From fe491c2b5ed6adad342eceeb8d931321bb634226 Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Fri, 22 Sep 2023 10:54:49 +0100 Subject: [PATCH] [opengoal] make `none` a child of `object` (#3001) Previously, `object` and `none` were both top-level types. This made decompilation rather messy as they have no LCA and resulted in a lot of variables coming out as type `none` which is very very wrong and additionally there were plenty of casts to `object`. This changes it so `none` becomes a child of `object` (it is still represented by `NullType` which remains unusable in compilation). This change makes `object` the sole top-level type, and the type that can represent *any* GOAL object. I believe this matches the original GOAL built-in type structure. A function that has a return type of `object` can now return an integer or a `none` at the same time. However, keep in mind that the return value of `(none)` is still undefined, just as before. This also makes a cast to `object` meaningless in 90% of the situations it showed up in (as every single thing is already an `object`) and the decompiler will no longer emit them. Casts to `none` are also reduced. Yay! Additionally, state handlers also don't get the final `(none)` printed out anymore. The return type of a state handler is completely meaningless outside the event handler (which is return type `object` anyway) so there are no limitations on what the last form needs to be. I did this instead of making them return `object` to trick the decompiler into not trying to output a variable to be used as a return value (internally, in the decompiler they still have return type `none`, but they have `object` elsewhere). Fixes #1703 Fixes #830 Fixes #928 --- common/type_system/Type.cpp | 6 +- common/type_system/Type.h | 2 +- common/type_system/TypeSystem.cpp | 10 +- common/type_system/TypeSystem.h | 2 +- common/type_system/state.cpp | 4 +- decompiler/Function/Function.h | 1 + decompiler/IR2/Form.cpp | 2 +- decompiler/analysis/expression_build.cpp | 40 +- decompiler/analysis/find_defstates.cpp | 3 + decompiler/analysis/insert_lets.cpp | 9 +- decompiler/analysis/variable_naming.cpp | 57 +- decompiler/config/jak1/all-types.gc | 24 +- .../ntsc_v1/anonymous_function_types.jsonc | 6 +- decompiler/config/jak2/all-types.gc | 44 +- .../ntsc_v1/anonymous_function_types.jsonc | 66 +- goal_src/jak1/build/all_objs.json | 4 +- goal_src/jak1/engine/anim/aligner.gc | 35 +- goal_src/jak1/engine/anim/joint-exploder.gc | 5 +- goal_src/jak1/engine/anim/joint.gc | 2 +- goal_src/jak1/engine/camera/cam-combiner.gc | 263 +++-- goal_src/jak1/engine/camera/cam-layout.gc | 1 - goal_src/jak1/engine/camera/cam-master.gc | 164 ++-- goal_src/jak1/engine/camera/cam-states-dbg.gc | 25 +- goal_src/jak1/engine/camera/cam-states.gc | 132 +-- goal_src/jak1/engine/camera/camera.gc | 87 +- goal_src/jak1/engine/camera/pov-camera.gc | 52 +- goal_src/jak1/engine/common-obs/babak.gc | 10 +- goal_src/jak1/engine/common-obs/basebutton.gc | 52 +- goal_src/jak1/engine/common-obs/baseplat.gc | 48 +- .../jak1/engine/common-obs/collectables.gc | 313 +++--- goal_src/jak1/engine/common-obs/crates.gc | 82 +- .../jak1/engine/common-obs/dark-eco-pool.gc | 1 - .../jak1/engine/common-obs/generic-obs.gc | 628 ++++++------ goal_src/jak1/engine/common-obs/nav-enemy.gc | 146 +-- goal_src/jak1/engine/common-obs/orb-cache.gc | 12 +- .../jak1/engine/common-obs/plat-button.gc | 39 +- goal_src/jak1/engine/common-obs/plat-eco.gc | 17 +- goal_src/jak1/engine/common-obs/plat.gc | 6 - .../engine/common-obs/process-taskable.gc | 82 +- goal_src/jak1/engine/common-obs/rigid-body.gc | 4 - goal_src/jak1/engine/common-obs/ropebridge.gc | 56 +- goal_src/jak1/engine/common-obs/sharkey.gc | 24 +- goal_src/jak1/engine/common-obs/voicebox.gc | 16 +- goal_src/jak1/engine/common-obs/water-anim.gc | 32 +- goal_src/jak1/engine/common-obs/water.gc | 18 +- goal_src/jak1/engine/debug/anim-tester.gc | 6 - goal_src/jak1/engine/debug/default-menu.gc | 254 ++--- goal_src/jak1/engine/debug/part-tester.gc | 4 - goal_src/jak1/engine/debug/viewer.gc | 7 +- goal_src/jak1/engine/entity/ambient.gc | 84 +- goal_src/jak1/engine/entity/entity.gc | 29 +- goal_src/jak1/engine/game/game-h.gc | 19 +- goal_src/jak1/engine/game/game-save.gc | 28 +- goal_src/jak1/engine/game/projectiles.gc | 15 +- goal_src/jak1/engine/target/sidekick.gc | 12 +- goal_src/jak1/engine/target/target-death.gc | 79 +- goal_src/jak1/engine/target/target-handler.gc | 477 +++++---- goal_src/jak1/engine/target/target.gc | 114 +-- goal_src/jak1/engine/target/target2.gc | 178 +--- goal_src/jak1/engine/ui/hud.gc | 23 +- goal_src/jak1/engine/ui/progress/progress.gc | 199 ++-- goal_src/jak1/kernel/gkernel-h.gc | 10 +- goal_src/jak1/kernel/gkernel.gc | 18 +- goal_src/jak1/kernel/gstate.gc | 4 +- goal_src/jak1/levels/beach/beach-obs.gc | 95 +- goal_src/jak1/levels/beach/beach-part.gc | 1 - goal_src/jak1/levels/beach/beach-rocks.gc | 10 +- goal_src/jak1/levels/beach/bird-lady-beach.gc | 2 - goal_src/jak1/levels/beach/lurkercrab.gc | 22 +- goal_src/jak1/levels/beach/lurkerpuppy.gc | 8 - goal_src/jak1/levels/beach/lurkerworm.gc | 13 - goal_src/jak1/levels/beach/mayor.gc | 3 - goal_src/jak1/levels/beach/pelican.gc | 200 ++-- goal_src/jak1/levels/beach/sculptor.gc | 3 - goal_src/jak1/levels/beach/seagull.gc | 13 - .../jak1/levels/citadel/assistant-citadel.gc | 4 - goal_src/jak1/levels/citadel/citadel-obs.gc | 64 +- goal_src/jak1/levels/citadel/citadel-sages.gc | 81 +- .../jak1/levels/citadel/citb-drop-plat.gc | 51 +- goal_src/jak1/levels/citadel/citb-plat.gc | 55 +- .../jak1/levels/common/battlecontroller.gc | 10 +- goal_src/jak1/levels/common/blocking-plane.gc | 2 - goal_src/jak1/levels/common/launcherdoor.gc | 7 - goal_src/jak1/levels/darkcave/darkcave-obs.gc | 60 +- goal_src/jak1/levels/demo/demo-obs.gc | 5 - goal_src/jak1/levels/demo/static-screen.gc | 3 - goal_src/jak1/levels/finalboss/final-door.gc | 53 +- .../jak1/levels/finalboss/green-eco-lurker.gc | 20 +- goal_src/jak1/levels/finalboss/light-eco.gc | 25 +- .../jak1/levels/finalboss/robotboss-misc.gc | 120 +-- .../jak1/levels/finalboss/robotboss-weapon.gc | 35 +- goal_src/jak1/levels/finalboss/robotboss.gc | 188 ++-- .../jak1/levels/finalboss/sage-finalboss.gc | 28 +- .../levels/firecanyon/assistant-firecanyon.gc | 3 - .../jak1/levels/firecanyon/firecanyon-obs.gc | 47 +- goal_src/jak1/levels/flut_common/flutflut.gc | 75 +- .../jak1/levels/flut_common/target-flut.gc | 110 +-- goal_src/jak1/levels/intro/evilbro.gc | 4 - goal_src/jak1/levels/jungle/bouncer.gc | 22 +- goal_src/jak1/levels/jungle/darkvine.gc | 57 +- goal_src/jak1/levels/jungle/fisher.gc | 82 +- goal_src/jak1/levels/jungle/hopper.gc | 8 - .../jak1/levels/jungle/jungle-elevator.gc | 11 - goal_src/jak1/levels/jungle/jungle-mirrors.gc | 46 +- goal_src/jak1/levels/jungle/jungle-obs.gc | 110 +-- goal_src/jak1/levels/jungle/junglefish.gc | 14 +- goal_src/jak1/levels/jungle/junglesnake.gc | 18 - goal_src/jak1/levels/jungleb/aphid.gc | 8 +- goal_src/jak1/levels/jungleb/jungleb-obs.gc | 31 +- goal_src/jak1/levels/jungleb/plant-boss.gc | 141 +-- goal_src/jak1/levels/jungleb/plat-flip.gc | 23 +- .../levels/lavatube/assistant-lavatube.gc | 11 +- .../jak1/levels/lavatube/lavatube-energy.gc | 128 +-- goal_src/jak1/levels/lavatube/lavatube-obs.gc | 38 +- goal_src/jak1/levels/maincave/baby-spider.gc | 37 +- goal_src/jak1/levels/maincave/dark-crystal.gc | 9 +- .../jak1/levels/maincave/driller-lurker.gc | 22 - goal_src/jak1/levels/maincave/gnawer.gc | 103 +- goal_src/jak1/levels/maincave/maincave-obs.gc | 133 +-- .../jak1/levels/maincave/mother-spider-egg.gc | 51 +- .../levels/maincave/mother-spider-proj.gc | 2 - .../jak1/levels/maincave/mother-spider.gc | 38 - goal_src/jak1/levels/maincave/spiderwebs.gc | 3 - .../jak1/levels/misty/babak-with-cannon.gc | 17 - goal_src/jak1/levels/misty/balloonlurker.gc | 14 +- goal_src/jak1/levels/misty/bonelurker.gc | 136 ++- goal_src/jak1/levels/misty/misty-conveyor.gc | 53 +- goal_src/jak1/levels/misty/misty-obs.gc | 23 +- .../jak1/levels/misty/misty-teetertotter.gc | 77 +- goal_src/jak1/levels/misty/misty-warehouse.gc | 8 +- goal_src/jak1/levels/misty/mistycannon.gc | 75 +- goal_src/jak1/levels/misty/muse.gc | 11 - goal_src/jak1/levels/misty/quicksandlurker.gc | 30 +- goal_src/jak1/levels/misty/sidekick-human.gc | 9 +- goal_src/jak1/levels/ogre/flying-lurker.gc | 436 ++++---- goal_src/jak1/levels/ogre/ogre-obs.gc | 112 +-- goal_src/jak1/levels/ogre/ogreboss.gc | 129 +-- .../jak1/levels/racer_common/racer-states.gc | 90 +- goal_src/jak1/levels/racer_common/racer.gc | 99 +- goal_src/jak1/levels/robocave/cave-trap.gc | 19 +- goal_src/jak1/levels/robocave/spider-egg.gc | 61 +- .../levels/rolling/rolling-lightning-mole.gc | 69 +- goal_src/jak1/levels/rolling/rolling-obs.gc | 41 +- .../jak1/levels/rolling/rolling-race-ring.gc | 90 +- .../jak1/levels/rolling/rolling-robber.gc | 22 - goal_src/jak1/levels/snow/ice-cube.gc | 185 ++-- goal_src/jak1/levels/snow/snow-ball.gc | 33 +- goal_src/jak1/levels/snow/snow-bumper.gc | 15 +- goal_src/jak1/levels/snow/snow-bunny.gc | 32 - .../jak1/levels/snow/snow-flutflut-obs.gc | 183 ++-- goal_src/jak1/levels/snow/snow-obs.gc | 116 +-- goal_src/jak1/levels/snow/snow-ram-boss.gc | 57 +- goal_src/jak1/levels/snow/snow-ram.gc | 26 +- goal_src/jak1/levels/snow/target-ice.gc | 11 - goal_src/jak1/levels/snow/target-snowball.gc | 16 +- goal_src/jak1/levels/snow/yeti.gc | 15 - goal_src/jak1/levels/sunken/bully.gc | 207 ++-- goal_src/jak1/levels/sunken/double-lurker.gc | 38 +- .../jak1/levels/sunken/floating-launcher.gc | 4 - goal_src/jak1/levels/sunken/helix-water.gc | 52 +- goal_src/jak1/levels/sunken/orbit-plat.gc | 129 ++- goal_src/jak1/levels/sunken/puffer.gc | 79 +- goal_src/jak1/levels/sunken/qbert-plat.gc | 21 +- goal_src/jak1/levels/sunken/shover.gc | 11 +- .../jak1/levels/sunken/square-platform.gc | 87 +- goal_src/jak1/levels/sunken/steam-cap.gc | 2 - .../jak1/levels/sunken/sun-exit-chamber.gc | 50 +- goal_src/jak1/levels/sunken/sun-iris-door.gc | 49 +- goal_src/jak1/levels/sunken/sunken-fish.gc | 3 - goal_src/jak1/levels/sunken/sunken-obs.gc | 4 - .../jak1/levels/sunken/sunken-pipegame.gc | 14 +- goal_src/jak1/levels/sunken/sunken-water.gc | 9 +- goal_src/jak1/levels/sunken/target-tube.gc | 45 +- goal_src/jak1/levels/sunken/wall-plat.gc | 63 +- goal_src/jak1/levels/sunken/wedge-plats.gc | 72 +- goal_src/jak1/levels/sunken/whirlpool.gc | 2 - goal_src/jak1/levels/swamp/billy.gc | 63 +- goal_src/jak1/levels/swamp/kermit.gc | 39 +- goal_src/jak1/levels/swamp/swamp-bat.gc | 9 - goal_src/jak1/levels/swamp/swamp-obs.gc | 57 +- goal_src/jak1/levels/swamp/swamp-rat-nest.gc | 21 +- goal_src/jak1/levels/swamp/swamp-rat.gc | 25 +- goal_src/jak1/levels/title/title-obs.gc | 157 ++- goal_src/jak1/levels/training/training-obs.gc | 163 ++- goal_src/jak1/levels/village1/assistant.gc | 3 +- goal_src/jak1/levels/village1/explorer.gc | 2 - .../jak1/levels/village1/fishermans-boat.gc | 93 +- goal_src/jak1/levels/village1/sage.gc | 5 - .../levels/village1/sequence-a-village1.gc | 6 +- goal_src/jak1/levels/village1/village-obs.gc | 17 - goal_src/jak1/levels/village1/yakow.gc | 107 +- .../levels/village2/assistant-village2.gc | 13 +- .../jak1/levels/village2/flutflut-bluehut.gc | 3 - goal_src/jak1/levels/village2/gambler.gc | 2 - goal_src/jak1/levels/village2/sage-bluehut.gc | 3 - .../jak1/levels/village2/sunken-elevator.gc | 5 - goal_src/jak1/levels/village2/swamp-blimp.gc | 45 +- goal_src/jak1/levels/village2/village2-obs.gc | 94 +- goal_src/jak1/levels/village2/warrior.gc | 2 - .../levels/village3/assistant-village3.gc | 2 - goal_src/jak1/levels/village3/minecart.gc | 31 +- goal_src/jak1/levels/village3/miners.gc | 4 - .../jak1/levels/village3/sage-village3.gc | 3 - goal_src/jak1/levels/village3/village3-obs.gc | 32 +- goal_src/jak1/levels/village_common/oracle.gc | 3 - .../levels/village_common/villagep-obs.gc | 34 +- goal_src/jak2/build/all_objs.json | 2 +- goal_src/jak2/engine/ai/enemy-h.gc | 14 +- goal_src/jak2/engine/ai/enemy.gc | 684 ++++++------- goal_src/jak2/engine/ambient/ambient.gc | 4 - goal_src/jak2/engine/anim/fma-sphere.gc | 8 +- goal_src/jak2/engine/anim/joint-exploder.gc | 3 - goal_src/jak2/engine/anim/joint.gc | 2 +- goal_src/jak2/engine/camera/cam-combiner.gc | 236 +++-- goal_src/jak2/engine/camera/cam-layout.gc | 1 - goal_src/jak2/engine/camera/cam-master.gc | 626 ++++++------ goal_src/jak2/engine/camera/cam-states-dbg.gc | 34 +- goal_src/jak2/engine/camera/cam-states.gc | 478 ++++----- goal_src/jak2/engine/camera/camera.gc | 3 +- goal_src/jak2/engine/collide/pat-h.gc | 162 +-- goal_src/jak2/engine/common_objs/base-plat.gc | 48 +- .../jak2/engine/common_objs/basebutton.gc | 121 +-- .../jak2/engine/common_objs/blocking-plane.gc | 103 +- .../jak2/engine/common_objs/collectables.gc | 410 ++++---- goal_src/jak2/engine/common_objs/conveyor.gc | 3 - goal_src/jak2/engine/common_objs/crates.gc | 94 +- .../jak2/engine/common_objs/dark-eco-pool.gc | 1 - goal_src/jak2/engine/common_objs/elevator.gc | 287 +++--- .../jak2/engine/common_objs/generic-obs.gc | 927 +++++++++--------- goal_src/jak2/engine/common_objs/plat.gc | 17 +- .../jak2/engine/common_objs/projectile.gc | 10 - goal_src/jak2/engine/common_objs/voicebox.gc | 25 +- .../jak2/engine/common_objs/water-anim.gc | 172 ++-- goal_src/jak2/engine/debug/default-menu.gc | 5 +- goal_src/jak2/engine/debug/editable-player.gc | 431 ++++---- .../jak2/engine/debug/nav/nav-graph-editor.gc | 91 +- goal_src/jak2/engine/debug/part-tester.gc | 1 - goal_src/jak2/engine/debug/viewer.gc | 4 +- goal_src/jak2/engine/entity/entity.gc | 78 +- goal_src/jak2/engine/game/game-save.gc | 32 +- goal_src/jak2/engine/game/task/task-arrow.gc | 16 +- .../jak2/engine/game/task/task-control.gc | 46 +- goal_src/jak2/engine/gfx/mood/time-of-day.gc | 171 ++-- goal_src/jak2/engine/nav/nav-enemy.gc | 93 +- goal_src/jak2/engine/physics/rigid-body-h.gc | 2 +- .../jak2/engine/physics/rigid-body-queue.gc | 2 - goal_src/jak2/engine/physics/rigid-body.gc | 198 ++-- .../process-drawable/process-drawable.gc | 16 +- .../process-drawable/process-taskable.gc | 38 +- .../engine/process-drawable/simple-focus.gc | 19 +- .../process-drawable/simple-nav-sphere.gc | 18 +- goal_src/jak2/engine/scene/scene.gc | 12 +- .../jak2/engine/target/board/board-states.gc | 147 +-- .../jak2/engine/target/board/board-util.gc | 14 +- .../jak2/engine/target/board/target-board.gc | 309 +++--- .../jak2/engine/target/gun/gun-dark-shot.gc | 8 - .../jak2/engine/target/gun/gun-red-shot.gc | 3 - goal_src/jak2/engine/target/gun/gun-states.gc | 18 +- goal_src/jak2/engine/target/gun/gun-util.gc | 18 +- goal_src/jak2/engine/target/logic-target.gc | 4 +- .../jak2/engine/target/mech/grunt-mech.gc | 14 - .../jak2/engine/target/mech/mech-states.gc | 147 +-- goal_src/jak2/engine/target/mech/mech.gc | 127 ++- goal_src/jak2/engine/target/sidekick.gc | 11 +- goal_src/jak2/engine/target/target-carry.gc | 37 +- goal_src/jak2/engine/target/target-darkjak.gc | 43 +- goal_src/jak2/engine/target/target-death.gc | 111 +-- goal_src/jak2/engine/target/target-h.gc | 2 +- goal_src/jak2/engine/target/target-handler.gc | 685 +++++++------ goal_src/jak2/engine/target/target-part.gc | 2 +- goal_src/jak2/engine/target/target-swim.gc | 31 +- goal_src/jak2/engine/target/target-tube.gc | 49 +- .../jak2/engine/target/target-turret-shot.gc | 9 +- goal_src/jak2/engine/target/target-turret.gc | 272 +++-- goal_src/jak2/engine/target/target.gc | 162 +-- goal_src/jak2/engine/target/target2.gc | 260 ++--- goal_src/jak2/engine/ui/progress/progress.gc | 11 - goal_src/jak2/kernel/gkernel-h.gc | 10 +- goal_src/jak2/kernel/gkernel.gc | 2 +- goal_src/jak2/kernel/gstate.gc | 4 +- goal_src/jak2/levels/atoll/atoll-obs.gc | 125 +-- goal_src/jak2/levels/atoll/atoll-tank.gc | 2 - goal_src/jak2/levels/atoll/juicer.gc | 20 +- goal_src/jak2/levels/atoll/sniper.gc | 3 - .../jak2/levels/castle/boss/castle-baron.gc | 60 +- goal_src/jak2/levels/castle/castle-obs.gc | 355 +++---- goal_src/jak2/levels/castle/pad/caspad-obs.gc | 4 - .../jak2/levels/castle/roboguard-level.gc | 27 - goal_src/jak2/levels/city/bombbot/bombbot.gc | 12 - .../levels/city/burning-bush/ctywide-bbush.gc | 14 +- .../jak2/levels/city/common/pilot-states.gc | 44 +- .../jak2/levels/city/common/searchlight.gc | 1 - .../jak2/levels/city/common/target-pilot.gc | 257 +++-- goal_src/jak2/levels/city/ctyport-obs.gc | 11 - goal_src/jak2/levels/city/ctywide-obs.gc | 582 +++++------ goal_src/jak2/levels/city/ctywide-scenes.gc | 84 +- goal_src/jak2/levels/city/farm/ctyfarm-obs.gc | 53 +- goal_src/jak2/levels/city/farm/yakow.gc | 8 - .../levels/city/generic/neon-praxis-part.gc | 1 - .../city/kiddogescort/crocesc-states.gc | 38 - .../jak2/levels/city/kiddogescort/crocesc.gc | 4 +- .../levels/city/kiddogescort/kidesc-states.gc | 41 - .../jak2/levels/city/kiddogescort/kidesc.gc | 4 +- .../levels/city/market/ashelin/ctyasha-obs.gc | 22 +- .../jak2/levels/city/market/ctymark-obs.gc | 12 +- .../levels/city/meet-brutter/meet-brutter.gc | 191 ++-- .../jak2/levels/city/onintent/onin-game.gc | 28 +- .../levels/city/oracle/oracle-training.gc | 23 +- .../jak2/levels/city/package/delivery-task.gc | 2 - .../jak2/levels/city/palace/ctypal-obs.gc | 3 - .../jak2/levels/city/port/ctyport-part.gc | 3 - .../jak2/levels/city/port/portrun/portrun.gc | 26 +- .../jak2/levels/city/port/race/errol-chal.gc | 114 +-- goal_src/jak2/levels/city/protect/protect.gc | 2 - .../jak2/levels/city/sack/collection-task.gc | 5 +- goal_src/jak2/levels/city/shuttle/shuttle.gc | 47 +- .../jak2/levels/city/slums/kor/kid-states.gc | 25 - goal_src/jak2/levels/city/slums/kor/kid.gc | 4 +- .../jak2/levels/city/slums/kor/kor-states.gc | 25 - goal_src/jak2/levels/city/slums/kor/kor.gc | 4 +- .../jak2/levels/city/slums/neon-baron-part.gc | 2 - .../city/traffic/citizen/citizen-chick.gc | 4 - .../city/traffic/citizen/citizen-enemy.gc | 6 - .../city/traffic/citizen/citizen-fat.gc | 5 - .../city/traffic/citizen/citizen-norm.gc | 7 - .../levels/city/traffic/citizen/citizen.gc | 188 ++-- .../levels/city/traffic/citizen/civilian.gc | 365 +++---- .../jak2/levels/city/traffic/citizen/guard.gc | 406 ++++---- .../city/traffic/citizen/metalhead-flitter.gc | 24 - .../city/traffic/citizen/metalhead-grunt.gc | 20 +- .../traffic/citizen/metalhead-predator.gc | 13 - .../levels/city/traffic/traffic-manager.gc | 3 - .../levels/city/traffic/vehicle/transport.gc | 12 - .../city/traffic/vehicle/vehicle-guard.gc | 11 +- .../city/traffic/vehicle/vehicle-rider.gc | 37 +- .../city/traffic/vehicle/vehicle-states.gc | 45 +- .../levels/city/traffic/vehicle/vehicle.gc | 183 ++-- .../jak2/levels/city/vinroom/vinroom-obs.gc | 6 - .../levels/common/ai/ashelin/ash-states.gc | 43 - goal_src/jak2/levels/common/ai/ashelin/ash.gc | 2 - goal_src/jak2/levels/common/ai/bot-states.gc | 16 - goal_src/jak2/levels/common/ai/bot.gc | 378 ++++--- goal_src/jak2/levels/common/ai/halt/hal.gc | 180 ++-- .../levels/common/ai/ruffian/ruf-states.gc | 36 - .../jak2/levels/common/ai/sig/sig-states.gc | 78 -- goal_src/jak2/levels/common/ai/sig/sig.gc | 36 +- goal_src/jak2/levels/common/airlock.gc | 94 +- goal_src/jak2/levels/common/battle.gc | 8 - goal_src/jak2/levels/common/elec-gate.gc | 16 +- .../common/enemy/amphibian/amphibian.gc | 39 +- goal_src/jak2/levels/common/enemy/bouncer.gc | 161 ++- .../jak2/levels/common/enemy/centurion.gc | 17 - goal_src/jak2/levels/common/enemy/flitter.gc | 26 +- .../jak2/levels/common/enemy/fodder/fodder.gc | 11 +- .../jak2/levels/common/enemy/grenadier.gc | 27 +- goal_src/jak2/levels/common/enemy/grunt.gc | 23 +- .../enemy/guards/crimson-guard-level.gc | 169 +--- .../common/enemy/guards/guard-conversation.gc | 34 +- .../common/enemy/guards/transport-level.gc | 11 - goal_src/jak2/levels/common/enemy/hopper.gc | 14 - .../common/enemy/hover/crimson-guard-hover.gc | 37 +- .../jak2/levels/common/enemy/hover/flamer.gc | 37 +- .../common/enemy/hover/hover-enemy-battle.gc | 32 +- .../levels/common/enemy/hover/hover-enemy.gc | 22 +- .../common/enemy/hover/hover-formation.gc | 93 +- .../common/enemy/hover/hover-nav-control.gc | 1 - .../jak2/levels/common/enemy/hover/wasp.gc | 53 +- .../jak2/levels/common/enemy/metalmonk.gc | 17 - goal_src/jak2/levels/common/enemy/spyder.gc | 36 +- .../levels/common/entities/com-elevator.gc | 7 - .../entities/cty-guard-turret-button.gc | 3 - .../common/entities/fort-floor-spike.gc | 71 +- .../jak2/levels/common/entities/gun-buoy.gc | 35 +- .../jak2/levels/common/entities/spydroid.gc | 15 - .../jak2/levels/common/guard-projectile.gc | 20 +- .../levels/common/metalhead-projectile.gc | 8 +- .../jak2/levels/common/race/race-manager.gc | 8 - goal_src/jak2/levels/common/race/race-obs.gc | 24 +- .../jak2/levels/common/race/vehicle-racer.gc | 237 ++--- goal_src/jak2/levels/common/scene-actor.gc | 2 - goal_src/jak2/levels/common/scene-looper.gc | 2 - goal_src/jak2/levels/common/warp-gate.gc | 55 +- goal_src/jak2/levels/consite/consite-obs.gc | 3 - goal_src/jak2/levels/demo/demo-obs.gc | 34 +- goal_src/jak2/levels/dig/dig-digger.gc | 93 +- goal_src/jak2/levels/dig/dig-obs.gc | 29 +- goal_src/jak2/levels/dig/dig1-obs.gc | 13 +- goal_src/jak2/levels/dig/dig2-obs.gc | 1 - goal_src/jak2/levels/dig/dig3-obs.gc | 70 +- goal_src/jak2/levels/drill/drill-baron.gc | 46 +- .../jak2/levels/drill/drill-mech-master.gc | 12 +- goal_src/jak2/levels/drill/drill-obs.gc | 327 +++--- goal_src/jak2/levels/drill/drill-obs2.gc | 63 +- goal_src/jak2/levels/drill/drill-panel.gc | 13 +- goal_src/jak2/levels/drill/drill-spool.gc | 18 +- goal_src/jak2/levels/drill/drillmid-obs.gc | 6 - goal_src/jak2/levels/drill/ginsu.gc | 20 - goal_src/jak2/levels/forest/fish.gc | 6 +- goal_src/jak2/levels/forest/forest-obs.gc | 35 +- goal_src/jak2/levels/forest/pegasus.gc | 18 - goal_src/jak2/levels/forest/predator.gc | 25 - goal_src/jak2/levels/forest/wren.gc | 17 - .../jak2/levels/fortress/dump/fordumpa-obs.gc | 17 +- .../jak2/levels/fortress/dump/fordumpb-obs.gc | 9 +- .../jak2/levels/fortress/dump/fordumpc-obs.gc | 49 +- .../fortress/dump/fort-robotank-turret.gc | 32 +- .../levels/fortress/dump/fort-robotank.gc | 175 ++-- .../jak2/levels/fortress/exit/forexita-obs.gc | 11 +- goal_src/jak2/levels/fortress/fort-turret.gc | 13 - goal_src/jak2/levels/fortress/fortress-obs.gc | 19 +- .../jak2/levels/fortress/prison/prison-obs.gc | 252 +++-- .../levels/fortress/rescue/forresca-obs.gc | 25 +- .../levels/fortress/rescue/forrescb-obs.gc | 31 +- goal_src/jak2/levels/gungame/gun-dummy.gc | 125 ++- goal_src/jak2/levels/gungame/gungame-obs.gc | 167 ++-- goal_src/jak2/levels/hideout/hideout-obs.gc | 1 - goal_src/jak2/levels/hiphog/hiphog-scenes.gc | 3 - goal_src/jak2/levels/hiphog/whack.gc | 46 +- goal_src/jak2/levels/intro/intro-obs.gc | 24 +- .../jak2/levels/mountain/canyon/mincan-obs.gc | 10 - goal_src/jak2/levels/mountain/mountain-obs.gc | 127 +-- .../jak2/levels/mountain/mountain-obs2.gc | 128 ++- .../jak2/levels/mountain/mountain-scenes.gc | 40 +- goal_src/jak2/levels/mountain/rhino-wall.gc | 7 +- goal_src/jak2/levels/mountain/rhino.gc | 423 ++++---- .../jak2/levels/nest/boss/metalkor-extras.gc | 298 +++--- .../jak2/levels/nest/boss/metalkor-setup.gc | 21 +- .../jak2/levels/nest/boss/metalkor-states.gc | 646 ++++++------ .../jak2/levels/nest/boss/nestb-scenes.gc | 3 +- goal_src/jak2/levels/nest/flying-spider.gc | 28 +- goal_src/jak2/levels/nest/mammoth.gc | 29 +- goal_src/jak2/levels/nest/mantis.gc | 27 - goal_src/jak2/levels/nest/nest-obs.gc | 14 +- goal_src/jak2/levels/nest/nest-scenes.gc | 3 - .../jak2/levels/palace/boss/squid-extras.gc | 73 +- .../jak2/levels/palace/boss/squid-states.gc | 49 - .../jak2/levels/palace/cable/palcab-obs.gc | 115 +-- goal_src/jak2/levels/palace/pal-obs.gc | 78 +- .../jak2/levels/palace/roof/palroof-obs.gc | 9 +- .../levels/palace/throne/palace-scenes.gc | 1 - goal_src/jak2/levels/ruins/breakable-wall.gc | 15 +- goal_src/jak2/levels/ruins/mechtest-obs.gc | 74 +- goal_src/jak2/levels/ruins/pillar-collapse.gc | 18 +- goal_src/jak2/levels/ruins/rapid-gunner.gc | 38 +- goal_src/jak2/levels/ruins/ruins-obs.gc | 13 +- goal_src/jak2/levels/ruins/ruins-scenes.gc | 29 +- goal_src/jak2/levels/sewer/escort/grim.gc | 1 - .../jak2/levels/sewer/escort/jinx-bomb.gc | 8 +- .../jak2/levels/sewer/escort/jinx-states.gc | 13 - goal_src/jak2/levels/sewer/escort/mog.gc | 1 - goal_src/jak2/levels/sewer/gator.gc | 12 - goal_src/jak2/levels/sewer/hosehead-fake.gc | 4 - goal_src/jak2/levels/sewer/hosehead.gc | 39 - goal_src/jak2/levels/sewer/sew-gunturret.gc | 7 - goal_src/jak2/levels/sewer/sewer-obs.gc | 137 ++- goal_src/jak2/levels/sewer/sewer-obs2.gc | 42 +- .../jak2/levels/stadium/skate/skatea-obs.gc | 94 +- goal_src/jak2/levels/stadium/stadium-obs.gc | 158 ++- .../jak2/levels/stadium/stadium-race-obs.gc | 20 +- .../jak2/levels/stadium/stadium-scenes.gc | 2 +- goal_src/jak2/levels/strip/chaincrate.gc | 2 - goal_src/jak2/levels/strip/strip-drop.gc | 65 +- goal_src/jak2/levels/strip/strip-obs.gc | 177 ++-- goal_src/jak2/levels/strip/strip-rescue.gc | 3 - goal_src/jak2/levels/title/title-obs.gc | 38 +- goal_src/jak2/levels/tomb/monster-frog.gc | 15 - goal_src/jak2/levels/tomb/target-indax.gc | 36 - goal_src/jak2/levels/tomb/tomb-baby-spider.gc | 10 - goal_src/jak2/levels/tomb/tomb-beetle.gc | 28 +- goal_src/jak2/levels/tomb/tomb-boulder.gc | 62 +- goal_src/jak2/levels/tomb/tomb-obs.gc | 114 +-- goal_src/jak2/levels/tomb/tomb-water.gc | 518 +++++----- goal_src/jak2/levels/tomb/widow-baron.gc | 341 ++++--- goal_src/jak2/levels/tomb/widow-extras.gc | 242 ++--- .../jak2/levels/tomb/widow-more-extras.gc | 15 +- goal_src/jak2/levels/under/centipede.gc | 30 - goal_src/jak2/levels/under/jellyfish.gc | 23 - goal_src/jak2/levels/under/pipe-grunt.gc | 5 - goal_src/jak2/levels/under/sig5-course.gc | 4 - goal_src/jak2/levels/under/under-laser.gc | 7 - goal_src/jak2/levels/under/under-obs.gc | 67 +- .../jak2/levels/under/under-shoot-block.gc | 29 - goal_src/jak2/levels/under/under-sig-obs.gc | 239 ++--- goal_src/jak2/levels/under/underb-master.gc | 50 +- goal_src/jak2/pc/damage-number.gc | 7 +- goal_src/jak2/pc/debug/anim-tester-x.gc | 2 +- goal_src/jak2/pc/debug/vag-player.gc | 6 +- goal_src/jak2/pc/subtitle2.gc | 10 +- goalc/compiler/Env.cpp | 2 +- goalc/compiler/compilation/ControlFlow.cpp | 25 +- goalc/compiler/compilation/Define.cpp | 8 +- goalc/compiler/compilation/Function.cpp | 5 +- goalc/compiler/compilation/Type.cpp | 12 +- .../reference/jak1/decompiler-macros.gc | 19 +- .../reference/jak1/engine/anim/aligner_REF.gc | 2 +- .../jak1/engine/anim/joint-exploder_REF.gc | 3 - .../reference/jak1/engine/anim/joint_REF.gc | 4 +- .../jak1/engine/camera/cam-combiner_REF.gc | 263 +++-- .../jak1/engine/camera/cam-layout_REF.gc | 1 - .../jak1/engine/camera/cam-master_REF.gc | 12 +- .../jak1/engine/camera/cam-states-dbg_REF.gc | 25 +- .../jak1/engine/camera/cam-states_REF.gc | 128 +-- .../jak1/engine/camera/camera_REF.gc | 82 +- .../jak1/engine/camera/pov-camera_REF.gc | 49 +- .../jak1/engine/common-obs/babak_REF.gc | 5 - .../jak1/engine/common-obs/basebutton_REF.gc | 52 +- .../jak1/engine/common-obs/baseplat_REF.gc | 48 +- .../engine/common-obs/collectables_REF.gc | 312 +++--- .../jak1/engine/common-obs/crates_REF.gc | 70 +- .../engine/common-obs/dark-eco-pool_REF.gc | 1 - .../jak1/engine/common-obs/generic-obs_REF.gc | 626 ++++++------ .../jak1/engine/common-obs/nav-enemy_REF.gc | 149 +-- .../jak1/engine/common-obs/orb-cache_REF.gc | 11 +- .../jak1/engine/common-obs/plat-button_REF.gc | 38 +- .../jak1/engine/common-obs/plat-eco_REF.gc | 16 +- .../jak1/engine/common-obs/plat_REF.gc | 5 - .../engine/common-obs/process-taskable_REF.gc | 84 +- .../jak1/engine/common-obs/rigid-body_REF.gc | 4 - .../jak1/engine/common-obs/ropebridge_REF.gc | 55 +- .../jak1/engine/common-obs/sharkey_REF.gc | 23 +- .../jak1/engine/common-obs/voicebox_REF.gc | 9 +- .../jak1/engine/common-obs/water-anim_REF.gc | 31 +- .../jak1/engine/common-obs/water_REF.gc | 16 +- .../jak1/engine/debug/anim-tester_REF.gc | 7 +- .../jak1/engine/debug/default-menu_REF.gc | 96 +- .../jak1/engine/debug/part-tester_REF.gc | 1 - .../reference/jak1/engine/debug/viewer_REF.gc | 3 +- .../jak1/engine/draw/process-drawable_REF.gc | 4 +- .../jak1/engine/entity/ambient_REF.gc | 80 +- .../jak1/engine/entity/entity_REF.gc | 30 +- .../jak1/engine/game/game-save_REF.gc | 28 +- .../jak1/engine/game/projectiles_REF.gc | 15 +- .../jak1/engine/gfx/mood/time-of-day_REF.gc | 1 - .../jak1/engine/target/sidekick_REF.gc | 11 +- .../jak1/engine/target/target-death_REF.gc | 7 - .../jak1/engine/target/target-handler_REF.gc | 478 +++++---- .../jak1/engine/target/target2_REF.gc | 178 +--- .../jak1/engine/target/target_REF.gc | 111 +-- .../reference/jak1/engine/ui/hud_REF.gc | 19 +- .../jak1/engine/ui/progress/progress_REF.gc | 325 +++--- .../reference/jak1/kernel/gkernel-h_REF.gc | 8 +- .../reference/jak1/kernel/gkernel_REF.gc | 2 +- .../reference/jak1/kernel/gstate_REF.gc | 4 +- .../jak1/levels/beach/beach-obs_REF.gc | 94 +- .../jak1/levels/beach/beach-part_REF.gc | 1 - .../jak1/levels/beach/beach-rocks_REF.gc | 9 +- .../jak1/levels/beach/bird-lady-beach_REF.gc | 1 - .../jak1/levels/beach/lurkercrab_REF.gc | 21 +- .../jak1/levels/beach/lurkerpuppy_REF.gc | 7 - .../jak1/levels/beach/lurkerworm_REF.gc | 13 - .../reference/jak1/levels/beach/mayor_REF.gc | 3 +- .../jak1/levels/beach/pelican_REF.gc | 199 ++-- .../jak1/levels/beach/sculptor_REF.gc | 3 +- .../jak1/levels/beach/seagull_REF.gc | 12 - .../levels/citadel/assistant-citadel_REF.gc | 3 - .../jak1/levels/citadel/citadel-obs_REF.gc | 63 +- .../jak1/levels/citadel/citadel-sages_REF.gc | 84 +- .../jak1/levels/citadel/citb-drop-plat_REF.gc | 50 +- .../jak1/levels/citadel/citb-plat_REF.gc | 55 +- .../levels/common/battlecontroller_REF.gc | 10 +- .../jak1/levels/common/blocking-plane_REF.gc | 1 - .../jak1/levels/common/launcherdoor_REF.gc | 2 - .../jak1/levels/darkcave/darkcave-obs_REF.gc | 43 +- .../jak1/levels/demo/demo-obs_REF.gc | 1 - .../jak1/levels/demo/static-screen_REF.gc | 3 - .../jak1/levels/finalboss/final-door_REF.gc | 52 +- .../levels/finalboss/green-eco-lurker_REF.gc | 19 +- .../jak1/levels/finalboss/light-eco_REF.gc | 17 - .../levels/finalboss/robotboss-misc_REF.gc | 120 +-- .../levels/finalboss/robotboss-weapon_REF.gc | 34 +- .../jak1/levels/finalboss/robotboss_REF.gc | 188 ++-- .../levels/finalboss/sage-finalboss_REF.gc | 27 +- .../firecanyon/assistant-firecanyon_REF.gc | 2 - .../levels/firecanyon/firecanyon-obs_REF.gc | 48 +- .../jak1/levels/flut_common/flutflut_REF.gc | 58 +- .../levels/flut_common/target-flut_REF.gc | 110 +-- .../jak1/levels/intro/evilbro_REF.gc | 3 - .../jak1/levels/jungle/bouncer_REF.gc | 15 +- .../jak1/levels/jungle/darkvine_REF.gc | 58 +- .../jak1/levels/jungle/fisher_REF.gc | 84 +- .../jak1/levels/jungle/hopper_REF.gc | 7 - .../jak1/levels/jungle/jungle-elevator_REF.gc | 7 - .../jak1/levels/jungle/jungle-mirrors_REF.gc | 46 +- .../jak1/levels/jungle/jungle-obs_REF.gc | 109 +- .../jak1/levels/jungle/junglefish_REF.gc | 9 - .../jak1/levels/jungle/junglesnake_REF.gc | 17 - .../jak1/levels/jungleb/aphid_REF.gc | 3 - .../jak1/levels/jungleb/jungleb-obs_REF.gc | 30 +- .../jak1/levels/jungleb/plant-boss_REF.gc | 138 +-- .../jak1/levels/jungleb/plat-flip_REF.gc | 22 +- .../levels/lavatube/assistant-lavatube_REF.gc | 2 - .../levels/lavatube/lavatube-energy_REF.gc | 127 +-- .../jak1/levels/lavatube/lavatube-obs_REF.gc | 37 +- .../jak1/levels/maincave/baby-spider_REF.gc | 37 +- .../jak1/levels/maincave/dark-crystal_REF.gc | 8 +- .../levels/maincave/driller-lurker_REF.gc | 21 - .../jak1/levels/maincave/gnawer_REF.gc | 102 +- .../jak1/levels/maincave/maincave-obs_REF.gc | 133 +-- .../levels/maincave/mother-spider-egg_REF.gc | 50 +- .../levels/maincave/mother-spider-proj_REF.gc | 2 - .../jak1/levels/maincave/mother-spider_REF.gc | 37 - .../jak1/levels/maincave/spiderwebs_REF.gc | 2 - .../levels/misty/babak-with-cannon_REF.gc | 17 - .../jak1/levels/misty/balloonlurker_REF.gc | 14 +- .../jak1/levels/misty/bonelurker_REF.gc | 131 ++- .../jak1/levels/misty/misty-conveyor_REF.gc | 52 +- .../jak1/levels/misty/misty-obs_REF.gc | 23 +- .../levels/misty/misty-teetertotter_REF.gc | 64 +- .../jak1/levels/misty/misty-warehouse_REF.gc | 7 +- .../jak1/levels/misty/mistycannon_REF.gc | 74 +- .../reference/jak1/levels/misty/muse_REF.gc | 11 - .../jak1/levels/misty/quicksandlurker_REF.gc | 29 +- .../jak1/levels/misty/sidekick-human_REF.gc | 8 +- .../jak1/levels/ogre/flying-lurker_REF.gc | 435 ++++---- .../jak1/levels/ogre/ogre-obs_REF.gc | 111 +-- .../jak1/levels/ogre/ogreboss_REF.gc | 126 +-- .../levels/racer_common/racer-states_REF.gc | 90 +- .../jak1/levels/racer_common/racer_REF.gc | 98 +- .../jak1/levels/robocave/cave-trap_REF.gc | 11 +- .../jak1/levels/robocave/spider-egg_REF.gc | 60 +- .../rolling/rolling-lightning-mole_REF.gc | 65 +- .../jak1/levels/rolling/rolling-obs_REF.gc | 40 +- .../levels/rolling/rolling-race-ring_REF.gc | 89 +- .../jak1/levels/rolling/rolling-robber_REF.gc | 21 - .../jak1/levels/snow/ice-cube_REF.gc | 187 ++-- .../jak1/levels/snow/snow-ball_REF.gc | 32 +- .../jak1/levels/snow/snow-bumper_REF.gc | 14 +- .../jak1/levels/snow/snow-bunny_REF.gc | 31 - .../jak1/levels/snow/snow-flutflut-obs_REF.gc | 182 ++-- .../jak1/levels/snow/snow-obs_REF.gc | 115 +-- .../jak1/levels/snow/snow-ram-boss_REF.gc | 56 +- .../jak1/levels/snow/snow-ram_REF.gc | 25 +- .../jak1/levels/snow/target-ice_REF.gc | 7 - .../jak1/levels/snow/target-snowball_REF.gc | 12 +- .../reference/jak1/levels/snow/yeti_REF.gc | 14 - .../reference/jak1/levels/sunken/bully_REF.gc | 207 ++-- .../jak1/levels/sunken/double-lurker_REF.gc | 37 +- .../levels/sunken/floating-launcher_REF.gc | 3 - .../jak1/levels/sunken/helix-water_REF.gc | 51 +- .../jak1/levels/sunken/orbit-plat_REF.gc | 129 ++- .../jak1/levels/sunken/puffer_REF.gc | 79 +- .../jak1/levels/sunken/qbert-plat_REF.gc | 20 +- .../jak1/levels/sunken/shover_REF.gc | 10 +- .../jak1/levels/sunken/square-platform_REF.gc | 86 +- .../jak1/levels/sunken/steam-cap_REF.gc | 1 - .../levels/sunken/sun-exit-chamber_REF.gc | 50 +- .../jak1/levels/sunken/sun-iris-door_REF.gc | 44 +- .../jak1/levels/sunken/sunken-fish_REF.gc | 2 - .../jak1/levels/sunken/sunken-obs_REF.gc | 3 - .../jak1/levels/sunken/sunken-pipegame_REF.gc | 14 +- .../jak1/levels/sunken/sunken-water_REF.gc | 9 +- .../jak1/levels/sunken/target-tube_REF.gc | 45 +- .../jak1/levels/sunken/wall-plat_REF.gc | 62 +- .../jak1/levels/sunken/wedge-plats_REF.gc | 71 +- .../jak1/levels/sunken/whirlpool_REF.gc | 1 - .../reference/jak1/levels/swamp/billy_REF.gc | 63 +- .../reference/jak1/levels/swamp/kermit_REF.gc | 39 +- .../jak1/levels/swamp/swamp-bat_REF.gc | 8 - .../jak1/levels/swamp/swamp-obs_REF.gc | 56 +- .../jak1/levels/swamp/swamp-rat-nest_REF.gc | 20 +- .../jak1/levels/swamp/swamp-rat_REF.gc | 25 +- .../jak1/levels/title/title-obs_REF.gc | 140 ++- .../jak1/levels/training/training-obs_REF.gc | 162 ++- .../jak1/levels/village1/assistant_REF.gc | 3 +- .../jak1/levels/village1/explorer_REF.gc | 2 +- .../levels/village1/fishermans-boat_REF.gc | 93 +- .../jak1/levels/village1/sage_REF.gc | 4 - .../village1/sequence-a-village1_REF.gc | 6 +- .../jak1/levels/village1/village-obs_REF.gc | 15 - .../jak1/levels/village1/yakow_REF.gc | 92 +- .../levels/village2/assistant-village2_REF.gc | 13 +- .../levels/village2/flutflut-bluehut_REF.gc | 2 - .../jak1/levels/village2/gambler_REF.gc | 1 - .../jak1/levels/village2/sage-bluehut_REF.gc | 2 - .../levels/village2/sunken-elevator_REF.gc | 4 - .../jak1/levels/village2/swamp-blimp_REF.gc | 43 +- .../jak1/levels/village2/village2-obs_REF.gc | 93 +- .../jak1/levels/village2/warrior_REF.gc | 2 +- .../levels/village3/assistant-village3_REF.gc | 2 +- .../jak1/levels/village3/minecart_REF.gc | 28 +- .../jak1/levels/village3/miners_REF.gc | 5 +- .../jak1/levels/village3/sage-village3_REF.gc | 3 +- .../jak1/levels/village3/village3-obs_REF.gc | 31 +- .../jak1/levels/village_common/oracle_REF.gc | 2 - .../levels/village_common/villagep-obs_REF.gc | 33 +- .../reference/jak2/engine/ai/enemy-h_REF.gc | 14 +- .../reference/jak2/engine/ai/enemy_REF.gc | 658 ++++++------- .../jak2/engine/ambient/ambient_REF.gc | 4 - .../jak2/engine/anim/fma-sphere_REF.gc | 8 +- .../jak2/engine/anim/joint-exploder_REF.gc | 3 - .../reference/jak2/engine/anim/joint_REF.gc | 2 +- .../jak2/engine/camera/cam-combiner_REF.gc | 236 +++-- .../jak2/engine/camera/cam-layout_REF.gc | 1 - .../jak2/engine/camera/cam-master_REF.gc | 626 ++++++------ .../jak2/engine/camera/cam-states-dbg_REF.gc | 38 +- .../jak2/engine/camera/cam-states_REF.gc | 478 ++++----- .../jak2/engine/camera/camera_REF.gc | 4 +- .../jak2/engine/common_objs/base-plat_REF.gc | 48 +- .../jak2/engine/common_objs/basebutton_REF.gc | 121 +-- .../engine/common_objs/blocking-plane_REF.gc | 103 +- .../engine/common_objs/collectables_REF.gc | 410 ++++---- .../jak2/engine/common_objs/conveyor_REF.gc | 3 - .../jak2/engine/common_objs/crates_REF.gc | 94 +- .../engine/common_objs/dark-eco-pool_REF.gc | 1 - .../jak2/engine/common_objs/elevator_REF.gc | 287 +++--- .../engine/common_objs/generic-obs_REF.gc | 923 +++++++++-------- .../jak2/engine/common_objs/plat_REF.gc | 17 +- .../jak2/engine/common_objs/projectile_REF.gc | 10 - .../jak2/engine/common_objs/voicebox_REF.gc | 25 +- .../jak2/engine/common_objs/water-anim_REF.gc | 171 ++-- .../jak2/engine/debug/default-menu_REF.gc | 5 +- .../jak2/engine/debug/editable-player_REF.gc | 431 ++++---- .../engine/debug/nav/nav-graph-editor_REF.gc | 33 +- .../jak2/engine/debug/part-tester_REF.gc | 1 - .../reference/jak2/engine/debug/viewer_REF.gc | 4 +- .../jak2/engine/entity/entity_REF.gc | 80 +- .../jak2/engine/game/game-info_REF.gc | 4 +- .../jak2/engine/game/game-save_REF.gc | 32 +- .../jak2/engine/game/task/task-arrow_REF.gc | 16 +- .../jak2/engine/game/task/task-control_REF.gc | 46 +- .../jak2/engine/gfx/foreground/bones_REF.gc | 8 +- .../jak2/engine/gfx/mood/time-of-day_REF.gc | 144 ++- .../jak2/engine/nav/nav-enemy_REF.gc | 93 +- .../jak2/engine/physics/rigid-body-h_REF.gc | 2 +- .../engine/physics/rigid-body-queue_REF.gc | 2 - .../jak2/engine/physics/rigid-body_REF.gc | 198 ++-- .../process-drawable/process-drawable_REF.gc | 16 +- .../process-drawable/process-taskable_REF.gc | 42 +- .../process-drawable/simple-focus_REF.gc | 19 +- .../process-drawable/simple-nav-sphere_REF.gc | 18 +- .../reference/jak2/engine/scene/scene_REF.gc | 12 +- .../engine/target/board/board-states_REF.gc | 147 +-- .../engine/target/board/board-util_REF.gc | 14 +- .../engine/target/board/target-board_REF.gc | 287 +++--- .../engine/target/gun/gun-dark-shot_REF.gc | 8 - .../engine/target/gun/gun-red-shot_REF.gc | 3 - .../jak2/engine/target/gun/gun-states_REF.gc | 17 +- .../jak2/engine/target/gun/gun-util_REF.gc | 18 +- .../jak2/engine/target/logic-target_REF.gc | 4 +- .../jak2/engine/target/mech/grunt-mech_REF.gc | 14 - .../engine/target/mech/mech-states_REF.gc | 147 +-- .../jak2/engine/target/mech/mech_REF.gc | 127 ++- .../jak2/engine/target/sidekick_REF.gc | 11 +- .../jak2/engine/target/target-carry_REF.gc | 37 +- .../jak2/engine/target/target-darkjak_REF.gc | 43 +- .../jak2/engine/target/target-death_REF.gc | 111 +-- .../jak2/engine/target/target-h_REF.gc | 2 +- .../jak2/engine/target/target-handler_REF.gc | 685 +++++++------ .../jak2/engine/target/target-part_REF.gc | 2 +- .../jak2/engine/target/target-swim_REF.gc | 31 +- .../jak2/engine/target/target-tube_REF.gc | 49 +- .../engine/target/target-turret-shot_REF.gc | 9 +- .../jak2/engine/target/target-turret_REF.gc | 272 +++-- .../jak2/engine/target/target2_REF.gc | 260 ++--- .../jak2/engine/target/target_REF.gc | 162 +-- .../jak2/engine/ui/progress/progress_REF.gc | 384 ++++---- .../reference/jak2/kernel/gkernel-h_REF.gc | 9 +- .../reference/jak2/kernel/gkernel_REF.gc | 13 +- .../reference/jak2/kernel/gstate_REF.gc | 4 +- .../jak2/levels/atoll/atoll-obs_REF.gc | 125 +-- .../jak2/levels/atoll/atoll-tank_REF.gc | 2 - .../reference/jak2/levels/atoll/juicer_REF.gc | 20 +- .../reference/jak2/levels/atoll/sniper_REF.gc | 3 - .../levels/castle/boss/castle-baron_REF.gc | 59 +- .../jak2/levels/castle/castle-obs_REF.gc | 355 +++---- .../jak2/levels/castle/pad/caspad-obs_REF.gc | 4 - .../jak2/levels/castle/roboguard-level_REF.gc | 27 - .../jak2/levels/city/bombbot/bombbot_REF.gc | 12 - .../city/burning-bush/ctywide-bbush_REF.gc | 14 +- .../levels/city/common/pilot-states_REF.gc | 43 +- .../levels/city/common/searchlight_REF.gc | 5 - .../levels/city/common/target-pilot_REF.gc | 246 +++-- .../jak2/levels/city/ctyport-obs_REF.gc | 11 - .../jak2/levels/city/ctywide-obs_REF.gc | 580 +++++------ .../jak2/levels/city/ctywide-scenes_REF.gc | 84 +- .../jak2/levels/city/farm/ctyfarm-obs_REF.gc | 53 +- .../jak2/levels/city/farm/yakow_REF.gc | 8 - .../city/generic/neon-praxis-part_REF.gc | 1 - .../city/kiddogescort/crocesc-states_REF.gc | 38 - .../levels/city/kiddogescort/crocesc_REF.gc | 3 +- .../city/kiddogescort/kidesc-states_REF.gc | 41 - .../levels/city/kiddogescort/kidesc_REF.gc | 3 +- .../city/market/ashelin/ctyasha-obs_REF.gc | 22 +- .../levels/city/market/ctymark-obs_REF.gc | 12 +- .../city/meet-brutter/meet-brutter_REF.gc | 195 ++-- .../levels/city/onintent/onin-game_REF.gc | 28 +- .../levels/city/oracle/oracle-training_REF.gc | 23 +- .../levels/city/package/delivery-task_REF.gc | 2 - .../jak2/levels/city/palace/ctypal-obs_REF.gc | 3 - .../jak2/levels/city/port/ctyport-part_REF.gc | 3 - .../levels/city/port/portrun/portrun_REF.gc | 26 +- .../levels/city/port/race/errol-chal_REF.gc | 114 +-- .../jak2/levels/city/protect/protect_REF.gc | 2 - .../levels/city/sack/collection-task_REF.gc | 5 +- .../jak2/levels/city/shuttle/shuttle_REF.gc | 51 +- .../levels/city/slums/kor/kid-states_REF.gc | 25 - .../jak2/levels/city/slums/kor/kid_REF.gc | 4 +- .../levels/city/slums/kor/kor-states_REF.gc | 25 - .../jak2/levels/city/slums/kor/kor_REF.gc | 4 +- .../levels/city/slums/neon-baron-part_REF.gc | 2 - .../city/traffic/citizen/citizen-chick_REF.gc | 4 - .../city/traffic/citizen/citizen-enemy_REF.gc | 6 - .../city/traffic/citizen/citizen-fat_REF.gc | 5 - .../city/traffic/citizen/citizen-norm_REF.gc | 7 - .../city/traffic/citizen/citizen_REF.gc | 188 ++-- .../city/traffic/citizen/civilian_REF.gc | 369 +++---- .../levels/city/traffic/citizen/guard_REF.gc | 407 ++++---- .../traffic/citizen/metalhead-flitter_REF.gc | 24 - .../traffic/citizen/metalhead-grunt_REF.gc | 20 +- .../traffic/citizen/metalhead-predator_REF.gc | 13 - .../city/traffic/traffic-manager_REF.gc | 3 - .../city/traffic/vehicle/transport_REF.gc | 12 - .../city/traffic/vehicle/vehicle-guard_REF.gc | 11 +- .../city/traffic/vehicle/vehicle-rider_REF.gc | 37 +- .../traffic/vehicle/vehicle-states_REF.gc | 45 +- .../city/traffic/vehicle/vehicle_REF.gc | 173 ++-- .../levels/city/vinroom/vinroom-obs_REF.gc | 6 - .../common/ai/ashelin/ash-states_REF.gc | 43 - .../jak2/levels/common/ai/ashelin/ash_REF.gc | 4 +- .../jak2/levels/common/ai/bot-states_REF.gc | 16 - .../jak2/levels/common/ai/bot_REF.gc | 378 ++++--- .../jak2/levels/common/ai/halt/hal_REF.gc | 180 ++-- .../common/ai/ruffian/ruf-states_REF.gc | 36 - .../levels/common/ai/sig/sig-states_REF.gc | 78 -- .../jak2/levels/common/ai/sig/sig_REF.gc | 33 +- .../jak2/levels/common/airlock_REF.gc | 94 +- .../jak2/levels/common/battle_REF.gc | 8 - .../jak2/levels/common/elec-gate_REF.gc | 16 +- .../common/enemy/amphibian/amphibian_REF.gc | 39 +- .../jak2/levels/common/enemy/bouncer_REF.gc | 161 ++- .../jak2/levels/common/enemy/centurion_REF.gc | 17 - .../jak2/levels/common/enemy/flitter_REF.gc | 26 +- .../levels/common/enemy/fodder/fodder_REF.gc | 11 +- .../jak2/levels/common/enemy/grenadier_REF.gc | 27 +- .../jak2/levels/common/enemy/grunt_REF.gc | 23 +- .../enemy/guards/crimson-guard-level_REF.gc | 169 +--- .../enemy/guards/guard-conversation_REF.gc | 34 +- .../enemy/guards/transport-level_REF.gc | 11 - .../jak2/levels/common/enemy/hopper_REF.gc | 13 - .../enemy/hover/crimson-guard-hover_REF.gc | 37 +- .../levels/common/enemy/hover/flamer_REF.gc | 37 +- .../enemy/hover/hover-enemy-battle_REF.gc | 29 +- .../common/enemy/hover/hover-enemy_REF.gc | 22 +- .../common/enemy/hover/hover-formation_REF.gc | 93 +- .../enemy/hover/hover-nav-control_REF.gc | 1 - .../levels/common/enemy/hover/wasp_REF.gc | 53 +- .../jak2/levels/common/enemy/metalmonk_REF.gc | 17 - .../jak2/levels/common/enemy/spyder_REF.gc | 37 +- .../common/entities/com-elevator_REF.gc | 7 - .../entities/cty-guard-turret-button_REF.gc | 7 +- .../common/entities/fort-floor-spike_REF.gc | 71 +- .../levels/common/entities/gun-buoy_REF.gc | 35 +- .../levels/common/entities/spydroid_REF.gc | 15 - .../levels/common/guard-projectile_REF.gc | 20 +- .../levels/common/metalhead-projectile_REF.gc | 8 +- .../levels/common/race/race-manager_REF.gc | 8 - .../jak2/levels/common/race/race-obs_REF.gc | 24 +- .../levels/common/race/vehicle-racer_REF.gc | 237 ++--- .../jak2/levels/common/scene-actor_REF.gc | 2 - .../jak2/levels/common/scene-looper_REF.gc | 2 - .../jak2/levels/common/warp-gate_REF.gc | 55 +- .../jak2/levels/consite/consite-obs_REF.gc | 7 - .../jak2/levels/demo/demo-obs_REF.gc | 34 +- .../jak2/levels/dig/dig-digger_REF.gc | 93 +- .../reference/jak2/levels/dig/dig-obs_REF.gc | 29 +- .../reference/jak2/levels/dig/dig1-obs_REF.gc | 13 +- .../reference/jak2/levels/dig/dig2-obs_REF.gc | 1 - .../reference/jak2/levels/dig/dig3-obs_REF.gc | 70 +- .../jak2/levels/drill/drill-baron_REF.gc | 46 +- .../levels/drill/drill-mech-master_REF.gc | 12 +- .../jak2/levels/drill/drill-obs2_REF.gc | 63 +- .../jak2/levels/drill/drill-obs_REF.gc | 327 +++--- .../jak2/levels/drill/drill-panel_REF.gc | 13 +- .../jak2/levels/drill/drill-spool_REF.gc | 16 +- .../jak2/levels/drill/drillmid-obs_REF.gc | 10 - .../reference/jak2/levels/drill/ginsu_REF.gc | 20 - .../reference/jak2/levels/forest/fish_REF.gc | 6 +- .../jak2/levels/forest/forest-obs_REF.gc | 35 +- .../jak2/levels/forest/pegasus_REF.gc | 18 - .../jak2/levels/forest/predator_REF.gc | 25 - .../reference/jak2/levels/forest/wren_REF.gc | 17 - .../levels/fortress/dump/fordumpa-obs_REF.gc | 15 +- .../levels/fortress/dump/fordumpb-obs_REF.gc | 14 +- .../levels/fortress/dump/fordumpc-obs_REF.gc | 49 +- .../fortress/dump/fort-robotank-turret_REF.gc | 32 +- .../levels/fortress/dump/fort-robotank_REF.gc | 175 ++-- .../levels/fortress/exit/forexita-obs_REF.gc | 11 +- .../jak2/levels/fortress/fort-turret_REF.gc | 13 - .../jak2/levels/fortress/fortress-obs_REF.gc | 19 +- .../levels/fortress/prison/prison-obs_REF.gc | 252 +++-- .../fortress/rescue/forresca-obs_REF.gc | 25 +- .../fortress/rescue/forrescb-obs_REF.gc | 31 +- .../jak2/levels/gungame/gun-dummy_REF.gc | 125 ++- .../jak2/levels/gungame/gungame-obs_REF.gc | 167 ++-- .../jak2/levels/hideout/hideout-obs_REF.gc | 1 - .../jak2/levels/hiphog/hiphog-obs_REF.gc | 4 - .../jak2/levels/hiphog/hiphog-scenes_REF.gc | 3 - .../reference/jak2/levels/hiphog/whack_REF.gc | 46 +- .../jak2/levels/intro/intro-obs_REF.gc | 24 +- .../levels/mountain/canyon/mincan-obs_REF.gc | 10 - .../jak2/levels/mountain/mountain-obs2_REF.gc | 128 ++- .../jak2/levels/mountain/mountain-obs_REF.gc | 127 +-- .../levels/mountain/mountain-scenes_REF.gc | 40 +- .../jak2/levels/mountain/rhino-wall_REF.gc | 5 +- .../jak2/levels/mountain/rhino_REF.gc | 423 ++++---- .../levels/nest/boss/metalkor-extras_REF.gc | 298 +++--- .../levels/nest/boss/metalkor-setup_REF.gc | 21 +- .../levels/nest/boss/metalkor-states_REF.gc | 622 ++++++------ .../jak2/levels/nest/boss/nestb-scenes_REF.gc | 3 +- .../jak2/levels/nest/flying-spider_REF.gc | 28 +- .../reference/jak2/levels/nest/mammoth_REF.gc | 29 +- .../reference/jak2/levels/nest/mantis_REF.gc | 27 - .../jak2/levels/nest/nest-obs_REF.gc | 14 +- .../jak2/levels/nest/nest-scenes_REF.gc | 3 - .../levels/palace/boss/squid-extras_REF.gc | 73 +- .../levels/palace/boss/squid-states_REF.gc | 49 - .../levels/palace/cable/palcab-obs_REF.gc | 115 +-- .../jak2/levels/palace/pal-obs_REF.gc | 78 +- .../levels/palace/roof/palroof-obs_REF.gc | 9 +- .../levels/palace/throne/palace-scenes_REF.gc | 1 - .../jak2/levels/ruins/breakable-wall_REF.gc | 15 +- .../jak2/levels/ruins/mechtest-obs_REF.gc | 74 +- .../jak2/levels/ruins/pillar-collapse_REF.gc | 17 +- .../jak2/levels/ruins/rapid-gunner_REF.gc | 38 +- .../jak2/levels/ruins/ruins-obs_REF.gc | 11 +- .../jak2/levels/ruins/ruins-scenes_REF.gc | 29 +- .../jak2/levels/sewer/escort/grim_REF.gc | 1 - .../jak2/levels/sewer/escort/jinx-bomb_REF.gc | 8 +- .../levels/sewer/escort/jinx-states_REF.gc | 13 - .../jak2/levels/sewer/escort/mog_REF.gc | 1 - .../reference/jak2/levels/sewer/gator_REF.gc | 12 - .../jak2/levels/sewer/hosehead-fake_REF.gc | 4 - .../jak2/levels/sewer/hosehead_REF.gc | 39 - .../jak2/levels/sewer/sew-gunturret_REF.gc | 7 - .../jak2/levels/sewer/sewer-obs2_REF.gc | 42 +- .../jak2/levels/sewer/sewer-obs_REF.gc | 136 ++- .../levels/stadium/skate/skatea-obs_REF.gc | 94 +- .../jak2/levels/stadium/stadium-obs_REF.gc | 158 ++- .../levels/stadium/stadium-race-obs_REF.gc | 20 +- .../jak2/levels/stadium/stadium-scenes_REF.gc | 2 +- .../jak2/levels/strip/chaincrate_REF.gc | 2 - .../jak2/levels/strip/strip-drop_REF.gc | 65 +- .../jak2/levels/strip/strip-obs_REF.gc | 177 ++-- .../jak2/levels/strip/strip-rescue_REF.gc | 3 - .../jak2/levels/title/title-obs_REF.gc | 38 +- .../jak2/levels/tomb/monster-frog_REF.gc | 15 - .../jak2/levels/tomb/target-indax_REF.gc | 36 - .../jak2/levels/tomb/tomb-baby-spider_REF.gc | 10 - .../jak2/levels/tomb/tomb-beetle_REF.gc | 28 +- .../jak2/levels/tomb/tomb-obs_REF.gc | 114 +-- .../jak2/levels/tomb/tomb-water_REF.gc | 518 +++++----- .../jak2/levels/tomb/widow-baron_REF.gc | 341 ++++--- .../jak2/levels/tomb/widow-extras_REF.gc | 242 ++--- .../jak2/levels/tomb/widow-more-extras_REF.gc | 15 +- .../jak2/levels/under/centipede_REF.gc | 30 - .../jak2/levels/under/jellyfish_REF.gc | 23 - .../jak2/levels/under/pipe-grunt_REF.gc | 5 - .../jak2/levels/under/sig5-course_REF.gc | 4 - .../jak2/levels/under/under-laser_REF.gc | 7 - .../jak2/levels/under/under-obs_REF.gc | 66 +- .../levels/under/under-shoot-block_REF.gc | 29 - .../jak2/levels/under/under-sig-obs_REF.gc | 239 ++--- .../jak2/levels/under/underb-master_REF.gc | 50 +- test/decompiler/test_FormExpressionBuild3.cpp | 2 +- 964 files changed, 24350 insertions(+), 38845 deletions(-) diff --git a/common/type_system/Type.cpp b/common/type_system/Type.cpp index 42464b5fda6..f6c383a8ad9 100644 --- a/common/type_system/Type.cpp +++ b/common/type_system/Type.cpp @@ -344,7 +344,7 @@ std::string Type::common_type_info_diff(const Type& other) const { * parents. */ bool Type::has_parent() const { - return m_name != "object" && !m_parent.empty(); + return m_name != "object"; } /*! @@ -485,7 +485,7 @@ std::string Type::diff(const Type& other) const { // Special Type for both "none" and "_type_" types // it's an error to try to do anything with Null. -NullType::NullType(std::string name) : Type("", std::move(name), false, 0) {} +NullType::NullType(std::string name) : Type("object", std::move(name), false, 0) {} bool NullType::is_reference() const { throw std::runtime_error("is_reference called on NullType"); @@ -496,7 +496,7 @@ int NullType::get_load_size() const { } bool NullType::get_load_signed() const { - throw std::runtime_error("get_load_size called on NullType"); + throw std::runtime_error("get_load_signed called on NullType"); } int NullType::get_size_in_memory() const { diff --git a/common/type_system/Type.h b/common/type_system/Type.h index f1158200ef8..5fe4dba0f84 100644 --- a/common/type_system/Type.h +++ b/common/type_system/Type.h @@ -133,7 +133,7 @@ class Type { bool m_new_method_info_defined = false; bool m_generate_inspect = true; - std::string m_parent; // the parent type (is empty for none and object) + std::string m_parent; // the parent type (is empty for object) std::string m_name; bool m_allow_in_runtime = true; std::string m_runtime_name; diff --git a/common/type_system/TypeSystem.cpp b/common/type_system/TypeSystem.cpp index 10ea6771a60..3dd4fd6f4b3 100644 --- a/common/type_system/TypeSystem.cpp +++ b/common/type_system/TypeSystem.cpp @@ -84,7 +84,7 @@ Type* TypeSystem::add_type(const std::string& name, std::unique_ptr type) } else { // newly defined! - // none/object get to skip these checks because they are roots. + // objects get to skip these checks because it is the root if (name != "object" && name != "none" && name != "_type_" && name != "_varargs_") { if (m_forward_declared_types.find(type->get_parent()) != m_forward_declared_types.end()) { throw_typesystem_error( @@ -1538,8 +1538,8 @@ void TypeSystem::builtin_structure_inherit(StructureType* st) { st->inherit(get_type_of_type(st->get_parent())); } -bool TypeSystem::tc(const TypeSpec& expected, const TypeSpec& actual) const { - return typecheck_and_throw(expected, actual, "", false, false); +bool TypeSystem::tc(const TypeSpec& less_specific, const TypeSpec& more_specific) const { + return typecheck_and_throw(less_specific, more_specific, "", false, false); } /*! @@ -1715,10 +1715,6 @@ std::string TypeSystem::lca_base(const std::string& a, const std::string& b) con return a; } - if (a == "none" || b == "none") { - return "none"; - } - auto a_up = get_path_up_tree(a); auto b_up = get_path_up_tree(b); diff --git a/common/type_system/TypeSystem.h b/common/type_system/TypeSystem.h index 2fc5f4d8998..d2db7c70a92 100644 --- a/common/type_system/TypeSystem.h +++ b/common/type_system/TypeSystem.h @@ -228,7 +228,7 @@ class TypeSystem { bool print_on_error = true, bool throw_on_error = true, bool allow_type_alias = false) const; - bool tc(const TypeSpec& expected, const TypeSpec& actual) const; + bool tc(const TypeSpec& less_specific, const TypeSpec& more_specific) const; std::vector get_path_up_tree(const std::string& type) const; int get_next_method_id(const Type* type) const; diff --git a/common/type_system/state.cpp b/common/type_system/state.cpp index 2cd40c95fc0..3abfe8e27b5 100644 --- a/common/type_system/state.cpp +++ b/common/type_system/state.cpp @@ -68,8 +68,6 @@ TypeSpec get_state_handler_type(StateHandler kind, const TypeSpec& state_type) { TypeSpec result; switch (kind) { case StateHandler::CODE: - result = state_to_go_function(state_type, TypeSpec("none")); - break; case StateHandler::ENTER: result = state_to_go_function(state_type, TypeSpec("none")); break; @@ -102,7 +100,7 @@ std::vector get_state_handler_arg_names(StateHandler kind) { case StateHandler::EXIT: return {}; case StateHandler::EVENT: - return {"proc", "arg1", "event-type", "event"}; + return {"proc", "argc", "message", "block"}; default: ASSERT(false); } diff --git a/decompiler/Function/Function.h b/decompiler/Function/Function.h index 158246c3b76..cece597db9b 100644 --- a/decompiler/Function/Function.h +++ b/decompiler/Function/Function.h @@ -188,6 +188,7 @@ class Function { std::string debug_form_string; bool print_debug_forms = false; bool expressions_succeeded = false; + bool skip_final_none = false; } ir2; std::optional mips2c_output; diff --git a/decompiler/IR2/Form.cpp b/decompiler/IR2/Form.cpp index 1c8cf90b99d..6b133a81ed5 100644 --- a/decompiler/IR2/Form.cpp +++ b/decompiler/IR2/Form.cpp @@ -2962,7 +2962,7 @@ goos::Object DefstateElement::to_form_internal(const Env& env) const { } //////////////////////////////// -// DefskelgroupElement +// WithDmaBufferAddBucketElement //////////////////////////////// WithDmaBufferAddBucketElement::WithDmaBufferAddBucketElement(RegisterAccess dma_buf, diff --git a/decompiler/analysis/expression_build.cpp b/decompiler/analysis/expression_build.cpp index 0a967db7634..99c397b1bbd 100644 --- a/decompiler/analysis/expression_build.cpp +++ b/decompiler/analysis/expression_build.cpp @@ -91,21 +91,31 @@ bool convert_to_expressions( needs_cast = true; } else { - bool found_early_return = false; - for (auto e : new_entries) { - e->apply([&](FormElement* elt) { - auto as_ret = dynamic_cast(elt); - if (as_ret) { - found_early_return = true; + // note : a return type of "object" will accept ANYTHING as a return value + // "object" is the parent type of everything, including "none" (as of sep 2023) + // if a function wants to return an object, we can safely discard the cast + // since there is no possible level of polymorphism at this highest level. + if (f.type.last_arg() != TypeSpec("object")) { + bool found_early_return = false; + for (auto e : new_entries) { + e->apply([&](FormElement* elt) { + auto as_ret = dynamic_cast(elt); + if (as_ret) { + found_early_return = true; + } + }); + if (found_early_return) { + break; } - }); - if (found_early_return) { - break; } - } - if (!found_early_return && f.type.last_arg() != return_type) { - needs_cast = true; + // the return value of this function is not an exact match + // we cast it to avoid complicated issues with polymorphism (e.g. methods) + // we don't run this if we find a (return statement because we do not handle + // type checking on those at the moment. + if (!found_early_return && f.type.last_arg() != return_type) { + needs_cast = true; + } } } @@ -124,8 +134,10 @@ bool convert_to_expressions( } else { // or just get all the expressions new_entries = stack.rewrite(pool, f.ir2.env); - new_entries.push_back( - pool.alloc_element(GenericOperator::make_fixed(FixedOperatorKind::NONE))); + if (!f.ir2.skip_final_none) { + new_entries.push_back(pool.alloc_element( + GenericOperator::make_fixed(FixedOperatorKind::NONE))); + } } // if we are a totally empty function, insert a placeholder so we don't have to handle diff --git a/decompiler/analysis/find_defstates.cpp b/decompiler/analysis/find_defstates.cpp index 3c369e3ba96..db431da6446 100644 --- a/decompiler/analysis/find_defstates.cpp +++ b/decompiler/analysis/find_defstates.cpp @@ -146,6 +146,9 @@ std::vector get_defstate_entries( // scary part - modify the function type! handler_func->type = get_state_handler_type(handler_kind, state_type); + // hack - lets pretend every handler (except event) returns none but remove the (none) at the + // end since the 'real' return type is object and thus anything is valid in the final form + handler_func->ir2.skip_final_none = true; } else if (handler_atom && handler_atom->is_sym_val()) { auto sym_type = env.dts->lookup_symbol_type(handler_atom->get_str()); auto expected_type = get_state_handler_type(handler_kind, state_type); diff --git a/decompiler/analysis/insert_lets.cpp b/decompiler/analysis/insert_lets.cpp index 893df30f0a3..b6554e2742e 100644 --- a/decompiler/analysis/insert_lets.cpp +++ b/decompiler/analysis/insert_lets.cpp @@ -1147,13 +1147,13 @@ FormElement* rewrite_as_case_with_else(LetElement* in, const Env& env, FormPool& return pool.alloc_element(in->entries().at(0).src, entries, cond->else_ir); } -bool var_equal(const Env& env, const RegisterAccess& a, std::optional b) { +bool var_equal(const Env& env, RegisterAccess a, std::optional b) { ASSERT(b); return env.get_variable_name_name_only(*b) == env.get_variable_name_name_only(a); } Form* match_ja_set(const Env& env, - const RegisterAccess& ch_var, + RegisterAccess ch_var, const std::string& field_name, int arr_idx, Form* in, @@ -1712,8 +1712,9 @@ FormElement* rewrite_attack_info(LetElement* in, const Env& env, FormPool& pool) enum AttackInfoFieldKind { DEFAULT, VECTOR, METERS, DEGREES }; const static std::map> possible_args_jak1 = { - {"vector", {1, VECTOR}}, {"mode", {5, DEFAULT}}, {"shove-back", {6, DEFAULT}}, - {"shove-up", {7, DEFAULT}}, {"control", {10, DEFAULT}}, {"angle", {11, DEFAULT}}, + {"vector", {1, VECTOR}}, {"attacker", {3, DEFAULT}}, {"mode", {5, DEFAULT}}, + {"shove-back", {6, DEFAULT}}, {"shove-up", {7, DEFAULT}}, {"control", {10, DEFAULT}}, + {"angle", {11, DEFAULT}}, }; const static std::map> possible_args_jak2 = { {"vector", {1, VECTOR}}, diff --git a/decompiler/analysis/variable_naming.cpp b/decompiler/analysis/variable_naming.cpp index 095db98e5d9..3c858bea5b5 100644 --- a/decompiler/analysis/variable_naming.cpp +++ b/decompiler/analysis/variable_naming.cpp @@ -655,34 +655,23 @@ namespace { TP_Type lca_for_var_types(const TP_Type& existing, const TP_Type& add, - const DecompilerTypeSystem& dts, - bool event_handler_hack) { + const DecompilerTypeSystem& dts) { bool changed; auto normal = dts.tp_lca(existing, add, &changed); - if (!event_handler_hack || normal.typespec().base_type() != "none") { - return normal; - } - if (existing.typespec().base_type() == "none") { - return add; - } else if (add.typespec().base_type() == "none") { - return existing; - } else { - return normal; - } + return normal; } void update_var_info(VariableNames::VarInfo* info, Register reg, const TypeState& ts, int var_id, - const DecompilerTypeSystem& dts, - bool event_handler_hack) { + const DecompilerTypeSystem& dts) { auto& type = ts.get(reg); if (info->initialized) { ASSERT(info->reg_id.id == var_id); ASSERT(info->reg_id.reg == reg); - info->type = lca_for_var_types(info->type, type, dts, event_handler_hack); + info->type = lca_for_var_types(info->type, type, dts); } else { info->reg_id.id = var_id; @@ -695,10 +684,9 @@ void update_var_info(VariableNames::VarInfo* info, bool merge_infos(VariableNames::VarInfo* info1, VariableNames::VarInfo* info2, - const DecompilerTypeSystem& dts, - bool event_handler_hack) { + const DecompilerTypeSystem& dts) { if (info1->initialized && info2->initialized) { - auto new_type = lca_for_var_types(info1->type, info2->type, dts, event_handler_hack); + auto new_type = lca_for_var_types(info1->type, info2->type, dts); info1->type = new_type; info2->type = new_type; @@ -710,13 +698,12 @@ bool merge_infos(VariableNames::VarInfo* info1, void merge_infos( std::unordered_map, Register::hash>& info1, std::unordered_map, Register::hash>& info2, - const DecompilerTypeSystem& dts, - bool event_handler_hack) { + const DecompilerTypeSystem& dts) { for (auto& [reg, infos] : info1) { auto other = info2.find(reg); if (other != info2.end()) { for (size_t i = 0; i < std::min(other->second.size(), infos.size()); i++) { - merge_infos(&infos.at(i), &other->second.at(i), dts, event_handler_hack); + merge_infos(&infos.at(i), &other->second.at(i), dts); } } } @@ -730,28 +717,6 @@ void merge_infos( * the none variables */ void SSA::make_vars(const Function& function, const DecompilerTypeSystem& dts) { - bool event_handler_hack = false; - - if (function.ir2.env.version == GameVersion::Jak2) { - event_handler_hack = function.guessed_name.is_event_handler() || - function.guessed_name.to_string() == "target-generic-event-handler" || - function.guessed_name.to_string() == "target-standard-event-handler" || - function.guessed_name.to_string() == "target-board-handler" || - function.guessed_name.to_string() == "(method 74 pegasus)" || - function.guessed_name.to_string() == "(method 74 crimson-guard-level)" || - function.guessed_name.to_string() == "widow-handler" || - function.guessed_name.to_string() == "(method 74 hal)" || - function.guessed_name.to_string() == "water-anim-event-handler" || - function.guessed_name.to_string() == "(method 74 civilian)" || - function.guessed_name.to_string() == "(method 74 crimson-guard)" || - function.guessed_name.to_string() == "metalkor-handler"; - } - - if (function.ir2.env.version == GameVersion::Jak1) { - event_handler_hack = function.guessed_name.is_event_handler() || - function.guessed_name.to_string() == "target-generic-event-handler"; - } - for (int block_id = 0; block_id < int(blocks.size()); block_id++) { const auto& block = blocks.at(block_id); const TypeState* init_types = &function.ir2.env.get_types_at_block_entry(block_id); @@ -766,13 +731,13 @@ void SSA::make_vars(const Function& function, const DecompilerTypeSystem& dts) { if (instr.dst.has_value()) { auto var_id = map.var_id(*instr.dst); auto* info = &program_write_vars[instr.dst->reg()].at(var_id); - update_var_info(info, instr.dst->reg(), *end_types, var_id, dts, event_handler_hack); + update_var_info(info, instr.dst->reg(), *end_types, var_id, dts); } for (auto& src : instr.src) { auto var_id = map.var_id(src); auto* info = &program_read_vars[src.reg()].at(var_id); - update_var_info(info, src.reg(), *init_types, var_id, dts, event_handler_hack); + update_var_info(info, src.reg(), *init_types, var_id, dts); } init_types = end_types; @@ -793,7 +758,7 @@ void SSA::make_vars(const Function& function, const DecompilerTypeSystem& dts) { } } - merge_infos(program_write_vars, program_read_vars, dts, event_handler_hack); + merge_infos(program_write_vars, program_read_vars, dts); // copy types from input argument coloring moves: for (auto& instr : blocks.at(0).ins) { diff --git a/decompiler/config/jak1/all-types.gc b/decompiler/config/jak1/all-types.gc index a0f5ebf0028..b35c12a37af 100644 --- a/decompiler/config/jak1/all-types.gc +++ b/decompiler/config/jak1/all-types.gc @@ -1858,10 +1858,10 @@ ) (deftype protect-frame (stack-frame) - ((exit (function none) :offset-assert 12) + ((exit (function object) :offset-assert 12) ) (:methods - (new (symbol type (function none)) protect-frame) + (new (symbol type (function object)) protect-frame) ) :method-count-assert 9 :size-assert #x10 @@ -1879,16 +1879,16 @@ (declare-type event-message-block structure) (deftype state (protect-frame) ((code function :offset-assert 16) - (trans (function none) :offset-assert 20) + (trans (function object) :offset-assert 20) (post function :offset-assert 24) (enter function :offset-assert 28) (event (function process int symbol event-message-block object) :offset-assert 32) ) (:methods (new (symbol type symbol function - (function none) + (function object) function - (function none) + (function object) (function process int symbol event-message-block object)) _type_ 0) ) :method-count-assert 9 @@ -16696,7 +16696,7 @@ (define-extern joint-control-channel-group-eval! (function joint-control-channel art-joint-anim (function joint-control-channel float float float) int)) (define-extern joint-control-channel-group! (function joint-control-channel art-joint-anim (function joint-control-channel float float float) int)) (define-extern joint-control-copy! (function joint-control joint-control joint-control)) -(define-extern joint-control-remap! (function joint-control art-group art-group pair int string object)) +(define-extern joint-control-remap! (function joint-control art-group art-group pair int string symbol)) (define-extern cspace<-cspace! (function cspace cspace matrix)) (define-extern cspace<-rot-yxy! (function cspace transform matrix)) ;; unused (define-extern cspace<-transform-yxy! (function cspace transform matrix)) ;; unused @@ -20562,7 +20562,7 @@ (define-extern rider-post (function int :behavior process-drawable)) (define-extern pusher-post (function int :behavior process-drawable)) (define-extern process-drawable-delay-player (function time-frame int :behavior process-drawable)) -(define-extern process-drawable-fuel-cell-handler (function process int symbol event-message-block none :behavior process-drawable)) +(define-extern process-drawable-fuel-cell-handler (function process int symbol event-message-block object :behavior process-drawable)) (define-extern process-drawable-birth-fuel-cell (function entity vector symbol none :behavior process-drawable)) (define-extern process-drawable-valid? (function process-drawable symbol)) @@ -22063,7 +22063,7 @@ (define-extern process-taskable-anim-loop (function none :behavior process-taskable)) (define-extern process-taskable-play-anim-enter (function symbol :behavior process-taskable)) (define-extern process-taskable-play-anim-exit (function none :behavior process-taskable)) -(define-extern process-taskable-hide-handler (function process int symbol event-message-block none :behavior process-taskable)) +(define-extern process-taskable-hide-handler (function process int symbol event-message-block object :behavior process-taskable)) (define-extern process-taskable-hide-enter (function int :behavior process-taskable)) ;; - Unknowns @@ -23386,7 +23386,7 @@ ;; - Functions (define-extern matrix-3x3-triple-transpose-product (function matrix matrix matrix matrix)) -(define-extern rigid-body-platform-event-handler (function process int symbol event-message-block vector :behavior rigid-body-platform)) +(define-extern rigid-body-platform-event-handler (function process int symbol event-message-block object :behavior rigid-body-platform)) (define-extern rigid-body-platform-post (function int :behavior rigid-body-platform)) ;; - Unknowns @@ -23627,9 +23627,9 @@ (define-extern nav-enemy-rnd-int-count (function int int)) (define-extern nav-enemy-rnd-float (function float)) (define-extern nav-enemy-rnd-percent? (function float symbol)) -(define-extern nav-enemy-default-event-handler (function process int symbol event-message-block none :behavior nav-enemy)) ;; TODO - last arg is definitely a vector...but also not? +(define-extern nav-enemy-default-event-handler (function process int symbol event-message-block object :behavior nav-enemy)) (define-extern nav-enemy-jump-event-handler (function process int symbol event-message-block object :behavior nav-enemy)) -(define-extern process-drawable-death-event-handler (function process int symbol event-message-block none :behavior process-drawable)) ;; First two args are unused +(define-extern process-drawable-death-event-handler (function process int symbol event-message-block object :behavior process-drawable)) (define-extern nav-enemy-patrol-post (function none :behavior nav-enemy)) (define-extern nav-enemy-chase-post (function none :behavior nav-enemy)) (define-extern nav-enemy-flee-post (function none :behavior nav-enemy)) @@ -26396,7 +26396,7 @@ (define-extern check-drop-level-lighteco-big-pops (function sparticle-system sparticle-cpuinfo vector none)) (define-extern check-drop-level-lighteco-pops (function sparticle-system sparticle-cpuinfo vector none)) (define-extern light-eco-child-default-event-handler (function process int symbol event-message-block object :behavior light-eco-child)) -(define-extern light-eco-mother-default-event-handler (function process int symbol event-message-block int :behavior light-eco-mother)) +(define-extern light-eco-mother-default-event-handler (function process int symbol event-message-block object :behavior light-eco-mother)) (define-extern light-eco-mother-init-by-other (function entity-actor vector none :behavior light-eco-mother)) ;; - Unknowns diff --git a/decompiler/config/jak1/ntsc_v1/anonymous_function_types.jsonc b/decompiler/config/jak1/ntsc_v1/anonymous_function_types.jsonc index 50f4d8ab121..1753ce992a0 100644 --- a/decompiler/config/jak1/ntsc_v1/anonymous_function_types.jsonc +++ b/decompiler/config/jak1/ntsc_v1/anonymous_function_types.jsonc @@ -564,10 +564,10 @@ [77, "(function symbol debug-menu-msg int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems [78, "(function symbol debug-menu-msg int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems [79, "(function symbol debug-menu-msg int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [80, "(function object)"], - [81, "(function object)"], + [80, "(function object object)"], + [81, "(function object object)"], [82, "(function symbol debug-menu-msg float float none)"], - [84, "(function symbol debug-menu-msg none)"], + [84, "(function symbol debug-menu-msg object)"], [88, "(function debug-menu debug-menu symbol)"], // not 100% sure about the debug-menu, but it has a string at offset 0 [89, "(function debug-menu debug-menu symbol)"], // not 100% sure about the debug-menu, but it has a string at offset 0 [90, "(function debug-menu debug-menu symbol)"] // not 100% sure about the debug-menu, but it has a string at offset 0 diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index 51755421a0f..4a2e33b455f 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -505,10 +505,10 @@ ) (deftype protect-frame (stack-frame) - ((exit (function none) :offset-assert 12) ;; guessed by decompiler + ((exit (function object) :offset-assert 12) ;; guessed by decompiler ) (:methods - (new (symbol type (function none)) protect-frame) + (new (symbol type (function object)) protect-frame) ) :method-count-assert 9 :size-assert #x10 @@ -526,16 +526,16 @@ (deftype state (protect-frame) ((code function :offset-assert 16) ;; guessed by decompiler - (trans (function none) :offset-assert 20) ;; guessed by decompiler + (trans (function object) :offset-assert 20) ;; guessed by decompiler (post function :offset-assert 24) ;; guessed by decompiler (enter function :offset-assert 28) ;; guessed by decompiler (event (function process int symbol event-message-block object) :offset-assert 32) ;; guessed by decompiler ) (:methods (new (symbol type symbol function - (function none) + (function object) function - (function none) + (function object) (function process int symbol event-message-block object)) _type_ 0) ) :method-count-assert 9 @@ -18755,7 +18755,7 @@ (target-board-jump meters meters symbol) target-board-jump-kick (target-board-pegasus handle) - (target-board-ride-edge symbol object object float) + (target-board-ride-edge symbol) target-board-stance (target-board-start object) (target-board-trickx float float symbol) @@ -23966,7 +23966,7 @@ (define-extern joint-control-channel-group-eval! (function joint-control-channel art-joint-anim (function joint-control-channel float float float float) int)) (define-extern joint-control-channel-group! (function joint-control-channel art-joint-anim (function joint-control-channel float float float float) int)) (define-extern joint-control-copy! (function joint-control joint-control joint-control)) -(define-extern joint-control-remap! (function joint-control art-group art-group pair int string object)) +(define-extern joint-control-remap! (function joint-control art-group art-group pair int string symbol)) (define-extern flatten-joint-control-to-spr (function joint-control int)) (define-extern matrix-from-joint-anim-frame (function joint-anim-compressed-control int int matrix)) (define-extern matrix-from-control-channel! (function matrix joint joint-control-channel matrix)) @@ -27733,7 +27733,7 @@ (define-extern cam-slave-init-vars (function none :behavior camera-slave)) (define-extern cam-slave-go (function (state camera-slave) none :behavior camera-slave)) (define-extern cam-slave-init (function (state camera-slave) entity none :behavior camera-slave)) -(define-extern cam-standard-event-handler (function process int symbol event-message-block none :behavior camera-slave)) +(define-extern cam-standard-event-handler (function process int symbol event-message-block object :behavior camera-slave)) (define-extern cam-curve-pos (function vector vector curve symbol vector :behavior camera-slave)) (define-extern cam-curve-setup (function vector none :behavior camera-slave)) (define-extern cam-calc-follow! (function cam-rotation-tracker vector symbol vector)) @@ -33297,15 +33297,15 @@ (enemy-method-63 (_type_ process-focusable enemy-aware) symbol 63) (enemy-method-64 (_type_) none 64) (enemy-method-65 (_type_) none 65) - (go-ambush (_type_) none 66) - (go-stare (_type_) none 67) - (go-stare2 (_type_) none 68) - (go-directed (_type_) none 69) - (go-hostile (_type_) none 70) - (go-flee (_type_) none 71) + (go-ambush (_type_) object 66) + (go-stare (_type_) object 67) + (go-stare2 (_type_) object 68) + (go-directed (_type_) object 69) + (go-hostile (_type_) object 70) + (go-flee (_type_) object 71) (react-to-focus "@TODO - flesh out docs" - (_type_) none 72) + (_type_) object 72) (kill-prefer-falling "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (_type_) object 73) @@ -34627,7 +34627,7 @@ ) ) -(define-extern simple-nav-sphere-event-handler (function process int symbol event-message-block none :behavior simple-nav-sphere)) +(define-extern simple-nav-sphere-event-handler (function process int symbol event-message-block object :behavior simple-nav-sphere)) (define-extern simple-nav-sphere-init-by-other (function float vector nav-mesh int none :behavior simple-nav-sphere)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -36247,7 +36247,7 @@ :flag-assert #x13003000a8 (:methods (idle () _type_ :state 14) - (spawning (object object process pointer) _type_ :state 15) + (spawning () _type_ :state 15) (die () _type_ :state 16) (hover-enemy-manager-init! "Initialize this [[hover-enemy-manager]]." (_type_ (array hover-enemy-battle-command)) none 17) (spawn-enemy (_type_ uint) none 18) @@ -47044,8 +47044,8 @@ ) (define-extern tomb-boss-catwalk-init-by-other (function vector int none :behavior tomb-boss-catwalk)) -(define-extern widow-bomb-handler (function process int symbol event-message-block none :behavior widow-bomb)) -(define-extern widow-bomb-back-handler (function process int symbol event-message-block none :behavior widow-bomb)) +(define-extern widow-bomb-handler (function process int symbol event-message-block object :behavior widow-bomb)) +(define-extern widow-bomb-back-handler (function process int symbol event-message-block object :behavior widow-bomb)) (define-extern widow-bomb-reaction (function control-info collide-query vector vector collide-status :behavior widow)) (define-extern widow-bomb-init-by-other (function vector vector float float vector none :behavior widow-bomb)) (define-extern heart-mar-init-by-other (function vector none :behavior heart-mar)) @@ -50342,7 +50342,7 @@ ) ) -(define-extern vehicle-rider-event-handler (function process int symbol event-message-block none :behavior vehicle-rider)) +(define-extern vehicle-rider-event-handler (function process int symbol event-message-block object :behavior vehicle-rider)) (define-extern vehicle-rider-init-by-other (function traffic-object-spawn-params none :behavior vehicle-rider)) (define-extern vehicle-rider-spawn (function vehicle type traffic-object-spawn-params process)) @@ -50496,7 +50496,7 @@ ;; vehicle-states ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(define-extern vehicle-event-handler (function process int symbol event-message-block none :behavior vehicle)) +(define-extern vehicle-event-handler (function process int symbol event-message-block object :behavior vehicle)) (define-extern vehicle-explode-post (function none :behavior vehicle)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -51751,7 +51751,7 @@ (move-to-vehicle () _type_ :state 209) (board-vehicle () _type_ :state 210) (ride () _type_ :state 211) - (exit-vehicle (object object int symbol event-message-block) _type_ :state 212) + (exit-vehicle () _type_ :state 212) (wait-at-dest () _type_ :state 213) (civilian-method-214 (_type_ nav-branch int vector float) float 214) (civilian-method-215 (_type_ vector) none 215) diff --git a/decompiler/config/jak2/ntsc_v1/anonymous_function_types.jsonc b/decompiler/config/jak2/ntsc_v1/anonymous_function_types.jsonc index 2e50e59f5f9..9f9062a59cc 100644 --- a/decompiler/config/jak2/ntsc_v1/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/ntsc_v1/anonymous_function_types.jsonc @@ -278,7 +278,7 @@ [55, "(function pair symbol)"] ], "script": [ - [0, "(function script-context none)"], + [0, "(function script-context object)"], [1, "(function script-context int)"], [2, "(function script-context int)"], [3, "(function script-context int)"], @@ -286,10 +286,10 @@ [5, "(function script-context int)"], [6, "(function script-context object)"], [7, "(function script-context object :behavior process)"], - [8, "(function script-context none :behavior process)"], - [9, "(function script-context none :behavior process)"], - [10, "(function script-context none :behavior process)"], - [11, "(function script-context none :behavior process)"], + [8, "(function script-context object :behavior process)"], + [9, "(function script-context object :behavior process)"], + [10, "(function script-context object :behavior process)"], + [11, "(function script-context object :behavior process)"], [12, "(function script-context symbol)"], [13, "(function script-context symbol)"], [14, "(function script-context symbol)"], @@ -298,50 +298,50 @@ [18, "(function script-context symbol)"], [19, "(function script-context symbol)"], [20, "(function script-context symbol)"], - [21, "(function script-context none)"], - [22, "(function script-context none)"], + [21, "(function script-context object)"], + [22, "(function script-context object)"], [23, "(function script-context symbol)"], - [24, "(function script-context none)"], + [24, "(function script-context object)"], [25, "(function script-context symbol)"], - [26, "(function script-context none)"], + [26, "(function script-context object)"], [27, "(function script-context entity-perm-status)"], [28, "(function script-context (pointer process))"], [29, "(function script-context symbol)"], - [30, "(function script-context none)"], - [31, "(function script-context none)"], - [32, "(function script-context none)"], + [30, "(function script-context object)"], + [31, "(function script-context object)"], + [32, "(function script-context object)"], [33, "(function script-context object)"], [34, "(function script-context region)"], [35, "(function script-context drawable-region-prim)"], [36, "(function script-context symbol :behavior time-of-day-proc)"], [37, "(function script-context object :behavior time-of-day-proc)"], - [38, "(function script-context none)"], + [38, "(function script-context object)"], // TODO - ugly time-frame casts - [39, "(function script-context none)"], + [39, "(function script-context object)"], // TODO - ugly time-frame casts - [40, "(function script-context none)"], + [40, "(function script-context object)"], [41, "(function script-context sound-id)"], [42, "(function script-context sound-id)"], - [43, "(function script-context none)"], + [43, "(function script-context object)"], [44, "(function script-context object)"], - [45, "(function script-context none)"], - [46, "(function script-context none)"], - [47, "(function script-context none)"], - [48, "(function script-context none)"], + [45, "(function script-context object)"], + [46, "(function script-context object)"], + [47, "(function script-context object)"], + [48, "(function script-context object)"], [49, "(function script-context symbol)"], [50, "(function script-context symbol)"], - [51, "(function script-context none)"], + [51, "(function script-context object)"], [52, "(function script-context symbol)"], [53, "(function script-context symbol)"], [54, "(function script-context symbol)"], - [55, "(function script-context none)"], - [56, "(function script-context none)"], - [57, "(function script-context none)"], - [58, "(function script-context none)"], - [59, "(function script-context none)"], - [60, "(function script-context none)"], - [61, "(function script-context none)"], - [62, "(function script-context none)"], + [55, "(function script-context object)"], + [56, "(function script-context object)"], + [57, "(function script-context object)"], + [58, "(function script-context object)"], + [59, "(function script-context object)"], + [60, "(function script-context object)"], + [61, "(function script-context object)"], + [62, "(function script-context object)"], [64, "(function script-context object)"], [65, "(function script-context symbol)"], [66, "(function script-context symbol)"], @@ -367,10 +367,10 @@ [15, "(function script-context pair :behavior process)"] // NOTE - an interesting one ], "entity": [ - [16, "(function process none)"], - [11, "(function process none)"], - [59, "(function process none)"], - [56, "(function process-drawable none)"] + [16, "(function process object)"], + [11, "(function process object)"], + [59, "(function process object)"], + [56, "(function process-drawable object)"] ], "memory-usage": [ [2, "(function process-drawable symbol)"], diff --git a/goal_src/jak1/build/all_objs.json b/goal_src/jak1/build/all_objs.json index 1f258c6bb9c..c0a2732dc02 100644 --- a/goal_src/jak1/build/all_objs.json +++ b/goal_src/jak1/build/all_objs.json @@ -75,7 +75,7 @@ ["ocean-frames", "ocean-frames", 3, ["GAME", "ENGINE"], "engine/gfx/ocean"], ["sky-h", "sky-h", 3, ["GAME", "ENGINE"], "engine/gfx/sky"], ["mood-h", "mood-h", 3, ["GAME", "ENGINE"], "engine/gfx"], -["time-of-day-h", "time-of-day-h", 3, ["GAME", "ENGINE"], "engine/gfx"], +["time-of-day-h", "time-of-day-h", 3, ["GAME", "ENGINE"], "engine/gfx/mood"], ["art-h", "art-h", 3, ["GAME", "ENGINE"], "engine/data"], ["generic-vu1-h", "generic-vu1-h", 3, ["GAME", "ENGINE"], "engine/gfx/generic"], ["merc-h", "merc-h", 3, ["GAME", "ENGINE"], "engine/gfx/merc"], @@ -200,7 +200,7 @@ ["mood-tables", "mood-tables", 3, ["GAME", "ENGINE"], "engine/gfx/mood"], ["mood", "mood", 3, ["GAME", "ENGINE"], "engine/gfx/mood"], ["weather-part", "weather-part", 3, ["GAME", "ENGINE"], "engine/gfx/mood"], -["time-of-day", "time-of-day", 3, ["GAME", "ENGINE"], "engine/gfx"], +["time-of-day", "time-of-day", 3, ["GAME", "ENGINE"], "engine/gfx/mood"], ["sky-utils", "sky-utils", 3, ["GAME", "ENGINE"], "engine/gfx/sky"], ["sky", "sky", 3, ["GAME", "ENGINE"], "engine/gfx/sky"], ["sky-tng", "sky-tng", 3, ["GAME", "ENGINE"], "engine/gfx/sky"], diff --git a/goal_src/jak1/engine/anim/aligner.gc b/goal_src/jak1/engine/anim/aligner.gc index 60a5b4f60cf..d0fc88c2077 100644 --- a/goal_src/jak1/engine/anim/aligner.gc +++ b/goal_src/jak1/engine/anim/aligner.gc @@ -7,8 +7,8 @@ ;; DECOMP BEGINS -;; WARN: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] -;; WARN: Unsupported inline assembly instruction kind - [jr ra] +;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] +;; ERROR: Unsupported inline assembly instruction kind - [jr ra] (defmethod compute-alignment! align-control ((obj align-control)) (local-vars (a0-9 symbol) (s7-0 none) (ra-0 int)) (with-pp @@ -24,23 +24,13 @@ ((or a2-0 (begin (set! a1-0 'stack1) (= a0-4 a1-0))) ) (else - ; TODO - support decompiling the return-from-thread - ; TODO - properly decompile the `go`to - ; (when (!= (-> v1-5 type) art-joint-anim) - ; (let - ; ((t9-0 (the-as (function object object object object) enter-state)) - ; (a0-7 "align joint-anim") - ; ) - ; (set! (-> pp next-state) process-drawable-art-error) - ; (t9-0 a0-7 (the-as none a1-0) a2-0) - ; ) - ; (.lw ra-0 return-from-thread s7-0) - ; (.jr ra-0) - ; (nop!) - ; 0 - ; ) - 0 - ) + (when (!= (-> v1-5 type) art-joint-anim) + ;; og:preserve-this + (go process-drawable-art-error "align joint-anim") + (abandon-thread) + 0 + ) + ) ) ) ) @@ -133,7 +123,7 @@ ) (defmethod align! align-control ((obj align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float)) - (when (zero? (logand (-> obj flags) (align-flags disabled))) + (when (not (logtest? (-> obj flags) (align-flags disabled))) (let* ((a0-1 (-> obj process)) (t9-0 (method-of-object a0-1 apply-alignment)) (v1-4 (-> obj delta)) @@ -163,7 +153,7 @@ ) (defmethod align-vel-and-quat-only! align-control ((obj align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) - (when (zero? (logand (-> obj flags) (align-flags disabled))) + (when (not (logtest? (-> obj flags) (align-flags disabled))) (let ((s5-0 (-> obj delta))) (let ((s3-0 (-> obj process root transv))) (if (logtest? arg0 (align-opts adjust-y-vel)) @@ -190,6 +180,3 @@ ) (-> obj process root) ) - - - diff --git a/goal_src/jak1/engine/anim/joint-exploder.gc b/goal_src/jak1/engine/anim/joint-exploder.gc index 646ce6b1c77..fa4715eeef7 100644 --- a/goal_src/jak1/engine/anim/joint-exploder.gc +++ b/goal_src/jak1/engine/anim/joint-exploder.gc @@ -459,7 +459,6 @@ (defstate joint-exploder-shatter (joint-exploder) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (let* ((f1-0 (the float (- (-> *display* base-frame-counter) (-> self state-time)))) @@ -516,7 +515,6 @@ ) ) 0 - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -524,7 +522,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior joint-exploder) ja-post) ) @@ -644,7 +641,7 @@ (set! (-> a0-6 pre-moved?) #f) ) ) - (set! (-> self mask) (logior (process-mask enemy) (-> self mask))) + (logior! (-> self mask) (process-mask enemy)) (set! (-> self root) (new 'process 'trsqv)) (set! (-> self root trans quad) (-> self parent-override 0 root trans quad)) (quaternion-copy! (-> self root quat) (-> self parent-override 0 root quat)) diff --git a/goal_src/jak1/engine/anim/joint.gc b/goal_src/jak1/engine/anim/joint.gc index dc1503cd51c..1249b663708 100644 --- a/goal_src/jak1/engine/anim/joint.gc +++ b/goal_src/jak1/engine/anim/joint.gc @@ -698,7 +698,7 @@ ) ) ) - (the-as object sv-24) + sv-24 ) (defun flatten-joint-control-to-spr ((arg0 joint-control)) diff --git a/goal_src/jak1/engine/camera/cam-combiner.gc b/goal_src/jak1/engine/camera/cam-combiner.gc index d069123f3a2..a26ffff3cfc 100644 --- a/goal_src/jak1/engine/camera/cam-combiner.gc +++ b/goal_src/jak1/engine/camera/cam-combiner.gc @@ -8,164 +8,156 @@ ;; DECOMP BEGINS (defstate cam-combiner-active (camera-combiner) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('point-of-interest) - (cond - ((-> event param 0) - (set! (-> self tracking use-point-of-interest) #t) - (set! (-> self tracking point-of-interest quad) (-> (the-as vector (-> event param 0)) quad)) - (set! (-> self tracking point-of-interest-blend target) 1.0) - ) - (else - (set! (-> self tracking use-point-of-interest) #f) - (set! (-> self tracking point-of-interest-blend target) 0.0) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('point-of-interest) + (cond + ((-> block param 0) + (set! (-> self tracking use-point-of-interest) #t) + (set! (-> self tracking point-of-interest quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self tracking point-of-interest-blend target) 1.0) + ) + (else + (set! (-> self tracking use-point-of-interest) #f) + (set! (-> self tracking point-of-interest-blend target) 0.0) ) ) - (('set-interpolation) - (set! (-> self interp-val) 0.0) - (set! (-> self interp-step) (/ 5.0 (the float (-> event param 0)))) - ) - (('teleport) - (when (nonzero? (-> self tracking-status)) - (cam-calc-follow! (-> self tracking) (-> self trans) #f) - (the-as object (slave-set-rotation! - (-> self tracking) - (-> self trans) - (the-as float (-> self tracking-options)) - (-> self fov) - #f - ) - ) + ) + (('set-interpolation) + (set! (-> self interp-val) 0.0) + (set! (-> self interp-step) (/ 5.0 (the float (-> block param 0)))) + ) + (('teleport) + (when (nonzero? (-> self tracking-status)) + (cam-calc-follow! (-> self tracking) (-> self trans) #f) + (slave-set-rotation! + (-> self tracking) + (-> self trans) + (the-as float (-> self tracking-options)) + (-> self fov) + #f ) ) - (('stop-tracking) - (set! (-> self tracking-status) (the-as uint 0)) - 0 - ) - (('start-tracking) - (cond - ((< arg1 1) - (let ((t9-2 format) - (a0-15 0) - (a1-3 "ERROR : missing camera-slave parameter to *camera-combiner* start-tracking~%") - ) - (let ((v1-7 (-> event param 0))) - (rtype-of v1-7) + ) + (('stop-tracking) + (set! (-> self tracking-status) (the-as uint 0)) + 0 + ) + (('start-tracking) + (cond + ((< argc 1) + (let ((t9-2 format) + (a0-15 0) + (a1-3 "ERROR : missing camera-slave parameter to *camera-combiner* start-tracking~%") ) - (t9-2 a0-15 a1-3) + (let ((v1-7 (-> block param 0))) + (rtype-of v1-7) ) + (t9-2 a0-15 a1-3) ) - ((let ((t9-3 type-type?) - (v1-8 (-> event param 0)) - ) - (not (t9-3 (rtype-of v1-8) camera-slave)) + ) + ((let ((t9-3 type-type?) + (v1-8 (-> block param 0)) + ) + (not (t9-3 (rtype-of v1-8) camera-slave)) + ) + (let ((t9-4 format) + (a0-18 0) + (a1-5 "ERROR : invalid type '~A' to *camera-combiner* start-tracking~%") + (v1-10 (-> block param 0)) + ) + (t9-4 a0-18 a1-5 (rtype-of v1-10)) + ) + ) + ((zero? (-> self tracking-status)) + (set! (-> self tracking-status) (the-as uint 1)) + (let ((gp-1 (the-as object (-> block param 0)))) + (set! (-> self tracking-options) (the-as int (-> (the-as camera-slave gp-1) options))) + (set! (-> self tracking no-follow) (-> (the-as camera-slave gp-1) tracking no-follow)) + (copy-cam-float-seeker (-> self tracking tilt-adjust) (-> (the-as camera-slave gp-1) tracking tilt-adjust)) + (copy-cam-float-seeker + (-> self tracking underwater-blend) + (-> (the-as camera-slave gp-1) tracking underwater-blend) ) - (let ((t9-4 format) - (a0-18 0) - (a1-5 "ERROR : invalid type '~A' to *camera-combiner* start-tracking~%") - (v1-10 (-> event param 0)) + (set! (-> self tracking use-point-of-interest) (-> (the-as camera-slave gp-1) tracking use-point-of-interest)) + (set! (-> self tracking point-of-interest quad) + (-> (the-as camera-slave gp-1) tracking point-of-interest quad) ) - (t9-4 a0-18 a1-5 (rtype-of v1-10)) + (copy-cam-float-seeker + (-> self tracking point-of-interest-blend) + (-> (the-as camera-slave gp-1) tracking point-of-interest-blend) ) - ) - ((zero? (-> self tracking-status)) - (set! (-> self tracking-status) (the-as uint 1)) - (let ((gp-1 (the-as object (-> event param 0)))) - (set! (-> self tracking-options) (the-as int (-> (the-as camera-slave gp-1) options))) - (set! (-> self tracking no-follow) (-> (the-as camera-slave gp-1) tracking no-follow)) - (copy-cam-float-seeker (-> self tracking tilt-adjust) (-> (the-as camera-slave gp-1) tracking tilt-adjust)) - (copy-cam-float-seeker - (-> self tracking underwater-blend) - (-> (the-as camera-slave gp-1) tracking underwater-blend) - ) - (set! (-> self tracking use-point-of-interest) (-> (the-as camera-slave gp-1) tracking use-point-of-interest)) - (set! (-> self tracking point-of-interest quad) - (-> (the-as camera-slave gp-1) tracking point-of-interest quad) - ) - (copy-cam-float-seeker - (-> self tracking point-of-interest-blend) - (-> (the-as camera-slave gp-1) tracking point-of-interest-blend) - ) - (let ((gp-2 (+ (the-as uint gp-1) 108))) - (cam-calc-follow! (-> self tracking) (the-as vector gp-2) #f) - (the-as object (slave-set-rotation! - (-> self tracking) - (the-as vector gp-2) - (the-as float (-> self tracking-options)) - (-> self fov) - #f - ) - ) + (let ((gp-2 (+ (the-as uint gp-1) 108))) + (cam-calc-follow! (-> self tracking) (the-as vector gp-2) #f) + (slave-set-rotation! + (-> self tracking) + (the-as vector gp-2) + (the-as float (-> self tracking-options)) + (-> self fov) + #f ) ) ) - ) + ) ) - (('copy-tracking) - (cond - ((< arg1 1) - (let ((t9-10 format) - (a0-27 0) - (a1-11 "ERROR : missing camera-slave parameter to *camera-combiner* copy-tracking~%") - ) - (let ((v1-23 (-> event param 0))) - (rtype-of v1-23) + ) + (('copy-tracking) + (cond + ((< argc 1) + (let ((t9-10 format) + (a0-27 0) + (a1-11 "ERROR : missing camera-slave parameter to *camera-combiner* copy-tracking~%") ) - (t9-10 a0-27 a1-11) + (let ((v1-23 (-> block param 0))) + (rtype-of v1-23) ) + (t9-10 a0-27 a1-11) ) - ((let ((t9-11 type-type?) - (v1-24 (-> event param 0)) - ) - (not (t9-11 (rtype-of v1-24) camera-slave)) - ) - (let ((t9-12 format) - (a0-30 0) - (a1-13 "ERROR : invalid type '~A' to *camera-combiner* copy-tracking~%") - (v1-25 (-> event param 0)) - ) - (t9-12 a0-30 a1-13 (rtype-of v1-25)) - ) + ) + ((let ((t9-11 type-type?) + (v1-24 (-> block param 0)) + ) + (not (t9-11 (rtype-of v1-24) camera-slave)) ) - ((nonzero? (-> self tracking-status)) - #f + (let ((t9-12 format) + (a0-30 0) + (a1-13 "ERROR : invalid type '~A' to *camera-combiner* copy-tracking~%") + (v1-25 (-> block param 0)) + ) + (t9-12 a0-30 a1-13 (rtype-of v1-25)) ) - (else - (set! (-> self tracking-status) (the-as uint 1)) - (let ((gp-3 (the-as camera-slave (-> event param 0)))) - (set! (-> self tracking-options) (the-as int (-> gp-3 options))) - (set! (-> self tracking no-follow) (-> gp-3 tracking no-follow)) - (copy-cam-float-seeker (-> self tracking tilt-adjust) (-> gp-3 tracking tilt-adjust)) - (copy-cam-float-seeker (-> self tracking underwater-blend) (-> gp-3 tracking underwater-blend)) - (set! (-> self tracking follow-off quad) (-> gp-3 tracking follow-off quad)) - (set! (-> self tracking follow-pt quad) (-> gp-3 tracking follow-pt quad)) - (let* ((a2-17 (-> self tracking)) - (a3-3 (-> gp-3 tracking)) - (v1-36 (-> a3-3 inv-mat vector 0 quad)) - (a0-37 (-> a3-3 inv-mat vector 1 quad)) - (a1-16 (-> a3-3 inv-mat vector 2 quad)) - (a3-4 (-> a3-3 inv-mat vector 3 quad)) - ) - (set! (-> a2-17 inv-mat vector 0 quad) v1-36) - (set! (-> a2-17 inv-mat vector 1 quad) a0-37) - (set! (-> a2-17 inv-mat vector 2 quad) a1-16) - (set! (-> a2-17 inv-mat vector 3 quad) a3-4) - ) - (set! (-> self tracking use-point-of-interest) (-> gp-3 tracking use-point-of-interest)) - (set! (-> self tracking point-of-interest quad) (-> gp-3 tracking point-of-interest quad)) - (the-as - object - (copy-cam-float-seeker (-> self tracking point-of-interest-blend) (-> gp-3 tracking point-of-interest-blend)) - ) + ) + ((nonzero? (-> self tracking-status)) + #f + ) + (else + (set! (-> self tracking-status) (the-as uint 1)) + (let ((gp-3 (the-as camera-slave (-> block param 0)))) + (set! (-> self tracking-options) (the-as int (-> gp-3 options))) + (set! (-> self tracking no-follow) (-> gp-3 tracking no-follow)) + (copy-cam-float-seeker (-> self tracking tilt-adjust) (-> gp-3 tracking tilt-adjust)) + (copy-cam-float-seeker (-> self tracking underwater-blend) (-> gp-3 tracking underwater-blend)) + (set! (-> self tracking follow-off quad) (-> gp-3 tracking follow-off quad)) + (set! (-> self tracking follow-pt quad) (-> gp-3 tracking follow-pt quad)) + (let* ((a2-17 (-> self tracking)) + (a3-3 (-> gp-3 tracking)) + (v1-36 (-> a3-3 inv-mat vector 0 quad)) + (a0-37 (-> a3-3 inv-mat vector 1 quad)) + (a1-16 (-> a3-3 inv-mat vector 2 quad)) + (a3-4 (-> a3-3 inv-mat vector 3 quad)) + ) + (set! (-> a2-17 inv-mat vector 0 quad) v1-36) + (set! (-> a2-17 inv-mat vector 1 quad) a0-37) + (set! (-> a2-17 inv-mat vector 2 quad) a1-16) + (set! (-> a2-17 inv-mat vector 3 quad) a3-4) ) + (set! (-> self tracking use-point-of-interest) (-> gp-3 tracking use-point-of-interest)) + (set! (-> self tracking point-of-interest quad) (-> gp-3 tracking point-of-interest quad)) + (copy-cam-float-seeker (-> self tracking point-of-interest-blend) (-> gp-3 tracking point-of-interest-blend)) ) ) ) - ) + ) ) ) :code (behavior () @@ -414,7 +406,6 @@ ) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/engine/camera/cam-layout.gc b/goal_src/jak1/engine/camera/cam-layout.gc index 91511606bbe..2059a574aa3 100644 --- a/goal_src/jak1/engine/camera/cam-layout.gc +++ b/goal_src/jak1/engine/camera/cam-layout.gc @@ -3506,7 +3506,6 @@ (cam-layout-do-menu *clm*) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/engine/camera/cam-master.gc b/goal_src/jak1/engine/camera/cam-master.gc index 4ddd4be86bd..ca6ad8b1861 100644 --- a/goal_src/jak1/engine/camera/cam-master.gc +++ b/goal_src/jak1/engine/camera/cam-master.gc @@ -628,13 +628,9 @@ ) ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 166] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 176] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 196] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 220] (defbehavior master-switch-to-entity camera-master ((arg0 entity)) (local-vars - (v0-21 none) + (v0-21 object) (gp-0 (pointer process)) (sv-16 res-tag) (sv-112 process) @@ -830,11 +826,11 @@ ) (defstate cam-master-active (camera-master) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) (rlet ((vf0 :class vf)) (init-vf0-vector) - (let ((v1-0 event-type)) + (let ((v1-0 message)) (cond ((= v1-0 'dist-from-interp-src) (set! v0-0 (cond @@ -865,7 +861,7 @@ ) ) ((= v1-0 'level-deactivate) - (set! v0-0 (if (and (-> self cam-entity) (= (-> (get-level (-> self cam-entity)) name) (-> event param 0))) + (set! v0-0 (if (and (-> self cam-entity) (= (-> (get-level (-> self cam-entity)) name) (-> block param 0))) (master-unset-region) ) ) @@ -879,12 +875,12 @@ ) ((= v1-0 'force-blend) (set! (-> self force-blend) (the-as uint 3)) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self force-blend-time) (the-as uint v0-0)) ) ((= v1-0 'teleport-to-transformq) - (set! v0-0 (when (> arg1 0) - (let ((gp-1 (the-as object (-> event param 0)))) + (set! v0-0 (when (> argc 0) + (let ((gp-1 (the-as object (-> block param 0)))) (send-event self 'change-state cam-free-floating 0) (dotimes (s5-1 (-> self num-slaves)) (set! (-> self slave s5-1 0 trans quad) (-> (the-as matrix gp-1) vector 0 quad)) @@ -918,8 +914,8 @@ ) ((= v1-0 'teleport-to-vector-start-string) (set! v0-0 - (when (> arg1 0) - (let ((v1-43 (the-as object (-> event param 0))) + (when (> argc 0) + (let ((v1-43 (the-as object (-> block param 0))) (gp-3 (new 'stack-no-clear 'vector)) ) (set! (-> *camera-combiner* trans quad) (-> (the-as vector v1-43) quad)) @@ -933,14 +929,14 @@ ) ) ((= v1-0 'change-pov) - (let ((v1-52 (the-as object (-> event param 0)))) + (let ((v1-52 (the-as object (-> block param 0)))) (cond - ((< arg1 2) + ((< argc 2) (set! (-> self pov-bone) 0) 0 ) (else - (set! (-> self pov-bone) (the-as int (-> event param 1))) + (set! (-> self pov-bone) (the-as int (-> block param 1))) ) ) (set! v0-0 (cond @@ -958,18 +954,18 @@ ) ) ((= v1-0 'change-target-bone) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self which-bone) (the-as int v0-0)) ) ((= v1-0 'change-target) - (let ((v1-56 (the-as object (-> event param 0)))) + (let ((v1-56 (the-as object (-> block param 0)))) (cond - ((< arg1 2) + ((< argc 2) (set! (-> self which-bone) 0) 0 ) (else - (set! (-> self which-bone) (the-as int (-> event param 1))) + (set! (-> self which-bone) (the-as int (-> block param 1))) ) ) (cond @@ -1001,9 +997,9 @@ (set! v0-0 (matrix-identity! (the-as matrix (-> *camera-combiner* tracking)))) ) ((= v1-0 'set-fov) - (set! (-> *camera-combiner* fov) (the-as float (-> event param 0))) + (set! (-> *camera-combiner* fov) (the-as float (-> block param 0))) (dotimes (v1-86 (-> self num-slaves)) - (set! (-> self slave v1-86 0 fov) (the-as float (-> event param 0))) + (set! (-> self slave v1-86 0 fov) (the-as float (-> block param 0))) ) (set! v0-0 #f) ) @@ -1024,18 +1020,18 @@ ) ((= v1-0 'query-state) (let ((v1-95 (+ (-> self num-slaves) -1))) - (while (not (or (< v1-95 0) (= (-> self slave v1-95 0 next-state) (-> event param 0)))) + (while (not (or (< v1-95 0) (= (-> self slave v1-95 0 next-state) (-> block param 0)))) (+! v1-95 -1) ) - (set! v0-0 (and (>= v1-95 0) (= (-> self slave v1-95 0 next-state) (-> event param 0)))) + (set! v0-0 (and (>= v1-95 0) (= (-> self slave v1-95 0 next-state) (-> block param 0)))) ) ) ((= v1-0 'change-to-entity-by-name) - (let ((a0-75 (entity-by-name (the-as string (-> event param 0))))) + (let ((a0-75 (entity-by-name (the-as string (-> block param 0))))) (set! v0-0 (if a0-75 (master-switch-to-entity a0-75) - (format 0 "ERROR : camera entity '~S' not found for change-to-entity-by-name~%" (-> event param 0)) + (format 0 "ERROR : camera entity '~S' not found for change-to-entity-by-name~%" (-> block param 0)) ) ) ) @@ -1049,24 +1045,24 @@ (s4-1 (the-as (pointer camera-slave) #f)) ) (let ((t9-22 type-type?) - (v1-101 (-> event param 0)) + (v1-101 (-> block param 0)) ) (cond ((t9-22 (rtype-of v1-101) state) - (set! s1-0 (-> event param 0)) + (set! s1-0 (-> block param 0)) ) ((let ((t9-23 type-type?) - (v1-103 (-> event param 0)) + (v1-103 (-> block param 0)) ) (t9-23 (rtype-of v1-103) camera-slave) ) - (set! s2-0 (process->ppointer (the-as process (-> event param 0)))) + (set! s2-0 (process->ppointer (the-as process (-> block param 0)))) ) (else (let ((t9-24 format) (a0-82 0) (a1-25 "ERROR : invalid type '~A' to *camera* change-state~%") - (v1-106 (-> event param 0)) + (v1-106 (-> block param 0)) ) (t9-24 a0-82 a1-25 (rtype-of v1-106)) ) @@ -1127,7 +1123,7 @@ ) ) ) - ((zero? (-> event param 1)) + ((zero? (-> block param 1)) (if *math-camera* (set! (-> *math-camera* reset) 1) ) @@ -1199,7 +1195,7 @@ ) (when (< 0.0 (-> self slave 0 0 intro-t-step)) (set! (-> self outro-t) (-> self slave 0 0 intro-t)) - (set! (-> self outro-t-step) (/ -5.0 (the float (-> event param 1)))) + (set! (-> self outro-t-step) (/ -5.0 (the float (-> block param 1)))) (set! (-> self outro-exit-value) (-> self slave 0 0 outro-exit-value)) (curve-copy! (-> self outro-curve) (-> self slave 0 0 intro-curve)) ) @@ -1244,7 +1240,7 @@ ) ) (when s2-0 - (send-event *camera-combiner* 'set-interpolation (-> event param 1)) + (send-event *camera-combiner* 'set-interpolation (-> block param 1)) (set! s4-1 (-> self slave 0)) (cond ((zero? (-> self slave 0 0 blend-from-type)) @@ -1350,36 +1346,36 @@ (cond ((< (-> self num-slaves) 2) (set! (-> self slave (-> self num-slaves)) - (the-as (pointer camera-slave) (process->ppointer (the-as process (-> event param 0)))) + (the-as (pointer camera-slave) (process->ppointer (the-as process (-> block param 0)))) ) (+! (-> self num-slaves) 1) (logior! (-> self master-options) 8) - (set! (-> *camera-combiner* tracking tilt-adjust target) (-> (the-as projectile (-> event param 0)) max-turn)) + (set! (-> *camera-combiner* tracking tilt-adjust target) (-> (the-as projectile (-> block param 0)) max-turn)) ) (else (format 0 "ERROR: ERROR : Exceeded maximum number of camera slaves!~%") - (the-as object (deactivate (the-as camera-slave (-> event param 0)))) + (deactivate (the-as camera-slave (-> block param 0))) ) ) ) ) ((= v1-0 'ease-in) (cond - ((< arg1 1) + ((< argc 1) (set! (-> self ease-t) 0.0) (logand! (-> self master-options) -33) ) - ((< arg1 2) - (if (< (the-as float (-> event param 0)) (-> self ease-t)) - (set! (-> self ease-t) (the-as float (-> event param 0))) + ((< argc 2) + (if (< (the-as float (-> block param 0)) (-> self ease-t)) + (set! (-> self ease-t) (the-as float (-> block param 0))) ) (logand! (-> self master-options) -33) ) (else - (if (< (the-as float (-> event param 0)) (-> self ease-t)) - (set! (-> self ease-t) (the-as float (-> event param 0))) + (if (< (the-as float (-> block param 0)) (-> self ease-t)) + (set! (-> self ease-t) (the-as float (-> block param 0))) ) - (set! (-> self ease-to quad) (-> (the-as vector (-> event param 1)) quad)) + (set! (-> self ease-to quad) (-> (the-as vector (-> block param 1)) quad)) (logior! (-> self master-options) 32) ) ) @@ -1410,25 +1406,25 @@ ) ) (countdown (gp-6 (-> self num-slaves)) - (send-event (ppointer->process (-> self slave gp-6)) event-type) + (send-event (ppointer->process (-> self slave gp-6)) message) ) (let ((a1-54 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-54 from) self) (set! (-> a1-54 num-params) 0) - (set! (-> a1-54 message) event-type) + (set! (-> a1-54 message) message) (set! v0-0 (send-event-function *camera-combiner* a1-54)) ) ) ((= v1-0 'toggle-slave-option) - (logxor! (-> self slave-options) (-> event param 0)) + (logxor! (-> self slave-options) (-> block param 0)) (let ((a0-193 (-> self slave 0)) (v1-360 (-> self slave 1)) ) (if a0-193 - (logxor! (-> a0-193 0 options) (-> event param 0)) + (logxor! (-> a0-193 0 options) (-> block param 0)) ) (set! v0-0 (when v1-360 - (set! v0-0 (logxor (-> v1-360 0 options) (-> event param 0))) + (set! v0-0 (logxor (-> v1-360 0 options) (-> block param 0))) (set! (-> v1-360 0 options) (the-as uint v0-0)) v0-0 ) @@ -1440,19 +1436,19 @@ (cond ((= v1-0 'slave-option?) (if (nonzero? (-> self num-slaves)) - (logtest? (-> self slave (+ (-> self num-slaves) -1) 0 options) (-> event param 0)) + (logtest? (-> self slave (+ (-> self num-slaves) -1) 0 options) (-> block param 0)) ) ) ((= v1-0 'set-slave-option) (when (nonzero? (-> self num-slaves)) - (set! v0-0 (logior (-> self slave (+ (-> self num-slaves) -1) 0 options) (-> event param 0))) + (set! v0-0 (logior (-> self slave (+ (-> self num-slaves) -1) 0 options) (-> block param 0))) (set! (-> self slave (+ (-> self num-slaves) -1) 0 options) (the-as uint v0-0)) v0-0 ) ) ((= v1-0 'clear-slave-option) (when (nonzero? (-> self num-slaves)) - (set! v0-0 (logclear (-> self slave (+ (-> self num-slaves) -1) 0 options) (-> event param 0))) + (set! v0-0 (logclear (-> self slave (+ (-> self num-slaves) -1) 0 options) (-> block param 0))) (set! (-> self slave (+ (-> self num-slaves) -1) 0 options) (the-as uint v0-0)) v0-0 ) @@ -1484,50 +1480,50 @@ (when (nonzero? (-> self num-slaves)) (let ((a1-60 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-60 from) proc) - (set! (-> a1-60 num-params) arg1) - (set! (-> a1-60 message) event-type) - (set! (-> a1-60 param 0) (-> event param 0)) - (set! (-> a1-60 param 1) (-> event param 1)) - (set! (-> a1-60 param 2) (-> event param 2)) - (set! (-> a1-60 param 3) (-> event param 3)) - (set! (-> a1-60 param 4) (-> event param 4)) - (set! (-> a1-60 param 5) (-> event param 5)) - (set! (-> a1-60 param 6) (-> event param 6)) + (set! (-> a1-60 num-params) argc) + (set! (-> a1-60 message) message) + (set! (-> a1-60 param 0) (-> block param 0)) + (set! (-> a1-60 param 1) (-> block param 1)) + (set! (-> a1-60 param 2) (-> block param 2)) + (set! (-> a1-60 param 3) (-> block param 3)) + (set! (-> a1-60 param 4) (-> block param 4)) + (set! (-> a1-60 param 5) (-> block param 5)) + (set! (-> a1-60 param 6) (-> block param 6)) (send-event-function (ppointer->process (-> self slave (+ (-> self num-slaves) -1))) a1-60) ) ) (let ((a1-61 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-61 from) proc) - (set! (-> a1-61 num-params) arg1) - (set! (-> a1-61 message) event-type) - (set! (-> a1-61 param 0) (-> event param 0)) - (set! (-> a1-61 param 1) (-> event param 1)) - (set! (-> a1-61 param 2) (-> event param 2)) - (set! (-> a1-61 param 3) (-> event param 3)) - (set! (-> a1-61 param 4) (-> event param 4)) - (set! (-> a1-61 param 5) (-> event param 5)) - (set! (-> a1-61 param 6) (-> event param 6)) + (set! (-> a1-61 num-params) argc) + (set! (-> a1-61 message) message) + (set! (-> a1-61 param 0) (-> block param 0)) + (set! (-> a1-61 param 1) (-> block param 1)) + (set! (-> a1-61 param 2) (-> block param 2)) + (set! (-> a1-61 param 3) (-> block param 3)) + (set! (-> a1-61 param 4) (-> block param 4)) + (set! (-> a1-61 param 5) (-> block param 5)) + (set! (-> a1-61 param 6) (-> block param 6)) (send-event-function *camera-combiner* a1-61) ) ) ((= v1-0 'part-water-drip) (set! (-> self water-drip-time) (-> *display* base-frame-counter)) - (set! (-> self water-drip-mult) (the-as float (-> event param 0))) - (set! (-> self water-drip-speed) (the-as float (-> event param 1))) + (set! (-> self water-drip-mult) (the-as float (-> block param 0))) + (set! (-> self water-drip-speed) (the-as float (-> block param 1))) ) (else (countdown (s3-1 (-> self num-slaves)) (let ((a1-62 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-62 from) proc) - (set! (-> a1-62 num-params) arg1) - (set! (-> a1-62 message) event-type) - (set! (-> a1-62 param 0) (-> event param 0)) - (set! (-> a1-62 param 1) (-> event param 1)) - (set! (-> a1-62 param 2) (-> event param 2)) - (set! (-> a1-62 param 3) (-> event param 3)) - (set! (-> a1-62 param 4) (-> event param 4)) - (set! (-> a1-62 param 5) (-> event param 5)) - (set! (-> a1-62 param 6) (-> event param 6)) + (set! (-> a1-62 num-params) argc) + (set! (-> a1-62 message) message) + (set! (-> a1-62 param 0) (-> block param 0)) + (set! (-> a1-62 param 1) (-> block param 1)) + (set! (-> a1-62 param 2) (-> block param 2)) + (set! (-> a1-62 param 3) (-> block param 3)) + (set! (-> a1-62 param 4) (-> block param 4)) + (set! (-> a1-62 param 5) (-> block param 5)) + (set! (-> a1-62 param 6) (-> block param 6)) (send-event-function (ppointer->process (-> self slave s3-1)) a1-62) ) ) @@ -1538,14 +1534,13 @@ ) ) ) - (the-as object v0-0) + v0-0 ) ) :enter (behavior () (if (and (nonzero? camera-master-debug) *debug-segment*) (add-connection *debug-engine* self camera-master-debug self #f #f) ) - (none) ) :trans (behavior () (when (not (paused?)) @@ -1555,7 +1550,6 @@ ) (cam-master-effect) ) - (none) ) :code (behavior () (loop @@ -1600,7 +1594,6 @@ ) (suspend) ) - (none) ) ) @@ -1620,7 +1613,6 @@ (change-to-last-brother self) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/engine/camera/cam-states-dbg.gc b/goal_src/jak1/engine/camera/cam-states-dbg.gc index ae81279cc8d..a2a278e7412 100644 --- a/goal_src/jak1/engine/camera/cam-states-dbg.gc +++ b/goal_src/jak1/engine/camera/cam-states-dbg.gc @@ -20,13 +20,13 @@ (define *CAM_POINT_WATCH-bank* (new 'static 'cam-point-watch-bank :speed 1600.0 :rot-speed (degrees 0.6))) (defstate cam-point-watch (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -36,7 +36,6 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) - (none) ) :code (behavior () (loop @@ -84,7 +83,6 @@ (suspend) 0 ) - (none) ) ) @@ -390,13 +388,13 @@ ) (defstate cam-free-floating (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -406,7 +404,6 @@ (set! (-> self blend-to-type) (the-as uint 1)) (send-event *camera-combiner* 'stop-tracking) ) - (none) ) :code (behavior () (loop @@ -423,7 +420,6 @@ ) (suspend) ) - (none) ) ) @@ -469,13 +465,13 @@ (set! (-> *camera-orbit-info* orbit-off y) 4096.0) (defstate cam-orbit (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -491,11 +487,9 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) - (none) ) :exit (behavior () '() - (none) ) :code (behavior () (loop @@ -586,6 +580,5 @@ ) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/engine/camera/cam-states.gc b/goal_src/jak1/engine/camera/cam-states.gc index 703f0bbd869..d734e095053 100644 --- a/goal_src/jak1/engine/camera/cam-states.gc +++ b/goal_src/jak1/engine/camera/cam-states.gc @@ -10,13 +10,13 @@ ;; DECOMP BEGINS (defstate cam-fixed (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -27,7 +27,6 @@ (set! (-> self blend-to-type) (the-as uint 0)) 0 ) - (none) ) :code (behavior () (loop @@ -43,18 +42,17 @@ ) (suspend) ) - (none) ) ) (defstate cam-fixed-read-entity (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -79,25 +77,23 @@ ) ) (go cam-fixed) - (none) ) :code (behavior () (loop (format *stdcon* "ERROR : stayed in cam-fixed-read-entity~%") (suspend) ) - (none) ) ) (defstate cam-pov (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -106,14 +102,12 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) - (none) ) :trans (behavior () (when (not (handle->process (-> *camera* pov-handle))) (set! (-> self blend-from-type) (the-as uint 0)) (cam-slave-go cam-fixed) ) - (none) ) :code (behavior () (loop @@ -145,18 +139,17 @@ ) (suspend) ) - (none) ) ) (defstate cam-pov180 (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -165,14 +158,12 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) - (none) ) :trans (behavior () (when (not (handle->process (-> *camera* pov-handle))) (set! (-> self blend-from-type) (the-as uint 0)) (cam-slave-go cam-fixed) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -244,7 +235,6 @@ (suspend) ) ) - (none) ) ) @@ -260,13 +250,11 @@ (send-event *camera* 'point-of-interest gp-0) ) ) - (none) ) :trans (behavior () (if (or (not (handle->process (-> *camera* pov-handle))) (not (logtest? (-> *camera* master-options) 2))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -278,7 +266,6 @@ ) (suspend) ) - (none) ) ) @@ -290,10 +277,10 @@ ) (defstate cam-standoff (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('set-standoff-dist) - (vector-normalize! (-> self pivot-pt) (the-as float (-> event param 0))) + (vector-normalize! (-> self pivot-pt) (the-as float (-> block param 0))) (cam-standoff-calc-trans) ) (('set-standoff-height) @@ -302,12 +289,12 @@ (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down) - (the-as float (-> event param 0)) + (the-as float (-> block param 0)) ) (cam-standoff-calc-trans) ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -327,13 +314,11 @@ ) ) (cam-calc-follow! (-> self tracking) (-> self trans) #f) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -343,7 +328,6 @@ ) (suspend) ) - (none) ) ) @@ -382,14 +366,12 @@ ) ) (go cam-standoff) - (none) ) :code (behavior () (loop (format *stdcon* "ERROR : stayed in cam-standoff-read-entity~%") (suspend) ) - (none) ) ) @@ -412,13 +394,13 @@ ;; main first-person camera ;; og:preserve-this modified for high fps (defstate cam-eye (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -432,7 +414,6 @@ 0 ) (set! (-> self fov) 11650.845) - (none) ) :exit (behavior () (if (and *target* @@ -441,13 +422,11 @@ ) (send-event *target* 'end-mode) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (go cam-free-floating) ) - (none) ) :code (behavior () (let ((gp-0 (-> *display* base-frame-counter))) @@ -564,7 +543,6 @@ (suspend) ) ) - (none) ) ) @@ -580,15 +558,14 @@ (define *CAM_BILLY-bank* (new 'static 'cam-billy-bank :rot-speed 364.0889 :tilt-degrees -1820.4445)) -;; first person camera for rat game (defstate cam-billy (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -603,17 +580,14 @@ ) (set! (-> self fov) 9830.4) (matrix-rotate-y! (the-as matrix (-> self tracking)) (the-as float -32768.0)) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -693,7 +667,6 @@ (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) (-> *camera* target-height)) (suspend) ) - (none) ) ) @@ -776,13 +749,11 @@ (send-event *camera* 'point-of-interest gp-2) ) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -794,18 +765,17 @@ ) (suspend) ) - (none) ) ) (defstate cam-decel (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -813,7 +783,6 @@ (if (not (-> self enter-has-run)) (set! (-> self saved-pt quad) (-> self trans quad)) ) - (none) ) :code (behavior () (loop @@ -846,18 +815,17 @@ ) (suspend) ) - (none) ) ) (defstate cam-endlessfall (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -866,7 +834,6 @@ (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (the-as uint 2)) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'cam-vector-seeker)) @@ -901,11 +868,9 @@ (suspend) ) ) - (none) ) ) -;; third person cam used to focus on various entities (defbehavior cam-circular-position-into-max-angle camera-slave ((arg0 vector) (arg1 vector) (arg2 float)) (let* ((f30-0 (vector-normalize-ret-len! arg0 (the-as float 1.0))) (f26-0 (vector-normalize-ret-len! arg1 (the-as float 1.0))) @@ -1082,8 +1047,8 @@ ) (defstate cam-circular (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) @@ -1092,7 +1057,7 @@ (cam-circular-position #f) ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -1168,13 +1133,11 @@ (send-event *camera* 'point-of-interest gp-3) ) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -1183,7 +1146,6 @@ ) (suspend) ) - (none) ) ) @@ -1194,19 +1156,16 @@ (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (the-as uint 2)) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) ) @@ -2279,9 +2238,9 @@ (#if PC_PORT (* (if (-> *pc-settings* third-camera-v-inverted?) 1.0 -1.0) f0-0) f0-0 + ) ) ) -) ;; main third-person camera (defbehavior cam-string-joystick camera-slave () @@ -2743,8 +2702,8 @@ ) (defstate cam-string (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) (let ((gp-0 (new-stack-vector0))) (cam-string-find-position-rel! gp-0) @@ -2752,8 +2711,8 @@ ) ) (('joystick) - (set! (-> self phony-joystick-x) (the-as float (-> event param 0))) - (set! (-> self phony-joystick-y) (the-as float (-> event param 1))) + (set! (-> self phony-joystick-x) (the-as float (-> block param 0))) + (set! (-> self phony-joystick-y) (the-as float (-> block param 1))) (let ((v0-1 (the-as object #t))) (set! (-> self have-phony-joystick) (the-as symbol v0-1)) v0-1 @@ -2761,10 +2720,10 @@ ) (('set-dist) (cond - ((-> event param 0) + ((-> block param 0) (set! (-> self string-val-locked) #t) - (set! (-> self string-min-val quad) (-> (the-as vector (-> event param 0)) quad)) - (set! (-> self string-max-val quad) (-> (the-as vector (-> event param 1)) quad)) + (set! (-> self string-min-val quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self string-max-val quad) (-> (the-as vector (-> block param 1)) quad)) (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) @@ -2779,7 +2738,7 @@ (-> self los-state) ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -2930,13 +2889,11 @@ (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (the-as uint 2)) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -2948,7 +2905,6 @@ ) (suspend) ) - (none) ) ) @@ -3091,7 +3047,6 @@ (set! (-> self blend-to-type) (the-as uint 2)) (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) @@ -3168,7 +3123,6 @@ ) ) ) - (none) ) :code (behavior () (loop @@ -3177,7 +3131,6 @@ ) (suspend) ) - (none) ) ) @@ -3325,13 +3278,11 @@ (cam-calc-bike-follow! (-> self tracking) (-> self trans) #f) (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -3340,7 +3291,6 @@ ) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/engine/camera/camera.gc b/goal_src/jak1/engine/camera/camera.gc index 959d31a37e5..25c2c172a07 100644 --- a/goal_src/jak1/engine/camera/camera.gc +++ b/goal_src/jak1/engine/camera/camera.gc @@ -1030,58 +1030,51 @@ (none) ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 7] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 31] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 45] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 50] (defbehavior cam-standard-event-handler camera-slave ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (case arg2 - (('go) - (let ((v1-1 (-> arg3 param 0)) - (t9-0 (the-as (function object) enter-state)) - ) - (set! (-> self next-state) (the-as state v1-1)) - (t9-0) - ) - ) - (('change-state 'change-state-no-go) - (let ((s5-0 (the-as object (-> arg3 param 0)))) - (cam-slave-init-vars) - (let ((t9-2 (the-as (function object) (-> (the-as state s5-0) enter)))) - (if t9-2 - (t9-2) - ) + (case arg2 + (('go) + (let ((v1-1 (-> arg3 param 0)) + (t9-0 (the-as (function object) enter-state)) ) - (set! (-> self enter-has-run) #t) - (set! (-> self event-hook) (-> (the-as state s5-0) event)) - (when (= arg2 'change-state) - (let ((t9-3 (the-as (function object) enter-state))) - (set! (-> self next-state) (the-as state s5-0)) - (t9-3) + (set! (-> self next-state) (the-as state v1-1)) + (t9-0) + ) + ) + (('change-state 'change-state-no-go) + (let ((s5-0 (the-as object (-> arg3 param 0)))) + (cam-slave-init-vars) + (let ((t9-2 (the-as (function object) (-> (the-as state s5-0) enter)))) + (if t9-2 + (t9-2) ) - ) ) - ) - (('point-of-interest) - (cond - ((-> arg3 param 0) - (set! (-> self tracking use-point-of-interest) #t) - (set! (-> self tracking point-of-interest quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> self tracking point-of-interest-blend target) 1.0) - ) - (else - (set! (-> self tracking use-point-of-interest) #f) - (set! (-> self tracking point-of-interest-blend target) 0.0) + (set! (-> self enter-has-run) #t) + (set! (-> self event-hook) (-> (the-as state s5-0) event)) + (when (= arg2 'change-state) + (let ((t9-3 (the-as (function object) enter-state))) + (set! (-> self next-state) (the-as state s5-0)) + (t9-3) ) ) ) - (('teleport) - (cam-calc-follow! (-> self tracking) (-> self trans) #f) - (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f) + ) + (('point-of-interest) + (cond + ((-> arg3 param 0) + (set! (-> self tracking use-point-of-interest) #t) + (set! (-> self tracking point-of-interest quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set! (-> self tracking point-of-interest-blend target) 1.0) + ) + (else + (set! (-> self tracking use-point-of-interest) #f) + (set! (-> self tracking point-of-interest-blend target) 0.0) + ) ) - ) + ) + (('teleport) + (cam-calc-follow! (-> self tracking) (-> self trans) #f) + (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f) + ) ) ) @@ -1500,9 +1493,9 @@ ) ) -;; WARN: Unsupported inline assembly instruction kind - [mula.s f0, f3] -;; WARN: Unsupported inline assembly instruction kind - [madda.s f1, f4] -;; WARN: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] +;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] (defun slave-set-rotation! ((arg0 cam-rotation-tracker) (arg1 vector) (arg2 float) (arg3 float) (arg4 symbol)) (local-vars (f0-8 float) diff --git a/goal_src/jak1/engine/camera/pov-camera.gc b/goal_src/jak1/engine/camera/pov-camera.gc index c641328d403..a001f37d424 100644 --- a/goal_src/jak1/engine/camera/pov-camera.gc +++ b/goal_src/jak1/engine/camera/pov-camera.gc @@ -34,7 +34,6 @@ :virtual #t :code (behavior () (go-virtual pov-camera-start-playing) - (none) ) ) @@ -56,7 +55,6 @@ ) ) (go-virtual pov-camera-playing) - (none) ) ) @@ -80,8 +78,8 @@ (defstate pov-camera-playing (pov-camera) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('abort) (when (logtest? (-> self flags) (pov-camera-flag notify-of-abort)) (logior! (-> self flags) (pov-camera-flag allow-abort)) @@ -97,7 +95,6 @@ (if (= (-> self anim-name type) string) (backup-load-state-and-set-cmds *load-state* (-> self command-list)) ) - (none) ) :exit (behavior () (if (= (-> self anim-name type) string) @@ -105,7 +102,6 @@ ) (remove-setting! 'music-volume) (remove-setting! 'sfx-volume) - (none) ) :code (behavior () (add-setting! 'music-volume 'rel (-> self music-volume-movie) 0) @@ -129,14 +125,12 @@ ) ) (go-virtual pov-camera-done-playing) - (none) ) :post (behavior () (if (= (-> self anim-name type) string) (execute-commands-up-to *load-state* (ja-aframe-num 0)) ) (ja-post) - (none) ) ) @@ -144,14 +138,12 @@ :virtual #t :enter (behavior () (logior! (-> self flags) (pov-camera-flag allow-abort)) - (none) ) :code (behavior () (set-blackout-frames (seconds 0.035)) (suspend) (suspend) (go-virtual pov-camera-done-playing) - (none) ) ) @@ -166,7 +158,6 @@ (suspend) (cleanup-for-death self) (deactivate self) - (none) ) ) @@ -224,28 +215,19 @@ (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) (set! (-> self event-hook) (lambda :behavior pov-camera ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'mask) - (let ((v0-0 (the-as number (-> arg3 param 0)))) - (set! (-> self mask-to-clear) (the-as process-mask v0-0)) - v0-0 - ) - ) - ((= v1-0 'music-movie-volume) - (let ((f0-0 (the-as float (-> arg3 param 0)))) - (set! (-> self music-volume-movie) f0-0) - f0-0 - ) - ) - ((= v1-0 'sfx-movie-volume) - (let ((f0-1 (the-as float (-> arg3 param 0)))) - (set! (-> self sfx-volume-movie) f0-1) - f0-1 - ) - ) - ) - ) + (case arg2 + (('mask) + (let ((v0-0 (the-as number (-> arg3 param 0)))) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) + v0-0 + ) + ) + (('music-movie-volume) + (set! (-> self music-volume-movie) (the-as float (-> arg3 param 0))) + ) + (('sfx-movie-volume) + (set! (-> self sfx-volume-movie) (the-as float (-> arg3 param 0))) + ) ) ) ) @@ -253,7 +235,3 @@ (go-virtual pov-camera-startup) (none) ) - - - - diff --git a/goal_src/jak1/engine/common-obs/babak.gc b/goal_src/jak1/engine/common-obs/babak.gc index 132e151cdea..d34430b15d8 100644 --- a/goal_src/jak1/engine/common-obs/babak.gc +++ b/goal_src/jak1/engine/common-obs/babak.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype babak (nav-enemy) () :heap-base #x120 @@ -44,7 +43,6 @@ ) ) ((the-as (function none) (-> (method-of-type nav-enemy nav-enemy-patrol) code))) - (none) ) ) @@ -77,7 +75,6 @@ (ja :num! (loop! f30-0)) ) ) - (none) ) ) @@ -128,7 +125,6 @@ ) ) ) - (none) ) ) @@ -167,7 +163,6 @@ (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -186,7 +181,6 @@ (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) ) (go-virtual nav-enemy-chase) - (none) ) ) @@ -204,11 +198,11 @@ :neck-joint 5 :player-look-at-joint 5 :run-travel-speed (meters 6) - :run-rotate-speed (degrees 2880.0) + :run-rotate-speed (degrees 2880) :run-acceleration (meters 1) :run-turn-time (seconds 0.1) :walk-travel-speed (meters 3) - :walk-rotate-speed (degrees 720.0) + :walk-rotate-speed (degrees 720) :walk-acceleration (meters 1) :walk-turn-time (seconds 0.5) :attack-shove-back (meters 3) diff --git a/goal_src/jak1/engine/common-obs/basebutton.gc b/goal_src/jak1/engine/common-obs/basebutton.gc index 98228aecf91..c901b81133c 100644 --- a/goal_src/jak1/engine/common-obs/basebutton.gc +++ b/goal_src/jak1/engine/common-obs/basebutton.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (deftype basebutton (process-drawable) ((root-override collide-shape-moving :offset 112) (down? symbol :offset-assert 176) @@ -70,16 +69,15 @@ (go-virtual basebutton-down-idle) (go-virtual basebutton-up-idle) ) - (none) ) ) (defstate basebutton-up-idle (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (case (-> event param 1) + (case (-> block param 1) (('flop) (basebutton-method-29 self (-> self event-going-down) (-> self notify-actor)) (sound-play "silo-button") @@ -92,19 +90,17 @@ (go-virtual basebutton-going-down) ) (('move-to) - (move-to-vec-or-quat! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1))) + (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) ) ) ) :enter (behavior () (press! self #f) - (none) ) :trans (behavior () (if (-> self move-to?) (rider-trans) ) - (none) ) :code (the-as (function none :behavior basebutton) anim-loop) :post (behavior () @@ -114,26 +110,24 @@ (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) (rider-post) ) - (none) ) ) (defstate basebutton-going-down (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (sound-play "silo-button") (go-virtual basebutton-going-up) ) (('move-to) - (move-to-vec-or-quat! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1))) + (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) ) ) ) :enter (behavior () (press! self #t) - (none) ) :trans (the-as (function none :behavior basebutton) rider-trans) :code (behavior () @@ -144,7 +138,6 @@ ) (basebutton-method-29 self (-> self event-down) (-> self notify-actor)) (go-virtual basebutton-down-idle) - (none) ) :post (behavior () (when (-> self move-to?) @@ -153,32 +146,29 @@ (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) ) (rider-post) - (none) ) ) (defstate basebutton-down-idle (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (sound-play "silo-button") (go-virtual basebutton-going-up) ) (('move-to) - (move-to-vec-or-quat! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1))) + (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) ) ) ) :enter (behavior () (press! self #t) - (none) ) :trans (behavior () (if (-> self move-to?) (rider-trans) ) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -195,7 +185,6 @@ (go-virtual basebutton-going-up) ) ) - (none) ) :post (behavior () (when (-> self move-to?) @@ -204,16 +193,15 @@ (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) (rider-post) ) - (none) ) ) (defstate basebutton-going-up (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('move-to) - (move-to-vec-or-quat! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1))) + (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) ) (('trigger) (sound-play "silo-button") @@ -223,7 +211,6 @@ ) :enter (behavior () (press! self #f) - (none) ) :trans (the-as (function none :behavior basebutton) rider-trans) :code (behavior () @@ -234,7 +221,6 @@ ) (basebutton-method-29 self (-> self event-up) (-> self notify-actor)) (go-virtual basebutton-up-idle) - (none) ) :post (behavior () (when (-> self move-to?) @@ -243,7 +229,6 @@ (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) ) (rider-post) - (none) ) ) @@ -473,7 +458,6 @@ :virtual #t :trans (behavior () (send-event *camera* 'joystick 0.0 0.0) - (none) ) :code (behavior ((arg0 int) (arg1 level)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -522,7 +506,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -551,8 +534,8 @@ ) (defstate target-warp-out (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('death-end) (let ((v0-0 (the-as object (logior (-> self draw status) (draw-status hidden))))) (set! (-> self draw status) (the-as draw-status v0-0)) @@ -560,7 +543,7 @@ ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -575,11 +558,9 @@ (vector-reset! (-> self control transv)) (logior! (-> self state-flags) (state-flags use-alt-cam-pos)) (set! (-> self alt-cam-pos quad) (-> arg1 quad)) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) - (none) ) :code (behavior ((arg0 vector) (arg1 vector)) (send-event *camera* 'change-state cam-fixed 0) @@ -668,7 +649,6 @@ (ja :num! (seek! (ja-aframe 40.0 0))) ) (anim-loop) - (none) ) :post target-no-stick-post ) diff --git a/goal_src/jak1/engine/common-obs/baseplat.gc b/goal_src/jak1/engine/common-obs/baseplat.gc index 3f33048dc27..935df48b38f 100644 --- a/goal_src/jak1/engine/common-obs/baseplat.gc +++ b/goal_src/jak1/engine/common-obs/baseplat.gc @@ -139,12 +139,11 @@ ) (defbehavior plat-event baseplat ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('bonk) - (baseplat-method-22 self) - ) - ) - ) + (case arg2 + (('bonk) + (baseplat-method-22 self) + ) + ) ) (deftype eco-door (process-drawable) @@ -178,23 +177,22 @@ (defbehavior eco-door-event-handler eco-door ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('trigger) - (set! (-> self locked) (not (-> self locked))) - (cond - ((-> self locked) - (if (= (-> self next-state name) 'door-closed) - (sound-play "door-lock") - ) - ) - (else - (sound-play "door-unlock") - ) - ) - #t - ) - ) - ) + (case arg2 + (('trigger) + (set! (-> self locked) (not (-> self locked))) + (cond + ((-> self locked) + (if (= (-> self next-state name) 'door-closed) + (sound-play "door-lock") + ) + ) + (else + (sound-play "door-unlock") + ) + ) + #t + ) + ) ) eco-door-event-handler @@ -225,7 +223,6 @@ eco-door-event-handler ) (suspend) ) - (none) ) ) @@ -253,7 +250,6 @@ eco-door-event-handler ) ) (go-virtual door-open) - (none) ) :post (the-as (function none :behavior eco-door) transform-post) ) @@ -287,7 +283,6 @@ eco-door-event-handler ) (suspend) ) - (none) ) ) @@ -313,7 +308,6 @@ eco-door-event-handler (sound-play "door-lock") ) (go-virtual door-closed) - (none) ) :post (the-as (function none :behavior eco-door) transform-post) ) diff --git a/goal_src/jak1/engine/common-obs/collectables.gc b/goal_src/jak1/engine/common-obs/collectables.gc index 154b68f0a2e..aa675ba562f 100644 --- a/goal_src/jak1/engine/common-obs/collectables.gc +++ b/goal_src/jak1/engine/common-obs/collectables.gc @@ -22,7 +22,6 @@ ;; DECOMP BEGINS - (define *eco-pill-count* 0) (deftype collectable (process-drawable) @@ -391,7 +390,6 @@ (if (task-complete? *game-info* (-> self entity extra perm task)) (go-virtual wait) ) - (none) ) :code (the-as (function none :behavior eco-collectable) anim-loop) ) @@ -435,15 +433,14 @@ (logior! (-> self mask) (process-mask actor-pause)) ) (go-virtual wait) - (none) ) ) (defstate wait (eco-collectable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-3 object)) - (when (and (or (= event-type 'touch) (= event-type 'attack)) + (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) (!= (-> self next-state name) 'pickup) @@ -453,71 +450,68 @@ (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual pickup #f (process->handle proc)) ) - (the-as - object - (cond - ((= event-type 'eco-blue) - (when (and (not (logtest? (-> self flags) (collectable-flags fading ignore-blue))) - (!= (-> self next-state name) 'pickup) - (begin (check-blue-suck (the-as process-drawable proc)) #t) - (logtest? (-> self flags) (collectable-flags can-collect)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual notice-blue (process->handle proc)) - ) - ) - ((= event-type 'trans) - (set! (-> self root-override trans quad) (-> (the-as vector (-> event param 0)) quad)) - (update-transforms! (-> self root-override)) - (the-as object (ja-post)) - ) - ((= event-type 'jump) + (cond + ((= message 'eco-blue) + (when (and (not (logtest? (-> self flags) (collectable-flags fading ignore-blue))) + (!= (-> self next-state name) 'pickup) + (begin (check-blue-suck (the-as process-drawable proc)) #t) + (logtest? (-> self flags) (collectable-flags can-collect)) + (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) + ) (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self jump-pos quad) (-> (the-as vector (-> event param 0)) quad)) - (go-virtual jump) - ) - ((= event-type 'pickup) - (when (!= (-> self next-state name) 'pickup) - (if (and (> arg1 0) (-> event param 0)) - (move-to-point! (-> self root-override) (the-as vector (-> event param 0))) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual pickup #f (the-as handle #f)) - ) + (go-virtual notice-blue (process->handle proc)) ) - ((= event-type 'die) + ) + ((= message 'trans) + (set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad)) + (update-transforms! (-> self root-override)) + (ja-post) + ) + ((= message 'jump) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self jump-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (go-virtual jump) + ) + ((= message 'pickup) + (when (!= (-> self next-state name) 'pickup) + (if (and (> argc 0) (-> block param 0)) + (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) + ) (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual die) - ) - ((= event-type 'movie-pos) - (set! v0-3 (-> event param 0)) - (set! (-> self movie-pos-index) (the-as int v0-3)) - v0-3 + (go-virtual pickup #f (the-as handle #f)) ) - ((= event-type 'actor-pause) - (cond - ((-> event param 0) - (logior! (-> self mask) (process-mask actor-pause)) - (set! v0-3 #t) - (set! (-> self actor-pause) (the-as symbol v0-3)) - v0-3 - ) - (else - (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self actor-pause) #f) - #f - ) + ) + ((= message 'die) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual die) + ) + ((= message 'movie-pos) + (set! v0-3 (-> block param 0)) + (set! (-> self movie-pos-index) (the-as int v0-3)) + v0-3 + ) + ((= message 'actor-pause) + (cond + ((-> block param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (set! v0-3 #t) + (set! (-> self actor-pause) (the-as symbol v0-3)) + v0-3 + ) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + #f ) ) - ((= event-type 'fade) - (logior! (-> self flags) (collectable-flags fade)) - (set! (-> self fadeout-timeout) (seconds 0.1)) - (set! v0-3 (-> *display* base-frame-counter)) - (set! (-> self birth-time) (the-as time-frame v0-3)) - v0-3 - ) - ) + ) + ((= message 'fade) + (logior! (-> self flags) (collectable-flags fade)) + (set! (-> self fadeout-timeout) (seconds 0.1)) + (set! v0-3 (-> *display* base-frame-counter)) + (set! (-> self birth-time) (the-as time-frame v0-3)) + v0-3 + ) ) ) :enter (behavior () @@ -528,7 +522,6 @@ ) (go-virtual pickup #f (process->handle *target*)) ) - (none) ) :trans (behavior () (cond @@ -572,7 +565,6 @@ ) ) (update-transforms! (-> self root-override)) - (none) ) :code (behavior () (loop @@ -608,14 +600,13 @@ ) (suspend) ) - (none) ) ) (defstate notice-blue (eco-collectable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (when (and (or (= event-type 'touch) (= event-type 'attack)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) (!= (-> self next-state name) 'pickup) @@ -637,13 +628,11 @@ ) (set! (-> self suck-y-offset) 0.0) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) - (none) ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -656,7 +645,6 @@ (go-virtual wait) ) ) - (none) ) :code (behavior ((arg0 handle)) (loop @@ -678,20 +666,19 @@ ) (suspend) ) - (none) ) ) (defstate pickup (eco-collectable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (the-as - object - (case event-type + symbol + (case message (('set-movie-pos) (let ((v1-3 (res-lump-struct (-> self entity) 'movie-pos vector :time (the-as float -1000000000.0)))) (the-as symbol (when v1-3 - (set! (-> v1-3 quad) (-> (the-as vector (-> event param 0)) quad)) + (set! (-> v1-3 quad) (-> (the-as vector (-> block param 0)) quad)) (the-as symbol v1-3) ) ) @@ -699,7 +686,7 @@ ) (('actor-pause) (the-as symbol (cond - ((-> event param 0) + ((-> block param 0) (logior! (-> self mask) (process-mask actor-pause)) (let ((v0-1 #t)) (set! (-> self actor-pause) v0-1) @@ -742,7 +729,6 @@ ) ) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :code (behavior ((arg0 object) (arg1 handle)) (clear-collide-with-as (-> self root-override)) @@ -846,7 +832,6 @@ (suspend) ) (go-virtual die) - (none) ) ) @@ -854,7 +839,6 @@ :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) @@ -882,24 +866,22 @@ (defstate die (eco) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('fade) - (process-entity-status! self (entity-perm-status dead) #t) - (the-as object (deactivate self)) - ) - (('die) - (go-virtual die) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fade) + (process-entity-status! self (entity-perm-status dead) #t) + (deactivate self) + ) + (('die) + (go-virtual die) + ) + ) ) :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) - (none) ) :code (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) @@ -928,7 +910,6 @@ (set! (-> self root-override trans quad) (-> self base quad)) (restore-collide-with-as (-> self root-override)) (go-virtual wait) - (none) ) ) @@ -1139,7 +1120,6 @@ (spawn (-> self part) (-> self root-override root-prim world-sphere)))) (suspend) ) - (none) ) ) @@ -1177,7 +1157,6 @@ (spawn (-> self part) (-> self root-override root-prim world-sphere)))) (suspend) ) - (none) ) ) @@ -1191,7 +1170,6 @@ (clear-collide-with-as (-> self root-override)) (process-entity-status! self (entity-perm-status dead) #t) (convert-to-hud-object self (the-as hud (ppointer->process (-> *hud-parts* money)))) - (none) ) ) @@ -1425,9 +1403,9 @@ (defstate wait (fuel-cell) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-3 object)) - (when (and (or (= event-type 'touch) (= event-type 'attack)) + (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) (and (not (handle->process (-> *game-info* other-camera-handle))) @@ -1443,47 +1421,46 @@ (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual pickup #f (process->handle proc)) ) - (the-as object (cond - ((= event-type 'trans) - (set! (-> self root-override trans quad) (-> (the-as vector (-> event param 0)) quad)) - (set! (-> self base quad) (-> self root-override trans quad)) - (update-transforms! (-> self root-override)) - ) - ((= event-type 'pickup) - (when (!= (-> self next-state name) 'pickup) - (if (and (> arg1 0) (-> event param 0)) - (move-to-point! (-> self root-override) (the-as vector (-> event param 0))) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual pickup #f (process->handle *target*)) - ) - ) - ((= event-type 'collide-shape) - (if (-> event param 0) - (the-as object (restore-collide-with-as (-> self root-override))) - (the-as object (clear-collide-with-as (-> self root-override))) - ) - ) - ((= event-type 'movie-pos) - (set! v0-3 (-> event param 0)) - (set! (-> self movie-pos-index) (the-as int v0-3)) - v0-3 - ) - ((= event-type 'anim) - (cond - ((-> event param 0) - (set! v0-3 (logclear (-> self flags) (collectable-flags anim))) - (set! (-> self flags) (the-as collectable-flags v0-3)) - ) - (else - (set! v0-3 (logior (-> self flags) (collectable-flags anim))) - (set! (-> self flags) (the-as collectable-flags v0-3)) - ) - ) - v0-3 - ) - ) - ) + (cond + ((= message 'trans) + (set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self base quad) (-> self root-override trans quad)) + (update-transforms! (-> self root-override)) + ) + ((= message 'pickup) + (when (!= (-> self next-state name) 'pickup) + (if (and (> argc 0) (-> block param 0)) + (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual pickup #f (process->handle *target*)) + ) + ) + ((= message 'collide-shape) + (if (-> block param 0) + (restore-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root-override)) + ) + ) + ((= message 'movie-pos) + (set! v0-3 (-> block param 0)) + (set! (-> self movie-pos-index) (the-as int v0-3)) + v0-3 + ) + ((= message 'anim) + (cond + ((-> block param 0) + (set! v0-3 (logclear (-> self flags) (collectable-flags anim))) + (set! (-> self flags) (the-as collectable-flags v0-3)) + ) + (else + (set! v0-3 (logior (-> self flags) (collectable-flags anim))) + (set! (-> self flags) (the-as collectable-flags v0-3)) + ) + ) + v0-3 + ) + ) ) :code (behavior () 0.5 @@ -1510,7 +1487,6 @@ ) ) ) - (none) ) ) @@ -1524,7 +1500,6 @@ (t9-1) ) ) - (none) ) :trans (behavior () (let ((f30-0 (the-as float (cond @@ -1581,7 +1556,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 object) (arg1 handle)) (local-vars (sv-96 res-tag)) @@ -1933,14 +1907,12 @@ ) ) (convert-to-hud-object self (the-as hud (ppointer->process (-> *hud-parts* fuel-cell)))) - (none) ) :post (behavior () (transform-post) (if (-> self state-object) (spawn (-> self part) (the-as vector (-> self root-override root-prim prim-core))) ) - (none) ) ) @@ -2034,19 +2006,19 @@ ) (defstate fuel-cell-clone-anim (fuel-cell) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('pickup) (when (!= (-> self next-state name) 'pickup) - (if (and (> arg1 0) (-> event param 0)) - (move-to-point! (-> self root-override) (the-as vector (-> event param 0))) + (if (and (> argc 0) (-> block param 0)) + (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual pickup #f (the-as handle #f)) ) ) (('trans) - (set! (-> self root-override trans quad) (-> (the-as vector (-> event param 0)) quad)) + (set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad)) (set! (-> self base quad) (-> self root-override trans quad)) (update-transforms! (-> self root-override)) ) @@ -2066,19 +2038,16 @@ (logior! (-> self mask) (process-mask actor-pause)) ) (logclear! (-> self skel status) (janim-status spool)) - (none) ) :code (behavior ((arg0 handle)) (logclear! (-> self mask) (process-mask actor-pause)) (clone-anim arg0 3 #t "") (format #t "ERROR: clone-anim returned in fuel-cell~%") (deactivate self) - (none) ) :post (behavior () (update-transforms! (-> self root-override)) (animate self) - (none) ) ) @@ -2148,24 +2117,21 @@ (animate self) (suspend) ) - (none) ) ) (defstate pickup (buzzer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (process-entity-status! self (entity-perm-status dead) #t) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (process-entity-status! self (entity-perm-status dead) #t) + ) + ) ) :enter (behavior ((arg0 object) (arg1 handle)) (set! (-> self pickup-handle) arg1) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :code (behavior ((arg0 object) (arg1 handle)) (logclear! (-> self mask) (process-mask actor-pause)) @@ -2260,7 +2226,6 @@ ) ) ) - (none) ) ) @@ -2367,14 +2332,6 @@ (none) ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 190] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 221] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 252] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 284] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 320] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 356] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 363] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 122] (defbehavior birth-pickup-at-point process ((arg0 vector) (arg1 pickup-type) (arg2 float) (arg3 symbol) (arg4 process-tree) (arg5 fact-info)) (local-vars (v1-2 basic) @@ -2688,7 +2645,6 @@ ) (suspend) ) - (none) ) ) @@ -2857,8 +2813,8 @@ ) (defstate vent-wait-for-touch (vent) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (or (= event-type 'touch) (= event-type 'attack)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (or (= message 'touch) (= message 'attack)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) (set! (-> a1-1 num-params) 2) @@ -2872,7 +2828,7 @@ ) (go vent-pickup (process->handle proc)) ) - (vent-standard-event-handler proc arg1 event-type event) + (vent-standard-event-handler proc argc message block) ) :code (behavior () (loop @@ -2889,13 +2845,12 @@ ) (suspend) ) - (none) ) ) (defstate vent-blocked (vent) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('show) (go vent-wait-for-touch) ) @@ -2908,7 +2863,6 @@ ) (suspend) ) - (none) ) ) @@ -2960,7 +2914,6 @@ ) ) (go vent-wait-for-touch) - (none) ) ) diff --git a/goal_src/jak1/engine/common-obs/crates.gc b/goal_src/jak1/engine/common-obs/crates.gc index 1a076da1bd7..5746a6182a6 100644 --- a/goal_src/jak1/engine/common-obs/crates.gc +++ b/goal_src/jak1/engine/common-obs/crates.gc @@ -10,7 +10,6 @@ ;; DECOMP BEGINS - (defskelgroup *crate-barrel-sg* crate crate-barrel-lod0-jg crate-barrel-idle-ja ((crate-barrel-lod0-mg (meters 20)) (crate-barrel-lod1-mg (meters 40)) (crate-barrel-lod2-mg (meters 999999))) :bounds (static-spherem 0 1 0 1.6) @@ -664,7 +663,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior crate) ja-post) ) @@ -677,7 +675,6 @@ (suspend) ) (go-virtual wait) - (none) ) :post (the-as (function none :behavior crate) crate-post) ) @@ -697,7 +694,6 @@ (logclear! (-> self mask) (process-mask sleep-code)) ) ) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self target) arg0) @@ -754,28 +750,27 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior crate) crate-post) ) (defstate die (crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (case (-> self defense) (('darkeco) (cond ((= (-> proc type) target) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'darkeco)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'darkeco)))) ) (else (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) self) (set! (-> a1-5 num-params) 4) (set! (-> a1-5 message) 'attack) - (set! (-> a1-5 param 0) (-> event param 0)) + (set! (-> a1-5 param 0) (-> block param 0)) (set! (-> a1-5 param 1) (the-as uint 'darkeco)) (let ((v1-12 (+ *global-attack-id* 1))) (set! *global-attack-id* v1-12) @@ -799,19 +794,17 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol) (arg1 int)) (clear-collide-with-as (-> self root-override)) (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (if (and *target* (and (logtest? (-> *target* control root-prim prim-core action) - (collide-action racer snowball tube flut) - ) - (!= (-> self fact pickup-type) 6) - (not arg0) - ) + (if (and *target* + (and (logtest? (-> *target* control root-prim prim-core action) (collide-action racer snowball tube flut)) + (!= (-> self fact pickup-type) 6) + (not arg0) + ) ) (logior! (-> self fact options) (fact-options instant-collect)) ) @@ -915,39 +908,37 @@ (suspend) ) ) - (none) ) ) (defstate special-contents-die (crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (case (-> event param 0) - (('pickup) - (let ((gp-0 (-> self entity extra perm))) - (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) - (set! (-> gp-0 user-int8 1) (min 127 (+ (-> gp-0 user-int8 1) 1))) - (+! (-> self child-count) -1) - (when (<= (-> self child-count) 0) - (if (or (= (-> self defense) 'iron) (= (-> self defense) 'steel)) - (process-entity-status! self (entity-perm-status bit-4) #f) - ) - (process-entity-status! self (entity-perm-status dead) #t) - (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> gp-0 user-int8 0) 2) - (let ((v0-0 (logclear (-> self mask) (process-mask sleep)))) - (set! (-> self mask) v0-0) - v0-0 - ) - ) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (let ((gp-0 (-> self entity extra perm))) + (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) + (set! (-> gp-0 user-int8 1) (min 127 (+ (-> gp-0 user-int8 1) 1))) + (+! (-> self child-count) -1) + (when (<= (-> self child-count) 0) + (if (or (= (-> self defense) 'iron) (= (-> self defense) 'steel)) + (process-entity-status! self (entity-perm-status bit-4) #f) + ) + (process-entity-status! self (entity-perm-status dead) #t) + (process-entity-status! self (entity-perm-status complete) #t) + (set! (-> gp-0 user-int8 0) 2) + (let ((v0-0 (logclear (-> self mask) (process-mask sleep)))) + (set! (-> self mask) v0-0) + v0-0 + ) + ) ) + ) + ) + ) + ) ) :trans (-> (method-of-type crate die) trans) :code (behavior () @@ -983,7 +974,6 @@ (suspend) ) ) - (none) ) ) @@ -1272,7 +1262,6 @@ (if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0)) (spool-push *art-control* (-> self victory-anim name) 0 self -99.0) ) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1302,7 +1291,6 @@ ) (set! (-> self root-override trans y) (-> self base y)) ) - (none) ) :post (the-as (function none :behavior crate-buzzer) #f) ) @@ -1315,7 +1303,6 @@ (suspend) ) (go-virtual wait) - (none) ) ) @@ -1356,6 +1343,5 @@ ) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/engine/common-obs/dark-eco-pool.gc b/goal_src/jak1/engine/common-obs/dark-eco-pool.gc index 2e9d6667648..253660070e7 100644 --- a/goal_src/jak1/engine/common-obs/dark-eco-pool.gc +++ b/goal_src/jak1/engine/common-obs/dark-eco-pool.gc @@ -380,6 +380,5 @@ ) ) ) - (none) ) ) diff --git a/goal_src/jak1/engine/common-obs/generic-obs.gc b/goal_src/jak1/engine/common-obs/generic-obs.gc index 7669301a7a6..dca0fae7200 100644 --- a/goal_src/jak1/engine/common-obs/generic-obs.gc +++ b/goal_src/jak1/engine/common-obs/generic-obs.gc @@ -120,7 +120,6 @@ ) (suspend) ) - (none) ) ) @@ -136,7 +135,6 @@ ) ) (go swingpole-stance) - (none) ) ) @@ -186,202 +184,197 @@ (defstate manipy-idle (manipy) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (let ((v1-0 event-type)) - (the-as - object - (cond - ((= v1-0 'attackable) - (cond - ((-> event param 0) - (set! v0-0 (logior (process-mask attackable) (-> self mask))) - (set! (-> self mask) (the-as process-mask v0-0)) - ) - (else - (set! v0-0 (logclear (-> self mask) (process-mask attackable))) - (set! (-> self mask) (the-as process-mask v0-0)) - ) - ) - v0-0 + (case message + (('attackable) + (cond + ((-> block param 0) + (set! v0-0 (logior (process-mask attackable) (-> self mask))) + (set! (-> self mask) (the-as process-mask v0-0)) + ) + (else + (set! v0-0 (logclear (-> self mask) (process-mask attackable))) + (set! (-> self mask) (the-as process-mask v0-0)) ) - ((= v1-0 'blend-shape) - (cond - ((-> event param 0) - (set! v0-0 (logior (-> self skel status) (janim-status blerc eye))) - (set! (-> self skel status) (the-as janim-status v0-0)) - ) - (else - (set! v0-0 (logclear (-> self skel status) (janim-status blerc eye))) - (set! (-> self skel status) (the-as janim-status v0-0)) - ) - ) - v0-0 + ) + v0-0 + ) + (('blend-shape) + (cond + ((-> block param 0) + (set! v0-0 (logior (-> self skel status) (janim-status blerc eye))) + (set! (-> self skel status) (the-as janim-status v0-0)) + ) + (else + (set! v0-0 (logclear (-> self skel status) (janim-status blerc eye))) + (set! (-> self skel status) (the-as janim-status v0-0)) ) - ((= v1-0 'shadow) - (cond - ((-> event param 0) - (set! v0-0 (-> self shadow-backup)) - (set! (-> self draw shadow) (the-as shadow-geo v0-0)) - v0-0 - ) - (else - (set! (-> self draw shadow) #f) - #f + ) + v0-0 + ) + (('shadow) + (cond + ((-> block param 0) + (set! v0-0 (-> self shadow-backup)) + (set! (-> self draw shadow) (the-as shadow-geo v0-0)) + v0-0 + ) + (else + (set! (-> self draw shadow) #f) + #f + ) + ) + ) + (('trans-hook) + (set! v0-0 (-> block param 0)) + (set! (-> self new-trans-hook) (the-as (function none) v0-0)) + v0-0 + ) + (('post-hook) + (set! v0-0 (-> block param 0)) + (set! (-> self new-post-hook) (the-as (function none) v0-0)) + v0-0 + ) + (('eval) + ((the-as (function manipy none) (-> block param 0)) self) + ) + (('become-hud-object) + (convert-to-hud-object self (the-as hud (-> block param 0))) + ) + (('event-hook) + (set! v0-0 (-> block param 0)) + (set! (-> self cur-event-hook) (the-as (function none) v0-0)) + v0-0 + ) + (('art-joint-anim) + (set! (-> self new-joint-anim) + (the-as + art-joint-anim + (lookup-art (-> self draw art-group) (the-as string (-> block param 0)) art-joint-anim) ) ) - ) - ((= v1-0 'trans-hook) - (set! v0-0 (-> event param 0)) - (set! (-> self new-trans-hook) (the-as (function none) v0-0)) - v0-0 - ) - ((= v1-0 'post-hook) - (set! v0-0 (-> event param 0)) - (set! (-> self new-post-hook) (the-as (function none) v0-0)) + (set! v0-0 (-> block param 1)) + (set! (-> self new-joint-anim-blend) (the-as uint v0-0)) + v0-0 + ) + (('anim-mode) + (when (nonzero? (-> self skel)) + (set! (-> self anim-mode) (the-as symbol (-> block param 0))) + (if (= (-> self anim-mode) 'clone-anim) + (ja-post) + ) + (-> self anim-mode) + ) + ) + (('origin-joint-index 'center-joint) + (set! (-> self draw origin-joint-index) (-> block param 0)) + (set! v0-0 (-> block param 0)) + (set! (-> self draw shadow-joint-index) (the-as uint v0-0)) + v0-0 + ) + (('max-vis-dist) + (set! (-> self draw lod-set lod (-> self draw lod-set max-lod) dist) (the-as float (-> block param 0))) + ) + (('grab) + (set! (-> self cur-grab-handle) (process->handle (the-as process (-> block param 0)))) + (let ((v1-30 (handle->process (-> self cur-grab-handle)))) + (when v1-30 + (set! v0-0 (-> self old-grab-pos)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as process-drawable v1-30) root trans quad)) v0-0 ) - ((= v1-0 'eval) - (the-as object ((the-as (function manipy none) (-> event param 0)) self)) - ) - ((= v1-0 'become-hud-object) - (the-as object (convert-to-hud-object self (the-as hud (-> event param 0)))) - ) - ((= v1-0 'event-hook) - (set! v0-0 (-> event param 0)) - (set! (-> self cur-event-hook) (the-as (function none) v0-0)) + ) + ) + (('target) + (set! v0-0 (process->handle (the-as process (-> block param 0)))) + (set! (-> self cur-target-handle) (the-as handle v0-0)) + v0-0 + ) + (('trans) + (cond + ((type-type? (-> self root type) collide-shape) + (move-to-point! (the-as collide-shape (-> self root)) (the-as vector (-> block param 0))) + ) + (else + (set! v0-0 (-> self root trans)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> block param 0)) quad)) v0-0 ) - ((= v1-0 'art-joint-anim) - (set! (-> self new-joint-anim) - (the-as - art-joint-anim - (lookup-art (-> self draw art-group) (the-as string (-> event param 0)) art-joint-anim) + ) + ) + (('rot) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (matrix-rotate-y! s5-0 (the-as float (-> block param 0))) + (matrix->quaternion (-> self root quat) s5-0) + ) + ) + (('rot-quat) + (quaternion-copy! (-> self root quat) (the-as quaternion (-> block param 0))) + ) + (('clone-copy-trans) + (set! v0-0 (-> block param 0)) + (set! (-> self clone-copy-trans) (the-as symbol v0-0)) + v0-0 + ) + (('release) + (set! (-> self cur-grab-handle) (the-as handle #f)) + #f + ) + (('draw) + (set! (-> self draw?) (the-as symbol (-> block param 0))) + (cond + ((-> block param 0) + (let ((v1-47 (logtest? (-> self draw status) (draw-status hidden)))) + (logclear! (-> self draw status) (draw-status hidden)) + (when v1-47 + (cond + ((nonzero? (-> self skel)) + (let ((gp-1 (-> self skel status))) + (logior! (-> self skel status) (janim-status inited)) + (set! v0-0 (ja-post)) + (set! (-> self skel status) gp-1) ) + v0-0 ) - (set! v0-0 (-> event param 1)) - (set! (-> self new-joint-anim-blend) (the-as uint v0-0)) - v0-0 - ) - ((= v1-0 'anim-mode) - (when (nonzero? (-> self skel)) - (set! (-> self anim-mode) (the-as symbol (-> event param 0))) - (if (= (-> self anim-mode) 'clone-anim) - (ja-post) - ) - (-> self anim-mode) - ) - ) - ((or (= v1-0 'origin-joint-index) (= v1-0 'center-joint)) - (set! (-> self draw origin-joint-index) (-> event param 0)) - (set! v0-0 (-> event param 0)) - (set! (-> self draw shadow-joint-index) (the-as uint v0-0)) - v0-0 - ) - ((= v1-0 'max-vis-dist) - (set! (-> self draw lod-set lod (-> self draw lod-set max-lod) dist) (the-as float (-> event param 0))) - ) - ((= v1-0 'grab) - (set! (-> self cur-grab-handle) (process->handle (the-as process (-> event param 0)))) - (let ((v1-30 (handle->process (-> self cur-grab-handle)))) - (when v1-30 - (set! v0-0 (-> self old-grab-pos)) - (set! (-> (the-as vector v0-0) quad) (-> (the-as process-drawable v1-30) root trans quad)) - v0-0 - ) - ) - ) - ((= v1-0 'target) - (set! v0-0 (process->handle (the-as process (-> event param 0)))) - (set! (-> self cur-target-handle) (the-as handle v0-0)) - v0-0 - ) - ((= v1-0 'trans) - (cond - ((type-type? (-> self root type) collide-shape) - (the-as object (move-to-point! (the-as collide-shape (-> self root)) (the-as vector (-> event param 0)))) - ) - (else - (set! v0-0 (-> self root trans)) - (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> event param 0)) quad)) - v0-0 - ) - ) - ) - ((= v1-0 'rot) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (matrix-rotate-y! s5-0 (the-as float (-> event param 0))) - (matrix->quaternion (-> self root quat) s5-0) - ) - ) - ((= v1-0 'rot-quat) - (quaternion-copy! (-> self root quat) (the-as quaternion (-> event param 0))) - ) - ((= v1-0 'clone-copy-trans) - (set! v0-0 (-> event param 0)) - (set! (-> self clone-copy-trans) (the-as symbol v0-0)) - v0-0 - ) - ((= v1-0 'release) - (set! (-> self cur-grab-handle) (the-as handle #f)) - #f - ) - ((= v1-0 'draw) - (set! (-> self draw?) (the-as symbol (-> event param 0))) - (cond - ((-> event param 0) - (let ((v1-47 (logtest? (-> self draw status) (draw-status hidden)))) - (logclear! (-> self draw status) (draw-status hidden)) - (when v1-47 - (cond - ((nonzero? (-> self skel)) - (let ((gp-1 (-> self skel status))) - (logior! (-> self skel status) (janim-status inited)) - (set! v0-0 (the-as object (ja-post))) - (set! (-> self skel status) gp-1) - ) - v0-0 - ) - (else - (the-as object (ja-post)) - ) - ) + (else + (ja-post) ) ) ) - (else - (set! v0-0 (logior (-> self draw status) (draw-status hidden))) - (set! (-> self draw status) (the-as draw-status v0-0)) - v0-0 - ) - ) - ) - ((= v1-0 'query) - (case (-> event param 0) - (('grab) - (handle->process (-> self cur-grab-handle)) - ) - (('done) - (case (-> self anim-mode) - (('play1 'play) - (>= (ja-frame-num 0) (the float (+ (-> (ja-group) data 0 length) -2))) - ) - ) - ) - ) + ) + ) + (else + (set! v0-0 (logior (-> self draw status) (draw-status hidden))) + (set! (-> self draw status) (the-as draw-status v0-0)) + v0-0 ) - ((= v1-0 'set-frame-num) - (let ((v1-73 (-> self skel root-channel 0))) - (set! (-> v1-73 num-func) num-func-identity) - (set! (-> v1-73 frame-num) (the-as float (-> event param 0))) + ) + ) + (('query) + (case (-> block param 0) + (('grab) + (handle->process (-> self cur-grab-handle)) + ) + (('done) + (case (-> self anim-mode) + (('play1 'play) + (>= (ja-frame-num 0) (the float (+ (-> (ja-group) data 0 length) -2))) ) - ) - (else - (if (-> self cur-event-hook) - (the-as object ((-> self cur-event-hook))) - ) ) ) + ) + ) + (('set-frame-num) + (let ((v1-73 (-> self skel root-channel 0))) + (set! (-> v1-73 num-func) num-func-identity) + (set! (-> v1-73 frame-num) (the-as float (-> block param 0))) + ) + ) + (else + (if (-> self cur-event-hook) + ((-> self cur-event-hook)) + ) ) ) ) @@ -418,7 +411,6 @@ ) ) ((-> self cur-trans-hook)) - (none) ) :code (behavior () (logclear! (-> self mask) (process-mask heap-shrunk)) @@ -476,7 +468,6 @@ ) ) ) - (none) ) ) @@ -611,7 +602,6 @@ (part-tracker-notify) (suspend) 0 - (none) ) ) @@ -647,6 +637,7 @@ (none) ) +;; ERROR: Failed load: (set! a0-1 (l.wu (+ a0-0 -4))) at op 11 ;; WARN: disable def twice: 68. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. ;; WARN: disable def twice: 82. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. ;; WARN: disable def twice: 96. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. @@ -1085,26 +1076,25 @@ ) (defstate camera-tracker-process (camera-tracker) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 uint)) - (the-as object (case event-type - (('message) - (set! v0-0 (-> event param 0)) - (set! (-> self message) (the-as basic v0-0)) - v0-0 - ) - (('mask) - (set! v0-0 (-> event param 0)) - (set! (-> self mask-to-clear) (the-as process-mask v0-0)) - v0-0 - ) - (('border) - (set! v0-0 (-> event param 0)) - (set! (-> self border-value) (the-as basic v0-0)) - v0-0 - ) - ) - ) + (case message + (('message) + (set! v0-0 (-> block param 0)) + (set! (-> self message) (the-as basic v0-0)) + v0-0 + ) + (('mask) + (set! v0-0 (-> block param 0)) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) + v0-0 + ) + (('border) + (set! v0-0 (-> block param 0)) + (set! (-> self border-value) (the-as basic v0-0)) + v0-0 + ) + ) ) :enter (behavior () (if (-> self entity) @@ -1116,14 +1106,12 @@ (add-setting! 'process-mask 'set 0.0 (-> self mask-to-clear)) (add-setting! 'movie (process->ppointer self) 0.0 0) (hide-hud-quick) - (none) ) :exit (behavior () (if (-> self entity) (set-or-clear-status! (-> self entity) (entity-perm-status bit-3) #f) ) (send-event *camera* 'clear-entity) - (none) ) :code (behavior () (cond @@ -1143,10 +1131,10 @@ (suspend) (suspend) 0 - (none) ) ) +;; ERROR: Failed load: (set! a0-3 (l.wu (+ a0-0 -4))) at op 42 (defbehavior camera-tracker-init camera-tracker ((arg0 object)) (stack-size-set! (-> self main-thread) 512) (logclear! (-> self mask) (process-mask actor-pause movie enemy platform projectile)) @@ -1257,7 +1245,6 @@ ;; og:preserve-this (init-vf0-vector) ) - (none) ) ) :post (the-as (function none :behavior med-res-level) ja-post) @@ -1335,8 +1322,8 @@ ) (defstate part-spawner-active (part-spawner) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('stop) (process-entity-status! self (entity-perm-status complete) #t) (set! (-> self enable) #f) @@ -1348,7 +1335,7 @@ #t ) (('trans) - (let ((v0-1 (the-as object (-> (the-as vector (-> event param 0)) quad)))) + (let ((v0-1 (the-as object (-> (the-as vector (-> block param 0)) quad)))) (set! (-> self root trans quad) (the-as uint128 v0-1)) v0-1 ) @@ -1365,7 +1352,6 @@ ) (suspend) ) - (none) ) ) @@ -1709,13 +1695,13 @@ ) (defstate cam-launcher-shortfall (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -1738,13 +1724,11 @@ (set! (-> self blend-to-type) (the-as uint 0)) 0 ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (let ((gp-0 (-> *display* base-frame-counter))) @@ -1759,7 +1743,6 @@ (suspend) ) ) - (none) ) ) @@ -1783,13 +1766,13 @@ ) (defstate cam-launcher-longfall (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -1805,14 +1788,12 @@ (cam-calc-follow! (-> self tracking) (-> self trans) #f) (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (cam-launcher-long-joystick) - (none) ) :code (behavior () (let ((gp-0 (-> *display* base-frame-counter))) @@ -1873,18 +1854,17 @@ (suspend) ) ) - (none) ) ) (defstate launcher-idle (launcher) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('instant-death) (go launcher-deactivated) ) (('trans) - (move-to-point! (-> self root-override) (the-as vector (-> event param 0))) + (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) (update-transforms! (-> self root-override)) ) ) @@ -1918,23 +1898,22 @@ ) ) ) - (none) ) :code (the-as (function none :behavior launcher) anim-loop) ) (defstate launcher-active (launcher) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (when (or (= event-type 'touch) (= event-type 'attack)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (or (= message 'touch) (= message 'attack)) (set! (-> self state-time) (-> *display* base-frame-counter)) (send-event proc 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) (cond - ((= event-type 'instant-death) + ((= message 'instant-death) (go launcher-deactivated) ) - ((= event-type 'trans) - (move-to-point! (-> self root-override) (the-as vector (-> event param 0))) + ((= message 'trans) + (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) (update-transforms! (-> self root-override)) ) ) @@ -1949,7 +1928,6 @@ (set! (-> v1-0 parms mask) (sound-mask volume time)) (-> v1-0 id) ) - (none) ) :trans (behavior () (if (or (or (not *target*) (< (-> self active-distance) @@ -1970,12 +1948,10 @@ ) (send-event *target* 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) - (none) ) :code (behavior () (sound-play "launch-start") (anim-loop) - (none) ) ) @@ -2103,100 +2079,99 @@ ) (defstate touch-tracker-idle (touch-tracker) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (the-as object (case event-type - (('touched) - (let ((v1-1 (ppointer->process (-> self parent)))) - (when (!= v1-1 proc) - (cond - ((= (-> self event) 'attack) - (cond - ((= (-> proc type) target) - (send-event - proc - (-> self event) - :from (the-as process v1-1) - #f - (static-attack-info ((mode (the-as symbol (-> self event-mode))))) - ) - ) - ((= (-> v1-1 type) target) - (send-event - proc - (-> self event) - :from (the-as process v1-1) - #f - (-> self event-mode) - (-> *target* control unknown-dword50) - (-> *target* control unknown-dword51) - ) - ) - (else - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) (the-as process v1-1)) - (set! (-> a1-5 num-params) 4) - (set! (-> a1-5 message) (-> self event)) - (set! (-> a1-5 param 0) (the-as uint #f)) - (set! (-> a1-5 param 1) (the-as uint (-> self event-mode))) - (let ((v1-19 (+ *global-attack-id* 1))) - (set! *global-attack-id* v1-19) - (set! (-> a1-5 param 2) (the-as uint v1-19)) - ) - (set! (-> a1-5 param 3) (the-as uint 0)) - (send-event-function proc a1-5) - ) - ) - ) - ) - ((-> self event) - (send-event proc (-> self event) :from (the-as process v1-1)) - ) - (else - (let ((t0-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> t0-5 from) proc) - (set! (-> t0-5 num-params) arg1) - (set! (-> t0-5 message) event-type) - (set! (-> t0-5 param 0) (-> event param 0)) - (set! (-> t0-5 param 1) (-> event param 1)) - (set! (-> t0-5 param 2) (-> event param 2)) - (set! (-> t0-5 param 3) (-> event param 3)) - (set! (-> t0-5 param 4) (-> event param 4)) - (set! (-> t0-5 param 5) (-> event param 5)) - (set! (-> t0-5 param 6) (-> event param 6)) - (send-event-function v1-1 t0-5) - ) - ) - ) - ) - ) - ) - (('target) - (set! v0-0 (process->handle (the-as process (-> event param 0)))) - (set! (-> self target) (the-as handle v0-0)) - v0-0 - ) - (('event) - (set! (-> self event) (the-as symbol (-> event param 0))) - (set! v0-0 (-> event param 1)) - (set! (-> self event-mode) (the-as basic v0-0)) - v0-0 - ) - (('exit) - (set! v0-0 (-> event param 0)) - (set! (-> self run-function) (the-as (function object) v0-0)) - v0-0 - ) - (('eval) - (the-as object ((the-as (function touch-tracker none) (-> event param 0)) self)) - ) - (('function) - (set! v0-0 (-> event param 0)) - (set! (-> self callback) (the-as (function touch-tracker none) v0-0)) - v0-0 + (case message + (('touched) + (let ((v1-1 (ppointer->process (-> self parent)))) + (when (!= v1-1 proc) + (cond + ((= (-> self event) 'attack) + (cond + ((= (-> proc type) target) + (send-event + proc + (-> self event) + :from (the-as process v1-1) + #f + (static-attack-info ((mode (the-as symbol (-> self event-mode))))) + ) + ) + ((= (-> v1-1 type) target) + (send-event + proc + (-> self event) + :from (the-as process v1-1) + #f + (-> self event-mode) + (-> *target* control unknown-dword50) + (-> *target* control unknown-dword51) + ) + ) + (else + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (the-as process v1-1)) + (set! (-> a1-5 num-params) 4) + (set! (-> a1-5 message) (-> self event)) + (set! (-> a1-5 param 0) (the-as uint #f)) + (set! (-> a1-5 param 1) (the-as uint (-> self event-mode))) + (let ((v1-19 (+ *global-attack-id* 1))) + (set! *global-attack-id* v1-19) + (set! (-> a1-5 param 2) (the-as uint v1-19)) ) - ) - ) + (set! (-> a1-5 param 3) (the-as uint 0)) + (send-event-function proc a1-5) + ) + ) + ) + ) + ((-> self event) + (send-event proc (-> self event) :from (the-as process v1-1)) + ) + (else + (let ((t0-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> t0-5 from) proc) + (set! (-> t0-5 num-params) argc) + (set! (-> t0-5 message) message) + (set! (-> t0-5 param 0) (-> block param 0)) + (set! (-> t0-5 param 1) (-> block param 1)) + (set! (-> t0-5 param 2) (-> block param 2)) + (set! (-> t0-5 param 3) (-> block param 3)) + (set! (-> t0-5 param 4) (-> block param 4)) + (set! (-> t0-5 param 5) (-> block param 5)) + (set! (-> t0-5 param 6) (-> block param 6)) + (send-event-function v1-1 t0-5) + ) + ) + ) + ) + ) + ) + (('target) + (set! v0-0 (process->handle (the-as process (-> block param 0)))) + (set! (-> self target) (the-as handle v0-0)) + v0-0 + ) + (('event) + (set! (-> self event) (the-as symbol (-> block param 0))) + (set! v0-0 (-> block param 1)) + (set! (-> self event-mode) (the-as basic v0-0)) + v0-0 + ) + (('exit) + (set! v0-0 (-> block param 0)) + (set! (-> self run-function) (the-as (function object) v0-0)) + v0-0 + ) + (('eval) + ((the-as (function touch-tracker none) (-> block param 0)) self) + ) + (('function) + (set! v0-0 (-> block param 0)) + (set! (-> self callback) (the-as (function touch-tracker none) v0-0)) + v0-0 + ) + ) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -2236,7 +2211,6 @@ (clear-collide-with-as (-> self root-override)) (suspend) 0 - (none) ) ) diff --git a/goal_src/jak1/engine/common-obs/nav-enemy.gc b/goal_src/jak1/engine/common-obs/nav-enemy.gc index 1f6352f97ec..7f6fc3e9b33 100644 --- a/goal_src/jak1/engine/common-obs/nav-enemy.gc +++ b/goal_src/jak1/engine/common-obs/nav-enemy.gc @@ -141,7 +141,7 @@ (send-event arg0 'get-attack-count 1) (logclear! (-> obj mask) (process-mask actor-pause attackable)) (go (method-of-object obj nav-enemy-die)) - (the-as object 'die) + 'die ) (defmethod attack-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) @@ -158,20 +158,17 @@ ) (defbehavior nav-enemy-send-attack nav-enemy ((arg0 process) (arg1 touching-shapes-entry) (arg2 symbol)) - (the-as - object - (when (send-event - arg0 - 'attack - arg1 - (static-attack-info - ((shove-back (-> self nav-info attack-shove-back)) (shove-up (-> self nav-info attack-shove-up)) (mode arg2)) - ) + (when (send-event + arg0 + 'attack + arg1 + (static-attack-info + ((shove-back (-> self nav-info attack-shove-back)) (shove-up (-> self nav-info attack-shove-up)) (mode arg2)) ) - (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) - #t - ) + ) + (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) + #t ) ) @@ -205,7 +202,10 @@ (('cue-jump-to-point) (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) (set! (-> self event-param-point quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) + (let ((v0-0 (the-as object (logclear (-> self nav-enemy-flags) (nav-enemy-flags navenmf11))))) + (set! (-> self nav-enemy-flags) (the-as nav-enemy-flags v0-0)) + v0-0 + ) ) ) (('cue-chase) @@ -218,7 +218,6 @@ (go-virtual nav-enemy-wait-for-cue) ) ) - (none) ) (defbehavior nav-enemy-jump-event-handler nav-enemy ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) @@ -240,10 +239,12 @@ (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0) ) (('death-end) - (logior! (-> self draw status) (draw-status hidden)) + (let ((v0-0 (the-as object (logior (-> self draw status) (draw-status hidden))))) + (set! (-> self draw status) (the-as draw-status v0-0)) + v0-0 + ) ) ) - (none) ) nav-enemy-default-event-handler @@ -739,10 +740,7 @@ nav-enemy-default-event-handler (defstate nav-enemy-idle (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (nav-enemy-neck-control-inactive) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -751,7 +749,6 @@ nav-enemy-default-event-handler ) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1 navenmf2)) (set! (-> self state-timeout) (seconds 1)) - (none) ) :trans (behavior () (if (and (and *target* (>= (-> self enemy-info idle-distance) @@ -764,7 +761,6 @@ nav-enemy-default-event-handler ) (go-virtual nav-enemy-patrol) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -776,17 +772,13 @@ nav-enemy-default-event-handler (ja :num! (loop! f30-0)) ) ) - (none) ) :post (the-as (function none :behavior nav-enemy) ja-post) ) (defstate nav-enemy-patrol (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self nav flags) @@ -799,11 +791,9 @@ nav-enemy-default-event-handler (set! (-> self acceleration) (-> self nav-info walk-acceleration)) (set! (-> self rotate-speed) (-> self nav-info walk-rotate-speed)) (set! (-> self turn-time) (-> self nav-info walk-turn-time)) - (none) ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) @@ -836,7 +826,6 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-notice) ) ) - (none) ) :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) @@ -887,17 +876,13 @@ nav-enemy-default-event-handler ) ) ) - (none) ) :post nav-enemy-patrol-post ) (defstate nav-enemy-notice (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-neck-control-look-at) @@ -913,7 +898,6 @@ nav-enemy-default-event-handler (nav-control-method-11 (-> self nav) (-> self nav target-pos)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -934,7 +918,6 @@ nav-enemy-default-event-handler ) ) (go-virtual nav-enemy-chase) - (none) ) :post nav-enemy-simple-post ) @@ -945,13 +928,9 @@ nav-enemy-default-event-handler (defstate nav-enemy-flee (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-time)) @@ -966,7 +945,6 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-patrol) ) ) - (none) ) :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) @@ -991,7 +969,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) :post nav-enemy-face-player-post ) @@ -1020,10 +997,7 @@ nav-enemy-default-event-handler (defstate nav-enemy-chase (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (nav-enemy-neck-control-look-at) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1034,7 +1008,6 @@ nav-enemy-default-event-handler (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) (nav-enemy-reset-frustration) - (none) ) :trans (behavior () (if (logtest? (-> *target* state-flags) (state-flags do-not-notice)) @@ -1072,7 +1045,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1084,17 +1056,13 @@ nav-enemy-default-event-handler (ja :num! (loop! f30-0)) ) ) - (none) ) :post nav-enemy-chase-post ) (defstate nav-enemy-stop-chase (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (let* ((f30-0 (vector-vector-distance (-> self collide-info trans) (target-pos 0))) @@ -1109,7 +1077,6 @@ nav-enemy-default-event-handler (set! (-> self acceleration) (-> self nav-info walk-acceleration)) (set! (-> self rotate-speed) (-> self nav-info walk-rotate-speed)) (set! (-> self turn-time) (-> self nav-info walk-turn-time)) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) @@ -1129,7 +1096,6 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-stare) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1141,17 +1107,13 @@ nav-enemy-default-event-handler (ja :num! (loop! f30-0)) ) ) - (none) ) :post nav-enemy-chase-post ) (defstate nav-enemy-stare (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) @@ -1166,11 +1128,9 @@ nav-enemy-default-event-handler (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) (set! (-> self collide-info transv quad) (-> *null-vector* quad)) - (none) ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) @@ -1212,26 +1172,20 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-give-up) ) ) - (none) ) :code (behavior () (go-virtual nav-enemy-give-up) - (none) ) :post nav-enemy-face-player-post ) (defstate nav-enemy-give-up (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (nav-enemy-neck-control-inactive) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) @@ -1239,37 +1193,27 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-chase) ) ) - (none) ) :code (behavior () (go-virtual nav-enemy-patrol) - (none) ) :post nav-enemy-simple-post ) (defstate nav-enemy-attack (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :code (behavior () (go-virtual nav-enemy-victory) - (none) ) :post nav-enemy-simple-post ) (defstate nav-enemy-victory (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self collide-info transv quad) (-> *null-vector* quad)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1284,7 +1228,6 @@ nav-enemy-default-event-handler ) ) (go-virtual nav-enemy-stare) - (none) ) :post nav-enemy-simple-post ) @@ -1297,7 +1240,6 @@ nav-enemy-default-event-handler ) :enter (behavior () (send-event (ppointer->process (-> self parent)) 'child-die) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1317,7 +1259,6 @@ nav-enemy-default-event-handler (suspend) ) (cleanup-for-death self) - (none) ) :post nav-enemy-death-post ) @@ -1352,7 +1293,6 @@ nav-enemy-default-event-handler ) ) (cleanup-for-death self) - (none) ) ) @@ -1509,11 +1449,9 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-jump-blocked) ) (nav-enemy-initialize-jump (-> self event-param-point)) - (none) ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) - (none) ) :code (behavior () (nav-enemy-execute-jump) @@ -1526,7 +1464,6 @@ nav-enemy-default-event-handler ) ) (go-virtual nav-enemy-jump-land) - (none) ) :post nav-enemy-jump-post ) @@ -1582,10 +1519,7 @@ nav-enemy-default-event-handler (defstate nav-enemy-jump-land (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self nav flags) (nav-control-flags navcf19)) @@ -1597,7 +1531,6 @@ nav-enemy-default-event-handler (vector-xz-normalize! gp-0 16384.0) (vector+! (-> self nav target-pos) (-> self collide-info trans) gp-0) ) - (none) ) :trans (behavior () (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) @@ -1605,31 +1538,24 @@ nav-enemy-default-event-handler ) (go-virtual nav-enemy-chase) ) - (none) ) :code (behavior () (nav-enemy-jump-land-anim) (go (-> self jump-return-state)) - (none) ) :post nav-enemy-jump-land-post ) (defstate nav-enemy-jump-blocked (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) (go (-> self jump-return-state)) ) - (none) ) :code (behavior () (when (not (ja-group? (-> self draw art-group data (-> self nav-info idle-anim)))) @@ -1644,17 +1570,13 @@ nav-enemy-default-event-handler (ja :num! (loop! f30-0)) ) ) - (none) ) :post nav-enemy-simple-post ) (defstate nav-enemy-wait-for-cue (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) @@ -1678,7 +1600,6 @@ nav-enemy-default-event-handler ) ) (go-virtual nav-enemy-jump-to-point) - (none) ) :post nav-enemy-simple-post ) @@ -1688,11 +1609,9 @@ nav-enemy-default-event-handler :event nav-enemy-jump-event-handler :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) - (none) ) :trans (behavior () 0 - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1709,7 +1628,6 @@ nav-enemy-default-event-handler (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (nav-enemy-jump-land-anim) (go-virtual nav-enemy-wait-for-cue) - (none) ) :post nav-enemy-jump-post ) diff --git a/goal_src/jak1/engine/common-obs/orb-cache.gc b/goal_src/jak1/engine/common-obs/orb-cache.gc index 94ad024eb80..a3d3a30bd5f 100644 --- a/goal_src/jak1/engine/common-obs/orb-cache.gc +++ b/goal_src/jak1/engine/common-obs/orb-cache.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype orb-cache-top (baseplat) ((active-distance float :offset-assert 228) (inactive-distance float :offset-assert 232) @@ -41,8 +40,8 @@ ) (defstate orb-cache-top-idle (orb-cache-top) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('eco-blue) (process-entity-status! self (entity-perm-status complete) #t) (dotimes (gp-0 5) @@ -52,7 +51,7 @@ (go orb-cache-top-activate #f) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -68,7 +67,6 @@ (game-task none) ) ) - (none) ) :code (behavior ((arg0 symbol)) (if (and (not arg0) (-> self child)) @@ -85,7 +83,6 @@ (ja :group! (-> self draw art-group data 3) :num! (identity (ja-aframe 0.0 0))) (transform-post) (anim-loop) - (none) ) ) @@ -196,7 +193,6 @@ :event (the-as (function process int symbol event-message-block object :behavior orb-cache-top) plat-event) :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :trans (the-as (function none :behavior orb-cache-top) plat-trans) :code (behavior ((arg0 symbol)) @@ -264,7 +260,6 @@ (go orb-cache-top-idle arg0) ) ) - (none) ) :post (the-as (function none :behavior orb-cache-top) plat-post) ) @@ -280,7 +275,6 @@ (new 'stack-no-clear 'vector) (set! (-> self basetrans y) (+ 2048.0 (-> self root-pos))) (anim-loop) - (none) ) :post (the-as (function none :behavior orb-cache-top) plat-post) ) diff --git a/goal_src/jak1/engine/common-obs/plat-button.gc b/goal_src/jak1/engine/common-obs/plat-button.gc index 641e2194e69..7c791a8265f 100644 --- a/goal_src/jak1/engine/common-obs/plat-button.gc +++ b/goal_src/jak1/engine/common-obs/plat-button.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype plat-button (process-drawable) ((root-override collide-shape-moving :offset 112) (go-back-if-lost-player? symbol :offset-assert 176) @@ -57,12 +56,12 @@ (defstate plat-button-idle (plat-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (when (can-activate? self) (if (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self root-override) (the-as uint 1) ) @@ -104,7 +103,6 @@ (suspend) ) ) - (none) ) ) @@ -124,7 +122,6 @@ ) (ja-post) (go-virtual plat-button-idle) - (none) ) ) @@ -143,7 +140,6 @@ (go-virtual plat-button-move-downward) (go-virtual plat-button-move-upward) ) - (none) ) :post (the-as (function none :behavior plat-button) rider-post) ) @@ -166,24 +162,21 @@ (defstate plat-button-move-downward (plat-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (when (or (= event-type 'touch) (= event-type 'attack)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - #f - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (or (= message 'touch) (= message 'attack)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + #f + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (process-entity-status! self (entity-perm-status bit-3) #t) (plat-button-camera-on) (set-setting! 'allow-look-around #f 0.0 0) - (none) ) :exit (behavior () (plat-button-camera-off) (remove-setting! 'allow-look-around) - (none) ) :trans (behavior () (if (= (-> self path-pos) 1.0) @@ -232,7 +225,6 @@ (if (and (-> self grab-player?) (< 0.2 (-> self path-pos))) (set! (-> self grab-player?) (not (process-release? *target*))) ) - (none) ) :code (the-as (function none :behavior plat-button) anim-loop) :post (the-as (function none :behavior plat-button) rider-post) @@ -240,24 +232,21 @@ (defstate plat-button-move-upward (plat-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (when (or (= event-type 'touch) (= event-type 'attack)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - #f - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (or (= message 'touch) (= message 'attack)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + #f + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (process-entity-status! self (entity-perm-status bit-3) #t) (plat-button-camera-on) (set-setting! 'allow-look-around #f 0.0 0) - (none) ) :exit (behavior () (plat-button-camera-off) (remove-setting! 'allow-look-around) - (none) ) :trans (behavior () (if (= (-> self path-pos) 0.0) @@ -306,7 +295,6 @@ (if (and (-> self grab-player?) (< (-> self path-pos) 0.8)) (set! (-> self grab-player?) (not (process-release? *target*))) ) - (none) ) :code (the-as (function none :behavior plat-button) anim-loop) :post (the-as (function none :behavior plat-button) rider-post) @@ -328,7 +316,6 @@ ) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/engine/common-obs/plat-eco.gc b/goal_src/jak1/engine/common-obs/plat-eco.gc index f7058e0cea5..1d3f16550ca 100644 --- a/goal_src/jak1/engine/common-obs/plat-eco.gc +++ b/goal_src/jak1/engine/common-obs/plat-eco.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype plat-eco (plat) ((notice-dist float :offset-assert 264) (sync-offset-dest float :offset-assert 268) @@ -39,8 +38,8 @@ (defstate plat-idle (plat-eco) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('wake) (go-virtual plat-path-active (the-as plat #f)) ) @@ -57,7 +56,6 @@ ) :enter (behavior () (lods-assign! (-> self draw) (-> self unlit-look)) - (none) ) :trans (behavior () (when (and (and *target* @@ -73,21 +71,19 @@ ) (level-hint-spawn (text-id misty-eco-plat) "sksp0073" (the-as entity #f) *entity-pool* (game-task none)) ) - (none) ) :code (behavior () (ja-post) (update-transforms! (-> self root-override)) (anim-loop) - (none) ) :post (the-as (function none :behavior plat-eco) ja-post) ) (defstate notice-blue (plat-eco) :virtual override - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('wake) (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) (go-virtual plat-path-active (the-as plat #f)) @@ -114,7 +110,6 @@ (go-virtual plat-idle) ) ) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self target) arg0) @@ -168,12 +163,10 @@ ) (suspend) ) - (none) ) :post (behavior () (plat-trans) (plat-post) - (none) ) ) @@ -207,7 +200,6 @@ ) ) ) - (none) ) :trans (behavior () (when (!= (-> self sync-offset-faux) (-> self sync-offset-dest)) @@ -219,7 +211,6 @@ ) ) ((-> (method-of-type plat plat-path-active) trans)) - (none) ) ) diff --git a/goal_src/jak1/engine/common-obs/plat.gc b/goal_src/jak1/engine/common-obs/plat.gc index ef551d20150..382bea17012 100644 --- a/goal_src/jak1/engine/common-obs/plat.gc +++ b/goal_src/jak1/engine/common-obs/plat.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defpartgroup group-standard-plat :id 107 :bounds (static-bspherem 0 -12 0 14) @@ -188,7 +187,6 @@ (go-virtual plat-idle) ) ) - (none) ) ) @@ -197,7 +195,6 @@ :event (the-as (function process int symbol event-message-block object :behavior plat) plat-event) :trans (behavior () (baseplat-method-20 self) - (none) ) :code (behavior () (plat-trans) @@ -217,7 +214,6 @@ (suspend) ) ) - (none) ) ) @@ -226,7 +222,6 @@ :event (the-as (function process int symbol event-message-block object :behavior plat) plat-event) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (set! (-> self path-pos) (if (logtest? (-> self fact options) (fact-options wrap-phase)) @@ -239,7 +234,6 @@ (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) - (none) ) :code (the-as (function plat none :behavior plat) anim-loop) :post (the-as (function none :behavior plat) plat-post) diff --git a/goal_src/jak1/engine/common-obs/process-taskable.gc b/goal_src/jak1/engine/common-obs/process-taskable.gc index 841d1ddf7cc..45cc27811f2 100644 --- a/goal_src/jak1/engine/common-obs/process-taskable.gc +++ b/goal_src/jak1/engine/common-obs/process-taskable.gc @@ -300,7 +300,6 @@ ) (process-taskable-method-33 self) ((-> self cur-trans-hook)) - (none) ) :code process-taskable-anim-loop :post (the-as (function none :behavior process-taskable) ja-post) @@ -333,7 +332,6 @@ (go-virtual release) (process-taskable-method-33 self) ((-> self cur-trans-hook)) - (none) ) :code process-taskable-anim-loop :post (the-as (function none :behavior process-taskable) ja-post) @@ -343,7 +341,6 @@ :virtual #t :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 5)) @@ -354,7 +351,6 @@ (go-virtual idle) ) ((-> self cur-trans-hook)) - (none) ) :code process-taskable-anim-loop :post (the-as (function none :behavior process-taskable) ja-post) @@ -501,7 +497,6 @@ :trans (behavior () (process-taskable-play-anim-trans) ((-> self cur-trans-hook)) - (none) ) :code (behavior () (process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (get-accept-anim self #t)) @@ -509,7 +504,6 @@ (suspend) ) (go-virtual enter-playing) - (none) ) :post (the-as (function none :behavior process-taskable) ja-post) ) @@ -521,12 +515,10 @@ :trans (behavior () (process-taskable-play-anim-trans) ((-> self cur-trans-hook)) - (none) ) :code (behavior () (process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (get-reject-anim self #t)) (go-virtual release) - (none) ) :post (the-as (function none :behavior process-taskable) ja-post) ) @@ -543,7 +535,6 @@ #f (lookup-text! *common-text* (text-id quit) #f) ) - (none) ) :exit process-taskable-play-anim-exit :trans (behavior () @@ -575,7 +566,6 @@ (push-reject-anim self) (set! *camera-look-through-other* 2) ((-> self cur-trans-hook)) - (none) ) :code process-taskable-anim-loop :post (the-as (function none :behavior process-taskable) ja-post) @@ -583,11 +573,11 @@ (defstate play-anim (process-taskable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('shadow) (cond - ((-> event param 0) + ((-> block param 0) (let ((v0-0 (the-as object (-> self shadow-backup)))) (set! (-> self draw shadow) (the-as shadow-geo v0-0)) v0-0 @@ -602,10 +592,10 @@ (('shadow-min-max) (let ((v1-5 (-> self draw shadow-ctrl))) (let ((a0-4 v1-5)) - (set! (-> a0-4 settings bot-plane w) (- (the-as float (-> event param 0)))) + (set! (-> a0-4 settings bot-plane w) (- (the-as float (-> block param 0)))) ) 0 - (set! (-> v1-5 settings top-plane w) (- (the-as float (-> event param 1)))) + (set! (-> v1-5 settings top-plane w) (- (the-as float (-> block param 1)))) ) 0 ) @@ -621,12 +611,10 @@ ) ) ((-> self cur-trans-hook)) - (none) ) :code (behavior () (process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (play-anim! self #t)) (process-taskable-method-38 self) - (none) ) :post (the-as (function none :behavior process-taskable) ja-post) ) @@ -657,7 +645,6 @@ (go-virtual hidden-other) ) ) - (none) ) (defbehavior process-taskable-hide-enter process-taskable () @@ -693,14 +680,10 @@ (defstate hidden (process-taskable) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior process-taskable) - process-taskable-hide-handler - ) + :event process-taskable-hide-handler :enter (the-as (function none :behavior process-taskable) process-taskable-hide-enter) :exit (behavior () (process-taskable-hide-exit (= (-> self next-state name) 'hidden)) - (none) ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -709,7 +692,6 @@ (if (or (-> self been-kicked) (should-display? self)) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior process-taskable) anim-loop) ) @@ -728,14 +710,10 @@ (defstate hidden-other (process-taskable) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior process-taskable) - process-taskable-hide-handler - ) + :event process-taskable-hide-handler :enter (the-as (function none :behavior process-taskable) process-taskable-hide-enter) :exit (behavior () (process-taskable-hide-exit (= (-> self next-state name) 'hidden-other)) - (none) ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -752,18 +730,17 @@ ) ) ) - (none) ) :code (the-as (function none :behavior process-taskable) anim-loop) ) (defstate be-clone (process-taskable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as shadow-geo (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (the-as shadow-geo (case message (('shadow) (the-as shadow-geo (cond - ((-> event param 0) + ((-> block param 0) (let ((v0-0 (-> self shadow-backup))) (set! (-> self draw shadow) v0-0) v0-0 @@ -779,10 +756,10 @@ (('shadow-min-max) (let ((v1-5 (-> self draw shadow-ctrl))) (let ((a0-5 v1-5)) - (set! (-> a0-5 settings bot-plane w) (- (the-as float (-> event param 0)))) + (set! (-> a0-5 settings bot-plane w) (- (the-as float (-> block param 0)))) ) 0 - (set! (-> v1-5 settings top-plane w) (- (the-as float (-> event param 1)))) + (set! (-> v1-5 settings top-plane w) (- (the-as float (-> block param 1)))) ) (the-as shadow-geo 0) ) @@ -800,7 +777,6 @@ (logior! (-> self skel status) (janim-status blerc)) (logclear! (-> self mask) (process-mask actor-pause)) (set-vector! (-> self draw bounds) 0.0 (-> self draw-bounds-y-offset) 0.0 (-> self draw bounds w)) - (none) ) :exit (behavior () (logclear! (-> self skel status) (janim-status blerc spool)) @@ -811,18 +787,15 @@ ) ) (ja-channel-set! 0) - (none) ) :trans (behavior () (draw-npc-shadow self) ((-> self cur-trans-hook)) - (none) ) :code (behavior ((arg0 handle)) (clone-anim arg0 (-> self center-joint-index) #t "") (format #t "ERROR: handle invalid while ~S is cloning~%" (-> self name)) (go-virtual hidden) - (none) ) ) @@ -832,10 +805,10 @@ (defstate idle (process-taskable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (the-as - object - (case event-type + symbol + (case message (('attack) (the-as symbol @@ -851,7 +824,7 @@ (the-as symbol (send-shove-back (-> self root-override) proc - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0 @@ -859,7 +832,7 @@ ) ) (('clone) - (the-as symbol (go-virtual be-clone (the-as handle (-> event param 0)))) + (the-as symbol (go-virtual be-clone (the-as handle (-> block param 0)))) ) (('play-anim) (logclear! (-> self mask) (process-mask actor-pause)) @@ -877,7 +850,6 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (process-taskable-clean-up-after-talking) - (none) ) :exit (behavior () (cond @@ -894,7 +866,6 @@ (apply-settings *setting-control*) ) ) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) @@ -982,7 +953,6 @@ (go-virtual play-anim) ) ((-> self cur-trans-hook)) - (none) ) :code process-taskable-anim-loop :post (behavior () @@ -997,7 +967,6 @@ ) ) (transform-post) - (none) ) ) @@ -1123,9 +1092,9 @@ ) (defstate othercam-running (othercam) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('die) (set! v0-0 #t) (set! (-> self die?) (the-as symbol v0-0)) @@ -1133,13 +1102,13 @@ ) (('joint) (let ((t9-0 type-type?) - (v1-1 (-> event param 0)) + (v1-1 (-> block param 0)) ) (cond ((t9-0 (rtype-of v1-1) string) (let ((v1-8 (lookup-art (-> (the-as process-taskable (-> self hand process 0)) draw jgeo) - (the-as string (-> event param 0)) + (the-as string (-> block param 0)) (the-as type #f) ) ) @@ -1151,8 +1120,8 @@ ) ) ) - ((not (logtest? (-> event param 0) 7)) - (set! v0-0 (-> event param 0)) + ((not (logtest? (-> block param 0) 7)) + (set! v0-0 (-> block param 0)) (set! (-> self cam-joint-index) (the-as int v0-0)) v0-0 ) @@ -1160,7 +1129,7 @@ ) ) (('mask) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self mask-to-clear) (the-as process-mask v0-0)) v0-0 ) @@ -1190,12 +1159,10 @@ ) ) (apply-settings *setting-control*) - (none) ) :exit (behavior () (remove-setting! 'process-mask) (apply-settings *setting-control*) - (none) ) :code (behavior () (loop @@ -1259,7 +1226,6 @@ ) ) ) - (none) ) ) diff --git a/goal_src/jak1/engine/common-obs/rigid-body.gc b/goal_src/jak1/engine/common-obs/rigid-body.gc index 176a211baa0..b11bc730d72 100644 --- a/goal_src/jak1/engine/common-obs/rigid-body.gc +++ b/goal_src/jak1/engine/common-obs/rigid-body.gc @@ -621,13 +621,11 @@ ) (go-virtual rigid-body-platform-float) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior rigid-body-platform) ja-post) ) @@ -642,13 +640,11 @@ ) (go-virtual rigid-body-platform-idle) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior rigid-body-platform) rigid-body-platform-post) ) diff --git a/goal_src/jak1/engine/common-obs/ropebridge.gc b/goal_src/jak1/engine/common-obs/ropebridge.gc index e5bba1e707a..aff077f3922 100644 --- a/goal_src/jak1/engine/common-obs/ropebridge.gc +++ b/goal_src/jak1/engine/common-obs/ropebridge.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype ropebridge-tuning (structure) ((num-springs int32 :offset-assert 0) (num-spring-points int32 :offset-assert 4) @@ -544,20 +543,20 @@ ) (defstate ropebridge-idle (ropebridge) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (let ((f0-0 -1.0)) (cond - ((= event-type 'bonk) + ((= message 'bonk) (when (>= (- (-> *display* base-frame-counter) (-> self bonk-time-stamp)) (seconds 0.2)) (set! (-> self bonk-time-stamp) (-> *display* base-frame-counter)) - (set! f0-0 (the-as float (-> event param 1))) + (set! f0-0 (the-as float (-> block param 1))) (if (>= f0-0 (-> self tuning rider-bonk-max)) (set! f0-0 (-> self tuning rider-bonk-max)) ) ) ) - ((and (= event-type 'attack) (= (-> event param 1) 'flop)) - (let ((v1-17 (-> event param 2))) + ((and (= message 'attack) (= (-> block param 1) 'flop)) + (let ((v1-17 (-> block param 2))) (when (!= v1-17 (-> self player-attack-id)) (set! (-> self player-attack-id) v1-17) (set! (-> self attack-flop-time-stamp) (-> *display* base-frame-counter)) @@ -566,30 +565,27 @@ ) ) ) - (the-as - object - (when (and (>= f0-0 (-> self tuning rider-bonk-min)) (-> event param 0)) - (set! (-> self agitated-time-stamp) (-> *display* base-frame-counter)) - (let* ((f30-0 (/ (* (- f0-0 (-> self tuning rider-bonk-min)) (-> self tuning rider-bonk-force)) - (- (-> self tuning rider-bonk-max) (-> self tuning rider-bonk-min)) - ) - ) - (gp-0 (the-as object (-> event param 0))) - (a0-7 (-> (the-as touching-shapes-entry gp-0) head)) - (s4-0 (-> self root-override)) - (s5-0 (get-touched-prim a0-7 s4-0 (the-as touching-shapes-entry gp-0))) - (v1-33 ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s4-0)) - (gp-1 (new 'stack-no-clear 'vector)) - ) - (vector-matrix*! gp-1 (-> v1-33 trans) (-> self inv-world-matrix)) - (let ((s5-1 (-> s5-0 prim-id))) - (let ((v1-37 (-> self spring-point s5-1))) - (new 'stack-no-clear 'vector) - (&+ v1-37 48) - ) - (set-vel-from-impact self s5-1 gp-1 -1 f30-0) - (set-vel-from-impact self (+ s5-1 1) gp-1 1 f30-0) + (when (and (>= f0-0 (-> self tuning rider-bonk-min)) (-> block param 0)) + (set! (-> self agitated-time-stamp) (-> *display* base-frame-counter)) + (let* ((f30-0 (/ (* (- f0-0 (-> self tuning rider-bonk-min)) (-> self tuning rider-bonk-force)) + (- (-> self tuning rider-bonk-max) (-> self tuning rider-bonk-min)) + ) + ) + (gp-0 (the-as object (-> block param 0))) + (a0-7 (-> (the-as touching-shapes-entry gp-0) head)) + (s4-0 (-> self root-override)) + (s5-0 (get-touched-prim a0-7 s4-0 (the-as touching-shapes-entry gp-0))) + (v1-33 ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s4-0)) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (vector-matrix*! gp-1 (-> v1-33 trans) (-> self inv-world-matrix)) + (let ((s5-1 (-> s5-0 prim-id))) + (let ((v1-37 (-> self spring-point s5-1))) + (new 'stack-no-clear 'vector) + (&+ v1-37 48) ) + (set-vel-from-impact self s5-1 gp-1 -1 f30-0) + (set-vel-from-impact self (+ s5-1 1) gp-1 1 f30-0) ) ) ) @@ -619,7 +615,6 @@ ) ) ) - (none) ) :post (behavior () (ja-post) @@ -631,7 +626,6 @@ ) ) 0 - (none) ) ) diff --git a/goal_src/jak1/engine/common-obs/sharkey.gc b/goal_src/jak1/engine/common-obs/sharkey.gc index e637f4b0036..d271fd9a653 100644 --- a/goal_src/jak1/engine/common-obs/sharkey.gc +++ b/goal_src/jak1/engine/common-obs/sharkey.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defpartgroup group-sharkey-splash :id 106 :duration (seconds 0.4) @@ -63,11 +62,11 @@ ) (defmethod touch-handler sharkey ((obj sharkey) (arg0 process) (arg1 event-message-block)) - (the-as object #t) + #t ) (defmethod attack-handler sharkey ((obj sharkey) (arg0 process) (arg1 event-message-block)) - (the-as object #t) + #t ) nav-enemy-default-event-handler @@ -216,11 +215,9 @@ nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (cond @@ -257,7 +254,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -273,7 +269,6 @@ nav-enemy-default-event-handler ) (logior! (-> self draw status) (draw-status hidden)) (anim-loop) - (none) ) :post (the-as (function none :behavior sharkey) #f) ) @@ -288,7 +283,6 @@ nav-enemy-default-event-handler (if (sharkey-notice-player?) (go-virtual nav-enemy-chase) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -314,11 +308,9 @@ nav-enemy-default-event-handler (ja :num! (seek! max (-> self anim-speed))) ) ) - (none) ) :post (behavior () (nav-enemy-travel-post) - (none) ) ) @@ -330,11 +322,9 @@ nav-enemy-default-event-handler ) :enter (behavior () (go-virtual nav-enemy-chase) - (none) ) :code (behavior () (go-virtual nav-enemy-chase) - (none) ) ) @@ -413,11 +403,9 @@ nav-enemy-default-event-handler (sharkey-reset-position) (logior! (-> self draw status) (draw-status hidden)) (go-virtual nav-enemy-idle) - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -429,7 +417,6 @@ nav-enemy-default-event-handler ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (if (not *target*) @@ -479,7 +466,6 @@ nav-enemy-default-event-handler (set! (-> self target-speed) (-> self chase-speed)) ) ) - (none) ) :code (behavior () (set! (-> self player-water-time) (-> *display* base-frame-counter)) @@ -496,7 +482,6 @@ nav-enemy-default-event-handler (ja :num! (seek! max (-> self anim-speed))) ) ) - (none) ) :post (behavior () (sharkey-get-player-position (-> self nav target-pos)) @@ -512,7 +497,6 @@ nav-enemy-default-event-handler :position (the-as symbol (-> self collide-info trans)) ) ) - (none) ) ) @@ -536,7 +520,6 @@ nav-enemy-default-event-handler (ja :num! (seek! max (-> self anim-speed))) ) ) - (none) ) ) @@ -553,7 +536,6 @@ nav-enemy-default-event-handler (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) (go-virtual nav-enemy-patrol) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.17)) @@ -565,7 +547,6 @@ nav-enemy-default-event-handler (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) (suspend) ) - (none) ) ) @@ -588,7 +569,6 @@ nav-enemy-default-event-handler ) ) (go-virtual nav-enemy-stare) - (none) ) ) diff --git a/goal_src/jak1/engine/common-obs/voicebox.gc b/goal_src/jak1/engine/common-obs/voicebox.gc index 4fe77f282bc..05fa8bf803b 100644 --- a/goal_src/jak1/engine/common-obs/voicebox.gc +++ b/goal_src/jak1/engine/common-obs/voicebox.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype camera-voicebox (camera-slave) () :heap-base #x9a0 @@ -112,8 +111,8 @@ (defstate enter (voicebox) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go-virtual exit) ) @@ -124,7 +123,6 @@ (if (< 0.1 (-> self blend)) (point-toward-point-clear-roll-pitch! (-> self root) (target-pos 0)) ) - (none) ) :code (behavior () (set-setting! 'sound-flava #f 20.0 (music-flava assistant)) @@ -151,7 +149,6 @@ ) (set! (-> self blend) 0.0) (go-virtual idle) - (none) ) :post (the-as (function none :behavior voicebox) ja-post) ) @@ -165,7 +162,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior voicebox) ja-post) ) @@ -192,7 +188,6 @@ (send-event (ppointer->process (-> self parent-override)) 'go empty-state) (suspend) 0 - (none) ) :post (the-as (function none :behavior voicebox) ja-post) ) @@ -212,10 +207,9 @@ :event (-> cam-string event) :enter (-> cam-string enter) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (deactivate self) ) - (none) ) :code (-> cam-string code) ) @@ -230,7 +224,3 @@ ) ) ) - - - - diff --git a/goal_src/jak1/engine/common-obs/water-anim.gc b/goal_src/jak1/engine/common-obs/water-anim.gc index 18d3c33491d..5f9ed24280c 100644 --- a/goal_src/jak1/engine/common-obs/water-anim.gc +++ b/goal_src/jak1/engine/common-obs/water-anim.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype water-anim (water-vol) ((ppointer-water-anim (pointer water-anim) :offset 24) (look int32 :offset-assert 212) @@ -474,21 +473,20 @@ (defstate water-vol-idle (water-anim) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('move-to) - (set! (-> self root trans quad) (-> (the-as vector (-> event param 0)) quad)) - (set! (-> self water-height) (-> self root trans y)) - (if (nonzero? (-> self sound)) - (update-trans! (-> self sound) (-> self root trans)) - ) - (let ((v0-0 (logclear (-> self mask) (process-mask sleep-code)))) - (set! (-> self mask) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('move-to) + (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self water-height) (-> self root trans y)) + (if (nonzero? (-> self sound)) + (update-trans! (-> self sound) (-> self root trans)) + ) + (let ((v0-0 (logclear (-> self mask) (process-mask sleep-code)))) + (set! (-> self mask) v0-0) + v0-0 + ) + ) + ) ) :trans (behavior () (let ((t9-0 (-> (method-of-type water-vol water-vol-idle) trans))) @@ -503,7 +501,6 @@ (if (and (-> self play-ambient-sound?) (nonzero? (-> self sound))) (update! (-> self sound)) ) - (none) ) :code (behavior () (loop @@ -511,7 +508,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/engine/common-obs/water.gc b/goal_src/jak1/engine/common-obs/water.gc index 1af63e18f3b..330716dd806 100644 --- a/goal_src/jak1/engine/common-obs/water.gc +++ b/goal_src/jak1/engine/common-obs/water.gc @@ -48,7 +48,7 @@ (sp-kill-particle arg0 arg1) (set-vector! s5-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sound-play "water-drop" :position (the-as symbol s5-0)) - (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 108) s5-0 :rate 1.0) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 108) s5-0) ) ) 0 @@ -1228,27 +1228,23 @@ :virtual #t :code (behavior () (go-virtual water-vol-idle) - (none) ) ) (defstate water-vol-idle (water-vol) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('update) - (the-as symbol (update! self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('update) + (update! self) + ) + ) ) :exit (behavior () (on-exit-water self) - (none) ) :trans (behavior () (update! self) - (none) ) :code (the-as (function none :behavior water-vol) anim-loop) ) diff --git a/goal_src/jak1/engine/debug/anim-tester.gc b/goal_src/jak1/engine/debug/anim-tester.gc index 2d3a0867461..f6b96768f06 100644 --- a/goal_src/jak1/engine/debug/anim-tester.gc +++ b/goal_src/jak1/engine/debug/anim-tester.gc @@ -1470,9 +1470,6 @@ (none) ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 893] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 938] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 1045] (defun anim-test-edit-sequence-list-handler ((arg0 int) (arg1 list-control)) (local-vars (sv-192 (function string dma-buffer int int font-color font-flags float)) @@ -2223,7 +2220,6 @@ :event anim-tester-standard-event-handler :enter (behavior () (logior! (-> self flags) (anim-tester-flags fanimt1)) - (none) ) :trans (behavior () (if (and (not (logtest? (-> self flags) (anim-tester-flags fanimt1))) (= *master-mode* 'menu)) @@ -2239,7 +2235,6 @@ (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) ) - (none) ) :code (behavior () (local-vars (s4-0 glst-node) (s5-1 anim-test-seq-item) (gp-2 anim-test-sequence)) @@ -2398,7 +2393,6 @@ ) ) ) - (none) ) :post anim-tester-post ) diff --git a/goal_src/jak1/engine/debug/default-menu.gc b/goal_src/jak1/engine/debug/default-menu.gc index 3edc9cac60d..bcfdc40eaae 100644 --- a/goal_src/jak1/engine/debug/default-menu.gc +++ b/goal_src/jak1/engine/debug/default-menu.gc @@ -31,63 +31,102 @@ (defun dm-cam-settings-func ((arg0 int) (arg1 debug-menu-msg)) (when (and (= arg1 (debug-menu-msg press)) *camera*) - (case arg0 - (((cam-slave-options)) - (send-event *camera* 'reset-root) + (cond + ((zero? arg0) + (send-event *camera* 'toggle-slave-option 1) + ) + ((= arg0 13) + (send-event *camera* 'toggle-slave-option 8192) + ) + ((= arg0 1) + (send-event *camera* 'toggle-slave-option 2) + ) + ((= arg0 2) + (send-event *camera* 'toggle-slave-option 4) + ) + ((= arg0 3) + (send-event *camera* 'toggle-slave-option 128) + ) + ((= arg0 4) + (send-event *camera* 'toggle-slave-option 8) + ) + ((= arg0 7) + (send-event *camera* 'toggle-slave-option 16) ) - (((cam-slave-options BUTT_CAM) - (cam-slave-options SAME_SIDE) - (cam-slave-options MOVE_SPHERICAL) - (cam-slave-options ALLOW_Z_ROT) - (cam-slave-options JUMP_PITCHES) - (cam-slave-options COLLIDE) - (cam-slave-options FIND_HIDDEN_TARGET) - (cam-slave-options DRAG) - (cam-slave-options LINE_OF_SIGHT) - (cam-slave-options BLOCK_SHIFT_BUTTONS) - (cam-slave-options NO_ROTATE) - (cam-slave-options STICKY_ANGLE) - ) - (send-event *camera* 'toggle-slave-option arg0) + ((= arg0 8) + (send-event *camera* 'toggle-slave-option 64) ) - ((9) ;; ignore regions + ((= arg0 6) + (send-event *camera* 'reset-root) + ) + ((= arg0 9) (logxor! (-> *camera* master-options) 1) ) - ((10) ;; switch only on ground + ((= arg0 10) (logxor! (-> *camera* master-options) 4) ) - (else - (format 0 "Unrecognized camera settings menu item selected: ~I~%" arg0) + ((= arg0 11) + (send-event *camera* 'toggle-slave-option 32) + ) + ((= arg0 12) + (send-event *camera* 'toggle-slave-option 512) + ) + ((= arg0 14) + (send-event *camera* 'toggle-slave-option #x8000) + ) + ((= arg0 15) + (send-event *camera* 'toggle-slave-option #x10000) ) ) ) (cond (*camera* - (case arg0 - (((cam-slave-options BUTT_CAM) - (cam-slave-options SAME_SIDE) - (cam-slave-options MOVE_SPHERICAL) - (cam-slave-options ALLOW_Z_ROT) - (cam-slave-options JUMP_PITCHES) - (cam-slave-options COLLIDE) - (cam-slave-options FIND_HIDDEN_TARGET) - (cam-slave-options DRAG) - (cam-slave-options LINE_OF_SIGHT) - (cam-slave-options BLOCK_SHIFT_BUTTONS) - (cam-slave-options NO_ROTATE) - (cam-slave-options STICKY_ANGLE) - ) - (logtest? (-> *camera* slave-options) arg0) - ) - ((9) ;; ignore regions + (cond + ((zero? arg0) + (logtest? (-> *camera* slave-options) 1) + ) + ((= arg0 13) + (logtest? (-> *camera* slave-options) 8192) + ) + ((= arg0 1) + (logtest? (-> *camera* slave-options) 2) + ) + ((= arg0 2) + (logtest? (-> *camera* slave-options) 4) + ) + ((= arg0 3) + (logtest? (-> *camera* slave-options) 128) + ) + ((= arg0 4) + (logtest? (-> *camera* slave-options) 8) + ) + ((= arg0 7) + (logtest? (-> *camera* slave-options) 16) + ) + ((= arg0 8) + (logtest? (-> *camera* slave-options) 64) + ) + ((= arg0 11) + (logtest? (-> *camera* slave-options) 32) + ) + ((= arg0 12) + (logtest? (-> *camera* slave-options) 512) + ) + ((= arg0 14) + (logtest? (-> *camera* slave-options) #x8000) + ) + ((= arg0 15) + (logtest? #x10000 (-> *camera* slave-options)) + ) + ((= arg0 9) (logtest? (-> *camera* master-options) 1) - ) - ((10) ;; switch only on ground + ) + ((= arg0 10) (logtest? (-> *camera* master-options) 4) - ) - (else - #f ) + (else + #f + ) ) ) (else @@ -557,13 +596,7 @@ (let ((s3-0 (-> (the-as drawable-tree-instance-shrub v1-7) info prototype-inline-array-shrub))) (dotimes (s2-0 (-> s3-0 length)) (let ((a1-4 - (new - 'debug ;; was global - 'debug-menu-item-flag - (the-as string (-> s3-0 data s2-0 name)) - (-> s3-0 data s2-0 name) - dm-instance-pick-func - ) + (new 'debug 'debug-menu-item-flag (-> s3-0 data s2-0 name) (-> s3-0 data s2-0 name) dm-instance-pick-func) ) ) (debug-menu-append-item *instance-shrub-menu* a1-4) @@ -780,7 +813,7 @@ (debug-menu-append-item arg1 a1-41) ) (let ((a1-43 - (new 'debug 'debug-menu-item-function "Reset Free" (cam-slave-options) (the-as (function object object) dm-cam-settings-func)) + (new 'debug 'debug-menu-item-function "Reset Free" 6 (the-as (function object object) dm-cam-settings-func)) ) ) (debug-menu-append-item arg1 a1-43) @@ -846,28 +879,28 @@ (let ((a1-29 (new 'debug 'debug-menu-item-submenu "Settings" s4-1))) (debug-menu-append-item gp-0 a1-29) ) - (let ((a1-31 (new 'debug 'debug-menu-item-flag "Butt cam" (cam-slave-options BUTT_CAM) dm-cam-settings-func))) + (let ((a1-31 (new 'debug 'debug-menu-item-flag "Butt cam" 0 dm-cam-settings-func))) (debug-menu-append-item s4-1 a1-31) ) - (let ((a1-33 (new 'debug 'debug-menu-item-flag "Block shift buttons" (cam-slave-options BLOCK_SHIFT_BUTTONS) dm-cam-settings-func))) + (let ((a1-33 (new 'debug 'debug-menu-item-flag "Block shift buttons" 13 dm-cam-settings-func))) (debug-menu-append-item s4-1 a1-33) ) - (let ((a1-35 (new 'debug 'debug-menu-item-flag "Same side" (cam-slave-options SAME_SIDE) dm-cam-settings-func))) + (let ((a1-35 (new 'debug 'debug-menu-item-flag "Same side" 1 dm-cam-settings-func))) (debug-menu-append-item s4-1 a1-35) ) - (let ((a1-37 (new 'debug 'debug-menu-item-flag "Move spherical" (cam-slave-options MOVE_SPHERICAL) dm-cam-settings-func))) + (let ((a1-37 (new 'debug 'debug-menu-item-flag "Move spherical" 2 dm-cam-settings-func))) (debug-menu-append-item s4-1 a1-37) ) - (let ((a1-39 (new 'debug 'debug-menu-item-flag "Drag" (cam-slave-options DRAG) dm-cam-settings-func))) + (let ((a1-39 (new 'debug 'debug-menu-item-flag "Drag" 3 dm-cam-settings-func))) (debug-menu-append-item s4-1 a1-39) ) - (let ((a1-41 (new 'debug 'debug-menu-item-flag "Allow Z rot" (cam-slave-options ALLOW_Z_ROT) dm-cam-settings-func))) + (let ((a1-41 (new 'debug 'debug-menu-item-flag "Allow Z rot" 4 dm-cam-settings-func))) (debug-menu-append-item s4-1 a1-41) ) - (let ((a1-43 (new 'debug 'debug-menu-item-flag "Pitch for jump" (cam-slave-options JUMP_PITCHES) dm-cam-settings-func))) + (let ((a1-43 (new 'debug 'debug-menu-item-flag "Pitch for jump" 7 dm-cam-settings-func))) (debug-menu-append-item s4-1 a1-43) ) - (let ((a1-45 (new 'debug 'debug-menu-item-flag "Find hidden target" (cam-slave-options FIND_HIDDEN_TARGET) dm-cam-settings-func))) + (let ((a1-45 (new 'debug 'debug-menu-item-flag "Find hidden target" 8 dm-cam-settings-func))) (debug-menu-append-item s4-1 a1-45) ) (let ((a1-47 @@ -882,16 +915,16 @@ (let ((a1-51 (new 'debug 'debug-menu-item-flag "Switch only on ground" 10 dm-cam-settings-func))) (debug-menu-append-item s4-1 a1-51) ) - (let ((a1-53 (new 'debug 'debug-menu-item-flag "Collide" (cam-slave-options COLLIDE) dm-cam-settings-func))) + (let ((a1-53 (new 'debug 'debug-menu-item-flag "Collide" 11 dm-cam-settings-func))) (debug-menu-append-item s4-1 a1-53) ) - (let ((a1-55 (new 'debug 'debug-menu-item-flag "Line of Sight" (cam-slave-options LINE_OF_SIGHT) dm-cam-settings-func))) + (let ((a1-55 (new 'debug 'debug-menu-item-flag "Line of Sight" 12 dm-cam-settings-func))) (debug-menu-append-item s4-1 a1-55) ) - (let ((a1-57 (new 'debug 'debug-menu-item-flag "No Rotate" (cam-slave-options NO_ROTATE) dm-cam-settings-func))) + (let ((a1-57 (new 'debug 'debug-menu-item-flag "No Rotate" 14 dm-cam-settings-func))) (debug-menu-append-item s4-1 a1-57) ) - (let ((a1-59 (new 'debug 'debug-menu-item-flag "Sticky Angle" (cam-slave-options STICKY_ANGLE) dm-cam-settings-func))) + (let ((a1-59 (new 'debug 'debug-menu-item-flag "Sticky Angle" 15 dm-cam-settings-func))) (debug-menu-append-item s4-1 a1-59) ) (let ((s3-2 (new 'debug 'debug-menu-item-var "Interp Frms" 40 80))) @@ -961,22 +994,16 @@ (debug-menu-append-item s4-1 a1-87) ) ) - (let ((a1-89 (new - 'debug - 'debug-menu-item-flag - "Edit" - '*cam-layout* - (the-as (function object debug-menu-msg object) (lambda ((arg0 symbol) (arg1 debug-menu-msg)) - (when (= arg1 (debug-menu-msg press)) - (if (-> arg0 value) - (cam-layout-stop) - (cam-layout-start) - ) - ) - (-> arg0 value) - ) - ) - ) + (let ((a1-89 (new 'debug 'debug-menu-item-flag "Edit" '*cam-layout* (lambda ((arg0 symbol) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if (-> arg0 value) + (cam-layout-stop) + (cam-layout-start) + ) + ) + (-> arg0 value) + ) + ) ) ) (debug-menu-append-item gp-0 a1-89) @@ -1064,10 +1091,7 @@ 'debug-menu-item-function "all tweak+" #f - (the-as - (function object object) - (lambda () (the-as object (all-texture-tweak-adjust *texture-page-dir* (the-as float 0.1)))) - ) + (lambda ((arg0 object)) (all-texture-tweak-adjust *texture-page-dir* (the-as float 0.1))) ) ) ) @@ -1078,10 +1102,7 @@ 'debug-menu-item-function "all tweak-" #f - (the-as - (function object object) - (lambda () (the-as object (all-texture-tweak-adjust *texture-page-dir* (the-as float -0.1)))) - ) + (lambda ((arg0 object)) (all-texture-tweak-adjust *texture-page-dir* (the-as float -0.1))) ) ) ) @@ -1923,10 +1944,7 @@ (debug-menu-append-item gp-0 a1-7) ) ) - (let ((a1-9 - (new 'debug 'debug-menu-item-function "Refresh" #f (the-as (function object object) build-instance-list)) - ) - ) + (let ((a1-9 (new 'debug 'debug-menu-item-function "Refresh" #f build-instance-list))) (debug-menu-append-item gp-0 a1-9) ) (let ((s3-0 (new 'debug 'debug-menu-item-var "near" (the-as int '*edit-instance*) 80))) @@ -1936,20 +1954,19 @@ (function int debug-menu-msg float float float) (lambda ((arg0 debug-menu) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) (let ((gp-0 (find-instance-by-name (-> arg0 name)))) - (the-as object (cond - (gp-0 - (when (= arg1 (debug-menu-msg press)) - (set! (-> gp-0 dists x) (* 4096.0 arg2)) - (prototype-bucket-recalc-fields gp-0) - ) - (* 0.00024414062 (-> gp-0 dists x)) - ) - (else - (empty) - arg3 - ) - ) - ) + (cond + (gp-0 + (when (= arg1 (debug-menu-msg press)) + (set! (-> gp-0 dists x) (* 4096.0 arg2)) + (prototype-bucket-recalc-fields gp-0) + ) + (* 0.00024414062 (-> gp-0 dists x)) + ) + (else + (empty) + arg3 + ) + ) ) ) ) @@ -1968,20 +1985,19 @@ (function int debug-menu-msg float float float) (lambda ((arg0 debug-menu) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) (let ((gp-0 (find-instance-by-name (-> arg0 name)))) - (the-as object (cond - (gp-0 - (when (= arg1 (debug-menu-msg press)) - (set! (-> gp-0 dists w) (* 4096.0 arg2)) - (prototype-bucket-recalc-fields gp-0) - ) - (* 0.00024414062 (-> gp-0 dists w)) - ) - (else - (empty) - arg3 - ) - ) - ) + (cond + (gp-0 + (when (= arg1 (debug-menu-msg press)) + (set! (-> gp-0 dists w) (* 4096.0 arg2)) + (prototype-bucket-recalc-fields gp-0) + ) + (* 0.00024414062 (-> gp-0 dists w)) + ) + (else + (empty) + arg3 + ) + ) ) ) ) diff --git a/goal_src/jak1/engine/debug/part-tester.gc b/goal_src/jak1/engine/debug/part-tester.gc index e8b4299ca6f..553eeecc2ec 100644 --- a/goal_src/jak1/engine/debug/part-tester.gc +++ b/goal_src/jak1/engine/debug/part-tester.gc @@ -94,7 +94,6 @@ ) (suspend) ) - (none) ) ) @@ -120,6 +119,3 @@ ) (none) ) - - - diff --git a/goal_src/jak1/engine/debug/viewer.gc b/goal_src/jak1/engine/debug/viewer.gc index 183479a0286..75640c1734e 100644 --- a/goal_src/jak1/engine/debug/viewer.gc +++ b/goal_src/jak1/engine/debug/viewer.gc @@ -47,7 +47,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior viewer) ja-post) ) @@ -228,9 +227,5 @@ viewer (t9-0 arg0 arg1) ) - (the-as object #t) + #t ) - - - - diff --git a/goal_src/jak1/engine/entity/ambient.gc b/goal_src/jak1/engine/entity/ambient.gc index 06b2bb63454..4af1f20f2ad 100644 --- a/goal_src/jak1/engine/entity/ambient.gc +++ b/goal_src/jak1/engine/entity/ambient.gc @@ -229,7 +229,7 @@ ) (and *target* (!= (-> *target* next-state name) 'target-look-around) - (zero? (logand (-> *target* state-flags) (state-flags being-attacked dying))) + (not (logtest? (-> *target* state-flags) (state-flags being-attacked dying))) (= *master-mode* 'game) ) ) @@ -272,10 +272,9 @@ (kill-current-level-hint '() '() 'exit) ) ) - (the-as object (and (not *hint-semaphore*) - (process-spawn level-hint :init ambient-hint-init-by-other arg0 arg1 arg3 :to arg2) - ) - ) + (and (not *hint-semaphore*) + (process-spawn level-hint :init ambient-hint-init-by-other arg0 arg1 arg3 :to arg2) + ) ) (defun kill-current-level-hint ((arg0 pair) (arg1 pair) (arg2 symbol)) @@ -350,14 +349,13 @@ (apply-settings *setting-control*) (set! (-> self event-hook) (lambda :behavior level-hint ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (when (or (= v1-0 'die) (= v1-0 'exit)) - (if (= (ppointer->process *hint-semaphore*) self) - (set! *hint-semaphore* (the-as (pointer level-hint) #f)) - ) - (deactivate self) - ) - ) + (case arg2 + (('die 'exit) + (if (= (ppointer->process *hint-semaphore*) self) + (set! *hint-semaphore* (the-as (pointer level-hint) #f)) + ) + (deactivate self) + ) ) ) ) @@ -391,24 +389,20 @@ ) (defstate level-hint-normal (level-hint) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'exit) - (go level-hint-exit) - ) - ((= v1-0 'die) - (deactivate self) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('exit) + (go level-hint-exit) + ) + (('die) + (deactivate self) + ) ) ) :exit (behavior () (if (= (ppointer->process *hint-semaphore*) self) (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) - (none) ) :code (behavior () (cond @@ -445,27 +439,23 @@ ) ) (go level-hint-exit) - (none) ) ) (defstate level-hint-sidekick (level-hint) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'exit) - (when (nonzero? (-> self sound-id)) - (sound-stop (-> self sound-id)) - (set! (-> self sound-id) (new 'static 'sound-id)) - 0 - ) - (go level-hint-exit) - ) - ((= v1-0 'die) - (deactivate self) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('exit) + (when (nonzero? (-> self sound-id)) + (sound-stop (-> self sound-id)) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + (go level-hint-exit) + ) + (('die) + (deactivate self) + ) ) ) :exit (behavior () @@ -480,7 +470,6 @@ (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) (send-event (handle->process (-> self voicebox)) 'die) - (none) ) :code (behavior ((arg0 string)) (#when PC_PORT (set! *level-hint-spool-name* arg0)) @@ -548,7 +537,6 @@ ) ) (go level-hint-exit) - (none) ) ) @@ -563,7 +551,6 @@ (if (= (ppointer->process *hint-semaphore*) self) (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) - (none) ) :code (behavior ((arg0 string)) (while (not *sound-player-enable*) @@ -631,7 +618,6 @@ ) ) (go level-hint-exit) - (none) ) ) @@ -663,7 +649,6 @@ ) ) (go level-hint-exit) - (none) ) ) @@ -672,7 +657,6 @@ (if (= (ppointer->process *hint-semaphore*) self) (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) - (none) ) ) @@ -1242,7 +1226,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak1/engine/entity/entity.gc b/goal_src/jak1/engine/entity/entity.gc index 29a8b3b2fca..4ee7f44df24 100644 --- a/goal_src/jak1/engine/entity/entity.gc +++ b/goal_src/jak1/engine/entity/entity.gc @@ -1102,21 +1102,20 @@ ) (iterate-process-tree *active-pool* - (the-as (function object object) (lambda ((arg0 process-drawable)) - (when (type-type? (-> arg0 type) process-drawable) - (if (nonzero? (-> arg0 nav)) - (debug-draw (-> arg0 nav)) - ) - (if (nonzero? (-> arg0 path)) - (debug-draw (-> arg0 path)) - ) - (if (nonzero? (-> arg0 vol)) - (init! (-> arg0 vol)) - ) - ) - (none) - ) + (lambda ((arg0 process-drawable)) + (when (type-type? (-> arg0 type) process-drawable) + (if (nonzero? (-> arg0 nav)) + (debug-draw (-> arg0 nav)) + ) + (if (nonzero? (-> arg0 path)) + (debug-draw (-> arg0 path)) ) + (if (nonzero? (-> arg0 vol)) + (init! (-> arg0 vol)) + ) + ) + (none) + ) *null-kernel-context* ) ) @@ -1581,7 +1580,7 @@ ) (iterate-process-tree *entity-pool* - (the-as (function object object) (lambda ((arg0 process-drawable)) (deactivate arg0) (none))) + (lambda ((arg0 process-drawable)) (deactivate arg0) (none)) *null-kernel-context* ) (if (= arg0 'game) diff --git a/goal_src/jak1/engine/game/game-h.gc b/goal_src/jak1/engine/game/game-h.gc index 8c14a85ac25..de7cff7c182 100644 --- a/goal_src/jak1/engine/game/game-h.gc +++ b/goal_src/jak1/engine/game/game-h.gc @@ -45,23 +45,18 @@ (flop-hit-ground) ;; set when ground pound hit ground ) -(defmacro static-attack-info (&key (mask ()) &rest args) - (when (!= (length args) 1) - (error "static-attack-info can only have 1 arg")) - (let ((mask-actual mask) - (arg (car args)) +(defmacro static-attack-info (&key (mask ()) args) + (let ((mask-actual mask)) + (dolist (it args) + (when (not (member (caar it) mask-actual)) + (cons! mask-actual (caar it)) ) - (when (assoc 'shove-up arg) (cons! mask-actual 'shove-up)) - (when (assoc 'shove-back arg) (cons! mask-actual 'shove-back)) - (when (assoc 'mode arg) (cons! mask-actual 'mode)) - (when (assoc 'vector arg) (cons! mask-actual 'vector)) - (when (assoc 'angle arg) (cons! mask-actual 'angle)) - (when (assoc 'control arg) (cons! mask-actual 'control)) + ) `(let ((atk (new 'static 'attack-info :mask (attack-mask ,@mask-actual)))) ,@(apply (lambda (x) (if (eq? (car x) 'vector) `(vector-copy! (-> atk ,(car x)) ,(cadr x)) `(set! (-> atk ,(car x)) ,(cadr x)) - )) arg) + )) args) atk) ) ) diff --git a/goal_src/jak1/engine/game/game-save.gc b/goal_src/jak1/engine/game/game-save.gc index 9aff4d75ed2..91d52232396 100644 --- a/goal_src/jak1/engine/game/game-save.gc +++ b/goal_src/jak1/engine/game/game-save.gc @@ -1364,7 +1364,6 @@ (set! (-> self buffer) a0-1) ) (go-virtual get-card) - (none) ) ) @@ -1415,7 +1414,6 @@ (go-virtual done) ) ) - (none) ) ) @@ -1455,7 +1453,6 @@ ) ) (go-virtual done) - (none) ) ) @@ -1486,7 +1483,6 @@ ) (label cfg-11) (go-virtual done) - (none) ) ) @@ -1536,7 +1532,6 @@ ) ) (go-virtual done) - (none) ) ) @@ -1613,7 +1608,6 @@ ) (label cfg-21) (go-virtual done) - (none) ) ) @@ -1686,22 +1680,20 @@ (suspend) ) (go-virtual done) - (none) ) ) (defstate error (auto-save) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('progress-allowed?) - #t - ) - (('die) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('progress-allowed?) + #t + ) + (('die) + (deactivate self) + ) + ) ) :code (behavior ((arg0 mc-status-code)) (if (-> self buffer) @@ -1732,7 +1724,6 @@ ) ) ) - (none) ) ) @@ -1771,7 +1762,6 @@ ) ) ) - (none) ) ) diff --git a/goal_src/jak1/engine/game/projectiles.gc b/goal_src/jak1/engine/game/projectiles.gc index 78ddbfd78df..afcdb969fce 100644 --- a/goal_src/jak1/engine/game/projectiles.gc +++ b/goal_src/jak1/engine/game/projectiles.gc @@ -600,20 +600,20 @@ (defstate projectile-moving (projectile) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (when (-> self attack-mode) (when (cond ((= (-> proc type) target) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode (-> self attack-mode))))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode (-> self attack-mode))))) ) (else (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) self) (set! (-> a1-2 num-params) 4) (set! (-> a1-2 message) 'attack) - (set! (-> a1-2 param 0) (-> event param 0)) + (set! (-> a1-2 param 0) (-> block param 0)) (set! (-> a1-2 param 1) (the-as uint (-> self attack-mode))) (let ((v1-13 (+ *global-attack-id* 1))) (set! *global-attack-id* v1-13) @@ -643,7 +643,6 @@ ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior () (let ((gp-0 #f)) @@ -700,7 +699,6 @@ ) ) (go-virtual projectile-dissipate) - (none) ) ) @@ -760,7 +758,6 @@ (sound-play "yellow-explode") (suspend) (go-virtual projectile-die) - (none) ) ) @@ -784,7 +781,6 @@ (sound-play "yellow-fizzle") (suspend) (go-virtual projectile-die) - (none) ) ) @@ -833,7 +829,6 @@ ) ) (cleanup-for-death self) - (none) ) ) @@ -1229,7 +1224,6 @@ :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -1237,6 +1231,5 @@ :virtual #t :code (behavior () (go-virtual projectile-die) - (none) ) ) diff --git a/goal_src/jak1/engine/target/sidekick.gc b/goal_src/jak1/engine/target/sidekick.gc index a90c6578eee..7c88676e0af 100644 --- a/goal_src/jak1/engine/target/sidekick.gc +++ b/goal_src/jak1/engine/target/sidekick.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (define *sidekick-remap* '(("run-to-stance-left" "run-to-stance") ("run-to-stance-loop-left" "run-to-stance-loop") ("stance-loop-left" "stance-loop") @@ -63,11 +62,11 @@ ) (defstate sidekick-clone (sidekick) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('matrix) - (case (-> event param 0) + (case (-> block param 0) (('play-anim) (set! v0-0 (-> self node-list data)) (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) cspace<-cspace+quaternion!) @@ -100,13 +99,13 @@ v0-0 ) (('shadow) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self shadow-in-movie?) (the-as symbol v0-0)) v0-0 ) (('blend-shape) (cond - ((-> event param 0) + ((-> block param 0) (set! v0-0 (logior (-> self skel status) (janim-status blerc))) (set! (-> self skel status) (the-as janim-status v0-0)) ) @@ -214,7 +213,6 @@ (if (logtest? (-> self skel status) (janim-status eye-done eye)) (merc-eye-anim self) ) - (none) ) ) diff --git a/goal_src/jak1/engine/target/target-death.gc b/goal_src/jak1/engine/target/target-death.gc index 955ffc33a32..9d41b4c4e9d 100644 --- a/goal_src/jak1/engine/target/target-death.gc +++ b/goal_src/jak1/engine/target/target-death.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defskelgroup *deathcam-sg* deathcam deathcam-lod0-jg deathcam-idle-ja ((deathcam-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 4) @@ -56,7 +55,6 @@ (remove-setting! 'sfx-volume) (remove-setting! 'ambient-volume) (remove-setting! 'music) - (none) ) :code (behavior ((arg0 continue-point)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -455,7 +453,6 @@ (suspend) (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (go target-stance) - (none) ) :post target-no-move-post ) @@ -822,7 +819,6 @@ (logclear! (-> self state-flags) (state-flags being-attacked dying)) ) (target-exit) - (none) ) :trans (behavior () (when (= *cheat-mode* 'debug) @@ -831,7 +827,6 @@ (go target-stance) ) ) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags wt16)) @@ -969,7 +964,6 @@ ) ) (go target-hit-ground #f) - (none) ) :post target-post ) @@ -1030,43 +1024,40 @@ ) (defstate target-death (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'end-mode) - (let ((v0-0 (the-as object #t))) - (set! (-> self control unknown-uint20) (the-as uint v0-0)) - v0-0 - ) - ) - ((= v1-0 'change-mode) - (case (-> event param 0) - (('grab) - #t - ) - ) - ) - ((= v1-0 'notify) - (when (type-type? (-> proc type) pov-camera) - (case (-> event param 0) - (('die 'abort-request) - (set! (-> self control unknown-uint20) (the-as uint #t)) - (the-as object (set-blackout-frames (seconds 0.2))) - ) - ) - ) - ) - ((= v1-0 'get-pickup) - #f - ) - ((= v1-0 'touched) - #f - ) - (else - (target-generic-event-handler proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('end-mode) + (let ((v0-0 (the-as object #t))) + (set! (-> self control unknown-uint20) (the-as uint v0-0)) + v0-0 + ) + ) + (('change-mode) + (case (-> block param 0) + (('grab) + #t + ) + ) + ) + (('notify) + (when (type-type? (-> proc type) pov-camera) + (case (-> block param 0) + (('die 'abort-request) + (set! (-> self control unknown-uint20) (the-as uint #t)) + (set-blackout-frames (seconds 0.2)) + ) + ) + ) + ) + (('get-pickup) + #f + ) + (('touched) + #f + ) + (else + (target-generic-event-handler proc argc message block) + ) ) ) :exit (behavior () @@ -1078,7 +1069,6 @@ (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) - (none) ) :trans (-> target-hit trans) :code (behavior ((arg0 symbol)) @@ -1405,7 +1395,6 @@ (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) (set! (-> self state-time) (-> *display* base-frame-counter)) (anim-loop) - (none) ) :post target-no-stick-post ) diff --git a/goal_src/jak1/engine/target/target-handler.gc b/goal_src/jak1/engine/target/target-handler.gc index 8cc392bc697..afc6ae09ebe 100644 --- a/goal_src/jak1/engine/target/target-handler.gc +++ b/goal_src/jak1/engine/target/target-handler.gc @@ -11,279 +11,276 @@ (defbehavior target-generic-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) - (the-as - object - (case arg2 - (('get-pickup) - (when (not (logtest? (-> self state-flags) (state-flags dying))) - (let ((s4-0 (-> arg3 param 0)) - (f28-0 (the-as float (-> arg3 param 1))) - ) - (if (!= (pickup-collectable! - (-> self fact-info-target) - (the-as pickup-type s4-0) - (the-as float 0.0) - (the-as handle #f) - ) - (pickup-collectable! (-> self fact-info-target) (the-as pickup-type s4-0) f28-0 (process->handle arg0)) + (case arg2 + (('get-pickup) + (when (not (logtest? (-> self state-flags) (state-flags dying))) + (let ((s4-0 (-> arg3 param 0)) + (f28-0 (the-as float (-> arg3 param 1))) + ) + (if (!= (pickup-collectable! + (-> self fact-info-target) + (the-as pickup-type s4-0) + (the-as float 0.0) + (the-as handle #f) ) - #t - 'full - ) - ) - ) - ) - (('reset-pickup) - (the-as object (reset! (-> self fact-info-target) (the-as symbol (-> arg3 param 0)))) - ) - (('reset-collide) - (cond - ((-> self control unknown-symbol00) - (target-collide-set! (-> self control unknown-symbol00) (-> self control unknown-float90)) - ) - ((-> self control unknown-symbol30) - (target-danger-set! (-> self control unknown-symbol30) #f) - ) + (pickup-collectable! (-> self fact-info-target) (the-as pickup-type s4-0) f28-0 (process->handle arg0)) + ) + #t + 'full + ) ) ) - (('level-deactivate) - #f + ) + (('reset-pickup) + (reset! (-> self fact-info-target) (the-as symbol (-> arg3 param 0))) + ) + (('reset-collide) + (cond + ((-> self control unknown-symbol00) + (target-collide-set! (-> self control unknown-symbol00) (-> self control unknown-float90)) + ) + ((-> self control unknown-symbol30) + (target-danger-set! (-> self control unknown-symbol30) #f) + ) ) - (('level-enter) - (let ((v1-21 (level-get *level* (the-as symbol (-> arg3 param 0))))) - (when v1-21 - (let ((s5-1 (-> v1-21 info))) - (let ((v1-22 (-> s5-1 buzzer))) - (if (zero? v1-22) - (set! (-> self fact-info-target buzzer) 0.0) - (set! (-> self fact-info-target buzzer) (pickup-collectable! - (-> self fact-info-target) - (pickup-type buzzer) - (the float (logior -65536 v1-22)) - (the-as handle #f) - ) - ) - ) - ) - (if (and (zero? (-> *game-info* enter-level-time (-> s5-1 index))) - (>= (-> *level-task-data-remap* length) (-> s5-1 index)) - ) - (set! (-> *game-info* enter-level-time (-> *level-task-data-remap* (+ (-> s5-1 index) -1))) - (-> *display* base-frame-counter) + ) + (('level-deactivate) + #f + ) + (('level-enter) + (let ((v1-21 (level-get *level* (the-as symbol (-> arg3 param 0))))) + (when v1-21 + (let ((s5-1 (-> v1-21 info))) + (let ((v1-22 (-> s5-1 buzzer))) + (if (zero? v1-22) + (set! (-> self fact-info-target buzzer) 0.0) + (set! (-> self fact-info-target buzzer) (pickup-collectable! + (-> self fact-info-target) + (pickup-type buzzer) + (the float (logior -65536 v1-22)) + (the-as handle #f) + ) ) ) ) - (send-event (ppointer->process (-> *hud-parts* buzzers)) 'sync) - (format #t "GAMEPLAY: enter ~A~%" (-> arg3 param 0)) + (if (and (zero? (-> *game-info* enter-level-time (-> s5-1 index))) + (>= (-> *level-task-data-remap* length) (-> s5-1 index)) + ) + (set! (-> *game-info* enter-level-time (-> *level-task-data-remap* (+ (-> s5-1 index) -1))) + (-> *display* base-frame-counter) + ) + ) ) + (send-event (ppointer->process (-> *hud-parts* buzzers)) 'sync) + (format #t "GAMEPLAY: enter ~A~%" (-> arg3 param 0)) ) ) - (('get-attack-count) - (set! v0-0 (+ (-> self control unknown-dword51) (-> arg3 param 0))) - (set! (-> self control unknown-dword51) (the-as int v0-0)) - v0-0 - ) - (('continue) - (go target-continue (the-as continue-point (-> arg3 param 0))) - ) - (('query) - (case (-> arg3 param 0) - (('powerup) - (and (= (-> self fact-info-target eco-type) (-> arg3 param 1)) (< 0.0 (-> self fact-info-target eco-level))) - ) - (('pickup) - (pickup-collectable! - (-> self fact-info-target) - (the-as pickup-type (-> arg3 param 1)) - (the-as float 0.0) - (the-as handle #f) - ) - ) - (('ground-height) - (target-height-above-ground) + ) + (('get-attack-count) + (set! v0-0 (+ (-> self control unknown-dword51) (-> arg3 param 0))) + (set! (-> self control unknown-dword51) (the-as int v0-0)) + v0-0 + ) + (('continue) + (go target-continue (the-as continue-point (-> arg3 param 0))) + ) + (('query) + (case (-> arg3 param 0) + (('powerup) + (and (= (-> self fact-info-target eco-type) (-> arg3 param 1)) (< 0.0 (-> self fact-info-target eco-level))) + ) + (('pickup) + (pickup-collectable! + (-> self fact-info-target) + (the-as pickup-type (-> arg3 param 1)) + (the-as float 0.0) + (the-as handle #f) ) - ) + ) + (('ground-height) + (target-height-above-ground) + ) ) - (('trans) - (case (-> arg3 param 0) - (('save) - (set! (-> self alt-cam-pos quad) (-> self control trans quad)) - (logior! (-> self state-flags) (state-flags has-saved-position)) - (mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48) - ) - (('restore) - (logclear! (-> self state-flags) (state-flags has-saved-position)) - (let ((gp-1 (-> arg3 param 1))) - (move-to-point! (-> self control) (the-as vector (+ gp-1 0))) - (quaternion-copy! (-> self control quat) (the-as quaternion (+ gp-1 16))) - ) - (rot->dir-targ! (-> self control)) - (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) - (set! v0-0 (-> *display* base-frame-counter)) - (set! (-> self control unknown-dword11) (the-as time-frame v0-0)) - v0-0 - ) - (('reset) - (set! v0-0 (logclear (-> self state-flags) (state-flags has-saved-position))) - (set! (-> self state-flags) (the-as state-flags v0-0)) - v0-0 + ) + (('trans) + (case (-> arg3 param 0) + (('save) + (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (logior! (-> self state-flags) (state-flags has-saved-position)) + (mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48) + ) + (('restore) + (logclear! (-> self state-flags) (state-flags has-saved-position)) + (let ((gp-1 (-> arg3 param 1))) + (move-to-point! (-> self control) (the-as vector (+ gp-1 0))) + (quaternion-copy! (-> self control quat) (the-as quaternion (+ gp-1 16))) ) - ) - ) - (('effect) - (the-as object (target-powerup-effect (the-as symbol (-> arg3 param 0)))) + (rot->dir-targ! (-> self control)) + (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) + (set! v0-0 (-> *display* base-frame-counter)) + (set! (-> self control unknown-dword11) (the-as time-frame v0-0)) + v0-0 + ) + (('reset) + (set! v0-0 (logclear (-> self state-flags) (state-flags has-saved-position))) + (set! (-> self state-flags) (the-as state-flags v0-0)) + v0-0 + ) ) - (('do-effect) - (effect-control-method-10 - (-> self skel effect) - (the-as symbol (-> arg3 param 0)) - (the-as float (-> arg3 param 1)) - -1 - ) - (if (-> self sidekick) - (effect-control-method-10 - (-> self sidekick 0 skel effect) - (the-as symbol (-> arg3 param 0)) - (the-as float (-> arg3 param 1)) - -1 - ) - ) + ) + (('effect) + (target-powerup-effect (the-as symbol (-> arg3 param 0))) + ) + (('do-effect) + (effect-control-method-10 + (-> self skel effect) + (the-as symbol (-> arg3 param 0)) + (the-as float (-> arg3 param 1)) + -1 ) - (('neck) - (set! (-> self neck flex-blend) (the-as float (-> arg3 param 0))) - (cond - ((-> arg3 param 1) - (logior! (-> self state-flags) (state-flags looking-at-enemy)) - (set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) - (the-as object (look-at-enemy! (-> self neck) (-> self alt-neck-pos) 'force arg0)) - ) - (else - (set! v0-0 (logclear (-> self state-flags) (state-flags looking-at-enemy))) - (set! (-> self state-flags) (the-as state-flags v0-0)) - v0-0 + (if (-> self sidekick) + (effect-control-method-10 + (-> self sidekick 0 skel effect) + (the-as symbol (-> arg3 param 0)) + (the-as float (-> arg3 param 1)) + -1 ) ) + ) + (('neck) + (set! (-> self neck flex-blend) (the-as float (-> arg3 param 0))) + (cond + ((-> arg3 param 1) + (logior! (-> self state-flags) (state-flags looking-at-enemy)) + (set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (look-at-enemy! (-> self neck) (-> self alt-neck-pos) 'force arg0) + ) + (else + (set! v0-0 (logclear (-> self state-flags) (state-flags looking-at-enemy))) + (set! (-> self state-flags) (the-as state-flags v0-0)) + v0-0 + ) ) - (('sidekick) - (cond - ((and (-> arg3 param 0) (not (-> self sidekick))) - (let ((gp-2 (get-process *default-dead-pool* sidekick #x4000))) - (set! v0-0 (when gp-2 - (let ((t9-21 (method-of-type sidekick activate))) - (t9-21 (the-as sidekick gp-2) self 'sidekick (the-as pointer #x70004000)) - ) - (run-now-in-process gp-2 init-sidekick) - (-> gp-2 ppointer) + ) + (('sidekick) + (cond + ((and (-> arg3 param 0) (not (-> self sidekick))) + (let ((gp-2 (get-process *default-dead-pool* sidekick #x4000))) + (set! v0-0 (when gp-2 + (let ((t9-21 (method-of-type sidekick activate))) + (t9-21 (the-as sidekick gp-2) self 'sidekick (the-as pointer #x70004000)) ) - ) - ) - (set! (-> self sidekick) (the-as (pointer sidekick) v0-0)) - v0-0 - ) - ((and (not (-> arg3 param 0)) (-> self sidekick)) - (deactivate (-> self sidekick 0)) - (set! (-> self sidekick) (the-as (pointer sidekick) #f)) - #f + (run-now-in-process gp-2 init-sidekick) + (-> gp-2 ppointer) + ) + ) ) - ) + (set! (-> self sidekick) (the-as (pointer sidekick) v0-0)) + v0-0 + ) + ((and (not (-> arg3 param 0)) (-> self sidekick)) + (deactivate (-> self sidekick 0)) + (set! (-> self sidekick) (the-as (pointer sidekick) #f)) + #f + ) ) - (('blend-shape) - (if (-> arg3 param 0) - (logior! (-> self skel status) (janim-status blerc)) - (logclear! (-> self skel status) (janim-status blerc)) - ) - (let ((v1-105 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-105 from) arg0) - (set! (-> v1-105 num-params) arg1) - (set! (-> v1-105 message) arg2) - (set! (-> v1-105 param 0) (-> arg3 param 0)) - (set! (-> v1-105 param 1) (-> arg3 param 1)) - (set! (-> v1-105 param 2) (-> arg3 param 2)) - (set! (-> v1-105 param 3) (-> arg3 param 3)) - (set! (-> v1-105 param 4) (-> arg3 param 4)) - (set! (-> v1-105 param 5) (-> arg3 param 5)) - (set! (-> v1-105 param 6) (-> arg3 param 6)) - (send-event-function (ppointer->process (-> self sidekick)) v1-105) + ) + (('blend-shape) + (if (-> arg3 param 0) + (logior! (-> self skel status) (janim-status blerc)) + (logclear! (-> self skel status) (janim-status blerc)) ) + (let ((v1-105 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-105 from) arg0) + (set! (-> v1-105 num-params) arg1) + (set! (-> v1-105 message) arg2) + (set! (-> v1-105 param 0) (-> arg3 param 0)) + (set! (-> v1-105 param 1) (-> arg3 param 1)) + (set! (-> v1-105 param 2) (-> arg3 param 2)) + (set! (-> v1-105 param 3) (-> arg3 param 3)) + (set! (-> v1-105 param 4) (-> arg3 param 4)) + (set! (-> v1-105 param 5) (-> arg3 param 5)) + (set! (-> v1-105 param 6) (-> arg3 param 6)) + (send-event-function (ppointer->process (-> self sidekick)) v1-105) ) - (('shadow) - (cond - ((-> arg3 param 0) - (let ((v1-108 (-> self draw shadow-ctrl))) - (logclear! (-> v1-108 settings flags) (shadow-flags disable-draw)) - ) - 0 + ) + (('shadow) + (cond + ((-> arg3 param 0) + (let ((v1-108 (-> self draw shadow-ctrl))) + (logclear! (-> v1-108 settings flags) (shadow-flags disable-draw)) ) - (else - (let ((v1-110 (-> self draw shadow-ctrl))) - (logior! (-> v1-110 settings flags) (shadow-flags disable-draw)) - ) - 0 + 0 + ) + (else + (let ((v1-110 (-> self draw shadow-ctrl))) + (logior! (-> v1-110 settings flags) (shadow-flags disable-draw)) ) + 0 ) ) - (('rotate-y-angle) - (quaternion-rotate-y! - (-> self control unknown-quaternion00) - (-> self control unknown-quaternion00) - (the-as float (-> arg3 param 0)) - ) - (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (rot->dir-targ! (-> self control)) - ) - ) - (('touched) - (send-event arg0 'touch (-> arg3 param 0)) - ) - (('dry) - (set! (-> self water drip-wetness) 0.0) - ) - (('reset-height) - (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) - #f + ) + (('rotate-y-angle) + (quaternion-rotate-y! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + (the-as float (-> arg3 param 0)) ) - (('draw) - (if (-> arg3 param 0) - (logclear! (-> self draw status) (draw-status skip-bones)) - (logior! (-> self draw status) (draw-status skip-bones)) - ) - (let ((v1-132 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-132 from) arg0) - (set! (-> v1-132 num-params) arg1) - (set! (-> v1-132 message) arg2) - (set! (-> v1-132 param 0) (-> arg3 param 0)) - (set! (-> v1-132 param 1) (-> arg3 param 1)) - (set! (-> v1-132 param 2) (-> arg3 param 2)) - (set! (-> v1-132 param 3) (-> arg3 param 3)) - (set! (-> v1-132 param 4) (-> arg3 param 4)) - (set! (-> v1-132 param 5) (-> arg3 param 5)) - (set! (-> v1-132 param 6) (-> arg3 param 6)) - (send-event-function (ppointer->process (-> self manipy)) v1-132) + (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (rot->dir-targ! (-> self control)) ) + ) + (('touched) + (send-event arg0 'touch (-> arg3 param 0)) + ) + (('dry) + (set! (-> self water drip-wetness) 0.0) + ) + (('reset-height) + (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) + #f + ) + (('draw) + (if (-> arg3 param 0) + (logclear! (-> self draw status) (draw-status skip-bones)) + (logior! (-> self draw status) (draw-status skip-bones)) + ) + (let ((v1-132 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-132 from) arg0) + (set! (-> v1-132 num-params) arg1) + (set! (-> v1-132 message) arg2) + (set! (-> v1-132 param 0) (-> arg3 param 0)) + (set! (-> v1-132 param 1) (-> arg3 param 1)) + (set! (-> v1-132 param 2) (-> arg3 param 2)) + (set! (-> v1-132 param 3) (-> arg3 param 3)) + (set! (-> v1-132 param 4) (-> arg3 param 4)) + (set! (-> v1-132 param 5) (-> arg3 param 5)) + (set! (-> v1-132 param 6) (-> arg3 param 6)) + (send-event-function (ppointer->process (-> self manipy)) v1-132) ) - (('no-load-wait) - (set! v0-0 (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0)))) - (set! (-> self no-load-wait) (the-as time-frame v0-0)) - v0-0 - ) - (('no-look-around) - (set! (-> self no-look-around-wait) - (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0))) - ) - (if (= (-> self next-state name) 'target-look-around) - (send-event self 'end-mode) + ) + (('no-load-wait) + (set! v0-0 (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0)))) + (set! (-> self no-load-wait) (the-as time-frame v0-0)) + v0-0 + ) + (('no-look-around) + (set! (-> self no-look-around-wait) + (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0))) ) - ) - (('change-state) - (go - (the-as (state object object object object target) (-> arg3 param 0)) - (-> arg3 param 1) - (-> arg3 param 2) - (-> arg3 param 3) - (-> arg3 param 4) + (if (= (-> self next-state name) 'target-look-around) + (send-event self 'end-mode) ) + ) + (('change-state) + (go + (the-as (state object object object object target) (-> arg3 param 0)) + (-> arg3 param 1) + (-> arg3 param 2) + (-> arg3 param 3) + (-> arg3 param 4) ) - ) + ) ) ) diff --git a/goal_src/jak1/engine/target/target.gc b/goal_src/jak1/engine/target/target.gc index ae75699f83f..9c9ce647111 100644 --- a/goal_src/jak1/engine/target/target.gc +++ b/goal_src/jak1/engine/target/target.gc @@ -340,7 +340,6 @@ (suspend) (suspend) (go target-stance) - (none) ) :post target-no-move-post ) @@ -350,12 +349,10 @@ :enter (behavior () (set! (-> self control unknown-surface00) *walk-mods*) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (behavior () (set! (-> self control unknown-float81) 0.0) (target-state-hook-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -404,7 +401,6 @@ ) (slide-down-test) (fall-test) - (none) ) :code (behavior () (let ((s5-0 22) @@ -577,7 +573,6 @@ ) ) ) - (none) ) :post target-post ) @@ -587,12 +582,10 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *walk-mods*) - (none) ) :exit (behavior () (target-effect-exit) (target-state-hook-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -658,7 +651,6 @@ ) (slide-down-test) (fall-test) - (none) ) :code (behavior () (let ((f28-0 0.0) @@ -964,7 +956,6 @@ ) ) ) - (none) ) :post target-post ) @@ -975,7 +966,6 @@ (vector-turn-to (-> self control transv)) (set! (-> self control unknown-surface00) *turn-around-mods*) (set! (-> self control unknown-float81) 1.0) - (none) ) :exit (behavior () (target-state-hook-exit) @@ -983,7 +973,6 @@ (set! (-> self control unknown-float01) 0.0) (set-quaternion! (-> self control) (-> self control dir-targ)) (set! (-> self control unknown-float81) 0.0) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -1010,7 +999,6 @@ (go target-falling #f) ) (slide-down-test) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.04)) @@ -1029,7 +1017,6 @@ (set! (-> self control unknown-float01) 40960.0) (target-state-hook-exit) (go target-walk) - (none) ) :post target-no-stick-post ) @@ -1038,11 +1025,9 @@ :event target-walk-event-handler :enter (behavior () (set! (-> self control unknown-surface00) *jump-mods*) - (none) ) :exit (behavior () (set! (-> self control unknown-dword35) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (when (or (logtest? (-> self control status) (cshape-moving-flags onsurf)) @@ -1053,7 +1038,6 @@ (logior! (-> self control status) (cshape-moving-flags onsurf)) (go target-duck-stance) ) - (none) ) :code (behavior () (if (not (ja-group? eichar-duck-stance-ja)) @@ -1066,7 +1050,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post target-post ) @@ -1208,7 +1191,6 @@ (set! (-> self control unknown-float81) 1.0) (set! (-> self control unknown-surface00) *duck-mods*) (target-collide-set! 'duck (the-as float 1.0)) - (none) ) :exit (behavior () (if (not (or (= (-> self next-state name) 'target-duck-walk) @@ -1222,7 +1204,6 @@ ) (target-exit) (target-collide-set! 'normal (the-as float 0.0)) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -1261,7 +1242,6 @@ ) (fall-test) (slide-down-test) - (none) ) :code (behavior () (cond @@ -1293,7 +1273,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post target-post ) @@ -1306,7 +1285,6 @@ (if (not (ja-group? eichar-duck-roll-ja)) (set! (-> self control unknown-surface00) *duck-mods*) ) - (none) ) :exit (-> target-duck-stance exit) :trans (behavior () @@ -1347,7 +1325,6 @@ ) (fall-test) (slide-down-test) - (none) ) :code (behavior () (cond @@ -1374,7 +1351,6 @@ ) (suspend) ) - (none) ) :post target-post ) @@ -1421,7 +1397,6 @@ (set! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) ) - (none) ) :exit target-exit :trans (behavior () @@ -1475,7 +1450,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) (-> *display* seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) (ja-channel-push! 2 (seconds 0.05)) @@ -1508,7 +1482,6 @@ (suspend) ) (target-falling-anim -1 (seconds 0.2)) - (none) ) :post target-post ) @@ -1518,7 +1491,6 @@ :enter (behavior ((arg0 float) (arg1 float)) ((-> target-jump enter) arg0 arg1 (the-as surface #f)) (set! (-> self control unknown-surface00) *forward-jump-mods*) - (none) ) :exit target-exit :trans (-> target-jump trans) @@ -1535,7 +1507,6 @@ (suspend) (ja :group! eichar-jump-loop-ja :num! (loop!)) ) - (none) ) :post target-post ) @@ -1557,7 +1528,6 @@ (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *double-jump-mods*) - (none) ) :exit target-exit :trans (behavior () @@ -1597,7 +1567,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) (-> *display* seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (ja-channel-push! 2 (seconds 0.05)) @@ -1610,7 +1579,6 @@ (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) ) (target-falling-anim -1 (seconds 0.2)) - (none) ) :post target-post ) @@ -1651,7 +1619,6 @@ (set! (-> self control unknown-float122) (fmax 0.0 (fmin 0.5 (* 0.00008138021 (+ -409.6 (-> self control unknown-float01))))) ) - (none) ) :exit target-exit :trans (behavior () @@ -1695,7 +1662,6 @@ (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01))))) (-> *display* seconds-per-frame) ) - (none) ) :code (-> target-jump code) :post target-post @@ -1707,7 +1673,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *turn-around-mods*) - (none) ) :exit target-exit :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) @@ -1750,7 +1715,6 @@ ) ) (go target-duck-high-jump-jump arg0 arg1 arg2) - (none) ) :post target-post ) @@ -1771,7 +1735,6 @@ (set! (-> self control unknown-surface00) *high-jump-mods*) ) ) - (none) ) :exit target-exit ;; og:preserve-this PAL patch here @@ -1798,7 +1761,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((f30-0 (the-as float (if (= arg2 'launch) @@ -1853,7 +1815,6 @@ ) ) (the-as none 0) - (none) ) :post target-post ) @@ -1864,7 +1825,6 @@ (set! (-> self control unknown-surface00) *jump-mods*) (set! (-> self control unknown-uint20) (the-as uint arg0)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (target-falling-trans @@ -1875,11 +1835,9 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol)) (target-falling-anim -1 (seconds 0.33)) - (none) ) :post target-post ) @@ -1939,7 +1897,6 @@ 600 1500 ) - (none) ) :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) @@ -1973,12 +1930,10 @@ ) (fall-test) (slide-down-test) - (none) ) :code (behavior ((arg0 symbol)) (target-hit-ground-anim #f) (go target-stance) - (none) ) :post target-post ) @@ -1992,12 +1947,10 @@ (set! (-> self control unknown-surface00) *attack-mods*) (set! (-> self water drip-mult) 4.0) (set! (-> self neck flex-blend) 0.0) - (none) ) :exit (behavior () (set! (-> self control unknown-dword33) (-> *display* base-frame-counter)) (target-exit) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.05)) @@ -2034,25 +1987,24 @@ (ja :num! (seek! max (-> self control unknown-surface01 align-speed))) ) (go target-stance) - (none) ) :post target-post ) (defstate target-running-attack (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (cond (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 224) ) (let ((gp-1 (target-send-attack proc (the-as uint (-> self control unknown-symbol30)) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control unknown-dword50) (-> self control unknown-dword51) ) @@ -2091,12 +2043,12 @@ ) ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -2120,7 +2072,6 @@ (if (or (< (fabs (-> self control unknown-float62)) 0.3) (< 0.3 (fabs (-> self control unknown-float61)))) (set! (-> self control unknown-float81) 1.0) ) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) @@ -2129,7 +2080,6 @@ (set! (-> *run-attack-mods* turnvv) 0.0) (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) (target-exit) - (none) ) :trans (behavior () (when (!= (-> self state-time) (-> *display* base-frame-counter)) @@ -2216,7 +2166,6 @@ ) ) ) - (none) ) :code (behavior () (if (logtest? (-> self water flags) (water-flags wt09)) @@ -2313,21 +2262,20 @@ (go target-falling #f) ) (go target-stance) - (none) ) :post target-post ) (defstate target-attack-air (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v0-0 (target-bonk-event-handler proc arg1 event-type event))) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v0-0 (target-bonk-event-handler proc argc message block))) (cond (v0-0 (empty) v0-0 ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -2397,13 +2345,11 @@ ) (set! (-> self control dynam gravity-length) 122880.0) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) ((-> target-attack exit)) - (none) ) :trans (behavior () (when (logtest? (-> self control status) (cshape-moving-flags onsurf)) @@ -2442,7 +2388,6 @@ (game-task none) ) ) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-push! 1 (seconds 0.075)) @@ -2504,7 +2449,6 @@ ) ) (go target-falling #f) - (none) ) :post target-post ) @@ -2516,7 +2460,6 @@ (target-start-attack) (target-danger-set! 'uppercut #f) (set! (-> self control unknown-surface00) *turn-around-mods*) - (none) ) :exit target-exit :code (behavior ((arg0 float) (arg1 float)) @@ -2535,7 +2478,6 @@ (ja :num! (seek! (ja-aframe (the-as float 7.0) 0))) ) (go target-attack-uppercut-jump arg0 arg1) - (none) ) :post target-post ) @@ -2554,7 +2496,6 @@ (set! (-> self control unknown-surface00) *uppercut-jump-mods*) (target-start-attack) (target-danger-set! 'uppercut #f) - (none) ) :exit target-exit :trans (behavior () @@ -2605,7 +2546,6 @@ (target-danger-set! 'harmless #f) ) (slide-down-test) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (compute-alignment! (-> self align)) @@ -2633,20 +2573,19 @@ ) ) (go target-falling #f) - (none) ) :post target-post ) (defstate target-flop (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v0-0 (target-bonk-event-handler proc arg1 event-type event))) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v0-0 (target-bonk-event-handler proc argc message block))) (cond (v0-0 (empty) v0-0 ) - ((let ((v1-0 event-type)) + ((let ((v1-0 message)) (= v1-0 'swim) ) (cond @@ -2668,7 +2607,7 @@ ) ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -2705,14 +2644,12 @@ ) ) ) - (none) ) :exit (behavior () (target-danger-set! 'harmless #f) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) - (none) ) :trans (behavior () (delete-back-vel) @@ -2727,7 +2664,7 @@ ) (and (logtest? (-> self control status) (cshape-moving-flags twall)) (< 0.7 (-> self control poly-angle))) ) - (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + (not (logtest? (-> self control status) (cshape-moving-flags t-act))) (>= (-> self control unknown-uint20) (the-as uint 2)) ) (set! (-> self control unknown-dword36) (-> *display* base-frame-counter)) @@ -2781,7 +2718,6 @@ (target-start-attack) (target-danger-set! 'flop #f) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 float)) (ja-channel-set! 2) @@ -2881,19 +2817,18 @@ (suspend) ) ) - (none) ) :post target-post ) (defstate target-flop-hit-ground (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('swim) #f ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -2916,7 +2851,6 @@ (set! (-> self control unknown-surface00) *flop-land-mods*) (logclear! (-> *flop-land-mods* flags) (surface-flags allow-edge-grab)) (logior! (-> self state-flags) (state-flags flop-hit-ground)) - (none) ) :exit target-exit :trans (behavior () @@ -2949,22 +2883,20 @@ ) ) (slide-down-test) - (none) ) :code (behavior ((arg0 symbol)) (target-hit-ground-anim arg0) (go target-falling #f) - (none) ) :post target-post ) (defstate target-wheel (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (= event-type 'touched) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (= message 'touched) (send-event proc 'roll) ) - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -2981,7 +2913,6 @@ (set! (-> self control unknown-uint20) (the-as uint 0)) (set! (-> self control unknown-int21) 0) 0 - (none) ) :exit (behavior () (when (!= (-> self next-state name) 'target-wheel) @@ -2989,7 +2920,6 @@ (set! (-> self control unknown-dword30) (-> *display* base-frame-counter)) ) (target-exit) - (none) ) :code (behavior () (let ((gp-0 0)) @@ -3076,7 +3006,6 @@ ) ) (go target-duck-stance) - (none) ) :post target-post ) @@ -3085,7 +3014,6 @@ :event target-standard-event-handler :enter (behavior ((arg0 float) (arg1 float)) (set! (-> self control unknown-surface00) *wheel-flip-mods*) - (none) ) :exit target-exit :trans (behavior () @@ -3107,7 +3035,6 @@ ) (go target-attack-air #f) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (ja-channel-push! 1 (seconds 0.04)) @@ -3208,7 +3135,6 @@ (go target-hit-ground #f) (go target-stance) ) - (none) ) :post target-post ) diff --git a/goal_src/jak1/engine/target/target2.gc b/goal_src/jak1/engine/target/target2.gc index f99e743f132..4119a0c2698 100644 --- a/goal_src/jak1/engine/target/target2.gc +++ b/goal_src/jak1/engine/target/target2.gc @@ -12,14 +12,14 @@ ;; DECOMP BEGINS (defstate target-load-wait (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('loading) (set! (-> self state-time) (-> *display* base-frame-counter)) #f ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -57,19 +57,18 @@ ) ) (go target-stance) - (none) ) :post target-no-stick-post ) (defstate target-stance-ambient (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('movie) (go target-stance) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -101,7 +100,6 @@ ) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (behavior () (let ((a0-0 (-> self control unknown-spoolanim00))) @@ -113,7 +111,6 @@ ) ((-> target-stance exit)) (target-exit) - (none) ) :trans (behavior () (spool-push *art-control* (-> self control unknown-spoolanim00 name) 0 self (the-as float -99.0)) @@ -122,7 +119,6 @@ ) (go target-stance) ) - (none) ) :code (behavior () (while (let ((v1-13 (file-status *art-control* (-> self control unknown-spoolanim00 name) 0))) @@ -141,7 +137,6 @@ ) (set! (-> self control unknown-uint20) (the-as uint #f)) (go target-stance) - (none) ) :post target-post ) @@ -277,8 +272,8 @@ ) (defstate hud-waiting (first-person-hud) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('go-away) (go hud-going-out) ) @@ -286,7 +281,6 @@ ) :enter (behavior () (disable-hud (the-as int (-> *hud-parts* power))) - (none) ) :code (behavior () (loop @@ -300,7 +294,6 @@ (go hud-coming-in) (suspend) ) - (none) ) ) @@ -314,11 +307,9 @@ ) (suspend) ) - (none) ) :post (behavior () (dumb-15 self) - (none) ) ) @@ -335,7 +326,6 @@ ) (suspend) ) - (none) ) ) @@ -348,11 +338,9 @@ ) (suspend) ) - (none) ) :post (behavior () (dumb-15 self) - (none) ) ) @@ -445,27 +433,26 @@ (set! (-> self state) v1-8) ) ((the-as (function none :behavior target) (-> target-stance code))) - (none) ) :post target-post ) (defstate target-look-around (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) - ((let ((v1-4 event-type)) + ((let ((v1-4 message)) (= v1-4 'end-mode) ) (go target-stance-look-around) ) ((-> self control unknown-symbol30) - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -484,7 +471,6 @@ (set! (-> self fp-hud) (ppointer->handle (process-spawn first-person-hud :to *dproc* :stack (&+ *fp-hud-stack* #x3800))) ) - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self fp-hud)))) @@ -500,7 +486,6 @@ (send-event *camera* 'clear-entity) (camera-change-to (the-as string 'base) 60 #f) ) - (none) ) :trans (behavior () (local-vars (sv-48 vector)) @@ -585,7 +570,6 @@ ) (set! (-> self cam-user-mode) 'normal) ) - (none) ) ) :code (behavior () @@ -605,24 +589,23 @@ ) (suspend) ) - (none) ) :post target-no-move-post ) (defstate target-billy-game (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) - ((let ((v1-4 event-type)) + ((let ((v1-4 message)) (= v1-4 'end-mode) ) (go target-stance) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -642,7 +625,6 @@ (set! (-> self fp-hud) (ppointer->handle (process-spawn first-person-hud :to *dproc* :stack (&+ *fp-hud-stack* #x3800))) ) - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self fp-hud)))) @@ -656,7 +638,6 @@ (camera-change-to (the-as string 'base) 0 #f) ) (target-exit) - (none) ) :trans (behavior () (local-vars (sv-48 vector)) @@ -730,51 +711,49 @@ ) (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) ) - (none) ) ) :code (behavior () (ja-channel-set! 0) (set! (-> self control transv quad) (the-as uint128 0)) (anim-loop) - (none) ) :post target-no-move-post ) (defstate target-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) (else - (case event-type + (case message (('end-mode) (go target-stance) ) (('play-anim) - (let ((v0-0 (the-as object (-> event param 0)))) + (let ((v0-0 (the-as object (-> block param 0)))) (set! (-> self control unknown-uint20) (the-as uint v0-0)) v0-0 ) ) (('clone-anim) - (go target-clone-anim (process->handle (the-as process (-> event param 0)))) + (go target-clone-anim (process->handle (the-as process (-> block param 0)))) ) (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('final-door) (go target-final-door - (the-as basic (process->handle (the-as process (-> event param 1)))) - (process->handle (the-as process (-> event param 2))) + (the-as basic (process->handle (the-as process (-> block param 1)))) + (process->handle (the-as process (-> block param 2))) ) ) ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -785,12 +764,10 @@ (set! (-> self neck flex-blend) 0.0) (logior! (-> self state-flags) (state-flags invulnerable grabbed)) (set! (-> self control unknown-uint20) (the-as uint 'stance)) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags invulnerable)) (target-exit) - (none) ) :code (behavior () (set-forward-vel (the-as float 0.0)) @@ -900,22 +877,20 @@ ) (label cfg-94) ) - (none) ) :post (behavior () (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (set! (-> self control transv quad) (the-as uint128 0)) ) (target-no-stick-post) - (none) ) ) (defstate target-pole-cycle (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'query) (= (-> event param 0) 'mode)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) :enter (behavior ((arg0 handle)) @@ -928,13 +903,11 @@ (set! (-> self control transv quad) (the-as uint128 0)) (send-event *camera* 'ease-in) (set! (-> self control unknown-int21) (the-as int #f)) - (none) ) :exit (behavior () (target-collide-set! 'normal (the-as float 0.0)) (logclear! (-> self control root-prim prim-core action) (collide-action swingpole-active)) (set! (-> self control unknown-handle10) (the-as handle #f)) - (none) ) :trans (behavior () (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) @@ -980,7 +953,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 handle)) (target-compute-pole) @@ -1025,7 +997,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post target-no-move-post ) @@ -1044,7 +1015,6 @@ ) (set-forward-vel arg2) (go target-pole-flip-up-jump (the-as float arg0) (the-as float arg1)) - (none) ) :post target-no-move-post ) @@ -1056,7 +1026,6 @@ :trans (behavior () ((-> target-jump-forward trans)) (vector-flatten! (-> self control transv) (-> self control transv) (-> self control unknown-vector100)) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (sound-play "jump") @@ -1078,7 +1047,6 @@ (suspend) (ja :group! eichar-jump-loop-ja :num! (loop!)) ) - (none) ) :post target-post ) @@ -1097,7 +1065,6 @@ ) (set-forward-vel arg2) (go target-pole-flip-forward-jump arg0 arg1) - (none) ) :post target-no-move-post ) @@ -1107,13 +1074,11 @@ :enter (behavior ((arg0 float) (arg1 float)) ((-> target-jump enter) arg0 arg1 (the-as surface #f)) (set! (-> self control unknown-surface00) *forward-pole-jump-mods*) - (none) ) :exit target-exit :trans (behavior () ((-> target-jump-forward trans)) (vector-flatten! (-> self control transv) (-> self control transv) (-> self control unknown-vector100)) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (sound-play "jump") @@ -1122,19 +1087,18 @@ (ja :num! (seek!)) ) ((the-as (function none :behavior target) (-> target-pole-flip-up-jump code))) - (none) ) :post target-post ) (defstate target-edge-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (go target-falling 'target-edge-grab) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -1146,14 +1110,12 @@ (set! (-> self control unknown-vector102 quad) (-> self control transv quad)) (set! (-> self control transv quad) (the-as uint128 0)) (send-event *camera* 'ease-in) - (none) ) :exit (behavior () (when (logtest? (-> self control root-prim prim-core action) (collide-action edgegrab-cam)) (logclear! (-> self control root-prim prim-core action) (collide-action edgegrab-active edgegrab-cam)) (send-event *camera* 'damp-up) ) - (none) ) :trans (behavior () (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) @@ -1193,7 +1155,6 @@ ) ) ) - (none) ) :code (behavior () (target-compute-edge) @@ -1241,19 +1202,18 @@ (ja :num! (seek!)) ) ) - (none) ) :post target-no-move-post ) (defstate target-edge-grab-jump (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (go target-falling 'target-edge-grab) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -1281,7 +1241,6 @@ (set-forward-vel (the-as float 16384.0)) (send-event *camera* 'damp-up) (go target-jump-forward arg0 arg1) - (none) ) :post target-no-move-post ) @@ -1317,7 +1276,6 @@ (+! (-> self control transv z) (-> self control rider-last-move z)) ) (go target-falling 'target-edge-grab) - (none) ) :post target-no-move-post ) @@ -1352,14 +1310,12 @@ ) ) ) - (none) ) :exit (behavior () (set! (-> *run-attack-mods* turnv) 0.0) (set! (-> *run-attack-mods* turnvv) 0.0) (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) (target-exit) - (none) ) :code (behavior () (let ((gp-0 (the-as handle #f))) @@ -1442,7 +1398,6 @@ (go target-stance) (go target-falling #f) ) - (none) ) :post target-post ) @@ -1491,13 +1446,11 @@ ) ) ) - (none) ) :exit (behavior () (rot->dir-targ! (-> self control)) (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) (target-exit) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1559,7 +1512,6 @@ (go target-stance) (go target-falling #f) ) - (none) ) :post target-no-stick-post ) @@ -1569,7 +1521,6 @@ :exit target-exit :trans (behavior () (slide-down-test) - (none) ) :code (behavior ((arg0 object) (arg1 float)) (set! (-> self neck flex-blend) 0.0) @@ -1641,7 +1592,6 @@ ) ) (go target-falling 'target-eco-powerup) - (none) ) :post target-post ) @@ -1652,7 +1602,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *wade-mods*) (set-zero! (-> self water bob)) - (none) ) :exit (behavior () (target-state-hook-exit) @@ -1661,7 +1610,6 @@ (set! (-> v1-1 channel-offset) 0) ) 0 - (none) ) :trans (behavior () ((-> self state-hook)) @@ -1698,7 +1646,6 @@ (if (can-hands? #t) (go target-running-attack) ) - (none) ) :code (-> target-stance code) :post target-post @@ -1743,7 +1690,6 @@ (if (can-hands? #t) (go target-running-attack) ) - (none) ) :code (behavior () (let ((gp-0 105) @@ -1917,7 +1863,6 @@ (suspend) ) ) - (none) ) :post target-post ) @@ -1962,7 +1907,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *swim-mods*) (logior! (-> self water flags) (water-flags wt04)) - (none) ) :exit (behavior () (target-state-hook-exit) @@ -1977,7 +1921,6 @@ (quaternion-identity! (-> self control unknown-quaternion01)) (set! (-> self control unknown-float00) 0.0) ) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -2029,7 +1972,6 @@ (go target-swim-walk) ) (target-swim-tilt (the-as float 0.0) (the-as float 2.0) (the-as float 0.0) (the-as float 1.0)) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -2080,7 +2022,6 @@ ) ) ) - (none) ) :post target-swim-post ) @@ -2091,7 +2032,6 @@ ((-> target-swim-stance enter)) (die-on-next-update! (-> self water bob)) (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) - (none) ) :exit (-> target-swim-stance exit) :trans (behavior () @@ -2145,7 +2085,6 @@ ) ) (target-swim-tilt (the-as float 0.0) (the-as float 2.0) (the-as float 0.0) (the-as float 1.0)) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -2185,16 +2124,15 @@ (ja :num! (seek!)) ) ) - (none) ) :post target-swim-post ) (defstate target-swim-down (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'attack-invinc) - (let ((v1-2 (the-as attack-info (-> event param 1)))) + (let ((v1-2 (the-as attack-info (-> block param 1)))) (when (or (not (logtest? (-> v1-2 mask) (attack-mask mode))) (= (-> v1-2 mode) 'generic) (= (-> v1-2 mode) 'drown)) (set! (-> v1-2 mode) 'damage) (if (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact-info-target health))) @@ -2206,7 +2144,7 @@ ) ) ) - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -2219,7 +2157,6 @@ (if (= (-> self next-state name) 'target-swim-down) (set! (-> self control unknown-float130) 0.0) ) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) @@ -2234,7 +2171,6 @@ (quaternion-identity! (-> self control unknown-quaternion01)) (set! (-> self control unknown-float00) 0.0) ) - (none) ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self water swim-time)) (seconds 0.5)) @@ -2254,7 +2190,6 @@ ) ) ) - (none) ) :code (behavior () (let ((gp-0 60) @@ -2354,7 +2289,6 @@ ) ) ) - (none) ) :post target-swim-post ) @@ -2381,7 +2315,6 @@ (send-event self 'attack #f (static-attack-info ((mode 'drown-death)))) ) ((-> target-swim-down trans)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -2454,7 +2387,6 @@ (start-bobbing! (-> self water) (the-as float -4096.0) 600 1500) (set! (-> self water bob start-time) (+ (-> *display* base-frame-counter) (seconds -0.05))) (go target-swim-stance) - (none) ) :post target-swim-post ) @@ -2474,7 +2406,6 @@ ) ) ((-> target-jump trans)) - (none) ) :code (-> target-jump code) :post target-post @@ -2488,7 +2419,6 @@ (die-on-next-update! (-> self water bob)) (set! (-> self water align-offset) 0.0) (logior! (-> self water flags) (water-flags wt16)) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (die-on-next-update! (-> self water bob)) @@ -2523,7 +2453,6 @@ ) (go target-swim-jump-jump (+ f30-0 arg0) (+ f30-0 arg1) (the-as surface #f)) ) - (none) ) :post target-swim-post ) @@ -2535,7 +2464,6 @@ (set! (-> self control unknown-dword33) 0) (set-forward-vel (the-as float 0.0)) (set! (-> self control unknown-surface00) *walk-mods*) - (none) ) :code (behavior ((arg0 float)) (when (!= arg0 0.0) @@ -2577,16 +2505,15 @@ (go target-stance) ) ) - (none) ) :post target-no-stick-post ) (defstate target-launch (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'query) (= (-> event param 0) 'mode)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'query) (= (-> block param 0) 'mode)) 'target-launch - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) :code (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) @@ -2673,14 +2600,13 @@ ;; PAL patch (sound plays elsewhere) ;(sound-play "launch-fire") (go target-high-jump arg0 arg0 'launch) - (none) ) :post target-no-stick-post ) (defstate target-periscope (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode) #f ) @@ -2691,7 +2617,7 @@ ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -2700,7 +2626,6 @@ (set! (-> self cam-user-mode) 'normal) ;; og:preserve-this PAL patch here (logclear! (-> self state-flags) (state-flags invulnerable grabbed)) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self neck flex-blend) 0.0) @@ -2733,7 +2658,6 @@ (ja :num! (seek! 0.0 2.0)) ) (go target-stance) - (none) ) :post target-no-stick-post ) @@ -2751,12 +2675,10 @@ ) (logior! (-> self state-flags) (state-flags grabbed)) (set! (-> self neck flex-blend) 0.0) - (none) ) :exit (behavior () (send-event (handle->process (-> self control unknown-handle10)) 'end-mode) (target-exit) - (none) ) :code (behavior ((arg0 string) (arg1 handle)) (let ((gp-0 (the-as art-joint-anim (lookup-art (-> self draw art-group) arg0 art-joint-anim)))) @@ -2772,17 +2694,16 @@ ) ) (go target-stance) - (none) ) :post target-no-stick-post ) (defstate target-clone-anim (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) - ((-> target-grab event) proc arg1 event-type event) + ((-> target-grab event) proc argc message block) ) :enter (behavior ((arg0 handle)) (set! (-> self control unknown-handle10) arg0) @@ -2793,7 +2714,6 @@ (vector-reset! (-> self control transv)) (set! (-> self neck flex-blend) 0.0) (send-event (ppointer->process (-> self sidekick)) 'shadow #t) - (none) ) :exit (behavior () (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) @@ -2838,12 +2758,10 @@ (ja-channel-set! 0) (ja-post) (target-exit) - (none) ) :code (behavior ((arg0 handle)) (clone-anim arg0 (the-as int (-> self draw origin-joint-index)) #t "") (go target-stance) - (none) ) :post target-no-ja-move-post ) diff --git a/goal_src/jak1/engine/ui/hud.gc b/goal_src/jak1/engine/ui/hud.gc index ddb07a3c6ce..f555210c750 100644 --- a/goal_src/jak1/engine/ui/hud.gc +++ b/goal_src/jak1/engine/ui/hud.gc @@ -220,9 +220,9 @@ ) (defstate hud-hidden (hud) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case arg2 + (case message (('show) (if (and (not *progress-process*) (!= (-> self last-hide-time) (-> *display* base-frame-counter))) (go hud-arriving) @@ -273,32 +273,28 @@ (kill-and-free-particles (-> self particles gp-1 part)) (set! (-> self particles gp-1 part matrix) -1) ) - (none) ) :exit (behavior () (set! (-> self y-offset) (-> self next-y-offset)) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (loop (suspend) ) - (none) ) :post (behavior () (if (-> self deactivate-when-hidden) (deactivate self) ) (hud-update self) - (none) ) ) (defstate hud-arriving (hud) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-3 object)) - (case arg2 + (case message (('hide-quick) (set! (-> self last-hide-time) (-> *display* base-frame-counter)) (set! (-> self force-on-screen) #f) @@ -351,7 +347,6 @@ (set! (-> self particles gp-1 part matrix) (sprite-allocate-user-hvdf)) ) ) - (none) ) :code (behavior () (loop @@ -373,13 +368,11 @@ ) (suspend) ) - (none) ) :post (behavior () (hud-update self) (draw-particles self) (draw-hud self) - (none) ) ) @@ -402,7 +395,6 @@ (go hud-hidden) ) (go hud-leaving 5) - (none) ) :post (-> hud-arriving post) ) @@ -429,7 +421,6 @@ ) (suspend) ) - (none) ) :post (-> hud-arriving post) ) @@ -472,7 +463,6 @@ (fuel-cell-animate) ) ) - (none) ) :code (behavior ((arg0 handle)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -521,11 +511,6 @@ ) ) ) - (none) ) :post ja-post ) - - - - diff --git a/goal_src/jak1/engine/ui/progress/progress.gc b/goal_src/jak1/engine/ui/progress/progress.gc index 953af05ef65..ff9365e6159 100644 --- a/goal_src/jak1/engine/ui/progress/progress.gc +++ b/goal_src/jak1/engine/ui/progress/progress.gc @@ -874,8 +874,8 @@ ) (defstate progress-waiting (progress) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('go-away) (go progress-gone) ) @@ -895,7 +895,6 @@ ) (suspend) ) - (none) ) ) @@ -906,7 +905,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -1716,99 +1714,98 @@ ) (defstate progress-normal (progress) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (the-as object (case event-type - (('go-away) - (go progress-going-out) - ) - (('notify) - (cond - ((= (-> event param 0) 'done) - (case (-> self display-state) - (((progress-screen memcard-saving)) - (cond - ((= (-> self display-state-stack 0) (progress-screen title)) - (let ((gp-1 (-> *setting-control* default auto-save))) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (cond - ;; Start a new game differently if speedrunning mode is active - ((= (-> *pc-settings* speedrunner-mode?) #t) - (speedrun-start-full-game-run)) - ;; start the game normally - (else - (initialize! *game-info* 'game (the-as game-save #f) "intro-start") - (set! (-> *setting-control* default auto-save) gp-1))) - ) - (the-as object (set-master-mode 'game)) - ) - (else - (set! v0-0 -1) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - ) - ) - (((progress-screen memcard-formatting)) - (set! (-> self force-transition) #t) - (set! v0-0 15) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-creating)) - (cond - ((= (-> self display-state-stack 0) (progress-screen title)) - (set! v0-0 18) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - ) - (else - (set! v0-0 17) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - ) - ) - v0-0 - ) - ) - ) - ((= (-> event param 0) 'error) - (format #t "ERROR NOTIFY: ~S ~D~%" (enum->string mc-status-code (-> event param 1)) (-> self display-state)) - (case (-> event param 1) - ((14) - (set! v0-0 7) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (else - (case (-> self display-state) - (((progress-screen memcard-formatting)) - (set! v0-0 24) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-creating)) - (set! v0-0 25) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-saving)) - (set! v0-0 21) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-loading)) - (set! v0-0 20) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - ) - ) - ) - ) - ) - ) - ) + (case message + (('go-away) + (go progress-going-out) + ) + (('notify) + (cond + ((= (-> block param 0) 'done) + (case (-> self display-state) + (((progress-screen memcard-saving)) + (cond + ((= (-> self display-state-stack 0) (progress-screen title)) + (let ((gp-1 (-> *setting-control* default auto-save))) + (sound-volume-off) + (set! (-> *game-info* mode) 'play) + (cond + ;; Start a new game differently if speedrunning mode is active + ((= (-> *pc-settings* speedrunner-mode?) #t) + (speedrun-start-full-game-run)) + ;; start the game normally + (else + (initialize! *game-info* 'game (the-as game-save #f) "intro-start") + (set! (-> *setting-control* default auto-save) gp-1))) + ) + (set-master-mode 'game) + ) + (else + (set! v0-0 -1) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + v0-0 + ) + ) + ) + (((progress-screen memcard-formatting)) + (set! (-> self force-transition) #t) + (set! v0-0 15) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + v0-0 + ) + (((progress-screen memcard-creating)) + (cond + ((= (-> self display-state-stack 0) (progress-screen title)) + (set! v0-0 18) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + ) + (else + (set! v0-0 17) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + ) + ) + v0-0 + ) ) + ) + ((= (-> block param 0) 'error) + (format #t "ERROR NOTIFY: ~S ~D~%" (enum->string mc-status-code (-> block param 1)) (-> self display-state)) + (case (-> block param 1) + ((14) + (set! v0-0 7) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + v0-0 + ) + (else + (case (-> self display-state) + (((progress-screen memcard-formatting)) + (set! v0-0 24) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + v0-0 + ) + (((progress-screen memcard-creating)) + (set! v0-0 25) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + v0-0 + ) + (((progress-screen memcard-saving)) + (set! v0-0 21) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + v0-0 + ) + (((progress-screen memcard-loading)) + (set! v0-0 20) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + ) + ) ) :code (behavior () (loop @@ -1951,7 +1948,6 @@ ) (suspend) ) - (none) ) :post (behavior () (let* ((a1-0 (-> self display-level-index)) @@ -2119,7 +2115,6 @@ ) (adjust-sprites self) (adjust-icons self) - (none) ) ) @@ -2133,7 +2128,6 @@ (sound-play "select-menu") (set-blackout-frames 0) (set! *pause-lock* #f) - (none) ) :code (behavior () (loop @@ -2151,7 +2145,6 @@ ) (suspend) ) - (none) ) :post (-> progress-normal post) ) @@ -2167,7 +2160,6 @@ (set! (-> self transition-speed) 30.0) ) ) - (none) ) :code (behavior () (loop @@ -2185,14 +2177,13 @@ ) (suspend) ) - (none) ) :post (-> progress-normal post) ) (defstate progress-debug (progress) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('go-away) (go progress-going-out) ) @@ -2244,7 +2235,6 @@ (load-game-text-info (-> *text-group-names* (-> self current-debug-group)) '*common-text* *common-text-heap*) (suspend) ) - (none) ) :post (behavior () (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) @@ -2393,6 +2383,5 @@ (draw-debug-text-box gp-4) (print-game-text (-> *common-text* data (-> self current-debug-string) text) gp-4 #f 128 22) ) - (none) ) ) diff --git a/goal_src/jak1/kernel/gkernel-h.gc b/goal_src/jak1/kernel/gkernel-h.gc index 1ae1f63cebb..72c3782d9f6 100644 --- a/goal_src/jak1/kernel/gkernel-h.gc +++ b/goal_src/jak1/kernel/gkernel-h.gc @@ -396,10 +396,10 @@ ;; A protect frame is a frame which has a cleanup function called on exit. (deftype protect-frame (stack-frame) - ((exit (function none) :offset-assert 12)) ;; function to call to clean up + ((exit (function object) :offset-assert 12)) ;; function to call to clean up (:methods - (new (symbol type (function none)) protect-frame) + (new (symbol type (function object)) protect-frame) ) :size-assert 16 :method-count-assert 9 @@ -495,16 +495,16 @@ ;; so if you abort out of a process, it cleans up the state too. (deftype state (protect-frame) ((code function :offset-assert 16) - (trans (function none) :offset-assert 20) + (trans (function object) :offset-assert 20) (post function :offset-assert 24) (enter function :offset-assert 28) (event (function process int symbol event-message-block object) :offset-assert 32) ) (:methods (new (symbol type symbol function - (function none) + (function object) function - (function none) + (function object) (function process int symbol event-message-block object)) _type_ 0) ) :method-count-assert 9 diff --git a/goal_src/jak1/kernel/gkernel.gc b/goal_src/jak1/kernel/gkernel.gc index 2599ef64175..26199321656 100644 --- a/goal_src/jak1/kernel/gkernel.gc +++ b/goal_src/jak1/kernel/gkernel.gc @@ -550,6 +550,22 @@ ) ) +(defmacro abandon-thread () + ;; abandon this one too. + ;; NOTE - this is different from GOAL. + ;; GOAL installs this as the return address for this function and returns normally. + ;; but we don't because I don't have an easy way to find where to stick this. + ;; I can't see how this makes a difference, as all non-main threads seem + ;; temporary, but if this turns out to be false, we will need to change this. + `(rlet ((temp) + (off :reg r15 :type uint :reset-here #t)) + (.mov temp return-from-thread) ;; could probably just call this... + (.add temp off) + (.push temp) + (.ret) + ) + ) + (defun reset-and-call ((obj thread) (func function)) "Make the given thread the top thread, reset the stack, and call the function. Sets up a return trampoline so when the function returns it will return to the @@ -2034,7 +2050,7 @@ (break) ) -(defmethod new protect-frame ((allocation symbol) (type-to-make type) (func (function none))) +(defmethod new protect-frame ((allocation symbol) (type-to-make type) (func (function object))) (let ((obj (the protect-frame (&+ allocation *gtype-basic-offset*)))) (set! (-> obj type) type-to-make) (set! (-> obj name) 'protect-frame) diff --git a/goal_src/jak1/kernel/gstate.gc b/goal_src/jak1/kernel/gstate.gc index 9580fcd66c2..aba54d79556 100644 --- a/goal_src/jak1/kernel/gstate.gc +++ b/goal_src/jak1/kernel/gstate.gc @@ -262,9 +262,9 @@ It type checks the arguments for the entry function. (type-to-make type) (name symbol) (code function) - (trans (function none)) + (trans (function object)) (enter function) - (exit (function none)) + (exit (function object)) (event (function process int symbol event-message-block object))) "Allocate a new state. It seems like this isn't really used much and most states are statically allocated and as a result don't have the constructor called." diff --git a/goal_src/jak1/levels/beach/beach-obs.gc b/goal_src/jak1/levels/beach/beach-obs.gc index 9cb3b2257c7..251c16bb1e6 100644 --- a/goal_src/jak1/levels/beach/beach-obs.gc +++ b/goal_src/jak1/levels/beach/beach-obs.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (defskelgroup *beachcam-sg* beachcam beachcam-lod0-jg beachcam-anim-ja ((beachcam-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 60) @@ -38,7 +37,6 @@ (defstate windmill-one-idle (windmill-one) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (rider-trans) @@ -47,7 +45,6 @@ (sound-play "gears-rumble" :id (-> self sound-id) :position (the-as symbol t2-0)) ) ) - (none) ) :code (behavior () (loop @@ -57,7 +54,6 @@ (ja :num! (seek! max 0.5)) ) ) - (none) ) :post (the-as (function none :behavior windmill-one) rider-post) ) @@ -207,19 +203,19 @@ ) (defstate grottopole-idle (grottopole) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (when (= (-> proc type) target) - (case event-type + (case message (('attack) - (let ((v1-2 (-> event param 2))) + (let ((v1-2 (-> block param 2))) (when (!= v1-2 (-> self incomming-attack-id)) (set! (-> self incomming-attack-id) v1-2) - (case (-> event param 1) + (case (-> block param 1) (('uppercut) (when (and (< (-> *target* control trans y) (+ -40960.0 (-> self root-override trans y))) (< (-> self position) (-> self max-position)) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 2) ) @@ -234,7 +230,7 @@ (when (and (< (+ -40960.0 (-> self root-override trans y)) (-> *target* control trans y)) (> (-> self position) 0) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) @@ -260,7 +256,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) @@ -311,7 +306,6 @@ ) (move-grottopole self 1.0) (go grottopole-idle) - (none) ) :post (the-as (function none :behavior grottopole) transform-post) ) @@ -325,7 +319,6 @@ ) (move-grottopole self -1.0) (go grottopole-idle) - (none) ) :post (the-as (function none :behavior grottopole) transform-post) ) @@ -533,8 +526,8 @@ ) (defstate ecoventrock-idle (ecoventrock) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (sound-play "cannon-shot") (increment-success-for-hint (text-id sidekick-hint-ecorocks)) @@ -548,7 +541,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) @@ -559,7 +551,6 @@ ) :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior ((arg0 symbol)) (local-vars (sv-128 symbol)) @@ -664,7 +655,6 @@ ) (process-entity-status! self (entity-perm-status dead) #t) (deactivate self) - (none) ) ) @@ -719,7 +709,6 @@ (defstate flying-rock-rolling (flying-rock) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior () (let ((gp-0 #f) @@ -793,14 +782,12 @@ (suspend) ) (go flying-rock-idle) - (none) ) :post (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) (go flying-rock-idle) ) (ja-post) - (none) ) ) @@ -815,7 +802,6 @@ (suspend) ) (deactivate self) - (none) ) :post (the-as (function none :behavior flying-rock) ja-post) ) @@ -895,7 +881,6 @@ (pusher-post) (suspend) ) - (none) ) ) @@ -903,7 +888,7 @@ (let ((v1-0 arg2)) (quaternion-axis-angle! (the-as quaternion (&-> arg0 link)) 0.0 0.0 1.0 (-> v1-0 angle)) ) - (the-as object 0) + 0 ) (defmethod init-from-entity! bladeassm ((obj bladeassm) (arg0 entity-actor)) @@ -1018,12 +1003,12 @@ ) (defstate flutflutegg-idle (flutflutegg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (when (and (= event-type 'attack) - (or (= (-> event param 1) 'punch) (= (-> event param 1) 'spin) (= (-> event param 1) 'spin-air)) - (!= (-> self incomming-attack-id) (-> event param 2)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (= message 'attack) + (or (= (-> block param 1) 'punch) (= (-> block param 1) 'spin) (= (-> block param 1) 'spin-air)) + (!= (-> self incomming-attack-id) (-> block param 2)) ) - (set! (-> self incomming-attack-id) (-> event param 2)) + (set! (-> self incomming-attack-id) (-> block param 2)) (flutflutegg-hit-sounds) (let ((s5-1 (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans)) @@ -1099,42 +1084,37 @@ ) ) ) - (none) ) :code (behavior () (ja-post) (loop (suspend) ) - (none) ) ) (defstate flutflutegg-physics (flutflutegg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (= event-type 'attack) - (or (= (-> event param 1) 'punch) (= (-> event param 1) 'spin) (= (-> event param 1) 'spin-air)) - (!= (-> self incomming-attack-id) (-> event param 2)) - ) - (set! (-> self incomming-attack-id) (-> event param 2)) - (flutflutegg-hit-sounds) - (let ((s5-1 - (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans)) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (= message 'attack) + (or (= (-> block param 1) 'punch) (= (-> block param 1) 'spin) (= (-> block param 1) 'spin-air)) + (!= (-> self incomming-attack-id) (-> block param 2)) + ) + (set! (-> self incomming-attack-id) (-> block param 2)) + (flutflutegg-hit-sounds) + (let ((s5-1 + (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans)) ) - (set! (-> s5-1 y) 0.0) - (vector-normalize! s5-1 1.0) - (let ((f0-2 (vector-dot s5-1 (-> self dir))) - (f1-2 (- (* (-> s5-1 x) (-> self dir z)) (* (-> s5-1 z) (-> self dir x)))) - ) - (if (< f0-2 -0.7) - (the-as symbol (flutflutegg-method-20 self 24576.0 (* -8192.0 f1-2) (* -8192.0 f0-2))) - (the-as symbol (flutflutegg-method-20 self 0.0 (* -8192.0 f1-2) (* -8192.0 f0-2))) - ) ) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (let ((f0-2 (vector-dot s5-1 (-> self dir))) + (f1-2 (- (* (-> s5-1 x) (-> self dir z)) (* (-> s5-1 z) (-> self dir x)))) + ) + (if (< f0-2 -0.7) + (flutflutegg-method-20 self 24576.0 (* -8192.0 f1-2) (* -8192.0 f0-2)) + (flutflutegg-method-20 self 0.0 (* -8192.0 f1-2) (* -8192.0 f0-2)) + ) ) ) ) @@ -1165,7 +1145,6 @@ (go flutflutegg-physics-fall) ) ) - (none) ) :post (the-as (function none :behavior flutflutegg) ja-post) ) @@ -1230,7 +1209,6 @@ (sound-play "sack-land" :vol 200) (go flutflutegg-break #f) ) - (none) ) :post (the-as (function none :behavior flutflutegg) ja-post) ) @@ -1285,7 +1263,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) :post (the-as (function none :behavior flutflutegg) ja-post) ) @@ -1365,8 +1342,8 @@ ) (defstate harvester-idle (harvester) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('update) (if (and (-> self alt-actor) (logtest? (-> self alt-actor extra perm status) (entity-perm-status complete))) (go harvester-inflate #f) @@ -1384,7 +1361,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) @@ -1404,7 +1380,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior harvester) ja-post) ) diff --git a/goal_src/jak1/levels/beach/beach-part.gc b/goal_src/jak1/levels/beach/beach-part.gc index e5fddf0e8d5..70d6cf333f1 100644 --- a/goal_src/jak1/levels/beach/beach-part.gc +++ b/goal_src/jak1/levels/beach/beach-part.gc @@ -100,7 +100,6 @@ ) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/beach/beach-rocks.gc b/goal_src/jak1/levels/beach/beach-rocks.gc index d66ac3f99ef..11780aa2e42 100644 --- a/goal_src/jak1/levels/beach/beach-rocks.gc +++ b/goal_src/jak1/levels/beach/beach-rocks.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defskelgroup *lrocklrg-sg* lrocklrg lrocklrg-lod0-jg lrocklrg-idle-ja ((lrocklrg-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 5) @@ -272,8 +271,8 @@ (defstate idle (beach-rock) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (set! (-> self trigger) #t) (go-virtual falling) @@ -293,7 +292,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) @@ -305,7 +303,6 @@ (spool-push *art-control* "lrocklrg-falling" 0 self -1.0) (suspend) ) - (none) ) ) @@ -340,7 +337,6 @@ ) (set! (-> self prev-frame) f30-0) ) - (none) ) :code (behavior () (local-vars (v1-3 symbol) (v1-49 symbol)) @@ -397,7 +393,6 @@ ) (set! (-> self draw bounds w) 20480.0) (go-virtual fallen) - (none) ) :post (the-as (function none :behavior beach-rock) transform-post) ) @@ -423,7 +418,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior beach-rock) ja-post) ) diff --git a/goal_src/jak1/levels/beach/bird-lady-beach.gc b/goal_src/jak1/levels/beach/bird-lady-beach.gc index 07042231bc4..1753326b322 100644 --- a/goal_src/jak1/levels/beach/bird-lady-beach.gc +++ b/goal_src/jak1/levels/beach/bird-lady-beach.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype bird-lady-beach (process-taskable) ((flutflut handle :offset-assert 384) (egg handle :offset-assert 392) @@ -42,7 +41,6 @@ (go-virtual hidden) ) ((-> (method-of-type process-taskable idle) enter)) - (none) ) ) diff --git a/goal_src/jak1/levels/beach/lurkercrab.gc b/goal_src/jak1/levels/beach/lurkercrab.gc index bdd10643e90..eab17cf0b0a 100644 --- a/goal_src/jak1/levels/beach/lurkercrab.gc +++ b/goal_src/jak1/levels/beach/lurkercrab.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defpartgroup group-lurkercrab-slide :id 159 :bounds (static-bspherem 0 -12 0 14) @@ -92,10 +91,9 @@ 6144.0 16384.0 ) - (the-as object (if (not (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8))) - (do-push-aways! (-> obj collide-info)) - ) - ) + (if (not (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8))) + (do-push-aways! (-> obj collide-info)) + ) ) (defmethod attack-handler lurkercrab ((obj lurkercrab) (arg0 process) (arg1 event-message-block)) @@ -202,7 +200,6 @@ nav-enemy-default-event-handler ) :exit (behavior () (set! (-> self draw force-lod) -1) - (none) ) :code (behavior () (set! (-> self target-speed) 0.0) @@ -232,7 +229,6 @@ nav-enemy-default-event-handler (ja :num! (seek! (ja-aframe 1.0 0))) ) ) - (none) ) ) @@ -270,7 +266,6 @@ nav-enemy-default-event-handler (lurkercrab-invulnerable) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) - (none) ) :code (behavior () (when (ja-group? lurkercrab-idle-ja) @@ -331,7 +326,6 @@ nav-enemy-default-event-handler (ja :num! (seek! (ja-aframe 90.0 0))) ) ) - (none) ) ) @@ -343,7 +337,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-chase) - (none) ) ) @@ -356,7 +349,6 @@ nav-enemy-default-event-handler :exit (behavior () (lurkercrab-invulnerable) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) - (none) ) :trans (behavior () (if (logtest? (-> *target* state-flags) @@ -367,7 +359,6 @@ nav-enemy-default-event-handler (if (< (ja-aframe-num 0) 2.0) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) ) - (none) ) :code (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) @@ -418,7 +409,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) ) - (none) ) ) @@ -430,7 +420,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-patrol) - (none) ) ) @@ -442,7 +431,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-patrol) - (none) ) ) @@ -461,7 +449,6 @@ nav-enemy-default-event-handler (suspend) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -472,7 +459,6 @@ nav-enemy-default-event-handler ) :exit (behavior () (set! (-> self orient) #t) - (none) ) :code (behavior () (set! (-> self momentum-speed) 57344.0) @@ -494,7 +480,6 @@ nav-enemy-default-event-handler ) ) (go-virtual nav-enemy-chase) - (none) ) :post (behavior () (let ((a0-0 (-> self part)) @@ -503,7 +488,6 @@ nav-enemy-default-event-handler (spawn a0-0 (the-as vector a1-0)) ) (nav-enemy-travel-post) - (none) ) ) diff --git a/goal_src/jak1/levels/beach/lurkerpuppy.gc b/goal_src/jak1/levels/beach/lurkerpuppy.gc index 4dcbba4e2ca..b846fc81642 100644 --- a/goal_src/jak1/levels/beach/lurkerpuppy.gc +++ b/goal_src/jak1/levels/beach/lurkerpuppy.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype lurkerpuppy (nav-enemy) () :heap-base #x120 @@ -41,7 +40,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-chase) - (none) ) ) @@ -80,7 +78,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) ) @@ -125,7 +122,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) ) @@ -158,7 +154,6 @@ nav-enemy-default-event-handler (ja :num! (seek! max 1.4)) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -171,7 +166,6 @@ nav-enemy-default-event-handler :code (behavior () (sound-play "head-butt") (go-virtual nav-enemy-victory) - (none) ) ) @@ -183,7 +177,6 @@ nav-enemy-default-event-handler ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) - (none) ) :code (behavior () (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) @@ -202,7 +195,6 @@ nav-enemy-default-event-handler ) ) (go-virtual nav-enemy-chase) - (none) ) :post (the-as (function none :behavior lurkerpuppy) nav-enemy-face-player-post) ) diff --git a/goal_src/jak1/levels/beach/lurkerworm.gc b/goal_src/jak1/levels/beach/lurkerworm.gc index ccbd97a05cb..eda7c96b866 100644 --- a/goal_src/jak1/levels/beach/lurkerworm.gc +++ b/goal_src/jak1/levels/beach/lurkerworm.gc @@ -288,7 +288,6 @@ lurkerworm-default-post-behavior :enter (behavior () (ja-channel-set! 0) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior () (loop @@ -300,7 +299,6 @@ lurkerworm-default-post-behavior ) (suspend) ) - (none) ) :post lurkerworm-default-post-behavior ) @@ -310,7 +308,6 @@ lurkerworm-default-post-behavior :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (sound-play "worm-rise1") - (none) ) :code (behavior () (set! (-> self part local-clock) 0) @@ -325,7 +322,6 @@ lurkerworm-default-post-behavior ) (suspend) ) - (none) ) :post lurkerworm-default-post-behavior ) @@ -334,7 +330,6 @@ lurkerworm-default-post-behavior :event lurkerworm-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior () (ja-channel-set! 1) @@ -347,7 +342,6 @@ lurkerworm-default-post-behavior ) (set! (-> self strike-count) 3) (go lurkerworm-rest) - (none) ) :post lurkerworm-default-post-behavior ) @@ -357,11 +351,9 @@ lurkerworm-default-post-behavior :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self vulnerable) #t) - (none) ) :exit (behavior () (set! (-> self vulnerable) #f) - (none) ) :code (behavior () (let* ((f30-0 10.0) @@ -411,7 +403,6 @@ lurkerworm-default-post-behavior (go lurkerworm-sink) ) ) - (none) ) :post lurkerworm-default-post-behavior ) @@ -431,7 +422,6 @@ lurkerworm-default-post-behavior (ja-no-eval :num! (seek!)) (ja-channel-push! 1 (seconds 0.135)) (go lurkerworm-rest) - (none) ) :post lurkerworm-default-post-behavior ) @@ -440,7 +430,6 @@ lurkerworm-default-post-behavior :event lurkerworm-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior () (ja-no-eval :group! lurkerworm-sink-ja :num! (seek!) :frame-num 0.0) @@ -451,7 +440,6 @@ lurkerworm-default-post-behavior (ja :num! (seek!)) ) (go lurkerworm-idle) - (none) ) :post lurkerworm-default-post-behavior ) @@ -474,7 +462,6 @@ lurkerworm-default-post-behavior (ja :num! (seek!)) ) (cleanup-for-death self) - (none) ) :post lurkerworm-default-post-behavior ) diff --git a/goal_src/jak1/levels/beach/mayor.gc b/goal_src/jak1/levels/beach/mayor.gc index c0a77b5db37..0374fd75252 100644 --- a/goal_src/jak1/levels/beach/mayor.gc +++ b/goal_src/jak1/levels/beach/mayor.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype mayor (process-taskable) () :heap-base #x110 @@ -704,7 +703,6 @@ (go-virtual hidden) ) ((-> (method-of-type process-taskable idle) trans)) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type process-taskable idle) post))) @@ -713,7 +711,6 @@ ) ) (do-push-aways! (-> self root-override)) - (none) ) ) diff --git a/goal_src/jak1/levels/beach/pelican.gc b/goal_src/jak1/levels/beach/pelican.gc index eab3cdf06be..663afbb0a61 100644 --- a/goal_src/jak1/levels/beach/pelican.gc +++ b/goal_src/jak1/levels/beach/pelican.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype pelican-bank (basic) ((circle-speed meters :offset-assert 4) (dive-time seconds :offset-assert 8) @@ -181,26 +180,23 @@ ) (defstate pelican-circle (pelican) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('dive) - (let ((v0-0 (the-as structure #t))) - (set! (-> self state-object) (the-as symbol v0-0)) - v0-0 - ) - ) - (('fuel-cell) - (handle->process (-> self fuel-cell)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('dive) + (let ((v0-0 (the-as structure #t))) + (set! (-> self state-object) (the-as symbol v0-0)) + v0-0 ) - (('position) - (set! (-> self path-pos) (the-as float (-> event param 0))) - (let ((a1-3 (path-control-method-12 (-> self path) (new 'stack-no-clear 'vector) (-> self path-pos)))) - (set-heading-vec! (-> self root-override) a1-3) - ) + ) + (('fuel-cell) + (handle->process (-> self fuel-cell)) + ) + (('position) + (set! (-> self path-pos) (the-as float (-> block param 0))) + (let ((a1-3 (path-control-method-12 (-> self path) (new 'stack-no-clear 'vector) (-> self path-pos)))) + (set-heading-vec! (-> self root-override) a1-3) ) - ) + ) ) ) :enter (behavior () @@ -233,7 +229,6 @@ (/ (* (-> *PELICAN-bank* circle-speed) (-> self path-max)) (path-distance (-> self path))) ) (set-roll-to-grav-2! (-> self root-override) -2730.6667) - (none) ) :trans (behavior () (pelican-path-update 728177.75 30 1.0 (/ (-> self path-max) (path-distance (-> self path))) #f) @@ -302,7 +297,6 @@ ) (go pelican-dive (-> self path-dive0) (-> self path-to-nest0) (-> *PELICAN-bank* to-nest0-time)) ) - (none) ) :code (behavior () (suspend) @@ -311,22 +305,20 @@ (the-as (function pelican int) (lambda () (rand-vu-int-range 2 4))) (the-as (function pelican int) (lambda () (rand-vu-int-range 3 5))) ) - (none) ) :post pelican-post ) (defstate pelican-dive (pelican) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('got-cell?) - (-> self state-object) - ) - (('fuel-cell) - (handle->process (-> self fuel-cell)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('got-cell?) + (-> self state-object) + ) + (('fuel-cell) + (handle->process (-> self fuel-cell)) + ) + ) ) :enter (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame)) (init! (-> self query) (the-as string #f) 40 150 25 #t (the-as string #f)) @@ -354,11 +346,9 @@ ) (set! (-> self draw force-lod) 0) 0 - (none) ) :exit (behavior () (set! (-> self draw force-lod) -1) - (none) ) :trans (behavior () (if (not (handle->process (-> self fuel-cell))) @@ -369,7 +359,6 @@ (if (= (-> self path-pos) (-> self path-max)) (go pelican-to-nest (-> self path-cache) (the-as int (-> self time-cache))) ) - (none) ) :code (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame)) (ja-channel-push! 1 (seconds 0.2)) @@ -396,7 +385,6 @@ (ja :num! (seek!)) ) (anim-loop) - (none) ) :post pelican-post ) @@ -407,7 +395,6 @@ (set! (-> self path-pos) 0.0) (set! (-> self path-max) (the float (+ (-> self path curve num-cverts) -1))) (set! (-> self path-speed) (/ (* 300.0 (-> self path-max)) (the float arg1))) - (none) ) :trans (behavior () (pelican-path-update 546133.3 30 0.0 0.0 #f) @@ -415,7 +402,6 @@ (if (= (-> self path-pos) (-> self path-max)) (go pelican-wait-at-nest #f) ) - (none) ) :code (behavior ((arg0 path-control) (arg1 int)) (pelican-fly @@ -426,60 +412,55 @@ ) ) ) - (none) ) :post pelican-post ) (defstate pelican-wait-at-nest (pelican) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (case (-> event param 1) - (('explode) - (let ((a0-2 (handle->process (-> self fuel-cell)))) - (if a0-2 - (send-event a0-2 'trans (-> self root-override trans)) - ) - ) - (go pelican-explode #f) - #f + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (case (-> block param 1) + (('explode) + (let ((a0-2 (handle->process (-> self fuel-cell)))) + (if a0-2 + (send-event a0-2 'trans (-> self root-override trans)) + ) ) - (else - (let* ((gp-0 proc) - (v1-13 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) - gp-0 - ) - ) - (f30-0 8192.0) - (gp-1 (-> self root-override)) - (s4-0 (-> (the-as process-drawable v1-13) root trans)) - ) - (if (< f30-0 - (fabs - (deg-diff (y-angle gp-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s4-0 (-> gp-1 trans)))) - ) + (go pelican-explode #f) + #f + ) + (else + (let* ((gp-0 proc) + (v1-13 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) + gp-0 + ) + ) + (f30-0 8192.0) + (gp-1 (-> self root-override)) + (s4-0 (-> (the-as process-drawable v1-13) root trans)) + ) + (if (< f30-0 + (fabs + (deg-diff (y-angle gp-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s4-0 (-> gp-1 trans)))) ) - (go pelican-spit) - ) - ) + ) + (go pelican-spit) + ) ) ) ) - (('touch) - (the-as object (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> event param 0)) - 0.7 - 6144.0 - 16384.0 - ) - ) + ) + (('touch) + (send-shove-back + (-> self root-override) + proc + (the-as touching-shapes-entry (-> block param 0)) + 0.7 + 6144.0 + 16384.0 ) - ) + ) ) ) :enter (behavior ((arg0 symbol)) @@ -512,13 +493,11 @@ (if (nonzero? (-> self neck)) (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) ) - (none) ) :exit (behavior () (if (nonzero? (-> self neck)) (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) ) - (none) ) :trans (behavior () (let ((a1-0 (-> self state-vector)) @@ -531,7 +510,6 @@ (do-push-aways! (-> self root-override)) (seek-toward-heading-vec! (-> self root-override) (-> self path-vector) 131072.0 (seconds 1)) (spool-push *art-control* "pelican-spit-ext" 0 self -99.0) - (none) ) :code (behavior ((arg0 symbol)) (cond @@ -571,7 +549,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (behavior () (when *target* @@ -583,7 +560,6 @@ ) ) (pelican-post) - (none) ) ) @@ -675,50 +651,43 @@ (send-event gp-3 'trans s5-3) ) (send-event gp-3 'draw #t) - (send-event - gp-3 - 'event-hook - (lambda :behavior pelican - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (when (or (= arg2 'touch) (= arg2 'attack)) - (let ((v1-7 (birth-pickup-at-point - (-> self root-override trans) - (pickup-type fuel-cell) - (the float (-> self entity extra perm task)) - #f - *entity-pool* - (the-as fact-info #f) + (send-event gp-3 'event-hook (lambda :behavior pelican + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (when (or (= arg2 'touch) (= arg2 'attack)) + (let ((v1-7 (birth-pickup-at-point + (-> self root-override trans) + (pickup-type fuel-cell) + (the float (-> self entity extra perm task)) + #f + *entity-pool* + (the-as fact-info #f) + ) + ) + ) + (when v1-7 + (set! (-> (the-as collectable (-> v1-7 0)) collect-timeout) 0) + 0 + ) ) + (deactivate self) ) - ) - (when v1-7 - (set! (-> (the-as collectable (-> v1-7 0)) collect-timeout) 0) - 0 - ) - ) - (deactivate self) - ) + ) ) - ) - ) ) ) (go pelican-from-nest) - (none) ) :post (behavior () (if (not (ja-group? pelican-sleep-ja)) (quaternion-identity! (-> self root-override quat)) ) (pelican-post) - (none) ) ) (defstate pelican-from-nest (pelican) :enter (behavior () (set! (-> self path-pos) 1.5) - (none) ) :trans (behavior () (pelican-path-update 131072.0 150 0.0 0.0 #f) @@ -726,14 +695,12 @@ (if (= (-> self path-pos) (-> self path-max)) (go pelican-dive (-> self path-dive1) (-> self path-to-nest1) (-> *PELICAN-bank* to-nest1-time)) ) - (none) ) :code (behavior () (pelican-fly (the-as (function pelican int) (lambda () (rand-vu-int-range 2 4))) (the-as (function pelican int) zero-func) ) - (none) ) :post pelican-post ) @@ -756,7 +723,6 @@ (eval-path-curve-div! (-> self path) gp-1 0.0 'interp) (set! (-> self state-float 1) (* 0.0073242188 (vector-vector-distance (-> self root-override trans) gp-1))) ) - (none) ) :trans (behavior () (pelican-path-update 546133.3 30 0.0 0.0 #f) @@ -775,7 +741,6 @@ (-> self state-float 0) ) ) - (none) ) :code (behavior ((arg0 path-control) (arg1 time-frame)) (pelican-fly @@ -786,7 +751,6 @@ ) ) ) - (none) ) :post pelican-post ) @@ -794,7 +758,6 @@ (defstate pelican-wait-at-end (pelican) :code (behavior ((arg0 symbol)) (cleanup-for-death self) - (none) ) ) @@ -845,7 +808,6 @@ (clear-collide-with-as (-> self root-override)) (ja-channel-set! 0) (anim-loop) - (none) ) :post (the-as (function none :behavior pelican) ja-post) ) diff --git a/goal_src/jak1/levels/beach/sculptor.gc b/goal_src/jak1/levels/beach/sculptor.gc index 0d5a9da678a..46833af6310 100644 --- a/goal_src/jak1/levels/beach/sculptor.gc +++ b/goal_src/jak1/levels/beach/sculptor.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (deftype sculptor (process-taskable) ((muse handle :offset-assert 384) ) @@ -90,7 +89,6 @@ :virtual #t :enter (behavior () (muse-to-idle (the-as muse self)) - (none) ) ) @@ -342,7 +340,6 @@ ) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/beach/seagull.gc b/goal_src/jak1/levels/beach/seagull.gc index 2c3f09bcc2d..9356e89bd1c 100644 --- a/goal_src/jak1/levels/beach/seagull.gc +++ b/goal_src/jak1/levels/beach/seagull.gc @@ -12,7 +12,6 @@ ;; DECOMP BEGINS - (defpartgroup group-seagull-takeoff :id 160 :bounds (static-bspherem 0 -12 0 14) @@ -345,7 +344,6 @@ (the float (sar (shl (the int (+ f30-0 (* f28-0 (+ f26-0 (rand-float-gen))))) 48) 48)) ) ) - (none) ) :trans (behavior () (when (nonzero? (-> self scared)) @@ -369,7 +367,6 @@ ) ) ) - (none) ) :code (behavior () (+! (-> self root-override trans y) 20480.0) @@ -452,7 +449,6 @@ ) ) ) - (none) ) :post seagull-post ) @@ -568,7 +564,6 @@ (-> self part) (-> self root-override root-prim prim-core) ) - (none) ) :code (behavior () (set! (-> self part-time) (-> *display* base-frame-counter)) @@ -611,7 +606,6 @@ (ja-no-eval :num! (seek!)) (ja-channel-push! 1 (seconds 0.067)) (go seagull-flying) - (none) ) :post seagull-post ) @@ -622,7 +616,6 @@ (-> self part) (-> self root-override root-prim prim-core) ) - (none) ) :code (behavior () (set! (-> self max-tilt) 1820.4445) @@ -803,7 +796,6 @@ ) ) ) - (none) ) :post seagull-post ) @@ -814,7 +806,6 @@ (-> self part) (-> self root-override root-prim prim-core) ) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -964,7 +955,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post seagull-post ) @@ -1117,7 +1107,6 @@ 0 ) (go seagull-idle) - (none) ) :post seagull-post ) @@ -1303,7 +1292,6 @@ ) ) (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) @@ -1318,7 +1306,6 @@ ) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/citadel/assistant-citadel.gc b/goal_src/jak1/levels/citadel/assistant-citadel.gc index 7e1c65000e0..643dfc6d574 100644 --- a/goal_src/jak1/levels/citadel/assistant-citadel.gc +++ b/goal_src/jak1/levels/citadel/assistant-citadel.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype assistant-lavatube-end (process-taskable) () :heap-base #x110 @@ -79,7 +78,6 @@ (not (closed? (-> self tasks) (game-task village4-button) (task-status need-reward-speech))) ) ) - (none) ) ) @@ -92,7 +90,6 @@ (send-event self 'play-anim) ) ) - (none) ) :code (behavior () (loop @@ -106,7 +103,6 @@ (ja :num! (seek!)) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/citadel/citadel-obs.gc b/goal_src/jak1/levels/citadel/citadel-obs.gc index 71bee347f07..283ed81c75a 100644 --- a/goal_src/jak1/levels/citadel/citadel-obs.gc +++ b/goal_src/jak1/levels/citadel/citadel-obs.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype citb-arm-section (process-drawable) ((sync sync-info :inline :offset-assert 176) (cull-dir-local vector :inline :offset-assert 192) @@ -94,7 +93,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior citb-arm-section) ja-post) ) @@ -153,7 +151,6 @@ (restore-collide-with-as (-> self root-override)) ) (rider-post) - (none) ) ) @@ -353,14 +350,13 @@ (defstate citb-disc-idle (citb-disc) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (send-event proc 'no-look-around (seconds 0.25)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (send-event proc 'no-look-around (seconds 0.25)) + #f + ) + ) ) :trans (the-as (function none :behavior citb-disc) rider-trans) :code (behavior () @@ -375,7 +371,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior citb-disc) rider-post) ) @@ -630,7 +625,6 @@ ) ) (send-event (ppointer->process (-> self launcher)) 'trans (-> self basetrans)) - (none) ) ) @@ -724,12 +718,12 @@ (defstate citb-robotboss-idle (citb-robotboss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (sv-96 int) (sv-112 int)) (the-as - object + symbol (cond - ((= event-type 'shield-off) + ((= message 'shield-off) (stop! (-> self sound)) (if (-> self shield-on) (sound-play "robotcage-off") @@ -737,17 +731,17 @@ (set! (-> self shield-on) #f) #f ) - ((= event-type 'shield-on) + ((= message 'shield-on) (let ((v0-3 #t)) (set! (-> self shield-on) v0-3) v0-3 ) ) - ((= event-type 'die) + ((= message 'die) (cleanup-for-death self) (the-as symbol (deactivate self)) ) - ((or (= event-type 'touch) (= event-type 'attack)) + ((or (= message 'touch) (= message 'attack)) (let ((s4-0 sound-play-by-name) (s3-0 (make-u128 #x7061 (the-as uint #x7a2d646c65696873))) (s2-0 (new-sound-id)) @@ -763,7 +757,7 @@ (the-as symbol (send-event proc 'shove - (-> event param 0) + (-> block param 0) (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) ) ) @@ -828,7 +822,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior citb-robotboss) ja-post) ) @@ -837,7 +830,6 @@ :code (behavior () (cleanup-for-death self) (deactivate self) - (none) ) ) @@ -907,8 +899,8 @@ ) (defstate citb-coil-idle (citb-coil) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go citb-coil-break) ) @@ -922,12 +914,10 @@ (ja :num! (seek!)) ) ) - (none) ) :post (behavior () (spawn (-> self part) (-> self root trans)) (ja-post) - (none) ) ) @@ -941,7 +931,6 @@ (ja :num! (seek!)) ) (go citb-coil-broken) - (none) ) :post (the-as (function none :behavior citb-coil) ja-post) ) @@ -957,7 +946,6 @@ (spawn (-> self part-off) (-> self root trans)) (suspend) ) - (none) ) :post (the-as (function none :behavior citb-coil) ja-post) ) @@ -1020,7 +1008,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior citb-hose) ja-post) ) @@ -1035,7 +1022,6 @@ (ja :num! (seek!)) ) (go citb-hose-idle) - (none) ) :post (the-as (function none :behavior citb-hose) ja-post) ) @@ -1051,7 +1037,6 @@ (ja :num! (seek!)) ) (anim-loop) - (none) ) :post (the-as (function none :behavior citb-hose) ja-post) ) @@ -1214,8 +1199,8 @@ ) (defstate citb-generator-idle (citb-generator) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (if (-> self mushroom) (increment-success-for-hint (text-id citadel-generator)) @@ -1230,7 +1215,6 @@ ) :exit (behavior () (stop! (-> self sound)) - (none) ) :code (behavior () (lods-assign! (-> self draw) (-> self normal-look)) @@ -1258,7 +1242,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior citb-generator) ja-post) ) @@ -1314,7 +1297,6 @@ ; (set-continue! *game-info* "citadel-elevator") ; ) (go citb-generator-broken) - (none) ) :post (the-as (function none :behavior citb-generator) ja-post) ) @@ -1338,12 +1320,10 @@ ) ) (anim-loop) - (none) ) :post (behavior () (spawn (-> self part-broken) (-> self root-override trans)) (ja-post) - (none) ) ) @@ -1445,8 +1425,8 @@ (defstate citadelcam-idle (citadelcam) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (when (and (task-complete? *game-info* (game-task citadel-sage-blue)) (task-complete? *game-info* (game-task citadel-sage-red)) @@ -1461,7 +1441,6 @@ :code (behavior () (logior! (-> self mask) (process-mask actor-pause)) (anim-loop) - (none) ) ) @@ -1510,7 +1489,6 @@ ) (level-hint-spawn (text-id citadel-plat) "sksp0387" (the-as entity #f) *entity-pool* (game-task none)) (go citadelcam-idle) - (none) ) ) @@ -1556,7 +1534,6 @@ ) ) (go-virtual battlecontroller-active) - (none) ) ) @@ -1569,7 +1546,6 @@ ((the-as (function none :behavior battlecontroller) t9-2)) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/citadel/citadel-sages.gc b/goal_src/jak1/levels/citadel/citadel-sages.gc index 3fbaad6c86f..363315b0511 100644 --- a/goal_src/jak1/levels/citadel/citadel-sages.gc +++ b/goal_src/jak1/levels/citadel/citadel-sages.gc @@ -83,34 +83,33 @@ ) (defstate citb-sagecage-idle (citb-sagecage) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (local-vars (v0-3 basic)) - (the-as object (case event-type - (('disable-bars) - (stop! (-> self sound)) - (sound-play "sagecage-off") - (set! (-> self bars-on) #f) - (the-as basic (citb-sagecage-update-collision)) - ) - (('enable-bars) - (set! (-> self bars-on) #t) - (the-as basic (citb-sagecage-update-collision)) - ) - (('start-cloning) - (set! v0-3 #t) - (set! (-> self cloning) (the-as symbol v0-3)) - v0-3 - ) - (('stop-cloning) - (set! (-> self cloning) #f) - (let ((v1-7 (-> self skel root-channel 0))) - (set! v0-3 (-> self draw art-group data 3)) - (set! (-> v1-7 frame-group) (the-as art-joint-anim v0-3)) - ) - v0-3 - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-3 object)) + (case message + (('disable-bars) + (stop! (-> self sound)) + (sound-play "sagecage-off") + (set! (-> self bars-on) #f) + (citb-sagecage-update-collision) + ) + (('enable-bars) + (set! (-> self bars-on) #t) + (citb-sagecage-update-collision) + ) + (('start-cloning) + (set! v0-3 #t) + (set! (-> self cloning) (the-as symbol v0-3)) + v0-3 + ) + (('stop-cloning) + (set! (-> self cloning) #f) + (let ((v1-7 (-> self skel root-channel 0))) + (set! v0-3 (-> self draw art-group data 3)) + (set! (-> v1-7 frame-group) (the-as art-joint-anim v0-3)) + ) + v0-3 + ) + ) ) :trans (the-as (function none :behavior citb-sagecage) rider-trans) :code (behavior () @@ -137,7 +136,6 @@ ) (suspend) ) - (none) ) :post (behavior () (rider-post) @@ -145,7 +143,6 @@ (update! (-> self sound)) (citb-sagecage-draw-bars) ) - (none) ) ) @@ -368,7 +365,6 @@ (send-event (handle->process (-> self cage)) 'disable-bars) (send-event (handle->process (-> self cage)) 'stop-cloning) ((-> (method-of-type process-taskable hidden) enter)) - (none) ) ) @@ -395,13 +391,13 @@ (defstate play-anim (citb-sage) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('disable-bars) (send-event (handle->process (-> self cage)) 'disable-bars) ) (else - ((-> (method-of-type process-taskable play-anim) event) proc arg1 event-type event) + ((-> (method-of-type process-taskable play-anim) event) proc argc message block) ) ) ) @@ -409,13 +405,13 @@ (defstate idle (citb-sage) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('open) (send-event (handle->process (-> self cage)) 'disable-bars) ) (else - ((-> (method-of-type process-taskable idle) event) proc arg1 event-type event) + ((-> (method-of-type process-taskable idle) event) proc argc message block) ) ) ) @@ -431,14 +427,12 @@ ) ) ((-> (method-of-type process-taskable idle) trans)) - (none) ) :post (behavior () ((the-as (function none :behavior citb-sage) (-> (method-of-type process-taskable idle) post))) (if (-> self beam-on) (citb-sage-draw-beam) ) - (none) ) ) @@ -989,8 +983,8 @@ (defstate play-anim (green-sagecage) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('spawn-robot) (let ((gp-0 (entity-by-name "robotboss-3"))) (format 0 "robotboss ent ~A~%" gp-0) @@ -1011,7 +1005,7 @@ ) ) (else - ((-> (method-of-type citb-sage play-anim) event) proc arg1 event-type event) + ((-> (method-of-type citb-sage play-anim) event) proc argc message block) ) ) ) @@ -1074,7 +1068,6 @@ ) (set! (-> self draw bounds w) 10240.0) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) :trans (behavior () (case (-> self which-movie) @@ -1103,7 +1096,6 @@ ) ) ((-> (method-of-type process-taskable play-anim) trans)) - (none) ) ) @@ -1125,7 +1117,6 @@ ) ) ((-> (method-of-type citb-sage idle) trans)) - (none) ) ) diff --git a/goal_src/jak1/levels/citadel/citb-drop-plat.gc b/goal_src/jak1/levels/citadel/citb-drop-plat.gc index 509b7eaa3be..84affc29491 100644 --- a/goal_src/jak1/levels/citadel/citb-drop-plat.gc +++ b/goal_src/jak1/levels/citadel/citb-drop-plat.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defskelgroup *citb-drop-plat-sg* citb-drop-plat citb-drop-plat-lod0-jg citb-drop-plat-idle-ja ((citb-drop-plat-lod0-mg (meters 20)) (citb-drop-plat-lod1-mg (meters 999999))) :bounds (static-spherem 0 0 0 3) @@ -62,8 +61,8 @@ (defstate drop-plat-idle (drop-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('drop) (logclear! (-> self mask) (process-mask actor-pause)) (go drop-plat-drop) @@ -86,7 +85,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior drop-plat) ja-post) ) @@ -107,8 +105,8 @@ ) (defstate drop-plat-spawn (drop-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('drop) (go drop-plat-die) ) @@ -132,13 +130,12 @@ ) (suspend) ) - (none) ) ) (defstate drop-plat-rise (drop-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('drop) (go drop-plat-drop) ) @@ -177,7 +174,6 @@ (suspend) ) ) - (none) ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'quaternion))) @@ -186,7 +182,6 @@ ) (drop-plat-set-fade) (transform-post) - (none) ) ) @@ -219,7 +214,6 @@ (+! (-> self spin-angle) (* (-> self spin-speed) (-> *display* seconds-per-frame))) (suspend) ) - (none) ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'quaternion))) @@ -228,14 +222,12 @@ ) (drop-plat-set-fade) (transform-post) - (none) ) ) (defstate drop-plat-die (drop-plat) :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -458,8 +450,8 @@ ) (defstate citb-drop-plat-idle (citb-drop-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go citb-drop-plat-active) ) @@ -470,24 +462,22 @@ (loop (suspend) ) - (none) ) ) (defstate citb-drop-plat-active (citb-drop-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('player-stepped) - (when (>= (- (-> *display* base-frame-counter) (-> self drop-time)) (seconds 0.2)) - (set! (-> self drop-time) (-> *display* base-frame-counter)) - (the-as object (citb-drop-plat-drop-children (the-as int (-> event param 0)))) - ) - ) - (('trigger) - (go citb-drop-plat-idle) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('player-stepped) + (when (>= (- (-> *display* base-frame-counter) (-> self drop-time)) (seconds 0.2)) + (set! (-> self drop-time) (-> *display* base-frame-counter)) + (citb-drop-plat-drop-children (the-as int (-> block param 0))) + ) + ) + (('trigger) + (go citb-drop-plat-idle) + ) + ) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -503,7 +493,6 @@ ) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/citadel/citb-plat.gc b/goal_src/jak1/levels/citadel/citb-plat.gc index ffd067ca1a4..86d9455c1b6 100644 --- a/goal_src/jak1/levels/citadel/citb-plat.gc +++ b/goal_src/jak1/levels/citadel/citb-plat.gc @@ -60,7 +60,6 @@ ) (go-virtual citb-base-plat-active) ) - (none) ) :code (the-as (function none :behavior citb-base-plat) anim-loop) :post (the-as (function none :behavior citb-base-plat) ja-post) @@ -76,7 +75,6 @@ (go-virtual citb-base-plat-idle) ) (rider-trans) - (none) ) :code (the-as (function none :behavior citb-base-plat) anim-loop) :post (the-as (function none :behavior citb-base-plat) rider-post) @@ -201,7 +199,6 @@ (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) - (none) ) ) @@ -275,17 +272,16 @@ (defstate citb-base-plat-idle (citb-stair-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('trigger) - (logclear! (-> self mask) (process-mask actor-pause)) - (let ((v0-0 #t)) - (set! (-> self rise) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((v0-0 #t)) + (set! (-> self rise) v0-0) + v0-0 + ) + ) + ) ) :trans (the-as (function none :behavior citb-stair-plat) #f) :code (behavior () @@ -317,7 +313,6 @@ (transform-post) (suspend) ) - (none) ) :post (the-as (function none :behavior citb-stair-plat) #f) ) @@ -331,7 +326,6 @@ (update-transforms! (-> self root-override)) (logior! (-> self mask) (process-mask actor-pause)) (anim-loop) - (none) ) :post (the-as (function none :behavior citb-stair-plat) ja-post) ) @@ -460,11 +454,9 @@ (go-virtual rigid-body-platform-float) ) ) - (none) ) :code (behavior () (anim-loop) - (none) ) :post (the-as (function none :behavior citb-chain-plat) ja-post) ) @@ -477,11 +469,9 @@ ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (behavior () (stop! (-> self sound)) - (none) ) :trans (behavior () (cond @@ -509,11 +499,9 @@ ) ) ) - (none) ) :code (behavior () (anim-loop) - (none) ) :post (the-as (function none :behavior citb-chain-plat) rigid-body-platform-post) ) @@ -546,7 +534,6 @@ ) (suspend) (go-virtual rigid-body-platform-idle) - (none) ) :post (the-as (function none :behavior citb-chain-plat) rider-post) ) @@ -636,7 +623,6 @@ (go-virtual citb-base-plat-idle) ) ) - (none) ) ) @@ -698,7 +684,6 @@ (* 65536.0 (get-current-phase (-> self sync))) ) (rider-post) - (none) ) ) @@ -761,7 +746,6 @@ (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) - (none) ) ) @@ -833,13 +817,11 @@ ) (go citb-firehose-active) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior citb-firehose) ja-post) ) @@ -860,13 +842,11 @@ (go citb-firehose-blast) ) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior citb-firehose) ja-post) ) @@ -885,13 +865,13 @@ ) (defstate citb-firehose-blast (citb-firehose) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (send-event proc 'attack - (-> event param 0) + (-> block param 0) (static-attack-info ((mode 'damage) (shove-back (meters 6)) (shove-up (meters 3)))) ) ) @@ -923,7 +903,6 @@ (ja :num! (seek!)) ) (go citb-firehose-active) - (none) ) :post (the-as (function none :behavior citb-firehose) transform-post) ) @@ -994,8 +973,8 @@ (defstate citb-exit-plat-idle (citb-exit-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (let ((v1-3 (-> self entity extra perm))) (logior! (-> v1-3 status) (entity-perm-status user-set-from-cstage)) @@ -1011,7 +990,6 @@ (loop (suspend) ) - (none) ) ) @@ -1031,7 +1009,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior citb-exit-plat) rider-post) ) @@ -1068,7 +1045,6 @@ ) (citb-exit-plat-move-player gp-0) ) - (none) ) :post (the-as (function none :behavior citb-exit-plat) transform-post) ) @@ -1085,7 +1061,6 @@ ) (citb-exit-plat-move-player gp-0) ) - (none) ) :post (the-as (function none :behavior citb-exit-plat) transform-post) ) diff --git a/goal_src/jak1/levels/common/battlecontroller.gc b/goal_src/jak1/levels/common/battlecontroller.gc index a9ea5180d64..2047dbce551 100644 --- a/goal_src/jak1/levels/common/battlecontroller.gc +++ b/goal_src/jak1/levels/common/battlecontroller.gc @@ -132,7 +132,7 @@ battlecontroller-default-event-handler ) ) ) - (the-as object 0) + 0 ) (defbehavior battlecontroller-camera-off battlecontroller () @@ -384,7 +384,6 @@ battlecontroller-default-event-handler :event battlecontroller-default-event-handler :trans (behavior () 0 - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -409,7 +408,6 @@ battlecontroller-default-event-handler ) (suspend) ) - (none) ) :post (the-as (function none :behavior battlecontroller) #f) ) @@ -419,15 +417,12 @@ battlecontroller-default-event-handler :event battlecontroller-default-event-handler :enter (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) - (none) ) :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :code (behavior () (go-virtual battlecontroller-active) - (none) ) ) @@ -450,7 +445,6 @@ battlecontroller-default-event-handler ) (battlecontroller-disable-ocean) (battlecontroller-update-spawners) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -482,7 +476,6 @@ battlecontroller-default-event-handler ) (suspend) ) - (none) ) :post (the-as (function none :behavior battlecontroller) #f) ) @@ -585,7 +578,6 @@ battlecontroller-default-event-handler (suspend) ) (process-entity-status! self (entity-perm-status dead) #t) - (none) ) :post (the-as (function none :behavior battlecontroller) #f) ) diff --git a/goal_src/jak1/levels/common/blocking-plane.gc b/goal_src/jak1/levels/common/blocking-plane.gc index 1123e5d073c..85dd5858687 100644 --- a/goal_src/jak1/levels/common/blocking-plane.gc +++ b/goal_src/jak1/levels/common/blocking-plane.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype blocking-plane (process-drawable) () :heap-base #x40 @@ -32,7 +31,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/common/launcherdoor.gc b/goal_src/jak1/levels/common/launcherdoor.gc index e2ee54b30cd..f6006f0317e 100644 --- a/goal_src/jak1/levels/common/launcherdoor.gc +++ b/goal_src/jak1/levels/common/launcherdoor.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (deftype launcherdoor (process-drawable) ((root-override collide-shape :offset 112) (notify-player-passed-thru? symbol :offset-assert 176) @@ -95,7 +94,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior launcherdoor) ja-post) ) @@ -131,7 +129,6 @@ (ja :num! (seek! max (-> self open-speed))) (suspend) ) - (none) ) :post (the-as (function none :behavior launcherdoor) ja-post) ) @@ -209,7 +206,3 @@ ) (none) ) - - - - diff --git a/goal_src/jak1/levels/darkcave/darkcave-obs.gc b/goal_src/jak1/levels/darkcave/darkcave-obs.gc index 1fc6fa8cba8..31f6fcf3a0f 100644 --- a/goal_src/jak1/levels/darkcave/darkcave-obs.gc +++ b/goal_src/jak1/levels/darkcave/darkcave-obs.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype cavecrystal (process-drawable) ((root-override collide-shape :offset 112) (is-master? symbol :offset-assert 176) @@ -92,8 +91,8 @@ ) (defstate cavecrystal-idle (cavecrystal) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (go cavecrystal-active) ) @@ -101,57 +100,46 @@ ) :trans (behavior () (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (level-hint-spawn - (text-id darkcave-light-hint) - "sksp0333" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + (level-hint-spawn (text-id darkcave-light-hint) "sksp0333" (the-as entity #f) *entity-pool* (game-task none)) ) (update-connected-crystals! self) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) (defstate cavecrystal-active (cavecrystal) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('attack) - (let ((v1-1 (-> event param 2))) - (cond - ((!= v1-1 (-> self player-attack-id)) - (set! (-> self player-attack-id) v1-1) - (set! (-> self activated-time) (-> *display* game-frame-counter)) - #t - ) - (else - #f - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((v1-1 (-> block param 2))) + (cond + ((!= v1-1 (-> self player-attack-id)) + (set! (-> self player-attack-id) v1-1) + (set! (-> self activated-time) (-> *display* game-frame-counter)) + #t ) + (else + #f + ) + ) + ) + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self activated-time) (-> *display* game-frame-counter)) (set! (-> self prev-compute-glow-time) (-> *display* game-frame-counter)) - (none) ) :exit (behavior () (stop! (-> self sound)) (if (not (-> self is-master?)) (logior! (-> self mask) (process-mask actor-pause)) ) - (none) ) :trans (behavior () (let ((f30-0 (compute-glow self))) @@ -179,24 +167,16 @@ (cavecrystal-light-control-method-9 *cavecrystal-light-control* (-> self crystal-id) (-> self glow-u) self) (update-connected-crystals! self) (when (>= 0.0 f30-0) - (level-hint-spawn - (text-id darkcave-light-end) - "sksp0332" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + (level-hint-spawn (text-id darkcave-light-end) "sksp0332" (the-as entity #f) *entity-pool* (game-task none)) (go cavecrystal-idle) ) ) (update! (-> self sound)) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) diff --git a/goal_src/jak1/levels/demo/demo-obs.gc b/goal_src/jak1/levels/demo/demo-obs.gc index 3aa1e1faeae..e6be9d044cd 100644 --- a/goal_src/jak1/levels/demo/demo-obs.gc +++ b/goal_src/jak1/levels/demo/demo-obs.gc @@ -334,11 +334,6 @@ (loop (suspend) ) - (none) ) :post target-no-move-post ) - - - - diff --git a/goal_src/jak1/levels/demo/static-screen.gc b/goal_src/jak1/levels/demo/static-screen.gc index b56f9b3b751..4fc6ee72ba0 100644 --- a/goal_src/jak1/levels/demo/static-screen.gc +++ b/goal_src/jak1/levels/demo/static-screen.gc @@ -106,13 +106,11 @@ (set! (-> *setting-control* current bg-a) 1.0) (set! (-> *setting-control* default bg-a) 0.0) (add-setting! 'common-page 'set 0.0 (ash 1 (+ arg0 1))) - (none) ) :trans (behavior () (hide-hud-quick) (spawn (-> self part 0) *zero-vector*) 0 - (none) ) :code (behavior ((arg0 int) (arg1 time-frame) (arg2 symbol)) (local-vars (v1-6 symbol)) @@ -134,7 +132,6 @@ (remove-setting! 'common-page) (suspend) 0 - (none) ) ) diff --git a/goal_src/jak1/levels/finalboss/final-door.gc b/goal_src/jak1/levels/finalboss/final-door.gc index 256fb1c881c..41c0ee42fde 100644 --- a/goal_src/jak1/levels/finalboss/final-door.gc +++ b/goal_src/jak1/levels/finalboss/final-door.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (deftype fin-door (process-hidden) () :method-count-assert 15 @@ -49,8 +48,8 @@ (defstate idle (final-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('open) (go-virtual open #f) ) @@ -61,30 +60,28 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) (defstate open (final-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('brightness) - (let ((f0-0 (the-as float (-> event param 0))) - (f1-0 (the-as float (-> event param 1))) - ) - (set-vector! (-> self draw color-mult) f0-0 f0-0 f0-0 f0-0) - (let ((v0-0 (-> self draw color-emissive))) - (set! (-> v0-0 x) f1-0) - (set! (-> v0-0 y) f1-0) - (set! (-> v0-0 z) f1-0) - (set! (-> v0-0 w) f1-0) - v0-0 - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('brightness) + (let ((f0-0 (the-as float (-> block param 0))) + (f1-0 (the-as float (-> block param 1))) + ) + (set-vector! (-> self draw color-mult) f0-0 f0-0 f0-0 f0-0) + (let ((v0-0 (-> self draw color-emissive))) + (set! (-> v0-0 x) f1-0) + (set! (-> v0-0 y) f1-0) + (set! (-> v0-0 z) f1-0) + (set! (-> v0-0 w) f1-0) + v0-0 + ) + ) + ) + ) ) :code (behavior ((arg0 symbol)) (case (-> self type) @@ -109,7 +106,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -181,7 +177,6 @@ ) (suspend) ) - (none) ) ) @@ -251,7 +246,6 @@ :to *entity-pool* ) (go-virtual idle) - (none) ) ) @@ -266,7 +260,6 @@ (transform-post) (suspend) ) - (none) ) ) @@ -302,26 +295,23 @@ ) (defstate target-final-door (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - ((-> target-grab event) proc arg1 event-type event) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + ((-> target-grab event) proc argc message block) ) :enter (behavior ((arg0 basic) (arg1 handle)) (send-event *camera* 'change-to-entity-by-name "camera-403") (set! (-> self control unknown-surface00) *empty-mods*) (logior! (-> self state-flags) (state-flags invulnerable grabbed)) (set-setting! 'allow-progress #f 0.0 0) - (none) ) :exit (behavior () (send-event *camera* 'change-state *camera-base-mode* (seconds 0.2)) (logclear! (-> self state-flags) (state-flags invulnerable grabbed)) (target-exit) (remove-setting! 'allow-progress) - (none) ) :trans (behavior () (set-letterbox-frames (seconds 0.017)) - (none) ) :code (behavior ((arg0 basic) (arg1 handle)) (local-vars (sv-144 process) (sv-160 vector) (sv-176 process) (sv-192 vector)) @@ -409,7 +399,6 @@ ) ) (go target-stance) - (none) ) :post target-no-stick-post ) diff --git a/goal_src/jak1/levels/finalboss/green-eco-lurker.gc b/goal_src/jak1/levels/finalboss/green-eco-lurker.gc index e20b64650aa..183fae87397 100644 --- a/goal_src/jak1/levels/finalboss/green-eco-lurker.gc +++ b/goal_src/jak1/levels/finalboss/green-eco-lurker.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype green-eco-lurker (nav-enemy) ((played-sound? symbol :offset-assert 400) (sound-delay int32 :offset-assert 404) @@ -388,11 +387,9 @@ (defstate green-eco-lurker-tune-spheres (green-eco-lurker) :trans (behavior () 0 - (none) ) :code (behavior () 0 - (none) ) :post (the-as (function none :behavior green-eco-lurker) transform-post) ) @@ -401,25 +398,21 @@ :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self collide-info)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self collide-info)) - (none) ) :trans (behavior () (if (nav-enemy-method-52 self (-> self appear-dest)) (go green-eco-lurker-appear) ) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -489,7 +482,6 @@ (vector-normalize! gp-1 1.0) (forward-up->quaternion (-> self collide-info quat) gp-1 *up-vector*) ) - (none) ) :trans (behavior () (let ((f30-0 (fmin (the float (- (-> *display* base-frame-counter) (-> self state-time))) (-> self traj time)))) @@ -508,7 +500,6 @@ ) (nav-enemy-method-53 self) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -533,7 +524,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior green-eco-lurker) transform-post) ) @@ -568,7 +558,6 @@ ) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-chase) - (none) ) :post (the-as (function none :behavior green-eco-lurker) transform-post) ) @@ -582,7 +571,6 @@ ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -615,7 +603,6 @@ (ja :num! (loop! f30-0)) ) ) - (none) ) ) @@ -634,7 +621,6 @@ (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) ) (go-virtual nav-enemy-chase) - (none) ) ) @@ -664,7 +650,6 @@ (t9-7) ) ) - (none) ) ) @@ -774,8 +759,8 @@ ) (defstate spawn-minions (green-eco-lurker-gen) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('blob-died) (set! (-> self num-alive) (max 0 (+ (-> self num-alive) -1))) (send-event (ppointer->process (-> self parent)) 'blob-died) @@ -813,7 +798,6 @@ ) (suspend) 0 - (none) ) ) diff --git a/goal_src/jak1/levels/finalboss/light-eco.gc b/goal_src/jak1/levels/finalboss/light-eco.gc index 59c36261bf6..13fe04148f5 100644 --- a/goal_src/jak1/levels/finalboss/light-eco.gc +++ b/goal_src/jak1/levels/finalboss/light-eco.gc @@ -186,8 +186,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0) - (launch-particles (-> *part-id-table* 2904) gp-0 :rate 1.0) - (launch-particles (-> *part-id-table* 2905) gp-0 :rate 1.0) + (launch-particles (-> *part-id-table* 2904) gp-0) + (launch-particles (-> *part-id-table* 2905) gp-0) ) ) (none) @@ -305,8 +305,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0) - (launch-particles (-> *part-id-table* 2910) gp-0 :rate 1.0) - (launch-particles (-> *part-id-table* 2911) gp-0 :rate 1.0) + (launch-particles (-> *part-id-table* 2910) gp-0) + (launch-particles (-> *part-id-table* 2911) gp-0) ) ) (none) @@ -382,7 +382,6 @@ :event light-eco-child-default-event-handler :enter (behavior () (set! (-> self falling-start-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (let ((f30-0 @@ -395,14 +394,12 @@ ) ) (common-trans self) - (none) ) :code (behavior () (loop (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior light-eco-child) transform-post) ) @@ -411,7 +408,6 @@ :event light-eco-child-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (let ((f30-0 (+ (-> self root-override transv y) (* -544768.0 (-> *display* seconds-per-frame))))) @@ -444,14 +440,12 @@ ) ) (common-trans self) - (none) ) :code (behavior () (loop (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior light-eco-child) transform-post) ) @@ -460,21 +454,18 @@ :event light-eco-child-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) (go light-eco-child-die) ) (common-trans self) - (none) ) :code (behavior () (loop (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior light-eco-child) transform-post) ) @@ -488,7 +479,6 @@ (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (suspend) ) - (none) ) ) @@ -496,7 +486,6 @@ :code (behavior () (suspend) 0 - (none) ) ) @@ -649,7 +638,6 @@ :trans (behavior () (common-trans self) (spawn (-> self part2) (-> self root trans)) - (none) ) :code (behavior () (while (!= (-> self root scale x) 12.0) @@ -660,7 +648,6 @@ (ja :num! (loop!)) ) (go light-eco-mother-active) - (none) ) :post (the-as (function none :behavior light-eco-mother) ja-post) ) @@ -671,14 +658,12 @@ (common-trans self) (spawn (-> self part) (-> self root trans)) 0 - (none) ) :code (behavior () (loop (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior light-eco-mother) ja-post) ) @@ -687,7 +672,6 @@ :event light-eco-mother-default-event-handler :trans (behavior () (common-trans self) - (none) ) :code (behavior () (while (!= (-> self root scale x) 0.0) @@ -701,7 +685,6 @@ (until (not (-> self child)) (suspend) ) - (none) ) :post (the-as (function none :behavior light-eco-mother) ja-post) ) diff --git a/goal_src/jak1/levels/finalboss/robotboss-misc.gc b/goal_src/jak1/levels/finalboss/robotboss-misc.gc index f8edab70bd4..8e3d83f9ccc 100644 --- a/goal_src/jak1/levels/finalboss/robotboss-misc.gc +++ b/goal_src/jak1/levels/finalboss/robotboss-misc.gc @@ -11,7 +11,6 @@ ;; DECOMP BEGINS - (defskelgroup *med-res-snow1-sg* medres-snowback 0 2 ((1 (meters 999999))) :bounds (static-spherem -360 100 100 380) @@ -19,11 +18,11 @@ ) (defstate cam-robotboss (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('set-pivot) (let ((v0-0 (the-as object (-> self pivot-pt)))) - (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> event param 0)) quad)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> block param 0)) quad)) v0-0 ) ) @@ -31,7 +30,7 @@ #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -47,14 +46,12 @@ (set! (-> self blend-to-type) (the-as uint 2)) ) ) - (none) ) :trans (behavior () (when (not (logtest? (-> *camera* master-options) 2)) (set! *camera-base-mode* cam-string) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -85,7 +82,6 @@ ) (suspend) ) - (none) ) ) @@ -157,61 +153,56 @@ ) ;; ERROR: Failed load: (set! a0-3 (l.wu (+ gp-1 -4))) at op 13 -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 28] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 79] (defbehavior ecoclaw-handler ecoclaw ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (case arg2 - (('open) - (let ((gp-1 (-> arg3 param 0))) - (set! (-> self particles 0 kind) - (the-as basic (if (and (nonzero? gp-1) (type-type? (rtype-of gp-1) sparticle-launch-group)) - gp-1 - ) - ) - ) - ) - (set! (-> self particles 0 trans quad) (-> self root trans quad)) - (set! (-> self particles 0 trans y) (+ 12288.0 (-> self particles 0 trans y))) - ) - (('beam-on) - (let ((s5-0 (-> arg3 param 0))) - (set! (-> self particles 1 kind) - (the-as basic (if (and (nonzero? s5-0) (type-type? (rtype-of s5-0) sparticle-launch-group)) - s5-0 - ) - ) - ) - ) - (set! (-> self particles 1 trans quad) (-> self root trans quad)) - (+! (-> self particles 1 trans y) 24576.0) - (let ((s5-1 (-> arg3 param 1))) - (set! (-> self particles 2 kind) - (the-as basic (if (and (nonzero? s5-1) (type-type? (rtype-of s5-1) sparticle-launch-group)) - s5-1 - ) - ) - ) - ) - (set! (-> self particles 2 trans quad) (-> (the-as vector (-> arg3 param 2)) quad)) - (set! (-> self particles 2 trans y) (+ 81920.0 (-> self particles 2 trans y))) + (case arg2 + (('open) + (let ((gp-1 (-> arg3 param 0))) + (set! (-> self particles 0 kind) + (the-as basic (if (and (nonzero? gp-1) (type-type? (rtype-of gp-1) sparticle-launch-group)) + gp-1 + ) + ) + ) ) - (('beam-off) - (set! (-> self particles 1 kind) #f) - (set! (-> self particles 2 kind) #f) - (let ((a0-10 (handle->process (-> self particles 1 tracker)))) - (if a0-10 - (deactivate a0-10) + (set! (-> self particles 0 trans quad) (-> self root trans quad)) + (set! (-> self particles 0 trans y) (+ 12288.0 (-> self particles 0 trans y))) + ) + (('beam-on) + (let ((s5-0 (-> arg3 param 0))) + (set! (-> self particles 1 kind) + (the-as basic (if (and (nonzero? s5-0) (type-type? (rtype-of s5-0) sparticle-launch-group)) + s5-0 + ) + ) ) - ) - (let ((a0-14 (handle->process (-> self particles 2 tracker)))) - (if a0-14 - (deactivate a0-14) + ) + (set! (-> self particles 1 trans quad) (-> self root trans quad)) + (+! (-> self particles 1 trans y) 24576.0) + (let ((s5-1 (-> arg3 param 1))) + (set! (-> self particles 2 kind) + (the-as basic (if (and (nonzero? s5-1) (type-type? (rtype-of s5-1) sparticle-launch-group)) + s5-1 + ) + ) ) - ) ) - ) + (set! (-> self particles 2 trans quad) (-> (the-as vector (-> arg3 param 2)) quad)) + (set! (-> self particles 2 trans y) (+ 81920.0 (-> self particles 2 trans y))) + ) + (('beam-off) + (set! (-> self particles 1 kind) #f) + (set! (-> self particles 2 kind) #f) + (let ((a0-10 (handle->process (-> self particles 1 tracker)))) + (if a0-10 + (deactivate a0-10) + ) + ) + (let ((a0-14 (handle->process (-> self particles 2 tracker)))) + (if a0-14 + (deactivate a0-14) + ) + ) + ) ) ) @@ -245,7 +236,6 @@ ) ) ) - (none) ) :code (behavior () (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) @@ -256,7 +246,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior ecoclaw) ja-post) ) @@ -270,7 +259,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior ecoclaw) ja-post) ) @@ -309,10 +297,10 @@ (defstate idle (silodoor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('open) - (set! (-> self part-opened) (the-as float (-> event param 0))) + (set! (-> self part-opened) (the-as float (-> block param 0))) ) (('hide) (go-virtual hidden) @@ -337,14 +325,12 @@ ) (suspend) ) - (none) ) :post (behavior () (if (and (< (vector-vector-xz-distance (target-pos 0) (-> self root trans)) 57344.0) (not (ja-min? 0))) (rider-post) (transform-post) ) - (none) ) ) @@ -363,7 +349,6 @@ (ja :num-func num-func-identity :frame-num 0.0) (set! (-> self part-opened) 0.0) (go-virtual idle) - (none) ) ) @@ -504,7 +489,6 @@ ) ) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) ) diff --git a/goal_src/jak1/levels/finalboss/robotboss-weapon.gc b/goal_src/jak1/levels/finalboss/robotboss-weapon.gc index ff1676d78d6..560ea9c56c3 100644 --- a/goal_src/jak1/levels/finalboss/robotboss-weapon.gc +++ b/goal_src/jak1/levels/finalboss/robotboss-weapon.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype torus (structure) ((origin vector :inline :offset-assert 0) (axis vector :inline :offset-assert 16) @@ -207,14 +206,12 @@ :trans (behavior () (arcing-shot-setup (camera-pos) (-> self entity extra trans) 40960.0) (arcing-shot-draw) - (none) ) :code (behavior () (loop (format *stdcon* "debug trajectory~%") (suspend) ) - (none) ) ) @@ -284,7 +281,6 @@ ) ) (deactivate self) - (none) ) :post (the-as (function none :behavior darkecobomb) ja-post) ) @@ -309,11 +305,9 @@ :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (set! (-> self next-tick) 0.9) - (none) ) :exit (behavior () (stop! (-> self sound)) - (none) ) :trans (behavior () (darkecobomb-explode-if-player-high-enough) @@ -354,7 +348,6 @@ (spawn (-> self part) gp-2) ) ) - (none) ) :code (behavior () (sound-play "bomb-open") @@ -371,7 +364,6 @@ (ja :num! (seek! max (-> self anim-speed))) ) ) - (none) ) :post (the-as (function none :behavior darkecobomb) transform-post) ) @@ -381,14 +373,12 @@ :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) 0 - (none) ) :trans (behavior () (darkecobomb-explode-if-player-high-enough) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 0.5)) (go darkecobomb-countdown) ) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -403,7 +393,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior darkecobomb) transform-post) ) @@ -411,7 +400,6 @@ (defstate darkecobomb-idle (darkecobomb) :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (none) ) :trans (behavior () (arcing-shot-calculate @@ -421,7 +409,6 @@ (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time)) (go darkecobomb-land) ) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) @@ -436,7 +423,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior darkecobomb) transform-post) ) @@ -494,7 +480,6 @@ (defstate greenshot-idle (greenshot) :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (none) ) :trans (behavior () (arcing-shot-calculate @@ -505,7 +490,6 @@ (deactivate self) ) (spawn (-> self part) (-> self root-override trans)) - (none) ) :code (behavior () (loop @@ -515,7 +499,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior greenshot) transform-post) ) @@ -645,7 +628,6 @@ ) ) ) - (none) ) :trans (behavior () (set! (-> self ring radius-primary) @@ -677,14 +659,12 @@ (send-event (ppointer->process (-> self parent)) 'missed-jak) (deactivate self) ) - (none) ) :code (behavior () (loop (ja :num-func num-func-identity :frame-num (* 0.000016276043 (-> self ring radius-primary))) (suspend) ) - (none) ) :post (the-as (function none :behavior redshot) transform-post) ) @@ -701,7 +681,6 @@ :event redshot-handler :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (none) ) :trans (behavior () (redshot-trans (- (-> self stall-time) (- (-> *display* game-frame-counter) (-> self state-time)))) @@ -709,13 +688,11 @@ (go redshot-explode) ) (spawn (-> self shot-particle) (-> self root-override trans)) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior redshot) transform-post) ) @@ -724,7 +701,6 @@ :event redshot-handler :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (none) ) :trans (behavior () (redshot-trans (seconds 5)) @@ -736,13 +712,11 @@ (go redshot-wait) ) (spawn (-> self shot-particle) (-> self root-override trans)) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior redshot) transform-post) ) @@ -799,11 +773,11 @@ (defstate yellowshot-idle (yellowshot) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (when (= (-> proc type) target) - (send-event *target* 'attack (-> event param 0) (static-attack-info ((mode 'generic)))) + (send-event *target* 'attack (-> block param 0) (static-attack-info ((mode 'generic)))) (send-event (ppointer->process (-> self parent)) 'hit-jak) ) ) @@ -811,7 +785,6 @@ ) :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (none) ) :trans (behavior () (arcing-shot-calculate @@ -823,13 +796,11 @@ (send-event (ppointer->process (-> self parent)) 'missed-jak) (deactivate self) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior yellowshot) transform-post) ) diff --git a/goal_src/jak1/levels/finalboss/robotboss.gc b/goal_src/jak1/levels/finalboss/robotboss.gc index 454c5a29a29..261e26b755b 100644 --- a/goal_src/jak1/levels/finalboss/robotboss.gc +++ b/goal_src/jak1/levels/finalboss/robotboss.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defmethod ease-loc-t robotboss ((obj robotboss)) (parameter-ease-sin-clamp (-> obj loc-t)) ) @@ -388,75 +387,70 @@ ) (defbehavior robotboss-handler robotboss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('flash) - (set! (-> self palette-val) (* 0.0078125 (the-as float (-> arg3 param 0)))) - ) - (('attack) - (when (>= arg1 2) - (case (-> arg3 param 1) - (('eco-yellow) - (let ((a0-5 (-> arg3 param 0))) - (when (and a0-5 ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry a0-5) - (-> self root-override) - (the-as uint (-> self vulnerable)) - ) - ) - (when (> (-> self hits-to-go) 0) - (set! (-> self took-hit) #t) - (let ((v0-0 (the-as number (+ (-> self hits-to-go) -1)))) - (set! (-> self hits-to-go) (the-as int v0-0)) - v0-0 - ) - ) + (case arg2 + (('flash) + (set! (-> self palette-val) (* 0.0078125 (the-as float (-> arg3 param 0)))) + ) + (('attack) + (when (>= arg1 2) + (case (-> arg3 param 1) + (('eco-yellow) + (let ((a0-5 (-> arg3 param 0))) + (when (and a0-5 ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry a0-5) + (-> self root-override) + (the-as uint (-> self vulnerable)) ) - ) - ) - ) - ) - ) - ) + ) + (when (> (-> self hits-to-go) 0) + (set! (-> self took-hit) #t) + (let ((v0-0 (the-as number (+ (-> self hits-to-go) -1)))) + (set! (-> self hits-to-go) (the-as int v0-0)) + v0-0 + ) + ) + ) + ) ) + ) + ) + ) + ) ) (defstate robotboss-yellow-dark-bomb-wait (robotboss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'white-eco-picked-up) - (close-specific-task! (game-task finalboss-movies) (task-status unknown)) - (entity-birth-no-kill (-> self alts 5)) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 0) - (set! (-> a1-2 message) 'play-anim) - (let ((t9-2 send-event-function) - (v1-2 (-> self alts 5)) - ) - (t9-2 - (if v1-2 - (-> v1-2 extra process) - ) - a1-2 - ) - ) - ) - (cleanup-for-death self) - (the-as object (deactivate self)) - ) - (else - (robotboss-bomb-handler proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('white-eco-picked-up) + (close-specific-task! (game-task finalboss-movies) (task-status unknown)) + (entity-birth-no-kill (-> self alts 5)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) self) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'play-anim) + (let ((t9-2 send-event-function) + (v1-2 (-> self alts 5)) + ) + (t9-2 + (if v1-2 + (-> v1-2 extra process) + ) + a1-2 + ) + ) + ) + (cleanup-for-death self) + (deactivate self) + ) + (else + (robotboss-bomb-handler proc argc message block) + ) ) ) :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (set! (-> self children-spawned) 0) 0 - (none) ) :exit (behavior () (set! (-> self des-cam-entity) #f) @@ -521,13 +515,11 @@ ) ) (send-event (handle->process (-> self white-eco)) 'beam-off) - (none) ) :trans (behavior () (robotboss-always-trans (the-as (state robotboss) #f)) (spool-push *art-control* "green-sagecage-outro-beat-boss-a" 0 self (the-as float -1.0)) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -589,7 +581,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -619,7 +610,6 @@ ) (set-blackout-frames 0) (go robotboss-yellow-dark-bomb-wait) - (none) ) ) @@ -629,11 +619,9 @@ (set! (-> self children-spawned) 0) (set! (-> self state-time) (-> *display* base-frame-counter)) (ja-post) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (spool-push *art-control* "green-sagecage-daxter-sacrifice" 0 self (the-as float -1.0)) @@ -647,7 +635,6 @@ (set! (-> self white-eco) (ppointer->handle (process-spawn light-eco-mother (-> self entity) gp-0 :to self))) ) ) - (none) ) :code (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -810,7 +797,6 @@ (go robotboss-yellow-dark-bomb-wait) ) ) - (none) ) ) @@ -823,7 +809,6 @@ (set! (-> self loc-t-duration) (seconds 4)) (set! (-> self desired-pool-y) -16384.0) (play-ambient (-> self ambient) "GOL-AM01" #t (the-as vector #f)) - (none) ) :trans (behavior () (robotboss-always-trans (the-as (state robotboss) #f)) @@ -832,7 +817,6 @@ (go robotboss-white-eco-movie) ) (robotboss-position) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -853,7 +837,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -900,8 +883,8 @@ ) (defstate robotboss-yellow-wait (robotboss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hit-jak) (let ((f0-2 (rand-float-gen))) (cond @@ -929,7 +912,7 @@ ) ) (else - (robotboss-handler proc arg1 event-type event) + (robotboss-handler proc argc message block) ) ) ) @@ -939,7 +922,6 @@ (set! (-> self till-next-shot) 300) (set! (-> self use-interesting) #t) (set! (-> self keep-charging) #f) - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) @@ -993,7 +975,6 @@ (robotboss-yellow-eco-off) (robotboss-cut-cam-exit) (stop! (-> self looping-sound 3)) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-yellow-dark-bomb) @@ -1050,7 +1031,6 @@ (spawn (-> self particle 6) gp-2) ) ) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -1159,7 +1139,6 @@ (go robotboss-yellow-dark-bomb) ) ) - (none) ) :post (behavior () (when *target* @@ -1168,7 +1147,6 @@ ) ) (transform-post) - (none) ) ) @@ -1181,7 +1159,6 @@ (set! (-> self loc-t-start) (-> *display* game-frame-counter)) (set! (-> self loc-t-duration) (seconds 3)) (set! (-> self desired-pool-y) -18432.0) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-yellow-wait) @@ -1189,7 +1166,6 @@ (go robotboss-yellow-wait) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -1223,7 +1199,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -1233,13 +1208,11 @@ :enter (behavior () (set! (-> self children-spawned) 0) (logior! (-> self alts 11 extra perm status) (entity-perm-status bit-3)) - (none) ) :exit (behavior () (set! (-> self ignore-camera) #f) (set! (-> self des-cam-entity) #f) (logclear! (-> self alts 11 extra perm status) (entity-perm-status bit-3)) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-yellow) @@ -1249,7 +1222,6 @@ (go robotboss-yellow) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -1279,7 +1251,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -1292,7 +1263,6 @@ (set! (-> self loc-t-start) (-> *display* game-frame-counter)) (set! (-> self loc-t-duration) (seconds 3)) (set! (-> self desired-pool-y) -20480.0) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-red-dark-bomb-wait) @@ -1300,7 +1270,6 @@ (if (>= (-> self loc-t) 1.0) (go robotboss-red-dark-bomb-wait) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1321,7 +1290,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -1475,8 +1443,8 @@ ) (defstate robotboss-red-wait (robotboss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hit-jak) (let ((f0-2 (rand-float-gen))) (cond @@ -1504,7 +1472,7 @@ ) ) (else - (robotboss-handler proc arg1 event-type event) + (robotboss-handler proc argc message block) ) ) ) @@ -1515,7 +1483,6 @@ (set! (-> self state-time) (-> *display* game-frame-counter)) (set! (-> self till-next-shot) 0) 0 - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) @@ -1579,7 +1546,6 @@ ) ) ) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-red-dark-bomb) @@ -1639,7 +1605,6 @@ ) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -1745,7 +1710,6 @@ (go robotboss-red-dark-bomb) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -1760,7 +1724,6 @@ (set! (-> self loc-t-duration) (seconds 3)) (set! (-> self desired-pool-y) -22528.0) (set-setting! 'sound-flava #f 40.0 (music-flava finalboss-end)) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-red-wait) @@ -1768,7 +1731,6 @@ (go robotboss-red-wait) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -1794,7 +1756,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -1804,12 +1765,10 @@ :enter (behavior () (set! (-> self children-spawned) 0) 0 - (none) ) :exit (behavior () (set! (-> self ignore-camera) #f) (set! (-> self des-cam-entity) #f) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-red) @@ -1819,7 +1778,6 @@ (go robotboss-red) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -1850,7 +1808,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -1864,7 +1821,6 @@ (set! (-> self loc-t-duration) (seconds 3)) (set! (-> self desired-pool-y) -24576.0) (play-ambient (-> self ambient) "MAI-AM01" #t (the-as vector #f)) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-green-dark-bomb-wait) @@ -1872,7 +1828,6 @@ (if (>= (-> self loc-t) 1.0) (go robotboss-green-dark-bomb-wait) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1893,7 +1848,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -1927,8 +1881,8 @@ ) (defstate robotboss-green-wait (robotboss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (ja-channel-push! 1 (seconds 0.2)) (ja :group! robotboss-green-roar-ja) @@ -1986,7 +1940,7 @@ ) ) (else - (robotboss-handler proc arg1 event-type event) + (robotboss-handler proc argc message block) ) ) ) @@ -1995,7 +1949,6 @@ (set! (-> self children-spawned) 0) (robotboss-setup-for-hits 2 5) (set! (-> self des-cam-entity) "camera-385") - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) @@ -2058,7 +2011,6 @@ ) ) ) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-green-dark-bomb) @@ -2128,7 +2080,6 @@ ) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -2152,7 +2103,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -2168,7 +2118,6 @@ (set! (-> self desired-pool-y) -26624.0) (play-ambient (-> self ambient) "GOL-AM01" #t (the-as vector #f)) (set-setting! 'sound-flava #f 40.0 (music-flava finalboss-middle)) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-green-wait) @@ -2176,7 +2125,6 @@ (go robotboss-green-wait) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -2202,7 +2150,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -2212,12 +2159,10 @@ :enter (behavior () (set! (-> self children-spawned) 0) 0 - (none) ) :exit (behavior () (set! (-> self ignore-camera) #f) (set! (-> self des-cam-entity) #f) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-green) @@ -2227,7 +2172,6 @@ (go robotboss-green) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -2266,7 +2210,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -2279,7 +2222,6 @@ (set! (-> self loc-t-start) (-> *display* game-frame-counter)) (set! (-> self loc-t-duration) (seconds 3)) (set! (-> self desired-pool-y) -28672.0) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-blue-dark-bomb-wait) @@ -2287,7 +2229,6 @@ (if (>= (-> self loc-t) 1.0) (go robotboss-blue-dark-bomb-wait) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2308,7 +2249,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -2509,7 +2449,6 @@ (process-entity-status! self (entity-perm-status bit-3) #t) (set! (-> self use-interesting) #t) (robotboss-yellow-eco-on) - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) @@ -2566,7 +2505,6 @@ ) (robotboss-set-dda) (robotboss-cut-cam-exit) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-blue-dark-bomb) @@ -2645,7 +2583,6 @@ ) (robotboss-position) (robotboss-cut-cam (the-as float 5.0) (the-as float 50.0) (the-as int robotboss-blue-roar-ja)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.4)) @@ -2691,7 +2628,6 @@ (go robotboss-blue-dark-bomb) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) diff --git a/goal_src/jak1/levels/finalboss/sage-finalboss.gc b/goal_src/jak1/levels/finalboss/sage-finalboss.gc index 779b69af41e..c70a3759297 100644 --- a/goal_src/jak1/levels/finalboss/sage-finalboss.gc +++ b/goal_src/jak1/levels/finalboss/sage-finalboss.gc @@ -6,7 +6,6 @@ ;; dgos: FIN ;; DECOMP BEGINS - (defskelgroup *robotboss-cinematic-sg* robotboss-cinematic robotboss-cinematic-lod0-jg robotboss-cinematic-idle-ja ((robotboss-cinematic-lod0-mg (meters 999999))) :bounds (static-spherem 0 -10 0 2000) @@ -67,11 +66,11 @@ (defstate plat-path-active (plat-eco-finalboss) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('target) (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> self force-dest) (the-as float (-> event param 0))) + (set! (-> self force-dest) (the-as float (-> block param 0))) ) (('ridden 'edge-grabbed) (if (>= (- (-> *display* base-frame-counter) (-> self touch-time)) (seconds 2)) @@ -93,7 +92,7 @@ #f ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -110,7 +109,6 @@ ) ) ) - (none) ) :trans (behavior () (let ((s5-0 (eval-path-curve! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp)) @@ -149,7 +147,6 @@ (process-entity-status! self (entity-perm-status complete) #t) (set! (-> self force-dest) 0.0) ) - (none) ) ) @@ -561,8 +558,8 @@ (defstate play-anim (sage-finalboss) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('fade) (set! (-> self credit-fade) 1.0) ) @@ -571,12 +568,12 @@ ) (('activate-particle) (let ((v0-0 (the-as object #t))) - (set! (-> self particle (-> event param 0) active) (the-as symbol v0-0)) + (set! (-> self particle (-> block param 0) active) (the-as symbol v0-0)) v0-0 ) ) (('deactivate-particle) - (set! (-> self particle (-> event param 0) active) #f) + (set! (-> self particle (-> block param 0) active) #f) #f ) ) @@ -584,7 +581,6 @@ :enter (behavior () (set! (-> self credit-fade) 0.0) ((-> (method-of-type process-taskable play-anim) enter)) - (none) ) :exit (behavior () (when (= (current-status (-> self tasks)) (task-status invalid)) @@ -695,7 +691,6 @@ (set! (-> self particle v1-84 active) #f) ) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) :trans (behavior () (local-vars (f28-0 float)) @@ -866,7 +861,6 @@ ) ) ((-> (method-of-type process-taskable play-anim) trans)) - (none) ) ) @@ -876,7 +870,6 @@ (set-blackout-frames 0) (initialize! *game-info* 'game (the-as game-save #f) "title-start") ) - (none) ) :code (behavior () (local-vars (s5-0 symbol)) @@ -936,7 +929,6 @@ ) ) (go-virtual hidden) - (none) ) ) @@ -981,12 +973,10 @@ (sage-finalboss-extra-enter) ((-> (method-of-type process-taskable hidden) enter)) (remove-setting! 'allow-progress) - (none) ) :trans (behavior () (sage-finalboss-extra-trans) ((-> (method-of-type process-taskable hidden) trans)) - (none) ) ) @@ -995,12 +985,10 @@ :enter (behavior () (sage-finalboss-extra-enter) ((-> (method-of-type process-taskable idle) enter)) - (none) ) :trans (behavior () (sage-finalboss-extra-trans) ((-> (method-of-type process-taskable idle) trans)) - (none) ) ) diff --git a/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc b/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc index 9bb332ac7e6..2b6c7dae4e7 100644 --- a/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc +++ b/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype assistant-firecanyon (process-taskable) () :heap-base #x110 @@ -122,7 +121,6 @@ (game-task none) ) ) - (none) ) ) @@ -247,7 +245,6 @@ ) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc b/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc index 2e73347ecd4..47c218994f7 100644 --- a/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc +++ b/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (deftype balloon (process-drawable) ((root-override collide-shape :offset 112) ) @@ -110,15 +109,14 @@ (suspend) (cleanup-for-death self) (deactivate self) - (none) ) ) (defstate balloon-idle (balloon) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (send-event arg0 'heat -10.0) + (send-event proc 'heat -10.0) (go balloon-popping) ) ) @@ -132,7 +130,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior balloon) ja-post) ) @@ -180,12 +177,11 @@ ) (defstate spike-up (spike) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (if (= v1-0 'go-spike-up) - #t - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('go-spike-up) + #t + ) ) ) :trans (behavior () @@ -214,7 +210,6 @@ ) ) ) - (none) ) :code (behavior () (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) @@ -226,18 +221,16 @@ (loop (suspend) ) - (none) ) ) (defstate spike-down (spike) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (when (= v1-0 'go-spike-up) - (go spike-up) - #t - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('go-spike-up) + (go spike-up) + #t + ) ) ) :trans (behavior () @@ -266,14 +259,12 @@ ) ) ) - (none) ) :code (behavior () (transform-post) (loop (suspend) ) - (none) ) ) @@ -299,14 +290,12 @@ ) ) ) - (none) ) :code (behavior () (transform-post) (loop (suspend) ) - (none) ) ) @@ -597,16 +586,15 @@ (suspend) (cleanup-for-death self) (deactivate self) - (none) ) ) (defstate idle (crate-darkeco-cluster) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'touch) - (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'darkeco)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'darkeco)))) (go-virtual die) ) ) @@ -616,7 +604,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) diff --git a/goal_src/jak1/levels/flut_common/flutflut.gc b/goal_src/jak1/levels/flut_common/flutflut.gc index 46f9797596d..0f08c8f86e8 100644 --- a/goal_src/jak1/levels/flut_common/flutflut.gc +++ b/goal_src/jak1/levels/flut_common/flutflut.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (if (not (nmember "flutp" *kernel-packages*)) (set! *kernel-packages* (cons "flutp" *kernel-packages*)) ) @@ -73,33 +72,27 @@ (defstate wait-for-start (flutflut) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'trans) - (vector+! (the-as vector (-> arg3 param 0)) (-> self root-override trans) (-> self extra-trans)) - ) - ((= v1-0 'notify) - (let ((v0-1 (the-as structure #t))) - (set! (-> self auto-get-off) (the-as symbol v0-1)) - v0-1 - ) - ) - ((or (= v1-0 'touch) (= v1-0 'attack)) - (set! (-> self touch-time) (-> *display* base-frame-counter)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trans) + (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + ) + (('notify) + (let ((v0-1 (the-as structure #t))) + (set! (-> self auto-get-off) (the-as symbol v0-1)) + v0-1 + ) + ) + (('touch 'attack) + (set! (-> self touch-time) (-> *display* base-frame-counter)) + #f + ) ) ) :exit (behavior () (set! (-> self root-override root-prim prim-core action) (collide-action)) (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) 0 - (none) ) :code (behavior () (loop @@ -169,7 +162,6 @@ (go-virtual wait-for-return) (go-virtual idle) ) - (none) ) ) @@ -179,7 +171,6 @@ :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (the-as curve-control (-> self path-target))) - (none) ) :exit (-> (method-of-type flutflut wait-for-start) exit) :code (behavior () @@ -193,13 +184,7 @@ ) (when (logtest? (-> self draw status) (draw-status was-drawn)) (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (level-hint-spawn - (text-id swamp-flutflut-hint) - "sksp0160" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + (level-hint-spawn (text-id swamp-flutflut-hint) "sksp0160" (the-as entity #f) *entity-pool* (game-task none)) ) ) (when (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) @@ -233,15 +218,14 @@ (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior flutflut) ja-post) ) (defstate pickup (flutflut) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('draw) (ja-channel-set! 1) (ja :group! (-> self draw art-group data 3)) @@ -250,7 +234,7 @@ (transform-post) ) (('trans) - (vector+! (the-as vector (-> arg3 param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) ) (('touch 'attack) #f @@ -259,7 +243,6 @@ ) :enter (behavior ((arg0 (state flutflut))) ((-> arg0 enter)) - (none) ) :code (behavior ((arg0 (state flutflut))) (ja-channel-set! 0) @@ -284,27 +267,22 @@ ) ) (go arg0) - (none) ) ) (defstate wait-for-return (flutflut) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (if (and (or (= arg2 'touch) (= arg2 'attack)) (send-event *target* 'end-mode)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (or (= message 'touch) (= message 'attack)) (send-event *target* 'end-mode)) (go-virtual pickup (method-of-object self idle)) ) - (the-as - object - (if (= arg2 'trans) - (vector+! (the-as vector (-> arg3 param 0)) (-> self root-override trans) (-> self extra-trans)) - ) - ) + (if (= message 'trans) + (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + ) ) :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (the-as curve-control (-> self path-flut))) - (none) ) :code (behavior () (ja-channel-set! 0) @@ -316,7 +294,6 @@ (flutflut-effect) (suspend) ) - (none) ) ) @@ -378,7 +355,3 @@ (go (method-of-object obj wait-for-start)) (none) ) - - - - diff --git a/goal_src/jak1/levels/flut_common/target-flut.gc b/goal_src/jak1/levels/flut_common/target-flut.gc index 8d6bc7cab5f..2f64a360f5a 100644 --- a/goal_src/jak1/levels/flut_common/target-flut.gc +++ b/goal_src/jak1/levels/flut_common/target-flut.gc @@ -421,7 +421,6 @@ (remove-setting! 'sound-flava) (target-exit) ) - (none) ) :code (behavior ((arg0 handle)) (target-exit) @@ -500,7 +499,6 @@ ) (remove-exit) (go target-flut-get-on arg0) - (none) ) :post target-post ) @@ -509,7 +507,6 @@ :event target-flut-standard-event-handler :enter (behavior () (set! (-> self control unknown-surface00) *flut-walk-mods*) - (none) ) :exit (-> target-flut-start exit) :trans (behavior () @@ -546,7 +543,6 @@ ) (go target-flut-falling #f) ) - (none) ) :code (behavior () (let ((gp-0 22)) @@ -587,7 +583,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) :post target-flut-post ) @@ -599,13 +594,11 @@ (set! (-> self control unknown-surface00) *flut-walk-mods*) (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-surface00 turnv))) (set! (-> self control unknown-int21) (the-as int (-> self control unknown-surface00 target-speed))) - (none) ) :exit (behavior () (set! (-> self control unknown-surface00 turnv) (the-as float (-> self control unknown-uint20))) (set! (-> self control unknown-surface00 target-speed) (the-as float (-> self control unknown-uint30))) ((-> target-flut-start exit)) - (none) ) :trans (behavior () (if (not (move-legs?)) @@ -663,7 +656,6 @@ ) ) ) - (none) ) :code (behavior () (let ((f28-0 0.0) @@ -747,16 +739,15 @@ ) ) ) - (none) ) :post target-flut-post ) (defstate target-flut-jump (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (when (and (= event-type 'touched) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (= message 'touched) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 6) ) @@ -767,22 +758,22 @@ ) ) ) - (send-event proc 'bonk (-> event param 0) (-> self control ground-impact-vel)) + (send-event proc 'bonk (-> block param 0) (-> self control ground-impact-vel)) (when (target-send-attack proc (the-as uint 'flut-bonk) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control unknown-dword50) (-> self control unknown-dword51) ) ) ) - (case event-type + (case message (('jump) - (go target-flut-jump (the-as float (-> event param 0)) (the-as float (-> event param 0))) + (go target-flut-jump (the-as float (-> block param 0)) (the-as float (-> block param 0))) ) (else - (target-flut-standard-event-handler proc arg1 event-type event) + (target-flut-standard-event-handler proc argc message block) ) ) ) @@ -798,12 +789,10 @@ (set! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) ) - (none) ) :exit (behavior () (target-exit) ((-> target-flut-start exit)) - (none) ) :trans (behavior () (set! (-> self control unknown-float123) @@ -855,7 +844,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) (-> *display* seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (ja-channel-push! 2 (seconds 0.12)) @@ -910,7 +898,6 @@ :frame-interp (-> self control unknown-float122) ) ) - (none) ) :post target-flut-post ) @@ -924,14 +911,12 @@ (set! (-> self control dynam gravity-length) 245760.0) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flut-double-jump-mods*) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (target-exit) ((-> target-flut-start exit)) - (none) ) :trans (behavior () (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) @@ -966,7 +951,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) (-> *display* seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (ja-channel-push! 1 (seconds 0.05)) @@ -1029,7 +1013,6 @@ (ja :num! (loop! max)) (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) ) - (none) ) :post target-flut-post ) @@ -1044,7 +1027,6 @@ (set! (-> self control unknown-dword31) 0) (set! (-> self control unknown-dword33) 0) (set! (-> self control unknown-surface00) *flut-walk-mods*) - (none) ) :exit (-> target-flut-start exit) :trans (behavior () @@ -1078,14 +1060,12 @@ ) (go target-flut-falling #f) ) - (none) ) :code (behavior () (let ((t9-0 target-flut-hit-ground-anim)) (t9-0) ) (go target-flut-stance) - (none) ) :post target-flut-post ) @@ -1095,7 +1075,6 @@ :enter (behavior ((arg0 symbol)) (set! (-> self control unknown-surface00) *flut-jump-mods*) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (-> target-flut-start exit) :trans (behavior () @@ -1118,7 +1097,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) (-> *display* seconds-per-frame) ) - (none) ) :code (behavior ((arg0 symbol)) (cond @@ -1142,25 +1120,24 @@ (ja :num! (loop! max)) (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) ) - (none) ) :post target-flut-post ) (defstate target-flut-running-attack (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (cond (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 224) ) (let ((gp-1 (target-send-attack proc (the-as uint (-> self control unknown-symbol30)) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control unknown-dword50) (-> self control unknown-dword51) ) @@ -1200,12 +1177,12 @@ ) ) (else - (target-flut-dangerous-event-handler proc arg1 event-type event) + (target-flut-dangerous-event-handler proc argc message block) ) ) ) (else - (target-flut-dangerous-event-handler proc arg1 event-type event) + (target-flut-dangerous-event-handler proc argc message block) ) ) ) @@ -1246,7 +1223,6 @@ ) (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) ) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) @@ -1255,7 +1231,6 @@ (set! (-> *run-attack-mods* turnvv) 0.0) (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) (target-exit) - (none) ) :trans (behavior () (when (!= (-> self state-time) (-> *display* base-frame-counter)) @@ -1306,7 +1281,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.02)) @@ -1410,16 +1384,15 @@ ) ) (go target-flut-stance) - (none) ) :post target-flut-post ) (defstate target-flut-air-attack (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'touched) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'touched) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 6) ) @@ -1430,14 +1403,14 @@ ) ) ) - (send-event proc 'bonk (-> event param 0) (-> self control ground-impact-vel)) + (send-event proc 'bonk (-> block param 0) (-> self control ground-impact-vel)) ) - (case event-type + (case message (('jump) - (go target-flut-jump (the-as float (-> event param 0)) (the-as float (-> event param 0))) + (go target-flut-jump (the-as float (-> block param 0)) (the-as float (-> block param 0))) ) (else - (target-flut-dangerous-event-handler proc arg1 event-type event) + (target-flut-dangerous-event-handler proc argc message block) ) ) ) @@ -1464,14 +1437,12 @@ ) ) ) - (none) ) :exit (behavior () (target-danger-set! 'harmless #f) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) - (none) ) :trans (behavior () (let ((s5-0 (new-stack-vector0))) @@ -1510,7 +1481,6 @@ (logior! (-> self control status) (cshape-moving-flags onsurf)) (go target-flut-hit-ground) ) - (none) ) :code (behavior ((arg0 float)) (sound-play "flut-hit" :pitch -0.5) @@ -1551,7 +1521,6 @@ (loop (suspend) ) - (none) ) :post target-flut-post ) @@ -1580,7 +1549,6 @@ ) ) ) - (none) ) :exit (-> target-flut-air-attack exit) :trans (-> target-flut-hit-ground trans) @@ -1608,7 +1576,6 @@ (ja :num! (seek!)) ) (go target-flut-stance) - (none) ) :post target-flut-post ) @@ -1621,7 +1588,6 @@ ) (target-exit) ((-> target-flut-start exit)) - (none) ) :trans (behavior () (when (= *cheat-mode* 'debug) @@ -1630,7 +1596,6 @@ (go target-flut-stance) ) ) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1765,7 +1730,6 @@ ) ) (go target-flut-hit-ground) - (none) ) :post target-flut-post ) @@ -1777,7 +1741,6 @@ (target-exit) (remove-setting! 'process-mask) (apply-settings *setting-control*) - (none) ) :trans (-> target-hit trans) :code (behavior ((arg0 symbol)) @@ -1872,7 +1835,6 @@ (set! v1-104 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (not (movie?)))) ) (go target-flut-stance) - (none) ) :post target-no-stick-post ) @@ -1934,7 +1896,6 @@ (quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00)) (rot->dir-targ! (-> self control)) (go target-flut-stance) - (none) ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -1963,7 +1924,6 @@ ) ) (target-no-move-post) - (none) ) ) @@ -1980,12 +1940,10 @@ ) ) (go target-flut-get-off-jump arg0) - (none) ) :post (behavior () (target-no-stick-post) (target-flut-post-post) - (none) ) ) @@ -2045,7 +2003,6 @@ (send-event *camera* 'ease-in) (ja-channel-set! 0) (go target-flut-get-off-hit-ground #f) - (none) ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -2080,7 +2037,6 @@ (quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> self control quat)) (set! (-> self flut flut-scale quad) (-> self control scale quad)) (target-no-move-post) - (none) ) ) @@ -2090,7 +2046,6 @@ :trans (behavior () (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) ((-> target-hit-ground trans)) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-set! 1) @@ -2103,27 +2058,26 @@ (ja :num! (seek!)) ) (go target-stance) - (none) ) :post target-post ) (defstate target-flut-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) (else - (case event-type + (case message (('end-mode) (go target-flut-stance) ) (('clone-anim) - (go target-flut-clone-anim (process->handle (the-as process (-> event param 0)))) + (go target-flut-clone-anim (process->handle (the-as process (-> block param 0)))) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -2133,45 +2087,39 @@ (set! (-> self control unknown-surface00) *grab-mods*) (set! (-> self neck flex-blend) 0.0) (logior! (-> self state-flags) (state-flags invulnerable grabbed)) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags invulnerable grabbed)) (target-exit) ((-> target-flut-start exit)) - (none) ) :code (-> target-flut-stance code) :post (behavior () (target-no-stick-post) (target-flut-post-post) - (none) ) ) (defstate target-flut-clone-anim (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) - ((-> target-flut-grab event) proc arg1 event-type event) + ((-> target-flut-grab event) proc argc message block) ) :enter (-> target-clone-anim enter) :exit (behavior () (send-event (ppointer->process (-> self sidekick)) 'matrix #f) ((-> target-clone-anim exit)) ((-> target-flut-start exit)) - (none) ) :code (behavior ((arg0 handle)) (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (clone-anim arg0 33 #t "") (go target-flut-stance) - (none) ) :post (behavior () (target-no-ja-move-post) (target-flut-post-post) - (none) ) ) diff --git a/goal_src/jak1/levels/intro/evilbro.gc b/goal_src/jak1/levels/intro/evilbro.gc index 5473fbdfa89..2f87b7ecac2 100644 --- a/goal_src/jak1/levels/intro/evilbro.gc +++ b/goal_src/jak1/levels/intro/evilbro.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype evilbro (process-taskable) ((evilsis entity-actor :offset-assert 380) ) @@ -46,7 +45,6 @@ :exit (behavior () (send-event (-> self evilsis extra process) 'end-mode) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) ) @@ -90,7 +88,6 @@ ) ) ) - (none) ) ) @@ -138,7 +135,6 @@ :trans (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) - (none) ) ) diff --git a/goal_src/jak1/levels/jungle/bouncer.gc b/goal_src/jak1/levels/jungle/bouncer.gc index 879c2ff05e4..484321fac66 100644 --- a/goal_src/jak1/levels/jungle/bouncer.gc +++ b/goal_src/jak1/levels/jungle/bouncer.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (deftype springbox (process-drawable) ((spring-height meters :offset-assert 176) (smush float :offset-assert 180) @@ -34,10 +33,10 @@ ) (defstate bouncer-wait (springbox) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('bonk) - (when (send-event arg0 'jump (-> self spring-height) (-> self spring-height) #f) + (when (send-event proc 'jump (-> self spring-height) (-> self spring-height) #f) (sound-play "trampoline") (go bouncer-fire) ) @@ -48,7 +47,7 @@ ) ) (('attack) - (when (and (= (-> arg3 param 1) 'flop) (send-event arg0 'jump (-> self spring-height) (-> self spring-height) #f)) + (when (and (= (-> block param 1) 'flop) (send-event proc 'jump (-> self spring-height) (-> self spring-height) #f)) (go bouncer-fire) #f ) @@ -62,19 +61,18 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) (defstate bouncer-smush (springbox) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (set! (-> self state-time) (-> *display* base-frame-counter)) #f ) (else - ((-> bouncer-wait event) arg0 arg1 arg2 arg3) + ((-> bouncer-wait event) proc argc message block) ) ) ) @@ -101,7 +99,6 @@ (go bouncer-wait) ) ) - (none) ) :post (the-as (function none :behavior springbox) transform-post) ) @@ -115,7 +112,6 @@ (ja :num! (seek!)) ) (go bouncer-wait) - (none) ) :post (the-as (function none :behavior springbox) transform-post) ) @@ -147,7 +143,3 @@ (go bouncer-wait) (none) ) - - - - diff --git a/goal_src/jak1/levels/jungle/darkvine.gc b/goal_src/jak1/levels/jungle/darkvine.gc index 0434d88c048..3a0a267533a 100644 --- a/goal_src/jak1/levels/jungle/darkvine.gc +++ b/goal_src/jak1/levels/jungle/darkvine.gc @@ -125,36 +125,33 @@ ) ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 50] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 52] (defbehavior darkvine-event-handler darkvine ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('touch) - (do-push-aways! (-> self root-override)) - (when (-> self dangerous) - (if (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) - ) - ) - ) - (('attack) - (let ((v1-10 (-> arg3 param 2))) - (cond - ((!= v1-10 (-> self player-attack-id)) - (set! (-> self player-attack-id) (the-as int v1-10)) - (when (-> self vulnerable) - (do-push-aways! (-> self root-override)) - (go darkvine-retreat) - ) - ) - (else - 'push - ) - ) - ) - ) - ) + (case arg2 + (('touch) + (do-push-aways! (-> self root-override)) + (when (-> self dangerous) + (if (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) + ) + ) + ) + (('attack) + (let ((v1-10 (-> arg3 param 2))) + (cond + ((!= v1-10 (-> self player-attack-id)) + (set! (-> self player-attack-id) (the-as int v1-10)) + (when (-> self vulnerable) + (do-push-aways! (-> self root-override)) + (go darkvine-retreat) + ) ) + (else + 'push + ) + ) + ) + ) + ) ) (defstate darkvine-idle (darkvine) @@ -182,7 +179,6 @@ ) ) ) - (none) ) :post (behavior () (when (and (-> self hit-player) @@ -200,7 +196,6 @@ self ) ) - (none) ) ) @@ -249,7 +244,6 @@ (ja :num! (seek!)) ) (go darkvine-idle) - (none) ) :post (-> darkvine-idle post) ) @@ -268,7 +262,6 @@ ) (logior! (-> self mask) (process-mask sleep)) (anim-loop) - (none) ) :post (-> darkvine-idle post) ) diff --git a/goal_src/jak1/levels/jungle/fisher.gc b/goal_src/jak1/levels/jungle/fisher.gc index b0a95edc2c9..4cac383a773 100644 --- a/goal_src/jak1/levels/jungle/fisher.gc +++ b/goal_src/jak1/levels/jungle/fisher.gc @@ -900,7 +900,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior fisher-fish) ja-post) ) @@ -953,7 +952,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) ) @@ -1010,7 +1008,6 @@ (send-event (ppointer->process (-> self parent)) 'fisher-fish-die 1) ) ) - (none) ) ) @@ -1318,14 +1315,12 @@ (send-event *target* 'lose) ) ) - (none) ) :exit (behavior () (when (and *target* (the-as target #f)) (send-event *target* 'end-mode) (process-grab? *target*) ) - (none) ) :trans (behavior () (set! *camera-look-through-other* 2) @@ -1373,7 +1368,6 @@ ) ) (spool-push *art-control* "fisher-reject" 0 self -99.0) - (none) ) :code (the-as (function none :behavior fisher) process-taskable-anim-loop) :post (the-as (function none :behavior fisher) ja-post) @@ -1494,18 +1488,18 @@ ) (defstate fisher-playing (fisher) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-2 object)) - (case event-type + (case message (('fisher-fish-die) (sound-play "fish-miss") - (set! v0-2 (+ (-> self missed) (-> event param 0))) + (set! v0-2 (+ (-> self missed) (-> block param 0))) (set! (-> self missed) (the-as int v0-2)) v0-2 ) (('fisher-fish-caught) (send-event *target* 'bounce) - (set! v0-2 (+ (-> self caught) (-> event param 0))) + (set! v0-2 (+ (-> self caught) (-> block param 0))) (set! (-> self caught) (the-as int v0-2)) v0-2 ) @@ -1539,7 +1533,6 @@ ) (send-event *camera* 'change-to-entity-by-name "camera-152") (init! (-> self query) (the-as string #f) 40 150 25 #t (lookup-text! *common-text* (text-id quit) #f)) - (none) ) :exit (behavior () (remove-setting! 'ambient-volume) @@ -1563,12 +1556,10 @@ (send-event *camera* 'change-state *camera-base-mode* 0) (send-event *camera* 'clear-entity) 0 - (none) ) :trans (behavior () (spool-push *art-control* "fisher-resolution" 0 self -99.0) (spool-push *art-control* "fisher-reject" 0 self -99.0) - (none) ) :code (behavior () (set! *display-profile* #f) @@ -1603,11 +1594,9 @@ ) (suspend) ) - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -1618,7 +1607,6 @@ (if (send-event *target* 'change-mode 'fishing self) (go fisher-playing) ) - (none) ) ) @@ -1671,7 +1659,6 @@ #f (lookup-text! *common-text* (text-id quit) #f) ) - (none) ) ;; og:preserve-this needed for cutscene skipping :exit (behavior () @@ -1730,29 +1717,28 @@ (defstate play-accept (fisher) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 rgbaf)) - (the-as object (case event-type - (('emissive-on) - (set-vector! (-> self draw color-mult) 0.6 0.6 0.6 1.0) - (set! v0-0 (-> self draw color-emissive)) - (set! (-> v0-0 x) 0.6) - (set! (-> v0-0 y) 0.6) - (set! (-> v0-0 z) 0.6) - (set! (-> v0-0 w) 0.0) - v0-0 - ) - (('emissive-off) - (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) - (set! v0-0 (-> self draw color-emissive)) - (set! (-> v0-0 x) 0.0) - (set! (-> v0-0 y) 0.0) - (set! (-> v0-0 z) 0.0) - (set! (-> v0-0 w) 0.0) - v0-0 - ) - ) - ) + (case message + (('emissive-on) + (set-vector! (-> self draw color-mult) 0.6 0.6 0.6 1.0) + (set! v0-0 (-> self draw color-emissive)) + (set! (-> v0-0 x) 0.6) + (set! (-> v0-0 y) 0.6) + (set! (-> v0-0 z) 0.6) + (set! (-> v0-0 w) 0.0) + v0-0 + ) + (('emissive-off) + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + (set! v0-0 (-> self draw color-emissive)) + (set! (-> v0-0 x) 0.0) + (set! (-> v0-0 y) 0.0) + (set! (-> v0-0 z) 0.0) + (set! (-> v0-0 w) 0.0) + v0-0 + ) + ) ) :trans (behavior () (when (-> self training) @@ -1774,7 +1760,6 @@ (t9-14) ) ) - (none) ) ) @@ -1898,7 +1883,6 @@ ) ) ) - (none) ) :code (behavior () (if (!= (ja-group) (get-art-elem self)) @@ -1928,7 +1912,6 @@ ) ) ) - (none) ) ) @@ -1995,18 +1978,18 @@ ) (defstate target-fishing (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((= event-type 'bounce) + ((= message 'bounce) (set-zero! (-> self control unknown-smush00)) (activate! (-> self control unknown-smush00) 1.0 120 210 0.3 1.0) ) - ((= event-type 'lose) - (set! (-> self control unknown-uint20) (the-as uint event-type)) - event-type + ((= message 'lose) + (set! (-> self control unknown-uint20) (the-as uint message)) + message ) (else - ((-> target-grab event) proc arg1 event-type event) + ((-> target-grab event) proc argc message block) ) ) ) @@ -2015,7 +1998,6 @@ (logior! (-> self state-flags) (state-flags invulnerable)) (set-zero! (-> self control unknown-smush00)) (set! (-> self control unknown-uint20) (the-as uint #f)) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags invulnerable)) @@ -2026,7 +2008,6 @@ ) ) (-> target-periscope exit) - (none) ) :code (behavior ((arg0 handle)) (let ((v1-1 (handle->process arg0))) @@ -2125,7 +2106,6 @@ (anim-loop) ) ) - (none) ) :post target-post ) diff --git a/goal_src/jak1/levels/jungle/hopper.gc b/goal_src/jak1/levels/jungle/hopper.gc index 6807a9cfacf..dd8f42e617c 100644 --- a/goal_src/jak1/levels/jungle/hopper.gc +++ b/goal_src/jak1/levels/jungle/hopper.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype hopper (nav-enemy) ((jump-length float :offset-assert 400) (shadow-min-y float :offset-assert 404) @@ -130,7 +129,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) ) - (none) ) ) @@ -144,7 +142,6 @@ nav-enemy-default-event-handler (if (not (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) ((-> (method-of-type nav-enemy nav-enemy-patrol) trans)) ) - (none) ) :code (behavior () (vector-reset! (-> self collide-info transv)) @@ -188,7 +185,6 @@ nav-enemy-default-event-handler ) (hopper-do-jump) ) - (none) ) :post (the-as (function none :behavior hopper) nav-enemy-jump-post) ) @@ -201,7 +197,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-chase) - (none) ) ) @@ -215,7 +210,6 @@ nav-enemy-default-event-handler (if (not (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) ) - (none) ) :code (behavior () (vector-reset! (-> self collide-info transv)) @@ -254,7 +248,6 @@ nav-enemy-default-event-handler (set! (-> self nav target-pos quad) (-> (target-pos 0) quad)) (hopper-do-jump) ) - (none) ) :post (the-as (function none :behavior hopper) nav-enemy-jump-post) ) @@ -267,7 +260,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-stare) - (none) ) ) diff --git a/goal_src/jak1/levels/jungle/jungle-elevator.gc b/goal_src/jak1/levels/jungle/jungle-elevator.gc index cfc13e83a8f..a9a605fa647 100644 --- a/goal_src/jak1/levels/jungle/jungle-elevator.gc +++ b/goal_src/jak1/levels/jungle/jungle-elevator.gc @@ -35,7 +35,6 @@ (set! (-> self bottom-height) (-> jungle bottom-height)) (set! (-> jungle bottom-height) (-> jungleb bottom-height)) (send-event *target* 'reset-pickup 'eco) - (none) ) :exit (behavior () (set! (-> jungle bottom-height) (-> self bottom-height)) @@ -44,7 +43,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((s5-0 (new 'stack-no-clear 'vector)) @@ -65,7 +63,6 @@ (if (and (>= (-> self path-pos) 0.2) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2))) (load-commands-set! *level* (load-command-get-index *level* 'jungle 0)) ) - (none) ) ) @@ -81,7 +78,6 @@ (set! (-> self bottom-height) (-> jungle bottom-height)) (set! (-> jungle bottom-height) (-> jungleb bottom-height)) (set! (-> self grab-player?) (process-grab? *target*)) - (none) ) :exit (behavior () (set! (-> jungle bottom-height) (-> self bottom-height)) @@ -90,7 +86,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) trans))) @@ -101,7 +96,6 @@ (if (and (< (-> self path-pos) 0.8) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2))) (load-commands-set! *level* (load-command-get-index *level* 'jungle 1)) ) - (none) ) ) @@ -129,7 +123,6 @@ ((the-as (function none :behavior plat-button) t9-4)) ) ) - (none) ) ) @@ -165,7 +158,3 @@ (set! (-> obj should-grab-player?) #t) (none) ) - - - - diff --git a/goal_src/jak1/levels/jungle/jungle-mirrors.gc b/goal_src/jak1/levels/jungle/jungle-mirrors.gc index 1d2554eb092..ebf94b275c7 100644 --- a/goal_src/jak1/levels/jungle/jungle-mirrors.gc +++ b/goal_src/jak1/levels/jungle/jungle-mirrors.gc @@ -632,13 +632,11 @@ (set! (-> self blend-to-type) (the-as uint 0)) 0 ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (local-vars (sv-32 int) (sv-48 int)) @@ -718,7 +716,6 @@ (suspend) ) ) - (none) ) ) @@ -739,7 +736,6 @@ (suspend) ) ) - (none) ) ) @@ -1042,12 +1038,9 @@ (apply-all (-> self link) (lambda ((arg0 entity-actor) (arg1 (pointer symbol))) - (the-as - object - (when (and (= (-> arg0 etype) periscope) (not (logtest? (-> arg0 extra perm status) (entity-perm-status complete)))) - (set! (-> arg1 0) #f) - #t - ) + (when (and (= (-> arg0 etype) periscope) (not (logtest? (-> arg0 extra perm status) (entity-perm-status complete)))) + (set! (-> arg1 0) #f) + #t ) ) (& sv-16) @@ -1157,8 +1150,8 @@ ) (defstate periscope-idle (periscope) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('activate) (logclear! (-> self mask) (process-mask actor-pause)) (go periscope-activate) @@ -1167,12 +1160,10 @@ ) :enter (behavior () (clear-collide-with-as (-> self root-override)) - (none) ) :exit (behavior () (restore-collide-with-as (-> self root-override)) (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans periscope-debug-trans :code (behavior () @@ -1190,7 +1181,6 @@ (loop (suspend) ) - (none) ) ) @@ -1198,7 +1188,6 @@ :exit (behavior () (sound-stop (-> self rise-sound-id)) (sound-play "eco-tower-stop" :position (the-as symbol (-> self base))) - (none) ) :trans periscope-debug-trans :code (behavior () @@ -1224,7 +1213,6 @@ ) (set! (-> self raised?) #t) (go periscope-wait-for-power-input) - (none) ) :post periscope-post ) @@ -1248,7 +1236,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior periscope) ja-post) ) @@ -1258,8 +1245,8 @@ ) (defstate periscope-wait-for-player (periscope) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) @@ -1267,7 +1254,7 @@ ) ) (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) @@ -1292,7 +1279,6 @@ ) :exit (behavior () (sound-stop (-> self grips-sound-id)) - (none) ) :code (behavior () (hide-hud) @@ -1381,7 +1367,6 @@ (suspend) ) ) - (none) ) :post (behavior () (if (-> self grips-moving?) @@ -1390,7 +1375,6 @@ ) (periscope-draw-beam-impact) (ja-post) - (none) ) ) @@ -1400,11 +1384,9 @@ (periscope-find-reflection-angles) (set! (-> self turn) (-> self target-turn)) (set! (-> self tilt) (-> self target-tilt)) - (none) ) :trans (behavior () (hide-hud) - (none) ) :code (behavior () (set! (-> self lock-time) (-> *display* base-frame-counter)) @@ -1606,13 +1588,11 @@ ) (suspend) ) - (none) ) :post (behavior () (periscope-draw-beam) (periscope-update-joints) (ja-post) - (none) ) ) @@ -1638,7 +1618,6 @@ (loop (suspend) ) - (none) ) :post periscope-post ) @@ -1779,11 +1758,9 @@ (loop (suspend) ) - (none) ) :post (behavior () (draw-power-beam (-> self reflector-trans) (-> self next-reflector-trans)) - (none) ) ) @@ -1799,8 +1776,8 @@ ) (defstate reflector-mirror-idle (reflector-mirror) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (sound-play "mirror-smash") (go reflector-mirror-broken #f) @@ -1809,7 +1786,6 @@ ) :exit (behavior () (stop! (-> self sound)) - (none) ) :code (behavior () (let ((gp-0 (new-stack-vector0))) @@ -1834,7 +1810,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior reflector-mirror) ja-post) ) @@ -1893,7 +1868,6 @@ (loop (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/jungle/jungle-obs.gc b/goal_src/jak1/levels/jungle/jungle-obs.gc index 5062159026b..20414aa2ea9 100644 --- a/goal_src/jak1/levels/jungle/jungle-obs.gc +++ b/goal_src/jak1/levels/jungle/jungle-obs.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defskelgroup *med-res-firecanyon-sg* medres-firecanyon medres-firecanyon-lod0-jg medres-firecanyon-idle-ja ((medres-firecanyon-lod0-mg (meters 999999))) :bounds (static-spherem -200 0 -440 530) @@ -42,9 +41,9 @@ (defstate idle (logtrap) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (or (= event-type 'touch) (= event-type 'attack)) - (send-event proc 'attack (-> event param 0) (new 'static 'attack-info)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (or (= message 'touch) (= message 'attack)) + (send-event proc 'attack (-> block param 0) (new 'static 'attack-info)) ) ) :code (behavior () @@ -69,7 +68,6 @@ (ja :num! (seek!)) ) ) - (none) ) ) @@ -128,7 +126,6 @@ (ja :num! (seek! max 0.4)) ) ) - (none) ) :post (the-as (function none :behavior towertop) ja-post) ) @@ -168,14 +165,13 @@ ) (defstate lurkerm-tall-sail-idle (lurkerm-tall-sail) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('stop) - (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> self speed) 0.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('stop) + (process-entity-status! self (entity-perm-status complete) #t) + (set! (-> self speed) 0.0) + ) + ) ) :trans (the-as (function none :behavior lurkerm-tall-sail) rider-trans) :code (behavior () @@ -191,7 +187,6 @@ (ja :num! (seek! max (* 0.5 (-> self speed)))) ) ) - (none) ) :post (the-as (function none :behavior lurkerm-tall-sail) rider-post) ) @@ -260,14 +255,13 @@ ) (defstate lurkerm-short-sail-idle (lurkerm-short-sail) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('stop) - (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> self speed) 0.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('stop) + (process-entity-status! self (entity-perm-status complete) #t) + (set! (-> self speed) 0.0) + ) + ) ) :trans (the-as (function none :behavior lurkerm-short-sail) rider-trans) :code (behavior () @@ -283,7 +277,6 @@ (ja :num! (seek! max (* 0.5 (-> self speed)))) ) ) - (none) ) :post (the-as (function none :behavior lurkerm-short-sail) rider-post) ) @@ -372,14 +365,13 @@ ) (defstate lurkerm-piston-idle (lurkerm-piston) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('stop) - (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> self speed) 0.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('stop) + (process-entity-status! self (entity-perm-status complete) #t) + (set! (-> self speed) 0.0) + ) + ) ) :trans (the-as (function none :behavior lurkerm-piston) rider-trans) :code (behavior () @@ -395,7 +387,6 @@ (ja :num! (seek! max (-> self speed))) ) ) - (none) ) :post (the-as (function none :behavior lurkerm-piston) rider-post) ) @@ -484,14 +475,13 @@ ) (defstate accordian-idle (accordian) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('stop) - (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> self speed) 0.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('stop) + (process-entity-status! self (entity-perm-status complete) #t) + (set! (-> self speed) 0.0) + ) + ) ) :code (behavior () (ja-no-eval :num! (loop!) :frame-num 0.0) @@ -503,7 +493,6 @@ (ja-post) ) ) - (none) ) ) @@ -560,7 +549,6 @@ (ja-eval) ) (go-virtual pov-camera-done-playing) - (none) ) ) @@ -598,8 +586,8 @@ ) (defstate precurbridge-idle (precurbridge) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('go) (go precurbridge-activate) ) @@ -654,7 +642,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior precurbridge) ja-post) ) @@ -662,7 +649,6 @@ (defstate precurbridge-activate (precurbridge) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (the-as (function none :behavior precurbridge) rider-trans) :code (behavior () @@ -677,27 +663,23 @@ (ja :num! (seek! max 0.25)) ) (go precurbridge-active #f) - (none) ) :post (the-as (function none :behavior precurbridge) rider-post) ) (defstate precurbridge-active (precurbridge) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('bonk) - (let* ((gp-0 (the-as object (-> event param 0))) - (a0-2 (-> (the-as touching-shapes-entry gp-0) head)) - (s5-0 (-> self root-override)) - ) - (get-touched-prim a0-2 s5-0 (the-as touching-shapes-entry gp-0)) - ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s5-0) - ) - (activate! (-> self smush) -1.0 150 600 1.0 1.0) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (let* ((gp-0 (the-as object (-> block param 0))) + (a0-2 (-> (the-as touching-shapes-entry gp-0) head)) + (s5-0 (-> self root-override)) + ) + (get-touched-prim a0-2 s5-0 (the-as touching-shapes-entry gp-0)) + ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s5-0) ) - ) + (activate! (-> self smush) -1.0 150 600 1.0 1.0) + ) ) ) :trans (the-as (function none :behavior precurbridge) rider-trans) @@ -732,7 +714,6 @@ (ja :num! (loop! 0.4)) (suspend) ) - (none) ) :post (the-as (function none :behavior precurbridge) rider-post) ) @@ -982,7 +963,6 @@ (ja-post) (suspend) ) - (none) ) ) @@ -1007,7 +987,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior maindoor) ja-post) ) @@ -1134,7 +1113,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior jngpusher) rider-post) ) diff --git a/goal_src/jak1/levels/jungle/junglefish.gc b/goal_src/jak1/levels/jungle/junglefish.gc index 496d09c215a..6581f1bb457 100644 --- a/goal_src/jak1/levels/jungle/junglefish.gc +++ b/goal_src/jak1/levels/jungle/junglefish.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype junglefish (nav-enemy) () :heap-base #x120 @@ -39,7 +38,6 @@ nav-enemy-default-event-handler ) :exit (behavior () (set! (-> self target-speed) (-> self nav-info walk-travel-speed)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -91,7 +89,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) ) @@ -103,7 +100,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-chase) - (none) ) ) @@ -118,7 +114,6 @@ nav-enemy-default-event-handler (if (and *target* (>= 8192.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (go-virtual nav-enemy-attack) ) - (none) ) ) @@ -130,7 +125,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-patrol) - (none) ) ) @@ -142,7 +136,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-patrol) - (none) ) ) @@ -154,7 +147,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-patrol) - (none) ) ) @@ -172,7 +164,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-chase) - (none) ) :post (the-as (function none :behavior junglefish) nav-enemy-chase-post) ) @@ -196,7 +187,6 @@ nav-enemy-default-event-handler (ja :num! (seek! max 2.0)) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -214,11 +204,11 @@ nav-enemy-default-event-handler :neck-joint -1 :player-look-at-joint 5 :run-travel-speed (meters 5.5) - :run-rotate-speed (degrees 720.0) + :run-rotate-speed (degrees 720) :run-acceleration (meters 6) :run-turn-time (seconds 0.15) :walk-travel-speed (meters 4) - :walk-rotate-speed (degrees 720.0) + :walk-rotate-speed (degrees 720) :walk-acceleration (meters 6) :walk-turn-time (seconds 0.15) :attack-shove-back (meters 1) diff --git a/goal_src/jak1/levels/jungle/junglesnake.gc b/goal_src/jak1/levels/jungle/junglesnake.gc index a0b27219b41..71017809dfb 100644 --- a/goal_src/jak1/levels/jungle/junglesnake.gc +++ b/goal_src/jak1/levels/jungle/junglesnake.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defskelgroup *junglesnake-sg* junglesnake junglesnake-lod0-jg junglesnake-idle-ja ((junglesnake-lod0-mg (meters 999999))) :bounds (static-spherem 0 14 0 18) @@ -333,7 +332,6 @@ junglesnake-default-event-handler (set! (-> self des-ry) (-> self ry)) (set! (-> self des-tilt) (-> self tilt)) (logior! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (when *target* @@ -345,13 +343,11 @@ junglesnake-default-event-handler ) ) ) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -364,7 +360,6 @@ junglesnake-default-event-handler (set! (-> self skel postbind-function) junglesnake-joint-callback) (set! (-> self refractory-delay) 0) 0 - (none) ) :trans (behavior () (junglesnake-method-20 self) @@ -378,7 +373,6 @@ junglesnake-default-event-handler ) ) ) - (none) ) :code (behavior () (ja-no-eval :group! junglesnake-drop-down-ja :num! (seek! max 0.85) :frame-num 0.5) @@ -387,7 +381,6 @@ junglesnake-default-event-handler (ja :num! (seek! max 0.85)) ) (go junglesnake-tracking) - (none) ) :post (the-as (function none :behavior junglesnake) transform-post) ) @@ -398,7 +391,6 @@ junglesnake-default-event-handler (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self track-player-ry) #t) (set! (-> self track-player-tilt) #t) - (none) ) :trans (behavior () (if (and (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) @@ -430,7 +422,6 @@ junglesnake-default-event-handler ) ) ) - (none) ) :code (behavior () (cond @@ -451,7 +442,6 @@ junglesnake-default-event-handler (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior junglesnake) transform-post) ) @@ -460,11 +450,9 @@ junglesnake-default-event-handler :event junglesnake-default-event-handler :enter (behavior () (set! (-> self hit-player) #f) - (none) ) :exit (behavior () (junglesnake-method-24 self) - (none) ) :trans (behavior () (junglesnake-method-20 self) @@ -478,7 +466,6 @@ junglesnake-default-event-handler ) ) ) - (none) ) :code (behavior () (set! (-> self track-player-ry) #t) @@ -521,7 +508,6 @@ junglesnake-default-event-handler (set! (-> self refractory-delay) (rand-vu-int-range 150 300)) ) (go junglesnake-tracking) - (none) ) :post (the-as (function none :behavior junglesnake) transform-post) ) @@ -534,11 +520,9 @@ junglesnake-default-event-handler (set! (-> self track-player-tilt) #f) (set! (-> self des-ry) (-> self ry)) (set! (-> self des-tilt) (-> self tilt)) - (none) ) :trans (behavior () (junglesnake-method-20 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -566,7 +550,6 @@ junglesnake-default-event-handler ) (set-vector! (-> self root-override scale) 1.0 1.0 1.0 1.0) (go junglesnake-sleeping) - (none) ) :post (the-as (function none :behavior junglesnake) transform-post) ) @@ -586,7 +569,6 @@ junglesnake-default-event-handler (ja :num! (seek!)) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior junglesnake) ja-post) ) diff --git a/goal_src/jak1/levels/jungleb/aphid.gc b/goal_src/jak1/levels/jungleb/aphid.gc index aeda565911e..28cd0c79381 100644 --- a/goal_src/jak1/levels/jungleb/aphid.gc +++ b/goal_src/jak1/levels/jungleb/aphid.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype aphid (nav-enemy) ((try int32 :offset-assert 400) ) @@ -114,7 +113,6 @@ ) ) ) - (none) ) ) @@ -159,7 +157,6 @@ ) ) ) - (none) ) ) @@ -198,7 +195,6 @@ (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -216,11 +212,11 @@ :neck-joint 10 :player-look-at-joint 5 :run-travel-speed (meters 5) - :run-rotate-speed (degrees 2880.0) + :run-rotate-speed (degrees 2880) :run-acceleration (meters 1) :run-turn-time (seconds 0.1) :walk-travel-speed (meters 3) - :walk-rotate-speed (degrees 720.0) + :walk-rotate-speed (degrees 720) :walk-acceleration (meters 1) :walk-turn-time (seconds 0.5) :attack-shove-back (meters 3) diff --git a/goal_src/jak1/levels/jungleb/jungleb-obs.gc b/goal_src/jak1/levels/jungleb/jungleb-obs.gc index 41989c93e10..56830658bda 100644 --- a/goal_src/jak1/levels/jungleb/jungleb-obs.gc +++ b/goal_src/jak1/levels/jungleb/jungleb-obs.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (deftype eggtop (process-drawable) ((root-override collide-shape-moving :offset 112) (cam-tracker handle :offset-assert 176) @@ -175,23 +174,21 @@ ) (defstate eggtop-idle (eggtop) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (case (-> event param 0) - (('pickup) - (if (type-type? (-> proc type) fuel-cell) - (save-reminder (get-task-control (-> self entity extra perm task)) 1 0) - ) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (if (type-type? (-> proc type) fuel-cell) + (save-reminder (get-task-control (-> self entity extra perm task)) 1 0) + ) + ) + ) + ) + ) ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (if (and (not (-> self child)) (task-complete? *game-info* (-> self entity extra perm task))) @@ -199,13 +196,11 @@ ) (spawn (-> self part) (-> self root-override trans)) (sound-play "electric-loop" :id (-> self sound-id)) - (none) ) :code (behavior () (suspend) (update-transforms! (-> self root-override)) (anim-loop) - (none) ) :post (the-as (function none :behavior eggtop) ja-post) ) @@ -214,7 +209,6 @@ :trans (behavior () (rider-trans) (hide-hud-quick) - (none) ) :code (behavior ((arg0 symbol)) (when (not arg0) @@ -291,7 +285,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior eggtop) rider-post) ) diff --git a/goal_src/jak1/levels/jungleb/plant-boss.gc b/goal_src/jak1/levels/jungleb/plant-boss.gc index cf5c7e46c56..e7567284f23 100644 --- a/goal_src/jak1/levels/jungleb/plant-boss.gc +++ b/goal_src/jak1/levels/jungleb/plant-boss.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (deftype plant-boss (process-drawable) ((root-override collide-shape :offset 112) (neck joint-mod :offset-assert 176) @@ -235,13 +234,13 @@ ) (defstate plant-boss-arm-idle (plant-boss-arm) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide 'die) - (go plant-boss-arm-die (the-as symbol (-> event param 0))) + (go plant-boss-arm-die (the-as symbol (-> block param 0))) ) (('hit) - (go plant-boss-arm-hit (the-as basic (-> event param 0))) + (go plant-boss-arm-hit (the-as basic (-> block param 0))) ) ) ) @@ -254,7 +253,6 @@ (ja :chan 1 :frame-interp (- 1.0 (-> self parent-override 0 energy))) (suspend) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -276,7 +274,6 @@ (ja :num! (seek!)) ) (go plant-boss-arm-idle) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -344,22 +341,21 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) (defstate plant-boss-back-arms-idle (plant-boss-arm) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (or (= event-type 'touch) (= event-type 'attack)) - (send-event proc 'attack (-> event param 0) (new 'static 'attack-info)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (or (= message 'touch) (= message 'attack)) + (send-event proc 'attack (-> block param 0) (new 'static 'attack-info)) ) (cond - ((= event-type 'hit) - (go plant-boss-back-arms-hit (the-as symbol (-> event param 0))) + ((= message 'hit) + (go plant-boss-back-arms-hit (the-as symbol (-> block param 0))) ) - ((= event-type 'die) - (go plant-boss-back-arms-die (the-as symbol (-> event param 0))) + ((= message 'die) + (go plant-boss-back-arms-die (the-as symbol (-> block param 0))) ) ) ) @@ -371,7 +367,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -410,7 +405,6 @@ (ja :num! (seek!)) ) (go plant-boss-back-arms-idle) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -436,19 +430,18 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) (defstate plant-boss-vine-idle (plant-boss-arm) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide 'die) - (go plant-boss-vine-die (the-as symbol (-> event param 0))) + (go plant-boss-vine-die (the-as symbol (-> block param 0))) ) (('hit) - (go plant-boss-vine-hit (the-as basic (-> event param 0))) + (go plant-boss-vine-hit (the-as basic (-> block param 0))) ) ) ) @@ -462,7 +455,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -484,7 +476,6 @@ (ja :num! (seek!)) ) (go plant-boss-vine-idle) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -508,16 +499,15 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) (defstate plant-boss-root-idle (plant-boss-arm) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide 'die) - (go plant-boss-root-die (the-as symbol (-> event param 0))) + (go plant-boss-root-die (the-as symbol (-> block param 0))) ) ) ) @@ -531,7 +521,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -546,7 +535,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -665,13 +653,13 @@ ) (defstate plant-boss-leaf-idle (plant-boss-leaf) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) - (go plant-boss-leaf-open (the-as symbol (-> event param 0))) + (go plant-boss-leaf-open (the-as symbol (-> block param 0))) ) (('die) - (go plant-boss-leaf-die (the-as basic (-> event param 0))) + (go plant-boss-leaf-die (the-as basic (-> block param 0))) ) ) ) @@ -698,19 +686,18 @@ ) ) ) - (none) ) :post (the-as (function none :behavior plant-boss-leaf) ja-post) ) (defstate plant-boss-leaf-open (plant-boss-leaf) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('kill) (go plant-boss-leaf-close) ) (('die) - (go plant-boss-leaf-die (the-as basic (-> event param 0))) + (go plant-boss-leaf-die (the-as basic (-> block param 0))) ) ) ) @@ -755,17 +742,16 @@ ) ) (go plant-boss-leaf-open-idle #f) - (none) ) :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) (defstate plant-boss-leaf-open-idle (plant-boss-leaf) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('kill) (set! (-> self state-object) #t) - (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> event param 0)))))) + (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> block param 0)))))) (set! (-> self state-time-frame) (the-as time-frame v0-0)) v0-0 ) @@ -776,7 +762,7 @@ ) ) (('die) - (go plant-boss-leaf-die (the-as basic (-> event param 0))) + (go plant-boss-leaf-die (the-as basic (-> block param 0))) ) ) ) @@ -803,23 +789,22 @@ (set! v1-19 (and (-> self state-object) (< (-> self state-time-frame) (-> *display* base-frame-counter)))) ) (go plant-boss-leaf-close) - (none) ) :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) (defstate plant-boss-leaf-bounce (plant-boss-leaf) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('kill) (set! (-> self state-object) #t) - (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> event param 0)))))) + (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> block param 0)))))) (set! (-> self state-time-frame) (the-as time-frame v0-0)) v0-0 ) ) (('die) - (go plant-boss-leaf-die (the-as basic (-> event param 0))) + (go plant-boss-leaf-die (the-as basic (-> block param 0))) ) ) ) @@ -845,16 +830,15 @@ ) ) (go plant-boss-leaf-open-idle (-> self state-object)) - (none) ) :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) (defstate plant-boss-leaf-close (plant-boss-leaf) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) - (go plant-boss-leaf-die (the-as basic (-> event param 0))) + (go plant-boss-leaf-die (the-as basic (-> block param 0))) ) ) ) @@ -879,7 +863,6 @@ ) ) (go plant-boss-leaf-idle #f) - (none) ) :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) @@ -890,7 +873,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) :post (the-as (function none :behavior plant-boss-leaf) ja-post) ) @@ -965,7 +947,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior plant-boss) ja-post) ) @@ -1055,7 +1036,6 @@ (set! (-> self cycle-count) 0) (set! (-> self snap-count) 0) (go plant-boss-reset 0) - (none) ) :post (the-as (function none :behavior plant-boss) ja-post) ) @@ -1067,7 +1047,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self body flex-blend) 0.0) (set! (-> self neck flex-blend) 1.0) - (none) ) :trans (behavior () (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) @@ -1099,7 +1078,6 @@ (go plant-boss-attack 1) ) ) - (none) ) :code (behavior () (cond @@ -1160,7 +1138,6 @@ ) ) ) - (none) ) :post plant-boss-post ) @@ -1194,7 +1171,6 @@ ) ) ) - (none) ) :trans (behavior () (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) @@ -1228,32 +1204,31 @@ ) ) ) - (none) ) :code (-> plant-boss-idle code) :post plant-boss-post ) (defstate plant-boss-vulnerable (plant-boss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) (send-event proc 'shove - (-> event param 0) + (-> block param 0) (static-attack-info ((shove-up (meters 2)) (shove-back (meters 6)))) ) - (go plant-boss-hit (the-as symbol (-> event param 1))) + (go plant-boss-hit (the-as symbol (-> block param 1))) ) ) (else - (plant-boss-generic-event-handler proc arg1 event-type event) + (plant-boss-generic-event-handler proc argc message block) ) ) ) @@ -1264,7 +1239,6 @@ (set! (-> self attack-prim 0 local-sphere w) 12288.0) (set! (-> self attack-prim 0 prim-core offense) (collide-offense indestructible)) (logior! (-> self attack-prim 0 prim-core action) (collide-action solid)) - (none) ) :exit (behavior () (send-event (ppointer->process (-> self leaf 1)) 'kill 0) @@ -1272,7 +1246,6 @@ (set! (-> self attack-prim 0 local-sphere w) 16384.0) (set! (-> self attack-prim 0 prim-core offense) (collide-offense no-offense)) (logclear! (-> self attack-prim 0 prim-core action) (collide-action solid)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.25)) @@ -1328,23 +1301,22 @@ ) ) (go plant-boss-spawn) - (none) ) :post plant-boss-post ) (defstate plant-boss-attack (plant-boss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (when (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) - (not (ja-group? (-> self draw art-group data 13))) + (not (ja-group? plant-boss-main-vulnerable2idle-ja)) ) - (when (send-event proc 'attack-or-shove (-> event param 0) (static-attack-info ((mode 'plant-boss)))) + (when (send-event proc 'attack-or-shove (-> block param 0) (static-attack-info ((mode 'plant-boss)))) (let ((v0-1 (the-as object #t))) (set! (-> self ate) (the-as symbol v0-1)) v0-1 @@ -1353,7 +1325,7 @@ ) ) (else - (plant-boss-default-event-handler proc arg1 event-type event) + (plant-boss-default-event-handler proc argc message block) ) ) ) @@ -1406,7 +1378,6 @@ ) ) (go plant-boss-reset arg0) - (none) ) :post plant-boss-post ) @@ -1420,7 +1391,6 @@ (deactivate a0-4) ) ) - (none) ) :code (behavior () (let ((f30-1 (the-as float (if (ja-group? plant-boss-main-attack-ja) @@ -1470,7 +1440,6 @@ (send-event *target* 'end-mode) (logclear! (-> self skel status) (janim-status inited)) (go plant-boss-idle) - (none) ) :post plant-boss-post ) @@ -1517,7 +1486,6 @@ (go plant-boss-idle) ) ) - (none) ) :post plant-boss-post ) @@ -1577,7 +1545,6 @@ (ja-eval) ) (go plant-boss-spawn) - (none) ) :post plant-boss-post ) @@ -1672,30 +1639,28 @@ (logior! (-> self mask) (process-mask actor-pause)) (remove-setting! 'music) (go plant-boss-dead-idle) - (none) ) :post (behavior () (plant-boss-post) (do-push-aways! (-> self root-override)) - (none) ) ) (defstate plant-boss-dead-idle (plant-boss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('bonk) (go plant-boss-dead-bounce (lerp-scale (the-as float 0.1) (the-as float 1.0) - (the-as float (-> event param 1)) + (the-as float (-> block param 1)) (the-as float 40960.0) (the-as float 81920.0) ) ) ) (else - (plant-boss-generic-event-handler proc arg1 event-type event) + (plant-boss-generic-event-handler proc argc message block) ) ) ) @@ -1713,7 +1678,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) @@ -1744,7 +1708,6 @@ (ja :chan 1 :frame-interp (- 1.0 arg0) :num-func num-func-identity :frame-num max) ) (go plant-boss-dead-idle) - (none) ) :post (the-as (function none :behavior plant-boss) rider-post) ) diff --git a/goal_src/jak1/levels/jungleb/plat-flip.gc b/goal_src/jak1/levels/jungleb/plat-flip.gc index fd336caf837..9a8993760be 100644 --- a/goal_src/jak1/levels/jungleb/plat-flip.gc +++ b/goal_src/jak1/levels/jungleb/plat-flip.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype plat-flip (process-drawable) ((root-override collide-shape-moving :offset 112) (path-pos float :offset-assert 176) @@ -36,17 +35,16 @@ ) (defstate plat-flip-idle (plat-flip) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (activate! (-> self smush) -1.0 90 300 1.0 1.0) - ) - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - (the-as smush-control #f) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (activate! (-> self smush) -1.0 90 300 1.0 1.0) + ) + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + (the-as smush-control #f) + ) + ) ) :trans (the-as (function none :behavior plat-flip) rider-trans) :code (behavior () @@ -99,7 +97,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior plat-flip) rider-post) ) diff --git a/goal_src/jak1/levels/lavatube/assistant-lavatube.gc b/goal_src/jak1/levels/lavatube/assistant-lavatube.gc index 06a2932c29f..e93730b34cc 100644 --- a/goal_src/jak1/levels/lavatube/assistant-lavatube.gc +++ b/goal_src/jak1/levels/lavatube/assistant-lavatube.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype assistant-lavatube-start (process-taskable) () :heap-base #x110 @@ -95,13 +94,7 @@ (set! (-> v1-28 scale) 0.8) ) (set! (-> gp-0 flags) (font-flags shadow kerning middle large)) - (print-game-text - (lookup-text! *common-text* (text-id assistant-lavatube-need-cells-text) #f) - gp-0 - #f - 128 - 22 - ) + (print-game-text (lookup-text! *common-text* (text-id assistant-lavatube-need-cells-text) #f) gp-0 #f 128 22) ) ) (level-hint-spawn @@ -112,7 +105,6 @@ (game-task none) ) ) - (none) ) ) @@ -143,7 +135,6 @@ (ja :num! (seek!)) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/lavatube/lavatube-energy.gc b/goal_src/jak1/levels/lavatube/lavatube-energy.gc index f2286af7d57..28c04298472 100644 --- a/goal_src/jak1/levels/lavatube/lavatube-energy.gc +++ b/goal_src/jak1/levels/lavatube/lavatube-energy.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defpartgroup group-energyarm :id 544 :bounds (static-bspherem 0 0 0 4) @@ -389,12 +388,11 @@ ) (defbehavior energydoor-open-handler energydoor ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('open?) - #t - ) - ) - ) + (case arg2 + (('open?) + #t + ) + ) ) (defbehavior energydoor-closed-handler energydoor ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) @@ -422,7 +420,6 @@ (go energydoor-closed-till-near) (go energydoor-closed-till-task) ) - (none) ) :post (the-as (function none :behavior energydoor) transform-post) ) @@ -458,7 +455,6 @@ ) ) ) - (none) ) :code (behavior () (ja :num-func num-func-identity :frame-num max) @@ -466,7 +462,6 @@ (loop (suspend) ) - (none) ) ) @@ -479,7 +474,6 @@ (ja :num! (seek!)) ) (go energydoor-opened) - (none) ) :post (the-as (function none :behavior energydoor) transform-post) ) @@ -509,7 +503,6 @@ (go energydoor-opening) ) ) - (none) ) :code (behavior () (ja :num-func num-func-identity :frame-num 0.0) @@ -517,7 +510,6 @@ (loop (suspend) ) - (none) ) ) @@ -527,7 +519,6 @@ (if (< -409600.0 (energydoor-player-dist)) (go energydoor-opening) ) - (none) ) :code (behavior () (ja :num-func num-func-identity :frame-num 0.0) @@ -535,7 +526,6 @@ (loop (suspend) ) - (none) ) ) @@ -628,7 +618,6 @@ (loop (suspend) ) - (none) ) ) @@ -647,14 +636,13 @@ ) ) ) - (none) ) :post (the-as (function none :behavior energybase) ja-post) ) (defstate energybase-idle (energybase) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('stop) (go energybase-stopping) ) @@ -671,7 +659,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior energybase) ja-post) ) @@ -758,29 +745,28 @@ ) (defstate energyball-idle (energyball) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('attack) - (when (and (>= arg1 2) (= (-> event param 1) 'eco-yellow)) - (increment-success-for-hint (text-id lavatube-balls)) - (sound-play "dcrate-break") - (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 546) - 600 - #f - #f - #f - (-> self root-override trans) - :to *entity-pool* - ) - (cleanup-for-death self) - (the-as symbol (deactivate self)) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (and (>= argc 2) (= (-> block param 1) 'eco-yellow)) + (increment-success-for-hint (text-id lavatube-balls)) + (sound-play "dcrate-break") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 546) + 600 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* + ) + (cleanup-for-death self) + (deactivate self) + ) + ) + ) ) :trans (behavior () (rider-trans) @@ -808,7 +794,6 @@ (matrix->quaternion (-> self root-override quat) s5-1) ) ) - (none) ) :code (behavior () (loop @@ -818,7 +803,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior energyball) rider-post) ) @@ -901,13 +885,11 @@ (defstate energyarm-stop (energyarm) :enter (behavior () '() - (none) ) :trans (behavior () (update! (-> self x-rotation) 0.0) (update! (-> self y-chatter-rotation) 0.0) (energyarm-trans) - (none) ) :code (behavior () (loop @@ -917,14 +899,13 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior energyarm) rider-post) ) (defstate energyarm-no-ball (energyarm) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('stop) (go energyarm-stop) ) @@ -932,7 +913,6 @@ ) :enter (behavior () (set! (-> self y-chatter-rotation osc target) 1.0) - (none) ) :trans (behavior () (set! (-> self x-correction) (fmax -1.0 (+ -0.1 (-> self x-correction)))) @@ -958,7 +938,6 @@ ) ) (energyarm-trans) - (none) ) :code (behavior () (loop @@ -968,7 +947,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior energyarm) rider-post) ) @@ -976,7 +954,6 @@ (defstate energyarm-fall (energyarm) :enter (behavior () (set! (-> self x-fall-rotation osc target) 1.0) - (none) ) :trans (behavior () (update! (-> self x-fall-rotation) 0.0) @@ -989,7 +966,6 @@ ) ) (energyarm-trans) - (none) ) :code (behavior () (loop @@ -999,14 +975,13 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior energyarm) rider-post) ) (defstate energyarm-idle (energyarm) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('stop) (go energyarm-stop) ) @@ -1048,7 +1023,6 @@ ) ) ) - (none) ) :code (behavior () (let ((gp-0 (-> self skel root-channel 0))) @@ -1066,7 +1040,6 @@ (ja :num! (loop! f0-9)) ) ) - (none) ) :post (the-as (function none :behavior energyarm) rider-post) ) @@ -1202,13 +1175,11 @@ (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (none) ) :trans (behavior () (update! (-> self rotation-speed) 0.0) (energyhub-trans) (energyhub-set-lava-height -122880.0) - (none) ) :code (behavior () (loop @@ -1222,19 +1193,17 @@ (ja :num! (loop! f0-4)) ) ) - (none) ) :post (the-as (function none :behavior energyhub) ja-post) ) (defstate energyhub-stop (energyhub) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('flash) - (set! (-> self palette-val) 1.9921875) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('flash) + (set! (-> self palette-val) 1.9921875) + ) + ) ) :enter (behavior () (set! (-> self rotation-speed target) 0.0) @@ -1280,7 +1249,6 @@ (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (none) ) :trans (behavior () (update! (-> self rotation-speed) 0.0) @@ -1289,7 +1257,6 @@ (if (< (-> self rotation-speed value) 0.3) (go energyhub-stopped) ) - (none) ) :code (behavior () (loop @@ -1303,19 +1270,17 @@ (ja :num! (loop! f0-4)) ) ) - (none) ) :post (the-as (function none :behavior energyhub) ja-post) ) (defstate energyhub-idle (energyhub) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('flash) - (set! (-> self palette-val) 1.9921875) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('flash) + (set! (-> self palette-val) 1.9921875) + ) + ) ) :trans (behavior () (if (nonzero? (-> self sound)) @@ -1364,7 +1329,6 @@ (update! (-> self rotation-speed-offset)) (update! (-> self rotation-speed) (-> self rotation-speed-offset value)) (energyhub-trans) - (none) ) :code (behavior () (loop @@ -1378,7 +1342,6 @@ (ja :num! (loop! f0-4)) ) ) - (none) ) :post (the-as (function none :behavior energyhub) ja-post) ) @@ -1447,7 +1410,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior energylava) ja-post) ) diff --git a/goal_src/jak1/levels/lavatube/lavatube-obs.gc b/goal_src/jak1/levels/lavatube/lavatube-obs.gc index c07b6dea55e..2fa09a492a1 100644 --- a/goal_src/jak1/levels/lavatube/lavatube-obs.gc +++ b/goal_src/jak1/levels/lavatube/lavatube-obs.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype lavabase (process-drawable) () :heap-base #x40 @@ -35,7 +34,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior lavabase) ja-post) ) @@ -75,7 +73,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior lavafall) ja-post) ) @@ -115,7 +112,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior lavashortcut) ja-post) ) @@ -514,17 +510,16 @@ ) (cleanup-for-death self) (deactivate self) - (none) ) ) (defstate darkecobarrel-mover-move (darkecobarrel-mover) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (cond ((= proc *target*) - (let ((s5-0 (-> event param 0))) + (let ((s5-0 (-> block param 0))) (if (and s5-0 ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry s5-0) @@ -537,8 +532,8 @@ ) ) ) - ((>= arg1 2) - (case (-> event param 1) + ((>= argc 2) + (case (-> block param 1) (('eco-yellow) (+! (-> self hits) 1) (cond @@ -587,7 +582,6 @@ ) (update! (-> self down) (update-with-delay! (-> self down-tgt))) (darkecobarrel-mover-pos) - (none) ) :code (behavior () (let ((f30-0 0.9) @@ -603,7 +597,6 @@ (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) - (none) ) :post (the-as (function none :behavior darkecobarrel-mover) pusher-post) ) @@ -698,7 +691,6 @@ (if (nonzero? (-> self sound)) (update! (-> self sound)) ) - (none) ) :code (behavior () (loop @@ -708,7 +700,6 @@ (ja :num! (seek!)) ) ) - (none) ) ) @@ -803,7 +794,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior lavafallsewera) ja-post) ) @@ -842,7 +832,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior lavafallsewerb) ja-post) ) @@ -1032,16 +1021,15 @@ ) (cleanup-for-death self) (deactivate self) - (none) ) ) (defstate idle (chainmine) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'touch) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'deadly)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'deadly)))) (go-virtual die) ) ) @@ -1057,7 +1045,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior chainmine) ja-post) ) @@ -1200,14 +1187,13 @@ (suspend) (cleanup-for-death self) (deactivate self) - (none) ) ) (defstate idle (lavaballoon) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (send-event proc 'heat -10.0) (go-virtual die) @@ -1220,7 +1206,6 @@ (eval-path-curve! (-> self path) (-> self root-override trans) f0-4 'interp) ) ) - (none) ) :code (behavior () (loop @@ -1230,7 +1215,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior lavaballoon) transform-post) ) @@ -1293,7 +1277,6 @@ ) ) (ja-post) - (none) ) ) @@ -1338,7 +1321,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior lavayellowtarp) ja-post) ) diff --git a/goal_src/jak1/levels/maincave/baby-spider.gc b/goal_src/jak1/levels/maincave/baby-spider.gc index 399397c9f3d..64deb0b4614 100644 --- a/goal_src/jak1/levels/maincave/baby-spider.gc +++ b/goal_src/jak1/levels/maincave/baby-spider.gc @@ -10,7 +10,6 @@ ;; DECOMP BEGINS - (deftype baby-spider-spawn-params (structure) ((hatched? symbol :offset-assert 0) (fast-start? symbol :offset-assert 4) @@ -210,14 +209,14 @@ ) ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 7] (defbehavior baby-spider-default-event-handler baby-spider ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (if (= v1-0 'victory) - (go-virtual nav-enemy-victory) - (nav-enemy-default-event-handler arg0 arg1 arg2 arg3) - ) - ) + (case arg2 + (('victory) + (go-virtual nav-enemy-victory) + ) + (else + (nav-enemy-default-event-handler arg0 arg1 arg2 arg3) + ) ) ) @@ -313,7 +312,6 @@ baby-spider-default-event-handler (ja :num! (seek!)) ) (go baby-spider-resume) - (none) ) :post (the-as (function none :behavior baby-spider) nav-enemy-simple-post) ) @@ -340,7 +338,6 @@ baby-spider-default-event-handler ) ) (go-virtual nav-enemy-idle) - (none) ) ) @@ -359,7 +356,6 @@ baby-spider-default-event-handler (set! (-> self collide-info trans quad) (-> gp-0 quad)) ) ) - (none) ) :trans (behavior () (if (nav-enemy-method-53 self) @@ -370,11 +366,9 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -390,7 +384,6 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) @@ -405,7 +398,6 @@ baby-spider-default-event-handler ) ) ) - (none) ) ) @@ -421,7 +413,6 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :code (behavior () (ja-no-eval :num! (loop!)) @@ -434,7 +425,6 @@ baby-spider-default-event-handler ) (ja-no-eval :num! (seek!)) (go-virtual nav-enemy-chase) - (none) ) ) @@ -453,7 +443,6 @@ baby-spider-default-event-handler (t9-3) ) ) - (none) ) :code (behavior () (set! (-> self target-nav-time) (-> *display* base-frame-counter)) @@ -470,12 +459,10 @@ baby-spider-default-event-handler (suspend) (ja :num! (loop!)) ) - (none) ) :post (behavior () (nav-enemy-method-52 self (target-pos 0)) (nav-enemy-travel-post) - (none) ) ) @@ -491,7 +478,6 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :code (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) ) @@ -508,7 +494,6 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :code (behavior () (set! (-> self rotate-speed) 1456355.5) @@ -536,7 +521,6 @@ baby-spider-default-event-handler ) ) ) - (none) ) ) @@ -552,7 +536,6 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -575,7 +558,6 @@ baby-spider-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -591,7 +573,6 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -601,7 +582,6 @@ baby-spider-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-victory) - (none) ) ) @@ -617,7 +597,6 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :code (-> (method-of-type nav-enemy nav-enemy-victory) code) ) @@ -641,7 +620,6 @@ baby-spider-default-event-handler (t9-1) ) ) - (none) ) ) @@ -654,7 +632,6 @@ baby-spider-default-event-handler (send-event (ppointer->process (-> self parent)) v1-2) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/maincave/dark-crystal.gc b/goal_src/jak1/levels/maincave/dark-crystal.gc index de8bb2f723a..a8bf9b4f5ce 100644 --- a/goal_src/jak1/levels/maincave/dark-crystal.gc +++ b/goal_src/jak1/levels/maincave/dark-crystal.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (deftype dark-crystal (process-drawable) ((root-override collide-shape :offset 112) (crystal-num int32 :offset-assert 176) @@ -415,8 +414,8 @@ ) (defstate dark-crystal-idle (dark-crystal) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (if (= (-> proc type) target) (level-hint-spawn @@ -437,7 +436,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -462,7 +460,6 @@ ) ) (go dark-crystal-explode) - (none) ) ) @@ -519,7 +516,6 @@ (until (not (-> self child)) (suspend) ) - (none) ) ) @@ -557,7 +553,6 @@ ) (aybabtu 2) (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak1/levels/maincave/driller-lurker.gc b/goal_src/jak1/levels/maincave/driller-lurker.gc index 4492ff057e0..45b235bbc26 100644 --- a/goal_src/jak1/levels/maincave/driller-lurker.gc +++ b/goal_src/jak1/levels/maincave/driller-lurker.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (deftype driller-lurker (process-drawable) ((root-overeride collide-shape-moving :offset 112) (hit-player? symbol :offset-assert 176) @@ -634,7 +633,6 @@ (defstate driller-lurker-debug-play-anims (driller-lurker) :code (behavior () 0 - (none) ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -646,18 +644,15 @@ (set! (-> self targ-path-speed) 0.0) (set! (-> self path-speed) 0.0) (shut-down! (-> self neck)) - (none) ) :exit (behavior () (stop! (-> self sound2)) - (none) ) :trans (behavior () (if (driller-lurker-method-25 self) (go driller-lurker-chase #t) ) (driller-lurker-method-20 self #t (the-as target #f)) - (none) ) :code (behavior () (update-trans! (-> self sound2) (-> self root-overeride trans)) @@ -689,7 +684,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -705,14 +699,12 @@ (set! (-> self targ-path-speed) 15360.0) ) (shut-down! (-> self neck)) - (none) ) :trans (behavior () (if (driller-lurker-method-25 self) (go driller-lurker-chase #t) ) (driller-lurker-method-20 self #t (the-as target #f)) - (none) ) :code (behavior () (ja-channel-push! 2 (seconds 0.2)) @@ -733,7 +725,6 @@ (ja :num-func num-func-identity :frame-num 0.0) ) ) - (none) ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -745,14 +736,12 @@ (set! (-> self path-speed) 0.0) (set! (-> self targ-path-speed) 0.0) (shut-down! (-> self neck)) - (none) ) :trans (behavior () (if (driller-lurker-method-25 self) (go driller-lurker-chase #t) ) (driller-lurker-method-20 self #t (the-as target #f)) - (none) ) :code (behavior () (set! (-> self timeout) (rand-vu-int-range 2 4)) @@ -792,7 +781,6 @@ ) ) (go driller-lurker-patrol) - (none) ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -806,7 +794,6 @@ (set! (-> self mode) (the-as uint 3)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self targ-path-speed) 23552.0) - (none) ) :trans (behavior () (if (driller-lurker-method-24 self) @@ -842,7 +829,6 @@ ) ) (driller-lurker-method-20 self #f (the-as target #t)) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-push! 2 (seconds 0.2)) @@ -858,7 +844,6 @@ (ja :num-func num-func-identity :frame-num 0.0) ) ) - (none) ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -870,7 +855,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self path-speed) 0.0) (set! (-> self targ-path-speed) 0.0) - (none) ) :trans (behavior () (cond @@ -887,7 +871,6 @@ (go driller-lurker-jammed-standing) ) (driller-lurker-method-20 self #f (the-as target #t)) - (none) ) :code (behavior () (ja-channel-push! 2 (seconds 0.2)) @@ -903,7 +886,6 @@ (ja :num-func num-func-identity :frame-num 0.0) ) ) - (none) ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -915,11 +897,9 @@ (set! (-> self path-speed) 0.0) (set! (-> self targ-path-speed) 0.0) (shut-down! (-> self neck)) - (none) ) :trans (behavior () (driller-lurker-method-20 self #f (the-as target #f)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -939,7 +919,6 @@ (go driller-lurker-patrol) ) ) - (none) ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -964,7 +943,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior driller-lurker) ja-post) ) diff --git a/goal_src/jak1/levels/maincave/gnawer.gc b/goal_src/jak1/levels/maincave/gnawer.gc index 7592031db1a..a43d5f0f963 100644 --- a/goal_src/jak1/levels/maincave/gnawer.gc +++ b/goal_src/jak1/levels/maincave/gnawer.gc @@ -12,7 +12,6 @@ ;; DECOMP BEGINS - (deftype gnawer-falling-segment (process-drawable) ((transv vector :inline :offset-assert 176) (facing-rot vector :inline :offset-assert 192) @@ -329,7 +328,6 @@ (seek! (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame))) (set! (-> self root scale y) (-> self root scale x)) (set! (-> self root scale z) (-> self root scale x)) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -345,7 +343,6 @@ (suspend) (ja :num! (seek!)) ) - (none) ) :post (the-as (function none :behavior gnawer-falling-segment) ja-post) ) @@ -801,14 +798,14 @@ ) (defstate gnawer-chewing-on-post (gnawer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (if (= (-> proc type) target) (send-event proc 'shove - (-> event param 0) + (-> block param 0) (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) ) ) @@ -822,13 +819,11 @@ ) :exit (behavior () (stop! (-> self sound2)) - (none) ) :trans (behavior () (if (and *target* (>= 81920.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) (go gnawer-retreat-into-post) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -912,7 +907,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior gnawer) transform-post) ) @@ -920,7 +914,6 @@ (defstate gnawer-retreat-into-post (gnawer) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) @@ -932,7 +925,6 @@ ) (quaternion-identity! (-> self root-override quat)) (go gnawer-wait-to-run) - (none) ) :post (the-as (function none :behavior gnawer) transform-post) ) @@ -948,20 +940,19 @@ ) ) (go gnawer-run) - (none) ) ) (defstate gnawer-run (gnawer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('touch) (if (= (-> proc type) target) (send-event proc 'shove - (-> event param 0) + (-> block param 0) (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) ) ) @@ -972,7 +963,7 @@ (send-event proc 'attack - (-> event param 0) + (-> block param 0) (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) ) ) @@ -980,7 +971,7 @@ (if (< (- (-> *display* base-frame-counter) (-> self last-hit-time)) (seconds 0.5)) (return #f) ) - (let* ((a2-1 (the-as object (-> event param 0))) + (let* ((a2-1 (the-as object (-> block param 0))) (v1-19 (-> (get-touched-prim (-> (the-as touching-shapes-entry a2-1) head) (-> self root-override) @@ -1009,12 +1000,10 @@ (gnawer-method-24 self) (set! (-> self last-hit-time) (-> *display* base-frame-counter)) (gnawer-method-26 self) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (stop! (-> self sound)) - (none) ) :trans (behavior () (+! (-> self route-dist) (* (-> self speed) (-> *display* seconds-per-frame))) @@ -1022,7 +1011,6 @@ (go gnawer-wait-to-run) ) (update! (-> self sound)) - (none) ) :code (behavior () (local-vars (v1-19 symbol) (v1-35 symbol)) @@ -1050,7 +1038,6 @@ ) (ja :group! gnawer-run-ja :num! min) ) - (none) ) :post (the-as (function none :behavior gnawer) transform-post) ) @@ -1065,7 +1052,6 @@ (vector-normalize! (-> self root-override transv) 1.0) (set! (-> self root-override transv y) 0.3) (vector-normalize! (-> self root-override transv) 32768.0) - (none) ) :trans (behavior () (+! (-> self root-override transv y) (* -409600.0 (-> *display* seconds-per-frame))) @@ -1081,7 +1067,6 @@ (vector+! (-> self root-override trans) (-> self root-override trans) gp-0) ) (spool-push *art-control* "maincavecam-gnawer-fuel-cell" 0 self -1.0) - (none) ) :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) @@ -1094,25 +1079,22 @@ (ja :num! (seek!)) ) (go gnawer-dying-give-pickups) - (none) ) :post (the-as (function none :behavior gnawer) ja-post) ) (defstate gnawer-dying-give-pickups (gnawer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (if (and (= (-> proc type) money) (= (-> event param 0) 'pickup)) - (gnawer-method-30 self (the-as process-drawable proc)) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (if (and (= (-> proc type) money) (= (-> block param 0) 'pickup)) + (gnawer-method-30 self (the-as process-drawable proc)) + ) + ) + ) ) :trans (behavior () (spool-push *art-control* "maincavecam-gnawer-fuel-cell" 0 self -1.0) - (none) ) :code (behavior () (local-vars (sv-128 symbol)) @@ -1166,29 +1148,27 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) (defstate gnawer-give-fuel-cell (gnawer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (cond - ((and (= (-> proc type) maincavecam) (= (-> event param 0) 'die)) - (process-entity-status! self (entity-perm-status bit-3) #f) - (let ((v0-0 (the-as uint (logior (-> self mask) (process-mask actor-pause))))) - (set! (-> self mask) (the-as process-mask v0-0)) - v0-0 - ) - ) - ((and (= (-> proc type) money) (= (-> event param 0) 'pickup)) - (gnawer-method-30 self (the-as process-drawable proc)) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (cond + ((and (= (-> proc type) maincavecam) (= (-> block param 0) 'die)) + (process-entity-status! self (entity-perm-status bit-3) #f) + (let ((v0-0 (the-as uint (logior (-> self mask) (process-mask actor-pause))))) + (set! (-> self mask) (the-as process-mask v0-0)) + v0-0 ) + ) + ((and (= (-> proc type) money) (= (-> block param 0) 'pickup)) + (gnawer-method-30 self (the-as process-drawable proc)) + ) + ) + ) + ) ) :code (behavior () (when (not (task-complete? *game-info* (-> self entity extra perm task))) @@ -1234,20 +1214,18 @@ (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self mask) (process-mask actor-pause)) (cleanup-for-death self) - (none) ) ) (defstate gnawer-put-items-at-dest (gnawer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (if (and (= (-> proc type) money) (= (-> event param 0) 'pickup)) - (gnawer-method-30 self (the-as process-drawable proc)) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (if (and (= (-> proc type) money) (= (-> block param 0) 'pickup)) + (gnawer-method-30 self (the-as process-drawable proc)) + ) + ) + ) ) :code (behavior () (set! (-> self draw origin-joint-index) (the-as uint 0)) @@ -1293,7 +1271,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak1/levels/maincave/maincave-obs.gc b/goal_src/jak1/levels/maincave/maincave-obs.gc index 6721a32d032..f9d23340408 100644 --- a/goal_src/jak1/levels/maincave/maincave-obs.gc +++ b/goal_src/jak1/levels/maincave/maincave-obs.gc @@ -63,7 +63,6 @@ ) ) (go-virtual pov-camera-done-playing) - (none) ) ) @@ -127,22 +126,21 @@ ) (defstate cavecrusher-idle (cavecrusher) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch 'attack) - (when (= (-> proc type) target) - (if ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry (-> event param 0)) - (-> *target* control) - (collide-action solid) - (collide-action) - ) - (the-as symbol (target-attack-up *target* 'attack-or-shove 'deadlyup)) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (when (= (-> proc type) target) + (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry (-> block param 0)) + (-> *target* control) + (collide-action solid) + (collide-action) + ) + (target-attack-up *target* 'attack-or-shove 'deadlyup) + ) + ) + ) + ) ) :code (behavior () (loop @@ -153,7 +151,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior cavecrusher) ja-post) ) @@ -216,8 +213,8 @@ (defstate idle (cavetrapdoor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (when (= (-> proc type) target) (when (>= (- (-> (target-pos 0) y) (-> self root-override trans y)) 409.6) @@ -236,7 +233,6 @@ (ja :num! (seek!)) ) (anim-loop) - (none) ) ) @@ -302,7 +298,6 @@ (ja :num! (seek!)) ) (go-virtual idle) - (none) ) :post (the-as (function none :behavior cavetrapdoor) pusher-post) ) @@ -427,12 +422,12 @@ ) (defstate caveflamepots-active (caveflamepots) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (when (= (-> proc type) target) (when ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> *target* control) (collide-action solid) (collide-action) @@ -446,13 +441,13 @@ (send-event proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((mode 'burn) (vector (-> s4-0 vector)) (shove-up (-> s4-0 shove-up)))) ) (send-event proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((mode 'burn) (shove-up (meters 0)) (shove-back (meters 2)) @@ -511,14 +506,12 @@ ) ) ) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -681,14 +674,12 @@ (let ((f0-0 (get-current-phase (-> self sync)))) (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (* -65536.0 f0-0)) ) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior cavespatula) rider-post) ) @@ -793,14 +784,12 @@ (let ((f0-0 (get-current-phase (-> self sync)))) (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (* -65536.0 f0-0)) ) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior cavespatulatwo) rider-post) ) @@ -929,26 +918,22 @@ ) (defstate caveelevator-cycle-active (caveelevator) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (activate! (-> self smush) -1.0 60 150 1.0 1.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (activate! (-> self smush) -1.0 60 150 1.0 1.0) + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (rider-trans) (caveelevator-method-20 self) - (none) ) :code (behavior () (loop @@ -961,18 +946,16 @@ ) (suspend) ) - (none) ) :post (behavior () (rider-post) (caveelevator-method-21 self) - (none) ) ) (defstate caveelevator-one-way-idle-start (caveelevator) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('bonk) (activate! (-> self smush) -1.0 60 150 1.0 1.0) (go caveelevator-one-way-travel-to-end) @@ -989,7 +972,6 @@ :trans (behavior () (rider-trans) (caveelevator-method-20 self) - (none) ) :code (behavior () (ja :group! (-> (the-as art-joint-anim (+ (* (-> self anim 0) 4) (the-as int (-> self draw art-group)))) @@ -1000,36 +982,30 @@ (loop (suspend) ) - (none) ) :post (behavior () (rider-post) (caveelevator-method-21 self) - (none) ) ) (defstate caveelevator-one-way-travel-to-end (caveelevator) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (activate! (-> self smush) -1.0 60 150 1.0 1.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (activate! (-> self smush) -1.0 60 150 1.0 1.0) + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (rider-trans) (caveelevator-method-20 self) - (none) ) :code (behavior () (ja :group! (-> self draw art-group data (-> self anim 0)) :num! min) @@ -1039,27 +1015,23 @@ (ja :num! (seek!)) ) (go caveelevator-one-way-idle-end) - (none) ) :post (behavior () (rider-post) (caveelevator-method-21 self) - (none) ) ) (defstate caveelevator-one-way-idle-end (caveelevator) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (activate! (-> self smush) -1.0 60 150 1.0 1.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (activate! (-> self smush) -1.0 60 150 1.0 1.0) + ) + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (cond @@ -1074,43 +1046,36 @@ ) (rider-trans) (caveelevator-method-20 self) - (none) ) :code (behavior () (ja :group! (-> self draw art-group data (-> self anim 0)) :num! max) (loop (suspend) ) - (none) ) :post (behavior () (rider-post) (caveelevator-method-21 self) - (none) ) ) (defstate caveelevator-one-way-travel-to-start (caveelevator) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (activate! (-> self smush) -1.0 60 150 1.0 1.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (activate! (-> self smush) -1.0 60 150 1.0 1.0) + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (rider-trans) (caveelevator-method-20 self) - (none) ) :code (behavior () (ja :group! (-> self draw art-group data (-> self anim 1)) :num! min) @@ -1120,12 +1085,10 @@ (ja :num! (seek!)) ) (go caveelevator-one-way-idle-start) - (none) ) :post (behavior () (rider-post) (caveelevator-method-21 self) - (none) ) ) diff --git a/goal_src/jak1/levels/maincave/mother-spider-egg.gc b/goal_src/jak1/levels/maincave/mother-spider-egg.gc index 301adfc6183..cbbccdb3fc1 100644 --- a/goal_src/jak1/levels/maincave/mother-spider-egg.gc +++ b/goal_src/jak1/levels/maincave/mother-spider-egg.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (deftype mother-spider-egg (process-drawable) ((parent-override (pointer mother-spider) :offset 12) (root-override collide-shape-moving :offset 112) @@ -216,8 +215,8 @@ ) (defstate mother-spider-egg-falling (mother-spider-egg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (go mother-spider-egg-die-while-falling) ) @@ -225,7 +224,6 @@ ) :enter (behavior () (set! (-> self falling-start-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (let ((f30-0 @@ -244,7 +242,6 @@ ) ) (draw-egg-shadow self (-> self shadow-pos) #t) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -255,44 +252,39 @@ (ja :num! (seek! max (-> self anim-speed))) ) ) - (none) ) :post (the-as (function none :behavior mother-spider-egg) transform-post) ) (defstate mother-spider-egg-on-ground (mother-spider-egg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (the-as object (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> event param 0)) - 0.7 - 6144.0 - 16384.0 - ) - ) - ) - (('attack) - (go mother-spider-egg-die) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (send-shove-back + (-> self root-override) + proc + (the-as touching-shapes-entry (-> block param 0)) + 0.7 + 6144.0 + 16384.0 + ) + ) + (('attack) + (go mother-spider-egg-die) + ) + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (if (not (draw-egg-shadow self (-> self shadow-pos) #t)) (set! (-> self shadow-pos quad) (-> self fall-dest quad)) ) - (none) ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) (go mother-spider-egg-hatch) ) (draw-egg-shadow self (-> self shadow-pos) #f) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -328,7 +320,6 @@ (ja :num! (seek! max (-> self anim-speed))) ) ) - (none) ) :post (the-as (function none :behavior mother-spider-egg) transform-post) ) @@ -348,7 +339,6 @@ ) ) ) - (none) ) :code (behavior () (send-event (ppointer->process (-> self parent-override)) 'trigger) @@ -376,7 +366,6 @@ ) 0 (go mother-spider-egg-die-exit) - (none) ) :post (the-as (function none :behavior mother-spider-egg) transform-post) ) @@ -408,7 +397,6 @@ (ja :num! (seek!)) ) (go mother-spider-egg-die-exit) - (none) ) :post (the-as (function none :behavior mother-spider-egg) ja-post) ) @@ -421,7 +409,6 @@ ) (eval-position! (-> self traj) f0-2 (-> self root-override trans)) ) - (none) ) :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) @@ -449,7 +436,6 @@ (ja :num! (seek!)) ) (go mother-spider-egg-die-exit) - (none) ) :post (the-as (function none :behavior mother-spider-egg) ja-post) ) @@ -468,7 +454,6 @@ (until (not (-> self child)) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/maincave/mother-spider-proj.gc b/goal_src/jak1/levels/maincave/mother-spider-proj.gc index 5368e955aff..c89f4312bc1 100644 --- a/goal_src/jak1/levels/maincave/mother-spider-proj.gc +++ b/goal_src/jak1/levels/maincave/mother-spider-proj.gc @@ -384,7 +384,6 @@ (sound-play "mother-hit") (suspend) (go-virtual projectile-die) - (none) ) ) @@ -407,6 +406,5 @@ ) (suspend) (go-virtual projectile-die) - (none) ) ) diff --git a/goal_src/jak1/levels/maincave/mother-spider.gc b/goal_src/jak1/levels/maincave/mother-spider.gc index f51e4ac9271..e20b890302a 100644 --- a/goal_src/jak1/levels/maincave/mother-spider.gc +++ b/goal_src/jak1/levels/maincave/mother-spider.gc @@ -10,7 +10,6 @@ ;; DECOMP BEGINS - (defskelgroup *mother-spider-sg* mother-spider mother-spider-lod0-jg -1 ((mother-spider-lod0-mg (meters 20)) (mother-spider-lod1-mg (meters 40)) @@ -139,7 +138,6 @@ (seek! (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame))) (set! (-> self root scale y) (-> self root scale x)) (set! (-> self root scale z) (-> self root scale x)) - (none) ) ) :code (behavior () @@ -159,7 +157,6 @@ (ja :num! (seek! max f30-0)) ) ) - (none) ) :post (the-as (function none :behavior mother-spider-leg) ja-post) ) @@ -170,7 +167,6 @@ (until (not (-> self child)) (suspend) ) - (none) ) :post (the-as (function none :behavior mother-spider) ja-post) ) @@ -818,27 +814,23 @@ (shut-down! (-> self neck)) (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self draw status) (draw-status hidden)) - (none) ) :exit (behavior () (restore-collide-with-as (-> self root-override)) (set! (-> self skel postbind-function) mother-spider-full-joint-callback) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (if (grab-player? self) (go mother-spider-traveling (the-as uint 1)) ) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -879,7 +871,6 @@ (set! (-> self mode) arg0) (set! (-> self hit?) #f) (set! (-> self going-up?) (< (-> self targ-dist-from-anchor) (-> self dist-from-anchor))) - (none) ) :trans (behavior () (let ((gp-0 (is-player-stuck? self)) @@ -934,7 +925,6 @@ ) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior ((arg0 uint)) (local-vars (v1-12 symbol) (v1-28 symbol)) @@ -961,7 +951,6 @@ ) (ja :group! mother-spider-lowering-ja :num! min) ) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -970,14 +959,12 @@ :event mother-spider-default-event-handler :enter (behavior () (set! (-> self hit?) #f) - (none) ) :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-tracking) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1001,7 +988,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -1012,7 +998,6 @@ (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self last-player-in-air-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (-> self hit?) @@ -1077,7 +1062,6 @@ ) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior () (cond @@ -1099,7 +1083,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -1108,7 +1091,6 @@ :event mother-spider-default-event-handler :enter (behavior () (set! (-> self hit?) #f) - (none) ) :trans (behavior () (if (-> self hit?) @@ -1119,7 +1101,6 @@ (go mother-spider-tracking) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1136,7 +1117,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -1146,14 +1126,12 @@ :enter (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-tracking) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.25)) @@ -1213,7 +1191,6 @@ (go mother-spider-tracking) (go mother-spider-traveling (the-as uint 2)) ) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -1223,7 +1200,6 @@ :enter (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (-> self hit?) @@ -1253,7 +1229,6 @@ (go mother-spider-birth-baby) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior () (cond @@ -1275,7 +1250,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -1285,7 +1259,6 @@ :enter (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (-> self hit?) @@ -1298,7 +1271,6 @@ (go mother-spider-birthing) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.25)) @@ -1323,7 +1295,6 @@ ) ) (go mother-spider-birthing) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -1414,7 +1385,6 @@ :event mother-spider-default-event-handler :enter (behavior () (set! (-> self hit?) #f) - (none) ) :trans (behavior () (if (-> self hit?) @@ -1424,7 +1394,6 @@ (go mother-spider-birthing) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1441,7 +1410,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -1476,11 +1444,9 @@ ) ) ) - (none) ) :trans (behavior () (mother-spider-method-29 self #f #f) - (none) ) :code (behavior () (let ((v1-2 (-> self entity extra perm))) @@ -1496,7 +1462,6 @@ (ja :num! (seek!)) ) (go mother-spider-die-wait-for-children) - (none) ) :post (the-as (function none :behavior mother-spider) ja-post) ) @@ -1505,7 +1470,6 @@ :event mother-spider-death-event-handler :trans (behavior () (mother-spider-method-29 self #f #f) - (none) ) :code (behavior () (let ((v1-2 (-> self entity extra perm))) @@ -1522,7 +1486,6 @@ (ja :num! (seek!)) ) (go mother-spider-die-wait-for-children) - (none) ) :post (the-as (function none :behavior mother-spider) ja-post) ) @@ -1538,7 +1501,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak1/levels/maincave/spiderwebs.gc b/goal_src/jak1/levels/maincave/spiderwebs.gc index debbe4256b7..b4b131f3bab 100644 --- a/goal_src/jak1/levels/maincave/spiderwebs.gc +++ b/goal_src/jak1/levels/maincave/spiderwebs.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (define *spider-jump-mods* (new 'static 'surface :name 'jump :turnv 131072.0 @@ -99,7 +98,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -119,7 +117,6 @@ (ja :num! (seek!)) ) (go spiderwebs-idle) - (none) ) :post (the-as (function none :behavior spiderwebs) transform-post) ) diff --git a/goal_src/jak1/levels/misty/babak-with-cannon.gc b/goal_src/jak1/levels/misty/babak-with-cannon.gc index a3c747507f0..68ce1e37572 100644 --- a/goal_src/jak1/levels/misty/babak-with-cannon.gc +++ b/goal_src/jak1/levels/misty/babak-with-cannon.gc @@ -42,7 +42,6 @@ nav-enemy-default-event-handler ) (go-virtual nav-enemy-patrol) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -53,7 +52,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) (anim-loop) - (none) ) :post (the-as (function none :behavior babak-with-cannon) #f) ) @@ -89,7 +87,6 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-notice) ) ) - (none) ) :code (-> (method-of-type babak nav-enemy-patrol) code) ) @@ -103,7 +100,6 @@ nav-enemy-default-event-handler (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self nav destination-pos quad) (-> self entity extra trans quad)) (set! (-> self nav target-pos quad) (-> self entity extra trans quad)) - (none) ) :trans (behavior () (if (nav-enemy-notice-player?) @@ -112,7 +108,6 @@ nav-enemy-default-event-handler (if (logtest? (nav-control-flags navcf19) (-> self nav flags)) (go babak-with-cannon-jump-onto-cannon) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -123,11 +118,9 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) ) - (none) ) :post (behavior () (nav-enemy-travel-post) - (none) ) ) @@ -185,7 +178,6 @@ nav-enemy-default-event-handler ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -247,7 +239,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) (go babak-with-cannon-shooting) - (none) ) :post (the-as (function none :behavior babak-with-cannon) nav-enemy-jump-post) ) @@ -259,7 +250,6 @@ nav-enemy-default-event-handler ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -281,7 +271,6 @@ nav-enemy-default-event-handler (set-current-poly! (-> self nav) a1-6) ) (go-virtual nav-enemy-jump-land) - (none) ) :post (the-as (function none :behavior babak-with-cannon) nav-enemy-jump-post) ) @@ -298,7 +287,6 @@ nav-enemy-default-event-handler (logior! (-> v1-2 extra perm status) (entity-perm-status complete)) ) ) - (none) ) :exit (behavior () (let ((v1-0 (entity-actor-lookup (-> self entity) 'alt-actor 0))) @@ -306,7 +294,6 @@ nav-enemy-default-event-handler (logclear! (-> v1-0 extra perm status) (entity-perm-status complete)) ) ) - (none) ) :trans (behavior () (let ((f0-1 (- (-> (target-pos 0) y) (-> self collide-info trans y)))) @@ -320,13 +307,11 @@ nav-enemy-default-event-handler (go babak-with-cannon-jump-off-cannon) ) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post babak-with-cannon-ride-cannon-post ) @@ -349,7 +334,6 @@ nav-enemy-default-event-handler (t9-3) ) ) - (none) ) ) @@ -388,7 +372,6 @@ nav-enemy-default-event-handler ) ) (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak1/levels/misty/balloonlurker.gc b/goal_src/jak1/levels/misty/balloonlurker.gc index 783a5d3e6a3..dc4a8ee1ce8 100644 --- a/goal_src/jak1/levels/misty/balloonlurker.gc +++ b/goal_src/jak1/levels/misty/balloonlurker.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defpartgroup group-balloonlurker-pilot-death :id 203 :duration (seconds 0.017) @@ -692,7 +691,6 @@ :trans (behavior () (ja :num! (loop!)) (set! (-> self anim-frame) (ja-frame-num 0)) - (none) ) :code (behavior () (when (not (ja-group? balloonlurker-idle-ja)) @@ -702,7 +700,6 @@ ) (ja-post) (anim-loop) - (none) ) :post balloonlurker-post ) @@ -740,7 +737,6 @@ (go balloonlurker-die) (go balloonlurker-patrol) ) - (none) ) :post balloonlurker-post ) @@ -751,7 +747,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self vulnerable) #f) (set! (-> self dead) #t) - (none) ) :code (behavior () (local-vars (v1-27 symbol) (sv-16 symbol) (sv-20 (pointer process-tree)) (sv-24 entity-actor)) @@ -804,7 +799,6 @@ (while (-> self child) (suspend) ) - (none) ) :post balloonlurker-post ) @@ -829,8 +823,8 @@ ) (defstate balloonlurker-pilot-idle (balloonlurker-pilot) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (send-event (ppointer->process (-> self parent-override)) 'die) (go balloonlurker-pilot-die) @@ -845,14 +839,12 @@ (suspend) (ja :num-func num-func-identity :frame-num (-> self parent-override 0 anim-frame)) ) - (none) ) :post (behavior () (set! (-> self root-override trans quad) (-> self parent-override 0 root-overlay trans quad)) (quaternion-copy! (-> self root-override quat) (-> self parent-override 0 root-overlay quat)) (update-transforms! (-> self root-override)) (ja-post) - (none) ) ) @@ -886,7 +878,6 @@ (ja :num! (seek!)) ) (cleanup-for-death self) - (none) ) :post (behavior () (vector-v++! @@ -895,7 +886,6 @@ ) (integrate-no-collide! (-> self root-override) (-> self root-override transv)) (ja-post) - (none) ) ) diff --git a/goal_src/jak1/levels/misty/bonelurker.gc b/goal_src/jak1/levels/misty/bonelurker.gc index 2db080bbe5e..95f6cf93823 100644 --- a/goal_src/jak1/levels/misty/bonelurker.gc +++ b/goal_src/jak1/levels/misty/bonelurker.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (deftype bonelurker (nav-enemy) ((bump-player-time time-frame :offset-assert 400) ) @@ -42,19 +41,18 @@ ) (defmethod touch-handler bonelurker ((obj bonelurker) (arg0 process) (arg1 event-message-block)) - (the-as object (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) - ) - (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (set! (-> obj speed-scale) 0.5) - #t - ) - ) - ) + (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) + ) + (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) + (set! (-> obj speed-scale) 0.5) + #t + ) + ) ) (defmethod attack-handler bonelurker ((obj bonelurker) (arg0 process) (arg1 event-message-block)) @@ -66,45 +64,42 @@ (set! (-> a1-1 message) 'query) (set! (-> a1-1 param 0) (the-as uint 'powerup)) (set! (-> a1-1 param 1) (the-as uint 2)) - (the-as - object - (cond - ((or (send-event-function *target* a1-1) (= (-> arg1 param 1) 'explode)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj nav-enemy-die)) - 'die - ) - (else - (cond - (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 2) - ) - (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) - (go bonelurker-stun) - #t - ) - ((and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) - (= (-> obj skel root-channel 0) (-> obj skel channel)) - (let ((v1-30 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-30 (-> obj draw art-group data 9)) (= v1-30 (-> obj draw art-group data 10))) - ) - ) - (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) - (set! (-> obj bump-player-time) (-> *display* base-frame-counter)) - (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) - 'push - ) + (cond + ((or (send-event-function *target* a1-1) (= (-> arg1 param 1) 'explode)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (go (method-of-object obj nav-enemy-die)) + 'die + ) + (else + (cond + (((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 2) ) + (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) + (go bonelurker-stun) + #t + ) + ((and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) + (= (-> obj skel root-channel 0) (-> obj skel channel)) + (let ((v1-30 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (or (= v1-30 (-> obj draw art-group data 9)) (= v1-30 (-> obj draw art-group data 10))) + ) + ) + (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) + (set! (-> obj bump-player-time) (-> *display* base-frame-counter)) + (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + 'push + ) ) ) ) @@ -113,18 +108,17 @@ ) (defbehavior bonelurker-stunned-event-handler bonelurker ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('attack) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (nav-enemy-set-hit-from-direction arg0) - (send-event arg0 'get-attack-count 1) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual nav-enemy-die) - 'die - ) - ) - ) - ) + (case arg2 + (('attack) + (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (nav-enemy-set-hit-from-direction arg0) + (send-event arg0 'get-attack-count 1) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual nav-enemy-die) + 'die + ) + ) + ) ) nav-enemy-default-event-handler @@ -166,12 +160,10 @@ nav-enemy-default-event-handler ) :exit (behavior () (bonelurker-set-large-bounds-sphere) - (none) ) :code (behavior () (bonelurker-set-small-bounds-sphere) ((the-as (function none :behavior bonelurker) (-> (method-of-type nav-enemy nav-enemy-idle) code))) - (none) ) ) @@ -184,7 +176,6 @@ nav-enemy-default-event-handler :code (behavior () (ja-channel-push! 1 (seconds 0.2)) ((the-as (function none :behavior bonelurker) (-> (method-of-type nav-enemy nav-enemy-patrol) code))) - (none) ) ) @@ -210,7 +201,6 @@ nav-enemy-default-event-handler ) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) ) - (none) ) :code (behavior () (set! (-> self rotate-speed) 524288.0) @@ -275,7 +265,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) ) @@ -336,7 +325,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) ) @@ -389,7 +377,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -406,11 +393,9 @@ nav-enemy-default-event-handler :event bonelurker-stunned-event-handler :enter (behavior () (nav-enemy-neck-control-inactive) - (none) ) :exit (behavior () (nav-enemy-neck-control-look-at) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -425,7 +410,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-chase) - (none) ) :post bonelurker-push-post ) @@ -444,11 +428,11 @@ nav-enemy-default-event-handler :neck-joint 5 :player-look-at-joint 5 :run-travel-speed (meters 6) - :run-rotate-speed (degrees 2880.0) + :run-rotate-speed (degrees 2880) :run-acceleration (meters 1) :run-turn-time (seconds 0.1) :walk-travel-speed (meters 3) - :walk-rotate-speed (degrees 2880.0) + :walk-rotate-speed (degrees 2880) :walk-acceleration (meters 1) :walk-turn-time (seconds 0.1) :attack-shove-back (meters 3) diff --git a/goal_src/jak1/levels/misty/misty-conveyor.gc b/goal_src/jak1/levels/misty/misty-conveyor.gc index 130829f1ac4..e2737377b41 100644 --- a/goal_src/jak1/levels/misty/misty-conveyor.gc +++ b/goal_src/jak1/levels/misty/misty-conveyor.gc @@ -12,7 +12,6 @@ ;; DECOMP BEGINS - (defpartgroup group-keg-bounce :id 197 :duration (seconds 0.035) @@ -132,27 +131,26 @@ ) (defbehavior keg-event-handler keg ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('touch 'attack) - (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) - (sound-play "icrate-break") - (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 71) - 20 - #f - #f - #f - (-> self root-override trans) - :to *entity-pool* - ) - (sound-stop (-> self sound-id)) - (deactivate self) - ) - ) - ) - ) + (case arg2 + (('touch 'attack) + (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + (sound-play "icrate-break") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 71) + 20 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* + ) + (sound-stop (-> self sound-id)) + (deactivate self) + ) + ) + ) ) (defbehavior keg-post keg () @@ -169,8 +167,8 @@ ) (defstate keg-on-paddle (keg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('detach) (go keg-paddle-to-path) ) @@ -188,7 +186,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (suspend) ) - (none) ) :post (the-as (function none :behavior keg) keg-post) ) @@ -223,7 +220,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior keg) keg-post) ) @@ -339,7 +335,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior keg) keg-post) ) @@ -379,7 +374,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior keg) keg-post) ) @@ -389,7 +383,6 @@ :code (behavior () (sound-stop (-> self sound-id)) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior keg) transform-post) ) @@ -463,7 +456,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior keg-conveyor) ja-post) ) @@ -529,7 +521,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior keg-conveyor-paddle) transform-post) ) diff --git a/goal_src/jak1/levels/misty/misty-obs.gc b/goal_src/jak1/levels/misty/misty-obs.gc index 74bef464ebe..3d9a8048760 100644 --- a/goal_src/jak1/levels/misty/misty-obs.gc +++ b/goal_src/jak1/levels/misty/misty-obs.gc @@ -1043,7 +1043,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior boatpaddle) ja-post) ) @@ -1102,7 +1101,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior windturbine) ja-post) ) @@ -1196,7 +1194,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior mis-bone-bridge) transform-post) ) @@ -1211,7 +1208,6 @@ (ja :num! (seek!)) ) (go mis-bone-bridge-idle) - (none) ) :post (the-as (function none :behavior mis-bone-bridge) rider-post) ) @@ -1230,7 +1226,6 @@ (ja :num! (seek!)) ) (go mis-bone-bridge-idle) - (none) ) :post (the-as (function none :behavior mis-bone-bridge) rider-post) ) @@ -1263,7 +1258,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior mis-bone-bridge) rider-post) ) @@ -1362,8 +1356,8 @@ (defstate breakaway-idle (breakaway) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (send-event proc 'no-look-around (seconds 1.5)) (go breakaway-about-to-fall) @@ -1405,7 +1399,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior breakaway) rider-post) ) @@ -1426,7 +1419,6 @@ ) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior breakaway) rider-post) ) @@ -1599,13 +1591,11 @@ :virtual #t :enter (behavior () (ja-channel-set! 0) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior bone-platform) ja-post) ) @@ -1634,7 +1624,6 @@ (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1643,7 +1632,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior bone-platform) rigid-body-platform-post) ) @@ -1771,7 +1759,6 @@ ) ) (go-virtual battlecontroller-active) - (none) ) ) @@ -1839,8 +1826,8 @@ (defstate boat-fuelcell-idle (boat-fuelcell) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('task-complete) (set! (-> self play-cutscene?) #t) (process-entity-status! self (entity-perm-status complete) #t) @@ -1875,14 +1862,12 @@ (suspend) ) (go boat-fuelcell-die) - (none) ) ) (defstate boat-fuelcell-die (boat-fuelcell) :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak1/levels/misty/misty-teetertotter.gc b/goal_src/jak1/levels/misty/misty-teetertotter.gc index 3b972b44e40..9d85ff58321 100644 --- a/goal_src/jak1/levels/misty/misty-teetertotter.gc +++ b/goal_src/jak1/levels/misty/misty-teetertotter.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (deftype teetertotter (process-drawable) ((launched-player basic :offset-assert 176) (in-launch-window basic :offset-assert 180) @@ -41,10 +40,10 @@ ) (defstate teetertotter-idle (teetertotter) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (case (-> arg3 param 1) + (case (-> block param 1) (('flop) (when (target-on-end-of-teetertotter? self) (set! (-> self in-launch-window) #f) @@ -56,13 +55,7 @@ ) (('bonk) (when (target-on-end-of-teetertotter? self) - (level-hint-spawn - (text-id misty-teetertotter) - "sksp0070" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + (level-hint-spawn (text-id misty-teetertotter) "sksp0070" (the-as entity #f) *entity-pool* (game-task none)) (go teetertotter-bend) ) ) @@ -73,44 +66,40 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior teetertotter) transform-post) ) (defstate teetertotter-launch (teetertotter) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (when (= arg2 'touch) - (if (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (= message 'touch) + (if (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape-moving (-> self root)) + (the-as uint 1) + ) + (-> self rock-is-dangerous) + ) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'deadly)))) + ) + (when (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape-moving (-> self root)) - (the-as uint 1) + (the-as uint 2) ) - (-> self rock-is-dangerous) + (target-on-end-of-teetertotter? self) + (not (-> self launched-player)) + (-> self in-launch-window) ) - (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'deadly)))) - ) - (when (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root)) - (the-as uint 2) - ) - (target-on-end-of-teetertotter? self) - (not (-> self launched-player)) - (-> self in-launch-window) - ) - (when (send-event - arg0 - 'shove - #f - (static-attack-info ((shove-back (meters 0)) (shove-up (meters 13)) (angle 'jump) (control 1.0))) - ) - (let ((v0-0 #t)) - (set! (-> self launched-player) v0-0) - v0-0 - ) + (when (send-event + proc + 'shove + #f + (static-attack-info ((shove-back (meters 0)) (shove-up (meters 13)) (angle 'jump) (control 1.0))) + ) + (let ((v0-0 #t)) + (set! (-> self launched-player) v0-0) + v0-0 ) ) ) @@ -130,7 +119,6 @@ (ja :num! (seek!)) ) (go teetertotter-idle) - (none) ) :post (the-as (function none :behavior teetertotter) rider-post) ) @@ -143,7 +131,6 @@ (ja :num! (seek!)) ) (go teetertotter-idle) - (none) ) :post (the-as (function none :behavior teetertotter) rider-post) ) @@ -220,7 +207,3 @@ (go teetertotter-idle) (none) ) - - - - diff --git a/goal_src/jak1/levels/misty/misty-warehouse.gc b/goal_src/jak1/levels/misty/misty-warehouse.gc index 6b8eaf5e127..d9fd6cc57ce 100644 --- a/goal_src/jak1/levels/misty/misty-warehouse.gc +++ b/goal_src/jak1/levels/misty/misty-warehouse.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (deftype silostep (process-drawable) ((anim-limit float :offset-assert 176) (cam-tracker handle :offset-assert 184) @@ -32,8 +31,8 @@ ) (defstate silostep-idle (silostep) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go silostep-camera) ) @@ -48,7 +47,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior silostep) ja-post) ) @@ -99,7 +97,6 @@ (sound-play "arena-steps") (send-to-all-after (-> self link) 'trigger-rise) (go silostep-rise #f) - (none) ) :post (the-as (function none :behavior silostep) ja-post) ) @@ -122,7 +119,6 @@ (ja-post) (suspend) ) - (none) ) :post (the-as (function none :behavior silostep) #f) ) diff --git a/goal_src/jak1/levels/misty/mistycannon.gc b/goal_src/jak1/levels/misty/mistycannon.gc index cf442bbbd0f..cfeb58c0bc8 100644 --- a/goal_src/jak1/levels/misty/mistycannon.gc +++ b/goal_src/jak1/levels/misty/mistycannon.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype angle-tracker (structure) ((value float :offset-assert 0) (min float :offset-assert 4) @@ -657,8 +656,8 @@ ) (defstate mistycannon-missile-idle (mistycannon-missile) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (go mistycannon-missile-explode) ) @@ -668,13 +667,11 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self sfx) (the-as uint 0)) 0 - (none) ) :trans (behavior () (if (< (-> self root-override trans y) (-> self water-height)) (go mistycannon-missile-in-water) ) - (none) ) :code (behavior () (clear-collide-with-as (-> self root-override)) @@ -749,7 +746,6 @@ (ja :num! (seek!)) ) (go mistycannon-missile-explode) - (none) ) :post (behavior () (vector-v++! @@ -786,7 +782,6 @@ ) ) (ja-post) - (none) ) ) @@ -824,14 +819,13 @@ (goto cfg-3) ) (ja-channel-set! 0) - (none) ) :post (the-as (function none :behavior mistycannon-missile) ja-post) ) (defstate mistycannon-missile-explode (mistycannon-missile) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (let* ((s4-0 proc) (v1-2 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) process-drawable)) @@ -862,14 +856,14 @@ ) (cond ((= (-> proc type) target) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'explode)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'explode)))) ) (else (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) self) (set! (-> a1-4 num-params) 4) (set! (-> a1-4 message) 'attack) - (set! (-> a1-4 param 0) (-> event param 0)) + (set! (-> a1-4 param 0) (-> block param 0)) (set! (-> a1-4 param 1) (the-as uint 'explode)) (let ((v1-18 (+ *global-attack-id* 1))) (set! *global-attack-id* v1-18) @@ -916,7 +910,6 @@ ) (kill-and-free-particles (-> self part2)) (deactivate self) - (none) ) :post (the-as (function none :behavior mistycannon-missile) ja-post) ) @@ -1244,14 +1237,12 @@ (go mistycannon-aim-at-player) ) (rider-trans) - (none) ) :code (behavior () (loop (mistycannon-method-23 self) (suspend) ) - (none) ) :post (the-as (function none :behavior mistycannon) rider-post) ) @@ -1419,7 +1410,6 @@ (defstate mistycannon-aim-at-player (mistycannon) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) @@ -1433,7 +1423,6 @@ (go mistycannon-idle) ) (rider-trans) - (none) ) :code (behavior () (loop @@ -1444,17 +1433,16 @@ (mistycannon-method-23 self) (suspend) ) - (none) ) :post (the-as (function none :behavior mistycannon) rider-post) ) (defstate mistycannon-waiting-for-player (mistycannon) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self root-override) (the-as uint 1) ) @@ -1474,7 +1462,6 @@ (go mistycannon-aim-at-player) ) (rider-trans) - (none) ) :code (behavior () (set! (-> self player-touching-grips?) #f) @@ -1517,7 +1504,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior mistycannon) rider-post) ) @@ -1529,13 +1515,11 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -1550,13 +1534,12 @@ ) (suspend) ) - (none) ) ) (defstate mistycannon-player-control (mistycannon) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode) (send-event *camera* 'change-state cam-mistycannon 0) ) @@ -1565,12 +1548,10 @@ :exit (behavior () (sound-stop (-> self sound-id)) (sound-stop (-> self aim-sound-id)) - (none) ) :trans (behavior () (mistycannon-method-23 self) (rider-trans) - (none) ) :code (behavior () (send-event *camera* 'change-state cam-mistycannon 0) @@ -1642,32 +1623,29 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior mistycannon) rider-post) ) (defstate mistycannon-waiting-for-player-to-fuck-off (mistycannon) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) - (-> self root-override) - (the-as uint 1) - ) - (let ((v0-0 (-> *display* base-frame-counter))) - (set! (-> self state-time) v0-0) - v0-0 - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self root-override) + (the-as uint 1) + ) + (let ((v0-0 (-> *display* base-frame-counter))) + (set! (-> self state-time) v0-0) + v0-0 + ) + ) + ) + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (the-as (function none :behavior mistycannon) rider-trans) :code (behavior () @@ -1678,7 +1656,6 @@ (go mistycannon-waiting-for-player) ) ) - (none) ) :post (the-as (function none :behavior mistycannon) rider-post) ) diff --git a/goal_src/jak1/levels/misty/muse.gc b/goal_src/jak1/levels/misty/muse.gc index 654197aabfb..fbe116d5dc6 100644 --- a/goal_src/jak1/levels/misty/muse.gc +++ b/goal_src/jak1/levels/misty/muse.gc @@ -188,7 +188,6 @@ nav-enemy-default-event-handler (if (and *target* (>= 81920.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (go-virtual nav-enemy-chase) ) - (none) ) :code (behavior () (when (ja-group? muse-run-ja) @@ -210,7 +209,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior muse) ja-post) ) @@ -223,7 +221,6 @@ nav-enemy-default-event-handler ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (cond @@ -247,7 +244,6 @@ nav-enemy-default-event-handler ) (seek! (-> self sprint-distance) 0.0 (* 4096.0 (-> *display* seconds-per-frame))) (muse-check-dest-point) - (none) ) :code (behavior () (cond @@ -270,7 +266,6 @@ nav-enemy-default-event-handler (suspend) (ja :num! (loop! (* 0.000016276043 (-> self momentum-speed)))) ) - (none) ) :post (behavior () (set! (-> self nav destination-pos quad) (-> self dest-point quad)) @@ -285,7 +280,6 @@ nav-enemy-default-event-handler (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (nav-enemy-travel-post) - (none) ) ) @@ -298,7 +292,6 @@ nav-enemy-default-event-handler :enter (behavior () ((-> (method-of-type nav-enemy nav-enemy-jump) enter)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) - (none) ) :code (-> (method-of-type nav-enemy nav-enemy-jump) code) ) @@ -319,7 +312,6 @@ nav-enemy-default-event-handler (ja :num! (seek! max 0.8)) ) (go-virtual nav-enemy-chase) - (none) ) ) @@ -327,7 +319,6 @@ nav-enemy-default-event-handler :event (the-as (function process int symbol event-message-block object :behavior muse) #f) :trans (behavior () (spool-push *art-control* (-> self anim name) 0 self -1.0) - (none) ) :code (behavior () (sound-play "money-pickup") @@ -404,14 +395,12 @@ nav-enemy-default-event-handler ) ) ) - (none) ) :post (behavior () (nav-enemy-method-51 self) (level-hint-surpress!) (kill-current-level-hint '() '() 'exit) (ja-post) - (none) ) ) diff --git a/goal_src/jak1/levels/misty/quicksandlurker.gc b/goal_src/jak1/levels/misty/quicksandlurker.gc index b0a506b50fb..9fef9058241 100644 --- a/goal_src/jak1/levels/misty/quicksandlurker.gc +++ b/goal_src/jak1/levels/misty/quicksandlurker.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defpartgroup group-quicksandlurker-missile :id 198 :bounds (static-bspherem 0 0 0 3) @@ -302,19 +301,19 @@ (defstate quicksandlurker-missile-idle (quicksandlurker-missile) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (when (cond ((= (-> proc type) target) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'explode)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'explode)))) ) (else (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) self) (set! (-> a1-4 num-params) 4) (set! (-> a1-4 message) 'attack) - (set! (-> a1-4 param 0) (-> event param 0)) + (set! (-> a1-4 param 0) (-> block param 0)) (set! (-> a1-4 param 1) (the-as uint 'explode)) (let ((v1-12 (+ *global-attack-id* 1))) (set! *global-attack-id* v1-12) @@ -333,7 +332,6 @@ ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior () (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) @@ -362,11 +360,9 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (behavior () (update-transforms! (-> self root-override)) - (none) ) ) @@ -389,7 +385,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -568,11 +563,9 @@ :event (the-as (function process int symbol event-message-block object :behavior quicksandlurker) #f) :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (if (and *target* @@ -580,13 +573,11 @@ ) (go quicksandlurker-wait) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior quicksandlurker) ja-post) ) @@ -611,7 +602,6 @@ (seek! (-> self y-offset) 1228.8 (* 20480.0 (-> *display* seconds-per-frame))) ) ) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -644,7 +634,6 @@ (suspend) ) ) - (none) ) :post quicksandlurker-post ) @@ -658,7 +647,6 @@ (ja :num! (seek!)) ) (go quicksandlurker-wait) - (none) ) :post quicksandlurker-post ) @@ -672,7 +660,6 @@ (go quicksandlurker-wait) ) (quicksandlurker-check-hide-transition) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -701,7 +688,6 @@ (suspend) ) ) - (none) ) :post quicksandlurker-post ) @@ -750,7 +736,6 @@ ) ) (go quicksandlurker-track) - (none) ) :post quicksandlurker-post ) @@ -777,7 +762,6 @@ ) ) (go quicksandlurker-track) - (none) ) :post quicksandlurker-post ) @@ -786,11 +770,9 @@ :event quicksandlurker-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (behavior () (restore-collide-with-as (-> self root-override)) - (none) ) :trans (behavior () (if (not *target*) @@ -814,7 +796,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -839,7 +820,6 @@ (orient-to-face-target) (suspend) ) - (none) ) :post quicksandlurker-post ) @@ -865,7 +845,6 @@ (ja :num! (seek!)) ) (go quicksandlurker-track) - (none) ) :post quicksandlurker-post ) @@ -884,7 +863,6 @@ (ja :num! (seek!)) ) (cleanup-for-death self) - (none) ) :post quicksandlurker-post ) diff --git a/goal_src/jak1/levels/misty/sidekick-human.gc b/goal_src/jak1/levels/misty/sidekick-human.gc index 2e29c135978..d556653dde8 100644 --- a/goal_src/jak1/levels/misty/sidekick-human.gc +++ b/goal_src/jak1/levels/misty/sidekick-human.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype sequenceA (process-hidden) () :method-count-assert 15 @@ -1381,8 +1380,8 @@ (defstate play-anim (sequenceB) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('offset-army) (dotimes (gp-0 9) (let ((v1-3 (-> *lurker-army* gp-0))) @@ -1498,12 +1497,10 @@ 'play-anim ) ) - (none) ) :trans (behavior () (spool-push *art-control* "sidekick-human-intro-sequence-c" 0 self (the-as float -1.0)) ((-> (method-of-type process-taskable play-anim) trans)) - (none) ) ) @@ -1680,12 +1677,10 @@ ) ) (start 'play (get-continue-by-name *game-info* "village1-intro")) - (none) ) :trans (behavior () (spool-push *art-control* "sage-intro-sequence-d1" 0 self (the-as float -1.0)) ((-> (method-of-type process-taskable play-anim) trans)) - (none) ) ) diff --git a/goal_src/jak1/levels/ogre/flying-lurker.gc b/goal_src/jak1/levels/ogre/flying-lurker.gc index 33ddae960ec..db151eed999 100644 --- a/goal_src/jak1/levels/ogre/flying-lurker.gc +++ b/goal_src/jak1/levels/ogre/flying-lurker.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defskelgroup *ogrecam-sg* ogrecam ogrecam-lod0-jg -1 ((ogrecam-lod0-mg (meters 999999))) :bounds (static-spherem 0 2 0 6) @@ -155,22 +154,20 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior plunger-lurker) ja-post) ) (defstate plunger-lurker-flee (plunger-lurker) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('attack) - (let ((v0-0 #t)) - (set! (-> self got-hit) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((v0-0 #t)) + (set! (-> self got-hit) v0-0) + v0-0 + ) + ) + ) ) :trans (behavior () (when (-> self got-hit) @@ -197,7 +194,6 @@ (cleanup-for-death self) (deactivate self) ) - (none) ) :code (behavior () (ja-no-eval :group! plunger-lurker-notice-ja :num! (seek!) :frame-num 0.0) @@ -213,14 +209,13 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior plunger-lurker) ja-post) ) (defstate plunger-lurker-idle (plunger-lurker) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('plunge) (logclear! (-> self mask) (process-mask actor-pause)) (go plunger-lurker-plunge) @@ -233,7 +228,6 @@ (logclear! (-> self mask) (process-mask actor-pause)) (go plunger-lurker-flee) ) - (none) ) :code (behavior () (loop @@ -243,7 +237,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior plunger-lurker) ja-post) ) @@ -254,7 +247,6 @@ (deactivate self) (suspend) 0 - (none) ) ) @@ -438,7 +430,6 @@ :code (behavior () (cleanup-for-death self) (deactivate self) - (none) ) ) @@ -449,7 +440,6 @@ (loop (suspend) ) - (none) ) ) @@ -587,109 +577,107 @@ ) (defstate flying-lurker-fly (flying-lurker) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('clone-and-kill-links) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'sleep) - (let ((t9-0 send-event-function) - (v1-3 (-> self link next)) - ) - (t9-0 - (if v1-3 - (-> v1-3 extra process) - ) - a1-1 - ) - ) - ) - (go flying-lurker-clone (the-as handle (-> event param 0)) "") - ) - (('die) - (let ((v1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-7 from) proc) - (set! (-> v1-7 num-params) arg1) - (set! (-> v1-7 message) event-type) - (set! (-> v1-7 param 0) (-> event param 0)) - (set! (-> v1-7 param 1) (-> event param 1)) - (set! (-> v1-7 param 2) (-> event param 2)) - (set! (-> v1-7 param 3) (-> event param 3)) - (set! (-> v1-7 param 4) (-> event param 4)) - (set! (-> v1-7 param 5) (-> event param 5)) - (set! (-> v1-7 param 6) (-> event param 6)) - (let ((t9-2 send-event-function) - (a1-3 (-> self link next)) - ) - (t9-2 - (if a1-3 - (-> a1-3 extra process) - ) - v1-7 - ) - ) - ) - (cleanup-for-death self) - (the-as object (deactivate self)) - ) - (('sleep) - (let ((v1-12 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-12 from) proc) - (set! (-> v1-12 num-params) arg1) - (set! (-> v1-12 message) event-type) - (set! (-> v1-12 param 0) (-> event param 0)) - (set! (-> v1-12 param 1) (-> event param 1)) - (set! (-> v1-12 param 2) (-> event param 2)) - (set! (-> v1-12 param 3) (-> event param 3)) - (set! (-> v1-12 param 4) (-> event param 4)) - (set! (-> v1-12 param 5) (-> event param 5)) - (set! (-> v1-12 param 6) (-> event param 6)) - (let ((t9-5 send-event-function) - (a1-5 (-> self link next)) - ) - (t9-5 - (if a1-5 - (-> a1-5 extra process) - ) - v1-12 - ) - ) - ) - (go flying-lurker-sleep) - ) - (('reset) - (let ((v1-15 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-15 from) proc) - (set! (-> v1-15 num-params) arg1) - (set! (-> v1-15 message) event-type) - (set! (-> v1-15 param 0) (-> event param 0)) - (set! (-> v1-15 param 1) (-> event param 1)) - (set! (-> v1-15 param 2) (-> event param 2)) - (set! (-> v1-15 param 3) (-> event param 3)) - (set! (-> v1-15 param 4) (-> event param 4)) - (set! (-> v1-15 param 5) (-> event param 5)) - (set! (-> v1-15 param 6) (-> event param 6)) - (let ((t9-7 send-event-function) - (a1-7 (-> self link next)) - ) - (t9-7 - (if a1-7 - (-> a1-7 extra process) - ) - v1-15 - ) - ) - ) - (the-as object (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('clone-and-kill-links) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'sleep) + (let ((t9-0 send-event-function) + (v1-3 (-> self link next)) + ) + (t9-0 + (if v1-3 + (-> v1-3 extra process) + ) + a1-1 + ) + ) + ) + (go flying-lurker-clone (the-as handle (-> block param 0)) "") + ) + (('die) + (let ((v1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-7 from) proc) + (set! (-> v1-7 num-params) argc) + (set! (-> v1-7 message) message) + (set! (-> v1-7 param 0) (-> block param 0)) + (set! (-> v1-7 param 1) (-> block param 1)) + (set! (-> v1-7 param 2) (-> block param 2)) + (set! (-> v1-7 param 3) (-> block param 3)) + (set! (-> v1-7 param 4) (-> block param 4)) + (set! (-> v1-7 param 5) (-> block param 5)) + (set! (-> v1-7 param 6) (-> block param 6)) + (let ((t9-2 send-event-function) + (a1-3 (-> self link next)) + ) + (t9-2 + (if a1-3 + (-> a1-3 extra process) + ) + v1-7 + ) + ) + ) + (cleanup-for-death self) + (deactivate self) + ) + (('sleep) + (let ((v1-12 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-12 from) proc) + (set! (-> v1-12 num-params) argc) + (set! (-> v1-12 message) message) + (set! (-> v1-12 param 0) (-> block param 0)) + (set! (-> v1-12 param 1) (-> block param 1)) + (set! (-> v1-12 param 2) (-> block param 2)) + (set! (-> v1-12 param 3) (-> block param 3)) + (set! (-> v1-12 param 4) (-> block param 4)) + (set! (-> v1-12 param 5) (-> block param 5)) + (set! (-> v1-12 param 6) (-> block param 6)) + (let ((t9-5 send-event-function) + (a1-5 (-> self link next)) + ) + (t9-5 + (if a1-5 + (-> a1-5 extra process) + ) + v1-12 + ) + ) + ) + (go flying-lurker-sleep) + ) + (('reset) + (let ((v1-15 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-15 from) proc) + (set! (-> v1-15 num-params) argc) + (set! (-> v1-15 message) message) + (set! (-> v1-15 param 0) (-> block param 0)) + (set! (-> v1-15 param 1) (-> block param 1)) + (set! (-> v1-15 param 2) (-> block param 2)) + (set! (-> v1-15 param 3) (-> block param 3)) + (set! (-> v1-15 param 4) (-> block param 4)) + (set! (-> v1-15 param 5) (-> block param 5)) + (set! (-> v1-15 param 6) (-> block param 6)) + (let ((t9-7 send-event-function) + (a1-7 (-> self link next)) + ) + (t9-7 + (if a1-7 + (-> a1-7 extra process) + ) + v1-15 + ) + ) + ) + (deactivate self) + ) + ) ) :enter (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (flying-lurker-method-20 self) @@ -721,7 +709,6 @@ ) ) ) - (none) ) :code (behavior () (loop @@ -749,7 +736,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior flying-lurker) ja-post) ) @@ -937,7 +923,6 @@ :event flying-lurker-handler :exit (behavior () (remove-setting! 'allow-progress) - (none) ) :code (behavior () (when (play-movie?) @@ -972,126 +957,120 @@ ) ) ) - (none) ) :post (the-as (function none :behavior flying-lurker) ja-post) ) (defstate flying-lurker-clone (flying-lurker) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'die) - (let ((v1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-1 from) proc) - (set! (-> v1-1 num-params) arg1) - (set! (-> v1-1 message) event-type) - (set! (-> v1-1 param 0) (-> event param 0)) - (set! (-> v1-1 param 1) (-> event param 1)) - (set! (-> v1-1 param 2) (-> event param 2)) - (set! (-> v1-1 param 3) (-> event param 3)) - (set! (-> v1-1 param 4) (-> event param 4)) - (set! (-> v1-1 param 5) (-> event param 5)) - (set! (-> v1-1 param 6) (-> event param 6)) - (let ((t9-0 send-event-function) - (a1-1 (-> self link next)) - ) - (t9-0 - (if a1-1 - (-> a1-1 extra process) - ) - v1-1 - ) - ) - ) - (cleanup-for-death self) - (the-as object (deactivate self)) - ) - ((= v1-0 'sleep) - (let ((v1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-6 from) proc) - (set! (-> v1-6 num-params) arg1) - (set! (-> v1-6 message) event-type) - (set! (-> v1-6 param 0) (-> event param 0)) - (set! (-> v1-6 param 1) (-> event param 1)) - (set! (-> v1-6 param 2) (-> event param 2)) - (set! (-> v1-6 param 3) (-> event param 3)) - (set! (-> v1-6 param 4) (-> event param 4)) - (set! (-> v1-6 param 5) (-> event param 5)) - (set! (-> v1-6 param 6) (-> event param 6)) - (let ((t9-3 send-event-function) - (a1-3 (-> self link next)) - ) - (t9-3 - (if a1-3 - (-> a1-3 extra process) - ) - v1-6 - ) - ) - ) - (go flying-lurker-sleep) - ) - ((= v1-0 'reset) - (let ((v1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-9 from) proc) - (set! (-> v1-9 num-params) arg1) - (set! (-> v1-9 message) event-type) - (set! (-> v1-9 param 0) (-> event param 0)) - (set! (-> v1-9 param 1) (-> event param 1)) - (set! (-> v1-9 param 2) (-> event param 2)) - (set! (-> v1-9 param 3) (-> event param 3)) - (set! (-> v1-9 param 4) (-> event param 4)) - (set! (-> v1-9 param 5) (-> event param 5)) - (set! (-> v1-9 param 6) (-> event param 6)) - (let ((t9-5 send-event-function) - (a1-5 (-> self link next)) - ) - (t9-5 - (if a1-5 - (-> a1-5 extra process) - ) - v1-9 - ) - ) - ) - (the-as object (deactivate self)) - ) - (else - (flying-lurker-handler proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (let ((v1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-1 from) proc) + (set! (-> v1-1 num-params) argc) + (set! (-> v1-1 message) message) + (set! (-> v1-1 param 0) (-> block param 0)) + (set! (-> v1-1 param 1) (-> block param 1)) + (set! (-> v1-1 param 2) (-> block param 2)) + (set! (-> v1-1 param 3) (-> block param 3)) + (set! (-> v1-1 param 4) (-> block param 4)) + (set! (-> v1-1 param 5) (-> block param 5)) + (set! (-> v1-1 param 6) (-> block param 6)) + (let ((t9-0 send-event-function) + (a1-1 (-> self link next)) + ) + (t9-0 + (if a1-1 + (-> a1-1 extra process) + ) + v1-1 + ) + ) + ) + (cleanup-for-death self) + (deactivate self) + ) + (('sleep) + (let ((v1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-6 from) proc) + (set! (-> v1-6 num-params) argc) + (set! (-> v1-6 message) message) + (set! (-> v1-6 param 0) (-> block param 0)) + (set! (-> v1-6 param 1) (-> block param 1)) + (set! (-> v1-6 param 2) (-> block param 2)) + (set! (-> v1-6 param 3) (-> block param 3)) + (set! (-> v1-6 param 4) (-> block param 4)) + (set! (-> v1-6 param 5) (-> block param 5)) + (set! (-> v1-6 param 6) (-> block param 6)) + (let ((t9-3 send-event-function) + (a1-3 (-> self link next)) + ) + (t9-3 + (if a1-3 + (-> a1-3 extra process) + ) + v1-6 + ) + ) + ) + (go flying-lurker-sleep) + ) + (('reset) + (let ((v1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-9 from) proc) + (set! (-> v1-9 num-params) argc) + (set! (-> v1-9 message) message) + (set! (-> v1-9 param 0) (-> block param 0)) + (set! (-> v1-9 param 1) (-> block param 1)) + (set! (-> v1-9 param 2) (-> block param 2)) + (set! (-> v1-9 param 3) (-> block param 3)) + (set! (-> v1-9 param 4) (-> block param 4)) + (set! (-> v1-9 param 5) (-> block param 5)) + (set! (-> v1-9 param 6) (-> block param 6)) + (let ((t9-5 send-event-function) + (a1-5 (-> self link next)) + ) + (t9-5 + (if a1-5 + (-> a1-5 extra process) + ) + v1-9 + ) + ) + ) + (deactivate self) + ) + (else + (flying-lurker-handler proc argc message block) + ) ) ) :exit (behavior () (ja-channel-set! 0) - (none) ) :code (behavior ((arg0 handle) (arg1 string)) (clone-anim arg0 3 #t arg1) - (none) ) ) (defstate flying-lurker-idle (flying-lurker) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('saw-player) (set! (-> self take-off) #t) (when (-> self link prev) (entity-birth-no-kill (-> self link prev)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) proc) - (set! (-> a1-1 num-params) arg1) - (set! (-> a1-1 message) event-type) - (set! (-> a1-1 param 0) (-> event param 0)) - (set! (-> a1-1 param 1) (-> event param 1)) - (set! (-> a1-1 param 2) (-> event param 2)) - (set! (-> a1-1 param 3) (-> event param 3)) - (set! (-> a1-1 param 4) (-> event param 4)) - (set! (-> a1-1 param 5) (-> event param 5)) - (set! (-> a1-1 param 6) (-> event param 6)) + (set! (-> a1-1 num-params) argc) + (set! (-> a1-1 message) message) + (set! (-> a1-1 param 0) (-> block param 0)) + (set! (-> a1-1 param 1) (-> block param 1)) + (set! (-> a1-1 param 2) (-> block param 2)) + (set! (-> a1-1 param 3) (-> block param 3)) + (set! (-> a1-1 param 4) (-> block param 4)) + (set! (-> a1-1 param 5) (-> block param 5)) + (set! (-> a1-1 param 6) (-> block param 6)) (let ((t9-1 send-event-function) (v1-13 (-> self link prev)) ) @@ -1112,8 +1091,8 @@ (set! (-> a1-2 from) self) (set! (-> a1-2 num-params) 2) (set! (-> a1-2 message) 'clone) - (set! (-> a1-2 param 0) (-> event param 0)) - (set! (-> a1-2 param 1) (+ (-> event param 1) -1)) + (set! (-> a1-2 param 0) (-> block param 0)) + (set! (-> a1-2 param 1) (+ (-> block param 1) -1)) (let ((t9-3 send-event-function) (v1-25 (-> self link next)) ) @@ -1126,30 +1105,28 @@ ) ) ) - (case (-> event param 1) + (case (-> block param 1) ((2) - (go flying-lurker-clone (the-as handle (-> event param 0)) "flying-lurker-b-") + (go flying-lurker-clone (the-as handle (-> block param 0)) "flying-lurker-b-") ) ((1) - (go flying-lurker-clone (the-as handle (-> event param 0)) "flying-lurker-c-") + (go flying-lurker-clone (the-as handle (-> block param 0)) "flying-lurker-c-") ) ) ) (else - (flying-lurker-handler proc arg1 event-type event) + (flying-lurker-handler proc argc message block) ) ) ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (spool-push *art-control* "flying-lurker-intro" 0 self -99.0) (if (and (-> self take-off) (first?)) (go flying-lurker-start) ) - (none) ) :code (behavior () (local-vars (gp-0 int) (f30-0 float)) @@ -1203,7 +1180,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior flying-lurker) ja-post) ) diff --git a/goal_src/jak1/levels/ogre/ogre-obs.gc b/goal_src/jak1/levels/ogre/ogre-obs.gc index 9964a406474..8229e73c10e 100644 --- a/goal_src/jak1/levels/ogre/ogre-obs.gc +++ b/goal_src/jak1/levels/ogre/ogre-obs.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (defskelgroup *med-res-snow-sg* medres-snow medres-snow-lod0-jg medres-snow-idle-ja ((medres-snow-lod0-mg (meters 999999))) :bounds (static-spherem -390 150 70 410) @@ -341,14 +340,13 @@ (suspend) (cleanup-for-death self) (deactivate self) - (none) ) ) (defstate idle (tntbarrel) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die-big) (go-virtual die #t) ) @@ -356,7 +354,7 @@ (go-virtual die #f) ) (('attack 'touch) - (send-event proc 'attack-invinc (-> event param 0) (static-attack-info ((mode 'death)))) + (send-event proc 'attack-invinc (-> block param 0) (static-attack-info ((mode 'death)))) (go-virtual die #f) ) ) @@ -366,7 +364,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -451,18 +448,17 @@ (defstate rigid-body-platform-idle (ogre-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('trigger) - (set! (-> self triggered) (the-as entity-actor #t)) - (set! (-> self delay) (the-as time-frame (-> event param 0))) - (let ((v0-0 (-> *display* base-frame-counter))) - (set! (-> self state-time) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (set! (-> self triggered) (the-as entity-actor #t)) + (set! (-> self delay) (the-as time-frame (-> block param 0))) + (let ((v0-0 (-> *display* base-frame-counter))) + (set! (-> self state-time) v0-0) + v0-0 + ) + ) + ) ) :trans (behavior () (cond @@ -483,14 +479,12 @@ ) ) ) - (none) ) :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (loop (suspend) ) - (none) ) :post (the-as (function none :behavior ogre-plat) ja-post) ) @@ -518,14 +512,12 @@ (seek! (-> self float-height-offset) (-> self float-y-offset) (* 32768.0 (-> *display* seconds-per-frame))) ) ) - (none) ) :code (behavior () (logclear! (-> self draw status) (draw-status hidden)) (loop (suspend) ) - (none) ) :post (the-as (function none :behavior ogre-plat) rigid-body-platform-post) ) @@ -859,7 +851,6 @@ (defstate ogre-bridge-idle (ogre-bridge) :exit (behavior () (ogre-bridge-update-joints) - (none) ) :trans (behavior () (if (and (and *target* @@ -870,14 +861,12 @@ (go ogre-bridge-activate) ) 0 - (none) ) :code (behavior () (ja-post) (loop (suspend) ) - (none) ) ) @@ -906,14 +895,13 @@ (ja :num! (seek!)) ) (go ogre-bridge-activated) - (none) ) :post (the-as (function none :behavior ogre-bridge) rider-post) ) (defstate ogre-bridge-activated (ogre-bridge) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('break) (+! (-> self dead-joint-count) 4) (go ogre-bridge-break) @@ -933,37 +921,35 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior ogre-bridge) ja-post) ) (defstate ogre-bridge-break (ogre-bridge) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('effect) - (when (= (-> event param 0) 'splash) - (let ((gp-0 (new 'stack-no-clear 'vector))) - (let ((a1-1 (-> event param 2))) - (set! (-> gp-0 quad) (-> self node-list data a1-1 bone transform vector 3 quad)) - ) - (set! (-> gp-0 y) 118784.0) - (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 466) - -1 - #f - #f - #f - gp-0 - :to *entity-pool* - ) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('effect) + (when (= (-> block param 0) 'splash) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((a1-1 (-> block param 2))) + (set! (-> gp-0 quad) (-> self node-list data a1-1 bone transform vector 3 quad)) + ) + (set! (-> gp-0 y) 118784.0) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 466) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* + ) + ) + ) + ) + ) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) @@ -972,7 +958,6 @@ (ja :num! (seek!)) ) (go ogre-bridge-idle) - (none) ) :post (the-as (function none :behavior ogre-bridge) rider-post) ) @@ -1199,7 +1184,6 @@ :code (behavior () (transform-post) (anim-loop) - (none) ) ) @@ -1237,8 +1221,8 @@ (defstate water-vol-idle (ogre-lava) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('submerge1) (set! (-> self anim) 3) (go-virtual water-vol-idle) @@ -1260,7 +1244,7 @@ (go-virtual water-vol-idle) ) (else - ((-> (method-of-type water-anim water-vol-idle) event) proc arg1 event-type event) + ((-> (method-of-type water-anim water-vol-idle) event) proc argc message block) ) ) ) @@ -1279,7 +1263,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior ogre-lava) #f) ) @@ -1290,7 +1273,6 @@ (set! (-> self idle-anim) 2) (set! (-> self anim) (-> self idle-anim)) (go-virtual water-vol-idle) - (none) ) ) @@ -1445,16 +1427,15 @@ ) (cleanup-for-death self) (deactivate self) - (none) ) :post (the-as (function none :behavior shortcut-boulder) ja-post) ) (defstate shortcut-boulder-idle (shortcut-boulder) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (if (and (>= arg1 2) (= (-> event param 1) 'eco-yellow)) + (if (and (>= argc 2) (= (-> block param 1) 'eco-yellow)) (go shortcut-boulder-break) ) ) @@ -1466,7 +1447,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/ogre/ogreboss.gc b/goal_src/jak1/levels/ogre/ogreboss.gc index b2bcc32a34e..e17c90a854e 100644 --- a/goal_src/jak1/levels/ogre/ogreboss.gc +++ b/goal_src/jak1/levels/ogre/ogreboss.gc @@ -10,7 +10,6 @@ ;; DECOMP BEGINS - (defskelgroup *ogreboss-sg* ogreboss ogreboss-lod0-jg ogreboss-idle-ja ((ogreboss-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 20) @@ -94,7 +93,6 @@ (defstate ogreboss-missile-idle (ogreboss-missile) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -135,7 +133,6 @@ ) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior ogreboss-missile) transform-post) ) @@ -183,12 +180,10 @@ ) ) (cleanup-for-death self) - (none) ) :post (behavior () (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) (transform-post) - (none) ) ) @@ -233,21 +228,21 @@ ) (defstate ogreboss-missile-impact (ogreboss-missile) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (cond (#f (cond ((= (-> proc type) target) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'explode)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'explode)))) ) (else (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) self) (set! (-> a1-2 num-params) 4) (set! (-> a1-2 message) 'attack) - (set! (-> a1-2 param 0) (-> event param 0)) + (set! (-> a1-2 param 0) (-> block param 0)) (set! (-> a1-2 param 1) (the-as uint 'explode)) (let ((v1-12 (+ *global-attack-id* 1))) (set! *global-attack-id* v1-12) @@ -301,7 +296,7 @@ (the-as rgba (new 'static 'rgba :g #xff :a #x80)) ) (when (>= f30-0 0.0) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'damage)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'damage)))) (send-event (ppointer->process (-> self parent-override)) 'victory) ) ) @@ -354,7 +349,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior ogreboss-missile) ja-post) ) @@ -511,8 +505,8 @@ ) (defstate ogreboss-super-boulder-idle (ogreboss-super-boulder) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('speedup) (set! (-> self speed) (* 1.3 (-> self speed))) ) @@ -532,7 +526,6 @@ ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :code (behavior () (ja :group! ogreboss-super-boulder-idle-ja :num! min) @@ -564,7 +557,6 @@ (sound-play "ogre-rock" :id (-> self sound-id) :position (the-as symbol (-> self joint transform))) (suspend) ) - (none) ) :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) @@ -603,7 +595,7 @@ (suspend) (ja :num! (seek!)) ) - (the-as object 0) + 0 ) (defstate ogreboss-super-boulder-throw (ogreboss-super-boulder) @@ -627,7 +619,6 @@ (ja :num! (seek!)) ) (go ogreboss-super-boulder-land) - (none) ) :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) @@ -638,7 +629,6 @@ (set! (-> self hit-boss) #t) (ogreboss-super-boulder-play-hit-anim) (go ogreboss-super-boulder-land) - (none) ) :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) @@ -654,7 +644,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) @@ -680,12 +669,10 @@ (ja :num! (seek! (ja-aframe (the-as float 100.0) 0))) ) (go ogreboss-super-boulder-roll) - (none) ) :post (behavior () (transform-post) 0 - (none) ) ) @@ -753,12 +740,10 @@ (ja :num! (seek!)) ) (cleanup-for-death self) - (none) ) :post (behavior () (transform-post) 0 - (none) ) ) @@ -782,7 +767,6 @@ (loop (suspend) ) - (none) ) ) @@ -900,7 +884,6 @@ ) ) (cleanup-for-death self) - (none) ) :post (behavior () (vector+*! (-> self root-override trans) (-> self src-pos) (-> self side-dir) (-> self side-pos)) @@ -914,7 +897,6 @@ (the-as float 0.0) (the-as float 409600.0) ) - (none) ) ) @@ -1120,7 +1102,6 @@ (send-event (ppointer->process gp-0) 'draw #t) ) ) - (none) ) :trans (behavior () (try-preload-stream *art-control* "$GAMCAM23" 0 self (the-as float -99.0)) @@ -1134,12 +1115,10 @@ ) ) ) - (none) ) :code (behavior () (ogreboss-reset-camera) (ogreboss-idle-loop) - (none) ) :post (the-as (function none :behavior ogreboss) ja-post) ) @@ -1181,7 +1160,6 @@ ) (set-setting! 'music 'ogreboss 0.0 0) (go ogreboss-wait-for-player) - (none) ) :post (the-as (function none :behavior ogreboss) ja-post) ) @@ -1196,11 +1174,9 @@ (go ogreboss-idle) ) ) - (none) ) :code (behavior () (ogreboss-idle-loop) - (none) ) :post (the-as (function none :behavior ogreboss) ja-post) ) @@ -1245,7 +1221,6 @@ ) (defbehavior ogreboss-shoot-boulder ogreboss ((arg0 pickup-type)) - ;; TODO non U1 v1 compatibility!! (let ((gp-0 (new 'stack-no-clear 'ogreboss-missile-init-data))) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 src) (-> self node-list data (#if *jak1-full-game* 50 52) bone transform vector 3)) @@ -1447,8 +1422,8 @@ ) (defstate ogreboss-stage1 (ogreboss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('next-stage) (set! (-> self bridge-assembled) #t) (go ogreboss-stage2) @@ -1457,7 +1432,6 @@ ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (and (-> self bridge-assembled) @@ -1466,7 +1440,6 @@ ) (go ogreboss-stage2) ) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask enemy)) @@ -1554,7 +1527,6 @@ (ja :num! (seek!)) ) (go ogreboss-stage1) - (none) ) :post ogreboss-post ) @@ -1630,52 +1602,49 @@ ) (defbehavior ogreboss-attack-event-handler ogreboss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('attack) - (when (-> self vulnerable) - (if ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 128) - ) - (ja :chan 1 :group! ogreboss-hit-crotch-ja :num! min :frame-interp 0.0) - (ja :chan 1 :group! ogreboss-hit-chest-ja :num! min :frame-interp 0.0) - ) - (set! (-> self hit-time) (-> *display* base-frame-counter)) - (let ((v1-17 (rand-vu-int-range 0 2))) - (cond - ((zero? v1-17) - (sound-play "ogre-grunt1" :position (the-as symbol (-> self root-override trans))) - ) - ((= v1-17 1) - (sound-play "ogre-grunt2" :position (the-as symbol (-> self root-override trans))) - ) - (else - (sound-play "ogre-grunt3" :position (the-as symbol (-> self root-override trans))) - ) - ) - ) - (+! (-> self hit-count) 1) - (if (>= (-> self hit-count) (-> self max-hit-count)) - (go ogreboss-stage3-hit) - ) - (send-event (handle->process (-> self boulder)) 'speedup) - ) - #t - ) - ) - ) + (case arg2 + (('attack) + (when (-> self vulnerable) + (if ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 128) + ) + (ja :chan 1 :group! ogreboss-hit-crotch-ja :num! min :frame-interp 0.0) + (ja :chan 1 :group! ogreboss-hit-chest-ja :num! min :frame-interp 0.0) + ) + (set! (-> self hit-time) (-> *display* base-frame-counter)) + (let ((v1-17 (rand-vu-int-range 0 2))) + (cond + ((zero? v1-17) + (sound-play "ogre-grunt1" :position (the-as symbol (-> self root-override trans))) + ) + ((= v1-17 1) + (sound-play "ogre-grunt2" :position (the-as symbol (-> self root-override trans))) + ) + (else + (sound-play "ogre-grunt3" :position (the-as symbol (-> self root-override trans))) + ) + ) + ) + (+! (-> self hit-count) 1) + (if (>= (-> self hit-count) (-> self max-hit-count)) + (go ogreboss-stage3-hit) + ) + (send-event (handle->process (-> self boulder)) 'speedup) + ) + #t + ) + ) ) (defstate ogreboss-stage2 (ogreboss) :event ogreboss-attack-event-handler :enter (behavior () (set! (-> self boulder) (the-as handle #f)) - (none) ) :trans (behavior () 0 - (none) ) :code (behavior () (ogreboss-set-stage2-camera) @@ -1715,7 +1684,6 @@ ) ) (go ogreboss-stage3-shuffle) - (none) ) :post ogreboss-post ) @@ -1738,12 +1706,10 @@ (set! (-> self max-hit-count) (the int (* 6.0 (-> self difficulty)))) (set! (-> self grow-time) (* 300.0 (+ (/ 10.0 (-> self difficulty)) (* -1.0 (-> self level))))) (set! (-> self boulder) (the-as handle #f)) - (none) ) :exit (behavior () (send-event *camera* 'point-of-interest #f) (set! (-> self vulnerable) #f) - (none) ) :trans (behavior () (let ((v1-1 (handle->process (-> self boulder)))) @@ -1758,7 +1724,6 @@ (send-event (handle->process (-> self boulder)) 'grow-faster) ) 0 - (none) ) :code (behavior () (set! (-> self shuffle-pos) 0.0) @@ -1845,12 +1810,10 @@ ) ) ) - (none) ) :post (behavior () (vector+*! (-> self root-override trans) (-> self far-pos) (-> self side-dir) (-> self shuffle-pos)) (ogreboss-post) - (none) ) ) @@ -1875,7 +1838,6 @@ ) (set! (-> self bridge-assembled) #f) (go ogreboss-stage1) - (none) ) :post (the-as (function none :behavior ogreboss) transform-post) ) @@ -1899,7 +1861,6 @@ (suspend) ) (go ogreboss-stage1) - (none) ) :post (the-as (function none :behavior ogreboss) transform-post) ) @@ -1943,7 +1904,6 @@ ) (ogreboss-trigger-steps) (go ogreboss-dead) - (none) ) ) @@ -2002,7 +1962,6 @@ ) ) (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak1/levels/racer_common/racer-states.gc b/goal_src/jak1/levels/racer_common/racer-states.gc index 5aebf51fb70..0895ea7c210 100644 --- a/goal_src/jak1/levels/racer_common/racer-states.gc +++ b/goal_src/jak1/levels/racer_common/racer-states.gc @@ -10,23 +10,23 @@ ;; DECOMP BEGINS (defstate target-racing-start (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) 'racer ) - ((and (= event-type 'get-pickup) (= (-> event param 0) 3)) + ((and (= message 'get-pickup) (= (-> block param 0) 3)) (if (>= (- (-> *display* base-frame-counter) (-> self racer boost-time)) (seconds 1)) - (send-event self 'boost (fmax 1.0 (fmin 2.0 (the-as float (-> event param 1))))) + (send-event self 'boost (fmax 1.0 (fmin 2.0 (the-as float (-> block param 1))))) ) ) (else - (case event-type + (case message (('end-mode) (go target-racing-get-off (process->handle proc)) ) (('touched) - (send-event proc 'attack (-> event param 0) 'racer 0 0) + (send-event proc 'attack (-> block param 0) 'racer 0 0) (when (and (type-type? (-> proc type) babak) (< 40960.0 (-> self control unknown-float01))) (let ((f0-5 (lerp-scale 16384.0 32768.0 (-> self control unknown-float01) 40960.0 (-> self racer transv-max)))) (go target-racing-jump f0-5 f0-5 #f) @@ -34,14 +34,14 @@ ) ) (('attack 'attack-or-shove 'attack-invinc) - (let ((v1-27 (the-as attack-info (-> event param 1)))) + (let ((v1-27 (the-as attack-info (-> block param 1)))) (if (not (and (logtest? (-> v1-27 mask) (attack-mask mode)) (or (= (-> v1-27 mode) 'burn) (= (-> v1-27 mode) 'burnup))) ) (target-attacked - event-type - (the-as attack-info (-> event param 1)) + message + (the-as attack-info (-> block param 1)) proc - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as (state symbol attack-info target) target-racing-hit) ) ) @@ -49,7 +49,7 @@ ) (('heat) (set! (-> self racer heat) - (fmax 0.0 (fmin (+ (-> self racer heat) (the-as float (-> event param 0))) (-> *RACER-bank* heat-max))) + (fmax 0.0 (fmin (+ (-> self racer heat) (the-as float (-> block param 0))) (-> *RACER-bank* heat-max))) ) ) (('boost) @@ -59,7 +59,7 @@ (set! (-> self racer boost-level) (seek (-> self racer boost-level) (-> *RACER-bank* boost-level-max) - (* (-> *RACER-bank* boost-level-inc) (the-as float (-> event param 0))) + (* (-> *RACER-bank* boost-level-inc) (the-as float (-> block param 0))) ) ) ) @@ -67,20 +67,20 @@ (go target-racing-smack (-> self control unknown-float01) #t) ) (('jump) - (go target-racing-jump (the-as float (-> event param 0)) (the-as float (-> event param 1)) #f) + (go target-racing-jump (the-as float (-> block param 0)) (the-as float (-> block param 1)) #f) ) (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('grab) (go target-racing-grab) ) ) ) (('clone-anim) - (go target-racing-clone-anim (process->handle (the-as process (-> event param 0)))) + (go target-racing-clone-anim (process->handle (the-as process (-> block param 0)))) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -142,7 +142,6 @@ (remove-setting! 'sound-flava) (target-exit) ) - (none) ) :code (behavior ((arg0 handle)) (target-exit) @@ -293,7 +292,6 @@ (set-twist! (-> self racer bottom-blade) (the-as float #f) (the-as float #f) (- (-> self racer bottom-rot))) (remove-exit) (go target-racing-get-on arg0) - (none) ) :post target-post ) @@ -323,12 +321,10 @@ :event (-> target-racing-start event) :enter (behavior () (set! (-> self control unknown-surface00) *racer-mods*) - (none) ) :exit (behavior () (target-racing-center-anim) ((-> target-racing-start exit)) - (none) ) :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) @@ -372,7 +368,6 @@ ) (set! (-> self racer turn-anim-targ) (* 20.0 (-> self racer mod-x))) (racer-buzz (+ 0.45 (* 1.7 (fabs (-> self racer slide-shift-x))))) - (none) ) :code (behavior () (cond @@ -486,14 +481,12 @@ (ja :num! (loop!)) ) ) - (none) ) :post (behavior () (if (= (-> self next-state name) 'target-racing) (set! (-> self racer racing-time) (-> *display* base-frame-counter)) ) (target-racing-post) - (none) ) ) @@ -530,13 +523,11 @@ ) ) ) - (none) ) :exit (behavior () (logclear! (-> self control root-prim prim-core action) (collide-action racer-grounded)) (set! (-> self racer hop?) #f) ((-> target-racing-start exit)) - (none) ) :trans (behavior () (set! (-> self control unknown-float123) @@ -604,7 +595,6 @@ (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1) (-> self control transv)) (set! (-> self racer shock-offset) (* 0.8 (-> self racer shock-offset))) (racer-buzz 0.4) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((a0-1 (if (< 0.1 (-> self racer hill-value)) @@ -614,7 +604,6 @@ ) (target-racing-jump-anim a0-1 (seconds 0.2)) ) - (none) ) :post (-> target-racing post) ) @@ -631,12 +620,10 @@ (set! (-> self control unknown-float123) (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float01))))) ) - (none) ) :exit (behavior () (logclear! (-> self control root-prim prim-core action) (collide-action racer-grounded)) ((-> target-racing-start exit)) - (none) ) :trans (behavior () (set! (-> self control unknown-float123) @@ -671,7 +658,6 @@ (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1) (-> self control transv)) (target-racing-smack-check) (racer-buzz 0.4) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (target-racing-land-anim arg2) @@ -686,7 +672,6 @@ (target-racing-turn-anim) (suspend) ) - (none) ) :post (-> target-racing post) ) @@ -710,16 +695,13 @@ (set! (-> self racer boost-output) 0.0) (set! (-> self racer boost-time) 0) 0 - (none) ) :exit (behavior () (set! (-> self racer heavy) #f) ((-> target-racing-start exit)) - (none) ) :trans (behavior () (set! (-> self racer turn-anim-targ) 0.0) - (none) ) :code (behavior ((arg0 float) (arg1 symbol)) (sound-play "zoomer-crash-2") @@ -735,7 +717,6 @@ (ja :num! (seek! max (lerp-scale 2.0 1.0 arg0 0.0 163840.0))) ) (go target-racing) - (none) ) :post (-> target-racing post) ) @@ -745,12 +726,10 @@ :enter (behavior () (set! (-> self control unknown-surface00) *racer-air-mods*) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (behavior () (logclear! (-> self control root-prim prim-core action) (collide-action racer-grounded)) ((-> target-racing-start exit)) - (none) ) :trans (behavior () (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) @@ -761,11 +740,9 @@ (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (logior! (-> self control root-prim prim-core action) (collide-action racer-grounded)) ) - (none) ) :code (behavior () (target-racing-jump-anim #f (seconds 0.1)) - (none) ) :post (-> target-racing post) ) @@ -795,14 +772,12 @@ ) ) ) - (none) ) :exit (behavior () (if (!= (-> self next-state name) 'target-racing-death) (logclear! (-> self state-flags) (state-flags being-attacked dying)) ) ((-> target-racing-start exit)) - (none) ) :code (behavior ((arg0 handle) (arg1 attack-info)) (target-timed-invulnerable (-> *TARGET-bank* hit-invulnerable-timeout) self) @@ -861,7 +836,6 @@ ) ) (go target-racing) - (none) ) :post target-no-stick-post ) @@ -878,7 +852,6 @@ ((-> target-racing-start exit)) (target-exit) (set! (-> self racer stick-off) #f) - (none) ) :code (behavior ((arg0 symbol)) (local-vars (v1-154 symbol)) @@ -1068,7 +1041,6 @@ ) ) (go target-stance) - (none) ) :post target-racing-post ) @@ -1165,7 +1137,6 @@ 0 ) (go target-racing) - (none) ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -1212,7 +1183,6 @@ ) (hide-hud-quick) (target-no-move-post) - (none) ) ) @@ -1251,7 +1221,6 @@ ) ) (go target-racing-get-off-jump arg0) - (none) ) :post target-racing-post ) @@ -1309,7 +1278,6 @@ (send-event *camera* 'ease-in) (ja-channel-set! 0) (go target-racing-get-off-hit-ground #f) - (none) ) :post (behavior () (let* ((f0-2 (deg-diff (-> self racer front-rot) (-> *RACER-bank* default-front-blade))) @@ -1383,7 +1351,6 @@ (set! (-> self racer bike-scale quad) (-> self control scale quad)) (hide-hud) (target-no-move-post) - (none) ) ) @@ -1393,7 +1360,6 @@ :trans (behavior () (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) ((-> target-hit-ground trans)) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-set! 1) @@ -1403,31 +1369,29 @@ (ja :num! (seek!)) ) (go target-stance) - (none) ) :post (behavior () (hide-hud) (target-post) - (none) ) ) (defstate target-racing-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) (else - (case event-type + (case message (('end-mode) (go target-racing) ) (('clone-anim) - (go target-racing-clone-anim (process->handle (the-as process (-> event param 0)))) + (go target-racing-clone-anim (process->handle (the-as process (-> block param 0)))) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -1438,14 +1402,12 @@ (set! (-> self neck flex-blend) 0.0) (logior! (-> self state-flags) (state-flags invulnerable grabbed)) (set! (-> self racer stick-off) #t) - (none) ) :exit (behavior () (set! (-> self racer stick-off) #f) (logclear! (-> self state-flags) (state-flags invulnerable grabbed)) (logclear! (-> self water flags) (water-flags wt16)) ((-> target-racing-start exit)) - (none) ) :code (behavior () (when (not (ja-group? (-> self draw art-group data 123))) @@ -1460,17 +1422,16 @@ (set-forward-vel 0.0) (suspend) ) - (none) ) :post target-racing-post ) (defstate target-racing-clone-anim (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) - ((-> target-racing-grab event) proc arg1 event-type event) + ((-> target-racing-grab event) proc argc message block) ) :enter (-> target-clone-anim enter) :exit (behavior () @@ -1480,7 +1441,6 @@ ((-> target-clone-anim exit)) ((-> target-racing-start exit)) (vector-reset! (-> self control transv)) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-vector11 y))) @@ -1488,7 +1448,6 @@ (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (clone-anim arg0 33 #t "") (go target-racing) - (none) ) :post (behavior () (racer-sounds) @@ -1497,6 +1456,5 @@ (quaternion-copy! (the-as quaternion (-> self racer bike-quat)) (-> self control quat)) (set! (-> self racer bike-scale quad) (-> self control scale quad)) (target-no-ja-move-post) - (none) ) ) diff --git a/goal_src/jak1/levels/racer_common/racer.gc b/goal_src/jak1/levels/racer_common/racer.gc index 9bb3e251c47..ec5e678f761 100644 --- a/goal_src/jak1/levels/racer_common/racer.gc +++ b/goal_src/jak1/levels/racer_common/racer.gc @@ -10,7 +10,6 @@ ;; DECOMP BEGINS - (if (not (nmember "racerp" *kernel-packages*)) (set! *kernel-packages* (cons "racerp" *kernel-packages*)) ) @@ -82,40 +81,36 @@ (defstate wait-for-start (racer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-1 structure)) - (the-as - object - (case event-type - (('trans) - (vector+! (the-as vector (-> event param 0)) (-> self root-override trans) (-> self extra-trans)) - ) - (('notify) - (set! v0-1 #t) - (set! (-> self auto-get-off) (the-as symbol v0-1)) - v0-1 - ) - (('shadow) - (cond - ((-> event param 0) - (set! v0-1 (-> self shadow-backup)) - (set! (-> self draw shadow) (the-as shadow-geo v0-1)) - v0-1 - ) - (else - (set! (-> self draw shadow) #f) - #f - ) + (case message + (('trans) + (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + ) + (('notify) + (set! v0-1 #t) + (set! (-> self auto-get-off) (the-as symbol v0-1)) + v0-1 + ) + (('shadow) + (cond + ((-> block param 0) + (set! v0-1 (-> self shadow-backup)) + (set! (-> self draw shadow) (the-as shadow-geo v0-1)) + v0-1 + ) + (else + (set! (-> self draw shadow) #f) + #f ) ) - ) + ) ) ) :exit (behavior () (set! (-> self root-override root-prim prim-core action) (collide-action)) (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) 0 - (none) ) :code (behavior () (label cfg-0) @@ -201,7 +196,6 @@ (go-virtual wait-for-return) (go-virtual idle) ) - (none) ) ) @@ -211,7 +205,6 @@ :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (-> self path-target)) - (none) ) :exit (-> (method-of-type racer wait-for-start) exit) :code (behavior () @@ -259,15 +252,14 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior racer) ja-post) ) (defstate pickup (racer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('draw) (ja-channel-set! 1) (ja :group! (-> self draw art-group data 3)) @@ -276,14 +268,14 @@ (transform-post) ) (('trans) - (vector+! (the-as vector (-> event param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) ) (('touch 'attack) #f ) (('shadow) (cond - ((-> event param 0) + ((-> block param 0) (let ((v0-1 (the-as object (-> self shadow-backup)))) (set! (-> self draw shadow) (the-as shadow-geo v0-1)) v0-1 @@ -299,7 +291,6 @@ ) :enter (behavior ((arg0 (state collectable))) ((the-as (function none :behavior racer) (-> arg0 enter))) - (none) ) :code (behavior ((arg0 (state collectable))) (ja-channel-set! 0) @@ -332,45 +323,40 @@ ) ) (go arg0) - (none) ) ) (defstate wait-for-return (racer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (or (= event-type 'touch) (= event-type 'attack)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (or (= message 'touch) (= message 'attack)) (and (!= (-> self condition) 4) (send-event *target* 'end-mode)) ) (go-virtual pickup (the-as (state collectable) (method-of-object self idle))) ) - (the-as - object - (cond - ((= event-type 'trans) - (vector+! (the-as vector (-> event param 0)) (-> self root-override trans) (-> self extra-trans)) - ) - ((= event-type 'shadow) - (cond - ((-> event param 0) - (let ((v0-3 (the-as structure (-> self shadow-backup)))) - (set! (-> self draw shadow) (the-as shadow-geo v0-3)) - v0-3 - ) + (cond + ((= message 'trans) + (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + ) + ((= message 'shadow) + (cond + ((-> block param 0) + (let ((v0-3 (the-as structure (-> self shadow-backup)))) + (set! (-> self draw shadow) (the-as shadow-geo v0-3)) + v0-3 ) - (else - (set! (-> self draw shadow) #f) - #f - ) + ) + (else + (set! (-> self draw shadow) #f) + #f ) ) - ) + ) ) ) :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (the-as curve-control (-> self path-racer))) - (none) ) :code (behavior () (ja-channel-set! 0) @@ -382,7 +368,6 @@ (racer-effect) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/robocave/cave-trap.gc b/goal_src/jak1/levels/robocave/cave-trap.gc index 1013052f56f..a394ceb36aa 100644 --- a/goal_src/jak1/levels/robocave/cave-trap.gc +++ b/goal_src/jak1/levels/robocave/cave-trap.gc @@ -46,9 +46,9 @@ (defstate spider-vent-idle (spider-vent) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('can-spawn?) (return (>= (- (-> *display* base-frame-counter) (-> self last-spawn-time)) (seconds 1))) v0-0 @@ -64,7 +64,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -225,13 +224,7 @@ (when (and (>= 61440.0 f1-1) (>= f1-1 -16384.0)) (when (>= 274432.0 f0-0) (when (or (>= 188416.0 f0-0) (send-event *target* 'query 'powerup (pickup-type eco-yellow))) - (level-hint-spawn - (text-id cave-trap-nest-hint) - "sksp0341" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + (level-hint-spawn (text-id cave-trap-nest-hint) "sksp0341" (the-as entity #f) *entity-pool* (game-task none)) (close-specific-task! (game-task cave-spider-tunnel) (task-status need-hint)) (go cave-trap-active) ) @@ -239,13 +232,11 @@ ) ) ) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -253,7 +244,6 @@ :event cave-trap-default-event-handler :enter (behavior () (set! (-> self spawn-delay) (seconds 0.5)) - (none) ) :trans (behavior () (cond @@ -277,13 +267,11 @@ ) ) 0 - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -292,7 +280,6 @@ :code (behavior () (suspend) (go cave-trap-idle) - (none) ) ) diff --git a/goal_src/jak1/levels/robocave/spider-egg.gc b/goal_src/jak1/levels/robocave/spider-egg.gc index 0894397f272..56666146eae 100644 --- a/goal_src/jak1/levels/robocave/spider-egg.gc +++ b/goal_src/jak1/levels/robocave/spider-egg.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (deftype spider-egg (process-drawable) ((root-override collide-shape-moving :offset 112) (notify-actor entity-actor :offset-assert 176) @@ -43,36 +42,33 @@ ) (defstate spider-egg-idle (spider-egg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (the-as object (case event-type - (('touch) - (the-as object (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> event param 0)) - 0.7 - 6144.0 - 16384.0 - ) - ) - ) - (('can-spawn?) - (return #t) - v0-0 - ) - (('notify-spawned) - (go spider-egg-hatch) - ) - (('attack) - (go spider-egg-die) - ) - ) - ) + (case message + (('touch) + (send-shove-back + (-> self root-override) + proc + (the-as touching-shapes-entry (-> block param 0)) + 0.7 + 6144.0 + 16384.0 + ) + ) + (('can-spawn?) + (return #t) + v0-0 + ) + (('notify-spawned) + (go spider-egg-hatch) + ) + (('attack) + (go spider-egg-die) + ) + ) ) :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior ((arg0 symbol)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) @@ -111,15 +107,14 @@ (ja-channel-push! 1 (seconds 0.1)) ) ) - (none) ) :post (the-as (function none :behavior spider-egg) ja-post) ) (defstate spider-egg-hatch (spider-egg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 symbol)) - (case event-type + (case message (('can-spawn?) (return (the-as object #f)) v0-0 @@ -152,15 +147,14 @@ (until (not (-> self child)) (suspend) ) - (none) ) :post (the-as (function none :behavior spider-egg) ja-post) ) (defstate spider-egg-die (spider-egg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 symbol)) - (case event-type + (case message (('can-spawn?) (return (the-as object #f)) v0-0 @@ -211,7 +205,6 @@ (until (not (-> self child)) (suspend) ) - (none) ) :post (the-as (function none :behavior spider-egg) ja-post) ) diff --git a/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc b/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc index a7fcde156b5..65817dd554f 100644 --- a/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc +++ b/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc @@ -383,7 +383,6 @@ :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-patrol) trans)) (fleeing-nav-enemy-adjust-nav-info) - (none) ) :code (-> (method-of-type nav-enemy nav-enemy-patrol) code) :post (-> (method-of-type nav-enemy nav-enemy-patrol) post) @@ -394,7 +393,6 @@ :enter (-> (method-of-type nav-enemy nav-enemy-notice) enter) :trans (behavior () (fleeing-nav-enemy-adjust-nav-info) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -421,7 +419,6 @@ ) ) (go-virtual nav-enemy-chase) - (none) ) :post (-> (method-of-type nav-enemy nav-enemy-notice) post) ) @@ -431,16 +428,13 @@ :enter (behavior () (logior! (-> self nav flags) (nav-control-flags navcf12)) ((-> (method-of-type nav-enemy nav-enemy-chase) enter)) - (none) ) :exit (behavior () (logclear! (-> self nav flags) (nav-control-flags navcf12)) - (none) ) :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) (fleeing-nav-enemy-adjust-nav-info) - (none) ) :code (-> (method-of-type nav-enemy nav-enemy-chase) code) :post (-> (method-of-type nav-enemy nav-enemy-chase) post) @@ -452,7 +446,6 @@ :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-stop-chase) trans)) (fleeing-nav-enemy-adjust-nav-info) - (none) ) :code (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) :post (-> (method-of-type nav-enemy nav-enemy-stop-chase) post) @@ -499,7 +492,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior fleeing-nav-enemy) nav-enemy-travel-post) ) @@ -602,7 +594,6 @@ (set! (-> self run-blend-interp) (-> gp-0 y)) ) (set! (-> self speed-adjust) 1.0) - (none) ) :code lightning-mole-run-code :post (the-as (function none :behavior lightning-mole) ja-post) @@ -614,7 +605,6 @@ (set-vector! (-> self debug-vector) 0.0 0.0 1.0 1.0) (set! (-> self saved-travel quad) (-> self debug-vector quad)) ((-> (method-of-type nav-enemy nav-enemy-chase) enter)) - (none) ) :trans (behavior () (when (cpad-pressed? 1 r3) @@ -622,7 +612,6 @@ (logclear! (-> *cpad-list* cpads 1 button0-rel 0) (pad-buttons r3)) (go lightning-mole-debug-run) ) - (none) ) :code lightning-mole-run-code :post (behavior () @@ -662,7 +651,6 @@ ) (camera-line-rel (-> self collide-info trans) (-> self nav travel) (new 'static 'vector4w :z #x80 :w #x80)) (camera-line (-> self collide-info trans) (-> self nav target-pos) (new 'static 'vector4w :z #x80 :w #x80)) - (none) ) ) @@ -675,7 +663,6 @@ (suspend) ) (deactivate self) - (none) ) ) @@ -683,7 +670,6 @@ :enter (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self collide-info)) - (none) ) :trans (behavior () (when (task-closed? (-> self entity extra perm task) (task-status need-introduction)) @@ -692,13 +678,11 @@ (restore-collide-with-as (-> self collide-info)) (go-virtual nav-enemy-idle) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) ) @@ -721,7 +705,6 @@ ) ) ) - (none) ) :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1)) @@ -754,7 +737,6 @@ (logclear! (-> *target* mask) (process-mask sleep)) ) (go lightning-mole-gone) - (none) ) :post lightning-mole-hole-post ) @@ -762,7 +744,6 @@ (defstate lightning-mole-head-for-hole (lightning-mole) :enter (behavior () (clear-collide-with-as (-> self collide-info)) - (none) ) :trans (behavior () (when (< (vector-vector-xz-distance *lightning-mole-hole* (-> self collide-info trans)) 61440.0) @@ -785,7 +766,6 @@ (if (< (vector-vector-distance (-> self collide-info trans) *lightning-mole-hole*) 40960.0) (go lightning-mole-dive) ) - (none) ) :code (-> (method-of-type fleeing-nav-enemy nav-enemy-chase) code) :post lightning-mole-hole-post @@ -795,11 +775,9 @@ :enter (behavior () (clear-collide-with-as (-> self collide-info)) ((-> (method-of-type fleeing-nav-enemy nav-enemy-chase) enter)) - (none) ) :exit (behavior () (restore-collide-with-as (-> self collide-info)) - (none) ) :trans (-> (method-of-type fleeing-nav-enemy nav-enemy-chase) trans) :code (behavior () @@ -812,7 +790,6 @@ ) ) (go-virtual nav-enemy-chase) - (none) ) :post (the-as (function none :behavior lightning-mole) nav-enemy-simple-post) ) @@ -830,7 +807,6 @@ (set! (-> self run-blend-interp) 0.0) (vector-! (-> self saved-travel) (-> self collide-info trans) (target-pos 0)) ((-> (method-of-type fleeing-nav-enemy nav-enemy-chase) enter)) - (none) ) :trans (behavior () (let ((s3-0 (new 'stack-no-clear 'vector)) @@ -886,7 +862,6 @@ ) ) ((-> (method-of-type fleeing-nav-enemy nav-enemy-chase) trans)) - (none) ) :code lightning-mole-run-code :post (the-as (function none :behavior lightning-mole) fleeing-nav-enemy-chase-post) @@ -898,7 +873,7 @@ (send-event arg0 'jump 32768.0 32768.0) (go lightning-mole-yelp) ) - (the-as object #t) + #t ) (defmethod touch-handler lightning-mole ((obj lightning-mole) (arg0 process) (arg1 event-message-block)) @@ -906,7 +881,7 @@ (send-event arg0 'jump 32768.0 32768.0) (go lightning-mole-yelp) ) - (the-as object #t) + #t ) (define *lightning-mole-nav-enemy-info* (new 'static 'nav-enemy-info @@ -1158,7 +1133,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (launch-particles (-> *part-id-table* 1771) gp-0 :rate 1.0) + (launch-particles (-> *part-id-table* 1771) gp-0) ) ) (none) @@ -1172,7 +1147,7 @@ (sound-play "land-grass") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (launch-particles (-> *part-id-table* 1772) gp-0 :rate 1.0) + (launch-particles (-> *part-id-table* 1772) gp-0) ) ) (none) @@ -1194,23 +1169,21 @@ (defstate peeper-wait (peeper) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('hide) - (let ((v0-0 (-> *display* base-frame-counter))) - (set! (-> self state-time) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('hide) + (let ((v0-0 (-> *display* base-frame-counter))) + (set! (-> self state-time) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -1218,14 +1191,12 @@ ) (go peeper-up) ) - (none) ) :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (loop (suspend) ) - (none) ) :post (the-as (function none :behavior peeper) ja-post) ) @@ -1242,14 +1213,13 @@ ) (logior! (-> self draw status) (draw-status hidden)) (go peeper-wait) - (none) ) :post (the-as (function none :behavior peeper) ja-post) ) (defstate peeper-down (peeper) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide) (go peeper-wait) ) @@ -1259,7 +1229,6 @@ (if (and *target* (>= 61440.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go peeper-wait) ) - (none) ) :code (behavior () (logior! (-> self draw status) (draw-status hidden)) @@ -1290,14 +1259,13 @@ ) ) (go peeper-up) - (none) ) :post (the-as (function none :behavior peeper) ja-post) ) (defstate peeper-up (peeper) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide) (go peeper-hide) ) @@ -1308,13 +1276,11 @@ (stop! (-> self sound)) ) (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (if (and *target* (>= 61440.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go peeper-hide) ) - (none) ) :code (behavior () (loop @@ -1325,7 +1291,6 @@ ) (go peeper-down) ) - (none) ) :post (the-as (function none :behavior peeper) ja-post) ) diff --git a/goal_src/jak1/levels/rolling/rolling-obs.gc b/goal_src/jak1/levels/rolling/rolling-obs.gc index 5c0b50a43e8..9b7750a9a1c 100644 --- a/goal_src/jak1/levels/rolling/rolling-obs.gc +++ b/goal_src/jak1/levels/rolling/rolling-obs.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype rolling-part (part-spawner) ((root-override basic :offset 112) ) @@ -124,7 +123,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior pusher) rider-post) ) @@ -154,7 +152,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior gorge-pusher) rider-post) ) @@ -275,7 +272,6 @@ (ja :num! (seek!)) ) (go dark-plant-idle) - (none) ) :post (the-as (function none :behavior dark-plant) ja-post) ) @@ -310,7 +306,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior dark-plant) ja-post) ) @@ -326,7 +321,6 @@ (ja :num! (seek!)) ) (go dark-plant-gone) - (none) ) :post (the-as (function none :behavior dark-plant) ja-post) ) @@ -381,7 +375,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior dark-plant) ja-post) ) @@ -403,7 +396,6 @@ (ja :num! (seek!)) ) (go dark-plant-idle) - (none) ) :post (the-as (function none :behavior dark-plant) ja-post) ) @@ -512,7 +504,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior happy-plant) ja-post) ) @@ -524,7 +515,6 @@ (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self mask) (process-mask actor-pause)) ) - (none) ) :code (behavior () (close-specific-task! (game-task rolling-plants) (task-status need-reminder)) @@ -584,7 +574,6 @@ ) (restore-collide-with-as (-> self root-override)) (go happy-plant-opened) - (none) ) :post (the-as (function none :behavior happy-plant) transform-post) ) @@ -606,7 +595,6 @@ ) ) ) - (none) ) :code (behavior () (clear-collide-with-as (-> self root-override)) @@ -617,7 +605,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior happy-plant) ja-post) ) @@ -778,8 +765,8 @@ (defstate rolling-start-break (rolling-start) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('unbreak) (go rolling-start-whole) ) @@ -807,14 +794,13 @@ (deactivate self) ) ) - (none) ) :post (the-as (function none :behavior rolling-start) ja-post) ) (defstate rolling-start-whole (rolling-start) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('break) (sound-play "cool-rolling-st") (go rolling-start-break #f) @@ -833,7 +819,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior rolling-start) ja-post) ) @@ -967,7 +952,6 @@ (send-event (ppointer->process (-> self parent)) 'aborted) ) ) - (none) ) ) @@ -988,7 +972,6 @@ (send-event (ppointer->process (-> self parent)) 'finished) ) ) - (none) ) ) @@ -1132,7 +1115,6 @@ (defstate gorge-start-race-finished (gorge-start) :trans (behavior () (gorge-trans) - (none) ) :code (behavior () (gorge-start-draw-time #t #t) @@ -1151,14 +1133,12 @@ ) ) (go gorge-start-idle) - (none) ) ) (defstate gorge-start-race-aborted (gorge-start) :trans (behavior () (gorge-trans) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1191,13 +1171,12 @@ (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) (send-event (ppointer->process (-> *hud-parts* money)) 'enable) (go gorge-start-idle) - (none) ) ) (defstate gorge-start-racing (gorge-start) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('finished) (go gorge-start-race-finished) ) @@ -1255,7 +1234,6 @@ ) (sleep (-> self ticker) (seconds 6000)) (set-setting! 'sound-flava #f 40.0 (music-flava rolling-gorge)) - (none) ) :exit (behavior () (let* ((v1-0 (-> self child)) @@ -1272,7 +1250,6 @@ (send-event (handle->process (-> self end-banner)) 'break-and-die) (send-event (handle->process (-> self start-banner)) 'unbreak) (remove-setting! 'sound-flava) - (none) ) :trans (the-as (function none :behavior gorge-start) gorge-trans) :code (behavior () @@ -1287,7 +1264,6 @@ (go gorge-start-ready) ) ) - (none) ) ) @@ -1313,7 +1289,6 @@ ) ) ) - (none) ) ) @@ -1321,17 +1296,14 @@ :enter (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :exit (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) - (none) ) :trans (behavior () (gorge-start-launch-start-banner) (gorge-trans) - (none) ) :code (behavior () (loop @@ -1345,7 +1317,6 @@ (go gorge-start-ready) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/rolling/rolling-race-ring.gc b/goal_src/jak1/levels/rolling/rolling-race-ring.gc index 2a02066509e..38372b5181e 100644 --- a/goal_src/jak1/levels/rolling/rolling-race-ring.gc +++ b/goal_src/jak1/levels/rolling/rolling-race-ring.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype race-ring (process-drawable) ((rot-y float :offset-assert 176) (face-vec vector :inline :offset-assert 192) @@ -559,53 +558,50 @@ ) (defstate race-ring-active (race-ring) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 symbol)) - (the-as - object - (case event-type - (('notify) - (when (and (= (-> event param 0) 'die) (= proc (-> self part-track process 0))) - (cond - ((= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) - (set! (-> self part-track) (ppointer->handle (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 460) - -1 - race-ring-blue-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - :to self - ) + (case message + (('notify) + (when (and (= (-> block param 0) 'die) (= proc (-> self part-track process 0))) + (cond + ((= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 460) + -1 + race-ring-blue-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self ) - ) - (set! v0-0 #t) - (set! (-> self keep-part-track-alive) v0-0) - ) - (else - (set! (-> self part-track) (ppointer->handle (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 457) - -1 - race-ring-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - :to self - ) + ) + ) + (set! v0-0 #t) + (set! (-> self keep-part-track-alive) v0-0) + ) + (else + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 457) + -1 + race-ring-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self ) - ) - (set! v0-0 #t) - (set! (-> self keep-part-track-alive) v0-0) - ) + ) + ) + (set! v0-0 #t) + (set! (-> self keep-part-track-alive) v0-0) ) - v0-0 ) + v0-0 ) - ) + ) ) ) :enter (behavior () @@ -651,7 +647,6 @@ (set! (-> self old-hips quad) (-> (target-pos 26) quad)) (+! (-> self old-hips x) 1.0) (set! (-> self state-time) (-> *display* game-frame-counter)) - (none) ) :exit (behavior () (sound-play "close-racering") @@ -698,7 +693,6 @@ (process-entity-status! self (entity-perm-status bit-3) #f) ) ) - (none) ) :trans (behavior () (if (nonzero? (-> self sound)) @@ -753,7 +747,6 @@ (spool-push *art-control* "race-ring-anim" 0 self -99.0) ) ) - (none) ) :code (behavior () (loop @@ -905,7 +898,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior race-ring) ja-post) ) @@ -923,13 +915,12 @@ (go race-ring-active) ) ) - (none) ) ) (defstate race-ring-idle (race-ring) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('activate) (logclear! (-> self mask) (process-mask actor-pause)) (go race-ring-active) @@ -943,7 +934,6 @@ (loop (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/rolling/rolling-robber.gc b/goal_src/jak1/levels/rolling/rolling-robber.gc index 536c9014b30..74aa2154eb6 100644 --- a/goal_src/jak1/levels/rolling/rolling-robber.gc +++ b/goal_src/jak1/levels/rolling/rolling-robber.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (defstate fuel-cell-spline-slider (fuel-cell) :trans (the-as (function none :behavior fuel-cell) hide-hud-quick) :code (behavior ((arg0 handle) (arg1 float) (arg2 float)) @@ -56,7 +55,6 @@ (suspend) (ja :num! (loop! 0.5)) ) - (none) ) ) @@ -314,7 +312,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robber) ja-post) ) @@ -323,7 +320,6 @@ :code (behavior () (cleanup-for-death self) (deactivate self) - (none) ) ) @@ -392,7 +388,6 @@ (suspend) ) (go robber-dead) - (none) ) :post (the-as (function none :behavior robber) transform-post) ) @@ -413,7 +408,6 @@ ) (go robber-flee) ) - (none) ) :code (behavior () (when (not (ja-group? (-> self draw art-group data 7))) @@ -429,7 +423,6 @@ (robber-rotate (the-as target #f) 1820.4445) (suspend) ) - (none) ) :post (the-as (function none :behavior robber) transform-post) ) @@ -438,11 +431,9 @@ :event robber-event-handler :enter (behavior () (set! (-> self y-offset-desired) -12288.0) - (none) ) :exit (behavior () (set! (-> self y-offset-desired) 0.0) - (none) ) :trans (behavior () (if (not (and *target* @@ -451,7 +442,6 @@ ) (go robber-got-away) ) - (none) ) :code (behavior () (loop @@ -487,7 +477,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior robber) transform-post) ) @@ -498,7 +487,6 @@ (set! (-> self near-timer) 3000) (set! (-> self far-time) (-> *display* base-frame-counter)) (set! (-> self y-offset-desired) 0.0) - (none) ) :trans (behavior () (if (not (and *target* @@ -522,7 +510,6 @@ (if (>= (- (-> *display* base-frame-counter) (-> self far-time)) (seconds 3)) (set! (-> self near-timer) (the-as int (-> self timeout))) ) - (none) ) :code (behavior () (loop @@ -558,7 +545,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior robber) transform-post) ) @@ -567,7 +553,6 @@ :event robber-event-handler :enter (behavior () (set! (-> self speed) 0.0) - (none) ) :trans (behavior () (if (and *target* @@ -577,7 +562,6 @@ ) (robber-rotate (the-as target #t) 182.04445) (robber-move) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -588,7 +572,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robber) transform-post) ) @@ -608,7 +591,6 @@ ) (go robber-flee) ) - (none) ) :code (behavior () (path-control-method-14 (-> self path) (-> self tangent) (-> self curve-position)) @@ -632,7 +614,6 @@ ) (go robber-flee) ) - (none) ) :post (the-as (function none :behavior robber) transform-post) ) @@ -641,7 +622,6 @@ :event robber-event-handler :enter (behavior () (set! (-> self speed) 0.0) - (none) ) :trans (behavior () (if (and *target* @@ -650,7 +630,6 @@ (go robber-initial-notice) ) (robber-move) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -661,7 +640,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robber) transform-post) ) diff --git a/goal_src/jak1/levels/snow/ice-cube.gc b/goal_src/jak1/levels/snow/ice-cube.gc index a3d660caa22..61394b825a9 100644 --- a/goal_src/jak1/levels/snow/ice-cube.gc +++ b/goal_src/jak1/levels/snow/ice-cube.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defskelgroup *ice-cube-break-sg* ice-cube-break ice-cube-break-lod0-jg -1 ((ice-cube-break-lod0-mg (meters 999999))) :bounds (static-spherem 0 -15 0 50) @@ -365,105 +364,101 @@ ) ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 98] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 176] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 194] (defbehavior ice-cube-default-event-handler ice-cube ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (case arg2 - (('attack) - (cond - ((and (= (-> arg0 type) target) - (= (-> self cprims-type) 2) - (not (send-event *target* 'query 'powerup (pickup-type eco-red))) - ) - (when (and (cond - ((= (-> arg0 type) target) - (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) - ) - (else - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 4) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (set! (-> a1-3 param 1) (the-as uint #f)) - (let ((v1-20 (+ *global-attack-id* 1))) - (set! *global-attack-id* v1-20) - (set! (-> a1-3 param 2) (the-as uint v1-20)) - ) - (set! (-> a1-3 param 3) (the-as uint 0)) - (send-event-function arg0 a1-3) + (case arg2 + (('attack) + (cond + ((and (= (-> arg0 type) target) + (= (-> self cprims-type) 2) + (not (send-event *target* 'query 'powerup (pickup-type eco-red))) + ) + (when (and (cond + ((= (-> arg0 type) target) + (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + ) + (else + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) self) + (set! (-> a1-3 num-params) 4) + (set! (-> a1-3 message) 'attack) + (set! (-> a1-3 param 0) (-> arg3 param 0)) + (set! (-> a1-3 param 1) (the-as uint #f)) + (let ((v1-20 (+ *global-attack-id* 1))) + (set! *global-attack-id* v1-20) + (set! (-> a1-3 param 2) (the-as uint v1-20)) ) + (set! (-> a1-3 param 3) (the-as uint 0)) + (send-event-function arg0 a1-3) ) ) - (= (-> arg0 type) target) ) - (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) - (level-hint-spawn (text-id snow-ice-cube-hint) "sksp0350" (the-as entity #f) *entity-pool* (game-task none)) - ) + (= (-> arg0 type) target) + ) + (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) + (level-hint-spawn (text-id snow-ice-cube-hint) "sksp0350" (the-as entity #f) *entity-pool* (game-task none)) ) - (else - (nav-enemy-set-hit-from-direction arg0) - (go ice-cube-shatter) - ) + ) + (else + (nav-enemy-set-hit-from-direction arg0) + (go ice-cube-shatter) ) ) - (('touch) - (when (and (cond - ((= (-> arg0 type) target) - (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) - ) - (else - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 4) - (set! (-> a1-7 message) 'attack) - (set! (-> a1-7 param 0) (-> arg3 param 0)) - (set! (-> a1-7 param 1) (the-as uint #f)) - (let ((v1-38 (+ *global-attack-id* 1))) - (set! *global-attack-id* v1-38) - (set! (-> a1-7 param 2) (the-as uint v1-38)) - ) - (set! (-> a1-7 param 3) (the-as uint 0)) - (send-event-function arg0 a1-7) + ) + (('touch) + (when (and (cond + ((= (-> arg0 type) target) + (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + ) + (else + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) self) + (set! (-> a1-7 num-params) 4) + (set! (-> a1-7 message) 'attack) + (set! (-> a1-7 param 0) (-> arg3 param 0)) + (set! (-> a1-7 param 1) (the-as uint #f)) + (let ((v1-38 (+ *global-attack-id* 1))) + (set! *global-attack-id* v1-38) + (set! (-> a1-7 param 2) (the-as uint v1-38)) ) + (set! (-> a1-7 param 3) (the-as uint 0)) + (send-event-function arg0 a1-7) ) ) - (= (-> arg0 type) target) ) - (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - ;; og:preserve-this fixed decompiler bug - (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) + (= (-> arg0 type) target) + ) + (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) + (let ((v0-3 (the-as object (logior (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))))) + (set! (-> self nav-enemy-flags) (the-as nav-enemy-flags v0-3)) + v0-3 ) ) - (('touched) - (when (!= (-> arg0 type) target) - (cond - ((= (-> arg0 type) target) - (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode #f)))) - ) - (else - (let ((a1-10 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-10 from) self) - (set! (-> a1-10 num-params) 4) - (set! (-> a1-10 message) 'attack) - (set! (-> a1-10 param 0) (-> arg3 param 0)) - (set! (-> a1-10 param 1) (the-as uint #f)) - (let ((v1-54 (+ *global-attack-id* 1))) - (set! *global-attack-id* v1-54) - (set! (-> a1-10 param 2) (the-as uint v1-54)) - ) - (set! (-> a1-10 param 3) (the-as uint 0)) - (send-event-function arg0 a1-10) + ) + (('touched) + (when (!= (-> arg0 type) target) + (cond + ((= (-> arg0 type) target) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode #f)))) + ) + (else + (let ((a1-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-10 from) self) + (set! (-> a1-10 num-params) 4) + (set! (-> a1-10 message) 'attack) + (set! (-> a1-10 param 0) (-> arg3 param 0)) + (set! (-> a1-10 param 1) (the-as uint #f)) + (let ((v1-54 (+ *global-attack-id* 1))) + (set! *global-attack-id* v1-54) + (set! (-> a1-10 param 2) (the-as uint v1-54)) ) + (set! (-> a1-10 param 3) (the-as uint 0)) + (send-event-function arg0 a1-10) ) ) ) ) - ) + ) ) ) @@ -749,12 +744,10 @@ (ja-post) (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self collide-info)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self collide-info)) - (none) ) :trans (behavior () (when (and *target* (>= 163840.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) @@ -769,13 +762,11 @@ ) ) ) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -789,7 +780,6 @@ (+! (-> self collide-info trans y) -12288.0) (set! (-> self collide-info transv quad) (-> *null-vector* quad)) (set! (-> self collide-info transv y) (rand-vu-float-range 102400.0 114688.0)) - (none) ) :trans (behavior () (when (and (< (-> self collide-info trans y) (-> self ground-y)) (< (-> self collide-info transv y) 0.0)) @@ -804,7 +794,6 @@ (vector<-cspace! gp-0 (-> s5-0 data (nav-enemy-rnd-int-count a0-2))) (spawn (-> self part2) gp-0) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -816,7 +805,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior ice-cube) nav-enemy-falling-post) ) @@ -840,7 +828,6 @@ (go ice-cube-become-mean) (go-virtual nav-enemy-idle) ) - (none) ) :post (the-as (function none :behavior ice-cube) ja-post) ) @@ -856,7 +843,6 @@ ) (set! (-> self draw force-lod) -1) (logior! (-> self mask) (process-mask actor-pause)) - (none) ) ) @@ -871,7 +857,6 @@ ) (set! (-> self draw force-lod) -1) (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -880,7 +865,6 @@ ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -894,7 +878,6 @@ (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (logclear! (-> self mask) (process-mask actor-pause)) (go ice-cube-face-player) - (none) ) :post (the-as (function none :behavior ice-cube) #f) ) @@ -918,7 +901,6 @@ (set! (-> self target-pt quad) (-> (target-pos 0) quad)) (nav-enemy-neck-control-look-at) (set-vector! (-> self collide-info transv) 0.0 114688.0 0.0 1.0) - (none) ) :code (behavior () (local-vars (gp-0 symbol)) @@ -986,7 +968,6 @@ (ja :num! (seek!)) ) (go ice-cube-become-mean) - (none) ) :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) @@ -997,7 +978,6 @@ (set! (-> self draw force-lod) 0) (logclear! (-> self mask) (process-mask actor-pause)) (nav-enemy-method-57 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1013,7 +993,6 @@ ) ) (go ice-cube-mean-turn-to-charge) - (none) ) :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) @@ -1055,7 +1034,6 @@ (set! (-> self target-pt quad) (-> (target-pos 0) quad)) (nav-enemy-neck-control-look-at) (set-vector! (-> self collide-info transv) 0.0 114688.0 0.0 1.0) - (none) ) :code (behavior () (local-vars (gp-0 symbol)) @@ -1123,7 +1101,6 @@ (ja :num! (seek!)) ) (go ice-cube-mean-charge) - (none) ) :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) @@ -1157,12 +1134,10 @@ (set! (-> self starting-pos quad) (-> a0-6 quad)) ) (set! (-> self charge-angle) (quaternion-y-angle (-> self collide-info quat))) - (none) ) :exit (behavior () (logior! (-> self nav flags) (nav-control-flags navcf8)) (set-root-prim-collide-with! (-> self collide-info) (collide-kind target)) - (none) ) :trans (behavior () (when (or (not *target*) (logtest? (-> *target* state-flags) (state-flags do-not-notice))) @@ -1267,7 +1242,6 @@ #f #f ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1284,7 +1258,6 @@ (ja :num! (loop!)) (ja :chan 1 :num! (chan 0) :frame-interp (-> self anim-blend)) ) - (none) ) :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) @@ -1295,7 +1268,6 @@ (nav-enemy-method-58 self) (nav-enemy-neck-control-inactive) (go ice-cube-retract-spikes) - (none) ) ) @@ -1317,7 +1289,6 @@ ) ) (go ice-cube-tired) - (none) ) :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) @@ -1326,7 +1297,6 @@ :event ice-cube-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) @@ -1345,7 +1315,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1362,7 +1331,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) @@ -1422,6 +1390,5 @@ (until (not (-> self child)) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/snow/snow-ball.gc b/goal_src/jak1/levels/snow/snow-ball.gc index 67bf631f82c..9f2732cf33a 100644 --- a/goal_src/jak1/levels/snow/snow-ball.gc +++ b/goal_src/jak1/levels/snow/snow-ball.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype snow-ball-shadow (process-drawable) () :heap-base #x40 @@ -121,14 +120,12 @@ (set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) (update-direction-from-time-of-day (-> self draw shadow-ctrl)) 0 - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior snow-ball-shadow) ja-post) ) @@ -364,24 +361,22 @@ ) (defstate snow-ball-roller-idle (snow-ball-roller) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch 'attack) - (when (= (-> proc type) target) - (do-push-aways! (-> self root-override)) - (when (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.5)) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) - (the-as symbol (snow-ball-roller-method-22 self *target*)) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (when (= (-> proc type) target) + (do-push-aways! (-> self root-override)) + (when (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.5)) + (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (snow-ball-roller-method-22 self *target*) + ) + ) + ) + ) ) :enter (behavior () (set! (-> self last-bounce-time) (-> *display* base-frame-counter)) (snow-ball-roller-path-init) - (none) ) :exit (behavior () (set! (-> self rolling-sound-enabled?) #f) @@ -390,18 +385,15 @@ (set! (-> self rolling-sound-id) (new 'static 'sound-id)) 0 ) - (none) ) :trans (behavior () (snow-ball-roller-path-update) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior snow-ball-roller) transform-post) ) @@ -559,7 +551,6 @@ (label cfg-22) (suspend) (b! #t cfg-1 :delay (nop!)) - (none) ) ) diff --git a/goal_src/jak1/levels/snow/snow-bumper.gc b/goal_src/jak1/levels/snow/snow-bumper.gc index d0f6ef52688..73531b5f72d 100644 --- a/goal_src/jak1/levels/snow/snow-bumper.gc +++ b/goal_src/jak1/levels/snow/snow-bumper.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (deftype snow-bumper (process-drawable) ((bumper-id int32 :offset-assert 176) (base-shove-ry float :offset-assert 180) @@ -146,7 +145,6 @@ (go snow-bumper-active-close-idle) ) 0 - (none) ) :code (behavior () (transform-post) @@ -155,16 +153,15 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) (defstate snow-bumper-active-close-idle (snow-bumper) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack 'bonk) (when (= (-> proc type) target) - (let ((gp-0 (-> event param 0))) + (let ((gp-0 (-> block param 0))) (when (and (>= 6144.0 (vector-vector-xz-distance (-> self root trans) (target-pos 0))) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry gp-0) @@ -205,7 +202,6 @@ ) (spawn (-> self part) (-> self root trans)) (update! (-> self sound)) - (none) ) :code (behavior () (transform-post) @@ -214,7 +210,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -222,7 +217,6 @@ :exit (behavior () (stop! (-> self sound)) (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (the-as (function none :behavior snow-bumper) rider-trans) :code (behavior () @@ -254,7 +248,6 @@ (go snow-bumper-spawn-fuel-cell) ) (go snow-bumper-inactive-idle) - (none) ) :post (the-as (function none :behavior snow-bumper) rider-post) ) @@ -278,7 +271,6 @@ (suspend) ) (go snow-bumper-inactive-idle) - (none) ) ) @@ -292,7 +284,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) diff --git a/goal_src/jak1/levels/snow/snow-bunny.gc b/goal_src/jak1/levels/snow/snow-bunny.gc index a95d6321f88..ca267f0a9cc 100644 --- a/goal_src/jak1/levels/snow/snow-bunny.gc +++ b/goal_src/jak1/levels/snow/snow-bunny.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype snow-bunny (nav-enemy) ((patrol-rand-distraction int32 :offset-assert 400) (base-hop-dist float :offset-assert 404) @@ -315,7 +314,6 @@ :virtual override :code (behavior () 0 - (none) ) :post (the-as (function none :behavior snow-bunny) transform-post) ) @@ -329,7 +327,6 @@ (t9-1) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -342,7 +339,6 @@ (ja :num! (loop! f30-0)) ) ) - (none) ) ) @@ -352,7 +348,6 @@ :trans (the-as (function none :behavior snow-bunny) #f) :code (behavior () (go-virtual snow-bunny-nav-resume) - (none) ) ) @@ -382,7 +377,6 @@ (go-virtual nav-enemy-idle) ) ) - (none) ) ) @@ -396,7 +390,6 @@ (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (set! (-> self state-timeout) (seconds 0.1)) - (none) ) :trans (behavior () (if (snow-bunny-method-57 self) @@ -416,7 +409,6 @@ ) ) (nav-enemy-method-58 self) - (none) ) :code (behavior () (let ((gp-0 (nav-enemy-rnd-int-count 3))) @@ -451,7 +443,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) @@ -596,16 +587,13 @@ (snow-bunny-method-76 self #t) (set! (-> self rotate-speed) 728177.75) (set! (-> self turn-time) (seconds 0.1)) - (none) ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) - (none) ) :trans (behavior () (nav-enemy-method-58 self) - (none) ) :code (behavior () (snow-bunny-execute-jump) @@ -618,7 +606,6 @@ (go-virtual snow-bunny-patrol-idle) (go-virtual snow-bunny-patrol-hop) ) - (none) ) :post (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) ) @@ -635,12 +622,10 @@ (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (snow-bunny-method-76 self #t) (set-vector! (-> self collide-info transv) 0.0 (nav-enemy-rnd-float-range 102400.0 131072.0) 0.0 1.0) - (none) ) :exit (the-as (function none :behavior snow-bunny) #f) :trans (behavior () (nav-enemy-method-58 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -684,7 +669,6 @@ ) ) (go-virtual nav-enemy-chase) - (none) ) :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) @@ -696,7 +680,6 @@ :trans (the-as (function none :behavior snow-bunny) #f) :code (behavior () (go-virtual snow-bunny-chase-hop) - (none) ) :post (the-as (function none :behavior snow-bunny) #f) ) @@ -793,19 +776,16 @@ (snow-bunny-method-76 self #t) (set! (-> self rotate-speed) 728177.75) (set! (-> self turn-time) (seconds 0.1)) - (none) ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) - (none) ) :trans (behavior () (if (snow-bunny-method-57 self) (set! (-> self should-retreat?) #t) ) (nav-enemy-method-58 self) - (none) ) :code (behavior () (snow-bunny-execute-jump) @@ -816,7 +796,6 @@ (go-virtual snow-bunny-defend) ) (go-virtual snow-bunny-chase-hop) - (none) ) :post (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) ) @@ -828,7 +807,6 @@ (go-virtual snow-bunny-retreat-hop) (go-virtual snow-bunny-lunge) ) - (none) ) ) @@ -1003,16 +981,13 @@ (snow-bunny-method-76 self #t) (set! (-> self rotate-speed) 728177.75) (set! (-> self turn-time) (seconds 0.1)) - (none) ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) - (none) ) :trans (behavior () (nav-enemy-method-58 self) - (none) ) :code (behavior () (snow-bunny-execute-jump) @@ -1020,7 +995,6 @@ (set-current-poly! (-> self nav) (nav-control-method-16 (-> self nav) (-> self collide-info trans))) ) (go-virtual snow-bunny-retreat-hop) - (none) ) :post (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) ) @@ -1031,7 +1005,6 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (snow-bunny-method-76 self #f) - (none) ) :trans (behavior () (if (not *target*) @@ -1051,7 +1024,6 @@ ) (go-virtual snow-bunny-retreat-hop) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1062,7 +1034,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) @@ -1074,7 +1045,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set-vector! (-> self collide-info transv) 0.0 0.0 0.0 1.0) (snow-bunny-method-76 self #t) - (none) ) :trans (behavior () (when *target* @@ -1093,7 +1063,6 @@ #f #f ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1106,7 +1075,6 @@ (suspend) ) (go-virtual snow-bunny-retreat-hop) - (none) ) :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) diff --git a/goal_src/jak1/levels/snow/snow-flutflut-obs.gc b/goal_src/jak1/levels/snow/snow-flutflut-obs.gc index e2a0744c8c5..1110cff802e 100644 --- a/goal_src/jak1/levels/snow/snow-flutflut-obs.gc +++ b/goal_src/jak1/levels/snow/snow-flutflut-obs.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (deftype flutflut-plat (plat) ((has-path? symbol :offset-assert 264) (plat-type int32 :offset-assert 268) @@ -225,9 +224,9 @@ ) (defstate snow-button-up-idle (snow-button) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-2 object)) - (case event-type + (case message (('touch 'attack 'bonk) (when (and (= (-> proc type) target) (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)) @@ -251,14 +250,13 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) (defstate snow-button-activate (snow-button) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('untrigger) (go snow-button-deactivate) ) @@ -287,7 +285,6 @@ ) ) (send-to-all-after (-> self link) 'trigger) - (none) ) :trans (behavior () (if (completed? (-> self ticker)) @@ -305,7 +302,6 @@ ) ) (rider-trans) - (none) ) :code (behavior () (sound-play "prec-button1" :pitch -1) @@ -317,15 +313,14 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) :post (the-as (function none :behavior snow-button) rider-post) ) (defstate snow-button-deactivate (snow-button) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 symbol)) - (case event-type + (case message (('query) (return (the-as object #f)) v0-0 @@ -335,7 +330,6 @@ :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :trans (the-as (function none :behavior snow-button) rider-trans) :code (behavior () @@ -350,7 +344,6 @@ (ja :num! (seek!)) ) (go snow-button-up-idle) - (none) ) :post (the-as (function none :behavior snow-button) rider-post) ) @@ -487,8 +480,8 @@ (defstate plat-startup (flutflut-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (when (or (!= (-> self plat-type) 1) (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) @@ -529,13 +522,12 @@ ) ) ) - (none) ) ) (defstate flutflut-plat-hidden-idle (flutflut-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (logclear! (-> self mask) (process-mask actor-pause)) (go flutflut-plat-appear) @@ -546,7 +538,6 @@ (if (and (= (-> self plat-type) 1) (get-lit-skel self)) (go flutflut-plat-appear) ) - (none) ) :code (behavior () (logior! (-> self draw status) (draw-status hidden)) @@ -556,18 +547,16 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) (defstate flutflut-plat-appear (flutflut-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as symbol (baseplat-method-22 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -585,11 +574,9 @@ (quaternion-axis-angle! gp-0 0.0 1.0 0.0 (rand-vu-float-range -32768.0 32768.0)) (quaternion*! (-> self appear-quat-bottom) (-> self appear-quat-bottom) gp-0) ) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (plat-trans) @@ -629,7 +616,6 @@ ) ) (baseplat-method-20 self) - (none) ) :code (the-as (function none :behavior flutflut-plat) anim-loop) :post (the-as (function none :behavior flutflut-plat) rider-post) @@ -637,16 +623,15 @@ (defstate plat-idle (flutflut-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as object (baseplat-method-22 self)) - ) - (('untrigger) - (go flutflut-plat-hide) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + (('untrigger) + (go flutflut-plat-hide) + ) + ) ) :enter (behavior () (let ((t9-0 (-> (method-of-type plat plat-idle) enter))) @@ -655,7 +640,6 @@ ) ) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) @@ -664,7 +648,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type plat plat-idle) trans))) @@ -675,22 +658,20 @@ (if (and (= (-> self plat-type) 1) (get-lit-skel self)) (go elevator-idle-at-cave) ) - (none) ) ) (defstate plat-path-active (flutflut-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as object (baseplat-method-22 self)) - ) - (('untrigger) - (go flutflut-plat-hide) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + (('untrigger) + (go flutflut-plat-hide) + ) + ) ) :enter (behavior ((arg0 plat)) (let ((t9-0 (-> (method-of-type plat plat-path-active) enter))) @@ -703,7 +684,6 @@ ) (logclear! (-> self mask) (process-mask actor-pause)) ) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) @@ -712,18 +692,16 @@ (t9-0) ) ) - (none) ) ) (defstate flutflut-plat-hide (flutflut-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as symbol (baseplat-method-22 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -740,12 +718,10 @@ (quaternion-axis-angle! gp-0 0.0 1.0 0.0 (rand-vu-float-range -32768.0 32768.0)) (quaternion*! (-> self appear-quat-bottom) (-> self appear-quat-bottom) gp-0) ) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self root-override root-prim prim-core action) (collide-action rider-plat-sticky)) - (none) ) :trans (behavior () (plat-trans) @@ -768,55 +744,48 @@ ) ) (baseplat-method-20 self) - (none) ) :code (the-as (function none :behavior flutflut-plat) anim-loop) :post (the-as (function none :behavior flutflut-plat) rider-post) ) (defstate elevator-idle-at-cave (flutflut-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('bonk) - (the-as object (baseplat-method-22 self)) - ) - (('bounce) - (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) - (the-as object (baseplat-method-22 self)) - ) - ) - (('ridden) - (if (or (not *target*) (not (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)))) - (go elevator-travel-to-fort) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + (('bounce) + (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) + (baseplat-method-22 self) + ) + ) + (('ridden) + (if (or (not *target*) (not (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)))) + (go elevator-travel-to-fort) + ) + ) ) ) :enter (behavior () (set! (-> self path-pos) 0.0) (eval-path-curve! (-> self path) (-> self basetrans) 0.0 'interp) - (none) ) :trans (behavior () (plat-trans) (baseplat-method-20 self) - (none) ) :code (the-as (function none :behavior flutflut-plat) anim-loop) :post (the-as (function none :behavior flutflut-plat) plat-post) ) (defstate elevator-travel-to-fort (flutflut-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as symbol (baseplat-method-22 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + ) ) :trans (behavior () (when (= (-> self path-pos) 1.0) @@ -828,25 +797,22 @@ (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (plat-trans) (baseplat-method-20 self) - (none) ) :code (the-as (function none :behavior flutflut-plat) anim-loop) :post (the-as (function none :behavior flutflut-plat) plat-post) ) (defstate elevator-idle-at-fort (flutflut-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as symbol (baseplat-method-22 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + ) ) :enter (behavior () (set! (-> self path-pos) 1.0) (eval-path-curve! (-> self path) (-> self basetrans) 1.0 'interp) - (none) ) :trans (behavior () (when *target* @@ -861,20 +827,18 @@ ) (plat-trans) (baseplat-method-20 self) - (none) ) :code (the-as (function none :behavior flutflut-plat) anim-loop) :post (the-as (function none :behavior flutflut-plat) plat-post) ) (defstate elevator-travel-to-cave (flutflut-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as symbol (baseplat-method-22 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + ) ) :trans (behavior () (when (= (-> self path-pos) 0.0) @@ -886,7 +850,6 @@ (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (plat-trans) (baseplat-method-20 self) - (none) ) :code (the-as (function none :behavior flutflut-plat) anim-loop) :post (the-as (function none :behavior flutflut-plat) plat-post) diff --git a/goal_src/jak1/levels/snow/snow-obs.gc b/goal_src/jak1/levels/snow/snow-obs.gc index bdbade8ddef..acdc903e69b 100644 --- a/goal_src/jak1/levels/snow/snow-obs.gc +++ b/goal_src/jak1/levels/snow/snow-obs.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype snowcam (pov-camera) ((seq uint64 :offset-assert 224) ) @@ -105,7 +104,6 @@ ) ) (go-virtual pov-camera-done-playing) - (none) ) ) @@ -276,19 +274,18 @@ ) (defstate snow-eggtop-idle-up (snow-eggtop) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (case (-> event param 0) - (('pickup) - (if (type-type? (-> proc type) fuel-cell) - (save-reminder (get-task-control (-> self entity extra perm task)) 1 4) - ) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (if (type-type? (-> proc type) fuel-cell) + (save-reminder (get-task-control (-> self entity extra perm task)) 1 4) + ) + ) + ) + ) + ) ) :trans (behavior () (if (and (not (-> self child)) (task-complete? *game-info* (-> self entity extra perm task))) @@ -296,7 +293,6 @@ ) (spawn (-> self part) (-> self root-override trans)) (update! (-> self sound)) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -306,23 +302,22 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) (defstate snow-eggtop-activate (snow-eggtop) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notify) (when (= (-> proc type) snowcam) (cond - ((= (-> event param 0) 'die) + ((= (-> block param 0) 'die) (if *target* (+! (-> *target* control trans y) 1024.0) ) (go snow-eggtop-idle-down) ) - ((= (-> event param 0) 'cut) + ((= (-> block param 0) 'cut) (stop! (-> self sound)) (set! (-> self play-sound?) #f) #f @@ -336,13 +331,11 @@ (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) (set! (-> self play-sound?) #t) - (none) ) :exit (behavior () (stop! (-> self sound)) (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :trans (the-as (function none :behavior snow-eggtop) rider-trans) :code (behavior () @@ -410,7 +403,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior snow-eggtop) rider-post) ) @@ -429,7 +421,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -510,14 +501,13 @@ ) (defstate snowpusher-idle (snowpusher) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) ) :code (behavior () (let ((gp-0 #f)) @@ -542,7 +532,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior snowpusher) pusher-post) ) @@ -632,14 +621,13 @@ ) (defstate snow-spatula-idle (snow-spatula) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (baseplat-method-22 self) - (sound-play "snow-spat-short" :vol 75 :pitch 0.75) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + (sound-play "snow-spat-short" :vol 75 :pitch 0.75) + ) + ) ) :trans (the-as (function none :behavior snow-spatula) plat-trans) :code (behavior () @@ -676,7 +664,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior snow-spatula) plat-post) ) @@ -904,8 +891,8 @@ ) (defstate snow-fort-gate-idle-closed (snow-fort-gate) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notice) (go snow-fort-gate-activate) ) @@ -916,7 +903,6 @@ (level-hint-spawn (text-id snow-fort-hint) "sksp0345" (the-as entity #f) *entity-pool* (game-task none)) (close-specific-task! (game-task snow-fort) (task-status need-hint)) ) - (none) ) :code (behavior () (ja :group! (-> self draw art-group data 2) :num! min) @@ -927,19 +913,16 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) (defstate snow-fort-gate-activate (snow-fort-gate) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (stop! (-> self sound)) (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :code (behavior () (let ((gp-0 #f)) @@ -982,7 +965,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior snow-fort-gate) transform-post) ) @@ -998,7 +980,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -1174,8 +1155,8 @@ ) (defstate snow-gears-idle (snow-gears) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notice) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) @@ -1190,14 +1171,12 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) (defstate snow-gears-activate (snow-gears) :trans (behavior () (snow-gears-method-20 self) - (none) ) :code (behavior () (sound-play "eng-start-up") @@ -1219,7 +1198,6 @@ (suspend) ) (go snow-gears-halt) - (none) ) :post (the-as (function none :behavior snow-gears) ja-post) ) @@ -1227,11 +1205,9 @@ (defstate snow-gears-halt (snow-gears) :exit (behavior () (stop! (-> self sound)) - (none) ) :trans (behavior () (snow-gears-method-20 self) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max 0.35) :frame-num 0.0) @@ -1248,7 +1224,6 @@ (ja :num! (seek! max 0.85)) ) (go snow-gears-stopped) - (none) ) :post (the-as (function none :behavior snow-gears) ja-post) ) @@ -1261,7 +1236,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -1334,7 +1308,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -1343,7 +1316,6 @@ :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (the-as (function none :behavior snow-switch) rider-trans) :code (behavior () @@ -1403,7 +1375,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior snow-switch) rider-post) ) @@ -1419,7 +1390,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -1510,8 +1480,8 @@ ) (defstate snow-log-wait-for-master (snow-log) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go snow-log-activate) ) @@ -1548,13 +1518,12 @@ ) ) ) - (none) ) ) (defstate snow-log-hidden (snow-log) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) @@ -1569,7 +1538,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -1578,12 +1546,10 @@ (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :trans (the-as (function none :behavior snow-log) rider-trans) :code (behavior () @@ -1602,7 +1568,6 @@ ) ) (go snow-log-active) - (none) ) :post (the-as (function none :behavior snow-log) rider-post) ) @@ -1639,7 +1604,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior snow-log) rider-post) ) @@ -1732,7 +1696,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -1741,7 +1704,6 @@ :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :trans (the-as (function none :behavior snow-log-button) rider-trans) :code (behavior () @@ -1777,7 +1739,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior snow-log-button) rider-post) ) @@ -1792,7 +1753,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/snow/snow-ram-boss.gc b/goal_src/jak1/levels/snow/snow-ram-boss.gc index 7502c84e48f..c4f81b0b94c 100644 --- a/goal_src/jak1/levels/snow/snow-ram-boss.gc +++ b/goal_src/jak1/levels/snow/snow-ram-boss.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (deftype ram-boss-proj (projectile) ((parent-override (pointer ram-boss) :offset 12) (part2 sparticle-launch-control :offset-assert 412) @@ -630,8 +629,8 @@ ) (defstate ram-boss-proj-growing (ram-boss-proj) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('launch) (let ((v1-1 (-> self parent-override))) (set! (-> v1-1 0 proj-stoked) #f) @@ -680,7 +679,6 @@ (spawn (-> self part) (-> self root-override trans)) (suspend) ) - (none) ) ) @@ -696,7 +694,6 @@ (+! (-> self target y) 4915.2) (set! (-> self target-base quad) (-> self target quad)) (go-virtual projectile-moving) - (none) ) ) @@ -720,7 +717,6 @@ (sound-play "ramboss-hit") (suspend) (go-virtual projectile-die) - (none) ) ) @@ -743,7 +739,6 @@ ) (suspend) (go-virtual projectile-die) - (none) ) ) @@ -1245,23 +1240,21 @@ (defstate ram-boss-show-anims (ram-boss) :trans (behavior () 0 - (none) ) :code (behavior () 0 - (none) ) :post (the-as (function none :behavior ram-boss) transform-post) ) (defstate ram-boss-idle (ram-boss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('jump) (go ram-boss-jump-down proc) ) (('touch 'attack) - (nav-enemy-send-attack proc (the-as touching-shapes-entry (-> event param 0)) 'generic) + (nav-enemy-send-attack proc (the-as touching-shapes-entry (-> block param 0)) 'generic) ) ) ) @@ -1269,7 +1262,6 @@ ((-> (method-of-type nav-enemy nav-enemy-idle) enter)) (set! (-> self frustration) 0) 0 - (none) ) :code (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) @@ -1296,15 +1288,14 @@ ) (suspend) ) - (none) ) ) (defstate ram-boss-jump-down (ram-boss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) - (nav-enemy-send-attack proc (the-as touching-shapes-entry (-> event param 0)) 'generic) + (nav-enemy-send-attack proc (the-as touching-shapes-entry (-> block param 0)) 'generic) ) ) ) @@ -1334,7 +1325,6 @@ ) ) (set! (-> self collide-info transv y) 102400.0) - (none) ) :trans (behavior () (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) @@ -1350,7 +1340,6 @@ (if (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)) (go ram-boss-jump-down-hit-ground) ) - (none) ) :code (behavior ((arg0 basic)) (ja-channel-push! 1 (seconds 0.8)) @@ -1367,7 +1356,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) @@ -1384,7 +1372,6 @@ ) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go ram-boss-nav-start) - (none) ) :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) @@ -1406,7 +1393,6 @@ (set-heading-vec! (-> self collide-info) gp-0) ) (go ram-boss-nav-start) - (none) ) ) @@ -1420,7 +1406,6 @@ (set-current-poly! (-> self nav) a1-1) ) (go ram-boss-nav-resume) - (none) ) ) @@ -1449,7 +1434,6 @@ ) ) (go-virtual nav-enemy-idle) - (none) ) ) @@ -1461,7 +1445,6 @@ (set! (-> self state-timeout) (-> self nav-enemy-patrol-timeout)) (set! (-> self nav-enemy-patrol-timeout) (seconds 1)) (ja-channel-push! 1 (seconds 0.3)) - (none) ) :trans (behavior () (when *target* @@ -1472,7 +1455,6 @@ ) ) ((-> (method-of-type nav-enemy nav-enemy-patrol) trans)) - (none) ) ) @@ -1485,7 +1467,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans)))) @@ -1512,7 +1493,6 @@ ) ) 0 - (none) ) ) @@ -1522,7 +1502,6 @@ :trans (the-as (function none :behavior ram-boss) #f) :code (behavior () (go ram-boss-tracking) - (none) ) ) @@ -1557,7 +1536,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self facing-y) (quaternion-y-angle (-> self collide-info quat))) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) - (none) ) :trans (behavior () (set-jump-height-factor! @@ -1632,7 +1610,6 @@ ) ) 0 - (none) ) :code (behavior () (let ((f30-0 -1.0)) @@ -1677,7 +1654,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) @@ -1686,12 +1662,10 @@ :enter (behavior () (set! (-> self frustration) 0) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) - (none) ) :trans (behavior () (set-jump-height-factor! self (the-as int #t)) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1701,7 +1675,6 @@ (ja :num! (seek!)) ) (go ram-boss-tracking) - (none) ) :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) @@ -1710,12 +1683,10 @@ :enter (behavior () (set! (-> self frustration) 0) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) - (none) ) :trans (behavior () (set-jump-height-factor! self (the-as int #t)) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1725,7 +1696,6 @@ (ja :num! (seek!)) ) (go ram-boss-tracking) - (none) ) :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) @@ -1743,7 +1713,6 @@ ) ) ) - (none) ) :code (behavior () (set! (-> self frustration) 0) @@ -1759,7 +1728,6 @@ ) ) (go-virtual nav-enemy-attack) - (none) ) :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) @@ -1769,7 +1737,6 @@ :event ram-boss-on-ground-event-handler :enter (behavior () (go ram-boss-nav-resume) - (none) ) ) @@ -1784,12 +1751,10 @@ ) ) (set! (-> self proj-last-thrown-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (set-jump-height-factor! self (the-as int #t)) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1810,7 +1775,6 @@ ) ) (go ram-boss-tracking) - (none) ) :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) @@ -1821,7 +1785,6 @@ (nav-enemy-neck-control-inactive) (nav-enemy-method-53 self) (init-jm! self *ram-boss-nav-enemy-info-no-shield*) - (none) ) :exit (behavior () (nav-enemy-neck-control-look-at) @@ -1834,7 +1797,6 @@ (set! (-> v1-3 enable) #t) (set! (-> v1-3 transform scale quad) (the-as uint128 0)) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -1853,7 +1815,6 @@ (ja :num! (seek!)) ) (go ram-boss-tracking) - (none) ) :post (behavior () (compute-alignment! (-> self align)) @@ -1881,7 +1842,6 @@ #f ) (nav-enemy-common-post) - (none) ) ) @@ -1901,6 +1861,5 @@ (send-event (ppointer->process (-> self parent-override)) 'notify) (suspend) 0 - (none) ) ) diff --git a/goal_src/jak1/levels/snow/snow-ram.gc b/goal_src/jak1/levels/snow/snow-ram.gc index 62c5e295e73..a5b7432c598 100644 --- a/goal_src/jak1/levels/snow/snow-ram.gc +++ b/goal_src/jak1/levels/snow/snow-ram.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defskelgroup *ram-sg* ram ram-lod0-jg ram-cock-ja ((ram-lod0-mg (meters 20)) (ram-lod1-mg (meters 40)) (ram-lod2-mg (meters 999999))) :bounds (static-spherem 0 5 0 8.5) @@ -179,18 +178,18 @@ ) (defstate ram-idle (ram) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (if ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self root-override) (the-as uint 1) ) (send-event proc 'attack - (-> event param 0) + (-> block param 0) (static-attack-info ((shove-up (meters 0.5)) (shove-back (meters 2)))) ) ) @@ -199,14 +198,12 @@ ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (rider-trans) (if (-> self give-fuel-cell-anim) (spool-push *art-control* (-> self give-fuel-cell-anim name) 0 self -99.0) ) - (none) ) :code (behavior () (local-vars (sv-16 symbol)) @@ -248,14 +245,13 @@ (go ram-fun-idle) ) ) - (none) ) :post (the-as (function none :behavior ram) rider-post) ) (defstate ram-fun-idle (ram) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notify) (when (= (-> proc type) ram-boss) (if (ram-method-22 self) @@ -269,7 +265,6 @@ (if (-> self give-fuel-cell-anim) (spool-push *art-control* (-> self give-fuel-cell-anim name) 0 self -99.0) ) - (none) ) :code (behavior () (if (-> self give-fuel-cell?) @@ -281,15 +276,14 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) (defstate ram-give-fuel-cell (ram) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notify) - (if (and (= (-> proc type) snowcam) (= (-> event param 0) 'die)) + (if (and (= (-> proc type) snowcam) (= (-> block param 0) 'die)) (go ram-fun-idle) ) ) @@ -298,7 +292,6 @@ :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :code (behavior () (set! (-> self give-fuel-cell?) #f) @@ -329,7 +322,6 @@ 0 ) (go ram-fun-idle) - (none) ) ) diff --git a/goal_src/jak1/levels/snow/target-ice.gc b/goal_src/jak1/levels/snow/target-ice.gc index e5243d4d472..47e0fe4f22c 100644 --- a/goal_src/jak1/levels/snow/target-ice.gc +++ b/goal_src/jak1/levels/snow/target-ice.gc @@ -11,7 +11,6 @@ :event target-standard-event-handler :enter (behavior () (set! (-> self control unknown-surface00) *walk-mods*) - (none) ) :exit target-state-hook-exit :trans (behavior () @@ -54,7 +53,6 @@ ) (slide-down-test) (fall-test) - (none) ) :code (behavior () (let ((gp-0 60)) @@ -157,7 +155,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) :post target-post ) @@ -167,12 +164,10 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *walk-mods*) - (none) ) :exit (behavior () (target-effect-exit) (target-state-hook-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -237,7 +232,6 @@ ) (slide-down-test) (fall-test) - (none) ) :code (behavior () (cond @@ -323,11 +317,6 @@ ) ) ) - (none) ) :post target-post ) - - - - diff --git a/goal_src/jak1/levels/snow/target-snowball.gc b/goal_src/jak1/levels/snow/target-snowball.gc index fa2f9d7184a..552daa24301 100644 --- a/goal_src/jak1/levels/snow/target-snowball.gc +++ b/goal_src/jak1/levels/snow/target-snowball.gc @@ -49,12 +49,12 @@ ) (defstate target-snowball-start (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) 'snowball ) - ((let ((v1-3 arg2)) + ((let ((v1-3 message)) (= v1-3 'end-mode) ) (go @@ -65,7 +65,7 @@ ) ) (else - (target-generic-event-handler arg0 arg1 arg2 arg3) + (target-generic-event-handler proc argc message block) ) ) ) @@ -85,7 +85,6 @@ (set! (-> self control reaction) target-collision-reaction) (target-exit) ) - (none) ) :code (behavior ((arg0 handle)) (target-exit) @@ -109,7 +108,6 @@ (ja :group! (-> self draw art-group data 5) :num! min) (remove-exit) (go target-snowball) - (none) ) :post target-post ) @@ -121,14 +119,8 @@ (loop (suspend) ) - (none) ) :post (behavior () (target-snowball-post) - (none) ) ) - - - - diff --git a/goal_src/jak1/levels/snow/yeti.gc b/goal_src/jak1/levels/snow/yeti.gc index d7f14e60797..747204148c4 100644 --- a/goal_src/jak1/levels/snow/yeti.gc +++ b/goal_src/jak1/levels/snow/yeti.gc @@ -10,7 +10,6 @@ ;; DECOMP BEGINS - (deftype yeti-slave (nav-enemy) ((ground-y float :offset-assert 400) (part2 sparticle-launch-control :offset-assert 404) @@ -228,7 +227,6 @@ (+! (-> self collide-info trans y) -12288.0) (set! (-> self collide-info transv quad) (-> *null-vector* quad)) (set! (-> self collide-info transv y) (rand-vu-float-range 102400.0 114688.0)) - (none) ) :trans (behavior () (when (and (< (-> self collide-info trans y) (-> self ground-y)) (< (-> self collide-info transv y) 0.0)) @@ -243,7 +241,6 @@ (vector<-cspace! gp-0 (-> s5-0 data (nav-enemy-rnd-int-count a0-2))) (spawn (-> self part2) gp-0) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -255,7 +252,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior yeti-slave) nav-enemy-falling-post) ) @@ -273,7 +269,6 @@ (go-virtual nav-enemy-chase) (go-virtual nav-enemy-idle) ) - (none) ) :post (the-as (function none :behavior yeti-slave) ja-post) ) @@ -281,11 +276,9 @@ (defstate yeti-slave-show-anims (yeti-slave) :trans (behavior () 0 - (none) ) :code (behavior () 0 - (none) ) :post (the-as (function none :behavior yeti-slave) transform-post) ) @@ -337,7 +330,6 @@ ) ) ) - (none) ) ) @@ -370,7 +362,6 @@ (ja :num! (loop! f30-0)) ) ) - (none) ) ) @@ -421,7 +412,6 @@ ) ) ) - (none) ) ) @@ -460,7 +450,6 @@ (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -479,7 +468,6 @@ (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) ) (go-virtual nav-enemy-chase) - (none) ) ) @@ -634,7 +622,6 @@ ) (suspend) ) - (none) ) ) @@ -662,7 +649,6 @@ ) ) (go yeti-idle) - (none) ) ) @@ -702,7 +688,6 @@ ) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/sunken/bully.gc b/goal_src/jak1/levels/sunken/bully.gc index e0efb5b671f..fcc635266aa 100644 --- a/goal_src/jak1/levels/sunken/bully.gc +++ b/goal_src/jak1/levels/sunken/bully.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (deftype bully-broken-cage (process-drawable) ((parent-override (pointer bully) :offset 12) ) @@ -225,7 +224,6 @@ (suspend) (ja :num! (seek!)) ) - (none) ) :post (the-as (function none :behavior bully-broken-cage) ja-post) ) @@ -241,126 +239,120 @@ (none) ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 48] ;; WARN: disable def twice: 148. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 229] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 248] (defbehavior bully-default-event-handler bully ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (local-vars (v0-0 none)) - (the-as - object - (case arg2 - (('touch 'touched 'attack) - (cond - ((= (-> arg0 type) bully) - (let ((v1-3 (new 'stack-no-clear 'vector))) - (vector-! v1-3 (-> self root-override trans) (-> (the-as process-drawable arg0) root trans)) - (set! (-> self travel-ry) (atan (-> v1-3 x) (-> v1-3 z))) - ) - (set! (-> self bounced?) #t) - (set! v0-0 (the-as none 100)) - (set! (-> self bounce-volume) (the-as int v0-0)) - v0-0 + (local-vars (v0-0 object)) + (case arg2 + (('touch 'touched 'attack) + (cond + ((= (-> arg0 type) bully) + (let ((v1-3 (new 'stack-no-clear 'vector))) + (vector-! v1-3 (-> self root-override trans) (-> (the-as process-drawable arg0) root trans)) + (set! (-> self travel-ry) (atan (-> v1-3 x) (-> v1-3 z))) ) - ((= (-> arg0 type) target) - (cond - ((= (-> arg3 param 1) 'flop) - (go bully-die) - (return (the-as object #t)) - v0-0 - ) - ((or (= arg2 'touch) (= arg2 'attack)) - (cond - ((>= (- (-> (target-pos 0) y) (-> self root-override trans y)) 6144.0) - (let* ((f0-6 (fmax 0.6 (* 0.000023935356 (-> self travel-speed)))) - (f28-0 (* 8192.0 f0-6)) - (f30-0 (* 8192.0 f0-6)) - (s4-0 (new 'stack-no-clear 'vector)) - ) - (vector-! s4-0 (target-pos 0) (-> self root-override trans)) - (let ((f26-0 (atan (-> s4-0 x) (-> s4-0 z)))) - (when (< 0.0 (-> self travel-speed)) - (let ((f0-11 (deg- f26-0 (-> self travel-ry)))) - (if (< (fabs f0-11) 8192.0) - (set! f26-0 (if (>= f0-11 0.0) - (+ 8192.0 f26-0) - (+ -8192.0 f26-0) - ) - ) - ) - ) + (set! (-> self bounced?) #t) + (set! v0-0 100) + (set! (-> self bounce-volume) (the-as int v0-0)) + v0-0 + ) + ((= (-> arg0 type) target) + (cond + ((= (-> arg3 param 1) 'flop) + (go bully-die) + (return #t) + v0-0 + ) + ((or (= arg2 'touch) (= arg2 'attack)) + (cond + ((>= (- (-> (target-pos 0) y) (-> self root-override trans y)) 6144.0) + (let* ((f0-6 (fmax 0.6 (* 0.000023935356 (-> self travel-speed)))) + (f28-0 (* 8192.0 f0-6)) + (f30-0 (* 8192.0 f0-6)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector-! s4-0 (target-pos 0) (-> self root-override trans)) + (let ((f26-0 (atan (-> s4-0 x) (-> s4-0 z)))) + (when (< 0.0 (-> self travel-speed)) + (let ((f0-11 (deg- f26-0 (-> self travel-ry)))) + (if (< (fabs f0-11) 8192.0) + (set! f26-0 (if (>= f0-11 0.0) + (+ 8192.0 f26-0) + (+ -8192.0 f26-0) + ) + ) + ) ) - (set-vector! s4-0 (* (sin f26-0) f28-0) 0.0 (* (cos f26-0) f28-0) 1.0) ) - (when (send-event arg0 'shove (-> arg3 param 0) (static-attack-info ((shove-up f30-0) (vector s4-0)))) - (level-hint-spawn - (text-id sunken-bully-dive-hint) - "sksp0131" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (set! (-> self bounced?) #t) - (set! v0-0 (the-as none 100)) - (set! (-> self bounce-volume) (the-as int v0-0)) - v0-0 + (set-vector! s4-0 (* (sin f26-0) f28-0) 0.0 (* (cos f26-0) f28-0) 1.0) + ) + (when (send-event arg0 'shove (-> arg3 param 0) (static-attack-info ((shove-up f30-0) (vector s4-0)))) + (level-hint-spawn + (text-id sunken-bully-dive-hint) + "sksp0131" + (the-as entity #f) + *entity-pool* + (game-task none) ) + (set! (-> self bounced?) #t) + (set! v0-0 100) + (set! (-> self bounce-volume) (the-as int v0-0)) + v0-0 ) ) - (else - (let ((f0-21 (fmax 0.6 (* 0.000023935356 (-> self travel-speed))))) - (when (send-event - arg0 - 'attack - (-> arg3 param 0) - (static-attack-info ((shove-up (* 12288.0 f0-21)) (shove-back (* 16384.0 f0-21)))) - ) - (level-hint-spawn - (text-id sunken-bully-dive-hint) - "sksp0131" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (set! (-> self hit-player?) #t) - (set! (-> self bounced?) #t) - (set! (-> self bounce-volume) 100) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) + ) + (else + (let ((f0-21 (fmax 0.6 (* 0.000023935356 (-> self travel-speed))))) + (when (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (* 12288.0 f0-21)) (shove-back (* 16384.0 f0-21)))) + ) + (level-hint-spawn + (text-id sunken-bully-dive-hint) + "sksp0131" + (the-as entity #f) + *entity-pool* + (game-task none) ) + (set! (-> self hit-player?) #t) + (set! (-> self bounced?) #t) + (set! (-> self bounce-volume) 100) + (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) ) ) ) ) - ) + ) ) - (else - (when (= arg2 'touched) - (cond - ((= (-> arg0 type) target) - (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'explode)))) - ) - (else - (let ((a1-14 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-14 from) self) - (set! (-> a1-14 num-params) 4) - (set! (-> a1-14 message) 'attack) - (set! (-> a1-14 param 0) (-> arg3 param 0)) - (set! (-> a1-14 param 1) (the-as uint 'explode)) - (let ((v1-48 (+ *global-attack-id* 1))) - (set! *global-attack-id* v1-48) - (set! (-> a1-14 param 2) (the-as uint v1-48)) - ) - (set! (-> a1-14 param 3) (the-as uint 0)) - (send-event-function arg0 a1-14) + ) + (else + (when (= arg2 'touched) + (cond + ((= (-> arg0 type) target) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'explode)))) + ) + (else + (let ((a1-14 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-14 from) self) + (set! (-> a1-14 num-params) 4) + (set! (-> a1-14 message) 'attack) + (set! (-> a1-14 param 0) (-> arg3 param 0)) + (set! (-> a1-14 param 1) (the-as uint 'explode)) + (let ((v1-48 (+ *global-attack-id* 1))) + (set! *global-attack-id* v1-48) + (set! (-> a1-14 param 2) (the-as uint v1-48)) ) + (set! (-> a1-14 param 3) (the-as uint 0)) + (send-event-function arg0 a1-14) ) ) ) ) ) ) - ) + ) ) ) @@ -464,14 +456,12 @@ (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) 0 - (none) ) :exit (behavior () (let ((v1-1 (-> self draw shadow-ctrl))) (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) 0 - (none) ) :trans (behavior () (when (and (and *target* (>= (-> self fact-override idle-distance) @@ -483,7 +473,6 @@ (start-hint-timer (text-id sunken-bully-dive-hint)) (go bully-notice) ) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-push! 1 (seconds 0.075)) @@ -497,7 +486,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) :post bully-post ) @@ -516,7 +504,6 @@ ) (set-target! (-> self neck) (target-pos 5)) ) - (none) ) :code (behavior () (set! (-> self travel-speed) 0.0) @@ -554,7 +541,6 @@ (ja :num! (seek!)) ) (go bully-start-spinning) - (none) ) :post bully-post ) @@ -575,7 +561,6 @@ (set! (-> self travel-ry) (atan (-> gp-0 x) (-> gp-0 z))) ) (+! (-> self travel-ry) (rand-vu-float-range -910.2222 910.2222)) - (none) ) :trans (behavior () (when *target* @@ -615,7 +600,6 @@ #f ) (nav-control-method-27 (-> self nav)) - (none) ) :code (behavior () (local-vars (v1-34 symbol) (v1-52 symbol)) @@ -650,7 +634,6 @@ ) (ja :group! bully-spin-ja :num! min) ) - (none) ) :post bully-post ) @@ -662,7 +645,6 @@ (set! (-> self reaction-delay) (rand-vu-int-range (seconds 2) (seconds 3))) (set! (-> self travel-speed) 0.0) (set! (-> self bounced?) #f) - (none) ) :trans (behavior () (when *target* @@ -676,7 +658,6 @@ ) (set-target! (-> self neck) (target-pos 5)) ) - (none) ) :code (behavior () (local-vars (v1-17 symbol) (v1-35 symbol)) @@ -721,7 +702,6 @@ (go bully-idle #f) ) (go bully-start-spinning) - (none) ) :post bully-post ) @@ -746,7 +726,6 @@ (while (-> self child) (suspend) ) - (none) ) :post (the-as (function none :behavior bully) transform-post) ) diff --git a/goal_src/jak1/levels/sunken/double-lurker.gc b/goal_src/jak1/levels/sunken/double-lurker.gc index a52eba279cf..55298f965db 100644 --- a/goal_src/jak1/levels/sunken/double-lurker.gc +++ b/goal_src/jak1/levels/sunken/double-lurker.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (deftype double-lurker-top (nav-enemy) ((parent-process (pointer double-lurker) :offset 12) (fall-dest vector :inline :offset-assert 400) @@ -237,18 +236,18 @@ ) (defstate double-lurker-top-on-shoulders (double-lurker-top) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (let ((v1-1 (-> self fall-dest)) - (a0-4 (-> (the-as vector (-> event param 0)) quad)) + (a0-4 (-> (the-as vector (-> block param 0)) quad)) ) (set! (-> v1-1 quad) a0-4) - (go double-lurker-top-knocked-down a0-4 (the-as vector arg1) (the-as vector event-type)) + (go double-lurker-top-knocked-down a0-4 (the-as vector argc) (the-as vector message)) ) ) (('instant-death) - (let ((v1-3 (the-as object (-> event param 0)))) + (let ((v1-3 (the-as object (-> block param 0)))) (quaternion-axis-angle! (-> self collide-info quat) 0.0 @@ -272,7 +271,6 @@ (update-transforms! (-> self collide-info)) (suspend) ) - (none) ) ) @@ -285,19 +283,18 @@ (suspend) (ja :num! (seek!)) ) - (none) ) :post (the-as (function none :behavior double-lurker-top) ja-post) ) (defstate double-lurker-top-knocked-down (double-lurker-top) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (send-event proc 'shove - (-> event param 0) + (-> block param 0) (static-attack-info ((shove-up (meters 3)) (shove-back (meters 2)))) ) ) @@ -332,7 +329,6 @@ (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (nav-control-method-27 (-> self nav)) (go double-lurker-top-resume) - (none) ) :post (the-as (function none :behavior double-lurker-top) transform-post) ) @@ -358,7 +354,6 @@ ) ) (go-virtual nav-enemy-idle) - (none) ) ) @@ -373,7 +368,6 @@ ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -390,7 +384,6 @@ (t9-0) ) ) - (none) ) ) @@ -586,11 +579,9 @@ (defstate double-lurker-show-anims (double-lurker) :trans (behavior () 0 - (none) ) :code (behavior () 0 - (none) ) :post (the-as (function none :behavior double-lurker) transform-post) ) @@ -616,7 +607,6 @@ ) ) (go-virtual nav-enemy-idle) - (none) ) ) @@ -637,7 +627,6 @@ ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -651,7 +640,6 @@ (t9-1) ) ) - (none) ) ) @@ -688,14 +676,12 @@ (t9-0) ) ) - (none) ) ) (defstate double-lurker-both-knocked-back (double-lurker) :enter (behavior () (set! (-> self knocked-back-speed) 40960.0) - (none) ) :trans (behavior () (local-vars (at-0 int)) @@ -755,7 +741,6 @@ #f ) (nav-control-method-27 (-> self nav)) - (none) ) ) :code (behavior () @@ -766,7 +751,6 @@ (ja :num! (seek!)) ) (go double-lurker-resume) - (none) ) :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post) ) @@ -821,7 +805,6 @@ (nav-enemy-method-51 self) (init-jm! self *double-lurker-nav-enemy-info*) (go double-lurker-break-apart) - (none) ) ) @@ -834,7 +817,6 @@ (ja :num! (seek!)) ) (go double-lurker-resume) - (none) ) :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post) ) @@ -842,7 +824,6 @@ (defstate double-lurker-knocked-back (double-lurker) :enter (behavior () (set! (-> self knocked-back-speed) 40960.0) - (none) ) :trans (behavior () (local-vars (at-0 int)) @@ -902,7 +883,6 @@ #f ) (nav-control-method-27 (-> self nav)) - (none) ) ) :code (behavior () @@ -913,7 +893,6 @@ (ja :num! (seek!)) ) (go double-lurker-resume) - (none) ) :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post) ) @@ -925,7 +904,6 @@ (until (not (-> self child)) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/sunken/floating-launcher.gc b/goal_src/jak1/levels/sunken/floating-launcher.gc index acd56dd48a1..eeb55c0b214 100644 --- a/goal_src/jak1/levels/sunken/floating-launcher.gc +++ b/goal_src/jak1/levels/sunken/floating-launcher.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype floating-launcher (baseplat) ((trigger-height float :offset-assert 228) (launcher (pointer launcher) :offset-assert 232) @@ -42,7 +41,6 @@ (go floating-launcher-lowering) ) ) - (none) ) :code (behavior () (transform-post) @@ -52,7 +50,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior floating-launcher) plat-post) ) @@ -79,7 +76,6 @@ (set! (-> self launcher 0 root-override trans quad) (-> self basetrans quad)) (update-transforms! (-> self launcher 0 root-override)) (go floating-launcher-ready) - (none) ) :post (the-as (function none :behavior floating-launcher) plat-post) ) diff --git a/goal_src/jak1/levels/sunken/helix-water.gc b/goal_src/jak1/levels/sunken/helix-water.gc index 42a093b6f43..d91f9172977 100644 --- a/goal_src/jak1/levels/sunken/helix-water.gc +++ b/goal_src/jak1/levels/sunken/helix-water.gc @@ -14,7 +14,6 @@ ;; DECOMP BEGINS - (deftype helix-slide-door (process-drawable) ((root-override collide-shape :offset 112) ) @@ -96,8 +95,8 @@ (defstate water-vol-idle (helix-dark-eco) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (let ((a0-1 (-> self sound))) (set! (-> a0-1 spec pitch-mod) 2057) @@ -105,7 +104,7 @@ ) ) (else - ((-> (method-of-type water-anim water-vol-idle) event) proc arg1 event-type event) + ((-> (method-of-type water-anim water-vol-idle) event) proc argc message block) ) ) ) @@ -119,7 +118,6 @@ (set! (-> a0-0 spec pitch-mod) 1524) (update-vol! a0-0 58) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type dark-eco-pool water-vol-idle) trans))) @@ -128,7 +126,6 @@ ) ) (update! (-> self sound)) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type dark-eco-pool water-vol-idle) post))) @@ -137,13 +134,12 @@ ) ) (ja-post) - (none) ) ) (defstate helix-slide-door-idle-open (helix-slide-door) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go helix-slide-door-close) ) @@ -153,7 +149,6 @@ (loop (suspend) ) - (none) ) ) @@ -166,7 +161,6 @@ ) (transform-post) (go helix-slide-door-idle-closed) - (none) ) :post (the-as (function none :behavior helix-slide-door) transform-post) ) @@ -177,7 +171,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -239,13 +232,12 @@ ) ) (go helix-button-idle-up) - (none) ) ) (defstate helix-button-idle-up (helix-button) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (when *target* (when (logtest? (-> *target* control status) (cshape-moving-flags onsurf)) @@ -270,7 +262,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -418,7 +409,6 @@ (suspend) ) (go helix-button-idle-down) - (none) ) :post (the-as (function none :behavior helix-button) rider-post) ) @@ -498,7 +488,6 @@ ) ) (go helix-button-idle-down) - (none) ) :post (the-as (function none :behavior helix-button) rider-post) ) @@ -508,7 +497,6 @@ (loop (suspend) ) - (none) ) ) @@ -603,16 +591,15 @@ ) (defstate helix-water-idle (helix-water) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('trigger) - (go helix-water-activated) - ) - (('music) - (the-as object (set-setting! 'music 'danger 0.0 0)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go helix-water-activated) + ) + (('music) + (set-setting! 'music 'danger 0.0 0) + ) + ) ) :code (behavior () (set! (-> self root trans y) (-> self start-y)) @@ -624,14 +611,13 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior helix-water) ja-post) ) (defstate helix-water-activated (helix-water) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notify) (when (= (-> proc type) launcherdoor) (remove-setting! 'music) @@ -668,7 +654,6 @@ ) (send-event (ppointer->process (-> self dark-eco)) 'move-to (-> self root trans)) (helix-water-method-21 self) - (none) ) :code (behavior () (send-event (ppointer->process (-> self dark-eco)) 'trigger) @@ -676,7 +661,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior helix-water) ja-post) ) diff --git a/goal_src/jak1/levels/sunken/orbit-plat.gc b/goal_src/jak1/levels/sunken/orbit-plat.gc index d4052910307..b5f1e9658b4 100644 --- a/goal_src/jak1/levels/sunken/orbit-plat.gc +++ b/goal_src/jak1/levels/sunken/orbit-plat.gc @@ -224,7 +224,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior orbit-plat-bottom) ja-post) ) @@ -262,39 +261,38 @@ ) (defstate orbit-plat-idle (orbit-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (baseplat-method-22 self)) - ) - (('go) - (go orbit-plat-rotating) - ) - (('query-reset) - (if (not (-> self is-reset?)) - (go orbit-plat-reset) - ) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'reset) - (let ((t9-3 send-event-function) - (v1-8 (-> self other)) - ) - (t9-3 - (if v1-8 - (-> v1-8 extra process) - ) - a1-1 - ) - ) - ) - ) - (('reset) - (go orbit-plat-reset) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + (('go) + (go orbit-plat-rotating) + ) + (('query-reset) + (if (not (-> self is-reset?)) + (go orbit-plat-reset) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'reset) + (let ((t9-3 send-event-function) + (v1-8 (-> self other)) + ) + (t9-3 + (if v1-8 + (-> v1-8 extra process) + ) + a1-1 + ) + ) + ) + ) + (('reset) + (go orbit-plat-reset) + ) + ) ) :trans (the-as (function none :behavior orbit-plat) plat-trans) :code (behavior () @@ -348,7 +346,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior orbit-plat) plat-post) ) @@ -374,16 +371,15 @@ ) (defstate orbit-plat-still (orbit-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (baseplat-method-22 self)) - ) - (('go) - (go orbit-plat-rotating) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + (('go) + (go orbit-plat-rotating) + ) + ) ) :trans (the-as (function none :behavior orbit-plat) plat-trans) :code (behavior () @@ -415,7 +411,6 @@ ) ) (go orbit-plat-idle) - (none) ) :post (the-as (function none :behavior orbit-plat) plat-post) ) @@ -450,7 +445,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior orbit-plat) plat-post) ) @@ -491,16 +485,15 @@ ) (defstate orbit-plat-rotating (orbit-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (baseplat-method-22 self)) - ) - (('stop) - (go orbit-plat-still) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + (('stop) + (go orbit-plat-still) + ) + ) ) :trans (the-as (function none :behavior orbit-plat) plat-trans) :code (behavior () @@ -546,7 +539,6 @@ (ja :num! (seek! 0.0)) ) (b! #t cfg-3 :delay (nop!)) - (none) ) :post (the-as (function none :behavior orbit-plat) plat-post) ) @@ -699,16 +691,15 @@ ) (defstate orbit-plat-reset (orbit-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (baseplat-method-22 self)) - ) - (('go) - (go orbit-plat-rotating) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + (('go) + (go orbit-plat-rotating) + ) + ) ) :trans (the-as (function none :behavior orbit-plat) plat-trans) :code (behavior () @@ -742,7 +733,6 @@ ) (set! (-> self is-reset?) #t) (go orbit-plat-idle) - (none) ) :post (the-as (function none :behavior orbit-plat) plat-post) ) @@ -765,7 +755,6 @@ (ja :num! (seek! 0.0)) ) ) - (none) ) :post (the-as (function none :behavior orbit-plat) ja-post) ) diff --git a/goal_src/jak1/levels/sunken/puffer.gc b/goal_src/jak1/levels/sunken/puffer.gc index c272f9d4fa3..126de16a8cd 100644 --- a/goal_src/jak1/levels/sunken/puffer.gc +++ b/goal_src/jak1/levels/sunken/puffer.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (deftype puffer (process-drawable) ((root-override collide-shape-moving :offset 112) (fact-info-override fact-info-enemy :offset 144) @@ -81,47 +80,43 @@ :shadow puffer-main-shadow-mg ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 56] (defbehavior puffer-default-event-handler puffer ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (case arg2 - (('touch 'attack) - (when (and (= arg2 'attack) (!= (-> self cprims-type) 2)) - (let* ((gp-0 arg0) - (v1-7 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) - gp-0 - ) - ) - ) - (when v1-7 - (let ((f0-4 (atan - (- (-> (the-as process-drawable v1-7) root trans x) (-> self root-override trans x)) - (- (-> (the-as process-drawable v1-7) root trans z) (-> self root-override trans z)) - ) + (case arg2 + (('touch 'attack) + (when (and (= arg2 'attack) (!= (-> self cprims-type) 2)) + (let* ((gp-0 arg0) + (v1-7 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) + gp-0 + ) + ) + ) + (when v1-7 + (let ((f0-4 (atan + (- (-> (the-as process-drawable v1-7) root trans x) (-> self root-override trans x)) + (- (-> (the-as process-drawable v1-7) root trans z) (-> self root-override trans z)) ) - ) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 f0-4) - ) + ) + ) + (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 f0-4) ) ) - (go puffer-die) - (return (the-as object #t)) ) - (when (= (-> arg0 type) target) - (when (send-event - arg0 - 'attack - (-> arg3 param 0) - (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) - ) - (set! (-> self hit-player?) #t) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) - ) + (go puffer-die) + (return #t) + ) + (when (= (-> arg0 type) target) + (when (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) + ) + (set! (-> self hit-player?) #t) + (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) ) ) - ) + ) ) ) @@ -505,7 +500,6 @@ (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) 0 - (none) ) :code (behavior () (loop @@ -521,7 +515,6 @@ (puffer-method-26 self) (suspend) ) - (none) ) :post puffer-post ) @@ -538,7 +531,6 @@ (set! (-> self picked-point-time) (-> *display* base-frame-counter)) (set! (-> self pick-new-point-delay) (rand-vu-int-range (seconds 3) (seconds 10))) (set! (-> self last-on-screen-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (and (not (and *target* (>= (-> self fact-info-override idle-distance) @@ -586,14 +578,12 @@ ) (vector-v+! (-> self root-override trans) (-> self root-override trans) (-> self root-override transv)) (puffer-method-28 self) - (none) ) :code (behavior () (loop (puffer-method-26 self) (suspend) ) - (none) ) :post puffer-post ) @@ -604,13 +594,11 @@ (set! (-> self attacking?) #t) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self travel-turn-speed) 21845.334) - (none) ) :exit (behavior () (shut-down! (-> self neck)) (set! (-> self attacking?) #f) (set! (-> self travel-turn-speed) 16384.0) - (none) ) :trans (behavior () (if (not (puffer-method-25 self (-> self give-up-dist))) @@ -634,23 +622,21 @@ ) (vector-v+! (-> self root-override trans) (-> self root-override trans) (-> self root-override transv)) (puffer-method-28 self) - (none) ) :code (behavior () (loop (puffer-method-26 self) (suspend) ) - (none) ) :post puffer-post ) (defstate puffer-die (puffer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (the-as uint - (case event-type + (case message (('death-start) (the-as uint (drop-pickup (-> self fact-info-override) #t *entity-pool* (-> self fact-info-override) 0)) ) @@ -674,7 +660,6 @@ (suspend) (ja :num! (seek!)) ) - (none) ) :post (the-as (function none :behavior puffer) ja-post) ) diff --git a/goal_src/jak1/levels/sunken/qbert-plat.gc b/goal_src/jak1/levels/sunken/qbert-plat.gc index f968da9809c..c1894d8c8f8 100644 --- a/goal_src/jak1/levels/sunken/qbert-plat.gc +++ b/goal_src/jak1/levels/sunken/qbert-plat.gc @@ -10,7 +10,6 @@ ;; DECOMP BEGINS - (deftype qbert-plat-on (process-drawable) () :heap-base #x40 @@ -104,8 +103,8 @@ (defstate qbert-plat-on-mimic (qbert-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go qbert-plat-on-die) ) @@ -128,7 +127,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior qbert-plat) ja-post) ) @@ -136,7 +134,6 @@ (defstate qbert-plat-on-die (qbert-plat) :code (behavior () '() - (none) ) ) @@ -226,7 +223,6 @@ (suspend) 0 ) - (none) ) :post (the-as (function none :behavior qbert-plat) ja-post) ) @@ -238,7 +234,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior qbert-plat) ja-post) ) @@ -250,7 +245,6 @@ (if (-> self on?) (logior! (-> self draw status) (draw-status hidden)) ) - (none) ) :trans (behavior () (logclear! (-> self draw status) (draw-status hidden)) @@ -265,7 +259,6 @@ ) (set! (-> self player-is-riding?) gp-1) ) - (none) ) :post (behavior () ((the-as @@ -276,7 +269,6 @@ (if (-> self on?) (logior! (-> self draw status) (draw-status hidden)) ) - (none) ) ) @@ -373,13 +365,13 @@ ) (defstate qbert-plat-master-idle (qbert-plat-master) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (start-hint-timer (text-id sunken-qbert-plat-hint)) (close-specific-task! (game-task sunken-platforms) (task-status need-hint)) (when (not (-> self puzzle-beaten?)) - (let ((v1-2 (-> event param 0))) + (let ((v1-2 (-> block param 0))) (when (!= v1-2 (-> self last-plat-triggered)) (set! (-> self last-plat-triggered) (the-as int v1-2)) (let ((s5-1 (= (-> self plat-states-needed-to-open-door) (-> self plat-states)))) @@ -529,7 +521,6 @@ ) (suspend) ) - (none) ) ) @@ -689,7 +680,6 @@ ) ) (go qbert-plat-master-idle) - (none) ) ) @@ -719,7 +709,6 @@ ) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/sunken/shover.gc b/goal_src/jak1/levels/sunken/shover.gc index 7eddbde8397..49bb4d578c5 100644 --- a/goal_src/jak1/levels/sunken/shover.gc +++ b/goal_src/jak1/levels/sunken/shover.gc @@ -10,7 +10,6 @@ ;; DECOMP BEGINS - (deftype shover (process-drawable) ((root-override collide-shape :offset 112) (shove-up float :offset-assert 176) @@ -31,12 +30,12 @@ ) (defstate shover-idle (shover) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (when (= (-> proc type) target) (when ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> *target* control) (collide-action solid) (collide-action) @@ -51,13 +50,13 @@ (send-event proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((mode 'burn) (vector (-> s4-0 vector)) (shove-up (-> s4-0 shove-up)))) ) (send-event proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((mode 'burn) (shove-up (meters 0)) (shove-back (meters 2)) diff --git a/goal_src/jak1/levels/sunken/square-platform.gc b/goal_src/jak1/levels/sunken/square-platform.gc index 0e5bac8df95..8ec196b0640 100644 --- a/goal_src/jak1/levels/sunken/square-platform.gc +++ b/goal_src/jak1/levels/sunken/square-platform.gc @@ -10,7 +10,6 @@ ;; DECOMP BEGINS - (deftype square-platform (baseplat) ((plat-id int32 :offset-assert 228) (pos-u float :offset-assert 232) @@ -261,8 +260,8 @@ ) (defstate square-platform-lowered (square-platform) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (if (and (= (-> proc type) square-platform-master) (= (-> (the-as square-platform-master proc) plat-id) (-> self plat-id)) @@ -278,27 +277,24 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) (defstate square-platform-rising (square-platform) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as object (baseplat-method-22 self)) - ) - (('untrigger) - (go square-platform-lowering) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + (('untrigger) + (go square-platform-lowering) + ) + ) ) :enter (behavior () (set! (-> self start-splash-time) 0) (set! (-> self splash-counter) 0) 0 - (none) ) :trans (behavior () (set! (-> self pos-u) @@ -311,29 +307,26 @@ (go square-platform-raised) ) (square-platform-method-27 self #t) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior square-platform) plat-post) ) (defstate square-platform-raised (square-platform) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as object (baseplat-method-22 self)) - ) - (('untrigger) - (go square-platform-lowering) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + (('untrigger) + (go square-platform-lowering) + ) + ) ) :trans (the-as (function none :behavior square-platform) plat-trans) :code (behavior () @@ -342,32 +335,29 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior square-platform) plat-post) ) (defstate square-platform-lowering (square-platform) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as object (baseplat-method-22 self)) - ) - (('trigger) - (go square-platform-rising) - ) - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + (('trigger) + (go square-platform-rising) + ) + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) ) :enter (behavior () (set! (-> self start-splash-time) 0) (set! (-> self splash-counter) 0) 0 - (none) ) :trans (behavior () (set! (-> self pos-u) @@ -380,14 +370,12 @@ (go square-platform-lowered) ) (square-platform-method-27 self #f) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior square-platform) plat-post) ) @@ -494,8 +482,8 @@ ) (defstate square-platform-master-idle (square-platform-master) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (when (= (-> proc type) square-platform-button) (set! (-> self button-id) (-> (the-as square-platform-button proc) button-id)) @@ -510,7 +498,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -602,12 +589,10 @@ ) (set! (-> self plat-id-dir) gp-0) ) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :trans (behavior () (when (completed? (-> self ticker)) @@ -648,13 +633,11 @@ ) ) ) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) diff --git a/goal_src/jak1/levels/sunken/steam-cap.gc b/goal_src/jak1/levels/sunken/steam-cap.gc index cbf44a5b365..7580e7e8f45 100644 --- a/goal_src/jak1/levels/sunken/steam-cap.gc +++ b/goal_src/jak1/levels/sunken/steam-cap.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype steam-cap-control-pt (structure) ((trans vector :inline :offset-assert 0) (transv vector :inline :offset-assert 16) @@ -640,7 +639,6 @@ (steam-cap-method-21 self) (suspend) ) - (none) ) :post (the-as (function none :behavior steam-cap) rider-post) ) diff --git a/goal_src/jak1/levels/sunken/sun-exit-chamber.gc b/goal_src/jak1/levels/sunken/sun-exit-chamber.gc index 539ccd35c12..98ed639c13a 100644 --- a/goal_src/jak1/levels/sunken/sun-exit-chamber.gc +++ b/goal_src/jak1/levels/sunken/sun-exit-chamber.gc @@ -203,7 +203,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior blue-eco-charger-orb) ja-post) ) @@ -286,7 +285,6 @@ ;; og:preserve-this (init-vf0-vector) ) - (none) ) ) :post (the-as (function none :behavior blue-eco-charger-orb) ja-post) @@ -372,7 +370,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior blue-eco-charger) ja-post) ) @@ -384,14 +381,12 @@ (sound-play "blue-eco-start") ) (blue-eco-charger-method-21 self #t) - (none) ) :trans (behavior () (if (blue-eco-charger-method-20 self) (set! (-> self state-time) (-> *display* base-frame-counter)) ) (update! (-> self sound)) - (none) ) :code (behavior ((arg0 symbol)) (ja-no-eval :num! (seek!)) @@ -420,7 +415,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior blue-eco-charger) ja-post) ) @@ -428,21 +422,18 @@ (defstate blue-eco-charger-stuck-open (blue-eco-charger) :trans (behavior () (update! (-> self sound)) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) (defstate blue-eco-charger-close (blue-eco-charger) :exit (behavior () (stop! (-> self sound)) - (none) ) :code (behavior () (ja-no-eval :num! (seek! 0.0)) @@ -461,7 +452,6 @@ ) (blue-eco-charger-method-21 self #f) (go blue-eco-charger-idle) - (none) ) :post (the-as (function none :behavior blue-eco-charger) ja-post) ) @@ -632,14 +622,14 @@ ) (defstate exit-chamber-charger-puzzle (exit-chamber) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('notify) - (case (-> event param 0) + (case (-> block param 0) ((1) (when (zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) - (let* ((a1-2 (-> event param 1)) + (let* ((a1-2 (-> block param 1)) (v1-5 (logior (-> self chargers-active) (ash 1 a1-2))) ) (set! (-> self chargers-active) v1-5) @@ -654,7 +644,7 @@ ) ((2) (when (zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) - (let ((a1-6 (-> event param 1))) + (let ((a1-6 (-> block param 1))) (set! v0-0 (logclear (-> self chargers-active) (ash 1 a1-6))) ) (set! (-> self chargers-active) (the-as uint v0-0)) @@ -667,7 +657,6 @@ ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :code (behavior () (loop @@ -677,7 +666,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior exit-chamber) ja-post) ) @@ -700,21 +688,20 @@ ) (send-event (ppointer->process (-> self door)) 'trigger) (go exit-chamber-idle-in-sunken) - (none) ) ) (defstate exit-chamber-idle-in-sunken (exit-chamber) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-1 object)) - (case event-type + (case message (('trigger) (go exit-chamber-rise) (return #t) v0-1 ) (('notify) - (when (and (= (-> proc type) fuel-cell) (= (-> event param 0) 'pickup)) + (when (and (= (-> proc type) fuel-cell) (= (-> block param 0) 'pickup)) (let ((a0-5 (handle->process (-> self fcell-handle)))) (when a0-5 (let ((v1-10 (new 'stack-no-clear 'vector))) @@ -730,7 +717,6 @@ ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :code (behavior () (save-reminder (get-task-control (game-task sunken-room)) 1 0) @@ -748,20 +734,17 @@ ) (suspend) ) - (none) ) ) (defstate exit-chamber-rise (exit-chamber) :enter (behavior () (set! (-> self move-player?) #f) - (none) ) :trans (behavior () (if (not (-> self move-player?)) (rider-trans) ) - (none) ) :code (behavior () (aybabtu 2) @@ -877,7 +860,6 @@ (suspend) ) (go exit-chamber-idle-in-village #f) - (none) ) :post (behavior () (if (-> self move-player?) @@ -885,18 +867,17 @@ (rider-post) ) (exit-chamber-method-23 self #t) - (none) ) ) (defstate exit-chamber-idle-in-village (exit-chamber) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go exit-chamber-lower) ) (('notify) - (when (and (= (-> proc type) fuel-cell) (= (-> event param 0) 'pickup)) + (when (and (= (-> proc type) fuel-cell) (= (-> block param 0) 'pickup)) (let ((a0-5 (handle->process (-> self fcell-handle)))) (when a0-5 (let ((v1-8 (new 'stack-no-clear 'vector))) @@ -913,11 +894,9 @@ :enter (behavior ((arg0 symbol)) (logior! (-> self mask) (process-mask platform)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (behavior () (logclear! (-> self mask) (process-mask platform)) - (none) ) :trans (behavior () (rider-trans) @@ -941,7 +920,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol)) (set! (-> self move-player?) #f) @@ -960,7 +938,6 @@ (exit-chamber-method-20 self 1.0) (suspend) ) - (none) ) :post (behavior () (rider-post) @@ -968,7 +945,6 @@ (if (and *target* (>= (vector-vector-xz-distance (target-pos 0) (-> self last-pos)) 40960.0)) (spawn (-> self part) (-> self last-pos)) ) - (none) ) ) @@ -980,7 +956,6 @@ (clear-collide-with-as (-> (the-as fuel-cell v1-2) root-override)) ) ) - (none) ) :trans (behavior () (if (not (-> self move-player?)) @@ -988,7 +963,6 @@ ) (seek! (-> self wave-scale) 0.0 0.0016666667) (exit-chamber-method-20 self (-> self wave-scale)) - (none) ) :code (behavior () (let ((v1-1 (process-spawn @@ -1067,7 +1041,6 @@ ) (set-continue! *game-info* "sunkenb-start") (go exit-chamber-idle-in-sunken) - (none) ) :post (behavior () (if (-> self move-player?) @@ -1075,7 +1048,6 @@ (rider-post) ) (exit-chamber-method-23 self #t) - (none) ) ) diff --git a/goal_src/jak1/levels/sunken/sun-iris-door.gc b/goal_src/jak1/levels/sunken/sun-iris-door.gc index e6ea9d8afd7..1cb8d4112e5 100644 --- a/goal_src/jak1/levels/sunken/sun-iris-door.gc +++ b/goal_src/jak1/levels/sunken/sun-iris-door.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype sun-iris-door (process-drawable) ((root-override collide-shape :offset 112) (timeout float :offset-assert 176) @@ -79,15 +78,15 @@ ) (defstate sun-iris-door-closed (sun-iris-door) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go sun-iris-door-opening) ) (('move-to) (set! (-> self move-to?) #t) - (set! (-> self move-to-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> arg3 param 1))) + (set! (-> self move-to-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> block param 1))) ) ) ) @@ -97,14 +96,12 @@ (go sun-iris-door-opening) ) ) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (behavior () (when (-> self move-to?) @@ -113,20 +110,19 @@ (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) (ja-post) ) - (none) ) ) (defstate sun-iris-door-opening (sun-iris-door) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go sun-iris-door-closing) ) (('move-to) (set! (-> self move-to?) #t) - (set! (-> self move-to-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> arg3 param 1))) + (set! (-> self move-to-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> block param 1))) ) ) ) @@ -139,7 +135,6 @@ ) (ja-post) (go sun-iris-door-open) - (none) ) :post (behavior () (cond @@ -153,7 +148,6 @@ (transform-post) ) ) - (none) ) ) @@ -210,8 +204,8 @@ ) (defstate sun-iris-door-open (sun-iris-door) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (let ((v0-0 (the-as object (-> *display* base-frame-counter)))) (set! (-> self state-time) (the-as time-frame v0-0)) @@ -223,8 +217,8 @@ ) (('move-to) (set! (-> self move-to?) #t) - (set! (-> self move-to-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> arg3 param 1))) + (set! (-> self move-to-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> block param 1))) ) ) ) @@ -232,12 +226,10 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (clear-collide-with-as (-> self root-override)) (logior! (-> self draw status) (draw-status hidden)) - (none) ) :exit (behavior () (restore-collide-with-as (-> self root-override)) (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (when (-> self proximity?) @@ -250,14 +242,12 @@ ) (go sun-iris-door-closing) ) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (behavior () (when (-> self move-to?) @@ -266,20 +256,19 @@ (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) (ja-post) ) - (none) ) ) (defstate sun-iris-door-closing (sun-iris-door) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go sun-iris-door-opening) ) (('move-to) (set! (-> self move-to?) #t) - (set! (-> self move-to-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> arg3 param 1))) + (set! (-> self move-to-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> block param 1))) ) ) ) @@ -292,7 +281,6 @@ ) (ja-post) (go sun-iris-door-closed) - (none) ) :post (behavior () (cond @@ -306,7 +294,6 @@ (transform-post) ) ) - (none) ) ) @@ -409,7 +396,3 @@ ) (none) ) - - - - diff --git a/goal_src/jak1/levels/sunken/sunken-fish.gc b/goal_src/jak1/levels/sunken/sunken-fish.gc index f958a2ebbd3..9d1c29c6c99 100644 --- a/goal_src/jak1/levels/sunken/sunken-fish.gc +++ b/goal_src/jak1/levels/sunken/sunken-fish.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype sunkenfisha (process-drawable) ((path-u float :offset-assert 176) (path-speed float :offset-assert 180) @@ -200,7 +199,6 @@ (.svf (&-> v1-16 quad) vf1) ) (sunkenfisha-method-23 self) - (none) ) ) :code (behavior () @@ -211,7 +209,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior sunkenfisha) ja-post) ) diff --git a/goal_src/jak1/levels/sunken/sunken-obs.gc b/goal_src/jak1/levels/sunken/sunken-obs.gc index 90fd154f60b..7aa4248b30c 100644 --- a/goal_src/jak1/levels/sunken/sunken-obs.gc +++ b/goal_src/jak1/levels/sunken/sunken-obs.gc @@ -10,7 +10,6 @@ ;; DECOMP BEGINS - (deftype water-vol-deadly (process-hidden) () :method-count-assert 15 @@ -161,7 +160,6 @@ :virtual #t :exit (behavior () (set! (-> *screen-filter* draw?) #f) - (none) ) :code (behavior () (let ((v1-0 (-> self seq))) @@ -299,7 +297,6 @@ ) ) (go-virtual pov-camera-done-playing) - (none) ) ) @@ -335,7 +332,6 @@ (ja :num! (seek! max (-> self anim-speed))) ) ) - (none) ) :post (the-as (function none :behavior seaweed) ja-post) ) diff --git a/goal_src/jak1/levels/sunken/sunken-pipegame.gc b/goal_src/jak1/levels/sunken/sunken-pipegame.gc index 515a81afdeb..7fef3ba56a6 100644 --- a/goal_src/jak1/levels/sunken/sunken-pipegame.gc +++ b/goal_src/jak1/levels/sunken/sunken-pipegame.gc @@ -509,13 +509,12 @@ (suspend) (send-event (handle->process (-> self prize 0 actor-handle)) 'anim #f) (go sunken-pipegame-idle) - (none) ) ) (defstate sunken-pipegame-idle (sunken-pipegame) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (when (= (-> proc type) sunken-pipegame-button) (set! (-> self challenge) (-> (the-as sunken-pipegame-button proc) button-id)) @@ -528,13 +527,12 @@ (loop (suspend) ) - (none) ) ) (defstate sunken-pipegame-begin-play (sunken-pipegame) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notify) (case (-> proc type) ((fuel-cell buzzer) @@ -554,7 +552,6 @@ ) ) ) - (none) ) :code (behavior () (local-vars (v1-112 symbol)) @@ -802,7 +799,6 @@ ) (ambient-hint-spawn "st-lose" (the-as vector #f) *entity-pool* 'stinger) (go sunken-pipegame-end-play) - (none) ) ) @@ -813,7 +809,6 @@ (kill-current-level-hint '(camera) '() 'exit) ) (go sunken-pipegame-end-play) - (none) ) ) @@ -838,7 +833,6 @@ ) ) (go sunken-pipegame-idle) - (none) ) ) diff --git a/goal_src/jak1/levels/sunken/sunken-water.gc b/goal_src/jak1/levels/sunken/sunken-water.gc index 7116aef42d0..5de826c8524 100644 --- a/goal_src/jak1/levels/sunken/sunken-water.gc +++ b/goal_src/jak1/levels/sunken/sunken-water.gc @@ -88,15 +88,15 @@ (defstate water-vol-idle (sunken-water) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notify) - (if (= (-> event param 0) 'attack) + (if (= (-> block param 0) 'attack) (sound-play "get-shocked") ) ) (else - ((-> (method-of-type water-anim water-vol-idle) event) proc arg1 event-type event) + ((-> (method-of-type water-anim water-vol-idle) event) proc argc message block) ) ) ) @@ -174,7 +174,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior sunken-water) ja-post) ) diff --git a/goal_src/jak1/levels/sunken/target-tube.gc b/goal_src/jak1/levels/sunken/target-tube.gc index d18f419d407..643954a2b50 100644 --- a/goal_src/jak1/levels/sunken/target-tube.gc +++ b/goal_src/jak1/levels/sunken/target-tube.gc @@ -425,13 +425,13 @@ ) (defstate target-tube-start (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) 'tube ) (else - (case event-type + (case message (('end-mode) (go target-jump @@ -441,20 +441,20 @@ ) ) (('touched) - (send-event proc 'attack (-> event param 0) 'tube 0 0) + (send-event proc 'attack (-> block param 0) 'tube 0 0) #f ) (('attack 'attack-or-shove 'attack-invinc) (target-attacked 'attack-or-shove - (the-as attack-info (-> event param 1)) + (the-as attack-info (-> block param 1)) proc - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) target-tube-hit ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -484,7 +484,6 @@ (send-event (handle->process (-> self tube tube)) 'end-mode) (target-exit) ) - (none) ) :code (behavior ((arg0 handle)) (send-event *camera* 'set-slave-option #x6000) @@ -536,7 +535,6 @@ (go target-tube) ) ) - (none) ) :post target-post ) @@ -597,7 +595,6 @@ :enter (behavior () (set! (-> self control unknown-surface00) *tube-mods*) (set! (-> self control surf) *tube-surface*) - (none) ) :exit (-> target-tube-start exit) :trans (behavior () @@ -612,7 +609,6 @@ ) (go target-tube-jump (-> *TARGET-bank* tube-jump-height-min) (-> *TARGET-bank* tube-jump-height-max)) ) - (none) ) :code (behavior () (case (ja-group) @@ -634,11 +630,9 @@ (target-tube-turn-anim) (suspend) ) - (none) ) :post (behavior () (target-tube-post) - (none) ) ) @@ -649,7 +643,6 @@ (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *tube-jump-mods*) - (none) ) :exit (-> target-tube-start exit) :trans (behavior () @@ -662,7 +655,6 @@ (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01))))) (-> *display* seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (ja-channel-push! 1 (seconds 0.05)) @@ -694,7 +686,6 @@ (suspend) (ja :group! (-> self draw art-group data 38) :num! (loop!)) ) - (none) ) :post (-> target-tube post) ) @@ -710,7 +701,6 @@ (-> self tube sidetube) (-> self tube foretube) ) - (none) ) :exit (behavior () (if (!= (-> self next-state name) 'target-tube-death) @@ -718,7 +708,6 @@ ) (logclear! (-> self state-flags) (state-flags sf02 do-not-notice grabbed first-person-mode)) ((-> target-tube-start exit)) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (let ((gp-0 (-> self attack-info))) @@ -810,7 +799,6 @@ ) ) (go target-tube) - (none) ) :post target-post ) @@ -823,7 +811,6 @@ (remove-setting! 'process-mask) (apply-settings *setting-control*) ((-> target-tube-start exit)) - (none) ) :code (behavior ((arg0 symbol)) (local-vars (v1-40 symbol)) @@ -854,7 +841,6 @@ (set! v1-40 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (not (movie?)))) ) (go target-tube) - (none) ) :post target-no-stick-post ) @@ -931,7 +917,6 @@ (eval-path-curve-div! (-> self path) (-> self root trans) 0.2 'interp) (path-control-method-12 (-> self path) (-> self rot) 0.2) (set! (-> self pos) 0.2) - (none) ) :trans (behavior () (if (and (and *target* (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) @@ -945,15 +930,14 @@ ) (go-virtual slide-control-ride) ) - (none) ) :code (the-as (function none :behavior slide-control) anim-loop) ) (defstate slide-control-ride (slide-control) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (go-virtual slide-control-watch) ) @@ -967,10 +951,10 @@ (if gp-0 (find-target-point (-> (the-as process-drawable gp-0) root trans)) ) - (set! (-> (the-as vector (-> event param 0)) quad) (-> self trans quad)) - (set! (-> (the-as vector (-> event param 1)) quad) (-> self rot quad)) - (set! (-> (the-as vector (-> event param 2)) quad) (-> self side quad)) - (eval-path-curve-div! (-> self path) (the-as vector (-> event param 3)) (+ 0.2 (-> self pos)) 'interp) + (set! (-> (the-as vector (-> block param 0)) quad) (-> self trans quad)) + (set! (-> (the-as vector (-> block param 1)) quad) (-> self rot quad)) + (set! (-> (the-as vector (-> block param 2)) quad) (-> self side quad)) + (eval-path-curve-div! (-> self path) (the-as vector (-> block param 3)) (+ 0.2 (-> self pos)) 'interp) (if (>= (-> self pos) (+ -0.2 (the float (+ (-> self path curve num-cverts) -1)))) (send-event gp-0 'end-mode) ) @@ -983,12 +967,10 @@ (set! (-> self pos) 0.0) (set! (-> self target) (process->handle *target*)) (process-entity-status! self (entity-perm-status bit-3) #t) - (none) ) :exit (behavior () (set! (-> self target) (the-as handle #f)) (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :trans (behavior () (let ((gp-0 (handle->process (-> self target)))) @@ -1002,7 +984,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior slide-control) anim-loop) ) diff --git a/goal_src/jak1/levels/sunken/wall-plat.gc b/goal_src/jak1/levels/sunken/wall-plat.gc index 93cb242cc2d..9ec64da9f41 100644 --- a/goal_src/jak1/levels/sunken/wall-plat.gc +++ b/goal_src/jak1/levels/sunken/wall-plat.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (deftype wall-plat (process-drawable) ((root-override collide-shape-moving :offset 112) (use-sync? symbol :offset-assert 176) @@ -38,8 +37,8 @@ ) (defstate wall-plat-retracted (wall-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go wall-plat-extending) ) @@ -54,23 +53,20 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) (defstate wall-plat-extending (wall-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) ) :enter (behavior () (sound-play "wall-plat") - (none) ) :trans (the-as (function none :behavior wall-plat) rider-trans) :code (behavior () @@ -87,14 +83,13 @@ (go wall-plat-extended) ) ) - (none) ) :post (the-as (function none :behavior wall-plat) rider-post) ) (defstate wall-plat-extended (wall-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go wall-plat-retracting) ) @@ -108,23 +103,20 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) (defstate wall-plat-retracting (wall-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) ) :enter (behavior () (sound-play "wall-plat") - (none) ) :trans (the-as (function none :behavior wall-plat) rider-trans) :code (behavior () @@ -140,28 +132,24 @@ (go wall-plat-retracted) ) ) - (none) ) :post (the-as (function none :behavior wall-plat) rider-post) ) (defstate wall-plat-sync-idle (wall-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (the-as (function none :behavior wall-plat) rider-trans) :code (behavior () @@ -193,7 +181,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior wall-plat) rider-post) ) diff --git a/goal_src/jak1/levels/sunken/wedge-plats.gc b/goal_src/jak1/levels/sunken/wedge-plats.gc index b5b8346b964..364925c11d0 100644 --- a/goal_src/jak1/levels/sunken/wedge-plats.gc +++ b/goal_src/jak1/levels/sunken/wedge-plats.gc @@ -11,7 +11,6 @@ ;; DECOMP BEGINS - (deftype wedge-plat-master (process) ((center vector :inline :offset-assert 112) (rotspeed float :offset-assert 128) @@ -43,7 +42,6 @@ ) (suspend) ) - (none) ) ) @@ -118,13 +116,12 @@ ) (defstate wedge-plat-idle (wedge-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as symbol (baseplat-method-22 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + ) ) :trans (the-as (function none :behavior wedge-plat) plat-trans) :code (behavior () @@ -135,23 +132,21 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior wedge-plat) plat-post) ) (defstate wedge-plat-tip (wedge-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as symbol (baseplat-method-22 self)) - ) - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) ) :trans (the-as (function none :behavior wedge-plat) plat-trans) :code (behavior () @@ -189,7 +184,6 @@ (ja :num! (seek! (ja-aframe 153.0 0))) ) (go wedge-plat-idle) - (none) ) :post (the-as (function none :behavior wedge-plat) plat-post) ) @@ -282,13 +276,12 @@ ) (defstate wedge-plat-outer-idle (wedge-plat-outer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as symbol (baseplat-method-22 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + ) ) :trans (the-as (function none :behavior wedge-plat-outer) plat-trans) :code (behavior () @@ -299,22 +292,20 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior wedge-plat-outer) plat-post) ) (defstate wedge-plat-outer-tip (wedge-plat-outer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (baseplat-method-22 self)) - ) - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + ) + ) ) :trans (the-as (function none :behavior wedge-plat-outer) plat-trans) :code (behavior () @@ -352,7 +343,6 @@ (ja :num! (seek! (ja-aframe 153.0 0))) ) (go wedge-plat-outer-idle) - (none) ) :post (the-as (function none :behavior wedge-plat-outer) plat-post) ) diff --git a/goal_src/jak1/levels/sunken/whirlpool.gc b/goal_src/jak1/levels/sunken/whirlpool.gc index 6ddc1143416..e80f4bd00ef 100644 --- a/goal_src/jak1/levels/sunken/whirlpool.gc +++ b/goal_src/jak1/levels/sunken/whirlpool.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype whirlpool (process-drawable) ((root-override collide-shape :offset 112) (spin-ry float :offset-assert 176) @@ -340,7 +339,6 @@ (update-vol! (-> self sound) (the int (* 100.0 f0-9))) ) ) - (none) ) :code (the-as (function none :behavior whirlpool) anim-loop) :post (the-as (function none :behavior whirlpool) ja-post) diff --git a/goal_src/jak1/levels/swamp/billy.gc b/goal_src/jak1/levels/swamp/billy.gc index 63b9b2cceb6..b2c30bfdb1a 100644 --- a/goal_src/jak1/levels/swamp/billy.gc +++ b/goal_src/jak1/levels/swamp/billy.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (deftype billy (process-taskable) ((child-override (pointer billy-snack) :offset 20) (farthy handle :offset-assert 384) @@ -81,14 +80,13 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior billy-snack) ja-post) ) (defstate billy-snack-idle (billy-snack) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('eat) (go billy-snack-eat) ) @@ -102,7 +100,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior billy-snack) ja-post) ) @@ -141,7 +138,6 @@ :virtual #t :enter (behavior () (go-virtual nav-enemy-chase) - (none) ) :post (the-as (function none :behavior billy-rat) nav-enemy-common-post) ) @@ -158,14 +154,12 @@ ) (send-event (ppointer->process (-> self billy)) 'billy-rat-die) (cleanup-for-death self) - (none) ) ) (defstate billy-rat-eat (billy-rat) :trans (behavior () (seek-to-point-toward-point! (-> self collide-info) (-> self destination) 131072.0 (seconds 0.01)) - (none) ) :code (behavior () (send-event (handle->process (-> self snack)) 'eat) @@ -180,7 +174,6 @@ (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) (logclear! (-> self nav flags) (nav-control-flags navcf19)) (go-virtual nav-enemy-chase) - (none) ) :post (the-as (function none :behavior billy-rat) nav-enemy-simple-post) ) @@ -210,7 +203,6 @@ (go billy-rat-eat) (go-virtual nav-enemy-chase) ) - (none) ) :post (the-as (function none :behavior billy-rat) nav-enemy-simple-post) ) @@ -230,7 +222,6 @@ (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) ) ) - (none) ) ) @@ -238,7 +229,6 @@ :virtual #t :enter (behavior () (go-virtual nav-enemy-chase) - (none) ) ) @@ -251,12 +241,10 @@ ) (go-virtual nav-enemy-victory) ) - (none) ) :post (behavior () (swamp-rat-update-wiggle-target (-> self destination)) (nav-enemy-travel-post) - (none) ) ) @@ -471,23 +459,22 @@ ) (defstate billy-done (billy) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('billy-rat-needs-destination) - (let* ((gp-0 proc) - (v1-2 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) billy-rat)) - gp-0 - ) - ) - ) - (when v1-2 - (set! (-> (the-as billy-rat v1-2) dest-type) (the-as uint 1)) - (get-random-point (-> self path-waypts) (-> (the-as billy-rat v1-2) destination)) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('billy-rat-needs-destination) + (let* ((gp-0 proc) + (v1-2 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) billy-rat)) + gp-0 ) - ) - ) - ) + ) + ) + (when v1-2 + (set! (-> (the-as billy-rat v1-2) dest-type) (the-as uint 1)) + (get-random-point (-> self path-waypts) (-> (the-as billy-rat v1-2) destination)) + ) + ) + ) + ) ) :enter (behavior () (init! @@ -530,13 +517,11 @@ ) ) ) - (none) ) :exit (behavior () (billy-kill-all-but-farthy) (send-event *camera* 'change-target *target*) (send-event *camera* 'change-state *camera-base-mode* 0) - (none) ) :trans (behavior () (cond @@ -566,12 +551,10 @@ ) ) (spool-push *art-control* "billy-reject" 0 self -99.0) - (none) ) :code (the-as (function none :behavior billy) process-taskable-anim-loop) :post (behavior () (ja-post) - (none) ) ) @@ -758,8 +741,8 @@ ) (defstate billy-playing (billy) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('billy-rat-die) (+! (-> self num-rats) -1) (let* ((f0-2 (rand-float-gen)) @@ -928,19 +911,16 @@ (set! a1-8 (car gp-2)) ) ) - (none) ) :exit (behavior () (restore-collide-with-as (-> self root-override)) (restore-load-state-and-cleanup *load-state*) (set! (-> *ACTOR-bank* birth-max) 1000) (remove-setting! 'music) - (none) ) :trans (behavior () (spool-push *art-control* "billy-resolution" 0 self -99.0) (spool-push *art-control* "billy-reject" 0 self -99.0) - (none) ) :code (behavior () (loop @@ -953,11 +933,9 @@ ) (suspend) ) - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -977,7 +955,6 @@ ) ) ) - (none) ) ) @@ -1049,7 +1026,6 @@ :exit (behavior () (billy-kill-all-but-farthy) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) ) @@ -1082,7 +1058,6 @@ ) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/swamp/kermit.gc b/goal_src/jak1/levels/swamp/kermit.gc index 6c82c62464f..c1be4bb993b 100644 --- a/goal_src/jak1/levels/swamp/kermit.gc +++ b/goal_src/jak1/levels/swamp/kermit.gc @@ -10,7 +10,6 @@ ;; DECOMP BEGINS - (defpartgroup group-kermit-charging-up :id 298 :bounds (static-bspherem 0 5 0 5) @@ -515,21 +514,19 @@ (defstate kermit-pulse-idle (kermit-pulse) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) - (send-event proc 'attack (-> event param 0) (new 'static 'attack-info)) + (send-event proc 'attack (-> block param 0) (new 'static 'attack-info)) (go kermit-pulse-impact) ) ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :code (behavior () (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) @@ -547,11 +544,9 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (behavior () (update-transforms! (-> self root-override)) - (none) ) ) @@ -570,7 +565,6 @@ :to *entity-pool* ) (cleanup-for-death self) - (none) ) ) @@ -903,7 +897,6 @@ nav-enemy-default-event-handler :enter (behavior () (set! (-> self notice-time) 0) 0 - (none) ) :trans (behavior () (if (and *target* (>= (-> self enemy-info idle-distance) @@ -912,7 +905,6 @@ nav-enemy-default-event-handler ) (go kermit-patrol) ) - (none) ) :code (behavior () (kermit-disable-tongue) @@ -921,7 +913,6 @@ nav-enemy-default-event-handler (ja :num! (loop!)) (suspend) ) - (none) ) :post (the-as (function none :behavior kermit) ja-post) ) @@ -936,7 +927,6 @@ nav-enemy-default-event-handler (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) (kermit-get-new-patrol-point) (nav-control-method-11 (-> self nav) (-> self nav target-pos)) - (none) ) :trans (behavior () (if (and (or (not *target*) (< (-> self enemy-info idle-distance) @@ -954,7 +944,6 @@ nav-enemy-default-event-handler (if (logtest? (nav-control-flags navcf19) (-> self nav flags)) (kermit-get-new-patrol-point) ) - (none) ) :code (behavior () (loop @@ -965,7 +954,6 @@ nav-enemy-default-event-handler ) (kermit-hop 20480.0) ) - (none) ) :post kermit-post ) @@ -977,18 +965,15 @@ nav-enemy-default-event-handler ) :enter (behavior () (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) - (none) ) :trans (behavior () (kermit-set-rotate-dir-to-player) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) (kermit-hop 0.0) (go kermit-chase) - (none) ) :post kermit-post ) @@ -1000,11 +985,9 @@ nav-enemy-default-event-handler ) :enter (behavior () (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) - (none) ) :code (behavior () (go kermit-patrol) - (none) ) :post kermit-simple-post ) @@ -1037,7 +1020,6 @@ nav-enemy-default-event-handler ) ) (nav-control-method-11 (-> self nav) (-> self nav target-pos)) - (none) ) :trans (behavior () (when (not (-> self airborne)) @@ -1049,7 +1031,6 @@ nav-enemy-default-event-handler (go kermit-chase) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.17)) @@ -1064,7 +1045,6 @@ nav-enemy-default-event-handler (kermit-hop 81920.0) (nop!) ) - (none) ) :post kermit-post ) @@ -1079,7 +1059,6 @@ nav-enemy-default-event-handler (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) (kermit-set-nav-mesh-target (-> self collide-info trans)) (nav-control-method-11 (-> self nav) (-> self nav target-pos)) - (none) ) :trans (behavior () (kermit-set-nav-mesh-target (-> self collide-info trans)) @@ -1112,7 +1091,6 @@ nav-enemy-default-event-handler (go kermit-give-up) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.17)) @@ -1126,7 +1104,6 @@ nav-enemy-default-event-handler (kermit-hop 81920.0) ) ) - (none) ) :post kermit-post ) @@ -1181,7 +1158,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) :post kermit-simple-post ) @@ -1197,7 +1173,6 @@ nav-enemy-default-event-handler (kermit-enable-tongue) (set! (-> self tongue-pulse-pos) 0.0) (spawn-kermit-pulse self (kermit-tongue-pos self) (-> self entity)) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) @@ -1206,7 +1181,6 @@ nav-enemy-default-event-handler (deactivate (-> v1-0 0)) ) ) - (none) ) :trans (behavior () (let ((s5-0 (kermit-player-target-pos)) @@ -1240,7 +1214,6 @@ nav-enemy-default-event-handler ) (send-event *target* 'tongue gp-0) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1252,12 +1225,10 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) ) - (none) ) :post (behavior () (seek-to-point-toward-point! (-> self collide-info) (target-pos 0) (-> self rotate-speed) (seconds 0.05)) (kermit-simple-post) - (none) ) ) @@ -1270,12 +1241,10 @@ nav-enemy-default-event-handler (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self charged-up) #f) (+! (-> self miss-count) 1) - (none) ) :exit (behavior () (set! (-> self tongue-control forward-scale-control) 0.0) (kermit-disable-tongue) - (none) ) :trans (behavior () (kermit-set-nav-mesh-target (-> self collide-info trans)) @@ -1287,7 +1256,6 @@ nav-enemy-default-event-handler (go kermit-chase) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1310,7 +1278,6 @@ nav-enemy-default-event-handler ) (kermit-hop 0.0) ) - (none) ) :post kermit-post ) diff --git a/goal_src/jak1/levels/swamp/swamp-bat.gc b/goal_src/jak1/levels/swamp/swamp-bat.gc index 64143d44d73..b725cdeafe9 100644 --- a/goal_src/jak1/levels/swamp/swamp-bat.gc +++ b/goal_src/jak1/levels/swamp/swamp-bat.gc @@ -10,7 +10,6 @@ ;; DECOMP BEGINS - (deftype swamp-bat-idle-path (structure) ((origin vector :inline :offset-assert 0) (x-axis vector :inline :offset-assert 16) @@ -253,7 +252,6 @@ swamp-bat-slave-event-handler (+! f30-2 (* 32768.0 (-> *display* seconds-per-frame) (-> self idle-anim-speed))) ) ) - (none) ) :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) ) @@ -284,7 +282,6 @@ swamp-bat-slave-event-handler ) ) ) - (none) ) :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) ) @@ -312,7 +309,6 @@ swamp-bat-slave-event-handler (ja :num! (loop!)) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) ) @@ -330,7 +326,6 @@ swamp-bat-slave-event-handler (ja :num! (loop!)) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) ) @@ -361,7 +356,6 @@ swamp-bat-slave-event-handler (suspend) ) ) - (none) ) :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) ) @@ -389,7 +383,6 @@ swamp-bat-slave-event-handler ) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) ) @@ -542,7 +535,6 @@ swamp-bat-slave-event-handler ) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-bat) #f) ) @@ -578,7 +570,6 @@ swamp-bat-slave-event-handler ) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-bat) #f) ) diff --git a/goal_src/jak1/levels/swamp/swamp-obs.gc b/goal_src/jak1/levels/swamp/swamp-obs.gc index 8fe9a4b585b..57206cd0158 100644 --- a/goal_src/jak1/levels/swamp/swamp-obs.gc +++ b/goal_src/jak1/levels/swamp/swamp-obs.gc @@ -12,7 +12,6 @@ ;; DECOMP BEGINS - (defpartgroup group-swamp-spike-up :id 289 :duration (seconds 0.017) @@ -264,22 +263,20 @@ ) ) ) - (none) ) :post swamp-spike-post ) (defstate swamp-spike-gate-up (swampgate) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('trigger) - (let ((v0-0 #t)) - (set! (-> self open-gate) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (let ((v0-0 #t)) + (set! (-> self open-gate) v0-0) + v0-0 + ) + ) + ) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -305,7 +302,6 @@ (ja :num! (seek!)) ) (go swamp-spike-gate-down) - (none) ) :post (the-as (function none :behavior swampgate) swamp-spike-post) ) @@ -314,7 +310,6 @@ :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior swampgate) swamp-spike-post) ) @@ -412,16 +407,15 @@ ) (defstate balance-plat-idle (balance-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('grow) - (let ((v0-0 #t)) - (set! (-> self got-grow) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('grow) + (let ((v0-0 #t)) + (set! (-> self got-grow) v0-0) + v0-0 + ) + ) + ) ) :trans (the-as (function none :behavior balance-plat) rider-trans) :code (behavior () @@ -470,7 +464,6 @@ (set! (-> self root-override trans y) (+ (-> self y-init) (-> self y-offset))) (suspend) ) - (none) ) :post (the-as (function none :behavior balance-plat) rider-post) ) @@ -624,16 +617,15 @@ ) (cleanup-for-death self) (deactivate self) - (none) ) :post (the-as (function none :behavior swamp-rock) ja-post) ) (defstate swamp-rock-idle (swamp-rock) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (if (and (>= arg1 2) (= (-> event param 1) 'eco-yellow)) + (if (and (>= argc 2) (= (-> block param 1) 'eco-yellow)) (go swamp-rock-break) ) ) @@ -645,7 +637,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) @@ -767,13 +758,11 @@ :virtual #t :enter (behavior () (ja-channel-set! 0) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior tar-plat) ja-post) ) @@ -801,7 +790,6 @@ (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -810,7 +798,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior tar-plat) rigid-body-platform-post) ) @@ -912,7 +899,6 @@ ) ) (go-virtual battlecontroller-active) - (none) ) ) @@ -925,6 +911,5 @@ (-> (method-of-type battlecontroller battlecontroller-die) code) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/swamp/swamp-rat-nest.gc b/goal_src/jak1/levels/swamp/swamp-rat-nest.gc index 65041d00ee0..04251614b61 100644 --- a/goal_src/jak1/levels/swamp/swamp-rat-nest.gc +++ b/goal_src/jak1/levels/swamp/swamp-rat-nest.gc @@ -11,7 +11,6 @@ ;; DECOMP BEGINS - (defpartgroup group-swamp-rat-nest-a-explosion :id 292 :duration (seconds 0.017) @@ -715,7 +714,6 @@ (ja :num-func num-func-identity :frame-num max) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) ) @@ -727,7 +725,6 @@ (if (<= (-> self parent-process 0 hit-points) 0) (go swamp-rat-nest-dummy-die) ) - (none) ) :code (behavior () (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) @@ -739,7 +736,6 @@ (ja :num! (seek!)) ) (go swamp-rat-nest-dummy-idle) - (none) ) :post (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) ) @@ -753,7 +749,6 @@ (ja :num! (seek!)) ) (go swamp-rat-nest-dummy-idle) - (none) ) :post (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) ) @@ -782,7 +777,6 @@ (suspend) ) (deactivate self) - (none) ) ) @@ -901,8 +895,8 @@ swamp-rat-nest-default-event-handler ) (defstate swamp-rat-nest-idle (swamp-rat-nest) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hit) (go swamp-rat-nest-active) ) @@ -910,7 +904,6 @@ swamp-rat-nest-default-event-handler ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (and *target* (>= (-> self fact-override idle-distance) @@ -919,14 +912,12 @@ swamp-rat-nest-default-event-handler ) (go swamp-rat-nest-active) ) - (none) ) :code (behavior () (swamp-rat-nest-check-dummy) (loop (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-rat-nest) #f) ) @@ -935,7 +926,6 @@ swamp-rat-nest-default-event-handler :event swamp-rat-nest-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (swamp-rat-nest-check-dummy) @@ -956,13 +946,11 @@ swamp-rat-nest-default-event-handler ) ) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-rat-nest) #f) ) @@ -971,7 +959,6 @@ swamp-rat-nest-default-event-handler :event swamp-rat-nest-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (swamp-rat-nest-check-dummy) @@ -982,13 +969,11 @@ swamp-rat-nest-default-event-handler (swamp-rat-nest-spawn-rat) (go swamp-rat-nest-active) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-rat-nest) #f) ) @@ -1012,7 +997,6 @@ swamp-rat-nest-default-event-handler ) ) (go swamp-rat-nest-active) - (none) ) :post (the-as (function none :behavior swamp-rat-nest) #f) ) @@ -1026,7 +1010,6 @@ swamp-rat-nest-default-event-handler (while (-> self child-process) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-rat-nest) #f) ) diff --git a/goal_src/jak1/levels/swamp/swamp-rat.gc b/goal_src/jak1/levels/swamp/swamp-rat.gc index 86c34ff3d74..1c7793a3eb9 100644 --- a/goal_src/jak1/levels/swamp/swamp-rat.gc +++ b/goal_src/jak1/levels/swamp/swamp-rat.gc @@ -11,7 +11,6 @@ ;; DECOMP BEGINS - (deftype swamp-rat (nav-enemy) ((up-vector vector :inline :offset-assert 400) (state-float float :offset-assert 416) @@ -63,14 +62,14 @@ ) ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 7] (defbehavior swamp-rat-default-event-handler swamp-rat ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (if (= v1-0 'victory) - (go-virtual nav-enemy-victory) - (nav-enemy-default-event-handler arg0 arg1 arg2 arg3) - ) - ) + (case arg2 + (('victory) + (go-virtual nav-enemy-victory) + ) + (else + (nav-enemy-default-event-handler arg0 arg1 arg2 arg3) + ) ) ) @@ -116,7 +115,6 @@ swamp-rat-default-event-handler :event swamp-rat-default-event-handler :post (behavior () (ja-post) - (none) ) ) @@ -136,7 +134,6 @@ swamp-rat-default-event-handler ) ) ) - (none) ) ) @@ -154,7 +151,6 @@ swamp-rat-default-event-handler ) (ja-no-eval :num! (seek!)) (go-virtual nav-enemy-chase) - (none) ) ) @@ -197,7 +193,6 @@ swamp-rat-default-event-handler (go-virtual nav-enemy-victory) ) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) - (none) ) :code (behavior () (set! (-> self target-nav-time) (-> *display* base-frame-counter)) @@ -214,12 +209,10 @@ swamp-rat-default-event-handler (suspend) (ja :num! (loop!)) ) - (none) ) :post (behavior () (swamp-rat-update-wiggle-target (target-pos 0)) (nav-enemy-travel-post) - (none) ) ) @@ -258,7 +251,6 @@ swamp-rat-default-event-handler ) ) ) - (none) ) ) @@ -286,7 +278,6 @@ swamp-rat-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -301,7 +292,6 @@ swamp-rat-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-victory) - (none) ) ) @@ -363,7 +353,6 @@ swamp-rat-default-event-handler (go-virtual nav-enemy-chase) (go-virtual nav-enemy-idle) ) - (none) ) :post (the-as (function none :behavior swamp-rat) nav-enemy-simple-post) ) diff --git a/goal_src/jak1/levels/title/title-obs.gc b/goal_src/jak1/levels/title/title-obs.gc index 931439edbce..7acf56ee139 100644 --- a/goal_src/jak1/levels/title/title-obs.gc +++ b/goal_src/jak1/levels/title/title-obs.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype logo (process-drawable) ((camera handle :offset-assert 176) (camera-anim handle :offset-assert 184) @@ -108,29 +107,28 @@ (defstate idle (logo-slave) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 uint)) - (the-as object (case event-type - (('blend-shape) - (cond - ((-> event param 0) - (set! v0-0 (the-as uint (logior (-> self skel status) (janim-status blerc eye)))) - (set! (-> self skel status) (the-as janim-status v0-0)) - ) - (else - (set! v0-0 (the-as uint (logclear (-> self skel status) (janim-status blerc eye)))) - (set! (-> self skel status) (the-as janim-status v0-0)) - ) - ) - v0-0 - ) - (('origin-joint-index) - (set! v0-0 (-> event param 0)) - (set! (-> self draw origin-joint-index) v0-0) - v0-0 - ) - ) - ) + (case message + (('blend-shape) + (cond + ((-> block param 0) + (set! v0-0 (the-as uint (logior (-> self skel status) (janim-status blerc eye)))) + (set! (-> self skel status) (the-as janim-status v0-0)) + ) + (else + (set! v0-0 (the-as uint (logclear (-> self skel status) (janim-status blerc eye)))) + (set! (-> self skel status) (the-as janim-status v0-0)) + ) + ) + v0-0 + ) + (('origin-joint-index) + (set! v0-0 (-> block param 0)) + (set! (-> self draw origin-joint-index) v0-0) + v0-0 + ) + ) ) :code (behavior () (ja-post) @@ -151,7 +149,6 @@ ) (suspend) ) - (none) ) ) @@ -177,13 +174,12 @@ (defstate startup (logo) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('update) - (the-as symbol (remove-setting! 'process-mask)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('update) + (remove-setting! 'process-mask) + ) + ) ) :exit (behavior () (let ((a0-0 (-> self anim))) @@ -198,7 +194,6 @@ ) ) ) - (none) ) :trans (behavior () (if (not (none-reserved? *art-control*)) @@ -207,7 +202,6 @@ (if (nonzero? (-> self next-anim)) (spool-push *art-control* (-> self next-anim name) 0 self -1.0) ) - (none) ) :code (behavior () (while (!= (file-status *art-control* (-> self next-anim name) 0) 'active) @@ -338,7 +332,6 @@ ) (remove-exit) (go-virtual idle) - (none) ) :post (behavior () (if *progress-process* @@ -372,7 +365,6 @@ (set-trs! (-> self main-joint) a1-0 (the-as quaternion #f) a3-0) ) (ja-post) - (none) ) ) @@ -416,7 +408,6 @@ (the-as (function process-drawable symbol) false-func) ) ) - (none) ) :post (-> (method-of-type logo startup) post) ) @@ -427,7 +418,6 @@ (if (nonzero? (-> self next-anim)) (spool-push *art-control* (-> self next-anim name) 0 self -1.0) ) - (none) ) :code (behavior () (ja-channel-set! 0) @@ -450,19 +440,17 @@ (set! *camera-look-through-other* 2) (suspend) ) - (none) ) ) (defstate ndi (logo) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('blackout) - (the-as symbol (set-setting! 'bg-a 'abs 1.0 0)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('blackout) + (set-setting! 'bg-a 'abs 1.0 0) + ) + ) ) :enter (behavior () (set-setting! 'bg-a 'abs 0.0 0) @@ -472,12 +460,10 @@ (set! (-> *time-of-day-proc* 0 hour) 12) ) (set! (-> self done?) #f) - (none) ) :exit (behavior () ((-> (method-of-type logo startup) exit)) (set-blackout-frames (seconds 0.035)) - (none) ) :trans (behavior () ((-> (method-of-type logo startup) trans)) @@ -512,7 +498,6 @@ (if *time-of-day-proc* (set! (-> *time-of-day-proc* 0 hour) 12) ) - (none) ) :code (behavior () (while (!= (file-status *art-control* (-> self next-anim name) 0) 'active) @@ -572,11 +557,9 @@ (set! (-> self done?) #t) (set-setting! 'bg-a 'abs 1.0 0) (anim-loop) - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -596,15 +579,15 @@ (initialize-skeleton self *logo-japan-sg* '()) (initialize-skeleton self *logo-sg* '()) ) - (case (scf-get-territory) - ((GAME_TERRITORY_SCEI) - (initialize-skeleton self *logo-japan-sg* '()) - ) - (else - (initialize-skeleton self *logo-sg* '()) + (case (scf-get-territory) + ((GAME_TERRITORY_SCEI) + (initialize-skeleton self *logo-japan-sg* '()) + ) + (else + (initialize-skeleton self *logo-sg* '()) + ) ) ) - ) (set! (-> self main-joint) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) self 3)) (set! (-> self main-joint max-dist) (the-as meters #t)) (set! (-> self next-anim) (new 'static 'spool-anim @@ -685,7 +668,6 @@ (ja-channel-set! 0) (ja-post) (send-event *camera* 'change-state cam-fixed 0) - (none) ) :exit (behavior () (when (not (or (= (-> self next-state name) 'target-title-play) (= (-> self next-state name) 'target-title-wait))) @@ -693,16 +675,14 @@ (deactivate (-> self manipy 0)) ) ) - (none) ) :trans (behavior () (hide-hud-quick) (spool-push *art-control* "ndi-intro" 0 self -1.0) ;; og:preserve-this PAL patch here (if *sound-player-enable* - (sound-group-pause (sound-group music)) + (sound-group-pause (sound-group music)) ) - (none) ) :code (behavior () (let ((gp-0 (the-as handle #f))) @@ -792,32 +772,27 @@ ) ) (go target-title-play) - (none) ) :post target-no-move-post ) (defstate target-title-play (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'wait) - (go target-title-wait) - ) - ((= v1-0 'reset) - (the-as object (deactivate (-> self manipy 0))) - ) - (else - (target-generic-event-handler proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('wait) + (go target-title-wait) + ) + (('reset) + (deactivate (-> self manipy 0)) + ) + (else + (target-generic-event-handler proc argc message block) + ) ) ) :enter (behavior () (set-setting! 'allow-pause #f 0.0 0) (set-setting! 'allow-progress #f 0.0 0) - (none) ) :exit (-> target-title exit) :trans (the-as (function none :behavior target) hide-hud-quick) @@ -826,20 +801,17 @@ ) (defstate target-title-wait (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'play) - (go target-title-play) - ) - ((= v1-0 'reset) - (the-as object (deactivate (-> self manipy 0))) - ) - (else - (target-generic-event-handler proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('play) + (go target-title-play) + ) + (('reset) + (deactivate (-> self manipy 0)) + ) + (else + (target-generic-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -852,7 +824,6 @@ (set! (-> *time-of-day-proc* 0 time-ratio) 18000.0) (set! *time-of-day-fast* #t) ) - (none) ) :exit (behavior () (when *time-of-day-proc* @@ -863,7 +834,6 @@ (remove-setting! 'allow-pause) (remove-setting! 'allow-progress) ((-> target-title exit)) - (none) ) :trans (behavior () (hide-hud-quick) @@ -890,7 +860,6 @@ (print-game-text (lookup-text! *common-text* (text-id press-start) #f) gp-0 #f 128 22) ) ) - (none) ) :code (the-as (function none :behavior target) anim-loop) :post target-no-move-post diff --git a/goal_src/jak1/levels/training/training-obs.gc b/goal_src/jak1/levels/training/training-obs.gc index 10463b12766..c5b1a65696c 100644 --- a/goal_src/jak1/levels/training/training-obs.gc +++ b/goal_src/jak1/levels/training/training-obs.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype training-water (water-anim) () :heap-base #x70 @@ -206,7 +205,6 @@ ) (suspend) ) - (none) ) ) @@ -586,105 +584,100 @@ (defstate idle (scarecrow-a) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (let* ((s3-0 (-> event param 2)) - (s4-0 (get-task-control (game-task training-gimmie))) - (v1-2 (get-reminder s4-0 0)) - ) - (when (!= s3-0 (-> self incomming-attack-id)) - (set! (-> self incomming-attack-id) s3-0) - (cond - ((= (-> self type) scarecrow-b) - ) - ((and (= (-> event param 1) 'spin) (zero? v1-2)) - (save-reminder s4-0 1 0) - 1 - ) - ((and (= (-> event param 1) 'punch) (= v1-2 1)) - (save-reminder s4-0 2 0) - 2 - ) - ((zero? v1-2) - ) - ((= v1-2 1) - ) - ) - (let* ((s4-1 proc) - (v1-14 (if (and (nonzero? s4-1) (type-type? (-> s4-1 type) process-drawable)) - s4-1 - ) - ) - (f30-0 - (cond - (v1-14 - (let ((s4-2 (-> self root-override)) - (s2-0 (-> (the-as process-drawable v1-14) root trans)) - ) - (deg-diff (y-angle s4-2) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-2 trans)))) - ) - ) - (else - 0.0 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let* ((s3-0 (-> block param 2)) + (s4-0 (get-task-control (game-task training-gimmie))) + (v1-2 (get-reminder s4-0 0)) + ) + (when (!= s3-0 (-> self incomming-attack-id)) + (set! (-> self incomming-attack-id) s3-0) + (cond + ((= (-> self type) scarecrow-b) + ) + ((and (= (-> block param 1) 'spin) (zero? v1-2)) + (save-reminder s4-0 1 0) + 1 + ) + ((and (= (-> block param 1) 'punch) (= v1-2 1)) + (save-reminder s4-0 2 0) + 2 + ) + ((zero? v1-2) + ) + ((= v1-2 1) + ) + ) + (let* ((s4-1 proc) + (v1-14 (if (and (nonzero? s4-1) (type-type? (-> s4-1 type) process-drawable)) + s4-1 + ) + ) + (f30-0 + (cond + (v1-14 + (let ((s4-2 (-> self root-override)) + (s2-0 (-> (the-as process-drawable v1-14) root trans)) + ) + (deg-diff (y-angle s4-2) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-2 trans)))) ) ) + (else + 0.0 + ) ) - (a0-24 ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint -1) - ) - ) ) - (go-virtual - hit - f30-0 - (if a0-24 - (get-middle-of-bsphere-overlap a0-24 (-> self intersection)) - (target-pos 0) - ) - (the-as - symbol - (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 2) + (a0-24 ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint -1) + ) ) - (or (= (-> self type) scarecrow-a) - (and (= (-> proc type) target) - (logtest? (-> (the-as target proc) control unknown-surface00 flags) (surface-flags jump)) - (not (logtest? (-> (the-as target proc) control status) (cshape-moving-flags onsurf))) - ) - ) - ) + ) + (go-virtual + hit + f30-0 + (if a0-24 + (get-middle-of-bsphere-overlap a0-24 (-> self intersection)) + (target-pos 0) ) + (the-as + symbol + (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 2) + ) + (or (= (-> self type) scarecrow-a) + (and (= (-> proc type) target) + (logtest? (-> (the-as target proc) control unknown-surface00 flags) (surface-flags jump)) + (not (logtest? (-> (the-as target proc) control status) (cshape-moving-flags onsurf))) + ) + ) + ) ) ) ) ) ) - (('touch) - (the-as object (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> event param 0)) - 0.7 - 6144.0 - 16384.0 - ) - ) + ) + (('touch) + (send-shove-back + (-> self root-override) + proc + (the-as touching-shapes-entry (-> block param 0)) + 0.7 + 6144.0 + 16384.0 ) - ) + ) ) ) :trans (behavior () (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (get-reminder (get-task-control (game-task training-gimmie)) 0) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.12)) @@ -695,7 +688,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior scarecrow-a) ja-post) ) @@ -771,7 +763,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior scarecrow-a) ja-post) ) @@ -833,7 +824,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior scarecrow-b) ja-post) ) @@ -912,7 +902,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior scarecrow-b) ja-post) ) diff --git a/goal_src/jak1/levels/village1/assistant.gc b/goal_src/jak1/levels/village1/assistant.gc index ab2f22b4edb..ff7dbbd8032 100644 --- a/goal_src/jak1/levels/village1/assistant.gc +++ b/goal_src/jak1/levels/village1/assistant.gc @@ -278,7 +278,6 @@ ) ) ) - (none) ) ) @@ -357,7 +356,7 @@ (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (launch-particles (-> *part-id-table* 367) gp-0 :rate 1.0) + (launch-particles (-> *part-id-table* 367) gp-0) ) ) (none) diff --git a/goal_src/jak1/levels/village1/explorer.gc b/goal_src/jak1/levels/village1/explorer.gc index 422eda649ee..1ed9f3b37da 100644 --- a/goal_src/jak1/levels/village1/explorer.gc +++ b/goal_src/jak1/levels/village1/explorer.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype explorer (process-taskable) () :heap-base #x110 @@ -330,7 +329,6 @@ ) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/village1/fishermans-boat.gc b/goal_src/jak1/levels/village1/fishermans-boat.gc index 1fadecaa7c3..50a07158636 100644 --- a/goal_src/jak1/levels/village1/fishermans-boat.gc +++ b/goal_src/jak1/levels/village1/fishermans-boat.gc @@ -889,7 +889,6 @@ ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (fishermans-boat-leave-dock?) @@ -899,7 +898,6 @@ (if (nonzero? (-> self anim)) (spool-push *art-control* (-> self anim name) 0 self -99.0) ) - (none) ) :code (behavior () (set! (-> self anim) (new 'static 'spool-anim @@ -923,7 +921,6 @@ (fishermans-boat-set-dock-point 0) (fishermans-boat-set-path-point 0) (anim-loop) - (none) ) :post fishermans-boat-post ) @@ -938,7 +935,6 @@ (go fishermans-boat-player-control) ) (rider-trans) - (none) ) :code (behavior () (load-state-want-levels 'village1 'misty) @@ -967,7 +963,6 @@ (loop (suspend) ) - (none) ) :post fishermans-boat-post ) @@ -986,7 +981,6 @@ ) ) (rider-trans) - (none) ) :code (behavior () (load-state-want-levels 'village1 'beach) @@ -994,7 +988,6 @@ (fishermans-boat-set-dock-point 0) (fishermans-boat-set-path-point 5) (anim-loop) - (none) ) :post fishermans-boat-post ) @@ -1006,7 +999,6 @@ ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (fishermans-boat-leave-dock?) @@ -1016,7 +1008,6 @@ (if (nonzero? (-> self anim)) (spool-push *art-control* (-> self anim name) 0 self -99.0) ) - (none) ) :code (behavior () (if #t @@ -1066,7 +1057,6 @@ (fishermans-boat-set-dock-point 4) (fishermans-boat-set-path-point 4) (anim-loop) - (none) ) :post fishermans-boat-post ) @@ -1081,7 +1071,6 @@ (go fishermans-boat-player-control) ) (rider-trans) - (none) ) :code (behavior () (set! (-> self cam-tracker) @@ -1109,7 +1098,6 @@ (loop (suspend) ) - (none) ) :post fishermans-boat-post ) @@ -1126,7 +1114,6 @@ ) ) (rider-trans) - (none) ) :code (behavior () (set-continue! *game-info* "misty-start") @@ -1135,7 +1122,6 @@ (loop (suspend) ) - (none) ) :post fishermans-boat-post ) @@ -1144,7 +1130,6 @@ :exit (behavior () (send-event *camera* 'change-state *camera-base-mode* 0) (set! (-> self auto-pilot) #t) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -1158,7 +1143,6 @@ ) ) 0 - (none) ) :code (behavior () (send-event (handle->process (-> self cam-tracker)) 'message 'release) @@ -1170,7 +1154,6 @@ ) (suspend) ) - (none) ) :post fishermans-boat-post ) @@ -1190,13 +1173,11 @@ (defstate fishermans-boat-measurements (fishermans-boat) :exit (behavior () (set! (-> self measure-parameters) #f) - (none) ) :trans (behavior () (if (cpad-pressed? 1 square) (go fishermans-boat-player-control) ) - (none) ) :code (behavior () (set! (-> self auto-pilot) #f) @@ -1234,7 +1215,6 @@ ) ) (go fishermans-boat-player-control) - (none) ) :post fishermans-boat-post ) @@ -1491,58 +1471,53 @@ :to self ) (go fishermans-boat-docked-misty) - (none) ) :post (behavior () (ja-post) (fishermans-boat-spawn-particles 81920.0) (fishermans-boat-play-sounds) - (none) ) ) (defstate fishermans-boat-ride-to-village1 (fishermans-boat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('evilbro) - (when (= (level-status *level* 'intro) 'active) - (let ((gp-1 (entity-by-name "evilbro-2"))) - (when gp-1 - (set! (-> self evilbro) - (ppointer->handle (manipy-spawn (-> self root-overlay trans) gp-1 *fb-evilbro-sg* #f :to self)) - ) - (send-event (handle->process (-> self evilbro)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> self evilbro)) 'blend-shape #t) - (send-event (handle->process (-> self evilbro)) 'center-joint 3) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('evilbro) + (when (= (level-status *level* 'intro) 'active) + (let ((gp-1 (entity-by-name "evilbro-2"))) + (when gp-1 + (set! (-> self evilbro) + (ppointer->handle (manipy-spawn (-> self root-overlay trans) gp-1 *fb-evilbro-sg* #f :to self)) + ) + (send-event (handle->process (-> self evilbro)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> self evilbro)) 'blend-shape #t) + (send-event (handle->process (-> self evilbro)) 'center-joint 3) ) - (let ((gp-2 (entity-by-name "evilsis-2"))) - (when gp-2 - (set! (-> self evilsis) - (ppointer->handle (manipy-spawn (-> self root-overlay trans) gp-2 *fb-evilsis-sg* #f :to self)) - ) - (send-event (handle->process (-> self evilsis)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> self evilsis)) 'blend-shape #t) - (send-event (handle->process (-> self evilsis)) 'center-joint 3) - ) + ) + (let ((gp-2 (entity-by-name "evilsis-2"))) + (when gp-2 + (set! (-> self evilsis) + (ppointer->handle (manipy-spawn (-> self root-overlay trans) gp-2 *fb-evilsis-sg* #f :to self)) + ) + (send-event (handle->process (-> self evilsis)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> self evilsis)) 'blend-shape #t) + (send-event (handle->process (-> self evilsis)) 'center-joint 3) ) ) ) - (('evilsis) - (let ((a0-44 (handle->process (-> self evilbro)))) - (if a0-44 - (deactivate a0-44) - ) - ) - (let ((a0-48 (handle->process (-> self evilsis)))) - (if a0-48 - (the-as object (deactivate a0-48)) - ) - ) + ) + (('evilsis) + (let ((a0-44 (handle->process (-> self evilbro)))) + (if a0-44 + (deactivate a0-44) + ) ) - ) + (let ((a0-48 (handle->process (-> self evilsis)))) + (if a0-48 + (deactivate a0-48) + ) + ) + ) ) ) :code (behavior () @@ -1593,12 +1568,10 @@ (fishermans-boat-play-sounds) (process-entity-status! self (entity-perm-status complete) #t) (go fishermans-boat-docked-village) - (none) ) :post (behavior () (ja-post) (fishermans-boat-spawn-particles 81920.0) (fishermans-boat-play-sounds) - (none) ) ) diff --git a/goal_src/jak1/levels/village1/sage.gc b/goal_src/jak1/levels/village1/sage.gc index f9599364d2f..ce70052f9ba 100644 --- a/goal_src/jak1/levels/village1/sage.gc +++ b/goal_src/jak1/levels/village1/sage.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype sage (process-taskable) ((reminder-played basic :offset-assert 380) (assistant handle :offset-assert 384) @@ -457,7 +456,6 @@ ) ) ((-> (method-of-type process-taskable idle) trans)) - (none) ) :code (behavior () (if (!= (ja-group) (get-art-elem self)) @@ -491,7 +489,6 @@ ) ) ) - (none) ) ) @@ -524,7 +521,6 @@ (start 'play (get-continue-by-name *game-info* "game-start")) ) ) - (none) ) :trans (behavior () (case (get-task-status (game-task intro)) @@ -533,7 +529,6 @@ ) ) ((-> (method-of-type process-taskable play-anim) trans)) - (none) ) ) diff --git a/goal_src/jak1/levels/village1/sequence-a-village1.gc b/goal_src/jak1/levels/village1/sequence-a-village1.gc index 8093b180665..5911db89c11 100644 --- a/goal_src/jak1/levels/village1/sequence-a-village1.gc +++ b/goal_src/jak1/levels/village1/sequence-a-village1.gc @@ -258,8 +258,8 @@ (defstate play-anim (sequenceA-village1) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('sidekick-human) (format 0 "got sidekick-human~%") (when (= (level-status *level* 'misty) 'active) @@ -323,7 +323,6 @@ 'play-anim ) ) - (none) ) :trans (behavior () ;; yeah they messed up a little bit here @@ -332,7 +331,6 @@ ;; (spool-push *art-control* "sidekick-human-intro-sequence-b" 0 self -1.0) ;; but it somehow causes a crash (maybe linux only?) ((-> (method-of-type process-taskable play-anim) trans)) - (none) ) ) diff --git a/goal_src/jak1/levels/village1/village-obs.gc b/goal_src/jak1/levels/village1/village-obs.gc index 28a40a350a7..4fb0383e9af 100644 --- a/goal_src/jak1/levels/village1/village-obs.gc +++ b/goal_src/jak1/levels/village1/village-obs.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (defskelgroup *med-res-jungle-sg* medres-jungle medres-jungle-lod0-jg medres-jungle-idle-ja ((medres-jungle-lod0-mg (meters 999999))) :bounds (static-spherem -80 0 -80 240) @@ -288,7 +287,6 @@ (logior! (-> self draw status) (draw-status do-not-check-distance)) (logclear! (-> self draw status) (draw-status do-not-check-distance)) ) - (none) ) :code (the-as (function none :behavior windmill-sail) anim-loop) :post (the-as (function none :behavior windmill-sail) ja-post) @@ -346,7 +344,6 @@ ) (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self orig-quat)) (quaternion-normalize! (-> self root-override quat)) - (none) ) :code (the-as (function none :behavior sagesail) anim-loop) :post (the-as (function none :behavior sagesail) ja-post) @@ -436,7 +433,6 @@ ) (quaternion*! (-> self root quat) (-> self root quat) (-> self orig-quat)) (quaternion-normalize! (-> self root quat)) - (none) ) :code (the-as (function none :behavior windspinner) anim-loop) :post (the-as (function none :behavior windspinner) ja-post) @@ -484,7 +480,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior mayorgears) ja-post) ) @@ -533,7 +528,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior evilplant) ja-post) ) @@ -571,7 +565,6 @@ (process-entity-status! self (entity-perm-status complete) #t) (draw-eco-beam (-> self reflector-trans) (-> self next-reflector-trans)) ) - (none) ) :code (the-as (function none :behavior reflector-middle) anim-loop) :post (the-as (function none :behavior reflector-middle) ja-post) @@ -655,23 +648,19 @@ (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background)) (set! (-> self state-time) (-> *display* base-frame-counter)) (ja-channel-set! 0) - (none) ) :exit (behavior () (ja-channel-set! 1) - (none) ) :trans (behavior () (if (and *target* (>= 163840.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (go starfish-patrol) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior starfish) ja-post) ) @@ -680,7 +669,6 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logior! (-> self nav flags) (nav-control-flags navcf19)) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -690,7 +678,6 @@ (go starfish-idle) ) ) - (none) ) :code (behavior () (set! (-> self target-speed) 4096.0) @@ -703,7 +690,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior starfish) nav-enemy-patrol-post) ) @@ -835,7 +821,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior villa-starfish) #f) ) @@ -870,7 +855,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior village-fish) #f) ) @@ -960,7 +944,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior hutlamp) ja-post) ) diff --git a/goal_src/jak1/levels/village1/yakow.gc b/goal_src/jak1/levels/village1/yakow.gc index e389d47f1c9..f766f9275e6 100644 --- a/goal_src/jak1/levels/village1/yakow.gc +++ b/goal_src/jak1/levels/village1/yakow.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (defskelgroup *village1cam-sg* village1cam village1cam-lod0-jg village1cam-anim-ja ((village1cam-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 4) @@ -133,47 +132,44 @@ :shadow yakow-shadow-mg ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 52] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 54] (defbehavior yakow-default-event-handler yakow ((arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('touch) - (let* ((s4-0 arg0) - (v1-2 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) process-drawable)) - s4-0 - ) - ) - ) - (when (and v1-2 (< 8192.0 (- (-> v1-2 root trans y) (-> self root-override trans y)))) - (do-push-aways! (-> self root-override)) - (send-shove-back - (-> self root-override) - arg0 - (the-as touching-shapes-entry (-> arg3 param 0)) - 0.7 - 6144.0 - 16384.0 - ) - ) - ) - ) - (('attack) - (let ((v1-9 (-> arg3 param 2))) - (cond - ((!= v1-9 (-> self player-attack-id)) - (set! (-> self player-attack-id) (the-as int v1-9)) - (if (-> self vulnerable) - (go yakow-kicked) - ) - ) - (else - 'push - ) - ) + (case arg2 + (('touch) + (let* ((s4-0 arg0) + (v1-2 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) process-drawable)) + s4-0 ) - ) - ) + ) + ) + (when (and v1-2 (< 8192.0 (- (-> v1-2 root trans y) (-> self root-override trans y)))) + (do-push-aways! (-> self root-override)) + (send-shove-back + (-> self root-override) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + 0.7 + 6144.0 + 16384.0 + ) + ) + ) + ) + (('attack) + (let ((v1-9 (-> arg3 param 2))) + (cond + ((!= v1-9 (-> self player-attack-id)) + (set! (-> self player-attack-id) (the-as int v1-9)) + (if (-> self vulnerable) + (go yakow-kicked) + ) ) + (else + 'push + ) + ) + ) + ) + ) ) yakow-default-event-handler @@ -211,14 +207,13 @@ yakow-default-event-handler ) (suspend) ) - (level-hint-spawn - (text-id village1-yakow-resolution) - "sksp018a" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (none) + (level-hint-spawn + (text-id village1-yakow-resolution) + "sksp018a" + (the-as entity #f) + *entity-pool* + (game-task none) + ) ) :to self ) @@ -456,7 +451,6 @@ yakow-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self travel-speed) 0.0) - (none) ) :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> *YAKOW-bank* default-patrol-time)) @@ -468,7 +462,6 @@ yakow-default-event-handler ) (go yakow-notice) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.15)) @@ -498,7 +491,6 @@ yakow-default-event-handler (ja-channel-push! 1 (seconds 0.1)) ) ) - (none) ) :post (the-as (function none :behavior yakow) ja-post) ) @@ -508,11 +500,9 @@ yakow-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self travel-speed) 0.0) - (none) ) :code (behavior () (go yakow-run-away) - (none) ) :post yakow-simple-post ) @@ -525,7 +515,6 @@ yakow-default-event-handler (set! (-> self nav destination-pos quad) (-> arg0 quad)) (set! (-> self rotate-speed) (-> *YAKOW-bank* walk-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* walk-turn-time)) - (none) ) :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> *YAKOW-bank* default-patrol-time)) @@ -554,7 +543,6 @@ yakow-default-event-handler (-> *YAKOW-bank* walk-speed) (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame)) ) - (none) ) :code (the-as (function vector none :behavior yakow) yakow-blend-walk-run) :post (behavior () @@ -569,7 +557,6 @@ yakow-default-event-handler (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (yakow-post) - (none) ) ) @@ -587,7 +574,6 @@ yakow-default-event-handler 'update ) ) - (none) ) :code (behavior () (while (< 546.13336 (fabs (deg-diff (-> self dest-rot) (y-angle (-> self root-override))))) @@ -615,7 +601,6 @@ yakow-default-event-handler (ja-channel-push! 1 (seconds 0.1)) ) ) - (none) ) :post yakow-simple-post ) @@ -629,7 +614,6 @@ yakow-default-event-handler (ja :num! (seek!)) ) (go yakow-graze) - (none) ) :post yakow-simple-post ) @@ -641,7 +625,6 @@ yakow-default-event-handler (logior! (-> self nav flags) (nav-control-flags navcf10)) (set! (-> self rotate-speed) (-> *YAKOW-bank* run-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* run-turn-time)) - (none) ) :trans (behavior () (when (or (not *target*) (< (-> *YAKOW-bank* safe-distance) @@ -675,7 +658,6 @@ yakow-default-event-handler (set! (-> self enable-turn-around) (< (-> *YAKOW-bank* run-speed) f30-2)) (seek! (-> self travel-speed) f30-2 (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame))) ) - (none) ) :code yakow-blend-walk-run :post yakow-run-post @@ -694,11 +676,9 @@ yakow-default-event-handler (-> *YAKOW-bank* run-speed) ) ) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) @@ -709,7 +689,6 @@ yakow-default-event-handler ) ) 0 - (none) ) :code (behavior () (set! (-> self enable-turn-around) #t) @@ -748,7 +727,6 @@ yakow-default-event-handler ) ) (go yakow-run-away) - (none) ) :post yakow-run-post ) @@ -763,7 +741,6 @@ yakow-default-event-handler 0 (drop-pickup (-> self fact-override) #t *entity-pool* (-> self fact-override) 0) (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) diff --git a/goal_src/jak1/levels/village2/assistant-village2.gc b/goal_src/jak1/levels/village2/assistant-village2.gc index 3bf4d5e8db1..7612a745317 100644 --- a/goal_src/jak1/levels/village2/assistant-village2.gc +++ b/goal_src/jak1/levels/village2/assistant-village2.gc @@ -489,7 +489,6 @@ ) ) ((-> (method-of-type process-taskable idle) trans)) - (none) ) :code (behavior () (if (!= (ja-group) (get-art-elem self)) @@ -570,7 +569,6 @@ ) ) ) - (none) ) ) @@ -586,11 +584,9 @@ (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'end-mode) ((-> (method-of-type process-taskable play-anim) exit)) (close-specific-task! (game-task village2-levitator) (task-status need-reminder-a)) - (none) ) :trans (behavior () '() - (none) ) ) @@ -684,7 +680,7 @@ (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (launch-particles (-> *part-id-table* 1324) gp-0 :rate 1.0) + (launch-particles (-> *part-id-table* 1324) gp-0) ) ) (none) @@ -1294,7 +1290,6 @@ ) ) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) :trans (behavior () (assistant-levitator-blue-glow) @@ -1302,7 +1297,6 @@ (assistant-levitator-blue-beam) ) ((-> (method-of-type process-taskable play-anim) trans)) - (none) ) ) @@ -1359,7 +1353,6 @@ (game-task none) ) ) - (none) ) ) @@ -1372,13 +1365,11 @@ :exit (behavior () (stop! (-> self sound)) ((-> (method-of-type process-taskable idle) exit)) - (none) ) :trans (behavior () (assistant-levitator-blue-glow) (update! (-> self sound)) ((-> (method-of-type process-taskable idle) trans)) - (none) ) :code (behavior () (if (!= (ja-group) (get-art-elem self)) @@ -1434,7 +1425,6 @@ ) ) ) - (none) ) ) @@ -1453,7 +1443,6 @@ (update! (-> self sound)) (suspend) ) - (none) ) ) diff --git a/goal_src/jak1/levels/village2/flutflut-bluehut.gc b/goal_src/jak1/levels/village2/flutflut-bluehut.gc index 5d49b157d16..335c0cc3520 100644 --- a/goal_src/jak1/levels/village2/flutflut-bluehut.gc +++ b/goal_src/jak1/levels/village2/flutflut-bluehut.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype flutflut-bluehut (process-taskable) () :heap-base #x110 @@ -50,7 +49,6 @@ :trans (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) - (none) ) :code (behavior () (if (!= (ja-group) (get-art-elem self)) @@ -109,7 +107,6 @@ (ja :num! (seek! 0.0)) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/village2/gambler.gc b/goal_src/jak1/levels/village2/gambler.gc index f36fb03a0d5..bf7034dca14 100644 --- a/goal_src/jak1/levels/village2/gambler.gc +++ b/goal_src/jak1/levels/village2/gambler.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype gambler (process-taskable) () :heap-base #x110 @@ -210,7 +209,6 @@ ) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/village2/sage-bluehut.gc b/goal_src/jak1/levels/village2/sage-bluehut.gc index 8ffce4f68d9..ef82710ad24 100644 --- a/goal_src/jak1/levels/village2/sage-bluehut.gc +++ b/goal_src/jak1/levels/village2/sage-bluehut.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype assistant-bluehut (process-taskable) ((sound-id sound-id :offset-assert 380) (jaws handle :offset-assert 384) @@ -202,7 +201,6 @@ (send-event (-> self assistant extra process) 'end-mode) (set! (-> self draw bounds w) 10240.0) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) ) @@ -311,7 +309,6 @@ ) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/village2/sunken-elevator.gc b/goal_src/jak1/levels/village2/sunken-elevator.gc index b0c22200590..c1d47941852 100644 --- a/goal_src/jak1/levels/village2/sunken-elevator.gc +++ b/goal_src/jak1/levels/village2/sunken-elevator.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype sunken-elevator (plat-button) ((play-at-top-going-up-camera? symbol :offset-assert 240) (teleport-if-below-y float :offset-assert 244) @@ -99,7 +98,6 @@ ) ) ) - (none) ) ) @@ -112,7 +110,6 @@ ) ) (set! (-> self play-at-top-going-up-camera?) #t) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) trans))) @@ -140,7 +137,6 @@ (set! (-> (the-as village2cam (-> v1-8 0)) seq) (the-as uint 2)) ) ) - (none) ) ) @@ -163,7 +159,6 @@ (send-event *target* 'reset-height) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/village2/swamp-blimp.gc b/goal_src/jak1/levels/village2/swamp-blimp.gc index 6ba8558f8bb..34df0f18919 100644 --- a/goal_src/jak1/levels/village2/swamp-blimp.gc +++ b/goal_src/jak1/levels/village2/swamp-blimp.gc @@ -597,7 +597,6 @@ (deactivate self) (suspend) 0 - (none) ) ) @@ -613,7 +612,6 @@ ) (suspend) ) - (none) ) ) @@ -622,7 +620,6 @@ (remove-setting! 'movie) (remove-setting! 'process-mask) (apply-settings *setting-control*) - (none) ) :code (behavior () (let ((gp-0 (tetherrock-get-info (-> self entity)))) @@ -799,16 +796,15 @@ ) ) (go swamp-tetherrock-hide) - (none) ) :post (the-as (function none :behavior swamp-tetherrock) ja-post) ) (defstate swamp-tetherrock-idle (swamp-tetherrock) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (when (and (>= arg1 2) (= (-> event param 1) 'eco-yellow)) + (when (and (>= argc 2) (= (-> block param 1) 'eco-yellow)) (+! (-> self hits) 1) (cond ((>= (-> self hits) 1) @@ -870,7 +866,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-tetherrock) transform-post) ) @@ -937,7 +932,6 @@ (loop (suspend) ) - (none) ) ) @@ -965,7 +959,6 @@ (set! (-> self root-override trans y) (+ (-> self y-offset) (-> self y-init))) (suspend) ) - (none) ) :post (the-as (function none :behavior precursor-arm) transform-post) ) @@ -989,8 +982,8 @@ ) (defstate precursor-arm-idle (precursor-arm) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('arm-sink-evt) (go precursor-arm-sink) ) @@ -1018,10 +1011,9 @@ (let ((a2-1 (new 'static 'vector))) (set! (-> a2-1 quad) (-> self root-override trans quad)) (set! (-> a2-1 y) 0.0) - (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2017) a2-1 :rate 1.0) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2017) a2-1) ) ) - (none) ) :code (behavior () (loop @@ -1080,7 +1072,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior precursor-arm) transform-post) ) @@ -1189,11 +1180,9 @@ (defstate swamp-rope-break (swamp-rope) :enter (behavior () (set! (-> self scale-base) (-> self root scale y)) - (none) ) :trans (behavior () (vector<-cspace! (-> self root trans) (-> self parent-override 0 node-list data (-> self parent-rp))) - (none) ) :code (behavior () (let ((f30-0 18.204445) @@ -1223,13 +1212,11 @@ ) ) ) - (none) ) :post (behavior () (set! (-> self other-pos quad) (-> self root trans quad)) (+! (-> self other-pos y) -245760.0) (swamp-rope-post) - (none) ) ) @@ -1298,7 +1285,6 @@ (ja :num-func num-func-identity :frame-num (* (-> self frame value) (the float (ja-num-frames 0)))) (suspend) ) - (none) ) :post swamp-rope-post ) @@ -1322,7 +1308,6 @@ (ja :num-func num-func-identity :frame-num (* (-> self frame value) (the float (ja-num-frames 0)))) (suspend) ) - (none) ) :post swamp-rope-post ) @@ -1421,7 +1406,6 @@ ) (set! (-> self draw force-lod) 0) 0 - (none) ) :trans (the-as (function none :behavior swamp-blimp) blimp-trans) :code (behavior () @@ -1447,7 +1431,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior swamp-blimp) transform-post) ) @@ -1537,14 +1520,13 @@ ) (defstate swamp-blimp-idle (swamp-blimp) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('tetherrock-break-evt) - (increment-success-for-hint (text-id swamp-tetherrock-eco-yellow-hint)) - (swamp-blimp-setup) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('tetherrock-break-evt) + (increment-success-for-hint (text-id swamp-tetherrock-eco-yellow-hint)) + (swamp-blimp-setup) + ) + ) ) :trans (the-as (function none :behavior swamp-blimp) blimp-trans) :code (behavior () @@ -1581,7 +1563,6 @@ (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-blimp) transform-post) ) diff --git a/goal_src/jak1/levels/village2/village2-obs.gc b/goal_src/jak1/levels/village2/village2-obs.gc index 5e42957d485..77a1e99c8ec 100644 --- a/goal_src/jak1/levels/village2/village2-obs.gc +++ b/goal_src/jak1/levels/village2/village2-obs.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (deftype village2cam (pov-camera) ((seq uint64 :offset-assert 224) ) @@ -62,7 +61,6 @@ ) ) (go-virtual pov-camera-done-playing) - (none) ) ) @@ -104,24 +102,20 @@ :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self root-overlay)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self root-overlay)) - (none) ) :trans (behavior () (if (task-closed? (the-as game-task (-> self task)) (task-status need-resolution)) (go-virtual rigid-body-platform-idle) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) ) @@ -129,38 +123,33 @@ :code (behavior () (cleanup-for-death self) (deactivate self) - (none) ) ) (defstate rigid-body-platform-float (pontoon) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'die) - (cleanup-for-death self) - (the-as vector (deactivate self)) - ) - (else - (rigid-body-platform-event-handler proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (cleanup-for-death self) + (deactivate self) + ) + (else + (rigid-body-platform-event-handler proc argc message block) + ) ) ) ) (defstate rigid-body-platform-idle (pontoon) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('die) - (cleanup-for-death self) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (cleanup-for-death self) + (deactivate self) + ) + ) ) ) @@ -485,23 +474,20 @@ ) (defstate allpontoons-be-clone (allpontoons) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('end-mode) - (cleanup-for-death self) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('end-mode) + (cleanup-for-death self) + (deactivate self) + ) + ) ) :enter (behavior ((arg0 handle)) (logclear! (-> self draw status) (draw-status hidden)) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (when (>= (ja-aframe-num 0) 500.0) @@ -512,27 +498,24 @@ (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 7))) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 9))) ) - (none) ) :code (behavior ((arg0 handle)) (clone-anim arg0 3 #t "") (cleanup-for-death self) (deactivate self) - (none) ) ) (defstate allpontoons-idle (allpontoons) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('clone) - (go allpontoons-be-clone (the-as handle (-> event param 0))) + (go allpontoons-be-clone (the-as handle (-> block param 0))) ) ) ) :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) - (none) ) :code (behavior () (loop @@ -543,7 +526,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) @@ -655,16 +637,13 @@ (vector-! (-> self draw bounds) gp-0 (-> self root-override trans)) ) (set! (-> self draw bounds w) 24576.0) - (none) ) :exit (behavior () (stop! (-> self sound)) - (none) ) :trans (behavior () (fireboulder-hover-stuff) (update! (-> self sound)) - (none) ) :code (behavior () (loop @@ -679,14 +658,13 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior fireboulder) transform-post) ) (defstate fireboulder-be-clone (fireboulder) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('stop-cloning) (go fireboulder-hover) ) @@ -694,12 +672,10 @@ ) :enter (behavior ((arg0 handle)) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logclear! (-> self skel status) (janim-status spool)) - (none) ) :trans (the-as (function none :behavior fireboulder) fireboulder-hover-stuff) :code (behavior ((arg0 handle)) @@ -707,15 +683,14 @@ (format 0 "ERROR: fireboulder-be-clone ended~%") (cleanup-for-death self) (deactivate self) - (none) ) ) (defstate fireboulder-idle (fireboulder) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('clone) - (go fireboulder-be-clone (the-as handle (-> event param 0))) + (go fireboulder-be-clone (the-as handle (-> block param 0))) ) ) ) @@ -725,7 +700,6 @@ (deactivate a0-1) ) ) - (none) ) :code (behavior () (transform-post) @@ -760,7 +734,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior fireboulder) ja-post) ) @@ -853,7 +826,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior ceilingflag) ja-post) ) @@ -919,7 +891,6 @@ ) ) (go exit-chamber-dummy-idle) - (none) ) ) @@ -955,7 +926,6 @@ ) ) (go exit-chamber-dummy-wait-to-appear) - (none) ) :post (the-as (function none :behavior exit-chamber-dummy) ja-post) ) @@ -1441,7 +1411,6 @@ (ja :num! (seek!)) ) (go ogreboss-village2-idle) - (none) ) :post (the-as (function none :behavior ogreboss-village2) ja-post) ) @@ -1517,7 +1486,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior ogreboss-village2) ja-post) ) diff --git a/goal_src/jak1/levels/village2/warrior.gc b/goal_src/jak1/levels/village2/warrior.gc index efd4ea6a0f2..f1d93d3b4b1 100644 --- a/goal_src/jak1/levels/village2/warrior.gc +++ b/goal_src/jak1/levels/village2/warrior.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype warrior (process-taskable) () :heap-base #x110 @@ -154,7 +153,6 @@ :exit (behavior () (send-event (-> (entity-by-type allpontoons) extra process) 'end-mode) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) ) diff --git a/goal_src/jak1/levels/village3/assistant-village3.gc b/goal_src/jak1/levels/village3/assistant-village3.gc index a0f0f3b4a98..acb8fc74168 100644 --- a/goal_src/jak1/levels/village3/assistant-village3.gc +++ b/goal_src/jak1/levels/village3/assistant-village3.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype assistant-villagec (process-taskable) () :heap-base #x110 @@ -177,7 +176,6 @@ ) ) ) - (none) ) ) diff --git a/goal_src/jak1/levels/village3/minecart.gc b/goal_src/jak1/levels/village3/minecart.gc index dc0625c43bb..14cdf6783fd 100644 --- a/goal_src/jak1/levels/village3/minecart.gc +++ b/goal_src/jak1/levels/village3/minecart.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defskelgroup *minecartsteel-sg* minecartsteel minecartsteel-lod0-jg minecartsteel-idle-ja ((minecartsteel-lod0-mg (meters 20)) (minecartsteel-lod1-mg (meters 40)) @@ -34,19 +33,18 @@ (defstate idle (minecartsteel) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) - (when (= (-> arg0 type) target) - (let ((a2-1 (new 'stack 'collide-overlap-result))) - (if (not (on-platform (-> self root-override) (-> *target* control) a2-1)) - (send-event arg0 'no-look-around (seconds 1.5)) - ) - ) - ) - #f - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (when (= (-> proc type) target) + (let ((a2-1 (new 'stack 'collide-overlap-result))) + (if (not (on-platform (-> self root-override) (-> *target* control) a2-1)) + (send-event proc 'no-look-around (seconds 1.5)) + ) + ) + ) + #f + ) ) ) :trans (the-as (function none :behavior minecartsteel) rider-trans) @@ -63,7 +61,6 @@ (update! (-> self sound)) (suspend) ) - (none) ) :post (the-as (function none :behavior minecartsteel) rider-post) ) @@ -148,7 +145,3 @@ (minecartsteel-initialize-by-other arg0 0.0) (none) ) - - - - diff --git a/goal_src/jak1/levels/village3/miners.gc b/goal_src/jak1/levels/village3/miners.gc index 9a8a4a4f31c..f23a59d3a35 100644 --- a/goal_src/jak1/levels/village3/miners.gc +++ b/goal_src/jak1/levels/village3/miners.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (defbehavior miners-anim-loop minershort () (when (!= (ja-group) (get-art-elem self)) (ja-channel-push! 1 (seconds 0.2)) @@ -106,7 +105,6 @@ :trans (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) - (none) ) :code (the-as (function none :behavior minertall) miners-anim-loop) ) @@ -460,7 +458,6 @@ :exit (behavior () (send-event (-> self other-miner ppointer 3) 'end-mode) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) ) @@ -608,7 +605,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior cavegem) ja-post) ) diff --git a/goal_src/jak1/levels/village3/sage-village3.gc b/goal_src/jak1/levels/village3/sage-village3.gc index 3b9bc5ea587..6b64fe94e6d 100644 --- a/goal_src/jak1/levels/village3/sage-village3.gc +++ b/goal_src/jak1/levels/village3/sage-village3.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype sage-villagec (process-taskable) ((evilbro handle :offset-assert 384) (evilsis handle :offset-assert 392) @@ -236,7 +235,6 @@ ) ) ((-> (method-of-type process-taskable idle) trans)) - (none) ) ) @@ -256,7 +254,6 @@ ) ) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) ) diff --git a/goal_src/jak1/levels/village3/village3-obs.gc b/goal_src/jak1/levels/village3/village3-obs.gc index d1d44608fcd..ddd5c5be5ff 100644 --- a/goal_src/jak1/levels/village3/village3-obs.gc +++ b/goal_src/jak1/levels/village3/village3-obs.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (defskelgroup *med-res-ogre-sg* medres-ogre medres-ogre-lod0-jg medres-ogre-idle-ja ((medres-ogre-lod0-mg (meters 999999))) :bounds (static-spherem -200 0 -450 350) @@ -241,7 +240,6 @@ (spool-push *art-control* (-> self anim name) 0 self -99.0) (suspend) ) - (none) ) ) @@ -278,12 +276,10 @@ ) (process-entity-status! self (entity-perm-status bit-3) #f) (go-virtual idle #t) - (none) ) :post (behavior () (ja-post) (update-direction-from-time-of-day (-> self draw shadow-ctrl)) - (none) ) ) @@ -321,7 +317,6 @@ ) (process-entity-status! self (entity-perm-status bit-3) #f) (go-virtual idle #f) - (none) ) :post (-> (method-of-type gondola ride-up) post) ) @@ -400,8 +395,8 @@ (defstate idle (pistons) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('update) (go-virtual active (process->handle proc) #f) ) @@ -412,7 +407,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -475,17 +469,16 @@ (defstate idle (gondolacables) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('update) - (process-entity-status! self (entity-perm-status complete) #t) - (let ((v0-0 1)) - (set! (-> self draw mgeo effect 0 effect-bits) (the-as uint v0-0)) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('update) + (process-entity-status! self (entity-perm-status complete) #t) + (let ((v0-0 1)) + (set! (-> self draw mgeo effect 0 effect-bits) (the-as uint v0-0)) + v0-0 + ) + ) + ) ) :code (behavior () (loop @@ -495,7 +488,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior gondolacables) ja-post) ) diff --git a/goal_src/jak1/levels/village_common/oracle.gc b/goal_src/jak1/levels/village_common/oracle.gc index e884221209e..7bbd77bda7e 100644 --- a/goal_src/jak1/levels/village_common/oracle.gc +++ b/goal_src/jak1/levels/village_common/oracle.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype oracle (process-taskable) ((first-task uint8 :offset-assert 380) (second-task uint8 :offset-assert 381) @@ -227,12 +226,10 @@ :exit (behavior () (stop! (-> self sound)) ((-> (method-of-type process-taskable idle) exit)) - (none) ) :trans (behavior () (update! (-> self sound)) ((-> (method-of-type process-taskable idle) trans)) - (none) ) ) diff --git a/goal_src/jak1/levels/village_common/villagep-obs.gc b/goal_src/jak1/levels/village_common/villagep-obs.gc index fff63dc9737..3ee8cdb44d4 100644 --- a/goal_src/jak1/levels/village_common/villagep-obs.gc +++ b/goal_src/jak1/levels/village_common/villagep-obs.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (deftype warpgate (process-hidden) () :method-count-assert 15 @@ -32,7 +31,6 @@ (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-hit-ground #f) ) - (none) ) :code (behavior ((arg0 vector) (arg1 vector)) (clear-collide-with-as (-> self control)) @@ -86,15 +84,14 @@ (ja :num! (seek!)) ) (target-falling-anim -1 (seconds 0.33)) - (none) ) :post target-no-move-post ) (defstate idle (warp-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide) (go-virtual hidden) ) @@ -162,7 +159,6 @@ ) (suspend) ) - (none) ) ) @@ -225,7 +221,6 @@ (apply-settings *setting-control*) (sound-play "start-options") (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (when (or (and (cpad-pressed? 0 triangle) @@ -255,7 +250,6 @@ ) ) ) - (none) ) :code (behavior () (local-vars (sv-112 int) (sv-128 int) (sv-144 int)) @@ -392,7 +386,6 @@ ) ) ) - (none) ) ) @@ -638,8 +631,8 @@ (defstate basebutton-up-idle (warp-gate-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (when (pressable? self) (basebutton-method-29 self (-> self event-going-down) (-> self notify-actor)) @@ -647,10 +640,10 @@ ) ) (('hide) - (send-event (handle->process (-> self warp)) event-type) + (send-event (handle->process (-> self warp)) message) ) (else - ((-> (method-of-type basebutton basebutton-up-idle) event) proc arg1 event-type event) + ((-> (method-of-type basebutton basebutton-up-idle) event) proc argc message block) ) ) ) @@ -661,7 +654,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -751,19 +743,18 @@ (t9-13) ) ) - (none) ) ) (defstate basebutton-down-idle (warp-gate-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide) - (send-event (handle->process (-> self warp)) event-type) + (send-event (handle->process (-> self warp)) message) ) (else - ((-> (method-of-type basebutton basebutton-down-idle) event) proc arg1 event-type event) + ((-> (method-of-type basebutton basebutton-down-idle) event) proc argc message block) ) ) ) @@ -776,7 +767,6 @@ (t9-4) ) ) - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self warp)))) @@ -789,7 +779,6 @@ (t9-1) ) ) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 60)) @@ -814,7 +803,6 @@ (t9-3) ) ) - (none) ) ) @@ -859,7 +847,6 @@ ((the-as (function none :behavior basebutton) t9-10)) ) ) - (none) ) ) @@ -1136,7 +1123,6 @@ ) (suspend) ) - (none) ) ) diff --git a/goal_src/jak2/build/all_objs.json b/goal_src/jak2/build/all_objs.json index 10e0c285a39..a41704afd9b 100644 --- a/goal_src/jak2/build/all_objs.json +++ b/goal_src/jak2/build/all_objs.json @@ -443,7 +443,7 @@ ["flitter", "flitter", 3, ["GAME", "COMMON"], "levels/common/enemy"], ["battle", "battle", 3, ["GAME", "COMMON"], "levels/common"], ["elec-gate", "elec-gate", 3, ["GAME", "COMMON"], "levels/common"], -["cty-guard-turret-button", "cty-guard-turret-button", 3, ["GAME", "COMMON"], "levels/common"], +["cty-guard-turret-button", "cty-guard-turret-button", 3, ["GAME", "COMMON"], "levels/common/entities"], ["tpage-2972", "tpage-2972", 4, ["LWIDEB"], "levels/city/common"], ["grunt-ag", "grunt", 4, ["LWIDEB", "STR", "DRILLMTN", "STADBLMP", "HALFPIPE", "SEW", "UNB", "RUI", "CTYASHA"], "levels/common/enemy/metalhead_grunt"], ["citizen-norm-ag", "citizen-norm", 4, ["LWIDEB", "LWIDEC", "LWIDEA"], "levels/city/common"], diff --git a/goal_src/jak2/engine/ai/enemy-h.gc b/goal_src/jak2/engine/ai/enemy-h.gc index 22c0c9f8a4b..4c0956b1fd5 100644 --- a/goal_src/jak2/engine/ai/enemy-h.gc +++ b/goal_src/jak2/engine/ai/enemy-h.gc @@ -347,13 +347,13 @@ (enemy-method-63 (_type_ process-focusable enemy-aware) symbol 63) (enemy-method-64 (_type_) none 64) (enemy-method-65 (_type_) none 65) - (go-ambush (_type_) none 66) - (go-stare (_type_) none 67) - (go-stare2 (_type_) none 68) - (go-directed (_type_) none 69) - (go-hostile (_type_) none 70) - (go-flee (_type_) none 71) - (react-to-focus (_type_) none 72) + (go-ambush (_type_) object 66) + (go-stare (_type_) object 67) + (go-stare2 (_type_) object 68) + (go-directed (_type_) object 69) + (go-hostile (_type_) object 70) + (go-flee (_type_) object 71) + (react-to-focus (_type_) object 72) (kill-prefer-falling (_type_) object 73) (general-event-handler (_type_ process int symbol event-message-block) object 74) (enemy-method-75 (_type_ process event-message-block) object 75) diff --git a/goal_src/jak2/engine/ai/enemy.gc b/goal_src/jak2/engine/ai/enemy.gc index b8aca03a8b2..b6f00b08a0c 100644 --- a/goal_src/jak2/engine/ai/enemy.gc +++ b/goal_src/jak2/engine/ai/enemy.gc @@ -490,40 +490,28 @@ (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-stare enemy ((obj enemy)) (go (method-of-object obj stare)) - (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-stare2 enemy ((obj enemy)) (go (method-of-object obj stare)) - (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-hostile enemy ((obj enemy)) (go (method-of-object obj hostile)) - (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-ambush enemy ((obj enemy)) (go (method-of-object obj ambush)) - (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-flee enemy ((obj enemy)) (go (method-of-object obj flee)) - (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-directed enemy ((obj enemy)) (go (method-of-object obj directed)) - (none) ) (defmethod react-to-focus enemy ((obj enemy)) @@ -547,9 +535,9 @@ ) ) ) - (none) ) +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-93 enemy ((obj enemy)) (if (logtest? (enemy-flag alert) (-> obj enemy-flags)) (go-directed obj) @@ -1227,6 +1215,7 @@ (none) ) +;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! enemy ((obj enemy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: @@ -1597,184 +1586,140 @@ This commonly includes things such as: ) ) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 17] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 28] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 37] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 89] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 105] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 202] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 211] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 274] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 346] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 407] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 413] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 490] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 493] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 530] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 560] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 610] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 641] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 720] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 774] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 807] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 814] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 850] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 933] (defmethod general-event-handler enemy ((obj enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (s5-5 rgbaf) (sv-432 process) (sv-448 event-message-block)) - (the-as - object - (cond - ((= arg2 'track) - (and (nonzero? (-> obj hit-points)) - (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) - (logtest? (enemy-flag check-water-backup) (-> obj enemy-flags)) - ) - ) - ((= arg2 'combo) - (and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points))) - ) - ((= arg2 'touch) - (enemy-method-75 obj arg0 arg3) - ) - ((= arg2 'touched) - (when (logtest? (-> obj enemy-flags) (enemy-flag attackable-backup)) - (let* ((s3-1 arg0) - (v1-20 (if (type? s3-1 process-drawable) - (the-as process-drawable s3-1) - ) - ) - ) - (when v1-20 - (let* ((s3-2 (-> v1-20 root)) - (a1-4 (if (type? s3-2 collide-shape) - s3-2 - ) - ) - (s3-3 (-> arg3 param 0)) - ) - (if (and a1-4 - s3-3 - ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry s3-3) - (the-as collide-shape a1-4) - (collide-action solid) - (collide-action) - ) - ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry s3-3) - (-> obj root) - (collide-action solid) - (collide-action) + (cond + ((= arg2 'track) + (and (nonzero? (-> obj hit-points)) + (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) + (logtest? (enemy-flag check-water-backup) (-> obj enemy-flags)) + ) + ) + ((= arg2 'combo) + (and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points))) + ) + ((= arg2 'touch) + (enemy-method-75 obj arg0 arg3) + ) + ((= arg2 'touched) + (when (logtest? (-> obj enemy-flags) (enemy-flag attackable-backup)) + (let* ((s3-1 arg0) + (v1-20 (if (type? s3-1 process-drawable) + (the-as process-drawable s3-1) ) + ) + ) + (when v1-20 + (let* ((s3-2 (-> v1-20 root)) + (a1-4 (if (type? s3-2 collide-shape) + s3-2 + ) ) - (set! (-> obj auto-reset-penetrate-time) (current-time)) - ) - ) + (s3-3 (-> arg3 param 0)) + ) + (if (and a1-4 + s3-3 + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-3) + (the-as collide-shape a1-4) + (collide-action solid) + (collide-action) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-3) + (-> obj root) + (collide-action solid) + (collide-action) + ) + ) + (set! (-> obj auto-reset-penetrate-time) (current-time)) + ) ) ) ) - (enemy-method-76 obj arg0 arg3) ) - ((= arg2 'attack-invinc) - (case (-> (the-as attack-info (-> arg3 param 1)) mode) - (('endlessfall) - (let ((v1-31 (-> obj root root-prim))) - (set! (-> v1-31 prim-core collide-as) (collide-spec)) - (set! (-> v1-31 prim-core collide-with) (collide-spec)) - ) - 0 - (kill-prefer-falling obj) + (enemy-method-76 obj arg0 arg3) + ) + ((= arg2 'attack-invinc) + (case (-> (the-as attack-info (-> arg3 param 1)) mode) + (('endlessfall) + (let ((v1-31 (-> obj root root-prim))) + (set! (-> v1-31 prim-core collide-as) (collide-spec)) + (set! (-> v1-31 prim-core collide-with) (collide-spec)) ) - ) + 0 + (kill-prefer-falling obj) + ) ) - ((= arg2 'attack) - (let ((s2-0 (the-as object (-> arg3 param 1)))) - (when (!= (-> (the-as attack-info s2-0) id) (-> obj incoming attack-id)) - (cond - ((and (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + ) + ((= arg2 'attack) + (let ((s2-0 (the-as object (-> arg3 param 1)))) + (when (!= (-> (the-as attack-info s2-0) id) (-> obj incoming attack-id)) + (cond + ((and (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) + ) + (let* ((s1-0 obj) + (s0-0 (method-of-object s1-0 enemy-method-106)) ) - (let* ((s1-0 obj) - (s0-0 (method-of-object s1-0 enemy-method-106)) - ) - (set! sv-432 arg0) - (set! sv-448 arg3) - (let ((a3-3 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg3))) - (s0-0 s1-0 sv-432 sv-448 (the-as int a3-3) (the-as attack-info s2-0)) - ) + (set! sv-432 arg0) + (set! sv-448 arg3) + (let ((a3-3 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg3))) + (s0-0 s1-0 sv-432 sv-448 (the-as int a3-3) (the-as attack-info s2-0)) ) - (send-event (ppointer->process (-> obj parent)) 'child-hit) - 0 - (when (not *debug-unkillable*) - ;; og:preserve-this for damage numbers cheat - (#cond - (PC_PORT - (let ((old-hp (-> obj hit-points)) - (dmg-taken (take-damage-from-attack obj arg0 arg3))) - (when (> dmg-taken 0) - (process-spawn damage-number (damage-amount-from-attack obj arg0 arg3) (-> obj root trans) (-> obj mask)) - (send-damage-to-bar *health-bar-manager* obj dmg-taken old-hp)) - (when (nonzero? (-> obj fated-time)) - (aif (get-bar-for-process *health-bar-manager* obj) - (send-event (ppointer->process it) 'set-hit-points 0) - (send-damage-to-bar *health-bar-manager* obj 1 1)) - ) + ) + (send-event (ppointer->process (-> obj parent)) 'child-hit) + 0 + (when (not *debug-unkillable*) + ;; og:preserve-this for damage numbers cheat + (#cond + (PC_PORT + (let ((old-hp (-> obj hit-points)) + (dmg-taken (take-damage-from-attack obj arg0 arg3))) + (when (> dmg-taken 0) + (process-spawn damage-number (damage-amount-from-attack obj arg0 arg3) (-> obj root trans) (-> obj mask)) + (send-damage-to-bar *health-bar-manager* obj dmg-taken old-hp)) + (when (nonzero? (-> obj fated-time)) + (aif (get-bar-for-process *health-bar-manager* obj) + (send-event (ppointer->process it) 'set-hit-points 0) + (send-damage-to-bar *health-bar-manager* obj 1 1)) ) ) - (#t - (take-damage-from-attack obj arg0 arg3))) + ) + (#t + (take-damage-from-attack obj arg0 arg3))) ) - (let ((s2-1 (the-as attack-info (enemy-method-58 obj arg0 arg3)))) - (when s2-1 - (logclear! (-> obj enemy-flags) (enemy-flag called-dying)) - (enemy-method-108 obj (the-as enemy arg0) arg3) - (let ((a1-13 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-13 from) (process->ppointer arg0)) - (set! (-> a1-13 num-params) arg1) - (set! (-> a1-13 message) (the-as symbol s2-1)) - (set! (-> a1-13 param 0) (-> arg3 param 0)) - (set! (-> a1-13 param 1) (-> arg3 param 1)) - (set! (-> a1-13 param 2) (-> arg3 param 2)) - (set! (-> a1-13 param 3) (-> arg3 param 3)) - (set! (-> a1-13 param 4) (-> arg3 param 4)) - (set! (-> a1-13 param 5) (-> arg3 param 5)) - (send-event-function obj a1-13) - ) + (let ((s2-1 (the-as attack-info (enemy-method-58 obj arg0 arg3)))) + (when s2-1 + (logclear! (-> obj enemy-flags) (enemy-flag called-dying)) + (enemy-method-108 obj (the-as enemy arg0) arg3) + (let ((a1-13 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-13 from) (process->ppointer arg0)) + (set! (-> a1-13 num-params) arg1) + (set! (-> a1-13 message) (the-as symbol s2-1)) + (set! (-> a1-13 param 0) (-> arg3 param 0)) + (set! (-> a1-13 param 1) (-> arg3 param 1)) + (set! (-> a1-13 param 2) (-> arg3 param 2)) + (set! (-> a1-13 param 3) (-> arg3 param 3)) + (set! (-> a1-13 param 4) (-> arg3 param 4)) + (set! (-> a1-13 param 5) (-> arg3 param 5)) + (send-event-function obj a1-13) ) ) ) - (else - (set! (-> obj incoming attack-id) (-> (the-as attack-info s2-0) id)) - (enemy-method-75 obj arg0 arg3) - ) + ) + (else + (set! (-> obj incoming attack-id) (-> (the-as attack-info s2-0) id)) + (enemy-method-75 obj arg0 arg3) ) ) ) ) - ((= arg2 'hit-flinch) - (when (zero? (-> obj hit-points)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) - ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (process-contact-action arg0) - (send-event arg0 'get-attack-count 1) - (kill-prefer-falling obj) - ) - #t - ) - ((= arg2 'hit-knocked) + ) + ((= arg2 'hit-flinch) + (when (zero? (-> obj hit-points)) (logclear! (-> obj mask) (process-mask actor-pause)) (logclear! (-> obj focus-status) (focus-status dangerous)) (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) @@ -1788,17 +1733,135 @@ This commonly includes things such as: (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (when (zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) - (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) - 0 + (kill-prefer-falling obj) + ) + #t + ) + ((= arg2 'hit-knocked) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) + (logior! (-> obj focus-status) (focus-status hit)) + (if (zero? (-> obj hit-points)) + (logior! (-> obj focus-status) (focus-status dead)) + ) + (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 obj) + (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (when (zero? (-> obj hit-points)) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) + (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + 0 + ) + ) + ) + (go (method-of-object obj knocked)) + ) + ((= arg2 'hit) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) + (logior! (-> obj focus-status) (focus-status hit)) + (if (zero? (-> obj hit-points)) + (logior! (-> obj focus-status) (focus-status dead)) + ) + (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 obj) + (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (if (zero? (-> obj hit-points)) + (kill-prefer-falling obj) + (go (method-of-object obj hit)) + ) + ) + ((= arg2 'cue-chase) + (when (and (> (-> obj hit-points) 0) + (zero? (-> obj fated-time)) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) + ) + (let ((v1-162 (logtest? (enemy-flag alert) (-> obj enemy-flags)))) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (logior! (-> obj enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (cond + (v1-162 + (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) + (go-ambush obj) + (go-hostile obj) + ) + ) + ((and (-> obj next-state) (let ((v1-173 (-> obj next-state name))) + (or (= v1-173 'dormant) (= v1-173 'dormant-aware)) + ) + ) + (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) + (go-ambush obj) + (go (method-of-object obj notice)) + ) ) ) ) - (go (method-of-object obj knocked)) + #t + ) + ) + ((= arg2 'cue-wake) + (when (and (> (-> obj hit-points) 0) + (zero? (-> obj fated-time)) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) + ) + (logclear! (-> obj enemy-flags) (enemy-flag alert victory called-dying)) + (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) + (go-ambush obj) + (react-to-focus obj) + ) + #t ) - ((= arg2 'hit) + ) + ((= arg2 'jump) + (when (and (> (-> obj hit-points) 0) + (zero? (-> obj fated-time)) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) + ) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj jump-why) (-> arg3 param 0)) + (set! (-> obj event-param-point quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (go (method-of-object obj jump)) + ) + ) + ((= arg2 'death-start) + (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag recover) (-> obj enemy-flags)))) + (send-event (ppointer->process (-> obj parent)) 'child-die) + (drop-pickup (-> obj fact) #t *entity-pool* (-> obj fact) 0) + (let ((s5-1 (-> obj on-death))) + (if s5-1 + (script-eval (the-as pair s5-1) :vector (-> obj root trans)) + ) + ) + ) + ((= arg2 'death-end) + (if (-> obj skel effect) + (logior! (-> obj skel effect flags) (effect-control-flag ecf2)) + ) + (logior! (-> obj draw status) (draw-control-status no-draw)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + (set! (-> obj enemy-flags) (logclear (-> obj enemy-flags) (enemy-flag check-water))) + ) + ((= arg2 'instant-death) + (when (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time))) + (set! (-> obj hit-points) 0) + (set! (-> obj root penetrated-by) (get-penetrate-info obj)) + (let ((s5-2 (enemy-method-50 obj (new 'stack-no-clear 'vector)))) + (vector-z-quaternion! s5-2 (-> obj root quat)) + (vector-float*! s5-2 s5-2 -1.0) + (vector-normalize! s5-2 1.0) + ) (logclear! (-> obj mask) (process-mask actor-pause)) (logclear! (-> obj focus-status) (focus-status dangerous)) (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) @@ -1810,180 +1873,79 @@ This commonly includes things such as: (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) (enemy-method-62 obj) (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (process-contact-action arg0) - (send-event arg0 'get-attack-count 1) - (if (zero? (-> obj hit-points)) - (kill-prefer-falling obj) - (go (method-of-object obj hit)) - ) - ) - ((= arg2 'cue-chase) - (when (and (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) - ) - (let ((v1-162 (logtest? (enemy-flag alert) (-> obj enemy-flags)))) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) - (logior! (-> obj enemy-flags) (enemy-flag dangerous-backup)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (cond - (v1-162 - (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (go-ambush obj) - (go-hostile obj) - ) - ) - ((and (-> obj next-state) (let ((v1-173 (-> obj next-state name))) - (or (= v1-173 'dormant) (= v1-173 'dormant-aware)) - ) - ) - (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (go-ambush obj) - (go (method-of-object obj notice)) - ) - ) - ) - ) - #t - ) - ) - ((= arg2 'cue-wake) - (when (and (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) - ) - (logclear! (-> obj enemy-flags) (enemy-flag alert victory called-dying)) - (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (go-ambush obj) - (react-to-focus obj) - ) - #t - ) - ) - ((= arg2 'jump) - (when (and (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) - ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj jump-why) (-> arg3 param 0)) - (set! (-> obj event-param-point quad) (-> (the-as vector (-> arg3 param 1)) quad)) - (go (method-of-object obj jump)) - ) + (kill-prefer-falling obj) ) - ((= arg2 'death-start) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag recover) (-> obj enemy-flags)))) - (send-event (ppointer->process (-> obj parent)) 'child-die) - (drop-pickup (-> obj fact) #t *entity-pool* (-> obj fact) 0) - (let ((s5-1 (-> obj on-death))) - (if s5-1 - (script-eval (the-as pair s5-1) :vector (-> obj root trans)) - ) - ) - ) - ((= arg2 'death-end) - (if (-> obj skel effect) - (logior! (-> obj skel effect flags) (effect-control-flag ecf2)) + ) + ((= arg2 'die-fast) + (logior! (-> obj draw status) (draw-control-status no-draw)) + (dispose! obj) + (send-event (ppointer->process (-> obj parent)) 'child-die) + (let ((s5-3 (-> obj on-death))) + (if s5-3 + (script-eval (the-as pair s5-3) :vector (-> obj root trans)) ) - (logior! (-> obj draw status) (draw-control-status no-draw)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (set! (-> obj enemy-flags) (logclear (-> obj enemy-flags) (enemy-flag check-water))) ) - ((= arg2 'instant-death) - (when (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time))) - (set! (-> obj hit-points) 0) - (set! (-> obj root penetrated-by) (get-penetrate-info obj)) - (let ((s5-2 (enemy-method-50 obj (new 'stack-no-clear 'vector)))) - (vector-z-quaternion! s5-2 (-> obj root quat)) - (vector-float*! s5-2 s5-2 -1.0) - (vector-normalize! s5-2 1.0) - ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) - ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (kill-prefer-falling obj) + (cleanup-for-death obj) + (go (method-of-object obj die-fast)) + ) + ((= arg2 'victory) + (if (and (-> obj enemy-info use-victory) + (not (and (-> obj next-state) (= (-> obj next-state name) 'victory))) + (> (-> obj hit-points) 0) + (zero? (-> obj fated-time)) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) + ) + (go (method-of-object obj victory)) ) - ) - ((= arg2 'die-fast) - (logior! (-> obj draw status) (draw-control-status no-draw)) - (dispose! obj) - (send-event (ppointer->process (-> obj parent)) 'child-die) - (let ((s5-3 (-> obj on-death))) - (if s5-3 - (script-eval (the-as pair s5-3) :vector (-> obj root trans)) - ) + ) + ((= arg2 'nav-control) + (if (nonzero? (-> obj nav)) + (-> obj nav) ) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) - ) - ((= arg2 'victory) - (if (and (-> obj enemy-info use-victory) - (not (and (-> obj next-state) (= (-> obj next-state name) 'victory))) - (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) - ) - (go (method-of-object obj victory)) - ) - ) - ((= arg2 'nav-control) - (if (nonzero? (-> obj nav)) - (-> obj nav) - ) - ) - ((= arg2 'push-trans) - (move-by-vector! (-> obj root) (the-as vector (-> arg3 param 0))) - ) - ((= arg2 'move-trans) - (move-to-point! (-> obj root) (the-as vector (-> arg3 param 0))) - ) - ((= arg2 'shadow) - (cond - ((-> arg3 param 0) - (let ((v1-320 (-> obj draw shadow-ctrl))) - (logclear! (-> v1-320 settings flags) (shadow-flags disable-draw)) - ) - 0 + ) + ((= arg2 'push-trans) + (move-by-vector! (-> obj root) (the-as vector (-> arg3 param 0))) + ) + ((= arg2 'move-trans) + (move-to-point! (-> obj root) (the-as vector (-> arg3 param 0))) + ) + ((= arg2 'shadow) + (cond + ((-> arg3 param 0) + (let ((v1-320 (-> obj draw shadow-ctrl))) + (logclear! (-> v1-320 settings flags) (shadow-flags disable-draw)) ) - (else - (let ((v1-323 (-> obj draw shadow-ctrl))) - (logior! (-> v1-323 settings flags) (shadow-flags disable-draw)) - ) - 0 + 0 + ) + (else + (let ((v1-323 (-> obj draw shadow-ctrl))) + (logior! (-> v1-323 settings flags) (shadow-flags disable-draw)) ) + 0 ) ) - ((= arg2 'color-effect) - (case (-> arg3 param 0) - (('dark) - (let ((f30-0 (rand-vu-float-range 0.2 1.0))) - (set-vector! (-> obj draw color-mult) (lerp 1.0 1.0 f30-0) (lerp 1.0 0.0 f30-0) (lerp 1.0 1.0 f30-0) 1.0) - (set! s5-5 (-> obj draw color-emissive)) - (set! (-> s5-5 x) (lerp 0.0 0.3 f30-0)) - (set! (-> s5-5 y) (lerp 0.0 0.0 f30-0)) - (set! (-> s5-5 z) (lerp 0.0 0.3 f30-0)) - ) - (set! (-> s5-5 w) 1.0) - s5-5 - ) - ((#f) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) + ) + ((= arg2 'color-effect) + (case (-> arg3 param 0) + (('dark) + (let ((f30-0 (rand-vu-float-range 0.2 1.0))) + (set-vector! (-> obj draw color-mult) (lerp 1.0 1.0 f30-0) (lerp 1.0 0.0 f30-0) (lerp 1.0 1.0 f30-0) 1.0) (set! s5-5 (-> obj draw color-emissive)) - (set! (-> s5-5 quad) (the-as uint128 0)) - s5-5 + (set! (-> s5-5 x) (lerp 0.0 0.3 f30-0)) + (set! (-> s5-5 y) (lerp 0.0 0.0 f30-0)) + (set! (-> s5-5 z) (lerp 0.0 0.3 f30-0)) ) - ) + (set! (-> s5-5 w) 1.0) + s5-5 + ) + ((#f) + (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) + (set! s5-5 (-> obj draw color-emissive)) + (set! (-> s5-5 quad) (the-as uint128 0)) + s5-5 + ) ) - ) + ) ) ) @@ -2225,7 +2187,6 @@ This commonly includes things such as: (logclear! (-> self mask) (process-mask actor-pause)) ) ) - (none) ) :trans (behavior () (if (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) @@ -2233,12 +2194,10 @@ This commonly includes things such as: ) (go-virtual active) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) (sleep-code) - (none) ) :post (behavior () (idle-control-method-10 (-> self idle-anim-player) self) @@ -2247,7 +2206,6 @@ This commonly includes things such as: ) (enemy-method-129 self) (ja-post) - (none) ) ) @@ -2268,7 +2226,6 @@ This commonly includes things such as: (logior! (-> self enemy-flags) (enemy-flag victory)) ) (logior! (-> self focus-status) (focus-status disable)) - (none) ) :exit (behavior () (logclear! (-> self focus-status) (focus-status disable)) @@ -2279,7 +2236,6 @@ This commonly includes things such as: (logclear! (-> self draw status) (draw-control-status no-draw)) (logclear! (-> self enemy-flags) (enemy-flag victory)) (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :code (the-as (function none :behavior enemy) sleep-code) ) @@ -2298,7 +2254,6 @@ This commonly includes things such as: (go-virtual active) ) ) - (none) ) :code (the-as (function none :behavior enemy) sleep-code) :post (behavior () @@ -2306,7 +2261,6 @@ This commonly includes things such as: (set! (-> self last-draw-time) (current-time)) ) (enemy-method-129 self) - (none) ) ) @@ -2315,11 +2269,9 @@ This commonly includes things such as: :event enemy-event-handler :enter (behavior () (logior! (-> self enemy-flags) (enemy-flag chase-startup)) - (none) ) :code (behavior () (go-virtual notice) - (none) ) ) @@ -2343,7 +2295,6 @@ This commonly includes things such as: (logclear! (-> self mask) (process-mask actor-pause)) ) ) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) @@ -2358,17 +2309,14 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) (sleep-code) - (none) ) :post (behavior () (idle-control-method-10 (-> self idle-anim-player) self) (enemy-simple-post) - (none) ) ) @@ -2406,7 +2354,6 @@ This commonly includes things such as: ) ) (logior! (-> self enemy-flags) (enemy-flag chase-startup)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -2432,7 +2379,6 @@ This commonly includes things such as: ) ) (react-to-focus self) - (none) ) :post enemy-simple-post ) @@ -2454,7 +2400,6 @@ This commonly includes things such as: ) ) ) - (none) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) @@ -2472,7 +2417,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2485,7 +2429,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post enemy-simple-post ) @@ -2497,7 +2440,6 @@ This commonly includes things such as: (set! (-> self state-time) (current-time)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self enemy-flags) (enemy-flag dangerous-backup)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) @@ -2515,7 +2457,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -2534,7 +2475,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post enemy-simple-post ) @@ -2545,7 +2485,6 @@ This commonly includes things such as: :enter (behavior () (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -2567,7 +2506,6 @@ This commonly includes things such as: ) ) (react-to-focus self) - (none) ) :post enemy-simple-post ) @@ -2580,7 +2518,6 @@ This commonly includes things such as: (look-at-target! self (enemy-flag lock-focus)) (logclear! (-> self enemy-flags) (enemy-flag dangerous-backup)) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) @@ -2588,7 +2525,6 @@ This commonly includes things such as: (go-stare self) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2601,7 +2537,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post enemy-simple-post ) @@ -2823,14 +2758,12 @@ This commonly includes things such as: (set! (-> self attack-id) a0-2) ) (logclear! (-> self focus-status) (focus-status in-air)) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'enemy-jump-info))) @@ -2894,7 +2827,6 @@ This commonly includes things such as: ) ) (enemy-method-93 self) - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) @@ -2904,7 +2836,6 @@ This commonly includes things such as: (find-overlapping-shapes (-> self root) a1-0) ) (enemy-simple-post) - (none) ) ) @@ -2914,7 +2845,6 @@ This commonly includes things such as: :enter (behavior () (set! (-> self state-time) (current-time)) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.5)) @@ -2923,7 +2853,6 @@ This commonly includes things such as: (enemy-method-93 self) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -2941,7 +2870,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post enemy-simple-post ) @@ -2953,7 +2881,6 @@ This commonly includes things such as: (stop-looking-at-target! self) (logclear! (-> self mask) (process-mask actor-pause)) (enemy-method-135 self 0) - (none) ) :code (behavior () (local-vars (v1-37 enemy-flag) (v1-45 enemy-flag)) @@ -3000,7 +2927,6 @@ This commonly includes things such as: (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (go-hostile self) - (none) ) :post enemy-simple-post ) @@ -3384,7 +3310,6 @@ This commonly includes things such as: (set! (-> self root penetrate-using) (penetrate lunge vehicle knocked)) (enemy-method-49 self) (enemy-method-46 self 1) - (none) ) :exit (behavior () (local-vars (v1-1 enemy-flag) (v1-15 enemy-flag) (v1-23 enemy-flag)) @@ -3425,13 +3350,11 @@ This commonly includes things such as: (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) ) - (none) ) :trans (behavior () (if (>= (-> self enemy-info knocked-seek-ry-clamp) 0.0) (seek-toward-yaw-angle! (-> self root) (-> self desired-angle) 138353.78 (seconds 0.1)) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'enemy-knocked-info))) @@ -3510,7 +3433,6 @@ This commonly includes things such as: (go-hostile self) ) ) - (none) ) :post enemy-falling-post ) @@ -3572,7 +3494,6 @@ This commonly includes things such as: (set! (-> self state-time) (current-time)) (set! (-> self hit-points) 0) (enemy-method-103 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -3598,7 +3519,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post enemy-simple-post ) @@ -3632,7 +3552,6 @@ This commonly includes things such as: (logior! (-> self enemy-flags) (enemy-flag trackable-backup)) ) (enemy-method-103 self) - (none) ) :exit (behavior () (local-vars (v0-0 enemy-flag)) @@ -3643,7 +3562,6 @@ This commonly includes things such as: ) ) (set! (-> self enemy-flags) v0-0) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -3669,7 +3587,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post enemy-die-falling-post ) @@ -3680,11 +3597,9 @@ This commonly includes things such as: :enter (behavior () (logior! (-> self enemy-flags) (enemy-flag victory)) ((-> (method-of-type enemy idle) enter)) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag victory)) - (none) ) :code (-> (method-of-type enemy idle) code) :post (-> (method-of-type enemy idle) post) @@ -3699,11 +3614,9 @@ This commonly includes things such as: :virtual #t :enter (behavior () '() - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (let ((gp-0 (-> self draw art-group))) @@ -3726,7 +3639,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior enemy) transform-post) ) diff --git a/goal_src/jak2/engine/ambient/ambient.gc b/goal_src/jak2/engine/ambient/ambient.gc index ce38632b27d..bc503ecb2eb 100644 --- a/goal_src/jak2/engine/ambient/ambient.gc +++ b/goal_src/jak2/engine/ambient/ambient.gc @@ -367,7 +367,6 @@ (suspend) ) (go-virtual exit) - (none) ) ) @@ -401,7 +400,6 @@ (auto-save-user) ) (apply-settings *setting-control*) - (none) ) :exit (behavior () (let ((gp-0 (-> self message on-close))) @@ -453,7 +451,6 @@ (remove-setting! 'hint) (remove-setting! 'speech-control) (apply-settings *setting-control*) - (none) ) :code (behavior () (local-vars (v1-43 symbol)) @@ -524,7 +521,6 @@ (auto-save-user) ) (go-virtual exit) - (none) ) ) diff --git a/goal_src/jak2/engine/anim/fma-sphere.gc b/goal_src/jak2/engine/anim/fma-sphere.gc index c88d729ee65..66aba5f3f51 100644 --- a/goal_src/jak2/engine/anim/fma-sphere.gc +++ b/goal_src/jak2/engine/anim/fma-sphere.gc @@ -51,10 +51,10 @@ (defstate idle (fma-sphere) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) - (let ((v1-1 (-> event param 0))) + (let ((v1-1 (-> block param 0))) (if v1-1 (send-event proc 'attack v1-1 (static-attack-info ((id (-> self attack-id)) (mode 'eco-red) @@ -75,7 +75,6 @@ (if (logtest? (-> self mode) (fma-sphere-mode kill-once)) (send-event *traffic-manager* 'kill-traffic-sphere (-> self sphere)) ) - (none) ) :trans (behavior () (local-vars (at-0 int)) @@ -141,7 +140,6 @@ (new 'static 'rgba :r #x80 :g #x40 :a #x80) ) ) - (none) ) ) :code (the-as (function none :behavior fma-sphere) sleep-code) diff --git a/goal_src/jak2/engine/anim/joint-exploder.gc b/goal_src/jak2/engine/anim/joint-exploder.gc index 32561187d5e..eadbd5e2198 100644 --- a/goal_src/jak2/engine/anim/joint-exploder.gc +++ b/goal_src/jak2/engine/anim/joint-exploder.gc @@ -537,7 +537,6 @@ (defstate joint-exploder-shatter (joint-exploder) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (let* ((f0-1 (the float (- (current-time) (-> self state-time)))) @@ -585,7 +584,6 @@ ) ) 0 - (none) ) :code (behavior () (set! (-> self state-time) (current-time)) @@ -593,7 +591,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior joint-exploder) ja-post) ) diff --git a/goal_src/jak2/engine/anim/joint.gc b/goal_src/jak2/engine/anim/joint.gc index 43bc9b3905c..5ea031cf4ea 100644 --- a/goal_src/jak2/engine/anim/joint.gc +++ b/goal_src/jak2/engine/anim/joint.gc @@ -771,7 +771,7 @@ ) ) ) - (the-as object sv-24) + sv-24 ) ;; ERROR: Failed load: (set! vf2 (l.vf (the-as int a2-1))) at op 46 diff --git a/goal_src/jak2/engine/camera/cam-combiner.gc b/goal_src/jak2/engine/camera/cam-combiner.gc index 3ed9b952d19..be765f09792 100644 --- a/goal_src/jak2/engine/camera/cam-combiner.gc +++ b/goal_src/jak2/engine/camera/cam-combiner.gc @@ -138,148 +138,143 @@ ) (defstate cam-combiner-active (camera-combiner) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (the-as - object - (case event-type - (('fast-rot) - (set! v0-0 #t) - (set! (-> self fast-rot) (the-as basic v0-0)) - v0-0 - ) - (('set-interpolation) - (let ((f0-1 (the float (-> event param 0)))) - (cond - ((>= 0.0 f0-1) - (set! (-> self interp-val) 1.0) - ) - (else - (set! (-> self interp-val) 0.0) - (set! (-> self interp-step) (/ 5.0 f0-1)) - ) + (case message + (('fast-rot) + (set! v0-0 #t) + (set! (-> self fast-rot) (the-as basic v0-0)) + v0-0 + ) + (('set-interpolation) + (let ((f0-1 (the float (-> block param 0)))) + (cond + ((>= 0.0 f0-1) + (set! (-> self interp-val) 1.0) + ) + (else + (set! (-> self interp-val) 0.0) + (set! (-> self interp-step) (/ 5.0 f0-1)) ) ) ) - (('teleport) - (when (nonzero? (-> self tracking-status)) - (jump-to-target! (-> self tracking point-of-interest-blend) 0.0) - (cam-calc-follow! (-> self tracking) (-> self trans) #f) - (the-as object (slave-set-rotation! - (-> self tracking) - (-> self trans) - (the-as cam-slave-options-u32 (-> self tracking-options)) - (-> self fov) - #f - ) - ) + ) + (('teleport) + (when (nonzero? (-> self tracking-status)) + (jump-to-target! (-> self tracking point-of-interest-blend) 0.0) + (cam-calc-follow! (-> self tracking) (-> self trans) #f) + (slave-set-rotation! + (-> self tracking) + (-> self trans) + (the-as cam-slave-options-u32 (-> self tracking-options)) + (-> self fov) + #f ) ) - (('stop-tracking) - (set! (-> self tracking-status) (the-as uint 0)) - 0 - ) - (('start-tracking) - (cond - ((< arg1 1) - (let ((t9-3 format) - (a0-14 0) - (a1-4 "ERROR : missing camera-slave parameter to *camera-combiner* start-tracking~%") - ) - (let ((v1-8 (-> event param 0))) - (rtype-of v1-8) + ) + (('stop-tracking) + (set! (-> self tracking-status) (the-as uint 0)) + 0 + ) + (('start-tracking) + (cond + ((< argc 1) + (let ((t9-3 format) + (a0-14 0) + (a1-4 "ERROR : missing camera-slave parameter to *camera-combiner* start-tracking~%") ) - (t9-3 a0-14 a1-4) + (let ((v1-8 (-> block param 0))) + (rtype-of v1-8) ) + (t9-3 a0-14 a1-4) ) - ((not (type? (-> event param 0) camera-slave)) - (let ((t9-5 format) - (a0-16 0) - (a1-6 "ERROR : invalid type '~A' to *camera-combiner* start-tracking~%") - (v1-11 (-> event param 0)) - ) - (t9-5 a0-16 a1-6 (rtype-of v1-11)) - ) + ) + ((not (type? (-> block param 0) camera-slave)) + (let ((t9-5 format) + (a0-16 0) + (a1-6 "ERROR : invalid type '~A' to *camera-combiner* start-tracking~%") + (v1-11 (-> block param 0)) + ) + (t9-5 a0-16 a1-6 (rtype-of v1-11)) ) - ((zero? (-> self tracking-status)) - (set! (-> self tracking-status) (the-as uint 1)) - (let ((gp-1 (the-as camera-slave (-> event param 0)))) - (set! (-> self tracking-options) (the-as int (-> gp-1 options))) - (set! (-> self tracking no-follow) (-> gp-1 tracking no-follow)) - (copy-to (-> self tracking tilt-adjust) (-> gp-1 tracking tilt-adjust)) - (copy-to (-> self tracking underwater-blend) (-> gp-1 tracking underwater-blend)) - (copy-to (-> self tracking point-of-interest-blend) (-> gp-1 tracking point-of-interest-blend)) - (let ((gp-2 (-> gp-1 trans))) - (cam-calc-follow! (-> self tracking) gp-2 #f) - (the-as object (slave-set-rotation! - (-> self tracking) - gp-2 - (the-as cam-slave-options-u32 (-> self tracking-options)) - (-> self fov) - #f - ) - ) + ) + ((zero? (-> self tracking-status)) + (set! (-> self tracking-status) (the-as uint 1)) + (let ((gp-1 (the-as camera-slave (-> block param 0)))) + (set! (-> self tracking-options) (the-as int (-> gp-1 options))) + (set! (-> self tracking no-follow) (-> gp-1 tracking no-follow)) + (copy-to (-> self tracking tilt-adjust) (-> gp-1 tracking tilt-adjust)) + (copy-to (-> self tracking underwater-blend) (-> gp-1 tracking underwater-blend)) + (copy-to (-> self tracking point-of-interest-blend) (-> gp-1 tracking point-of-interest-blend)) + (let ((gp-2 (-> gp-1 trans))) + (cam-calc-follow! (-> self tracking) gp-2 #f) + (slave-set-rotation! + (-> self tracking) + gp-2 + (the-as cam-slave-options-u32 (-> self tracking-options)) + (-> self fov) + #f ) ) ) - ) + ) ) - (('copy-tracking) - (cond - ((< arg1 1) - (let ((t9-11 format) - (a0-23 0) - (a1-12 "ERROR : missing camera-slave parameter to *camera-combiner* copy-tracking~%") - ) - (let ((v1-23 (-> event param 0))) - (rtype-of v1-23) + ) + (('copy-tracking) + (cond + ((< argc 1) + (let ((t9-11 format) + (a0-23 0) + (a1-12 "ERROR : missing camera-slave parameter to *camera-combiner* copy-tracking~%") ) - (t9-11 a0-23 a1-12) + (let ((v1-23 (-> block param 0))) + (rtype-of v1-23) ) + (t9-11 a0-23 a1-12) ) - ((not (type? (-> event param 0) camera-slave)) - (let ((t9-13 format) - (a0-25 0) - (a1-14 "ERROR : invalid type '~A' to *camera-combiner* copy-tracking~%") - (v1-25 (-> event param 0)) - ) - (t9-13 a0-25 a1-14 (rtype-of v1-25)) - ) - ) - ((nonzero? (-> self tracking-status)) - #f + ) + ((not (type? (-> block param 0) camera-slave)) + (let ((t9-13 format) + (a0-25 0) + (a1-14 "ERROR : invalid type '~A' to *camera-combiner* copy-tracking~%") + (v1-25 (-> block param 0)) + ) + (t9-13 a0-25 a1-14 (rtype-of v1-25)) ) - (else - (set! (-> self tracking-status) (the-as uint 1)) - (let ((gp-3 (the-as camera-slave (-> event param 0)))) - (set! (-> self tracking-options) (the-as int (-> gp-3 options))) - (set! (-> self tracking no-follow) (-> gp-3 tracking no-follow)) - (copy-to (-> self tracking tilt-adjust) (-> gp-3 tracking tilt-adjust)) - (copy-to (-> self tracking underwater-blend) (-> gp-3 tracking underwater-blend)) - (set! (-> self tracking follow-off quad) (-> gp-3 tracking follow-off quad)) - (set! (-> self tracking follow-pt quad) (-> gp-3 tracking follow-pt quad)) - (let* ((a2-23 (-> self tracking)) - (a3-7 (-> gp-3 tracking)) - (v1-37 (-> a3-7 inv-mat quad 0)) - (a0-32 (-> a3-7 inv-mat quad 1)) - (a1-17 (-> a3-7 inv-mat quad 2)) - (a3-8 (-> a3-7 inv-mat trans quad)) - ) - (set! (-> a2-23 inv-mat quad 0) v1-37) - (set! (-> a2-23 inv-mat quad 1) a0-32) - (set! (-> a2-23 inv-mat quad 2) a1-17) - (set! (-> a2-23 inv-mat trans quad) a3-8) - ) - (copy-to (-> self tracking point-of-interest-blend) (-> gp-3 tracking point-of-interest-blend)) - (set! (-> self tracking looking-at quad) (-> gp-3 tracking looking-at quad)) - (set! v0-0 (-> self tracking looking-interesting)) - (set! (-> (the-as vector v0-0) quad) (-> gp-3 tracking looking-interesting quad)) + ) + ((nonzero? (-> self tracking-status)) + #f + ) + (else + (set! (-> self tracking-status) (the-as uint 1)) + (let ((gp-3 (the-as camera-slave (-> block param 0)))) + (set! (-> self tracking-options) (the-as int (-> gp-3 options))) + (set! (-> self tracking no-follow) (-> gp-3 tracking no-follow)) + (copy-to (-> self tracking tilt-adjust) (-> gp-3 tracking tilt-adjust)) + (copy-to (-> self tracking underwater-blend) (-> gp-3 tracking underwater-blend)) + (set! (-> self tracking follow-off quad) (-> gp-3 tracking follow-off quad)) + (set! (-> self tracking follow-pt quad) (-> gp-3 tracking follow-pt quad)) + (let* ((a2-23 (-> self tracking)) + (a3-7 (-> gp-3 tracking)) + (v1-37 (-> a3-7 inv-mat quad 0)) + (a0-32 (-> a3-7 inv-mat quad 1)) + (a1-17 (-> a3-7 inv-mat quad 2)) + (a3-8 (-> a3-7 inv-mat trans quad)) + ) + (set! (-> a2-23 inv-mat quad 0) v1-37) + (set! (-> a2-23 inv-mat quad 1) a0-32) + (set! (-> a2-23 inv-mat quad 2) a1-17) + (set! (-> a2-23 inv-mat trans quad) a3-8) ) - v0-0 + (copy-to (-> self tracking point-of-interest-blend) (-> gp-3 tracking point-of-interest-blend)) + (set! (-> self tracking looking-at quad) (-> gp-3 tracking looking-at quad)) + (set! v0-0 (-> self tracking looking-interesting)) + (set! (-> (the-as vector v0-0) quad) (-> gp-3 tracking looking-interesting quad)) ) + v0-0 ) ) - ) + ) ) ) :code (behavior () @@ -443,7 +438,6 @@ (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/engine/camera/cam-layout.gc b/goal_src/jak2/engine/camera/cam-layout.gc index 25e390621db..c83ab953de8 100644 --- a/goal_src/jak2/engine/camera/cam-layout.gc +++ b/goal_src/jak2/engine/camera/cam-layout.gc @@ -3288,7 +3288,6 @@ (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/engine/camera/cam-master.gc b/goal_src/jak2/engine/camera/cam-master.gc index b2cae748025..392ab260387 100644 --- a/goal_src/jak2/engine/camera/cam-master.gc +++ b/goal_src/jak2/engine/camera/cam-master.gc @@ -592,357 +592,352 @@ ) (defstate cam-master-active (camera-master) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object) (v1-125 uint)) (rlet ((vf0 :class vf)) (init-vf0-vector) - (let ((v1-0 event-type)) - (the-as - object - (cond - ((= v1-0 'dist-from-interp-src) - (cond - ((not *camera-combiner*) - #x48c80000 - ) - ((= (-> *camera-combiner* interp-val) 0.0) - 0 - ) - (else - (-> *camera-combiner* dist-from-src) - ) - ) - ) - ((= v1-0 'dist-from-interp-dest) - (cond - ((not *camera-combiner*) - 0 - ) - ((= (-> *camera-combiner* interp-val) 0.0) - #x48c80000 - ) - (else - (-> *camera-combiner* dist-from-dest) - ) - ) - ) - ((= v1-0 'level-deactivate) - (format 0 "ERROR : *camera* level-deactivate event not supported anymore~%") - ) - ((= v1-0 'clear-entity) - (format 0 "ERROR : *camera* clear-entity event not supported anymore~%") - ) - ((= v1-0 'no-intro) - (format 0 "ERROR : *camera* no-intro event not supported anymore '~S'~%" (-> event param 0)) + (case message + (('dist-from-interp-src) + (cond + ((not *camera-combiner*) + #x48c80000 + ) + ((= (-> *camera-combiner* interp-val) 0.0) + 0 + ) + (else + (-> *camera-combiner* dist-from-src) ) - ((= v1-0 'force-blend) - (format 0 "ERROR : *camera* force-blend event not supported anymore '~S'~%" (-> event param 0)) + ) + ) + (('dist-from-interp-dest) + (cond + ((not *camera-combiner*) + 0 + ) + ((= (-> *camera-combiner* interp-val) 0.0) + #x48c80000 + ) + (else + (-> *camera-combiner* dist-from-dest) ) - ((= v1-0 'teleport-to-transformq) - (when (> arg1 0) - (let ((gp-1 (the-as object (-> event param 0)))) - (when (-> self slave) - (deactivate (-> self slave 0)) - (set! (-> self slave) (the-as (pointer camera-slave) #f)) - ) - (set! (-> *camera-combiner* trans quad) (-> (the-as matrix gp-1) vector 0 quad)) - (quaternion->matrix (-> *camera-combiner* inv-camera-rot) (the-as quaternion (+ (the-as uint gp-1) 16))) - ) - (send-event self 'teleport) - (cam-master-activate-slave #f) - #t + ) + ) + (('level-deactivate) + (format 0 "ERROR : *camera* level-deactivate event not supported anymore~%") + ) + (('clear-entity) + (format 0 "ERROR : *camera* clear-entity event not supported anymore~%") + ) + (('no-intro) + (format 0 "ERROR : *camera* no-intro event not supported anymore '~S'~%" (-> block param 0)) + ) + (('force-blend) + (format 0 "ERROR : *camera* force-blend event not supported anymore '~S'~%" (-> block param 0)) + ) + (('teleport-to-transformq) + (when (> argc 0) + (let ((gp-1 (the-as object (-> block param 0)))) + (when (-> self slave) + (deactivate (-> self slave 0)) + (set! (-> self slave) (the-as (pointer camera-slave) #f)) ) + (set! (-> *camera-combiner* trans quad) (-> (the-as matrix gp-1) vector 0 quad)) + (quaternion->matrix (-> *camera-combiner* inv-camera-rot) (the-as quaternion (+ (the-as uint gp-1) 16))) ) - ((= v1-0 'teleport-to-other-start-string) - (let ((gp-2 (new 'stack-no-clear 'vector))) - (when (-> self slave) - (deactivate (-> self slave 0)) - (set! (-> self slave) (the-as (pointer camera-slave) #f)) - ) - (set! (-> *camera-combiner* trans quad) (-> *camera-other-trans* quad)) - (vector-! gp-2 (-> self tpos-curr-adj) *camera-other-trans*) - (vector-normalize! gp-2 1.0) - (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-2 (new 'static 'vector :y -1.0)) - ) - (send-event self 'teleport) - (the-as object (cam-master-activate-slave #f)) + (send-event self 'teleport) + (cam-master-activate-slave #f) + #t + ) + ) + (('teleport-to-other-start-string) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (when (-> self slave) + (deactivate (-> self slave 0)) + (set! (-> self slave) (the-as (pointer camera-slave) #f)) ) - ((= v1-0 'teleport-to-vector-start-string) - (when (> arg1 0) - (let ((s5-0 (the-as object (-> event param 0))) - (gp-3 (new 'stack-no-clear 'vector)) - ) - (when (-> self slave) - (deactivate (-> self slave 0)) - (set! (-> self slave) (the-as (pointer camera-slave) #f)) - ) - (set! (-> *camera-combiner* trans quad) (-> (the-as vector s5-0) quad)) - (vector-! gp-3 (-> self tpos-curr-adj) (the-as vector s5-0)) - (vector-normalize! gp-3 1.0) - (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-3 (new 'static 'vector :y -1.0)) + (set! (-> *camera-combiner* trans quad) (-> *camera-other-trans* quad)) + (vector-! gp-2 (-> self tpos-curr-adj) *camera-other-trans*) + (vector-normalize! gp-2 1.0) + (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-2 (new 'static 'vector :y -1.0)) + ) + (send-event self 'teleport) + (cam-master-activate-slave #f) + ) + (('teleport-to-vector-start-string) + (when (> argc 0) + (let ((s5-0 (the-as object (-> block param 0))) + (gp-3 (new 'stack-no-clear 'vector)) ) - (send-event self 'teleport) - (the-as object (cam-master-activate-slave #f)) + (when (-> self slave) + (deactivate (-> self slave 0)) + (set! (-> self slave) (the-as (pointer camera-slave) #f)) ) + (set! (-> *camera-combiner* trans quad) (-> (the-as vector s5-0) quad)) + (vector-! gp-3 (-> self tpos-curr-adj) (the-as vector s5-0)) + (vector-normalize! gp-3 1.0) + (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-3 (new 'static 'vector :y -1.0)) ) - ((= v1-0 'change-target) - (let ((a1-15 (-> event param 0))) - (cond - ((not a1-15) - (clear-focused (-> self focus)) - (logclear! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) - ) - (else - (try-update-focus (-> self focus) (the-as process-focusable a1-15)) - (logior! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) - (reset-target-tracking) - ) - ) + (send-event self 'teleport) + (cam-master-activate-slave #f) + ) + ) + (('change-target) + (let ((a1-15 (-> block param 0))) + (cond + ((not a1-15) + (clear-focused (-> self focus)) + (logclear! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) + ) + (else + (try-update-focus (-> self focus) (the-as process-focusable a1-15)) + (logior! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) + (reset-target-tracking) ) - (set! (-> *camera-combiner* tracking no-follow) #f) - #f - ) - ((= v1-0 'intro-done?) - (or (not (-> self slave)) (>= (-> self slave 0 intro-t) 1.0)) ) - ((= v1-0 'query-state) - (and (-> self slave) (= (-> self slave 0 next-state) (-> event param 0))) - ) - ((= v1-0 'change-to-entity-by-name) - (format - 0 - "ERROR : *camera* change-to-entity-by-name event not supported anymore '~S'~%" - (-> event param 0) + ) + (set! (-> *camera-combiner* tracking no-follow) #f) + #f + ) + (('intro-done?) + (or (not (-> self slave)) (>= (-> self slave 0 intro-t) 1.0)) + ) + (('query-state) + (and (-> self slave) (= (-> self slave 0 next-state) (-> block param 0))) + ) + (('change-to-entity-by-name) + (format + 0 + "ERROR : *camera* change-to-entity-by-name event not supported anymore '~S'~%" + (-> block param 0) + ) + ) + (('change-state) + (format 0 "ERROR : *camera* change-state event not supported anymore ~A~%" (-> block param 0)) + ) + (('set-slave) + (let ((s5-1 (process->ppointer (the-as process (-> block param 0)))) + (s4-0 (-> self settings interp-time)) + (gp-4 (-> self slave)) ) - ) - ((= v1-0 'change-state) - (format 0 "ERROR : *camera* change-state event not supported anymore ~A~%" (-> event param 0)) - ) - ((= v1-0 'set-slave) - (let ((s5-1 (process->ppointer (the-as process (-> event param 0)))) - (s4-0 (-> self settings interp-time)) - (gp-4 (-> self slave)) - ) - (when (and s5-1 (!= s5-1 gp-4)) - (set! (-> self slave) (the-as (pointer camera-slave) s5-1)) - (logior! (-> self master-options) (cam-master-options-u32 SET_COMBINER_AXIS)) - (set! (-> *camera-combiner* tracking tilt-adjust target) (-> self slave 0 tracking tilt-adjust target)) - (cond - ((or (zero? s4-0) (not gp-4)) - (if *math-camera* - (set! (-> *math-camera* reset) 1) - ) - (send-event *camera-combiner* 'set-interpolation 0) - (send-event *camera-combiner* 'stop-tracking) - (if (= (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) (camera-blend-to-type unknown-2)) - (send-event *camera-combiner* 'start-tracking (ppointer->process s5-1)) - ) + (when (and s5-1 (!= s5-1 gp-4)) + (set! (-> self slave) (the-as (pointer camera-slave) s5-1)) + (logior! (-> self master-options) (cam-master-options-u32 SET_COMBINER_AXIS)) + (set! (-> *camera-combiner* tracking tilt-adjust target) (-> self slave 0 tracking tilt-adjust target)) + (cond + ((or (zero? s4-0) (not gp-4)) + (if *math-camera* + (set! (-> *math-camera* reset) 1) ) - ((begin - (when (< 0.0 (-> gp-4 0 intro-t-step)) - (set! (-> self outro-t) (-> gp-4 0 intro-t)) - (set! (-> self outro-t-step) (/ -5.0 (the float s4-0))) - (set! (-> self outro-exit-value) (-> gp-4 0 outro-exit-value)) - (curve-copy! (-> self outro-curve) (-> gp-4 0 intro-curve)) - ) - (if (-> self settings no-intro) - (set! (-> self outro-t) 0.0) - ) - (send-event *camera-combiner* 'set-interpolation s4-0) - (cond - ((zero? (-> gp-4 0 blend-from-type)) - (send-event (ppointer->process (-> self decel)) 'change-state cam-fixed) - (send-event *camera-combiner* 'stop-tracking) - ) - (else - (send-event (ppointer->process (-> self decel)) 'change-state cam-decel) - ) - ) - (set! v1-125 (-> *camera-combiner* tracking-status)) - (zero? v1-125) - ) - (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) - (((camera-blend-to-type unknown-0)) - ) - (((camera-blend-to-type unknown-1)) - ) - (((camera-blend-to-type unknown-2)) - (if (= (-> gp-4 0 blend-from-type) 1) - (send-event *camera-combiner* 'copy-tracking (ppointer->process gp-4)) - (send-event *camera-combiner* 'start-tracking (ppointer->process s5-1)) - ) - (set! (-> *camera-combiner* tracking-status) (the-as uint 2)) - ) - (else - (format 0 "unknown blend-to type~%") - ) - ) + (send-event *camera-combiner* 'set-interpolation 0) + (send-event *camera-combiner* 'stop-tracking) + (if (= (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) (camera-blend-to-type unknown-2)) + (send-event *camera-combiner* 'start-tracking (ppointer->process s5-1)) ) - ((= v1-125 1) - (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) - (((camera-blend-to-type unknown-0)) - (set! (-> *camera-combiner* tracking-status) (the-as uint 3)) - ) - (((camera-blend-to-type unknown-1)) - (set! (-> *camera-combiner* tracking-status) (the-as uint 3)) - ) - (((camera-blend-to-type unknown-2)) - ) - (else - (format 0 "unknown blend-to type~%") - ) + ) + ((begin + (when (< 0.0 (-> gp-4 0 intro-t-step)) + (set! (-> self outro-t) (-> gp-4 0 intro-t)) + (set! (-> self outro-t-step) (/ -5.0 (the float s4-0))) + (set! (-> self outro-exit-value) (-> gp-4 0 outro-exit-value)) + (curve-copy! (-> self outro-curve) (-> gp-4 0 intro-curve)) + ) + (if (-> self settings no-intro) + (set! (-> self outro-t) 0.0) + ) + (send-event *camera-combiner* 'set-interpolation s4-0) + (cond + ((zero? (-> gp-4 0 blend-from-type)) + (send-event (ppointer->process (-> self decel)) 'change-state cam-fixed) + (send-event *camera-combiner* 'stop-tracking) + ) + (else + (send-event (ppointer->process (-> self decel)) 'change-state cam-decel) ) ) - ((or (= v1-125 2) (= v1-125 3)) - (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) - (((camera-blend-to-type unknown-0)) - (set! (-> *camera-combiner* tracking-status) (the-as uint 0)) - 0 - ) - (((camera-blend-to-type unknown-1)) - (set! (-> *camera-combiner* tracking-status) (the-as uint 0)) - 0 - ) - (((camera-blend-to-type unknown-2)) - (set! (-> *camera-combiner* tracking-status) (the-as uint 2)) + (set! v1-125 (-> *camera-combiner* tracking-status)) + (zero? v1-125) + ) + (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) + (((camera-blend-to-type unknown-0)) + ) + (((camera-blend-to-type unknown-1)) + ) + (((camera-blend-to-type unknown-2)) + (if (= (-> gp-4 0 blend-from-type) 1) + (send-event *camera-combiner* 'copy-tracking (ppointer->process gp-4)) + (send-event *camera-combiner* 'start-tracking (ppointer->process s5-1)) ) - (else - (format 0 "unknown blend-to type~%") - ) - ) + (set! (-> *camera-combiner* tracking-status) (the-as uint 2)) + ) + (else + (format 0 "unknown blend-to type~%") ) - (else - (format 0 "unknown combiner status~%") - ) + ) + ) + ((= v1-125 1) + (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) + (((camera-blend-to-type unknown-0)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 3)) ) - (if gp-4 - (the-as object (deactivate (-> gp-4 0))) - ) - ) - ) - ) - ((= v1-0 'ease-in) - (cond - ((< arg1 1) - (set! (-> self ease-t) 0.0) - (logclear! (-> self master-options) (cam-master-options-u32 HAVE_EASE_TO_POS)) + (((camera-blend-to-type unknown-1)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 3)) + ) + (((camera-blend-to-type unknown-2)) + ) + (else + (format 0 "unknown blend-to type~%") + ) + ) ) - ((< arg1 2) - (if (< (the-as float (-> event param 0)) (-> self ease-t)) - (set! (-> self ease-t) (the-as float (-> event param 0))) + ((or (= v1-125 2) (= v1-125 3)) + (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) + (((camera-blend-to-type unknown-0)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 0)) + 0 + ) + (((camera-blend-to-type unknown-1)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 0)) + 0 + ) + (((camera-blend-to-type unknown-2)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 2)) + ) + (else + (format 0 "unknown blend-to type~%") ) - (logclear! (-> self master-options) (cam-master-options-u32 HAVE_EASE_TO_POS)) + ) ) (else - (if (< (the-as float (-> event param 0)) (-> self ease-t)) - (set! (-> self ease-t) (the-as float (-> event param 0))) - ) - (set! (-> self ease-to quad) (-> (the-as vector (-> event param 1)) quad)) - (logior! (-> self master-options) (cam-master-options-u32 HAVE_EASE_TO_POS)) + (format 0 "unknown combiner status~%") ) ) - (set! (-> self ease-step) 0.033333335) - (set! v0-0 (-> self ease-from)) - (set! (-> (the-as vector v0-0) quad) (-> self tpos-curr-adj quad)) - v0-0 - ) - ((= v1-0 'damp-up) - (set! (-> self upspeed) 0.0) - ) - ((= v1-0 'reset-follow) - (reset-follow) - ) - ((= v1-0 'teleport) - (reset-target-tracking) - (if (-> self slave) - (send-event (ppointer->process (-> self slave)) event-type) + (if gp-4 + (deactivate (-> gp-4 0)) ) - (send-event *camera-combiner* event-type) ) - ((= v1-0 'toggle-slave-option) - (logxor! (-> self slave-options) (-> event param 0)) - (if (-> self slave) - (logxor! (-> self slave 0 options) (the-as uint (-> event param 0))) + ) + ) + (('ease-in) + (cond + ((< argc 1) + (set! (-> self ease-t) 0.0) + (logclear! (-> self master-options) (cam-master-options-u32 HAVE_EASE_TO_POS)) + ) + ((< argc 2) + (if (< (the-as float (-> block param 0)) (-> self ease-t)) + (set! (-> self ease-t) (the-as float (-> block param 0))) + ) + (logclear! (-> self master-options) (cam-master-options-u32 HAVE_EASE_TO_POS)) + ) + (else + (if (< (the-as float (-> block param 0)) (-> self ease-t)) + (set! (-> self ease-t) (the-as float (-> block param 0))) ) - (when (-> self decel) - (set! v0-0 (logxor (-> self decel 0 options) (the-as uint (-> event param 0)))) - (set! (-> self decel 0 options) (the-as cam-slave-options-u32 v0-0)) - v0-0 - ) + (set! (-> self ease-to quad) (-> (the-as vector (-> block param 1)) quad)) + (logior! (-> self master-options) (cam-master-options-u32 HAVE_EASE_TO_POS)) ) - ((= v1-0 'slave-option?) - (and (-> self slave) (logtest? (-> self slave 0 options) (-> event param 0))) + ) + (set! (-> self ease-step) 0.033333335) + (set! v0-0 (-> self ease-from)) + (set! (-> (the-as vector v0-0) quad) (-> self tpos-curr-adj quad)) + v0-0 + ) + (('damp-up) + (set! (-> self upspeed) 0.0) + ) + (('reset-follow) + (reset-follow) + ) + (('teleport) + (reset-target-tracking) + (if (-> self slave) + (send-event (ppointer->process (-> self slave)) message) ) - ((= v1-0 'set-slave-option) - (when (-> self slave) - (set! v0-0 (logior (-> self slave 0 options) (-> event param 0))) - (set! (-> self slave 0 options) (the-as cam-slave-options-u32 v0-0)) - v0-0 - ) + (send-event *camera-combiner* message) + ) + (('toggle-slave-option) + (logxor! (-> self slave-options) (-> block param 0)) + (if (-> self slave) + (logxor! (-> self slave 0 options) (the-as uint (-> block param 0))) ) - ((= v1-0 'clear-slave-option) - (when (-> self slave) - (set! v0-0 (logclear (-> self slave 0 options) (-> event param 0))) - (set! (-> self slave 0 options) (the-as cam-slave-options-u32 v0-0)) - v0-0 - ) + (when (-> self decel) + (set! v0-0 (logxor (-> self decel 0 options) (the-as uint (-> block param 0)))) + (set! (-> self decel 0 options) (the-as cam-slave-options-u32 v0-0)) + v0-0 + ) + ) + (('slave-option?) + (and (-> self slave) (logtest? (-> self slave 0 options) (-> block param 0))) + ) + (('set-slave-option) + (when (-> self slave) + (set! v0-0 (logior (-> self slave 0 options) (-> block param 0))) + (set! (-> self slave 0 options) (the-as cam-slave-options-u32 v0-0)) + v0-0 + ) + ) + (('clear-slave-option) + (when (-> self slave) + (set! v0-0 (logclear (-> self slave 0 options) (-> block param 0))) + (set! (-> self slave 0 options) (the-as cam-slave-options-u32 v0-0)) + v0-0 + ) + ) + (('no-follow) + (when (-> self slave) + (set! (-> self slave 0 tracking no-follow) (the-as basic #t)) + (vector-reset! (-> self slave 0 tracking follow-off)) + ) + (set! (-> *camera-combiner* tracking no-follow) (the-as basic #t)) + (set! v0-0 (-> *camera-combiner* tracking follow-off)) + (.svf (&-> (the-as vector v0-0) quad) vf0) + v0-0 + ) + (('yes-follow) + (if (-> self slave) + (set! (-> self slave 0 tracking no-follow) #f) ) - ((= v1-0 'no-follow) - (when (-> self slave) - (set! (-> self slave 0 tracking no-follow) (the-as basic #t)) - (vector-reset! (-> self slave 0 tracking follow-off)) + (set! (-> *camera-combiner* tracking no-follow) #f) + #f + ) + (('blend-from-as-fixed) + (let ((t9-42 format) + (a0-101 0) + (a1-35 "ERROR : *camera* blend-from-as-fixed event not supported anymore~%") ) - (set! (-> *camera-combiner* tracking no-follow) (the-as basic #t)) - (set! v0-0 (-> *camera-combiner* tracking follow-off)) - (.svf (&-> (the-as vector v0-0) quad) vf0) - v0-0 - ) - ((= v1-0 'yes-follow) - (if (-> self slave) - (set! (-> self slave 0 tracking no-follow) #f) - ) - (set! (-> *camera-combiner* tracking no-follow) #f) - #f - ) - ((= v1-0 'blend-from-as-fixed) - (let ((t9-42 format) - (a0-101 0) - (a1-35 "ERROR : *camera* blend-from-as-fixed event not supported anymore~%") - ) - (-> event param 0) - (t9-42 a0-101 a1-35) + (-> block param 0) + (t9-42 a0-101 a1-35) + ) + ) + (('point-of-interest) + (let ((t9-43 format) + (a0-102 0) + (a1-36 "ERROR : *camera* point-of-interest event not supported anymore~%") ) - ) - ((= v1-0 'point-of-interest) - (let ((t9-43 format) - (a0-102 0) - (a1-36 "ERROR : *camera* point-of-interest event not supported anymore~%") - ) - (-> event param 0) - (t9-43 a0-102 a1-36) + (-> block param 0) + (t9-43 a0-102 a1-36) + ) + ) + (('part-water-drip) + (set! (-> self water-drip-time) (current-time)) + (set! (-> self water-drip-mult) (the-as float (-> block param 0))) + (set! (-> self water-drip-speed) (the-as float (-> block param 1))) + ) + (else + (and (-> self slave) (let ((v1-237 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-237 from) (process->ppointer proc)) + (set! (-> v1-237 num-params) argc) + (set! (-> v1-237 message) message) + (set! (-> v1-237 param 0) (-> block param 0)) + (set! (-> v1-237 param 1) (-> block param 1)) + (set! (-> v1-237 param 2) (-> block param 2)) + (set! (-> v1-237 param 3) (-> block param 3)) + (set! (-> v1-237 param 4) (-> block param 4)) + (set! (-> v1-237 param 5) (-> block param 5)) + (send-event-function (ppointer->process (-> self slave)) v1-237) + ) ) - ) - ((= v1-0 'part-water-drip) - (set! (-> self water-drip-time) (current-time)) - (set! (-> self water-drip-mult) (the-as float (-> event param 0))) - (set! (-> self water-drip-speed) (the-as float (-> event param 1))) - ) - (else - (and (-> self slave) (let ((v1-237 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-237 from) (process->ppointer proc)) - (set! (-> v1-237 num-params) arg1) - (set! (-> v1-237 message) event-type) - (set! (-> v1-237 param 0) (-> event param 0)) - (set! (-> v1-237 param 1) (-> event param 1)) - (set! (-> v1-237 param 2) (-> event param 2)) - (set! (-> v1-237 param 3) (-> event param 3)) - (set! (-> v1-237 param 4) (-> event param 4)) - (set! (-> v1-237 param 5) (-> event param 5)) - (send-event-function (ppointer->process (-> self slave)) v1-237) - ) - ) - ) - ) ) ) ) @@ -966,7 +961,6 @@ (if (and (nonzero? camera-master-debug) *debug-segment*) (add-connection *debug-engine* self camera-master-debug self #f #f) ) - (none) ) :trans (behavior () (when (not (paused?)) @@ -976,7 +970,6 @@ ) (cam-master-effect) ) - (none) ) :code (behavior () (until #f @@ -1048,7 +1041,6 @@ (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/engine/camera/cam-states-dbg.gc b/goal_src/jak2/engine/camera/cam-states-dbg.gc index f8fde412ad3..0cdd09f017e 100644 --- a/goal_src/jak2/engine/camera/cam-states-dbg.gc +++ b/goal_src/jak2/engine/camera/cam-states-dbg.gc @@ -20,13 +20,14 @@ (define *CAM_POINT_WATCH-bank* (new 'static 'cam-point-watch-bank :speed 1600.0 :rot-speed (degrees 0.6))) (defstate cam-point-watch (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -35,7 +36,6 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) ) - (none) ) :code (behavior () (until #f @@ -84,7 +84,6 @@ 0 ) #f - (none) ) ) @@ -436,13 +435,14 @@ ) (defstate cam-free-floating (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -451,7 +451,6 @@ (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) (send-event *camera-combiner* 'stop-tracking) ) - (none) ) :code (behavior () (until #f @@ -469,6 +468,5 @@ (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/engine/camera/cam-states.gc b/goal_src/jak2/engine/camera/cam-states.gc index bbea4991050..6bfe8923696 100644 --- a/goal_src/jak2/engine/camera/cam-states.gc +++ b/goal_src/jak2/engine/camera/cam-states.gc @@ -10,13 +10,14 @@ ;; DECOMP BEGINS (defstate cam-really-fixed (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -26,25 +27,24 @@ (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 ) - (none) ) :code (behavior () (until #f (suspend) ) #f - (none) ) ) (defstate cam-fixed (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -54,7 +54,6 @@ (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 ) - (none) ) :code (behavior () (until #f @@ -71,18 +70,18 @@ (suspend) ) #f - (none) ) ) (defstate cam-fixed-read-entity (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -101,7 +100,6 @@ ) ) (go cam-fixed) - (none) ) :code (behavior () (until #f @@ -109,18 +107,18 @@ (suspend) ) #f - (none) ) ) (defstate cam-pov (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -128,14 +126,12 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) ) - (none) ) :trans (behavior () (when (not (handle->process (-> *camera* settings pov-handle))) (set! (-> self blend-from-type) (the-as uint 0)) (cam-slave-go cam-fixed) ) - (none) ) :code (behavior () (until #f @@ -174,18 +170,18 @@ (suspend) ) #f - (none) ) ) (defstate cam-pov180 (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -193,14 +189,12 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) ) - (none) ) :trans (behavior () (when (not (handle->process (-> *camera* settings pov-handle))) (set! (-> self blend-from-type) (the-as uint 0)) (cam-slave-go cam-fixed) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -283,21 +277,16 @@ ) ) #f - (none) ) ) (defstate cam-pov-track (camera-slave) - :event (the-as - (function process int symbol event-message-block object :behavior camera-slave) - cam-standard-event-handler - ) + :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) ) - (none) ) :trans (behavior () (if (or (not (handle->process (-> *camera* settings pov-handle))) @@ -305,7 +294,6 @@ ) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f @@ -347,7 +335,6 @@ (suspend) ) #f - (none) ) ) @@ -359,28 +346,25 @@ ) (defstate cam-standoff (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'set-standoff-dist) - (vector-normalize! (-> self pivot-pt) (the-as float (-> event param 0))) - (cam-standoff-calc-trans) - ) - ((= v1-0 'set-standoff-height) - (vector-flatten! (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down)) - (vector--float*! - (-> self pivot-pt) - (-> self pivot-pt) - (-> *camera* local-down) - (the-as float (-> event param 0)) - ) - (cam-standoff-calc-trans) - ) - (else - (the-as vector (cam-standard-event-handler proc arg1 event-type event)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('set-standoff-dist) + (vector-normalize! (-> self pivot-pt) (the-as float (-> block param 0))) + (cam-standoff-calc-trans) + ) + (('set-standoff-height) + (vector-flatten! (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down)) + (vector--float*! + (-> self pivot-pt) + (-> self pivot-pt) + (-> *camera* local-down) + (the-as float (-> block param 0)) + ) + (cam-standoff-calc-trans) + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -399,13 +383,11 @@ ) ) (cam-calc-follow! (-> self tracking) (-> self trans) #f) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f @@ -416,15 +398,11 @@ (suspend) ) #f - (none) ) ) (defstate cam-standoff-read-entity (camera-slave) - :event (the-as - (function process int symbol event-message-block object :behavior camera-slave) - cam-standard-event-handler - ) + :event cam-standard-event-handler :enter (behavior () (cond ((-> self enter-has-run) @@ -453,7 +431,6 @@ ) ) (go cam-standoff) - (none) ) :code (behavior () (until #f @@ -461,7 +438,6 @@ (suspend) ) #f - (none) ) ) @@ -482,13 +458,14 @@ ) (defstate cam-eye (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -504,7 +481,6 @@ 0 ) (set! (-> self fov) 11650.845) - (none) ) :exit (behavior () (if (and *target* @@ -513,13 +489,11 @@ ) (send-event *target* 'end-mode) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (go cam-free-floating) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -640,15 +614,11 @@ ) ) #f - (none) ) ) (defstate cam-spline (camera-slave) - :event (the-as - (function process int symbol event-message-block object :behavior camera-slave) - cam-standard-event-handler - ) + :event cam-standard-event-handler :enter (behavior () (cond ((-> self enter-has-run) @@ -719,13 +689,11 @@ (format #t "ERROR : cam-spline enter without entity~%") ) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f @@ -738,18 +706,18 @@ (suspend) ) #f - (none) ) ) (defstate cam-decel (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -758,7 +726,6 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) ) - (none) ) :code (behavior () (until #f @@ -792,18 +759,18 @@ (suspend) ) #f - (none) ) ) (defstate cam-endlessfall (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -811,7 +778,6 @@ (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'cam-vector-seeker)) @@ -847,7 +813,6 @@ ) ) #f - (none) ) ) @@ -1045,21 +1010,18 @@ ) (defstate cam-circular (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'teleport) - (the-as vector #f) - ) - ((= v1-0 'outro-done) - (set! (-> self trans quad) (-> *camera-combiner* trans quad)) - (cam-circular-position #f) - ) - (else - (the-as vector (cam-standard-event-handler proc arg1 event-type event)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (('outro-done) + (set! (-> self trans quad) (-> *camera-combiner* trans quad)) + (cam-circular-position #f) + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -1162,13 +1124,11 @@ ) ) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f @@ -1178,34 +1138,27 @@ (suspend) ) #f - (none) ) ) (defstate cam-lookat (camera-slave) - :event (the-as - (function process int symbol event-message-block object :behavior camera-slave) - cam-standard-event-handler - ) + :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f (suspend) ) #f - (none) ) ) @@ -2946,120 +2899,115 @@ ) (defstate cam-string (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (let ((v1-0 event-type)) - (the-as - object - (cond - ((= v1-0 'get-behind) - (set! (-> self butt-timer) (the-as uint (+ (current-time) (seconds 0.25)))) - (set! (-> self butt-seek) (the-as basic #t)) - (set! v0-0 (-> self butt-vector)) - (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> event param 0)) quad)) - v0-0 - ) - ((= v1-0 'teleport) - (let ((gp-0 (new-stack-vector0))) - (cam-string-find-position-rel! gp-0) - (cam-string-set-position-rel! gp-0) - ) - ) - ((= v1-0 'joystick) - (set! (-> self phony-joystick-x) (the-as float (-> event param 0))) - (set! (-> self phony-joystick-y) (the-as float (-> event param 1))) - (set! v0-0 #t) - (set! (-> self have-phony-joystick) (the-as basic v0-0)) - v0-0 - ) - ((= v1-0 'tween-dist) - (cond - ((-> event param 0) - (set! (-> self string-val-locked) (the-as basic #t)) - (let ((s5-0 (the-as object (-> event param 0))) - (gp-1 (the-as object (-> event param 1))) - ) - (if (!= (-> (the-as vector s5-0) y) 4095996000.0) - (seek! - (-> self string-min-val y) - (-> (the-as vector s5-0) y) - (* (-> (the-as vector s5-0) w) (seconds-per-frame)) - ) - ) - (if (!= (-> (the-as vector s5-0) z) 4095996000.0) - (seek! - (-> self string-min-val z) - (-> (the-as vector s5-0) z) - (* (-> (the-as vector s5-0) w) (seconds-per-frame)) - ) - ) - (if (!= (-> (the-as vector gp-1) y) 4095996000.0) - (seek! - (-> self string-max-val y) - (-> (the-as vector gp-1) y) - (* (-> (the-as vector gp-1) w) (seconds-per-frame)) - ) - ) - (if (!= (-> (the-as vector gp-1) z) 4095996000.0) - (seek! - (-> self string-max-val z) - (-> (the-as vector gp-1) z) - (* (-> (the-as vector gp-1) w) (seconds-per-frame)) - ) - ) + (case message + (('get-behind) + (set! (-> self butt-timer) (the-as uint (+ (current-time) (seconds 0.25)))) + (set! (-> self butt-seek) (the-as basic #t)) + (set! v0-0 (-> self butt-vector)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> block param 0)) quad)) + v0-0 + ) + (('teleport) + (let ((gp-0 (new-stack-vector0))) + (cam-string-find-position-rel! gp-0) + (cam-string-set-position-rel! gp-0) + ) + ) + (('joystick) + (set! (-> self phony-joystick-x) (the-as float (-> block param 0))) + (set! (-> self phony-joystick-y) (the-as float (-> block param 1))) + (set! v0-0 #t) + (set! (-> self have-phony-joystick) (the-as basic v0-0)) + v0-0 + ) + (('tween-dist) + (cond + ((-> block param 0) + (set! (-> self string-val-locked) (the-as basic #t)) + (let ((s5-0 (the-as object (-> block param 0))) + (gp-1 (the-as object (-> block param 1))) ) - (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) - (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) - (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) - ) - (else - (set! (-> self string-val-locked) #f) - #f - ) - ) - ) - ((= v1-0 'set-dist) - (cond - ((-> event param 0) - (set! (-> self string-val-locked) (the-as basic #t)) - (set! (-> self string-min-val quad) (-> (the-as vector (-> event param 0)) quad)) - (set! (-> self string-max-val quad) (-> (the-as vector (-> event param 1)) quad)) - (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) - (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) - (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) - ) - (else - (set! (-> self string-val-locked) #f) - #f - ) - ) - ) - ((= v1-0 'relative-position) - (cond - ((-> event param 0) - (set! (-> self string-val-locked) (the-as basic #t)) - (set! (-> self string-relative) (the-as basic #t)) - (set! v0-0 (-> self relative-position)) - (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> event param 0)) quad)) - v0-0 - ) - (else - (set! (-> self string-val-locked) #f) - (set! (-> self string-relative) #f) - #f - ) - ) - ) - ((= v1-0 'set-max-angle-offset) - (set! (-> self max-angle-offset) (the-as float (-> event param 0))) + (if (!= (-> (the-as vector s5-0) y) 4095996000.0) + (seek! + (-> self string-min-val y) + (-> (the-as vector s5-0) y) + (* (-> (the-as vector s5-0) w) (seconds-per-frame)) + ) + ) + (if (!= (-> (the-as vector s5-0) z) 4095996000.0) + (seek! + (-> self string-min-val z) + (-> (the-as vector s5-0) z) + (* (-> (the-as vector s5-0) w) (seconds-per-frame)) + ) + ) + (if (!= (-> (the-as vector gp-1) y) 4095996000.0) + (seek! + (-> self string-max-val y) + (-> (the-as vector gp-1) y) + (* (-> (the-as vector gp-1) w) (seconds-per-frame)) + ) + ) + (if (!= (-> (the-as vector gp-1) z) 4095996000.0) + (seek! + (-> self string-max-val z) + (-> (the-as vector gp-1) z) + (* (-> (the-as vector gp-1) w) (seconds-per-frame)) + ) + ) + ) + (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) + (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) + (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) + ) + (else + (set! (-> self string-val-locked) #f) + #f ) - ((= v1-0 'blocked-side?) - (-> self los-state) + ) + ) + (('set-dist) + (cond + ((-> block param 0) + (set! (-> self string-val-locked) (the-as basic #t)) + (set! (-> self string-min-val quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self string-max-val quad) (-> (the-as vector (-> block param 1)) quad)) + (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) + (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) + (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) + ) + (else + (set! (-> self string-val-locked) #f) + #f ) - (else - (the-as object (cam-standard-event-handler proc arg1 event-type event)) - ) + ) + ) + (('relative-position) + (cond + ((-> block param 0) + (set! (-> self string-val-locked) (the-as basic #t)) + (set! (-> self string-relative) (the-as basic #t)) + (set! v0-0 (-> self relative-position)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> block param 0)) quad)) + v0-0 ) + (else + (set! (-> self string-val-locked) #f) + (set! (-> self string-relative) #f) + #f + ) + ) + ) + (('set-max-angle-offset) + (set! (-> self max-angle-offset) (the-as float (-> block param 0))) + ) + (('blocked-side?) + (-> self los-state) + ) + (else + (cam-standard-event-handler proc argc message block) ) ) ) @@ -3217,13 +3165,11 @@ (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f @@ -3236,7 +3182,6 @@ (suspend) ) #f - (none) ) ) @@ -3360,10 +3305,7 @@ ) (defstate cam-stick (camera-slave) - :event (the-as - (function process int symbol event-message-block object :behavior camera-slave) - cam-standard-event-handler - ) + :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self view-off-param) (-> *camera* view-off-param-save)) @@ -3386,7 +3328,6 @@ (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) (slave-set-rotation! (-> self tracking) (-> self trans) (-> self options) (-> self fov) #f) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) @@ -3443,7 +3384,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -3453,7 +3393,6 @@ (suspend) ) #f - (none) ) ) @@ -3587,10 +3526,7 @@ ) (defstate cam-bike (camera-slave) - :event (the-as - (function process int symbol event-message-block object :behavior camera-slave) - cam-standard-event-handler - ) + :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) (set-setting! 'head-offset 'abs (meters 4) 0) @@ -3610,18 +3546,15 @@ (cam-calc-bike-follow! (-> self tracking) (-> self trans) #f) (slave-set-rotation! (-> self tracking) (-> self trans) (-> self options) (-> self fov) #f) ) - (none) ) :exit (behavior () (remove-setting! 'head-offset) (remove-setting! 'foot-offset) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f @@ -3631,6 +3564,5 @@ (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/engine/camera/camera.gc b/goal_src/jak2/engine/camera/camera.gc index 85a071f9bfe..5891a7b9132 100644 --- a/goal_src/jak2/engine/camera/camera.gc +++ b/goal_src/jak2/engine/camera/camera.gc @@ -1039,7 +1039,6 @@ (slave-set-rotation! (-> self tracking) (-> self trans) (-> self options) (-> self fov) #f) ) ) - (none) ) (defbehavior cam-curve-pos camera-slave ((arg0 vector) (arg1 vector) (arg2 curve) (arg3 symbol)) @@ -1149,6 +1148,8 @@ ;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 144 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 144 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16 (defun cam-calc-follow! ((arg0 cam-rotation-tracker) (arg1 vector) (arg2 symbol)) (local-vars (sv-128 (function float float float float)) (sv-144 float) (sv-160 float)) (with-pp diff --git a/goal_src/jak2/engine/collide/pat-h.gc b/goal_src/jak2/engine/collide/pat-h.gc index a4179dd9c58..ade458e4806 100644 --- a/goal_src/jak2/engine/collide/pat-h.gc +++ b/goal_src/jak2/engine/collide/pat-h.gc @@ -94,171 +94,15 @@ ) (defun-debug pat-material->string ((arg0 pat-surface)) - (case (-> arg0 material) - (((pat-material deepsnow)) - "deepsnow" - ) - (((pat-material neutral)) - "neutral" - ) - (((pat-material carpet)) - "carpet" - ) - (((pat-material shmetal)) - "shmetal" - ) - (((pat-material grmetal)) - "grmetal" - ) - (((pat-material lava)) - "lava" - ) - (((pat-material crmetal)) - "crmetal" - ) - (((pat-material pcmetal)) - "pcmetal" - ) - (((pat-material grass)) - "grass" - ) - (((pat-material snow)) - "snow" - ) - (((pat-material swamp)) - "swamp" - ) - (((pat-material stone)) - "stone" - ) - (((pat-material hotcoals)) - "hotcoals" - ) - (((pat-material unknown)) - "unknown" - ) - (((pat-material dirt)) - "dirt" - ) - (((pat-material tube)) - "tube" - ) - (((pat-material stopproj)) - "stopproj" - ) - (((pat-material tar)) - "tar" - ) - (((pat-material straw)) - "straw" - ) - (((pat-material wood)) - "wood" - ) - (((pat-material quicksand)) - "quicksand" - ) - (((pat-material ice)) - "ice" - ) - (((pat-material rotate)) - "rotate" - ) - (((pat-material crwood)) - "crwood" - ) - (((pat-material waterbottom)) - "waterbottom" - ) - (((pat-material hdwood)) - "hdwood" - ) - (((pat-material sand)) - "sand" - ) - (((pat-material gravel)) - "gravel" - ) - (((pat-material metal)) - "metal" - ) - (else - "*unknown*" - ) - ) + (enum->string pat-material (-> arg0 material)) ) (defun-debug pat-mode->string ((arg0 pat-surface)) - (case (-> arg0 mode) - (((pat-mode wall)) - "wall" - ) - (((pat-mode halfpipe)) - "halfpipe" - ) - (((pat-mode obstacle)) - "obstacle" - ) - (((pat-mode ground)) - "ground" - ) - (else - "*unknown*" - ) - ) + (enum->string pat-mode (-> arg0 mode)) ) (defun-debug pat-event->string ((arg0 pat-surface)) - (case (-> arg0 event) - (((pat-event burn)) - "burn" - ) - (((pat-event deadly)) - "deadly" - ) - (((pat-event slippery)) - "slippery" - ) - (((pat-event melt)) - "melt" - ) - (((pat-event endlessfall)) - "endlessfall" - ) - (((pat-event burnup)) - "burnup" - ) - (((pat-event hide)) - "hide" - ) - (((pat-event deadlup)) - "deadlyup" - ) - (((pat-event shockup)) - "shockup" - ) - (((pat-event slide)) - "slide" - ) - (((pat-event lipramp)) - "lipramp" - ) - (((pat-event rail)) - "rail" - ) - (((pat-event none)) - "none" - ) - (((pat-event lip)) - "lip" - ) - (((pat-event shock)) - "shock" - ) - (else - "*unknown*" - ) - ) + (enum->string pat-event (-> arg0 event)) ) (deftype pat-mode-info (structure) diff --git a/goal_src/jak2/engine/common_objs/base-plat.gc b/goal_src/jak2/engine/common_objs/base-plat.gc index 6ce0a3d38d3..f8acfdccfd3 100644 --- a/goal_src/jak2/engine/common_objs/base-plat.gc +++ b/goal_src/jak2/engine/common_objs/base-plat.gc @@ -148,12 +148,11 @@ If we aren't bouncing however, TODO - CSHAPE" (defbehavior plat-event base-plat ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) "Handles platform related events. Presently all this does is: - if `event-type` is [['bonk]], then call [[base-plat:29]]" - (the-as object (case event-type - (('bonk) - (start-bouncing! self) - ) - ) - ) + (case event-type + (('bonk) + (start-bouncing! self) + ) + ) ) (deftype eco-door (process-drawable) @@ -193,23 +192,22 @@ If we aren't bouncing however, TODO - CSHAPE" and play the respective sound @unused - likely a leftover from Jak 1" - (the-as object (case event-type - (('trigger) - (set! (-> self locked) (not (-> self locked))) - (cond - ((-> self locked) - (if (and (-> self next-state) (= (-> self next-state name) 'door-closed)) - (sound-play "door-lock") - ) - ) - (else - (sound-play "door-unlock") - ) - ) - #t - ) - ) - ) + (case event-type + (('trigger) + (set! (-> self locked) (not (-> self locked))) + (cond + ((-> self locked) + (if (and (-> self next-state) (= (-> self next-state name) 'door-closed)) + (sound-play "door-lock") + ) + ) + (else + (sound-play "door-unlock") + ) + ) + #t + ) + ) ) eco-door-event-handler @@ -241,7 +239,6 @@ eco-door-event-handler (suspend) ) #f - (none) ) ) @@ -266,7 +263,6 @@ eco-door-event-handler (suspend) ) (go-virtual door-open) - (none) ) :post (the-as (function none :behavior eco-door) transform-post) ) @@ -306,7 +302,6 @@ eco-door-event-handler (suspend) ) #f - (none) ) ) @@ -335,7 +330,6 @@ eco-door-event-handler (sound-play "door-lock") ) (go-virtual door-closed) - (none) ) :post (the-as (function none :behavior eco-door) transform-post) ) diff --git a/goal_src/jak2/engine/common_objs/basebutton.gc b/goal_src/jak2/engine/common_objs/basebutton.gc index 5a701e6ca3f..10347e12d9c 100644 --- a/goal_src/jak2/engine/common_objs/basebutton.gc +++ b/goal_src/jak2/engine/common_objs/basebutton.gc @@ -84,49 +84,44 @@ (defstate up-idle (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (let ((attack (the-as attack-info (-> event param 1)))) - (case (-> attack mode) - (('flop 'spin 'punch 'eco-yellow 'eco-red 'eco-blue 'eco-dark) - (when (or (not (or (= (-> attack mode) 'spin) (= (-> attack mode) 'punch))) - (logtest? (-> self button-status) (button-status button-status-3)) - ) - (send-event! self (-> self event-going-down)) - (go-virtual going-down) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((attack (the-as attack-info (-> block param 1)))) + (case (-> attack mode) + (('flop 'spin 'punch 'eco-yellow 'eco-red 'eco-blue 'eco-dark) + (when (or (not (or (= (-> attack mode) 'spin) (= (-> attack mode) 'punch))) + (logtest? (-> self button-status) (button-status button-status-3)) + ) + (send-event! self (-> self event-going-down)) + (go-virtual going-down) ) - ) + ) ) ) - (('trigger) - (sound-play "silo-button") + ) + (('trigger) + (sound-play "silo-button") + (go-virtual going-down) + ) + (('touch) + (when (logtest? (-> self button-status) (button-status button-status-4)) + (send-event! self (-> self event-going-down)) (go-virtual going-down) ) - (('touch) - (when (logtest? (-> self button-status) (button-status button-status-4)) - (send-event! self (-> self event-going-down)) - (go-virtual going-down) - ) - ) - (('move-to) - (the-as object (move-to! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1)))) - ) - ) + ) + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) ) ) :enter (behavior () (press! self #f) - (none) ) :trans (behavior () (if (logtest? (-> self button-status) (button-status button-status-2)) (rider-trans) ) - (none) ) :code (the-as (function none :behavior basebutton) sleep-code) :post (behavior () @@ -136,28 +131,23 @@ (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (rider-post) ) - (none) ) ) (defstate going-down (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('untrigger) - (go-virtual going-up) - ) - (('move-to) - (the-as object (move-to! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1)))) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('untrigger) + (go-virtual going-up) + ) + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) ) ) :enter (behavior () (press! self #t) - (none) ) :trans (the-as (function none :behavior basebutton) rider-trans) :code (behavior () @@ -173,7 +163,6 @@ ) ) (go-virtual down-idle) - (none) ) :post (behavior () (when (logtest? (-> self button-status) (button-status button-status-2)) @@ -182,35 +171,29 @@ (quaternion-copy! (-> self root quat) (-> self move-to-quat)) ) (rider-post) - (none) ) ) (defstate down-idle (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('untrigger) - (go-virtual going-up) - ) - (('move-to) - (the-as object (move-to! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1)))) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('untrigger) + (go-virtual going-up) + ) + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) ) ) :enter (behavior () (press! self #t) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (logtest? (-> self button-status) (button-status button-status-2)) (rider-trans) ) - (none) ) :code (behavior () (cond @@ -226,7 +209,6 @@ (go-virtual going-up) ) ) - (none) ) :post (behavior () (when (logtest? (-> self button-status) (button-status button-status-2)) @@ -235,28 +217,23 @@ (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (rider-post) ) - (none) ) ) (defstate going-up (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('move-to) - (the-as object (move-to! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1)))) - ) - (('trigger) - (go-virtual going-down) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) + (('trigger) + (go-virtual going-down) + ) ) ) :enter (behavior () (press! self #f) - (none) ) :trans (the-as (function none :behavior basebutton) rider-trans) :code (behavior () @@ -267,7 +244,6 @@ ) (send-event! self (-> self event-up)) (go-virtual up-idle) - (none) ) :post (behavior () (when (logtest? (-> self button-status) (button-status button-status-2)) @@ -276,7 +252,6 @@ (quaternion-copy! (-> self root quat) (-> self move-to-quat)) ) (rider-post) - (none) ) ) diff --git a/goal_src/jak2/engine/common_objs/blocking-plane.gc b/goal_src/jak2/engine/common_objs/blocking-plane.gc index f2f4dd8f1be..c2d835a1518 100644 --- a/goal_src/jak2/engine/common_objs/blocking-plane.gc +++ b/goal_src/jak2/engine/common_objs/blocking-plane.gc @@ -29,60 +29,59 @@ (defstate idle (blocking-plane) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('on) - (cond - ((nonzero? (-> self root)) - (let ((prim (-> self root root-prim))) - (set! (-> prim prim-core collide-as) (-> self root backup-collide-as)) - (let ((v0-0 (the-as int (-> self root backup-collide-with)))) - (set! (-> prim prim-core collide-with) (the-as collide-spec v0-0)) - v0-0 - ) - ) - ) - (else - (let ((proc-child-ptr-0 (-> self child))) - (while proc-child-ptr-0 - (let ((proc-child-0 (ppointer->process proc-child-ptr-0))) - (set! proc-child-ptr-0 (-> proc-child-ptr-0 0 brother)) - (if (type? proc-child-0 blocking-plane) - (send-event proc-child-0 'on) - ) - ) - ) - ) - (the-as int #f) - ) - ) - ) - (('off) - (cond - ((nonzero? (-> self root)) - (let ((v1-13 (-> self root root-prim))) - (set! (-> v1-13 prim-core collide-as) (collide-spec)) - (set! (-> v1-13 prim-core collide-with) (collide-spec)) - ) - 0 - ) - (else - (let ((proc-child-ptr-1 (-> self child))) - (while proc-child-ptr-1 - (let ((proc-child-1 (ppointer->process proc-child-ptr-1))) - (set! proc-child-ptr-1 (-> proc-child-ptr-1 0 brother)) - (if (type? proc-child-1 blocking-plane) - (send-event proc-child-1 'off) - ) - ) - ) - ) - (the-as int #f) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('on) + (cond + ((nonzero? (-> self root)) + (let ((prim (-> self root root-prim))) + (set! (-> prim prim-core collide-as) (-> self root backup-collide-as)) + (let ((v0-0 (the-as int (-> self root backup-collide-with)))) + (set! (-> prim prim-core collide-with) (the-as collide-spec v0-0)) + v0-0 + ) + ) + ) + (else + (let ((proc-child-ptr-0 (-> self child))) + (while proc-child-ptr-0 + (let ((proc-child-0 (ppointer->process proc-child-ptr-0))) + (set! proc-child-ptr-0 (-> proc-child-ptr-0 0 brother)) + (if (type? proc-child-0 blocking-plane) + (send-event proc-child-0 'on) ) + ) + ) + ) + (the-as int #f) + ) + ) + ) + (('off) + (cond + ((nonzero? (-> self root)) + (let ((v1-13 (-> self root root-prim))) + (set! (-> v1-13 prim-core collide-as) (collide-spec)) + (set! (-> v1-13 prim-core collide-with) (collide-spec)) ) + 0 + ) + (else + (let ((proc-child-ptr-1 (-> self child))) + (while proc-child-ptr-1 + (let ((proc-child-1 (ppointer->process proc-child-ptr-1))) + (set! proc-child-ptr-1 (-> proc-child-ptr-1 0 brother)) + (if (type? proc-child-1 blocking-plane) + (send-event proc-child-1 'off) + ) + ) + ) + ) + (the-as int #f) + ) + ) + ) + ) ) :code (the-as (function none :behavior blocking-plane) sleep-code) ) diff --git a/goal_src/jak2/engine/common_objs/collectables.gc b/goal_src/jak2/engine/common_objs/collectables.gc index 04a2b8414a2..cad06e53f59 100644 --- a/goal_src/jak2/engine/common_objs/collectables.gc +++ b/goal_src/jak2/engine/common_objs/collectables.gc @@ -652,18 +652,8 @@ #f ) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 108] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 144] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 179] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 191] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 213] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 256] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 271] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 288] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 309] (defbehavior collectable-standard-event-handler collectable ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (local-vars (v0-4 none)) + (local-vars (v0-4 object)) (when (and (or (= arg2 'touch) (= arg2 'attack)) (and (logtest? (-> self flags) (collectable-flag pickup)) (>= (- (current-time) (the-as int (-> self birth-time))) (the-as time-frame (-> self collect-timeout))) @@ -675,137 +665,136 @@ (process-contact-action arg0) (go-virtual pickup #f (process->handle arg0)) ) - (the-as object (cond - ((= arg2 'trans) - (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (update-transforms (-> self root)) - (ja-post) - ) - ((= arg2 'jump) - (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self jump-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (go-virtual jump) - ) - ((= arg2 'pickup) - (when (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) - (if (and (> arg1 0) (-> arg3 param 0)) - (move-to-point! (-> self root) (the-as vector (-> arg3 param 0))) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (process-contact-action arg0) - (go-virtual pickup #f (the-as handle #f)) - ) - ) - ((= arg2 'suck) - (when (not (and (-> self next-state) (let ((v1-60 (-> self next-state name))) - (or (= v1-60 'suck) (= v1-60 'pickup)) - ) - ) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual suck (process->handle (the-as process (-> arg3 param 0)))) - ) - ) - ((= arg2 'die) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual die) - ) - ((= arg2 'movie-pos) - (set! v0-4 (the-as none (-> arg3 param 0))) - (set! (-> self movie-pos-index) (the-as int v0-4)) - v0-4 - ) - ((= arg2 'actor-pause) - (cond - ((-> arg3 param 0) - (logior! (-> self mask) (process-mask actor-pause)) - (set! v0-4 (the-as none #t)) - (set! (-> self actor-pause) (the-as symbol v0-4)) - v0-4 - ) - (else - (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self actor-pause) #f) - #f - ) - ) - ) - ((= arg2 'fade) - (logior! (-> self flags) (collectable-flag fadeout)) - (set! (-> self fadeout-timeout) (the-as seconds 30)) - (set! v0-4 (the-as none (current-time))) - (set! (-> self birth-time) (the-as time-frame v0-4)) - v0-4 - ) - ((= arg2 'anim) - (cond - ((-> arg3 param 0) - (set! v0-4 (the-as none (logclear (-> self flags) (collectable-flag no-bob)))) - (set! (-> self flags) (the-as collectable-flag v0-4)) - ) - (else - (set! v0-4 (the-as none (logior (-> self flags) (collectable-flag no-bob)))) - (set! (-> self flags) (the-as collectable-flag v0-4)) - ) - ) - v0-4 - ) - ((= arg2 'collide-shape) - (cond - ((-> arg3 param 0) - (let ((v1-97 (-> self root root-prim))) - (set! (-> v1-97 prim-core collide-as) (-> self root backup-collide-as)) - (set! v0-4 (the-as none (-> self root backup-collide-with))) - (set! (-> v1-97 prim-core collide-with) (the-as collide-spec v0-4)) - ) - v0-4 - ) - (else - (let ((v1-99 (-> self root root-prim))) - (set! (-> v1-99 prim-core collide-as) (collide-spec)) - (set! (-> v1-99 prim-core collide-with) (collide-spec)) - ) - 0 - ) - ) - ) - ((= arg2 'get-notify) - (cond - ((= (-> arg3 param 0) #t) - (let ((v1-103 (ppointer->process (-> self parent)))) - (cond - ((logtest? (-> v1-103 mask) (process-mask process-tree)) - (set! (-> self notify) (the-as handle #f)) - #f - ) - (else - (set! v0-4 (the-as none (process->handle v1-103))) - (set! (-> self notify) (the-as handle v0-4)) - v0-4 - ) - ) - ) - ) - ((= (-> arg3 param 0) #f) - (set! (-> self notify) (the-as handle #f)) - #f - ) - (else - (set! v0-4 (the-as none (process->handle (the-as process (-> arg3 param 0))))) - (set! (-> self notify) (the-as handle v0-4)) - v0-4 - ) - ) - ) - ((= arg2 'effect) - (when (not (-> arg3 param 0)) - (set! (-> self collect-effect) (the-as basic 0)) - (set! (-> self collect-effect2) (the-as basic 0)) - 0 - ) - ) - ) + (cond + ((= arg2 'trans) + (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (update-transforms (-> self root)) + (ja-post) + ) + ((= arg2 'jump) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self jump-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (go-virtual jump) + ) + ((= arg2 'pickup) + (when (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (if (and (> arg1 0) (-> arg3 param 0)) + (move-to-point! (-> self root) (the-as vector (-> arg3 param 0))) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-contact-action arg0) + (go-virtual pickup #f (the-as handle #f)) + ) + ) + ((= arg2 'suck) + (when (not (and (-> self next-state) (let ((v1-60 (-> self next-state name))) + (or (= v1-60 'suck) (= v1-60 'pickup)) + ) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual suck (process->handle (the-as process (-> arg3 param 0)))) + ) + ) + ((= arg2 'die) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual die) + ) + ((= arg2 'movie-pos) + (set! v0-4 (-> arg3 param 0)) + (set! (-> self movie-pos-index) (the-as int v0-4)) + v0-4 + ) + ((= arg2 'actor-pause) + (cond + ((-> arg3 param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (set! v0-4 #t) + (set! (-> self actor-pause) (the-as symbol v0-4)) + v0-4 + ) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + #f + ) + ) + ) + ((= arg2 'fade) + (logior! (-> self flags) (collectable-flag fadeout)) + (set! (-> self fadeout-timeout) (the-as seconds 30)) + (set! v0-4 (current-time)) + (set! (-> self birth-time) (the-as time-frame v0-4)) + v0-4 + ) + ((= arg2 'anim) + (cond + ((-> arg3 param 0) + (set! v0-4 (logclear (-> self flags) (collectable-flag no-bob))) + (set! (-> self flags) (the-as collectable-flag v0-4)) + ) + (else + (set! v0-4 (logior (-> self flags) (collectable-flag no-bob))) + (set! (-> self flags) (the-as collectable-flag v0-4)) + ) + ) + v0-4 + ) + ((= arg2 'collide-shape) + (cond + ((-> arg3 param 0) + (let ((v1-97 (-> self root root-prim))) + (set! (-> v1-97 prim-core collide-as) (-> self root backup-collide-as)) + (set! v0-4 (-> self root backup-collide-with)) + (set! (-> v1-97 prim-core collide-with) (the-as collide-spec v0-4)) + ) + v0-4 + ) + (else + (let ((v1-99 (-> self root root-prim))) + (set! (-> v1-99 prim-core collide-as) (collide-spec)) + (set! (-> v1-99 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + ) + ((= arg2 'get-notify) + (cond + ((= (-> arg3 param 0) #t) + (let ((v1-103 (ppointer->process (-> self parent)))) + (cond + ((logtest? (-> v1-103 mask) (process-mask process-tree)) + (set! (-> self notify) (the-as handle #f)) + #f + ) + (else + (set! v0-4 (process->handle v1-103)) + (set! (-> self notify) (the-as handle v0-4)) + v0-4 + ) + ) ) + ) + ((= (-> arg3 param 0) #f) + (set! (-> self notify) (the-as handle #f)) + #f + ) + (else + (set! v0-4 (process->handle (the-as process (-> arg3 param 0)))) + (set! (-> self notify) (the-as handle v0-4)) + v0-4 + ) + ) + ) + ((= arg2 'effect) + (when (not (-> arg3 param 0)) + (set! (-> self collect-effect) (the-as basic 0)) + (set! (-> self collect-effect2) (the-as basic 0)) + 0 + ) + ) + ) ) (defstate blocked (collectable) @@ -814,7 +803,6 @@ (if (task-complete? *game-info* (-> self entity extra perm task)) (go-virtual wait) ) - (none) ) :code (the-as (function none :behavior collectable) sleep-code) ) @@ -849,7 +837,6 @@ (logior! (-> self mask) (process-mask actor-pause)) ) (go-virtual wait) - (none) ) ) @@ -873,7 +860,6 @@ ) (go-virtual suck (process->handle *target*)) ) - (none) ) :exit (behavior () (vector-reset! (-> self root transv)) @@ -886,7 +872,6 @@ (logclear! (-> self root root-prim prim-core action) (collide-action solid)) (set! (-> self root root-prim prim-core collide-with) (collide-spec jak player-list tobot)) (set! (-> self root root-prim prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) - (none) ) :trans (behavior () (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) @@ -914,7 +899,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -922,7 +906,6 @@ (suspend) ) #f - (none) ) ) @@ -941,7 +924,6 @@ (set! (-> self suck-y-offset) 0.0) (logclear! (-> self mask) (process-mask actor-pause)) (logior! (-> self flags) (collectable-flag pickup suck-in)) - (none) ) :code (behavior ((arg0 handle)) (until #f @@ -952,14 +934,13 @@ (suspend) ) #f - (none) ) ) (defstate wait (collectable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('eco-blue) (when (and (not (logtest? (-> self flags) (collectable-flag do-fadeout no-eco-blue))) (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) @@ -975,7 +956,7 @@ ) ) (else - (collectable-standard-event-handler proc arg1 event-type event) + (collectable-standard-event-handler proc argc message block) ) ) ) @@ -988,7 +969,6 @@ (process-contact-action *target*) (go-virtual pickup #f (process->handle *target*)) ) - (none) ) :code (behavior () (until #f @@ -1012,7 +992,6 @@ (suspend) ) #f - (none) ) ) @@ -1049,14 +1028,13 @@ ) ) #f - (none) ) ) (defstate notice-blue (collectable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (when (and (or (= event-type 'touch) (= event-type 'attack)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flag pickup)) (>= (- (current-time) (the-as int (-> self birth-time))) (the-as time-frame (-> self collect-timeout))) (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) @@ -1077,13 +1055,11 @@ ) (set! (-> self suck-y-offset) 0.0) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) - (none) ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -1096,7 +1072,6 @@ (go-virtual wait) ) ) - (none) ) :code (behavior ((arg0 handle)) (until #f @@ -1107,63 +1082,59 @@ (suspend) ) #f - (none) ) ) (defstate pickup (collectable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('set-movie-pos) - (let ((v1-2 (res-lump-struct (-> self entity) 'movie-pos structure))) - (when v1-2 - (set! (-> (the-as vector v1-2) quad) (-> (the-as vector (-> event param 0)) quad)) - v1-2 - ) - ) - ) - (('actor-pause) - (cond - ((-> event param 0) - (logior! (-> self mask) (process-mask actor-pause)) - (let ((v0-1 (the-as object #t))) - (set! (-> self actor-pause) (the-as symbol v0-1)) - v0-1 - ) - ) - (else - (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self actor-pause) #f) - #f - ) - ) - ) - (('fade) - (process-entity-status! self (entity-perm-status dead) #t) - (send-event (handle->process (-> self notify)) 'notify 'die) - (the-as object (deactivate self)) - ) - (('effect) - (when (not (-> event param 0)) - (set! (-> self collect-effect) (the-as basic 0)) - (set! (-> self collect-effect2) (the-as basic 0)) - 0 - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('set-movie-pos) + (let ((v1-2 (res-lump-struct (-> self entity) 'movie-pos structure))) + (when v1-2 + (set! (-> (the-as vector v1-2) quad) (-> (the-as vector (-> block param 0)) quad)) + v1-2 + ) + ) + ) + (('actor-pause) + (cond + ((-> block param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (let ((v0-1 (the-as object #t))) + (set! (-> self actor-pause) (the-as symbol v0-1)) + v0-1 ) + ) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + #f + ) + ) + ) + (('fade) + (process-entity-status! self (entity-perm-status dead) #t) + (send-event (handle->process (-> self notify)) 'notify 'die) + (deactivate self) + ) + (('effect) + (when (not (-> block param 0)) + (set! (-> self collect-effect) (the-as basic 0)) + (set! (-> self collect-effect2) (the-as basic 0)) + 0 + ) + ) + ) ) :enter (behavior ((arg0 symbol) (arg1 handle)) (do-pickup self arg1) - (none) ) :code (behavior ((arg0 symbol) (arg1 handle)) (while (-> self child) (suspend) ) (go-virtual die) - (none) ) ) @@ -1171,7 +1142,6 @@ :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) @@ -1198,25 +1168,23 @@ (defstate die (eco) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('fade) - (process-entity-status! self (entity-perm-status dead) #t) - (send-event (handle->process (-> self notify)) 'notify 'die) - (the-as object (deactivate self)) - ) - (('die) - (go-virtual die) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fade) + (process-entity-status! self (entity-perm-status dead) #t) + (send-event (handle->process (-> self notify)) 'notify 'die) + (deactivate self) + ) + (('die) + (go-virtual die) + ) + ) ) :exit (behavior () (process-entity-status! self (entity-perm-status no-kill) #f) (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) - (none) ) :code (behavior () (process-entity-status! self (entity-perm-status no-kill) #t) @@ -1252,7 +1220,6 @@ (logclear! (-> self draw status) (draw-control-status no-draw)) ) (go-virtual wait) - (none) ) ) @@ -1267,7 +1234,6 @@ ((the-as (function none) t9-2)) ) ) - (none) ) ) @@ -1401,7 +1367,6 @@ This commonly includes things such as: ) (send-event self 'suck *target*) ) - (none) ) ) @@ -1550,7 +1515,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -1558,7 +1522,6 @@ This commonly includes things such as: :virtual #t :code (behavior ((arg0 symbol) (arg1 handle)) (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) @@ -1749,7 +1712,6 @@ This commonly includes things such as: (logior! (-> self root root-prim prim-core action) (collide-action solid)) (set! (-> self root reaction) projectile-bounce-reaction) (set! (-> self root penetrated-by) (the-as penetrate -1)) - (none) ) :exit (behavior () (set! (-> self roty-speed) (fmin 262144.0 (-> self roty-speed))) @@ -1761,7 +1723,6 @@ This commonly includes things such as: (t9-2) ) ) - (none) ) :trans (the-as (function none :behavior gem) #f) :code (the-as (function none :behavior gem) sleep-code) @@ -1851,7 +1812,6 @@ This commonly includes things such as: ) (seek! (-> self roty-speed) 0.0 (* 16384.0 (seconds-per-frame))) (common-post self) - (none) ) ) @@ -1947,7 +1907,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -2278,7 +2237,6 @@ This commonly includes things such as: :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) diff --git a/goal_src/jak2/engine/common_objs/conveyor.gc b/goal_src/jak2/engine/common_objs/conveyor.gc index 944647e837c..e52249236d2 100644 --- a/goal_src/jak2/engine/common_objs/conveyor.gc +++ b/goal_src/jak2/engine/common_objs/conveyor.gc @@ -375,7 +375,6 @@ and return it as well. Otherwise, set it to `0`" (if (nonzero? (-> self sound)) (update! (-> self sound)) ) - (none) ) ) @@ -466,7 +465,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type conveyor idle) post))) @@ -475,6 +473,5 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) diff --git a/goal_src/jak2/engine/common_objs/crates.gc b/goal_src/jak2/engine/common_objs/crates.gc index 2bea8d284aa..e06b2188ca4 100644 --- a/goal_src/jak2/engine/common_objs/crates.gc +++ b/goal_src/jak2/engine/common_objs/crates.gc @@ -615,7 +615,6 @@ (set! (-> v1-29 prim-core collide-with) (-> (the-as collide-shape-moving (-> self root)) backup-collide-with)) ) (go-virtual idle) - (none) ) ) @@ -631,20 +630,19 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior crate) ja-post) ) (defstate carry (crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('carry? 'carry-info) (-> self carry) ) (('drop) - (set! (-> self root transv quad) (-> (the-as vector (-> event param 1)) quad)) + (set! (-> self root transv quad) (-> (the-as vector (-> block param 1)) quad)) (go-virtual fall) ) ) @@ -655,22 +653,20 @@ (carry-info-method-9 (-> self carry)) (carry-info-method-13 (-> self carry)) (update-transforms (the-as collide-shape-moving (-> self root))) - (none) ) ) (defstate fall (crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('carry-info) - (-> self carry) - ) - (('carry? 'pickup) - (the-as carry-info #f) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('carry-info) + (-> self carry) + ) + (('carry? 'pickup) + (the-as carry-info #f) + ) + ) ) :enter (behavior () (if (handle->process (-> self carry other)) @@ -685,7 +681,6 @@ (-> self root root-prim prim-core collide-with) (collide-spec backgnd crate obstacle hit-by-others-list pusher) ) - (none) ) :trans (behavior () (when (and (logtest? (-> (the-as collide-shape-moving (-> self root)) status) (collide-status on-surface)) @@ -704,7 +699,6 @@ (go-virtual idle) ) ) - (none) ) :code (the-as (function none :behavior crate) sleep-code) :post (behavior () @@ -728,7 +722,6 @@ (set! (-> gp-1 root-prim type) collide-shape-prim-mesh) ) (crate-post) - (none) ) ) @@ -740,7 +733,6 @@ (suspend) ) (go-virtual idle) - (none) ) :post crate-post ) @@ -760,7 +752,6 @@ (logclear! (-> self mask) (process-mask sleep-code)) ) ) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self target) arg0) @@ -820,19 +811,18 @@ (suspend) ) #f - (none) ) :post crate-post ) (defstate die (crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (case (-> self defense) (('darkeco) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (new-attack-id)) (mode 'darkeco)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (new-attack-id)) (mode 'darkeco)))) ) ) ) @@ -1024,39 +1014,37 @@ ) (go-virtual hide) ) - (none) ) ) (defstate special-contents-die (crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (case (-> event param 0) - (('pickup) - (let ((gp-0 (-> self entity extra perm))) - (logior! (-> gp-0 status) (entity-perm-status bit-5)) - (set! (-> gp-0 user-int8 1) (min 127 (+ (-> gp-0 user-int8 1) 1))) - (+! (-> self child-count) -1) - (when (<= (-> self child-count) 0) - (if (or (= (-> self defense) 'iron) (= (-> self defense) 'steel)) - (process-entity-status! self (entity-perm-status bit-4) #f) - ) - (process-entity-status! self (entity-perm-status dead) #t) - (process-entity-status! self (entity-perm-status subtask-complete) #t) - (set! (-> gp-0 user-int8 0) 2) - (let ((v0-0 (logclear (-> self mask) (process-mask sleep)))) - (set! (-> self mask) v0-0) - v0-0 - ) - ) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (let ((gp-0 (-> self entity extra perm))) + (logior! (-> gp-0 status) (entity-perm-status bit-5)) + (set! (-> gp-0 user-int8 1) (min 127 (+ (-> gp-0 user-int8 1) 1))) + (+! (-> self child-count) -1) + (when (<= (-> self child-count) 0) + (if (or (= (-> self defense) 'iron) (= (-> self defense) 'steel)) + (process-entity-status! self (entity-perm-status bit-4) #f) + ) + (process-entity-status! self (entity-perm-status dead) #t) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (set! (-> gp-0 user-int8 0) 2) + (let ((v0-0 (logclear (-> self mask) (process-mask sleep)))) + (set! (-> self mask) v0-0) + v0-0 + ) + ) ) + ) + ) + ) + ) ) :trans (-> (method-of-type crate die) trans) :code (behavior () @@ -1101,7 +1089,6 @@ (suspend) ) ) - (none) ) ) @@ -1400,6 +1387,5 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/engine/common_objs/dark-eco-pool.gc b/goal_src/jak2/engine/common_objs/dark-eco-pool.gc index 2fddcbe6c5a..7c450b21130 100644 --- a/goal_src/jak2/engine/common_objs/dark-eco-pool.gc +++ b/goal_src/jak2/engine/common_objs/dark-eco-pool.gc @@ -307,6 +307,5 @@ (set! (-> gp-0 global-scale) (* 4096.0 (* 3.0 (+ 1.0 f0-9)))) (set! (-> gp-0 individual-normal-scale) (+ 0.5 (* 0.5 f0-9))) ) - (none) ) ) diff --git a/goal_src/jak2/engine/common_objs/elevator.gc b/goal_src/jak2/engine/common_objs/elevator.gc index dabcc9c4f1a..670c5720f32 100644 --- a/goal_src/jak2/engine/common_objs/elevator.gc +++ b/goal_src/jak2/engine/common_objs/elevator.gc @@ -264,160 +264,139 @@ which is obviously useful for an elevator." ) ) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 18] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 119] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 209] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 222] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 236] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 246] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 257] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 264] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 276] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 301] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 326] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 334] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 337] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 174] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 40] ;; WARN: disable def twice: 11. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defbehavior elevator-event elevator ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((evt-type event-type)) - (the-as - object - (cond - ((= evt-type 'status?) - (and (= (the float (/ (the-as int (-> event param 0)) 8)) (-> self move-pos 0)) - (= (the float (/ (the-as int (-> event param 1)) 8)) (-> self move-pos 1)) - ) - ) - ((= evt-type 'ridden) - (let ((proc-focus (handle->process (-> (the-as focus (-> event param 0)) handle)))) - (if (= (-> proc-focus type) target) - (set! (-> self sticky-player-last-ride-time) (current-time)) - ) + (case event-type + (('status?) + (and (= (the float (/ (the-as int (-> event param 0)) 8)) (-> self move-pos 0)) + (= (the float (/ (the-as int (-> event param 1)) 8)) (-> self move-pos 1)) + ) + ) + (('ridden) + (let ((proc-focus (handle->process (-> (the-as focus (-> event param 0)) handle)))) + (if (= (-> proc-focus type) target) + (set! (-> self sticky-player-last-ride-time) (current-time)) ) - #t - ) - ((= evt-type 'use-camera) - (if (-> event param 0) - (set-setting! 'entity-name (-> event param 0) 0.0 0) - (remove-setting! 'entity-name) - ) + ) + #t + ) + (('use-camera) + (if (-> event param 0) + (set-setting! 'entity-name (-> event param 0) 0.0 0) + (remove-setting! 'entity-name) ) - ((= evt-type 'move-to) - (when (and (-> self next-state) (let ((next-state-0 (-> self next-state name))) - (or (= next-state-0 'waiting) (= next-state-0 'arrived)) - ) - ) - (set! (-> self move-pos 0) (-> self move-pos 1)) - (cond - ((not (logtest? (-> event param 0) 7)) - (let ((gp-0 (the-as number (-> event param 0)))) - (set! (-> self move-pos 1) (if (type? (the-as uint gp-0) float) - (the-as float gp-0) - ) - ) + ) + (('move-to) + (when (and (-> self next-state) (let ((next-state-0 (-> self next-state name))) + (or (= next-state-0 'waiting) (= next-state-0 'arrived)) + ) ) - ) - (else - (case (-> event param 0) - (('quote 'bottom) - (set! (-> self move-pos 1) (-> self bottom-top 0)) - ) - (('quote 'top) - (set! (-> self move-pos 1) (-> self bottom-top 1)) + (set! (-> self move-pos 0) (-> self move-pos 1)) + (cond + ((not (logtest? (-> event param 0) 7)) + (let ((gp-0 (the-as number (-> event param 0)))) + (set! (-> self move-pos 1) (if (type? (the-as uint gp-0) float) + (the-as float gp-0) + ) ) - ) - ) - ) - (go-virtual running) - ) - ) - ((= evt-type 'jump-to) - (cond - ((not (logtest? (-> event param 0) 7)) - (let ((gp-1 (the-as number (-> event param 0)))) - (set! (-> self move-pos 1) (if (type? (the-as uint gp-1) float) - (the-as float gp-1) - ) - ) - ) ) - (else - (case (-> event param 0) - (('quote 'bottom) - (set! (-> self move-pos 1) (-> self bottom-top 0)) - ) - (('quote 'top) - (set! (-> self move-pos 1) (-> self bottom-top 1)) - ) - ) - ) - ) - (set! (-> self move-pos 0) (-> self move-pos 1)) - (get-point-in-path! (-> self path) (-> self basetrans) (-> self move-pos 0) 'interp) - (go-virtual waiting) - ) - ((= evt-type 'trigger) - (when (and (-> self next-state) (let ((next-state-1 (-> self next-state name))) - (or (= next-state-1 'waiting) (= next-state-1 'arrived)) - ) - ) - (set! (-> self move-pos 0) (-> self move-pos 1)) - (cond - ((= (-> self move-pos 0) (-> self bottom-top 0)) - (set! (-> self move-pos 1) (-> self bottom-top 1)) - ) - ((= (-> self move-pos 0) (-> self bottom-top 1)) + ) + (else + (case (-> event param 0) + (('quote 'bottom) (set! (-> self move-pos 1) (-> self bottom-top 0)) ) + (('quote 'top) + (set! (-> self move-pos 1) (-> self bottom-top 1)) + ) ) - (go-virtual running) ) ) - ((= evt-type 'query) + (go-virtual running) + ) + ) + (('jump-to) + (cond + ((not (logtest? (-> event param 0) 7)) + (let ((gp-1 (the-as number (-> event param 0)))) + (set! (-> self move-pos 1) (if (type? (the-as uint gp-1) float) + (the-as float gp-1) + ) + ) + ) + ) + (else (case (-> event param 0) - (('waiting?) - (and (-> self next-state) (= (-> self next-state name) 'waiting)) - ) - (('arrived?) - (and (-> self next-state) (let ((v1-61 (-> self next-state name))) - (or (= v1-61 'arrived) (= v1-61 'waiting)) - ) - ) + (('quote 'bottom) + (set! (-> self move-pos 1) (-> self bottom-top 0)) ) - (('running?) - (and (-> self next-state) (= (-> self next-state name) 'running)) - ) - (('path-pos?) - (+ (-> self move-pos 0) (* (-> self path-pos) (- (-> self move-pos 1) (-> self move-pos 0)))) - ) - (('player-standing-on?) - (= (-> self sticky-player-last-ride-time) (current-time)) - ) - (('point-inside-shaft?) - (move-between-points self (the-as vector (-> event param 1)) (-> self bottom-top 1) (-> self bottom-top 0)) - ) - (('going-down?) - (< (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 1) 'interp) y) - (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 0) 'interp) y) - ) - ) - (('going-up?) - (< (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 0) 'interp) y) - (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 1) 'interp) y) - ) + (('quote 'top) + (set! (-> self move-pos 1) (-> self bottom-top 1)) ) ) ) - ((= evt-type 'go-dormant) - (go-virtual dormant) - ) - (else - (plat-event proc arg1 event-type event) + ) + (set! (-> self move-pos 0) (-> self move-pos 1)) + (get-point-in-path! (-> self path) (-> self basetrans) (-> self move-pos 0) 'interp) + (go-virtual waiting) + ) + (('trigger) + (when (and (-> self next-state) (let ((next-state-1 (-> self next-state name))) + (or (= next-state-1 'waiting) (= next-state-1 'arrived)) + ) + ) + (set! (-> self move-pos 0) (-> self move-pos 1)) + (cond + ((= (-> self move-pos 0) (-> self bottom-top 0)) + (set! (-> self move-pos 1) (-> self bottom-top 1)) ) + ((= (-> self move-pos 0) (-> self bottom-top 1)) + (set! (-> self move-pos 1) (-> self bottom-top 0)) + ) + ) + (go-virtual running) + ) + ) + (('query) + (case (-> event param 0) + (('waiting?) + (and (-> self next-state) (= (-> self next-state name) 'waiting)) + ) + (('arrived?) + (and (-> self next-state) (let ((v1-61 (-> self next-state name))) + (or (= v1-61 'arrived) (= v1-61 'waiting)) + ) + ) + ) + (('running?) + (and (-> self next-state) (= (-> self next-state name) 'running)) ) + (('path-pos?) + (+ (-> self move-pos 0) (* (-> self path-pos) (- (-> self move-pos 1) (-> self move-pos 0)))) + ) + (('player-standing-on?) + (= (-> self sticky-player-last-ride-time) (current-time)) + ) + (('point-inside-shaft?) + (move-between-points self (the-as vector (-> event param 1)) (-> self bottom-top 1) (-> self bottom-top 0)) + ) + (('going-down?) + (< (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 1) 'interp) y) + (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 0) 'interp) y) + ) + ) + (('going-up?) + (< (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 0) 'interp) y) + (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 1) 'interp) y) + ) + ) + ) + ) + (('go-dormant) + (go-virtual dormant) + ) + (else + (plat-event proc arg1 event-type event) ) ) ) @@ -524,8 +503,8 @@ do so. (defstate dormant (elevator) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual waiting) ) @@ -533,7 +512,7 @@ do so. #f ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -544,16 +523,16 @@ do so. (defstate waiting (elevator) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (if (commited-to-ride? self) (logior! (-> self elevator-status) (elevator-status waiting-to-descend)) ) - (elevator-event proc arg1 event-type event) + (elevator-event proc argc message block) ) (else - (elevator-event proc arg1 event-type event) + (elevator-event proc argc message block) ) ) ) @@ -564,7 +543,6 @@ do so. (if (nonzero? (-> self sound)) (update-vol! (-> self sound) 0.0) ) - (none) ) :trans (behavior () (plat-trans) @@ -584,21 +562,19 @@ do so. (set! (-> self move-pos 1) (-> self path-seq data (the int (-> self move-pos 1)) next-pos)) (go-virtual running) ) - (none) ) :code (the-as (function none :behavior elevator) sleep-code) :post (behavior () (logclear! (-> self elevator-status) (elevator-status waiting-to-descend)) (debug-draw (-> self path)) (plat-post) - (none) ) ) (defstate running (elevator) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('running?) #t ) @@ -606,7 +582,7 @@ do so. (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) ) (else - (elevator-event proc arg1 event-type event) + (elevator-event proc argc message block) ) ) ) @@ -646,7 +622,6 @@ do so. (set-setting! 'jump #f 0.0 0) (apply-settings *setting-control*) ) - (none) ) :exit (behavior () (if (not (logtest? (-> self params flags) (elevator-flags elevator-flags-7))) @@ -656,7 +631,6 @@ do so. (if (logtest? (-> self params flags) (elevator-flags prevent-jump)) (remove-setting! 'jump) ) - (none) ) :trans (behavior () (if (and (not (logtest? (-> self elevator-status) (elevator-status waiting-to-ascend))) @@ -672,7 +646,6 @@ do so. (elevator-method-48 self) ) (plat-trans) - (none) ) :code (behavior () (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) @@ -683,7 +656,6 @@ do so. ) ) #f - (none) ) :post (behavior () (when (logtest? (-> self elevator-status) (elevator-status waiting-to-ascend)) @@ -703,20 +675,19 @@ do so. ) ) (move-post) - (none) ) ) (defstate arrived (elevator) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (set! (-> self ride-timer) (current-time)) - (elevator-event proc arg1 event-type event) + (elevator-event proc argc message block) ) (else - (elevator-event proc arg1 event-type event) + (elevator-event proc argc message block) ) ) ) @@ -730,7 +701,6 @@ do so. (script-eval gp-0 :key (* (the int (-> self move-pos 1)) 8) :vector (-> self root trans)) ) ) - (none) ) :trans (behavior () (if (and (< (- (-> self ride-timer) (-> self sticky-player-last-ride-time)) (seconds 2)) @@ -756,7 +726,6 @@ do so. ) ) (plat-trans) - (none) ) :code (the-as (function none :behavior elevator) sleep-code) :post (the-as (function none :behavior elevator) plat-post) diff --git a/goal_src/jak2/engine/common_objs/generic-obs.gc b/goal_src/jak2/engine/common_objs/generic-obs.gc index e946bc49bc0..9fa48d56bcd 100644 --- a/goal_src/jak2/engine/common_objs/generic-obs.gc +++ b/goal_src/jak2/engine/common_objs/generic-obs.gc @@ -181,16 +181,15 @@ (defstate idle (swingpole) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch 'attack) - (if (send-event proc 'pole-grab (-> event param 0)) - (go-virtual active (process->handle proc)) - ) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (if (send-event proc 'pole-grab (-> block param 0)) + (go-virtual active (process->handle proc)) + ) + #f + ) + ) ) :code (behavior () (if (nonzero? (-> self draw)) @@ -211,7 +210,6 @@ 0 ) ) - (none) ) ) @@ -238,7 +236,6 @@ ) ) (go-virtual idle) - (none) ) ) @@ -384,416 +381,407 @@ This commonly includes things such as: (defstate idle (manipy) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (s4-0 object)) - (let ((v1-0 event-type)) - (the-as - object - (cond - ((= v1-0 'attackable) - (cond - ((-> event param 0) - (set! s4-0 (logior (process-mask collectable) (-> self mask))) - (set! (-> self mask) (the-as process-mask s4-0)) - ) - (else - (set! s4-0 (logclear (-> self mask) (process-mask collectable))) - (set! (-> self mask) (the-as process-mask s4-0)) - ) - ) - s4-0 - ) - ((= v1-0 'blend-shape) - (when (nonzero? (-> self skel)) - (cond - ((-> event param 0) - (set! s4-0 (logior (-> self skel status) (joint-control-status blend-shape eye-anim))) - (set! (-> self skel status) (the-as joint-control-status s4-0)) - ) - (else - (set! s4-0 (logclear (-> self skel status) (joint-control-status blend-shape eye-anim))) - (set! (-> self skel status) (the-as joint-control-status s4-0)) - ) - ) - s4-0 - ) - ) - ((= v1-0 'shadow) - (when (nonzero? (-> self draw)) - (cond - ((-> event param 0) - (set! s4-0 (-> self shadow-backup)) - (set! (-> self draw shadow) (the-as shadow-geo s4-0)) - s4-0 - ) - (else - (set! (-> self draw shadow) #f) - #f - ) - ) - ) - ) - ((= v1-0 'shadow-volume) - (let ((v1-17 (get-art-by-name-method (-> self draw jgeo) (the-as string (-> event param 0)) (the-as type #f)))) - (if v1-17 - (set! (-> self shadow-volume-joint) (+ (-> (the-as joint v1-17) number) 1)) - ) - ) - (when (and (-> self draw shadow-ctrl) (< 1 arg1) (>= (the-as int (-> event param 1)) 0)) - (let ((v0-1 (command-get-int (-> event param 1) 0))) - (set! (-> self draw shadow-ctrl settings flags) (the-as shadow-flags v0-1)) - v0-1 - ) - ) - ) - ((= v1-0 'shadow-type) - (if (and (-> self draw shadow-ctrl) (> arg1 0)) - (set! (-> self draw shadow-ctrl settings shadow-type) (command-get-int (-> event param 0) 0)) - ) + (case message + (('attackable) + (cond + ((-> block param 0) + (set! s4-0 (logior (process-mask collectable) (-> self mask))) + (set! (-> self mask) (the-as process-mask s4-0)) + ) + (else + (set! s4-0 (logclear (-> self mask) (process-mask collectable))) + (set! (-> self mask) (the-as process-mask s4-0)) ) - ((= v1-0 'shadow-dir) - (when (and (-> self draw shadow-ctrl) (> arg1 0)) - (set! s4-0 (-> self draw shadow-ctrl settings shadow-dir)) - (set! (-> (the-as vector s4-0) x) (command-get-float (-> event param 0) 0.0)) - (set! (-> (the-as vector s4-0) y) (command-get-float (-> event param 1) 0.0)) - (set! (-> (the-as vector s4-0) z) (command-get-float (-> event param 2) 0.0)) - (set! (-> (the-as vector s4-0) w) (if (< 3 arg1) - (command-get-float (-> event param 3) 0.0) - 409600.0 - ) - ) - s4-0 + ) + s4-0 + ) + (('blend-shape) + (when (nonzero? (-> self skel)) + (cond + ((-> block param 0) + (set! s4-0 (logior (-> self skel status) (joint-control-status blend-shape eye-anim))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) + ) + (else + (set! s4-0 (logclear (-> self skel status) (joint-control-status blend-shape eye-anim))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) ) ) - ((= v1-0 'shadow-top-plane) - (when (and (-> self draw shadow-ctrl) (>= arg1 4)) - (set! s4-0 (-> self draw shadow-ctrl settings top-plane)) - (set! (-> (the-as plane s4-0) x) (command-get-float (-> event param 0) 0.0)) - (set! (-> (the-as plane s4-0) y) (command-get-float (-> event param 1) 0.0)) - (set! (-> (the-as plane s4-0) z) (command-get-float (-> event param 2) 0.0)) - (set! (-> (the-as plane s4-0) w) (command-get-float (-> event param 3) 0.0)) - s4-0 + s4-0 + ) + ) + (('shadow) + (when (nonzero? (-> self draw)) + (cond + ((-> block param 0) + (set! s4-0 (-> self shadow-backup)) + (set! (-> self draw shadow) (the-as shadow-geo s4-0)) + s4-0 + ) + (else + (set! (-> self draw shadow) #f) + #f ) ) - ((= v1-0 'shadow-bot-plane) - (when (and (-> self draw shadow-ctrl) (>= arg1 4)) - (set! s4-0 (-> self draw shadow-ctrl settings bot-plane)) - (set! (-> (the-as plane s4-0) x) (command-get-float (-> event param 0) 0.0)) - (set! (-> (the-as plane s4-0) y) (command-get-float (-> event param 1) 0.0)) - (set! (-> (the-as plane s4-0) z) (command-get-float (-> event param 2) 0.0)) - (set! (-> (the-as plane s4-0) w) (command-get-float (-> event param 3) 0.0)) - s4-0 + ) + ) + (('shadow-volume) + (let ((v1-17 (get-art-by-name-method (-> self draw jgeo) (the-as string (-> block param 0)) (the-as type #f)))) + (if v1-17 + (set! (-> self shadow-volume-joint) (+ (-> (the-as joint v1-17) number) 1)) ) + ) + (when (and (-> self draw shadow-ctrl) (< 1 argc) (>= (the-as int (-> block param 1)) 0)) + (let ((v0-1 (command-get-int (-> block param 1) 0))) + (set! (-> self draw shadow-ctrl settings flags) (the-as shadow-flags v0-1)) + v0-1 ) - ((= v1-0 'no-fog) - (set! s4-0 (logior (-> self draw status) (draw-control-status disable-fog))) - (set! (-> self draw status) (the-as draw-control-status s4-0)) - s4-0 + ) + ) + (('shadow-type) + (if (and (-> self draw shadow-ctrl) (> argc 0)) + (set! (-> self draw shadow-ctrl settings shadow-type) (command-get-int (-> block param 0) 0)) ) - ((= v1-0 'setup-spotlight-shadow) - (when (-> self draw shadow-ctrl) - (let ((v1-53 (command-get-process "spotlight" *target*))) - (when v1-53 - (let ((s5-1 (-> (the-as process-drawable v1-53) node-list data 3))) - (vector<-cspace! (new 'stack-no-clear 'vector) s5-1) - (let ((s5-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-1 bone transform vector 2) -1.0)) - (s4-1 - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self draw shadow-joint-index))) - ) - (f30-0 1638400.0) - (s3-0 (new 'stack-no-clear 'collide-query)) - (f28-0 122880.0) - ) - (set! (-> s3-0 start-pos quad) (-> s4-1 quad)) - (vector-normalize-copy! (-> s3-0 move-dist) s5-2 f28-0) - (let ((v1-64 s3-0)) - (set! (-> v1-64 radius) 1638.4) - (set! (-> v1-64 collide-with) (collide-spec obstacle hit-by-others-list)) - (set! (-> v1-64 ignore-process0) self) - (set! (-> v1-64 ignore-process1) #f) - (set! (-> v1-64 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) - (set! (-> v1-64 action-mask) (collide-action solid)) + ) + (('shadow-dir) + (when (and (-> self draw shadow-ctrl) (> argc 0)) + (set! s4-0 (-> self draw shadow-ctrl settings shadow-dir)) + (set! (-> (the-as vector s4-0) x) (command-get-float (-> block param 0) 0.0)) + (set! (-> (the-as vector s4-0) y) (command-get-float (-> block param 1) 0.0)) + (set! (-> (the-as vector s4-0) z) (command-get-float (-> block param 2) 0.0)) + (set! (-> (the-as vector s4-0) w) (if (< 3 argc) + (command-get-float (-> block param 3) 0.0) + 409600.0 + ) + ) + s4-0 + ) + ) + (('shadow-top-plane) + (when (and (-> self draw shadow-ctrl) (>= argc 4)) + (set! s4-0 (-> self draw shadow-ctrl settings top-plane)) + (set! (-> (the-as plane s4-0) x) (command-get-float (-> block param 0) 0.0)) + (set! (-> (the-as plane s4-0) y) (command-get-float (-> block param 1) 0.0)) + (set! (-> (the-as plane s4-0) z) (command-get-float (-> block param 2) 0.0)) + (set! (-> (the-as plane s4-0) w) (command-get-float (-> block param 3) 0.0)) + s4-0 + ) + ) + (('shadow-bot-plane) + (when (and (-> self draw shadow-ctrl) (>= argc 4)) + (set! s4-0 (-> self draw shadow-ctrl settings bot-plane)) + (set! (-> (the-as plane s4-0) x) (command-get-float (-> block param 0) 0.0)) + (set! (-> (the-as plane s4-0) y) (command-get-float (-> block param 1) 0.0)) + (set! (-> (the-as plane s4-0) z) (command-get-float (-> block param 2) 0.0)) + (set! (-> (the-as plane s4-0) w) (command-get-float (-> block param 3) 0.0)) + s4-0 + ) + ) + (('no-fog) + (set! s4-0 (logior (-> self draw status) (draw-control-status disable-fog))) + (set! (-> self draw status) (the-as draw-control-status s4-0)) + s4-0 + ) + (('setup-spotlight-shadow) + (when (-> self draw shadow-ctrl) + (let ((v1-53 (command-get-process "spotlight" *target*))) + (when v1-53 + (let ((s5-1 (-> (the-as process-drawable v1-53) node-list data 3))) + (vector<-cspace! (new 'stack-no-clear 'vector) s5-1) + (let ((s5-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-1 bone transform vector 2) -1.0)) + (s4-1 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self draw shadow-joint-index))) ) - (let* ((f0-13 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) - (f28-1 (if (< 0.0 f0-13) - (* f0-13 f28-0) - 122880.0 - ) + (f30-0 1638400.0) + (s3-0 (new 'stack-no-clear 'collide-query)) + (f28-0 122880.0) + ) + (set! (-> s3-0 start-pos quad) (-> s4-1 quad)) + (vector-normalize-copy! (-> s3-0 move-dist) s5-2 f28-0) + (let ((v1-64 s3-0)) + (set! (-> v1-64 radius) 1638.4) + (set! (-> v1-64 collide-with) (collide-spec obstacle hit-by-others-list)) + (set! (-> v1-64 ignore-process0) self) + (set! (-> v1-64 ignore-process1) #f) + (set! (-> v1-64 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-64 action-mask) (collide-action solid)) + ) + (let* ((f0-13 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) + (f28-1 (if (< 0.0 f0-13) + (* f0-13 f28-0) + 122880.0 ) - ) - (the-as object (shadow-control-method-14 - (-> self draw shadow-ctrl) - s4-1 - s5-2 - f30-0 - (- f28-1 (command-get-float (-> event param 0) 0.0)) - (+ f28-1 (command-get-float (-> event param 1) 0.0)) - ) ) - ) + ) + (shadow-control-method-14 + (-> self draw shadow-ctrl) + s4-1 + s5-2 + f30-0 + (- f28-1 (command-get-float (-> block param 0) 0.0)) + (+ f28-1 (command-get-float (-> block param 1) 0.0)) ) ) ) ) ) ) - ((= v1-0 'color-mult) - (when (>= arg1 4) - (set! s4-0 (-> self draw color-mult)) - (set! (-> (the-as rgbaf s4-0) x) (command-get-float (-> event param 0) 0.0)) - (set! (-> (the-as rgbaf s4-0) y) (command-get-float (-> event param 1) 0.0)) - (set! (-> (the-as rgbaf s4-0) z) (command-get-float (-> event param 2) 0.0)) - (set! (-> (the-as rgbaf s4-0) w) (command-get-float (-> event param 3) 0.0)) - s4-0 - ) - ) - ((= v1-0 'color-mult-vector) - (set! s4-0 (-> self draw color-mult)) - (set! (-> (the-as rgbaf s4-0) quad) (-> (the-as vector (-> event param 0)) quad)) - s4-0 - ) - ((= v1-0 'color-emissive-vector) - (set! s4-0 (-> self draw color-emissive)) - (set! (-> (the-as rgbaf s4-0) quad) (-> (the-as vector (-> event param 0)) quad)) - s4-0 - ) - ((= v1-0 'segment) - (let ((a1-44 (/ (the-as int (-> event param 0)) 8)) - (a2-5 (/ (the-as int (-> event param 1)) 8)) - ) - (the-as object (setup-masks (-> self draw) (the-as int a1-44) (the-as int a2-5))) + ) + ) + (('color-mult) + (when (>= argc 4) + (set! s4-0 (-> self draw color-mult)) + (set! (-> (the-as rgbaf s4-0) x) (command-get-float (-> block param 0) 0.0)) + (set! (-> (the-as rgbaf s4-0) y) (command-get-float (-> block param 1) 0.0)) + (set! (-> (the-as rgbaf s4-0) z) (command-get-float (-> block param 2) 0.0)) + (set! (-> (the-as rgbaf s4-0) w) (command-get-float (-> block param 3) 0.0)) + s4-0 + ) + ) + (('color-mult-vector) + (set! s4-0 (-> self draw color-mult)) + (set! (-> (the-as rgbaf s4-0) quad) (-> (the-as vector (-> block param 0)) quad)) + s4-0 + ) + (('color-emissive-vector) + (set! s4-0 (-> self draw color-emissive)) + (set! (-> (the-as rgbaf s4-0) quad) (-> (the-as vector (-> block param 0)) quad)) + s4-0 + ) + (('segment) + (let ((a1-44 (/ (the-as int (-> block param 0)) 8)) + (a2-5 (/ (the-as int (-> block param 1)) 8)) ) - ) - ((= v1-0 'trans-hook) - (set! s4-0 (-> event param 0)) - (set! (-> self new-trans-hook) (the-as (function none) s4-0)) - s4-0 - ) - ((= v1-0 'post-hook) - (set! s4-0 (-> event param 0)) - (set! (-> self new-post-hook) (the-as (function none) s4-0)) - s4-0 - ) - ((= v1-0 'user-data) - (set! s4-0 (-> event param 0)) - (set! (-> self userdata) (the-as uint s4-0)) - s4-0 - ) - ((= v1-0 'eval) - ((the-as (function manipy object) (-> event param 0)) self) - ) - ((= v1-0 'speed) - (set! (-> self speed) (the-as float (-> event param 0))) - ) - ((= v1-0 'event-hook) - (set! s4-0 (-> event param 0)) - (set! (-> self cur-event-hook) (the-as (function none) s4-0)) - s4-0 - ) - ((= v1-0 'art-joint-anim) - (set! (-> self new-joint-anim) - (get-art-by-name (-> self draw art-group) (the-as string (-> event param 0)) art-joint-anim) - ) - (set! s4-0 (-> event param 1)) - (set! (-> self new-joint-anim-blend) (the-as uint s4-0)) - s4-0 - ) - ((= v1-0 'anim-mode) - (when (nonzero? (-> self skel)) - (set! (-> self anim-mode) (the-as symbol (-> event param 0))) - (if (= (-> self anim-mode) 'clone-anim) - (ja-post) - ) - (-> self anim-mode) + (setup-masks (-> self draw) (the-as int a1-44) (the-as int a2-5)) + ) + ) + (('trans-hook) + (set! s4-0 (-> block param 0)) + (set! (-> self new-trans-hook) (the-as (function none) s4-0)) + s4-0 + ) + (('post-hook) + (set! s4-0 (-> block param 0)) + (set! (-> self new-post-hook) (the-as (function none) s4-0)) + s4-0 + ) + (('user-data) + (set! s4-0 (-> block param 0)) + (set! (-> self userdata) (the-as uint s4-0)) + s4-0 + ) + (('eval) + ((the-as (function manipy object) (-> block param 0)) self) + ) + (('speed) + (set! (-> self speed) (the-as float (-> block param 0))) + ) + (('event-hook) + (set! s4-0 (-> block param 0)) + (set! (-> self cur-event-hook) (the-as (function none) s4-0)) + s4-0 + ) + (('art-joint-anim) + (set! (-> self new-joint-anim) + (get-art-by-name (-> self draw art-group) (the-as string (-> block param 0)) art-joint-anim) ) - ) - ((or (= v1-0 'origin-joint-index) (= v1-0 'center-joint)) - (set! (-> self draw origin-joint-index) (-> event param 0)) - (set! s4-0 (-> event param 0)) - (set! (-> self draw shadow-joint-index) (the-as uint s4-0)) - s4-0 - ) - ((= v1-0 'max-vis-dist) - (set! (-> self draw lod-set lod (-> self draw lod-set max-lod) dist) (the-as float (-> event param 0))) - ) - ((= v1-0 'grab) - (set! (-> self cur-grab-handle) (process->handle (the-as process (-> event param 0)))) - (let ((v1-98 (handle->process (-> self cur-grab-handle)))) - (when v1-98 - (set! s4-0 (-> self old-grab-pos)) - (set! (-> (the-as vector s4-0) quad) (-> (the-as process-drawable v1-98) root trans quad)) - s4-0 - ) + (set! s4-0 (-> block param 1)) + (set! (-> self new-joint-anim-blend) (the-as uint s4-0)) + s4-0 + ) + (('anim-mode) + (when (nonzero? (-> self skel)) + (set! (-> self anim-mode) (the-as symbol (-> block param 0))) + (if (= (-> self anim-mode) 'clone-anim) + (ja-post) ) - ) - ((= v1-0 'target) - (set! s4-0 (process->handle (the-as process (-> event param 0)))) - (set! (-> self cur-target-handle) (the-as handle s4-0)) + (-> self anim-mode) + ) + ) + (('origin-joint-index 'center-joint) + (set! (-> self draw origin-joint-index) (-> block param 0)) + (set! s4-0 (-> block param 0)) + (set! (-> self draw shadow-joint-index) (the-as uint s4-0)) + s4-0 + ) + (('max-vis-dist) + (set! (-> self draw lod-set lod (-> self draw lod-set max-lod) dist) (the-as float (-> block param 0))) + ) + (('grab) + (set! (-> self cur-grab-handle) (process->handle (the-as process (-> block param 0)))) + (let ((v1-98 (handle->process (-> self cur-grab-handle)))) + (when v1-98 + (set! s4-0 (-> self old-grab-pos)) + (set! (-> (the-as vector s4-0) quad) (-> (the-as process-drawable v1-98) root trans quad)) s4-0 ) - ((= v1-0 'trans) - (cond - ((type? (-> self root) collide-shape) - (the-as object (move-to-point! (-> self root) (the-as vector (-> event param 0)))) - ) - (else - (set! s4-0 (-> self root trans)) - (set! (-> (the-as vector s4-0) quad) (-> (the-as vector (-> event param 0)) quad)) - s4-0 - ) - ) - ) - ((= v1-0 'rot) - (let ((s5-3 (new 'stack-no-clear 'matrix))) - (matrix-rotate-y! s5-3 (the-as float (-> event param 0))) - (matrix->quaternion (-> self root quat) s5-3) - ) - ) - ((= v1-0 'rot-quat) - (quaternion-copy! (-> self root quat) (the-as quaternion (-> event param 0))) - ) - ((= v1-0 'clone-copy-trans) - (set! s4-0 (-> event param 0)) - (set! (-> self clone-copy-trans) (the-as symbol s4-0)) + ) + ) + (('target) + (set! s4-0 (process->handle (the-as process (-> block param 0)))) + (set! (-> self cur-target-handle) (the-as handle s4-0)) + s4-0 + ) + (('trans) + (cond + ((type? (-> self root) collide-shape) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) + ) + (else + (set! s4-0 (-> self root trans)) + (set! (-> (the-as vector s4-0) quad) (-> (the-as vector (-> block param 0)) quad)) s4-0 ) - ((= v1-0 'release) - (set! (-> self cur-grab-handle) (the-as handle #f)) - #f - ) - ((= v1-0 'draw) - (set! (-> self draw?) (the-as symbol (-> event param 0))) - (cond - ((-> event param 0) - (let ((v1-114 (logtest? (-> self draw status) (draw-control-status no-draw)))) - (logclear! (-> self draw status) (draw-control-status no-draw)) - (when v1-114 - (cond - ((nonzero? (-> self skel)) - (let ((gp-1 (-> self skel status))) - (logior! (-> self skel status) (joint-control-status sync-math)) - (set! s4-0 (the-as object (ja-post))) - (set! (-> self skel status) gp-1) - ) - s4-0 - ) - (else - (the-as object (ja-post)) - ) - ) - ) - ) - ) - (else - (set! s4-0 (logior (-> self draw status) (draw-control-status no-draw))) - (set! (-> self draw status) (the-as draw-control-status s4-0)) - s4-0 - ) - ) - ) - ((= v1-0 'sync) - (when (nonzero? (-> self skel)) - (cond - ((-> event param 0) - (set! s4-0 (logior (-> self skel status) (joint-control-status sync-math))) - (set! (-> self skel status) (the-as joint-control-status s4-0)) - ) - (else - (set! s4-0 (logclear (-> self skel status) (joint-control-status sync-math))) - (set! (-> self skel status) (the-as joint-control-status s4-0)) - ) - ) - s4-0 - ) - ) - ((= v1-0 'query) - (case (-> event param 0) - (('grab) - (handle->process (-> self cur-grab-handle)) - ) - (('done) - (case (-> self anim-mode) - (('play1 'play) - (>= (ja-frame-num 0) (the float (+ (-> (ja-group) frames num-frames) -2))) + ) + ) + (('rot) + (let ((s5-3 (new 'stack-no-clear 'matrix))) + (matrix-rotate-y! s5-3 (the-as float (-> block param 0))) + (matrix->quaternion (-> self root quat) s5-3) + ) + ) + (('rot-quat) + (quaternion-copy! (-> self root quat) (the-as quaternion (-> block param 0))) + ) + (('clone-copy-trans) + (set! s4-0 (-> block param 0)) + (set! (-> self clone-copy-trans) (the-as symbol s4-0)) + s4-0 + ) + (('release) + (set! (-> self cur-grab-handle) (the-as handle #f)) + #f + ) + (('draw) + (set! (-> self draw?) (the-as symbol (-> block param 0))) + (cond + ((-> block param 0) + (let ((v1-114 (logtest? (-> self draw status) (draw-control-status no-draw)))) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (when v1-114 + (cond + ((nonzero? (-> self skel)) + (let ((gp-1 (-> self skel status))) + (logior! (-> self skel status) (joint-control-status sync-math)) + (set! s4-0 (ja-post)) + (set! (-> self skel status) gp-1) + ) + s4-0 ) + (else + (ja-post) + ) ) ) - ) - ) - ((= v1-0 'set-frame-num) - (let ((v1-147 (-> self skel root-channel 0))) - (set! (-> v1-147 num-func) num-func-identity) - (set! (-> v1-147 frame-num) (the-as float (-> event param 0))) - ) - ) - ((= v1-0 'prefix) - (set! s4-0 (-> event param 0)) - (set! (-> self prefix) (the-as basic s4-0)) + ) + ) + (else + (set! s4-0 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status s4-0)) s4-0 ) - ((= v1-0 'light-index) - (let ((v0-40 (command-get-int (-> event param 0) 0))) - (set! (-> self draw light-index) (the-as uint v0-40)) - v0-40 - ) - ) - ((= v1-0 'eye-slot) - (set! (-> self draw mgeo header eye-ctrl eye-slot) (command-get-int (-> event param 0) 0)) - ) - ((= v1-0 'shadow-mask) - (let ((v0-42 (command-get-int (-> event param 0) 0))) - (set! (-> self draw shadow-mask) (the-as uint v0-42)) - v0-42 - ) - ) - ((= v1-0 'shadow-values) - (let ((v0-43 (command-get-int (-> event param 0) 0))) - (set! (-> self draw shadow-values) (the-as uint v0-43)) - v0-43 + ) + ) + (('sync) + (when (nonzero? (-> self skel)) + (cond + ((-> block param 0) + (set! s4-0 (logior (-> self skel status) (joint-control-status sync-math))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) + ) + (else + (set! s4-0 (logclear (-> self skel status) (joint-control-status sync-math))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) ) ) - ((= v1-0 'mirror) - (cond - ((-> event param 0) - (set! s4-0 (-> self node-list data 2)) - (set! (-> (the-as cspace s4-0) param0) - (the-as (function cspace transformq none) cspace<-parented-matrix-mirror!) - ) - (set! (-> (the-as cspace s4-0) param1) (the-as basic (-> *math-camera* mirror-trans))) - (set! (-> (the-as cspace s4-0) param2) (the-as basic (-> *math-camera* mirror-normal))) - ) - (else - (set! s4-0 (-> self node-list data 2)) - (set! (-> (the-as cspace s4-0) param0) #f) - ) + s4-0 + ) + ) + (('query) + (case (-> block param 0) + (('grab) + (handle->process (-> self cur-grab-handle)) + ) + (('done) + (case (-> self anim-mode) + (('play1 'play) + (>= (ja-frame-num 0) (the float (+ (-> (ja-group) frames num-frames) -2))) ) - s4-0 - ) - ((= v1-0 'draw-mirror) - (send-event (ppointer->process (-> self child)) 'draw (-> event param 0)) - ) - ((= v1-0 'user) - (set! s4-0 (-> event param 1)) - (set! (-> self user-uint64 (/ (the-as int (-> event param 0)) 8)) (the-as uint s4-0)) - s4-0 - ) - ((= v1-0 'die) - (the-as object (deactivate self)) + ) + ) + ) + ) + (('set-frame-num) + (let ((v1-147 (-> self skel root-channel 0))) + (set! (-> v1-147 num-func) num-func-identity) + (set! (-> v1-147 frame-num) (the-as float (-> block param 0))) + ) + ) + (('prefix) + (set! s4-0 (-> block param 0)) + (set! (-> self prefix) (the-as basic s4-0)) + s4-0 + ) + (('light-index) + (let ((v0-40 (command-get-int (-> block param 0) 0))) + (set! (-> self draw light-index) (the-as uint v0-40)) + v0-40 + ) + ) + (('eye-slot) + (set! (-> self draw mgeo header eye-ctrl eye-slot) (command-get-int (-> block param 0) 0)) + ) + (('shadow-mask) + (let ((v0-42 (command-get-int (-> block param 0) 0))) + (set! (-> self draw shadow-mask) (the-as uint v0-42)) + v0-42 + ) + ) + (('shadow-values) + (let ((v0-43 (command-get-int (-> block param 0) 0))) + (set! (-> self draw shadow-values) (the-as uint v0-43)) + v0-43 + ) + ) + (('mirror) + (cond + ((-> block param 0) + (set! s4-0 (-> self node-list data 2)) + (set! (-> (the-as cspace s4-0) param0) + (the-as (function cspace transformq none) cspace<-parented-matrix-mirror!) + ) + (set! (-> (the-as cspace s4-0) param1) (the-as basic (-> *math-camera* mirror-trans))) + (set! (-> (the-as cspace s4-0) param2) (the-as basic (-> *math-camera* mirror-normal))) + ) + (else + (set! s4-0 (-> self node-list data 2)) + (set! (-> (the-as cspace s4-0) param0) #f) ) - ((= v1-0 'do-effect) - (if (and (nonzero? (-> self skel)) (-> self skel effect)) - (the-as - object - (do-effect (-> self skel effect) (the-as symbol (-> event param 0)) (the-as float (-> event param 1)) -1) - ) - ) + ) + s4-0 + ) + (('draw-mirror) + (send-event (ppointer->process (-> self child)) 'draw (-> block param 0)) + ) + (('user) + (set! s4-0 (-> block param 1)) + (set! (-> self user-uint64 (/ (the-as int (-> block param 0)) 8)) (the-as uint s4-0)) + s4-0 + ) + (('die) + (deactivate self) + ) + (('do-effect) + (if (and (nonzero? (-> self skel)) (-> self skel effect)) + (do-effect (-> self skel effect) (the-as symbol (-> block param 0)) (the-as float (-> block param 1)) -1) ) - (else - (if (-> self cur-event-hook) - (the-as object ((-> self cur-event-hook))) - ) + ) + (else + (if (-> self cur-event-hook) + ((-> self cur-event-hook)) ) - ) ) ) ) @@ -830,7 +818,6 @@ This commonly includes things such as: ) ) ((-> self cur-trans-hook)) - (none) ) :code (behavior () (logclear! (-> self mask) (process-mask heap-shrunk)) @@ -939,7 +926,6 @@ This commonly includes things such as: ) ) #f - (none) ) ) @@ -1072,13 +1058,12 @@ This commonly includes things such as: (defstate active (part-tracker) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('die) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (deactivate self) + ) + ) ) :code (behavior () (set! (-> self start-time) (current-time)) @@ -1142,7 +1127,6 @@ This commonly includes things such as: (notify-parent-of-death self) (suspend) 0 - (none) ) ) @@ -1392,13 +1376,12 @@ This commonly includes things such as: (defstate active (lightning-tracker) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('die) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (deactivate self) + ) + ) ) :exit (behavior () (when (nonzero? (-> self sound)) @@ -1412,7 +1395,6 @@ This commonly includes things such as: (-> v1-1 id) ) ) - (none) ) :code (behavior () (set! (-> self sound) (new 'static 'sound-id)) @@ -1528,7 +1510,6 @@ This commonly includes things such as: (notify-parent-of-death self) (suspend) 0 - (none) ) ) @@ -1558,7 +1539,7 @@ This commonly includes things such as: ) (else (set! (-> self target-joint0) -1) - ;; hack, fixed bug in original game + ;: og:preserve-this hack, fixed bug in original game (when arg4 (set! (-> self offset0 quad) (-> arg4 quad)) ) @@ -1571,7 +1552,7 @@ This commonly includes things such as: ) (else (set! (-> self target-joint1) -1) - ;; hack, fixed bug in original game + ;; og:preserve-this hack, fixed bug in original game (when arg5 (set! (-> self offset1 quad) (-> arg5 quad)) ) @@ -1759,7 +1740,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior med-res-level) ja-post) ) @@ -1811,8 +1791,8 @@ This commonly includes things such as: (defstate active (part-spawner) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('stop) (process-entity-status! self (entity-perm-status subtask-complete) #t) (set! (-> self enable) #f) @@ -1824,7 +1804,7 @@ This commonly includes things such as: #t ) (('trans) - (let ((v0-1 (the-as object (-> (the-as vector (-> event param 0)) quad)))) + (let ((v0-1 (the-as object (-> (the-as vector (-> block param 0)) quad)))) (set! (-> self root trans quad) (the-as uint128 v0-1)) v0-1 ) @@ -1842,7 +1822,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -2186,13 +2165,14 @@ This commonly includes things such as: ) (defstate cam-launcher-shortfall (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -2214,13 +2194,11 @@ This commonly includes things such as: (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -2236,7 +2214,6 @@ This commonly includes things such as: ) ) #f - (none) ) ) @@ -2256,13 +2233,14 @@ This commonly includes things such as: ) (defstate cam-launcher-longfall (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -2277,14 +2255,12 @@ This commonly includes things such as: (cam-calc-follow! (-> self tracking) (-> self trans) #f) (slave-set-rotation! (-> self tracking) (-> self trans) (-> self options) (-> self fov) #f) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) (cam-launcher-long-joystick) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -2346,23 +2322,21 @@ This commonly includes things such as: ) ) #f - (none) ) ) (defstate idle (launcher) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('instant-death) - (go-virtual deactivated) - ) - (('trans) - (move-to-point! (-> self root) (the-as vector (-> event param 0))) - (the-as object (update-transforms (-> self root))) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('instant-death) + (go-virtual deactivated) + ) + (('trans) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) + (update-transforms (-> self root)) + ) + ) ) :trans (behavior () (when (and *target* @@ -2391,28 +2365,26 @@ This commonly includes things such as: (talker-spawn-func (-> *talker-speech* 322) *entity-pool* (target-pos 0) (the-as region #f)) ) ) - (none) ) :code (the-as (function none :behavior launcher) sleep-code) ) (defstate active (launcher) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (when (or (= event-type 'touch) (= event-type 'attack)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (or (= message 'touch) (= message 'attack)) (set! (-> self state-time) (current-time)) (send-event proc 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) - (the-as object (cond - ((= event-type 'instant-death) - (go-virtual deactivated) - ) - ((= event-type 'trans) - (move-to-point! (-> self root) (the-as vector (-> event param 0))) - (the-as object (update-transforms (-> self root))) - ) - ) - ) + (cond + ((= message 'instant-death) + (go-virtual deactivated) + ) + ((= message 'trans) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) + (update-transforms (-> self root)) + ) + ) ) :exit (behavior () (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) @@ -2424,7 +2396,6 @@ This commonly includes things such as: (set! (-> v1-0 params mask) (the-as uint 17)) (-> v1-0 id) ) - (none) ) :trans (behavior () (if (or (or (not *target*) @@ -2448,12 +2419,10 @@ This commonly includes things such as: ) (send-event *target* 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) - (none) ) :code (behavior () (sound-play "launch-start") (sleep-code) - (none) ) ) @@ -2599,9 +2568,9 @@ This commonly includes things such as: (defstate active (touch-tracker) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('touched) (let ((v1-1 (ppointer->process (-> self parent)))) (when (!= v1-1 proc) @@ -2621,14 +2590,14 @@ This commonly includes things such as: (else (let ((t0-5 (new 'stack-no-clear 'event-message-block))) (set! (-> t0-5 from) (process->ppointer proc)) - (set! (-> t0-5 num-params) arg1) - (set! (-> t0-5 message) event-type) - (set! (-> t0-5 param 0) (-> event param 0)) - (set! (-> t0-5 param 1) (-> event param 1)) - (set! (-> t0-5 param 2) (-> event param 2)) - (set! (-> t0-5 param 3) (-> event param 3)) - (set! (-> t0-5 param 4) (-> event param 4)) - (set! (-> t0-5 param 5) (-> event param 5)) + (set! (-> t0-5 num-params) argc) + (set! (-> t0-5 message) message) + (set! (-> t0-5 param 0) (-> block param 0)) + (set! (-> t0-5 param 1) (-> block param 1)) + (set! (-> t0-5 param 2) (-> block param 2)) + (set! (-> t0-5 param 3) (-> block param 3)) + (set! (-> t0-5 param 4) (-> block param 4)) + (set! (-> t0-5 param 5) (-> block param 5)) (send-event-function v1-1 t0-5) ) ) @@ -2637,26 +2606,26 @@ This commonly includes things such as: ) ) (('target) - (set! v0-0 (process->handle (the-as process (-> event param 0)))) + (set! v0-0 (process->handle (the-as process (-> block param 0)))) (set! (-> self target) (the-as handle v0-0)) v0-0 ) (('event) - (set! (-> self event) (the-as symbol (-> event param 0))) - (set! v0-0 (-> event param 1)) + (set! (-> self event) (the-as symbol (-> block param 0))) + (set! v0-0 (-> block param 1)) (set! (-> self event-mode) (the-as basic v0-0)) v0-0 ) (('exit) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self run-function) (the-as (function object) v0-0)) v0-0 ) (('eval) - ((the-as (function touch-tracker object) (-> event param 0)) self) + ((the-as (function touch-tracker object) (-> block param 0)) self) ) (('function) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self callback) (the-as (function touch-tracker none) v0-0)) v0-0 ) @@ -2703,7 +2672,6 @@ This commonly includes things such as: 0 (suspend) 0 - (none) ) ) @@ -2836,8 +2804,8 @@ This commonly includes things such as: (defstate explode (explosion) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (let* ((s4-0 proc) (v1-1 (if (type? s4-0 process-drawable) @@ -2865,7 +2833,7 @@ This commonly includes things such as: (set! (-> v1-5 action-mask) (collide-action solid)) ) (if (< (fill-and-probe-using-line-sphere *collide-cache* a1-2) 0.0) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) ) ) ) @@ -2897,7 +2865,6 @@ This commonly includes things such as: (while (< (- (current-time) (-> self start-time)) (the-as time-frame (-> self linger-duration))) (suspend) ) - (none) ) ) diff --git a/goal_src/jak2/engine/common_objs/plat.gc b/goal_src/jak2/engine/common_objs/plat.gc index 79bbd7aa00a..cceeb6e6af9 100644 --- a/goal_src/jak2/engine/common_objs/plat.gc +++ b/goal_src/jak2/engine/common_objs/plat.gc @@ -93,7 +93,6 @@ otherwise, [[plat::34]] :event (the-as (function process int symbol event-message-block object :behavior plat) plat-event) :trans (behavior () (execute-effects self) - (none) ) :code (behavior () (plat-trans) @@ -114,7 +113,6 @@ otherwise, [[plat::34]] ) ) #f - (none) ) ) @@ -123,7 +121,6 @@ otherwise, [[plat::34]] :event (the-as (function process int symbol event-message-block object :behavior plat) plat-event) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (set! (-> self path-pos) (get-norm! (-> self sync) 0)) @@ -132,7 +129,6 @@ otherwise, [[plat::34]] (sound-play "eco-plat-hover" :id (-> self sound-id) :position (-> self root trans)) ) (plat-trans) - (none) ) :code (behavior () (until #f @@ -146,7 +142,6 @@ otherwise, [[plat::34]] ) ) #f - (none) ) :post (the-as (function none :behavior plat) plat-post) ) @@ -246,8 +241,8 @@ This commonly includes things such as: (defstate idle (drop-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack 'bonk) (let* ((proc-temp proc) (proc-focus (if (type? proc-temp process-focusable) @@ -293,15 +288,14 @@ This commonly includes things such as: (go-virtual fall #f) ) #f - (none) ) :post (the-as (function none :behavior drop-plat) plat-post) ) (defstate fall (drop-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('edge-grabbed) (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (send-event proc 'end-mode) @@ -314,11 +308,9 @@ This commonly includes things such as: ) :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (ja-abort-spooled-anim (-> self anim) (the-as art-joint-anim #f) -1) - (none) ) :trans (the-as (function none :behavior drop-plat) rider-trans) :code (behavior ((arg0 symbol)) @@ -341,7 +333,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior drop-plat) rider-post) ) diff --git a/goal_src/jak2/engine/common_objs/projectile.gc b/goal_src/jak2/engine/common_objs/projectile.gc index 46058325342..1afa9a95de0 100644 --- a/goal_src/jak2/engine/common_objs/projectile.gc +++ b/goal_src/jak2/engine/common_objs/projectile.gc @@ -279,7 +279,6 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p :event projectile-event-handler :exit (behavior () (stop-sound! self) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self spawn-time)) (-> self timeout)) @@ -330,7 +329,6 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (go-sitting! self) ) ) - (none) ) :code (behavior () (until #f @@ -339,7 +337,6 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (suspend) ) #f - (none) ) ) @@ -349,12 +346,10 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p :enter (behavior () (spawn-shell-particles self) (play-impact-sound self (projectile-options lose-altitude)) - (none) ) :code (behavior () (suspend) (go-virtual die) - (none) ) ) @@ -364,12 +359,10 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p :enter (behavior () (unknown-particles self) (play-impact-sound self (projectile-options proj-options-2)) - (none) ) :code (behavior () (suspend) (go-virtual die) - (none) ) ) @@ -380,7 +373,6 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (send-event (handle->process v1-0) 'notify 'die) ) (cleanup-for-death self) - (none) ) ) @@ -544,7 +536,6 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (if (>= (- (current-time) (-> self spawn-time)) (-> self timeout)) (go-virtual impact) ) - (none) ) :code (the-as (function none :behavior projectile-bounce) sleep-code) :post (the-as (function none :behavior projectile-bounce) projectile-bounce-falling-post) @@ -560,7 +551,6 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p :virtual #t :enter (behavior () (go-virtual impact) - (none) ) ) diff --git a/goal_src/jak2/engine/common_objs/voicebox.gc b/goal_src/jak2/engine/common_objs/voicebox.gc index 4f3ea8f6aa8..ef4ece9592f 100644 --- a/goal_src/jak2/engine/common_objs/voicebox.gc +++ b/goal_src/jak2/engine/common_objs/voicebox.gc @@ -212,13 +212,13 @@ (defstate enter (remote) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go-virtual exit) ) (('speak-effect) - (let ((v0-0 (the-as object (-> event param 0)))) + (let ((v0-0 (the-as object (-> block param 0)))) (set! (-> self speak-effect?) (the-as basic v0-0)) v0-0 ) @@ -237,7 +237,6 @@ (try-update-focus (-> self focus) (the-as process-focusable a1-1)) ) ) - (none) ) :trans (behavior () (remote-track) @@ -246,7 +245,6 @@ (point-toward-point-clear-roll-pitch! (-> self root) (get-trans (the-as process-focusable a0-1) 0)) ) ) - (none) ) :code (behavior () (let* ((gp-0 (ppointer->process (-> self parent 0 parent))) @@ -279,11 +277,9 @@ ) (set! (-> self blend) 0.0) (go-virtual idle) - (none) ) :post (behavior () (post-common self) - (none) ) ) @@ -297,7 +293,6 @@ (ja :num! (loop!)) ) (go-virtual exit) - (none) ) :post (-> (method-of-type remote enter) post) ) @@ -310,7 +305,6 @@ (send-event (ppointer->process (-> self parent)) 'change-state empty-state) (suspend) 0 - (none) ) :post (-> (method-of-type remote enter) post) ) @@ -340,7 +334,6 @@ ) (deactivate self) ) - (none) ) :code (-> cam-string code) ) @@ -375,7 +368,6 @@ (send-event (ppointer->process (-> self parent)) 'change-state empty-state) (suspend) (cleanup-for-death self) - (none) ) ) @@ -454,8 +446,8 @@ (defstate wait (judge) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (sound-play "judge-stop") (go-virtual exit) @@ -488,7 +480,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -499,14 +490,13 @@ (send-event *target* 'get-pickup (pickup-type trick-judge) (the float (-> self total-time))) (sound-play "judge-start") (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to self))) - (none) ) ) (defstate idle (judge) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (sound-play "judge-stop") (go-virtual exit) @@ -522,7 +512,6 @@ ) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (go-virtual exit) - (none) ) ) diff --git a/goal_src/jak2/engine/common_objs/water-anim.gc b/goal_src/jak2/engine/common_objs/water-anim.gc index e86e5f3ee58..2cceec54c00 100644 --- a/goal_src/jak2/engine/common_objs/water-anim.gc +++ b/goal_src/jak2/engine/common_objs/water-anim.gc @@ -311,98 +311,96 @@ ) ) -;; WARN: Return type mismatch none vs object. (defbehavior water-anim-event-handler water-anim ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-1 object)) - (the-as object (case arg2 - (('move-to) - (move-to-point! self (the-as vector (-> arg3 param 0))) - (set! v0-1 (logclear (-> self mask) (process-mask sleep-code))) - (set! (-> self mask) (the-as process-mask v0-1)) - v0-1 - ) - (('move-to-y) - (let ((a1-2 (new 'stack-no-clear 'vector))) - (set! (-> a1-2 quad) (-> self root trans quad)) - (set! (-> a1-2 y) (the-as float (-> arg3 param 0))) - (move-to-point! self a1-2) - ) - (set! v0-1 (logclear (-> self mask) (process-mask sleep-code))) - (set! (-> self mask) (the-as process-mask v0-1)) - v0-1 - ) - (('water) - (let* ((s5-0 (the-as object (-> arg3 param 0))) - (s4-0 (the-as object (-> arg3 param 1))) - (gp-0 (if (type? (the-as process s4-0) process-focusable) - (the-as uint s4-0) - ) - ) - ) - (when (and (logtest? (-> self flags) (water-flags deadly)) - (logtest? (water-flags touch-water) (-> (the-as water-info s5-0) flags)) - (the-as uint gp-0) - ) - (let ((v1-15 (-> self attack-event))) - (case v1-15 - ((#f) - ) - (('heat) - (send-event (the-as process-tree gp-0) 'heat (* 10.0 (seconds-per-frame))) - ) - (('drown-death 'lava 'dark-eco-pool) - (if (and (not (focus-test? (the-as process-focusable gp-0) board)) - (send-event - (the-as process-focusable gp-0) - 'attack-invinc - #f - (static-attack-info ((id (-> self attack-id)) (mode v1-15))) - ) - ) - (send-event self 'notify 'attack) - ) - ) - (else - (if (and (not (focus-test? (the-as process-focusable gp-0) board)) - (send-event - (the-as process-tree gp-0) - 'attack - #f - (static-attack-info ((id (-> self attack-id)) (mode v1-15))) - ) - ) - (send-event self 'notify 'attack) - ) - ) - ) - ) - ) - (when (and (logtest? (-> self flags) (water-flags flow)) - (logtest? (water-flags touch-water) (-> (the-as water-info s5-0) flags)) - ) - (let ((a0-40 (-> self flow))) - (if (nonzero? a0-40) - (the-as object (push-process a0-40 (the-as process-focusable gp-0))) - ) - ) - ) + (case arg2 + (('move-to) + (move-to-point! self (the-as vector (-> arg3 param 0))) + (set! v0-1 (logclear (-> self mask) (process-mask sleep-code))) + (set! (-> self mask) (the-as process-mask v0-1)) + v0-1 + ) + (('move-to-y) + (let ((a1-2 (new 'stack-no-clear 'vector))) + (set! (-> a1-2 quad) (-> self root trans quad)) + (set! (-> a1-2 y) (the-as float (-> arg3 param 0))) + (move-to-point! self a1-2) + ) + (set! v0-1 (logclear (-> self mask) (process-mask sleep-code))) + (set! (-> self mask) (the-as process-mask v0-1)) + v0-1 + ) + (('water) + (let* ((s5-0 (the-as object (-> arg3 param 0))) + (s4-0 (the-as object (-> arg3 param 1))) + (gp-0 (if (type? (the-as process s4-0) process-focusable) + (the-as uint s4-0) ) - ) - (('visible) - (cond - ((-> arg3 param 0) - (set! (-> self visible) #t) + ) + ) + (when (and (logtest? (-> self flags) (water-flags deadly)) + (logtest? (water-flags touch-water) (-> (the-as water-info s5-0) flags)) + (the-as uint gp-0) + ) + (let ((v1-15 (-> self attack-event))) + (case v1-15 + ((#f) + ) + (('heat) + (send-event (the-as process-tree gp-0) 'heat (* 10.0 (seconds-per-frame))) + ) + (('drown-death 'lava 'dark-eco-pool) + (if (and (not (focus-test? (the-as process-focusable gp-0) board)) + (send-event + (the-as process-focusable gp-0) + 'attack-invinc + #f + (static-attack-info ((id (-> self attack-id)) (mode v1-15))) + ) ) - (else - (set! (-> self visible) #f) - (logior! (-> self draw status) (draw-control-status no-draw)) + (send-event self 'notify 'attack) + ) + ) + (else + (if (and (not (focus-test? (the-as process-focusable gp-0) board)) + (send-event + (the-as process-tree gp-0) + 'attack + #f + (static-attack-info ((id (-> self attack-id)) (mode v1-15))) + ) ) - ) - (logclear! (-> self mask) (process-mask sleep-code)) - #t - ) + (send-event self 'notify 'attack) ) - ) + ) + ) + ) + ) + (when (and (logtest? (-> self flags) (water-flags flow)) + (logtest? (water-flags touch-water) (-> (the-as water-info s5-0) flags)) + ) + (let ((a0-40 (-> self flow))) + (if (nonzero? a0-40) + (push-process a0-40 (the-as process-focusable gp-0)) + ) + ) + ) + ) + ) + (('visible) + (cond + ((-> arg3 param 0) + (set! (-> self visible) #t) + ) + (else + (set! (-> self visible) #f) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + ) + (logclear! (-> self mask) (process-mask sleep-code)) + #t + ) + ) ) (defstate idle (water-anim) @@ -427,7 +425,6 @@ (if (and (-> self visible) (and (-> self play-ambient-sound?) (nonzero? (-> self sound)))) (update! (-> self sound)) ) - (none) ) :code (behavior () (until #f @@ -436,7 +433,6 @@ (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/engine/debug/default-menu.gc b/goal_src/jak2/engine/debug/default-menu.gc index 0444b602d1f..ddeaf8e7ec3 100644 --- a/goal_src/jak2/engine/debug/default-menu.gc +++ b/goal_src/jak2/engine/debug/default-menu.gc @@ -2528,10 +2528,7 @@ (debug-menu-append-item gp-0 a1-7) ) ) - (let ((a1-9 - (new 'debug 'debug-menu-item-function "Refresh" #f (the-as (function object object) build-instance-list)) - ) - ) + (let ((a1-9 (new 'debug 'debug-menu-item-function "Refresh" #f build-instance-list))) (debug-menu-append-item gp-0 a1-9) ) (let ((a1-11 diff --git a/goal_src/jak2/engine/debug/editable-player.gc b/goal_src/jak2/engine/debug/editable-player.gc index 2b4abc44d30..04ddf738e9f 100644 --- a/goal_src/jak2/engine/debug/editable-player.gc +++ b/goal_src/jak2/engine/debug/editable-player.gc @@ -1598,275 +1598,269 @@ (defstate idle (editable-player) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (the-as - object - (case event-type - (('execute) - (let ((a2-1 (-> event param 0))) - (case a2-1 - ((28 27 35 29 31 32) - (the-as object (editable-array-method-13 - (-> self current) - (editable-command pick-loc) - (the-as editable-command a2-1) - "click on the point to insert at (up target, down camera)" - ) - ) + (case message + (('execute) + (let ((a2-1 (-> block param 0))) + (case a2-1 + ((28 27 35 29 31 32) + (editable-array-method-13 + (-> self current) + (editable-command pick-loc) + (the-as editable-command a2-1) + "click on the point to insert at (up target, down camera)" ) - ((51 1 47 36 55 56) - (if (not (-> self left-handed)) - (the-as object (editable-array-method-13 - (-> self current) - (editable-command pick-yes-no) - (the-as editable-command a2-1) - "press x to confirm, square to cancel" - ) - ) - (the-as object (editable-array-method-13 - (-> self current) - (editable-command pick-yes-no) - (the-as editable-command a2-1) - "press down to confirm, left to cancel" - ) - ) + ) + ((51 1 47 36 55 56) + (if (not (-> self left-handed)) + (editable-array-method-13 + (-> self current) + (editable-command pick-yes-no) + (the-as editable-command a2-1) + "press x to confirm, square to cancel" ) - ) - (else - (editable-array-method-9 (-> self current) (the-as editable-command a2-1) *mouse*) - ) + (editable-array-method-13 + (-> self current) + (editable-command pick-yes-no) + (the-as editable-command a2-1) + "press down to confirm, left to cancel" + ) + ) + ) + (else + (editable-array-method-9 (-> self current) (the-as editable-command a2-1) *mouse*) ) ) ) - (('exit) - (the-as object (deactivate self)) - ) - (('menu) - (set! v0-0 (+ (current-time) (the-as time-frame (-> event param 0)))) - (set! (-> self close-menu-time) (the-as time-frame v0-0)) - v0-0 - ) - (('on-enter 'on-exit 'on-inside) - (let ((s4-0 (-> self current region))) - (when s4-0 - (let ((gp-1 (-> event param 0))) - (set! (-> *syntax-context* got-error?) #f) - (eval! *syntax-context* (the-as pair gp-1)) - (when (not (-> *syntax-context* got-error?)) - (set! (-> s4-0 changed) #t) - (cond - ((= event-type 'on-enter) - (set! (-> s4-0 on-enter) (the-as string gp-1)) - ) - ((= event-type 'on-inside) - (set! (-> s4-0 on-inside) (the-as string gp-1)) - ) - ((= event-type 'on-exit) - (set! (-> s4-0 on-exit) (the-as string gp-1)) - ) - ) + ) + (('exit) + (deactivate self) + ) + (('menu) + (set! v0-0 (+ (current-time) (the-as time-frame (-> block param 0)))) + (set! (-> self close-menu-time) (the-as time-frame v0-0)) + v0-0 + ) + (('on-enter 'on-exit 'on-inside) + (let ((s4-0 (-> self current region))) + (when s4-0 + (let ((gp-1 (-> block param 0))) + (set! (-> *syntax-context* got-error?) #f) + (eval! *syntax-context* (the-as pair gp-1)) + (when (not (-> *syntax-context* got-error?)) + (set! (-> s4-0 changed) #t) + (cond + ((= message 'on-enter) + (set! (-> s4-0 on-enter) (the-as string gp-1)) + ) + ((= message 'on-inside) + (set! (-> s4-0 on-inside) (the-as string gp-1)) + ) + ((= message 'on-exit) + (set! (-> s4-0 on-exit) (the-as string gp-1)) + ) ) ) - (set! v0-0 (editable-region-method-12 s4-0)) - (set! (-> s4-0 filter) (the-as editable-filter v0-0)) - v0-0 ) + (set! v0-0 (editable-region-method-12 s4-0)) + (set! (-> s4-0 filter) (the-as editable-filter v0-0)) + v0-0 ) ) - (('select) - (let ((gp-2 (-> event param 0))) - (editable-array-method-9 (-> self current) (editable-command select-none) (the-as mouse-info #f)) - (let* ((s5-1 (-> self current length)) - (s4-1 0) - (a0-36 (-> self current data s4-1)) - ) - (while (< s4-1 s5-1) - (when (and a0-36 (or (and (logtest? (-> a0-36 region filter) (-> self current filter 0)) - (logtest? (-> a0-36 region filter) (-> self current filter 1)) - ) - (logtest? (-> a0-36 flags) (editable-flag selected)) - ) - ) - (when (and (-> a0-36 region) (= gp-2 (-> a0-36 region id))) - (set! (-> self current region) (-> a0-36 region)) - (select-editable! a0-36 #t) - ) + ) + (('select) + (let ((gp-2 (-> block param 0))) + (editable-array-method-9 (-> self current) (editable-command select-none) (the-as mouse-info #f)) + (let* ((s5-1 (-> self current length)) + (s4-1 0) + (a0-36 (-> self current data s4-1)) + ) + (while (< s4-1 s5-1) + (when (and a0-36 (or (and (logtest? (-> a0-36 region filter) (-> self current filter 0)) + (logtest? (-> a0-36 region filter) (-> self current filter 1)) + ) + (logtest? (-> a0-36 flags) (editable-flag selected)) + ) + ) + (when (and (-> a0-36 region) (= gp-2 (-> a0-36 region id))) + (set! (-> self current region) (-> a0-36 region)) + (select-editable! a0-36 #t) ) - (+! s4-1 1) - (set! a0-36 (-> self current data s4-1)) ) + (+! s4-1 1) + (set! a0-36 (-> self current data s4-1)) ) ) - #f ) - (('name) - (let* ((s5-2 (-> self current length)) - (s4-2 0) - (s3-0 (-> self current data s4-2)) - ) - (while (< s4-2 s5-2) - (when (and s3-0 (logtest? (-> s3-0 flags) (editable-flag selected))) - (let ((v1-60 (if (type? s3-0 editable) - s3-0 - ) - ) - ) - (when v1-60 - (set! (-> v1-60 name) (the-as string (-> event param 0))) - (logior! (-> v1-60 flags) (editable-flag changed)) - (let ((v1-61 (-> v1-60 region))) - (if v1-61 - (set! (-> v1-61 changed) #t) - ) - ) + #f + ) + (('name) + (let* ((s5-2 (-> self current length)) + (s4-2 0) + (s3-0 (-> self current data s4-2)) + ) + (while (< s4-2 s5-2) + (when (and s3-0 (logtest? (-> s3-0 flags) (editable-flag selected))) + (let ((v1-60 (if (type? s3-0 editable) + s3-0 + ) + ) + ) + (when v1-60 + (set! (-> v1-60 name) (the-as string (-> block param 0))) + (logior! (-> v1-60 flags) (editable-flag changed)) + (let ((v1-61 (-> v1-60 region))) + (if v1-61 + (set! (-> v1-61 changed) #t) + ) ) ) ) - (+! s4-2 1) - (set! s3-0 (-> self current data s4-2)) ) + (+! s4-2 1) + (set! s3-0 (-> self current data s4-2)) ) - #f ) - (('level) - (let ((gp-3 (lookup-level-info (the-as symbol (-> event param 0))))) - (when (-> gp-3 dbname) - (let* ((s5-3 (-> self current length)) - (s4-3 0) - (s3-1 (-> self current data s4-3)) - ) - (while (< s4-3 s5-3) - (when (and s3-1 (logtest? (-> s3-1 flags) (editable-flag selected))) - (let ((v1-73 (if (type? s3-1 editable) - s3-1 - ) - ) - ) - (when (and v1-73 (-> v1-73 region)) - (set! (-> v1-73 region level) (the-as string (-> gp-3 dbname))) - (set! (-> v1-73 region changed) #t) + #f + ) + (('level) + (let ((gp-3 (lookup-level-info (the-as symbol (-> block param 0))))) + (when (-> gp-3 dbname) + (let* ((s5-3 (-> self current length)) + (s4-3 0) + (s3-1 (-> self current data s4-3)) + ) + (while (< s4-3 s5-3) + (when (and s3-1 (logtest? (-> s3-1 flags) (editable-flag selected))) + (let ((v1-73 (if (type? s3-1 editable) + s3-1 + ) + ) ) + (when (and v1-73 (-> v1-73 region)) + (set! (-> v1-73 region level) (the-as string (-> gp-3 dbname))) + (set! (-> v1-73 region changed) #t) ) ) - (+! s4-3 1) - (set! s3-1 (-> self current data s4-3)) ) + (+! s4-3 1) + (set! s3-1 (-> self current data s4-3)) ) - #f ) + #f ) ) - (('get-level) - (-> self current level) - ) - (('direction) - (let* ((f30-0 (the-as float (-> event param 0))) - (f28-0 (the-as float (-> event param 1))) - (f26-0 (the-as float (-> event param 2))) - (f24-0 (if (and (zero? (-> event param 0)) (zero? (-> event param 1)) (zero? (-> event param 2))) - 0.0 - 1.0 - ) - ) - (gp-4 (-> self current length)) - (s5-4 0) - (s4-4 (-> self current data s5-4)) - ) - (while (< s5-4 gp-4) - (when (and s4-4 (logtest? (-> s4-4 flags) (editable-flag selected))) - (let ((s3-2 (if (type? s4-4 editable-light) - (the-as editable-light s4-4) - ) - ) - ) - (when s3-2 - (set-vector! (-> s3-2 direction) f30-0 f28-0 f26-0 f24-0) - (vector-normalize! (-> s3-2 direction) 1.0) - (logior! (-> s3-2 flags) (editable-flag changed)) - (let ((a0-73 (-> s3-2 region))) - (if a0-73 - (set! (-> a0-73 changed) #t) + ) + (('get-level) + (-> self current level) + ) + (('direction) + (let* ((f30-0 (the-as float (-> block param 0))) + (f28-0 (the-as float (-> block param 1))) + (f26-0 (the-as float (-> block param 2))) + (f24-0 (if (and (zero? (-> block param 0)) (zero? (-> block param 1)) (zero? (-> block param 2))) + 0.0 + 1.0 ) ) + (gp-4 (-> self current length)) + (s5-4 0) + (s4-4 (-> self current data s5-4)) + ) + (while (< s5-4 gp-4) + (when (and s4-4 (logtest? (-> s4-4 flags) (editable-flag selected))) + (let ((s3-2 (if (type? s4-4 editable-light) + (the-as editable-light s4-4) + ) + ) + ) + (when s3-2 + (set-vector! (-> s3-2 direction) f30-0 f28-0 f26-0 f24-0) + (vector-normalize! (-> s3-2 direction) 1.0) + (logior! (-> s3-2 flags) (editable-flag changed)) + (let ((a0-73 (-> s3-2 region))) + (if a0-73 + (set! (-> a0-73 changed) #t) + ) ) ) ) - (+! s5-4 1) - (set! s4-4 (-> self current data s5-4)) ) + (+! s5-4 1) + (set! s4-4 (-> self current data s5-4)) ) - #f ) - (('color) - (let* ((f30-1 (the-as float (-> event param 0))) - (f28-1 (the-as float (-> event param 1))) - (f26-1 (the-as float (-> event param 2))) - (f24-1 (the-as float (-> event param 3))) - (gp-5 (-> self current length)) - (s5-5 0) - (s4-5 (-> self current data s5-5)) - ) - (while (< s5-5 gp-5) - (when (and s4-5 (logtest? (-> s4-5 flags) (editable-flag selected))) - (let ((v1-114 (if (type? s4-5 editable-light) - (the-as editable-light s4-5) - ) - ) - ) - (when v1-114 - (set-vector! (-> v1-114 color) f30-1 f28-1 f26-1 f24-1) - (logior! (-> v1-114 flags) (editable-flag changed)) - (let ((v1-115 (-> v1-114 region))) - (if v1-115 - (set! (-> v1-115 changed) #t) - ) - ) + #f + ) + (('color) + (let* ((f30-1 (the-as float (-> block param 0))) + (f28-1 (the-as float (-> block param 1))) + (f26-1 (the-as float (-> block param 2))) + (f24-1 (the-as float (-> block param 3))) + (gp-5 (-> self current length)) + (s5-5 0) + (s4-5 (-> self current data s5-5)) + ) + (while (< s5-5 gp-5) + (when (and s4-5 (logtest? (-> s4-5 flags) (editable-flag selected))) + (let ((v1-114 (if (type? s4-5 editable-light) + (the-as editable-light s4-5) + ) + ) + ) + (when v1-114 + (set-vector! (-> v1-114 color) f30-1 f28-1 f26-1 f24-1) + (logior! (-> v1-114 flags) (editable-flag changed)) + (let ((v1-115 (-> v1-114 region))) + (if v1-115 + (set! (-> v1-115 changed) #t) + ) ) ) ) - (+! s5-5 1) - (set! s4-5 (-> self current data s5-5)) ) + (+! s5-5 1) + (set! s4-5 (-> self current data s5-5)) ) - #f ) - (('param) - (let ((s5-6 (-> event param 0)) - (f30-2 (the-as float (-> event param 1))) - ) - (when (and (>= (the-as int s5-6) 0) (>= 2 (the-as int s5-6))) - (let* ((gp-6 (-> self current length)) - (s4-6 0) - (s3-3 (-> self current data s4-6)) - ) - (while (< s4-6 gp-6) - (when (and s3-3 (logtest? (-> s3-3 flags) (editable-flag selected))) - (let ((v1-129 (if (type? s3-3 editable-light) - s3-3 - ) - ) - ) - (when v1-129 - (set! (-> (the-as editable-light (+ (* s5-6 4) (the-as uint v1-129))) decay-start) f30-2) - (logior! (-> v1-129 flags) (editable-flag changed)) - (let ((v1-130 (-> v1-129 region))) - (if v1-130 - (set! (-> v1-130 changed) #t) - ) - ) + #f + ) + (('param) + (let ((s5-6 (-> block param 0)) + (f30-2 (the-as float (-> block param 1))) + ) + (when (and (>= (the-as int s5-6) 0) (>= 2 (the-as int s5-6))) + (let* ((gp-6 (-> self current length)) + (s4-6 0) + (s3-3 (-> self current data s4-6)) + ) + (while (< s4-6 gp-6) + (when (and s3-3 (logtest? (-> s3-3 flags) (editable-flag selected))) + (let ((v1-129 (if (type? s3-3 editable-light) + s3-3 + ) + ) + ) + (when v1-129 + (set! (-> (the-as editable-light (+ (* s5-6 4) (the-as uint v1-129))) decay-start) f30-2) + (logior! (-> v1-129 flags) (editable-flag changed)) + (let ((v1-130 (-> v1-129 region))) + (if v1-130 + (set! (-> v1-130 changed) #t) + ) ) ) ) - (+! s4-6 1) - (set! s3-3 (-> self current data s4-6)) ) + (+! s4-6 1) + (set! s3-3 (-> self current data s4-6)) ) - #f ) + #f ) ) - ) + ) ) ) :trans (behavior () @@ -2071,18 +2065,15 @@ ) ) ) - (none) ) :code (behavior () (until #f (suspend) ) #f - (none) ) :post (behavior () (editable-player-method-21 self) - (none) ) ) diff --git a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc index 24d0eaedb47..fca3031c38c 100644 --- a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc +++ b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc @@ -1088,6 +1088,7 @@ ) ) +;; WARN: Return type mismatch object vs none. (defmethod nav-graph-editor-method-32 nav-graph-editor ((obj nav-graph-editor) (arg0 symbol) (arg1 int)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1428,6 +1429,7 @@ ) ) +;; WARN: Return type mismatch object vs none. (defmethod nav-graph-editor-method-35 nav-graph-editor ((obj nav-graph-editor)) (nav-graph-editor-method-34 obj) (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) @@ -1467,30 +1469,27 @@ ) ) ) - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () (nav-graph-editor-method-29 self "Move node" "" "") (nav-graph-editor-method-28 self) (nav-graph-editor-method-35 self) - (none) ) ) (defstate adjust-plane (nav-graph-editor) :virtual #t :trans (behavior () - (if (logtest? (-> *mouse* button0-abs 0) (mouse-buttons left)) + (if (mouse-hold? left) (go-virtual move-plane) ) - (when (and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons middle)) (>= (-> self selected-index) 0)) + (when (and (mouse-hold? middle) (>= (-> self selected-index) 0)) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons middle)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons middle)) (set! (-> self plane-height) (-> self nav-graph node-array data (-> self selected-index) position y)) ) (nav-graph-editor-method-41 self) - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1500,7 +1499,6 @@ (nav-graph-editor-method-46 self) (nav-graph-editor-method-42 self) (nav-graph-editor-method-32 self (-> self selected-node-edge?) (-> self selected-index)) - (none) ) ) @@ -1509,13 +1507,11 @@ :enter (behavior () (set-vector! (-> self mouse-spos-hold) (-> *mouse* posx) (-> *mouse* posy) 0.0 1.0) (set! (-> self plane-height-hold) (-> self plane-height)) - (none) ) :trans (behavior () (if (not (mouse-hold? left)) (go-virtual adjust-plane) ) - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1531,7 +1527,6 @@ (nav-graph-editor-method-28 self) (nav-graph-editor-method-34 self) (nav-graph-editor-method-46 self) - (none) ) ) @@ -1557,14 +1552,13 @@ ) ) (cond - ((and (logtest? (-> *mouse* button0-rel 0) (mouse-buttons left)) - (begin - (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) - (let ((v1-20 (logclear (-> *mouse* button0-rel 0) (mouse-buttons left)))) - (set! (-> *mouse* button0-rel 0) v1-20) - (and v1-20 (!= (-> obj selected-index) (-> obj edge-src))) - ) - ) + ((and (mouse-pressed? left) (begin + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) + (let ((v1-20 (logclear (-> *mouse* button0-rel 0) (mouse-buttons left)))) + (set! (-> *mouse* button0-rel 0) v1-20) + (and v1-20 (!= (-> obj selected-index) (-> obj edge-src))) + ) + ) ) (cond ((>= (-> obj selected-index) 0) @@ -1583,7 +1577,7 @@ (nav-graph-editor-method-47 obj) (set! (-> obj edge-src) (-> obj edge-dst)) ) - ((logtest? (-> *mouse* button0-rel 0) (mouse-buttons right)) + ((mouse-pressed? right) (if (= (-> obj edge-dst) -2) (nav-graph-editor-method-58 obj) ) @@ -1612,14 +1606,12 @@ ) ) ) - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () (nav-graph-editor-method-29 self "Dest node/pos" "" "Cancel") (nav-graph-editor-method-28 self) (nav-graph-editor-method-38 self) - (none) ) ) @@ -1631,15 +1623,12 @@ (nav-graph-editor-method-43 obj) (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) (cond - ((logtest? (-> *mouse* button0-rel 0) (mouse-buttons left)) + ((mouse-pressed? left) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) (go (method-of-object obj create-edge)) ) - ((and (logtest? (-> *mouse* button0-rel 0) (mouse-buttons right)) - (>= (-> obj selected-index) 0) - (not (-> obj selected-node-edge?)) - ) + ((and (mouse-pressed? right) (>= (-> obj selected-index) 0) (not (-> obj selected-node-edge?))) ) (else (nav-graph-editor-method-59 obj) @@ -1654,14 +1643,12 @@ :enter (behavior () (set! (-> self edge-src) -1) (set! (-> self edge-dst) -1) - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () (nav-graph-editor-method-29 self "Create edge" "" "Delete edge") (nav-graph-editor-method-28 self) (nav-graph-editor-method-37 self) - (none) ) ) @@ -1669,11 +1656,9 @@ :virtual #t :enter (behavior () (set! (-> self edge-visibility) (-> self selected-index)) - (none) ) :exit (behavior () (set! (-> self edge-visibility) -1) - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1685,23 +1670,22 @@ (nav-graph-editor-method-42 self) (nav-graph-editor-method-32 self (-> self selected-node-edge?) (-> self selected-index)) (cond - ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons left)) (>= (-> self selected-index) 0)) + ((and (mouse-hold? left) (>= (-> self selected-index) 0)) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) (nav-graph-editor-method-53 self (-> self edge-visibility) (-> self selected-index)) ) - ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons middle)) (>= (-> self selected-index) 0)) + ((and (mouse-hold? middle) (>= (-> self selected-index) 0)) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons middle)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons middle)) (nav-graph-editor-method-57 self (-> self edge-visibility) (-> self selected-index)) ) - ((logtest? (-> *mouse* button0-abs 0) (mouse-buttons right)) + ((mouse-hold? right) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) (go-virtual adjust-minimap) ) ) - (none) ) ) @@ -1709,7 +1693,6 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1727,7 +1710,6 @@ ) ) ) - (none) ) ) @@ -1735,7 +1717,6 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1756,7 +1737,6 @@ (nav-graph-editor-method-31 self (-> self selected-index)) ) ) - (none) ) ) @@ -1764,7 +1744,6 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1785,7 +1764,6 @@ (nav-graph-editor-method-33 self (-> self selected-index)) ) ) - (none) ) ) @@ -1793,7 +1771,6 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1818,7 +1795,6 @@ ) ) ) - (none) ) ) @@ -1836,21 +1812,18 @@ ) ) (cond - ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons left)) (>= (-> obj selected-index) 0)) + ((and (mouse-hold? left) (>= (-> obj selected-index) 0)) (if (-> obj selected-node-edge?) (go (method-of-object obj adjust-node-angle)) ) ) - ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons right)) (>= (-> obj selected-index) 0)) + ((and (mouse-hold? right) (>= (-> obj selected-index) 0)) (if (-> obj selected-node-edge?) (go (method-of-object obj adjust-node-radius)) (go (method-of-object obj adjust-edge-width)) ) ) - ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons middle)) - (>= (-> obj selected-index) 0) - (not (-> obj selected-node-edge?)) - ) + ((and (mouse-hold? middle) (>= (-> obj selected-index) 0) (not (-> obj selected-node-edge?))) (go (method-of-object obj adjust-edge-density)) ) (else @@ -1865,7 +1838,6 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1882,7 +1854,6 @@ ) (nav-graph-editor-method-28 self) (nav-graph-editor-method-39 self) - (none) ) ) @@ -1896,12 +1867,12 @@ (nav-graph-editor-method-30 obj (-> obj selected-index)) ) (cond - ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons left)) (>= (-> obj selected-index) 0)) + ((and (mouse-hold? left) (>= (-> obj selected-index) 0)) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) (go (method-of-object obj adjust-edge-visibility)) ) - ((logtest? (-> *mouse* button0-abs 0) (mouse-buttons right)) + ((mouse-hold? right) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) (go (method-of-object obj draw-closest-minimap)) @@ -1918,14 +1889,12 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () (nav-graph-editor-method-29 self "Edge visibility" "" "Closest Node/Edge") (nav-graph-editor-method-28 self) (nav-graph-editor-method-40 self) - (none) ) ) @@ -1933,7 +1902,6 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1974,7 +1942,7 @@ ) ) (cond - ((logtest? (-> *mouse* button0-abs 0) (mouse-buttons right)) + ((mouse-hold? right) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) (go-virtual adjust-minimap) @@ -1984,10 +1952,10 @@ (nav-graph-editor-method-46 self) ) ) - (none) ) ) +;; WARN: Return type mismatch object vs none. (defmethod nav-graph-editor-method-36 nav-graph-editor ((obj nav-graph-editor)) (nav-graph-editor-method-41 obj) (nav-graph-editor-method-34 obj) @@ -1995,20 +1963,17 @@ (nav-graph-editor-method-43 obj) (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) (cond - ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons left)) - (>= (-> obj selected-index) 0) - (-> obj selected-node-edge?) - ) + ((and (mouse-hold? left) (>= (-> obj selected-index) 0) (-> obj selected-node-edge?)) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) (go (method-of-object obj move-node)) ) - ((logtest? (-> *mouse* button0-abs 0) (mouse-buttons right)) + ((mouse-hold? right) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) (go (method-of-object obj create-edge)) ) - ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons middle)) (>= (-> obj selected-index) 0)) + ((and (mouse-hold? middle) (>= (-> obj selected-index) 0)) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons middle)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons middle)) (if (-> obj selected-node-edge?) @@ -2028,14 +1993,12 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () (nav-graph-editor-method-29 self "Move node" "Delete node/edge" "Create edge(s)") (nav-graph-editor-method-28 self) (nav-graph-editor-method-36 self) - (none) ) ) diff --git a/goal_src/jak2/engine/debug/part-tester.gc b/goal_src/jak2/engine/debug/part-tester.gc index e4a5be52d0f..9ece1559f44 100644 --- a/goal_src/jak2/engine/debug/part-tester.gc +++ b/goal_src/jak2/engine/debug/part-tester.gc @@ -100,7 +100,6 @@ (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/engine/debug/viewer.gc b/goal_src/jak2/engine/debug/viewer.gc index 240f221b7ee..82b073c7c4e 100644 --- a/goal_src/jak2/engine/debug/viewer.gc +++ b/goal_src/jak2/engine/debug/viewer.gc @@ -50,7 +50,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior viewer) ja-post) ) @@ -206,6 +205,7 @@ (none) ) +;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! viewer ((obj viewer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: @@ -271,5 +271,5 @@ This commonly includes things such as: (defun birth-viewer ((arg0 process) (arg1 entity-actor)) (set! (-> arg0 type) viewer) (init-entity arg0 arg1 viewer) - (the-as object #t) + #t ) diff --git a/goal_src/jak2/engine/entity/entity.gc b/goal_src/jak2/engine/entity/entity.gc index e85a43bfe39..d0df3af5afa 100644 --- a/goal_src/jak2/engine/entity/entity.gc +++ b/goal_src/jak2/engine/entity/entity.gc @@ -1036,18 +1036,19 @@ (set! (-> gp-0 pid) (string->int *pid-string*)) ) ) - (let ((gp-1 (lambda ((arg0 process)) - (let ((v1-0 *debug-actor-info*)) - (if (= (-> arg0 pid) (-> v1-0 pid)) - (set! (-> v1-0 handle) (process->handle arg0)) + (let ((gp-1 (lambda ((arg0 process)) (let ((v1-0 *debug-actor-info*)) + (when (= (-> arg0 pid) (-> v1-0 pid)) + (let ((v0-0 (process->handle arg0))) + (set! (-> v1-0 handle) (the-as handle v0-0)) + v0-0 + ) + ) + ) ) - ) - (none) - ) ) ) - (iterate-process-tree *pusher-pool* (the-as (function object object) gp-1) *null-kernel-context*) - (iterate-process-tree *entity-pool* (the-as (function object object) gp-1) *null-kernel-context*) + (iterate-process-tree *pusher-pool* gp-1 *null-kernel-context*) + (iterate-process-tree *entity-pool* gp-1 *null-kernel-context*) ) ) (else @@ -1226,8 +1227,8 @@ (cond ((= sv-16 'process) (let ((s5-1 draw-actor-marks)) - (iterate-process-tree *pusher-pool* (the-as (function object object) s5-1) *null-kernel-context*) - (iterate-process-tree *entity-pool* (the-as (function object object) s5-1) *null-kernel-context*) + (iterate-process-tree *pusher-pool* s5-1 *null-kernel-context*) + (iterate-process-tree *entity-pool* s5-1 *null-kernel-context*) ) ) (else @@ -1443,17 +1444,14 @@ (if (or *display-path-marks* *display-vol-marks*) (iterate-process-tree *active-pool* - (the-as (function object object) (lambda ((arg0 process-drawable)) - (when (type? arg0 process-drawable) - (if (nonzero? (-> arg0 path)) - (debug-draw (-> arg0 path)) - ) - (if (nonzero? (-> arg0 vol)) - (debug-draw (-> arg0 vol)) - ) - ) - (none) - ) + (lambda ((arg0 process-drawable)) (when (type? arg0 process-drawable) + (if (nonzero? (-> arg0 path)) + (debug-draw (-> arg0 path)) + ) + (if (nonzero? (-> arg0 vol)) + (debug-draw (-> arg0 vol)) + ) + ) ) *null-kernel-context* ) @@ -1883,23 +1881,21 @@ ) (let ((v1-23 (-> obj level heap base)) (a0-7 (-> obj level heap top-base)) - (s5-2 (lambda ((arg0 process)) - (check-for-rougue-process - arg0 - (-> *kernel-context* relocating-min) - (-> *kernel-context* relocating-max) - (-> *kernel-context* relocating-level) - ) - (none) - ) + (s5-2 (lambda ((arg0 process)) (check-for-rougue-process + arg0 + (-> *kernel-context* relocating-min) + (-> *kernel-context* relocating-max) + (-> *kernel-context* relocating-level) + ) + ) ) ) (set! (-> *kernel-context* relocating-min) (the-as int v1-23)) (set! (-> *kernel-context* relocating-max) (the-as int a0-7)) (set! (-> *kernel-context* relocating-level) (-> obj level)) - (iterate-process-tree *pusher-pool* (the-as (function object object) s5-2) *null-kernel-context*) - (iterate-process-tree *entity-pool* (the-as (function object object) s5-2) *null-kernel-context*) - (iterate-process-tree *default-pool* (the-as (function object object) s5-2) *null-kernel-context*) + (iterate-process-tree *pusher-pool* s5-2 *null-kernel-context*) + (iterate-process-tree *entity-pool* s5-2 *null-kernel-context*) + (iterate-process-tree *default-pool* s5-2 *null-kernel-context*) ) (let ((s5-3 (-> obj nav-meshes))) (when (nonzero? s5-3) @@ -2012,16 +2008,14 @@ ) ) ) - (let ((s5-1 (lambda ((arg0 process)) - (if (not (logtest? (-> arg0 mask) (process-mask no-kill))) - (deactivate arg0) - ) - (none) - ) + (let ((s5-1 (lambda ((arg0 process)) (if (not (logtest? (-> arg0 mask) (process-mask no-kill))) + (deactivate arg0) + ) + ) ) ) - (iterate-process-tree *pusher-pool* (the-as (function object object) s5-1) *null-kernel-context*) - (iterate-process-tree *entity-pool* (the-as (function object object) s5-1) *null-kernel-context*) + (iterate-process-tree *pusher-pool* s5-1 *null-kernel-context*) + (iterate-process-tree *entity-pool* s5-1 *null-kernel-context*) ) (if #t (task-node-reset arg0) diff --git a/goal_src/jak2/engine/game/game-save.gc b/goal_src/jak2/engine/game/game-save.gc index 67c39081422..b3c9e6d67aa 100644 --- a/goal_src/jak2/engine/game/game-save.gc +++ b/goal_src/jak2/engine/game/game-save.gc @@ -1808,7 +1808,6 @@ auto-save-post ) (format #t "got buffer #x~X~%" (-> self buffer base)) (go-virtual get-card) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) @@ -1863,7 +1862,6 @@ auto-save-post (go-virtual done) ) ) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) @@ -1908,7 +1906,6 @@ auto-save-post ) ) (go-virtual done) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) @@ -1941,7 +1938,6 @@ auto-save-post ) (label cfg-10) (go-virtual done) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) @@ -1999,7 +1995,6 @@ auto-save-post ) ) (go-virtual done) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) @@ -2064,15 +2059,14 @@ auto-save-post #f (label cfg-18) (go-virtual done) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) (defstate restore (auto-save) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('progress-allowed?) #t ) @@ -2147,23 +2141,21 @@ auto-save-post (apply-settings *setting-control*) (sleep-code) (go-virtual done) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) (defstate error (auto-save) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('progress-allowed?) - #t - ) - (('die) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('progress-allowed?) + #t + ) + (('die) + (deactivate self) + ) + ) ) :code (behavior ((arg0 mc-status-code)) (if (-> self buffer) @@ -2259,7 +2251,6 @@ auto-save-post ) ) ) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) @@ -2291,7 +2282,6 @@ auto-save-post (mem-copy! (the-as pointer gp-0) (the-as pointer (-> self info)) 300) (send-event (handle->process (-> self notify)) 'notify 'done (mc-status-code ok) gp-0) ) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) diff --git a/goal_src/jak2/engine/game/task/task-arrow.gc b/goal_src/jak2/engine/game/task/task-arrow.gc index 07a98c37b47..ffec2de9194 100644 --- a/goal_src/jak2/engine/game/task/task-arrow.gc +++ b/goal_src/jak2/engine/game/task/task-arrow.gc @@ -187,11 +187,11 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" (defstate idle (task-arrow) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-2 object)) - (case event-type + (case message (('set-position) - (let ((a0-3 (the-as object (-> event param 0)))) + (let ((a0-3 (the-as object (-> block param 0)))) (set! (-> self pos quad) (-> (the-as vector a0-3) quad)) ) (if (logtest? (-> self flags) (task-arrow-flags task-arrow-flag-03)) @@ -212,8 +212,8 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" ) ) (('modify-flags) - (let ((v1-16 (-> event param 0)) - (a1-3 (-> event param 1)) + (let ((v1-16 (-> block param 0)) + (a1-3 (-> block param 1)) ) (set! v0-2 (logior (logclear (-> self flags) a1-3) v1-16)) ) @@ -222,7 +222,7 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" ) (('map-icon) (kill-callback (-> *minimap* engine) (-> self minimap)) - (let ((a2-1 (-> event param 0))) + (let ((a2-1 (-> block param 0))) (set! (-> self map-icon) a2-1) (set! v0-2 (add-icon! *minimap* self a2-1 (the-as int #f) (the-as vector #t) 0)) ) @@ -237,7 +237,6 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" :code (the-as (function none :behavior task-arrow) sleep-code) :post (behavior () (draw-arrow self) - (none) ) ) @@ -249,11 +248,9 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" (suspend) ) (cleanup-for-death self) - (none) ) :post (behavior () (draw-arrow self) - (none) ) ) @@ -261,7 +258,6 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak2/engine/game/task/task-control.gc b/goal_src/jak2/engine/game/task/task-control.gc index 2c4f57ab14c..cef814c1a06 100644 --- a/goal_src/jak2/engine/game/task/task-control.gc +++ b/goal_src/jak2/engine/game/task/task-control.gc @@ -1546,8 +1546,8 @@ (defstate idle (fail-mission) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('reset) (cond ((logtest? (-> self flags) (fail-mission-flags famflags-1)) @@ -1562,7 +1562,7 @@ ) ) (('query) - (case (-> event param 0) + (case (-> block param 0) (('reset) (logtest? (-> self flags) (fail-mission-flags famflags-1)) ) @@ -1575,7 +1575,6 @@ (update-rates! (-> *display* entity-clock) 1.0) (update-rates! (-> *display* target-clock) 1.0) (update-rates! (-> *display* camera-clock) 1.0) - (none) ) :code (behavior () (when (and *target* (focus-test? *target* dead)) @@ -1681,7 +1680,6 @@ #f ) ) - (none) ) ) @@ -1699,31 +1697,28 @@ (defstate resetting (fail-mission) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('reset) - #t - ) - (('query) - (case (-> event param 0) - (('reset) - #t - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('reset) + #t + ) + (('query) + (case (-> block param 0) + (('reset) + #t + ) + ) + ) + ) ) :enter (behavior () '() - (none) ) :exit (behavior () (if (= *master-mode* 'freeze) (set-master-mode 'game) ) (process-release? *target*) - (none) ) :code (behavior () (local-vars (a1-10 string)) @@ -1789,7 +1784,6 @@ (persist-with-delay *setting-control* 'speech-control (seconds 3) 'speech-control #f 0.0 0) (persist-with-delay *setting-control* 'music-volume (seconds 3) 'music-volume 'abs 0.0 0) (persist-with-delay *setting-control* 'sfx-volume (seconds 3) 'music-volume 'abs 0.0 0) - (none) ) ) @@ -2134,7 +2128,6 @@ ) (deactivate self) ) - (none) ) :code (behavior () (while (or (not *target*) (not *spawn-actors*)) @@ -2161,7 +2154,6 @@ ) ) (go-virtual active) - (none) ) ) @@ -2175,7 +2167,6 @@ (t9-1) ) ) - (none) ) :code (behavior () (let ((t9-0 (-> self info code-hook))) @@ -2192,7 +2183,6 @@ (suspend) ) #f - (none) ) ;; og:preserve-this added this so we can see it during the code-hook :post (behavior () @@ -2244,7 +2234,6 @@ (while (-> self child) (suspend) ) - (none) ) ) @@ -2253,7 +2242,6 @@ :event task-manager-event-handler :exit (behavior () (disable *screen-filter*) - (none) ) :code (behavior () (while (not (-> self allow-fail)) @@ -2342,7 +2330,6 @@ ) ) ) - (none) ) ) @@ -2387,6 +2374,5 @@ ) ) ) - (none) ) ) diff --git a/goal_src/jak2/engine/gfx/mood/time-of-day.gc b/goal_src/jak2/engine/gfx/mood/time-of-day.gc index 3ed04234c33..5ad884af3f1 100644 --- a/goal_src/jak2/engine/gfx/mood/time-of-day.gc +++ b/goal_src/jak2/engine/gfx/mood/time-of-day.gc @@ -9,13 +9,11 @@ ;; DECOMP BEGINS -;; definition for method 5 of type time-of-day-palette ;; WARN: Return type mismatch uint vs int. (defmethod asize-of time-of-day-palette ((obj time-of-day-palette)) (the-as int (+ (-> obj type size) (* (* (-> obj height) (-> obj width)) 4))) ) -;; definition for method 10 of type time-of-day-proc (defmethod deactivate time-of-day-proc ((obj time-of-day-proc)) (if (nonzero? (-> obj sun)) (kill-and-free-particles (-> obj sun)) @@ -30,14 +28,10 @@ (none) ) -;; failed to figure out what this is: (if (zero? time-of-day-effect) (set! time-of-day-effect nothing) ) -;; definition for function time-of-day-update -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defbehavior time-of-day-update time-of-day-proc () (time-of-day-effect) (let ((gp-0 #t)) @@ -124,8 +118,6 @@ (none) ) - -;; definition for function update-counters (defbehavior update-counters time-of-day-proc () (let ((v1-2 (-> *display* bg-clock frame-counter))) 0 @@ -151,84 +143,81 @@ ) (defstate time-of-day-tick (time-of-day-proc) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('change) - (case (-> event param 0) - (('ratio) - (let ((a0-5 (-> *display* bg-clock)) - (f0-0 (the-as float (-> event param 1))) - ) - (set! (-> self time-ratio) f0-0) - (set! (-> self dest-time-ratio) f0-0) - (update-rates! a0-5 f0-0) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('change) + (case (-> block param 0) + (('ratio) + (let ((a0-5 (-> *display* bg-clock)) + (f0-0 (the-as float (-> block param 1))) + ) + (set! (-> self time-ratio) f0-0) + (set! (-> self dest-time-ratio) f0-0) + (update-rates! a0-5 f0-0) ) - (('hour) - (update-counters) - (let ((v1-7 (-> *display* bg-clock frame-counter)) - (a0-7 #x69780) - (a1-5 (/ (the int (* 1080000.0 (the float (-> event param 1)))) 60)) - ) - (set! (-> *display* bg-clock frame-counter) (+ (- v1-7 (the-as time-frame (mod v1-7 a0-7))) a0-7 a1-5)) - ) - (update-counters) - (-> self hours) - (kill-and-free-particles (-> self sun)) - (spawn (-> self sun) (math-camera-pos)) - (set! (-> self sun-count) 1) - (kill-and-free-particles (-> self green-sun)) - (spawn (-> self green-sun) (math-camera-pos)) - (set! (-> self green-sun-count) 1) - (kill-and-free-particles (-> self moon)) - (spawn (-> self moon) (math-camera-pos)) - (let ((v0-0 (the-as number 1))) - (set! (-> self moon-count) (the-as int v0-0)) - v0-0 - ) + ) + (('hour) + (update-counters) + (let ((v1-7 (-> *display* bg-clock frame-counter)) + (a0-7 #x69780) + (a1-5 (/ (the int (* 1080000.0 (the float (-> block param 1)))) 60)) + ) + (set! (-> *display* bg-clock frame-counter) (+ (- v1-7 (the-as time-frame (mod v1-7 a0-7))) a0-7 a1-5)) ) - ) - ) - (('ratio) - (-> self time-ratio) - ) - (('day-length) - (if (= (-> self time-ratio) 0.0) - 0 - (/ 25920000.0 (-> self time-ratio)) - ) - ) - (('time-frame) - (-> self frames) - ) - (('time-of-day) - (-> self time-of-day) - ) - (('time-of-day-norm) - (* 0.041666668 (-> self time-of-day)) - ) - (('hour) - (-> self hours) - ) - (('minute) - (-> self minutes) - ) - (('second) - (-> self seconds) + (update-counters) + (-> self hours) + (kill-and-free-particles (-> self sun)) + (spawn (-> self sun) (math-camera-pos)) + (set! (-> self sun-count) 1) + (kill-and-free-particles (-> self green-sun)) + (spawn (-> self green-sun) (math-camera-pos)) + (set! (-> self green-sun-count) 1) + (kill-and-free-particles (-> self moon)) + (spawn (-> self moon) (math-camera-pos)) + (let ((v0-0 (the-as number 1))) + (set! (-> self moon-count) (the-as int v0-0)) + v0-0 + ) + ) ) - (('dest-clock-ratio-set) - (set! (-> self dest-time-ratio) (the-as float (-> event param 0))) - (let ((f0-12 (-> self time-ratio)) - (f1-5 (-> self dest-time-ratio)) - (f2-1 (/ 300.0 (the float (-> event param 1)))) - ) - (set! (-> self dest-time-delta) (* (fabs (- f0-12 f1-5)) f2-1 (-> *display* real-clock seconds-per-frame))) + ) + (('ratio) + (-> self time-ratio) + ) + (('day-length) + (if (= (-> self time-ratio) 0.0) + 0 + (/ 25920000.0 (-> self time-ratio)) ) - (-> self dest-time-ratio) + ) + (('time-frame) + (-> self frames) + ) + (('time-of-day) + (-> self time-of-day) + ) + (('time-of-day-norm) + (* 0.041666668 (-> self time-of-day)) + ) + (('hour) + (-> self hours) + ) + (('minute) + (-> self minutes) + ) + (('second) + (-> self seconds) + ) + (('dest-clock-ratio-set) + (set! (-> self dest-time-ratio) (the-as float (-> block param 0))) + (let ((f0-12 (-> self time-ratio)) + (f1-5 (-> self dest-time-ratio)) + (f2-1 (/ 300.0 (the float (-> block param 1)))) + ) + (set! (-> self dest-time-delta) (* (fabs (- f0-12 f1-5)) f2-1 (-> *display* real-clock seconds-per-frame))) ) - ) + (-> self dest-time-ratio) + ) ) ) :code (behavior () @@ -244,12 +233,10 @@ (suspend) ) #f - (none) ) :post time-of-day-update ) -;; definition for function init-time-of-day (defbehavior init-time-of-day time-of-day-proc () (stack-size-set! (-> self main-thread) 128) (set! (-> self hours) 0) @@ -275,7 +262,6 @@ (go time-of-day-tick) ) -;; definition for function start-time-of-day ;; WARN: Return type mismatch (pointer time-of-day-proc) vs (pointer process). (defun start-time-of-day () (kill-by-name "time-of-day-proc" *active-pool*) @@ -283,7 +269,6 @@ (the-as (pointer process) *time-of-day*) ) -;; definition for function time-of-day-setup (defun time-of-day-setup ((arg0 symbol)) (when arg0 (when (= (-> *time-of-day* 0 time-ratio) 0.0) @@ -298,13 +283,10 @@ (!= (-> *time-of-day* 0 time-ratio) 0.0) ) -;; definition for function time-of-day-interp-colors ;; ERROR: function was not converted to expressions. Cannot decompile. -;; definition for function time-of-day-interp-colors-scratch ;; ERROR: function was not converted to expressions. Cannot decompile. -;; definition for function init-time-of-day-context (defun init-time-of-day-context ((arg0 time-of-day-context)) (set-vector! (-> arg0 title-light-group dir0 color) 0.82 0.82 0.82 1.0) (set-vector! (-> arg0 title-light-group dir1 color) 2.0 2.0 2.0 1.0) @@ -333,15 +315,12 @@ ) ) -;; definition for function set-filter-color! -;; WARN: Return type mismatch int vs none. (defun set-filter-color! ((arg0 float) (arg1 float) (arg2 float)) (set-vector! (-> *time-of-day-context* filter-color) arg0 arg1 arg2 1.0) 0 (none) ) -;; definition for function tod-madd! (defun tod-madd! ((arg0 vector) (arg1 vector) (arg2 vector)) (local-vars (v0-0 float)) (rlet ((acc :class vf) @@ -362,7 +341,6 @@ ) ) -;; definition for function update-environment-colors (defun update-environment-colors ((arg0 time-of-day-context)) (let* ((v1-0 (-> arg0 light-group)) (s4-0 (-> v1-0 0 ambi color)) @@ -399,9 +377,6 @@ ) ) -;; definition for function update-time-of-day -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defun update-time-of-day ((arg0 time-of-day-context)) (with-pp (set! (-> arg0 exterior-level) #f) @@ -649,7 +624,6 @@ ) ) -;; definition for function calc-fade-from-fog (defun calc-fade-from-fog ((arg0 vector)) (let* ((f0-0 (vector-vector-distance (math-camera-pos) arg0)) (v1-1 (-> *time-of-day-context* current-fog)) @@ -662,8 +636,6 @@ ) ) -;; definition for method 10 of type palette-fade-controls -;; INFO: Used lq/sq (defmethod set-fade! palette-fade-controls ((obj palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) (cond ((and (>= arg0 0) (< arg0 8)) @@ -683,8 +655,6 @@ ) ) -;; definition for method 9 of type palette-fade-controls -;; WARN: Return type mismatch int vs none. (defmethod reset! palette-fade-controls ((obj palette-fade-controls)) (countdown (v1-0 8) (let ((a1-2 (-> obj control v1-0))) @@ -696,5 +666,4 @@ (none) ) -;; failed to figure out what this is: (start-time-of-day) diff --git a/goal_src/jak2/engine/nav/nav-enemy.gc b/goal_src/jak2/engine/nav/nav-enemy.gc index 0f0f337212c..629f47131fa 100644 --- a/goal_src/jak2/engine/nav/nav-enemy.gc +++ b/goal_src/jak2/engine/nav/nav-enemy.gc @@ -25,35 +25,27 @@ ) ) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 7] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 15] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 23] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 33] (defmethod general-event-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'nav-mesh-kill) - (deactivate obj) - #t - ) - ((= v1-0 'nav-mesh-new) - (set! (-> obj water-max-height) (-> obj nav state mesh water-max-height)) - #t - ) - ((= v1-0 'debug-control-on) - (go (method-of-object obj debug-control)) - ) - ((= v1-0 'debug-control-off) - (react-to-focus obj) - ) - (else - ((method-of-type enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) - ) + (case arg2 + (('nav-mesh-kill) + (deactivate obj) + #t + ) + (('nav-mesh-new) + (set! (-> obj water-max-height) (-> obj nav state mesh water-max-height)) + #t + ) + (('debug-control-on) + (go (method-of-object obj debug-control)) + ) + (('debug-control-off) + (react-to-focus obj) + ) + (else + ((method-of-type enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) ) ) @@ -950,6 +942,7 @@ (none) ) +;; WARN: Return type mismatch object vs none. (defmethod nav-enemy-method-160 nav-enemy ((obj nav-enemy)) (let ((s5-0 (handle->process (-> obj focus handle)))) (cond @@ -1481,13 +1474,11 @@ This commonly includes things such as: (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-stare2 nav-enemy ((obj nav-enemy)) (if (!= (-> obj enemy-info taunt-anim) -1) (go (method-of-object obj taunt)) ) (go (method-of-object obj stare)) - (none) ) (defmethod go-stare nav-enemy ((obj nav-enemy)) @@ -1509,7 +1500,6 @@ This commonly includes things such as: ) ) ) - (none) ) (defmethod go-hostile nav-enemy ((obj nav-enemy)) @@ -1519,13 +1509,10 @@ This commonly includes things such as: (go-stare2 obj) (go (method-of-object obj hostile)) ) - (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-flee nav-enemy ((obj nav-enemy)) (go (method-of-object obj flee)) - (none) ) (define *nav-enemy-debug-control-info* (new 'static 'nav-enemy-debug-control-info)) @@ -1586,7 +1573,6 @@ This commonly includes things such as: ) 0 (nav-enemy-method-167 self) - (none) ) ) @@ -1609,7 +1595,6 @@ This commonly includes things such as: ) 0 (nav-enemy-method-167 self) - (none) ) ) @@ -1643,7 +1628,6 @@ This commonly includes things such as: ) 0 (nav-enemy-method-165 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1737,7 +1721,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post nav-enemy-patrol-post ) @@ -1779,7 +1762,6 @@ This commonly includes things such as: (set! (-> v1-19 target-speed) 0.0) ) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1807,7 +1789,6 @@ This commonly includes things such as: ) ) (react-to-focus self) - (none) ) :post nav-enemy-simple-post ) @@ -1834,7 +1815,6 @@ This commonly includes things such as: (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-9 enemy-flags)))) ) 0 - (none) ) :trans (behavior () (nav-enemy-method-160 self) @@ -1868,7 +1848,6 @@ This commonly includes things such as: ) ) ) - (none) ) :post nav-enemy-chase-post ) @@ -1905,7 +1884,6 @@ This commonly includes things such as: ) 0 (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (nav-enemy-method-160 self) @@ -1937,7 +1915,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1950,7 +1927,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post nav-enemy-chase-post ) @@ -1981,7 +1957,6 @@ This commonly includes things such as: (nav-enemy-method-167 self) (vector-reset! (-> self root transv)) (set! (-> self starting-time) (current-time)) - (none) ) :exit (behavior () (rlet ((acc :class vf) @@ -2031,7 +2006,6 @@ This commonly includes things such as: ) 0 ) - (none) ) ) :trans (behavior () @@ -2071,7 +2045,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2090,7 +2063,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post nav-enemy-stare-post ) @@ -2109,7 +2081,6 @@ This commonly includes things such as: ) (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) ) - (none) ) :exit (-> (method-of-type nav-enemy stare) exit) :trans (behavior () @@ -2125,7 +2096,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2161,7 +2131,6 @@ This commonly includes things such as: ) ) (go-virtual stare) - (none) ) :post nav-enemy-stare-post ) @@ -2200,7 +2169,6 @@ This commonly includes things such as: ) (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) ) - (none) ) :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -2266,7 +2234,6 @@ This commonly includes things such as: ) (go-stare2 self) ) - (none) ) :code (behavior () (let ((f30-0 (get-rand-float-range self 0.9 1.1)) @@ -2289,7 +2256,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -2301,7 +2267,6 @@ This commonly includes things such as: ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -2345,7 +2310,6 @@ This commonly includes things such as: (set! (-> self enemy-flags) (the-as enemy-flag (logxor (shl 256 32) (the-as int (-> self enemy-flags))))) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag enemy-flag41)))) (set! (-> self starting-time) (current-time)) - (none) ) :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -2380,7 +2344,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (let ((f30-0 (get-rand-float-range self 0.9 1.1)) @@ -2403,7 +2366,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((a0-0 self)) @@ -2442,7 +2404,6 @@ This commonly includes things such as: ) ) (nav-enemy-travel-post) - (none) ) ) @@ -2468,7 +2429,6 @@ This commonly includes things such as: (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-9 enemy-flags)))) ) 0 - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) @@ -2481,7 +2441,6 @@ This commonly includes things such as: (go-stare2 self) ) ) - (none) ) :post nav-enemy-flee-post ) @@ -2506,7 +2465,6 @@ This commonly includes things such as: ) 0 (vector-reset! (-> self root transv)) - (none) ) :post nav-enemy-simple-post ) @@ -2530,7 +2488,6 @@ This commonly includes things such as: (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-9 enemy-flags)))) ) 0 - (none) ) :code (behavior () (local-vars (v1-37 enemy-flag) (v1-45 enemy-flag)) @@ -2577,7 +2534,6 @@ This commonly includes things such as: (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (go-hostile self) - (none) ) :post nav-enemy-simple-post ) @@ -2600,7 +2556,6 @@ This commonly includes things such as: (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-9 enemy-flags)))) ) 0 - (none) ) :post nav-enemy-falling-post ) @@ -2624,7 +2579,6 @@ This commonly includes things such as: ) 0 (nav-enemy-method-167 self) - (none) ) :post nav-enemy-simple-post ) @@ -2648,7 +2602,6 @@ This commonly includes things such as: ) 0 (nav-enemy-method-167 self) - (none) ) :post nav-enemy-die-falling-post ) @@ -2696,7 +2649,6 @@ This commonly includes things such as: ) 0 (logclear! (-> self nav state flags) (nav-state-flag at-gap)) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type enemy jump) exit))) @@ -2708,7 +2660,6 @@ This commonly includes things such as: (logclear! (-> v1-4 shape nav-flags) (nav-flags has-extra-sphere)) ) 0 - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'enemy-jump-info))) @@ -2797,7 +2748,6 @@ This commonly includes things such as: ) ) (enemy-method-93 self) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -2816,7 +2766,6 @@ This commonly includes things such as: ) ) ) - (none) ) ) @@ -2838,7 +2787,6 @@ This commonly includes things such as: ) 0 (nav-enemy-method-167 self) - (none) ) :post nav-enemy-simple-post ) @@ -2849,7 +2797,6 @@ This commonly includes things such as: :enter (behavior () (logior! (-> self enemy-flags) (enemy-flag victory)) ((-> (method-of-type nav-enemy idle) enter)) - (none) ) :code (-> (method-of-type nav-enemy idle) code) :post (-> (method-of-type nav-enemy idle) post) @@ -2869,7 +2816,6 @@ This commonly includes things such as: ) 0 ) - (none) ) ) @@ -2899,7 +2845,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post nav-enemy-debug-control-post ) diff --git a/goal_src/jak2/engine/physics/rigid-body-h.gc b/goal_src/jak2/engine/physics/rigid-body-h.gc index 513f4687ff3..d465fcf1b8d 100644 --- a/goal_src/jak2/engine/physics/rigid-body-h.gc +++ b/goal_src/jak2/engine/physics/rigid-body-h.gc @@ -236,7 +236,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod rigid-body-control-method-10 rigid-body-control ((obj rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) - (the-as object (rigid-body-method-10 (-> obj state))) + (rigid-body-method-10 (-> obj state)) ) (defmethod rigid-body-control-method-11 rigid-body-control ((obj rigid-body-control) (arg0 collide-shape-moving)) diff --git a/goal_src/jak2/engine/physics/rigid-body-queue.gc b/goal_src/jak2/engine/physics/rigid-body-queue.gc index 8dd648b37cb..a83e1fa92d8 100644 --- a/goal_src/jak2/engine/physics/rigid-body-queue.gc +++ b/goal_src/jak2/engine/physics/rigid-body-queue.gc @@ -235,7 +235,6 @@ :exit (behavior () (set! (-> self queue count) 0) 0 - (none) ) :code (the-as (function none :behavior rigid-body-queue-manager) sleep-code) :post (behavior () @@ -271,7 +270,6 @@ ) (label cfg-4) 0 - (none) ) ) diff --git a/goal_src/jak2/engine/physics/rigid-body.gc b/goal_src/jak2/engine/physics/rigid-body.gc index e6f32d183d1..253dba12b59 100644 --- a/goal_src/jak2/engine/physics/rigid-body.gc +++ b/goal_src/jak2/engine/physics/rigid-body.gc @@ -850,7 +850,7 @@ ) ) ) - (the-as object 0) + 0 ) (defmethod rigid-body-method-11 rigid-body ((obj rigid-body) (arg0 collide-shape-moving)) @@ -1287,133 +1287,124 @@ This commonly includes things such as: #t ) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 74] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 95] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 140] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 202] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 243] (defmethod rigid-body-object-method-46 rigid-body-object ((obj rigid-body-object) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (case arg2 - (('impact-impulse) - (let ((s5-1 (-> arg3 param 0))) - (if (!= obj arg0) - (rigid-body-object-method-42 obj) - ) - (rigid-body-object-method-45 obj (the-as rigid-body-impact s5-1)) - ) - (if (and (-> obj next-state) (= (-> obj next-state name) 'idle)) - (rigid-body-object-method-43 obj) + (case arg2 + (('impact-impulse) + (let ((s5-1 (-> arg3 param 0))) + (if (!= obj arg0) + (rigid-body-object-method-42 obj) ) + (rigid-body-object-method-45 obj (the-as rigid-body-impact s5-1)) ) - (('touched) - (if (= obj *debug-actor*) - (format *stdcon* "rigid-body-object got touched~%") - ) - (when (zero? (-> arg0 rbody)) - (let ((s3-0 (if (type? arg0 process-focusable) - (the-as process-focusable arg0) - ) - ) - ) - (when s3-0 - (when (logtest? (-> s3-0 mask) (process-mask target)) - (logior! (-> obj flags) (rigid-body-object-flag player-touching)) - (set! (-> obj player-touch-time) (current-time)) - (rigid-body-object-method-42 obj) - ) - (if (not (logtest? (-> s3-0 mask) (process-mask target))) - (rigid-body-object-method-48 obj s3-0 (the-as touching-shapes-entry (-> arg3 param 0))) - ) + (if (and (-> obj next-state) (= (-> obj next-state name) 'idle)) + (rigid-body-object-method-43 obj) + ) + ) + (('touched) + (if (= obj *debug-actor*) + (format *stdcon* "rigid-body-object got touched~%") + ) + (when (zero? (-> arg0 rbody)) + (let ((s3-0 (if (type? arg0 process-focusable) + (the-as process-focusable arg0) + ) + ) + ) + (when s3-0 + (when (logtest? (-> s3-0 mask) (process-mask target)) + (logior! (-> obj flags) (rigid-body-object-flag player-touching)) + (set! (-> obj player-touch-time) (current-time)) + (rigid-body-object-method-42 obj) ) + (if (not (logtest? (-> s3-0 mask) (process-mask target))) + (rigid-body-object-method-48 obj s3-0 (the-as touching-shapes-entry (-> arg3 param 0))) + ) ) ) ) - (('attack) - (let ((s3-1 (the-as attack-info (-> arg3 param 1))) - (t0-1 (get-penetrate-using-from-attack-event arg0 arg3)) - ) - (when (!= (-> s3-1 id) (-> obj incoming-attack-id)) - (set! (-> obj incoming-attack-id) (-> s3-1 id)) - (rigid-body-object-method-47 obj arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) t0-1) + ) + (('attack) + (let ((s3-1 (the-as attack-info (-> arg3 param 1))) + (t0-1 (get-penetrate-using-from-attack-event arg0 arg3)) ) + (when (!= (-> s3-1 id) (-> obj incoming-attack-id)) + (set! (-> obj incoming-attack-id) (-> s3-1 id)) + (rigid-body-object-method-47 obj arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) t0-1) ) ) - (('edge-grabbed 'pilot-edge-grab) - (let ((s5-2 (the-as object (-> arg3 param 0)))) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) - (let ((a0-25 (if (type? arg0 process-focusable) - (the-as process-focusable arg0) - ) - ) - ) - (when a0-25 - (let ((f0-1 (/ 163840.0 (get-inv-mass a0-25)))) - (logior! (-> obj flags) (rigid-body-object-flag player-touching player-edge-grabbing player-contact-force)) - (set! (-> obj player-force-position quad) (-> (the-as attack-info s5-2) attacker-velocity quad)) - (vector-reset! (-> obj player-force)) - (set! (-> obj player-force y) (* -1.0 f0-1)) - ) + ) + (('edge-grabbed 'pilot-edge-grab) + (let ((s5-2 (the-as object (-> arg3 param 0)))) + (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) + (let ((a0-25 (if (type? arg0 process-focusable) + (the-as process-focusable arg0) + ) + ) + ) + (when a0-25 + (let ((f0-1 (/ 163840.0 (get-inv-mass a0-25)))) + (logior! (-> obj flags) (rigid-body-object-flag player-touching player-edge-grabbing player-contact-force)) + (set! (-> obj player-force-position quad) (-> (the-as attack-info s5-2) attacker-velocity quad)) + (vector-reset! (-> obj player-force)) + (set! (-> obj player-force y) (* -1.0 f0-1)) ) ) ) ) - (not (logtest? (-> obj focus-status) (focus-status dead inactive))) ) - (('ridden) - (let ((v1-45 (the-as object (-> arg3 param 0)))) - (when (the-as uint v1-45) - (let* ((s5-3 (handle->process (-> (the-as focus v1-45) handle))) - (a0-34 (if (type? s5-3 process-focusable) - (the-as process-focusable s5-3) - ) - ) - ) - (when (and a0-34 - (logtest? (-> a0-34 mask) (process-mask target)) - (not (logtest? (-> a0-34 focus-status) (focus-status on-water under-water))) - ) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) - (logior! (-> obj flags) (rigid-body-object-flag player-touching player-standing-on player-contact-force)) - (set! (-> obj player-force-position quad) (-> a0-34 root trans quad)) - (vector-reset! (-> obj player-force)) - (let ((f0-4 (/ 163840.0 (get-inv-mass a0-34))) - (f1-1 1.0) + (not (logtest? (-> obj focus-status) (focus-status dead inactive))) + ) + (('ridden) + (let ((v1-45 (the-as object (-> arg3 param 0)))) + (when (the-as uint v1-45) + (let* ((s5-3 (handle->process (-> (the-as focus v1-45) handle))) + (a0-34 (if (type? s5-3 process-focusable) + (the-as process-focusable s5-3) + ) ) - (set! (-> obj player-force y) (* -1.0 f0-4 f1-1)) - ) + ) + (when (and a0-34 + (logtest? (-> a0-34 mask) (process-mask target)) + (not (logtest? (-> a0-34 focus-status) (focus-status on-water under-water))) + ) + (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) + (logior! (-> obj flags) (rigid-body-object-flag player-touching player-standing-on player-contact-force)) + (set! (-> obj player-force-position quad) (-> a0-34 root trans quad)) + (vector-reset! (-> obj player-force)) + (let ((f0-4 (/ 163840.0 (get-inv-mass a0-34))) + (f1-1 1.0) + ) + (set! (-> obj player-force y) (* -1.0 f0-4 f1-1)) ) ) ) ) ) ) - (('bonk) - (when #t - (let ((a0-38 (if (type? arg0 process-focusable) - (the-as process-focusable arg0) - ) - ) - ) - (when a0-38 - (logior! (-> obj flags) (rigid-body-object-flag player-touching player-impulse-force)) - (set! (-> obj player-force-position quad) (-> a0-38 root trans quad)) - (let ((f30-2 (* 0.00012207031 (the-as float (-> arg3 param 1)))) - (f0-9 (/ 163840.0 (get-inv-mass a0-38))) - ) - (vector-reset! (-> obj player-force)) - (set! (-> obj player-force y) (* -0.1 f0-9 f30-2)) - ) + ) + (('bonk) + (when #t + (let ((a0-38 (if (type? arg0 process-focusable) + (the-as process-focusable arg0) + ) + ) + ) + (when a0-38 + (logior! (-> obj flags) (rigid-body-object-flag player-touching player-impulse-force)) + (set! (-> obj player-force-position quad) (-> a0-38 root trans quad)) + (let ((f30-2 (* 0.00012207031 (the-as float (-> arg3 param 1)))) + (f0-9 (/ 163840.0 (get-inv-mass a0-38))) + ) + (vector-reset! (-> obj player-force)) + (set! (-> obj player-force y) (* -0.1 f0-9 f30-2)) ) ) ) ) - (('enable-physics) - (rigid-body-object-method-42 obj) - ) - ) + ) + (('enable-physics) + (rigid-body-object-method-42 obj) + ) ) ) @@ -1432,7 +1423,6 @@ This commonly includes things such as: ) (go-virtual active) ) - (none) ) :code (the-as (function none :behavior rigid-body-object) sleep-code) :post (the-as (function none :behavior rigid-body-object) ja-post) @@ -1450,11 +1440,9 @@ This commonly includes things such as: ) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior rigid-body-object) sleep-code) :post (behavior () (rigid-body-object-method-37 self) - (none) ) ) diff --git a/goal_src/jak2/engine/process-drawable/process-drawable.gc b/goal_src/jak2/engine/process-drawable/process-drawable.gc index 3fbeadcb695..2c571d9f938 100644 --- a/goal_src/jak2/engine/process-drawable/process-drawable.gc +++ b/goal_src/jak2/engine/process-drawable/process-drawable.gc @@ -594,14 +594,13 @@ ) (defstate process-drawable-art-error (process-drawable) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('nav-mesh-kill) - (deactivate self) - #t - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('nav-mesh-kill) + (deactivate self) + #t + ) + ) ) :code (behavior ((arg0 string)) ;; og:preserve-this @@ -654,7 +653,6 @@ (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/engine/process-drawable/process-taskable.gc b/goal_src/jak2/engine/process-drawable/process-taskable.gc index cd32a964481..1df061ba38d 100644 --- a/goal_src/jak2/engine/process-drawable/process-taskable.gc +++ b/goal_src/jak2/engine/process-drawable/process-taskable.gc @@ -55,6 +55,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (none) ) +;; WARN: Return type mismatch object vs none. (defmethod process-taskable-method-37 process-taskable ((obj process-taskable)) (let ((v1-1 (-> obj draw shadow-ctrl))) (cond @@ -75,16 +76,15 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (defstate hide (process-taskable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('say) - (let ((v0-0 (current-time))) - (set! (-> self want-to-say) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('say) + (let ((v0-0 (current-time))) + (set! (-> self want-to-say) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior () (set! (-> self state-time) (current-time)) @@ -94,7 +94,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (set! (-> v1-6 prim-core collide-with) (collide-spec)) ) 0 - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) @@ -102,7 +101,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :trans (behavior () (let ((v1-1 (get-current-task-event (-> self task)))) @@ -114,15 +112,14 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (go-virtual idle) ) ) - (none) ) :code (the-as (function none :behavior process-taskable) sleep-code) ) (defstate idle (process-taskable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (if (-> self bounce-away) (send-event @@ -134,7 +131,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ) (('touch) - (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> event param 0)) 0.7 6144.0 16384.0) + (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) ) (('say) (let ((v0-0 (the-as object (current-time)))) @@ -146,11 +143,9 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :trans (behavior () (let ((gp-0 (get-current-task-event (-> self task)))) @@ -269,11 +264,9 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ) (process-taskable-method-37 self) - (none) ) :code (behavior () (process-taskable-anim-loop (the-as (function process-taskable object) true-func)) - (none) ) :post (behavior () (if (and (-> self hide-during-movie) (movie?)) @@ -284,7 +277,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (target-look-at-me! :trans (get-trans self 2)) ) (transform-post) - (none) ) ) @@ -295,7 +287,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (set! (-> self want-to-say) 0) (process-entity-status! self (entity-perm-status no-kill) #t) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (set! (-> self last-talk) (-> *display* game-clock frame-counter)) @@ -310,7 +301,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (set! (-> v1-13 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-13 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :code (behavior ((arg0 game-task-event)) (when (-> arg0 scene) @@ -330,7 +320,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ) (go-virtual hide) - (none) ) ) @@ -345,7 +334,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ) (go-virtual hide) - (none) ) :post (-> (method-of-type process-taskable idle) post) ) diff --git a/goal_src/jak2/engine/process-drawable/simple-focus.gc b/goal_src/jak2/engine/process-drawable/simple-focus.gc index ee42b5c5a94..287ed50db00 100644 --- a/goal_src/jak2/engine/process-drawable/simple-focus.gc +++ b/goal_src/jak2/engine/process-drawable/simple-focus.gc @@ -34,16 +34,15 @@ (defstate idle (simple-focus) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('move-trans) - (let ((v0-0 (-> self root trans))) - (set! (-> v0-0 quad) (-> (the-as vector (-> event param 0)) quad)) - v0-0 - ) - ) - ) - ) + :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 (the-as (function none :behavior simple-focus) sleep-code) ) diff --git a/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc b/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc index 5f435495309..415d0a1af60 100644 --- a/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc +++ b/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc @@ -23,7 +23,6 @@ ) -;; WARN: Return type mismatch object vs none. (defbehavior simple-nav-sphere-event-handler simple-nav-sphere ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (case event-type (('die-fast) @@ -44,7 +43,6 @@ #t ) ) - (none) ) (defmethod run-logic? simple-nav-sphere ((obj simple-nav-sphere)) @@ -64,10 +62,7 @@ (defstate idle (simple-nav-sphere) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior simple-nav-sphere) - simple-nav-sphere-event-handler - ) + :event simple-nav-sphere-event-handler :trans (behavior () (if *display-nav-marks* (add-debug-sphere @@ -78,17 +73,13 @@ (new 'static 'rgba :r #x80 :g #x40 :a #x80) ) ) - (none) ) :code (the-as (function none :behavior simple-nav-sphere) sleep-code) ) (defstate active (simple-nav-sphere) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior simple-nav-sphere) - simple-nav-sphere-event-handler - ) + :event simple-nav-sphere-event-handler :trans (behavior () (let ((v1-0 (ppointer->process (-> self parent))) (gp-0 (new 'stack-no-clear 'vector)) @@ -96,7 +87,6 @@ (vector<-cspace! gp-0 (-> (the-as process-drawable v1-0) node-list data (-> self track-joint))) (move-to-point! (-> self root) gp-0) ) - (none) ) :code (the-as (function none :behavior simple-nav-sphere) sleep-code) ) @@ -133,9 +123,7 @@ (set! (-> self root) s5-0) ) (logclear! (-> self mask) (process-mask actor-pause enemy)) - (set! (-> self event-hook) - (the-as (function process int symbol event-message-block object) simple-nav-sphere-event-handler) - ) + (set! (-> self event-hook) simple-nav-sphere-event-handler) (if arg2 (add-process-drawable-to-navmesh arg2 self #f) (nav-mesh-connect-from-ent self) diff --git a/goal_src/jak2/engine/scene/scene.gc b/goal_src/jak2/engine/scene/scene.gc index 5a4f303fa40..5e1790f2e18 100644 --- a/goal_src/jak2/engine/scene/scene.gc +++ b/goal_src/jak2/engine/scene/scene.gc @@ -865,7 +865,6 @@ ) ) ) - (none) ) :trans (behavior () (if (and (-> self scene) (nonzero? (-> self anim anim-name)) (not (load-in-progress? *level*))) @@ -881,7 +880,6 @@ ) ) (set! (-> *ACTOR-bank* birth-max) 1000) - (none) ) :code (behavior ((arg0 symbol)) (local-vars (v1-18 symbol) (v1-118 symbol)) @@ -1032,7 +1030,6 @@ ) ) (go-virtual play-anim) - (none) ) ) @@ -1132,14 +1129,13 @@ (if (and (-> self scene) (-> self scene save)) (auto-save-user) ) - (none) ) ) (defstate play-anim (scene-player) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('abort) (set! (-> self aborted?) #t) (set-blackout-frames (seconds 0.2)) @@ -1164,7 +1160,6 @@ (remove-setting! 'borrow) (remove-setting! 'gem) (apply-settings *setting-control*) - (none) ) :trans (behavior () (cond @@ -1197,7 +1192,6 @@ ) ) ) - (none) ) :code (behavior () (local-vars (a0-24 symbol)) @@ -1259,7 +1253,6 @@ (if (and (-> self wait) *target* (focus-test? *target* grabbed)) (go-virtual release) ) - (none) ) :post (behavior () (when (-> self scene) @@ -1541,7 +1534,6 @@ ) ) ) - (none) ) ) diff --git a/goal_src/jak2/engine/target/board/board-states.gc b/goal_src/jak2/engine/target/board/board-states.gc index c430e8fe5ed..b81a5e79e6f 100644 --- a/goal_src/jak2/engine/target/board/board-states.gc +++ b/goal_src/jak2/engine/target/board/board-states.gc @@ -504,14 +504,13 @@ (target-board-init) (remove-exit) (go target-board-get-on) - (none) ) :post target-post ) (defstate target-board-stance (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('lip) (when (and (= (-> self control ground-pat mode) (pat-mode halfpipe)) (< (-> self control poly-angle) 0.5) @@ -528,7 +527,7 @@ ) (set! (-> self board halfpipe-lip-time) (current-time)) (set! (-> self board halfpipe-side-time) (current-time)) - (set! (-> self board halfpipe-lip-event) (the-as symbol (-> event param 0))) + (set! (-> self board halfpipe-lip-event) (the-as symbol (-> block param 0))) (let ((v0-2 (the-as object (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset)))) ) (set! (-> self control root-prim prim-core action) (the-as collide-action v0-2)) @@ -539,20 +538,19 @@ (('jump) (go target-board-jump - (the-as meters (-> event param 0)) - (the-as meters (-> event param 1)) - (the-as symbol (-> event param 2)) + (the-as meters (-> block param 0)) + (the-as meters (-> block param 1)) + (the-as symbol (-> block param 2)) ) ) (else - (target-board-handler proc arg1 event-type event) + (target-board-handler proc argc message block) ) ) ) :enter (behavior () (set! (-> self control mod-surface) *board-walk-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) - (none) ) :exit (behavior () (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -577,7 +575,6 @@ (set! (-> self board turn-anim-duck) 0.0) ) (target-board-exit) - (none) ) :trans (behavior () (if (and (cpad-hold? (-> self control cpad number) l1) @@ -657,7 +654,6 @@ (set! (-> self board mods-backup) (-> self control mod-surface)) ) ) - (none) ) :code (behavior () (let ((gp-0 (-> self board stance-info))) @@ -756,7 +752,6 @@ ) ) #f - (none) ) :post target-board-post ) @@ -766,12 +761,10 @@ :enter (behavior () (set! (-> self control mod-surface) *board-duck-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) - (none) ) :exit (behavior () (set! (-> self board turn-anim-duck-vel) -8.0) ((-> target-board-stance exit)) - (none) ) :trans (behavior () (if (and (or (not (cpad-hold? (-> self control cpad number) l1)) @@ -863,18 +856,17 @@ (set! (-> self board mods-backup) (-> self control mod-surface)) ) ) - (none) ) :code (-> target-board-stance code) :post target-board-post ) (defstate target-board-jump (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'edge-grab) (< (- (current-time) (-> self state-time)) (seconds 0.1))) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'edge-grab) (< (- (current-time) (-> self state-time)) (seconds 0.1))) (return #f) ) - (target-board-handler proc arg1 event-type event) + (target-board-handler proc argc message block) ) :enter (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) (local-vars @@ -1021,7 +1013,6 @@ (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) ) (set! (-> self board slow-transv quad) (-> self control transv quad)) - (none) ) :exit target-board-exit :trans (behavior () @@ -1035,7 +1026,6 @@ (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) (set! (-> self board slow-transv quad) (-> self control transv quad)) (set! (-> self board shock-offset) (* 0.8 (-> self board shock-offset))) - (none) ) :code (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) (case arg2 @@ -1089,14 +1079,13 @@ (ja :num! (loop!)) ) #f - (none) ) :post target-board-post ) (defstate target-board-halfpipe (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('edge-grab) (format #t @@ -1149,14 +1138,14 @@ ) ) (('grenade) - (if (< (the-as float (-> event param 0)) + (if (< (the-as float (-> block param 0)) (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) ) (go target-board-grenade (process->handle proc)) ) ) (else - (target-board-handler proc arg1 event-type event) + (target-board-handler proc argc message block) ) ) ) @@ -1214,7 +1203,6 @@ ) (go target-board-turn-to (-> self control transv) (seconds 0.5)) ) - (none) ) :exit (behavior () (if (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -1234,7 +1222,6 @@ (remove-setting! 'matrix-blend-max-partial) (logclear! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) (target-board-exit) - (none) ) :trans (behavior () (when (and (or (= (the-as int (-> self control did-move-to-pole-or-max-jump-height)) #t) @@ -1316,7 +1303,6 @@ (go target-board-stance) ) (target-board-halfpipe-trans) - (none) ) :code (behavior () (cond @@ -1349,7 +1335,6 @@ ((the-as (function none :behavior target) (-> target-board-stance code))) ) ) - (none) ) :post target-board-post ) @@ -1362,7 +1347,6 @@ (set! (-> self control mod-surface) *board-jump-mods*) ) (set! (-> self board mods-backup) (-> self control mod-surface)) - (none) ) :exit (-> target-board-halfpipe exit) :trans (behavior () @@ -1374,7 +1358,6 @@ (set! (-> self control mod-surface) *board-air-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -1430,7 +1413,6 @@ ) ) ) - (none) ) :post target-board-post ) @@ -1442,7 +1424,6 @@ (set! (-> self control mod-surface) *board-jump-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) (sound-play "board-k-jump") - (none) ) :exit target-board-exit :trans (behavior () @@ -1462,7 +1443,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1481,7 +1461,6 @@ (ja :num! (loop!)) ) #f - (none) ) :post target-board-post ) @@ -1505,7 +1484,6 @@ (set! (-> self board mods-backup) (-> self control mod-surface)) (set! (-> self board smack-surface-time) 0) 0 - (none) ) :exit target-board-exit :trans target-board-jump-trans @@ -1530,7 +1508,6 @@ ) enter-state (go target-board-falling) - (none) ) :post target-board-post ) @@ -1573,7 +1550,6 @@ (set! (-> self control unknown-sound-id00) (sound-play "board-flip")) (target-start-attack) (target-danger-set! 'board-spin #f) - (none) ) :exit (behavior () (target-danger-set! 'harmless #f) @@ -1597,7 +1573,6 @@ (-> v1-9 id) ) ((-> target-board-halfpipe exit)) - (none) ) :trans (behavior () (cond @@ -1615,7 +1590,6 @@ ) ) (set! (-> self board slow-transv quad) (-> self control transv quad)) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((gp-0 (>= (-> self board flip-control) 0.0))) @@ -1711,7 +1685,6 @@ ) ) (go target-board-falling) - (none) ) :post target-board-post ) @@ -1744,7 +1717,6 @@ (set! (-> self control mod-surface) *board-flip-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) (set! (-> self control dynam gravity-length) 147456.0) - (none) ) :exit (behavior () (set! (-> self board unknown-float01) 0.0) @@ -1764,7 +1736,6 @@ ) ) ((-> target-board-halfpipe exit)) - (none) ) :trans (behavior () (target-board-spin-check) @@ -1783,7 +1754,6 @@ ) ) (set! (-> self board slow-transv quad) (-> self control transv quad)) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((v1-0 (new 'stack-no-clear 'vector))) @@ -1914,7 +1884,6 @@ ) ) (go target-board-falling) - (none) ) :post target-board-post ) @@ -1926,7 +1895,6 @@ (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) (sound-play "board-boots") ((-> target-board-hold exit)) - (none) ) :trans (behavior () (target-board-spin-check) @@ -1944,7 +1912,6 @@ (go target-board-hit-ground) ) (set! (-> self board slow-transv quad) (-> self control transv quad)) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((gp-0 (>= (-> self board unknown-float00) 0.0)) @@ -2022,7 +1989,6 @@ ) ) (go target-board-falling) - (none) ) :post target-board-post ) @@ -2034,7 +2000,6 @@ (if (= (-> self control ground-pat mode) (pat-mode halfpipe)) (go target-board-turn-to (-> self control transv) (seconds 0.5)) ) - (none) ) :exit target-board-exit :trans (behavior () @@ -2058,7 +2023,6 @@ (if (target-board-smack-surface?) 0 ) - (none) ) :code (behavior () (set! (-> self control mod-surface) *board-walk-mods*) @@ -2106,7 +2070,6 @@ ) ) (go target-board-stance) - (none) ) :post target-board-post ) @@ -2146,7 +2109,6 @@ (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) ) (set! (-> self control turn-lockout-end-time) (+ (current-time) arg1)) - (none) ) :exit target-board-exit :trans (behavior () @@ -2173,20 +2135,19 @@ ) ) (set! (-> self board turn-anim-targ) (* 10.0 (-> self board turn-anim-targ))) - (none) ) :code (-> target-board-stance code) :post target-board-post ) (defstate target-board-ride-edge (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('edge-grab 'push-transv 'push-trans) #f ) (('end-mode) - (when (-> event param 0) + (when (-> block param 0) (let ((v1-6 (/ (- (current-time) (-> self board ride-start-time)) 300))) (if (> v1-6 0) (add-to-trick-list (-> self board) (board-tricks board-rail) (* 100.0 (the float v1-6))) @@ -2196,11 +2157,11 @@ (go target-board-turn-to (-> self control transv) (seconds 0.2)) ) (else - (target-board-handler proc arg1 event-type event) + (target-board-handler proc argc message block) ) ) ) - :enter (behavior ((arg0 symbol) (arg1 object) (arg2 object) (arg3 float)) + :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (current-time)) (logior! (-> self focus-status) (focus-status rail)) (logior! (-> self control root-prim prim-core action) (collide-action can-ride)) @@ -2258,7 +2219,6 @@ ) (add-to-trick-list (-> self board) (board-tricks board-rail-jump) f0-24) ) - (none) ) :exit (behavior () (logclear! (-> self control status) (collide-status probe-hit)) @@ -2298,7 +2258,6 @@ (vector+! (new 'stack-no-clear 'vector) gp-0 (new 'static 'vector :y 204.8 :w 1.0)) ) ) - (none) ) :trans (behavior () (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) @@ -2375,9 +2334,8 @@ (launch-particles (-> *part-id-table* 431) gp-1) ) ) - (none) ) - :code (behavior ((arg0 symbol) (arg1 object) (arg2 object) (arg3 float)) + :code (behavior ((arg0 symbol)) (let* ((v1-1 (-> self board ride-mode)) (gp-0 (cond ((zero? v1-1) @@ -2417,22 +2375,20 @@ (suspend) ) #f - (none) ) :post (behavior () (target-board-ride-post) - (none) ) ) (defstate target-board-grenade (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('target) (handle->process (-> self control unknown-handle02)) ) (else - (target-board-handler proc arg1 event-type event) + (target-board-handler proc argc message block) ) ) ) @@ -2461,12 +2417,10 @@ ) ) ) - (none) ) :exit (behavior () (send-event (handle->process (-> self control unknown-handle02)) 'exit) ((-> target-board-halfpipe exit)) - (none) ) :trans (behavior () (set! (-> self board halfpipe-time) (current-time)) @@ -2490,7 +2444,6 @@ (+! (-> self control transv z) (* 20480.0 (-> self control edge-grab-across-edge-dir z))) (go target-board-stance) ) - (none) ) :code (behavior ((arg0 handle)) (ja-channel-push! 1 (seconds 0.05)) @@ -2530,25 +2483,24 @@ (ja-eval) ) (sleep-code) - (none) ) :post target-board-post ) (defstate target-board-get-on (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'attack-or-shove 'attack-invinc) (target-attacked - event-type - (the-as attack-info (-> event param 1)) + message + (the-as attack-info (-> block param 1)) proc - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) target-hit ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -2646,7 +2598,6 @@ ) ) (set! (-> self board slow-transv quad) (-> self control transv quad)) - (none) ) :exit target-board-exit :code (behavior () @@ -2687,19 +2638,18 @@ (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) (logior! (-> self control status) (collide-status on-surface)) (go target-board-hit-ground) - (none) ) :post target-board-post ) (defstate target-board-pegasus (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (go target-jump 16384.0 16384.0 (the-as surface #f)) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -2708,7 +2658,6 @@ (set! (-> self board shock-offsetv) 0.0) (set! (-> self state-time) (current-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) - (none) ) :exit target-board-exit :code (behavior ((arg0 handle)) @@ -2777,7 +2726,6 @@ ) ) #f - (none) ) :post (behavior () (set! (-> self control bend-speed) 0.0) @@ -2785,7 +2733,6 @@ (vector-seek! (-> self control draw-offset) *null-vector* (* 16384.0 (seconds-per-frame))) (target-no-move-post) (target-board-effect) - (none) ) ) @@ -2881,7 +2828,6 @@ ) ) (set! (-> self board slow-transv quad) (-> self control transv quad)) - (none) ) :exit target-board-exit :code (behavior ((arg0 object) (arg1 symbol)) @@ -2975,7 +2921,6 @@ ) ) ) - (none) ) :post (behavior () (set! (-> self control bend-speed) 0.0) @@ -2983,33 +2928,32 @@ (vector-seek! (-> self control draw-offset) *null-vector* (* 16384.0 (seconds-per-frame))) (target-post) (target-board-effect) - (none) ) ) (defstate target-board-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) (else - (case event-type + (case message (('end-mode) (go target-board-stance) ) (('clone-anim) - (go target-board-clone-anim (process->handle (the-as process (-> event param 0)))) + (go target-board-clone-anim (process->handle (the-as process (-> block param 0)))) ) (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('normal) (go target-grab 'stance) ) ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -3022,7 +2966,6 @@ (logior! (-> self focus-status) (focus-status grabbed)) (logclear! (-> self focus-status) (focus-status halfpipe)) (set! (-> self board stick-off) #t) - (none) ) :exit (behavior () (set! (-> self board stick-off) #f) @@ -3030,7 +2973,6 @@ (logclear! (-> self focus-status) (focus-status grabbed)) (logclear! (-> self water flags) (water-flags jump-out)) (target-board-exit) - (none) ) :code (behavior ((arg0 symbol)) (let ((v1-2 (ja-group))) @@ -3044,17 +2986,16 @@ (suspend) ) #f - (none) ) :post target-board-post ) (defstate target-board-clone-anim (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) (set! (-> self control unknown-word04) (the-as uint #f)) ) - ((-> target-board-grab event) proc arg1 event-type event) + ((-> target-board-grab event) proc argc message block) ) :enter (-> target-clone-anim enter) :exit (behavior () @@ -3064,7 +3005,6 @@ ((-> target-clone-anim exit)) ((-> target-board-start exit)) (vector-reset! (-> self control transv)) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self control unknown-word04) (the-as uint (-> self control draw-offset y))) @@ -3072,7 +3012,6 @@ (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (clone-anim arg0 #t "") (go target-board-stance) - (none) ) :post target-no-ja-move-post ) @@ -3096,7 +3035,6 @@ ) (logior! (-> self state-flags) (state-flags lleg-no-ik rleg-no-ik)) (target-board-exit) - (none) ) :trans (behavior () (when (= *cheat-mode* 'debug) @@ -3106,7 +3044,6 @@ (go target-board-stance) ) ) - (none) ) :code (behavior ((arg0 vector) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags jump-out)) @@ -3241,7 +3178,6 @@ ) enter-state (go target-board-hit-ground) - (none) ) :post (behavior () (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) @@ -3271,6 +3207,5 @@ ) ) (target-board-joint-points) - (none) ) ) diff --git a/goal_src/jak2/engine/target/board/board-util.gc b/goal_src/jak2/engine/target/board/board-util.gc index c97a8df3bc8..436186ef988 100644 --- a/goal_src/jak2/engine/target/board/board-util.gc +++ b/goal_src/jak2/engine/target/board/board-util.gc @@ -80,7 +80,6 @@ (go-virtual idle #f) ) ) - (none) ) :code (behavior () (ja-channel-set! 0) @@ -88,14 +87,13 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) (defstate idle (board) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('open) (go-virtual use) ) @@ -113,7 +111,6 @@ (go-virtual hidden) ) ) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-push! 1 (seconds 0.1)) @@ -136,15 +133,14 @@ ) (set! (-> self draw shadow) #f) (sleep-code) - (none) ) :post board-post ) (defstate use (board) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('close) (go-virtual idle #f) ) @@ -183,7 +179,6 @@ ) ) ) - (none) ) :code (behavior () (set! (-> self draw shadow) (-> self shadow-backup)) @@ -197,7 +192,6 @@ (ja :num! (seek!)) ) (sleep-code) - (none) ) :post board-post ) diff --git a/goal_src/jak2/engine/target/board/target-board.gc b/goal_src/jak2/engine/target/board/target-board.gc index 904c9f08d1a..88edd4320c1 100644 --- a/goal_src/jak2/engine/target/board/target-board.gc +++ b/goal_src/jak2/engine/target/board/target-board.gc @@ -30,27 +30,6 @@ (define-extern target-board-ground-check (function none :behavior target)) (define-extern target-board-halfpipe-check (function collide-action :behavior target)) (define-extern target-board-jump-trans (function none :behavior target)) -(define-extern target-board-start (state object target)) -(define-extern target-board-stance (state target)) -(define-extern target-board-duck-stance (state target)) -(define-extern target-board-jump (state meters meters symbol target)) -(define-extern target-board-halfpipe (state target)) -(define-extern target-board-falling (state target)) -(define-extern target-board-jump-kick (state target)) -(define-extern target-board-wall-kick (state vector float target)) -(define-extern target-board-flip (state float float symbol target)) -(define-extern target-board-hold (state float float symbol target)) -(define-extern target-board-trickx (state float float symbol target)) -(define-extern target-board-hit-ground (state target)) -(define-extern target-board-turn-to (state vector time-frame target)) -(define-extern target-board-ride-edge (state symbol object object float target)) -(define-extern target-board-grenade (state handle target)) -(define-extern target-board-get-on (state target)) -(define-extern target-board-pegasus (state handle target)) -(define-extern target-board-get-off (state object symbol target)) -(define-extern target-board-grab (state symbol target)) -(define-extern target-board-clone-anim (state handle target)) -(define-extern target-board-hit (state vector attack-info target)) (#when PC_PORT @@ -618,170 +597,148 @@ ) ) -;; WARN: Return type mismatch none vs object. (defbehavior target-board-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object) (a0-10 uint)) - (the-as - object - (cond - ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) - 'board - ) - (else - (let ((v1-3 arg2)) - (cond - ((= v1-3 'end-mode) - (go target-board-get-off (process->handle arg0) #f) - ) - ((= v1-3 'change-mode) - (let ((v1-7 (-> arg3 param 0))) - (b! (!= v1-7 'grab) cfg-19 :delay (set! a0-10 (the-as uint #f))) - (b! (focus-test? self dead) cfg-18 :delay (set! v0-0 #f)) - (set! v0-0 (if (not (-> arg3 param 1)) - #t - (go target-board-grab (the-as symbol a0-10)) - ) - ) - (label cfg-18) - (b! #t cfg-37 :delay (nop!)) - (label cfg-19) - (set! v0-0 (cond - ((= v1-7 'normal) - (go target-board-get-off (process->handle arg0) #f) - ) - ((= v1-7 'falling) - enter-state - (go target-board-falling) - ) - ((= v1-7 'pegasus) - (go target-board-get-off (process->handle arg0) 'pegasus) - ) - ((= v1-7 'pilot) - (target-standard-event-handler arg0 arg1 arg2 arg3) - ) - ) - ) - ) - (label cfg-37) - v0-0 - ) - (else - (let ((a3-2 (= v1-3 'swim))) - (cond - ((or a3-2 (begin (set! a3-2 (= v1-3 'wade)) a3-2) (begin (set! a3-2 (= v1-3 'slide)) a3-2) (= v1-3 'pole-grab)) - #f - ) - ((= v1-3 'clone-anim) - (go target-board-clone-anim (process->handle (the-as process (-> arg3 param 0)))) - ) - ((= v1-3 'edge-grab) - (let ((gp-1 *edge-grab-info*) - (s5-1 (new 'stack-no-clear 'vector)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + 'board + ) + (else + (case arg2 + (('end-mode) + (go target-board-get-off (process->handle arg0) #f) + ) + (('change-mode) + (let ((v1-7 (-> arg3 param 0))) + (b! (!= v1-7 'grab) cfg-19 :delay (set! a0-10 (the-as uint #f))) + (b! (focus-test? self dead) cfg-18 :delay (set! v0-0 #f)) + (set! v0-0 (if (not (-> arg3 param 1)) + #t + (go target-board-grab (the-as symbol a0-10)) + ) + ) + (label cfg-18) + (b! #t cfg-37 :delay (nop!)) + (label cfg-19) + (set! v0-0 (cond + ((= v1-7 'normal) + (go target-board-get-off (process->handle arg0) #f) ) - (vector-normalize! - (vector-! - (-> self control edge-grab-edge-dir) - (-> gp-1 world-vertex 1) - (the-as vector (-> gp-1 world-vertex)) + ((= v1-7 'falling) + enter-state + (go target-board-falling) ) - 1.0 - ) - (vector+float*! s5-1 (-> self control trans) (-> self control c-R-w vector 2) (* 40960.0 (seconds-per-frame))) - (let* ((t9-8 vector-segment-overlap) - (a1-8 (-> gp-1 world-vertex)) - (a2-3 (-> gp-1 world-vertex 1)) - (f0-2 (t9-8 s5-1 (the-as vector a1-8) a2-3)) - ) - (if (and (>= (- (current-time) (-> self board ride-time)) (seconds 0.4)) - (>= f0-2 0.0) - (>= 1.0 f0-2) - (not (and (-> self next-state) (= (-> self next-state name) 'target-board-duck-stance))) - ) - (go - target-board-ride-edge - (logtest? (-> self control mod-surface flags) (surface-flag air)) - (the-as object a1-8) - (the-as object a2-3) - (the-as float a3-2) - ) - ) - ) - ) - ) - ((= v1-3 'touched) - (cond - ((and (-> self control danger-mode) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self control) - (the-as uint 1920) - ) - ) - (when (target-send-attack - arg0 - (-> self control danger-mode) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as int (-> self control target-attack-id)) - (the-as int (-> self control attack-count)) - (-> self control penetrate-using) - ) - (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 117) 0 #f #f self 25 :to self) - (the-as object (target-timed-invulnerable (seconds 0.5) self 2)) - ) - ) - (else - (let ((a1-15 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-15 from) (process->ppointer self)) - (set! (-> a1-15 num-params) 2) - (set! (-> a1-15 message) 'attack) - (set! (-> a1-15 param 0) (-> arg3 param 0)) - (set! (-> a1-15 param 1) - (the-as - uint - (static-attack-info - ((id (-> self board attack-id)) (mode 'board) (penetrate-using (-> self control penetrate-using))) - ) - ) - ) - (set! v0-0 (send-event-function arg0 a1-15)) + ((= v1-7 'pegasus) + (go target-board-get-off (process->handle arg0) 'pegasus) ) - (when v0-0 - (let* ((v1-63 (-> self game)) - (a0-68 (+ (-> v1-63 attack-id) 1)) - ) - (set! (-> v1-63 attack-id) a0-68) - (set! (-> self board attack-id) a0-68) - ) + ((= v1-7 'pilot) + (target-standard-event-handler arg0 arg1 arg2 arg3) ) - v0-0 - ) - ) - ) - ((or (= v1-3 'attack) (= v1-3 'attack-or-shove) (= v1-3 'attack-invinc)) - (target-attacked - arg2 - (the-as attack-info (-> arg3 param 1)) - arg0 - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as (state symbol attack-info target) target-board-hit) - ) - ) - ((= v1-3 'shove) - (when (not (focus-test? self hit)) - (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 160) - (when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker))) - (set! (-> self attack-info-rec attacker) (process->handle arg0)) - (logior! (-> self attack-info-rec mask) (attack-mask attacker)) - ) - (go target-board-hit (the-as vector 'shove) (-> self attack-info-rec)) - ) - ) - (else - (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + (label cfg-37) + v0-0 + ) + (('swim 'wade 'slide 'pole-grab) + #f + ) + (('clone-anim) + (go target-board-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (('edge-grab) + (let ((gp-1 *edge-grab-info*) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (-> gp-1 world-vertex 1) + (the-as vector (-> gp-1 world-vertex)) + ) + 1.0 + ) + (vector+float*! s5-1 (-> self control trans) (-> self control c-R-w vector 2) (* 40960.0 (seconds-per-frame))) + (let ((f0-2 (vector-segment-overlap s5-1 (the-as vector (-> gp-1 world-vertex)) (-> gp-1 world-vertex 1)))) + (if (and (>= (- (current-time) (-> self board ride-time)) (seconds 0.4)) + (>= f0-2 0.0) + (>= 1.0 f0-2) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-duck-stance))) + ) + (go target-board-ride-edge (logtest? (-> self control mod-surface flags) (surface-flag air))) + ) + ) + ) + ) + (('touched) + (cond + ((and (-> self control danger-mode) ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 1920) + ) + ) + (when (target-send-attack + arg0 + (-> self control danger-mode) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) ) - ) - ) + (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 117) 0 #f #f self 25 :to self) + (target-timed-invulnerable (seconds 0.5) self 2) ) ) + (else + (let ((a1-15 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-15 from) (process->ppointer self)) + (set! (-> a1-15 num-params) 2) + (set! (-> a1-15 message) 'attack) + (set! (-> a1-15 param 0) (-> arg3 param 0)) + (set! (-> a1-15 param 1) + (the-as + uint + (static-attack-info + ((id (-> self board attack-id)) (mode 'board) (penetrate-using (-> self control penetrate-using))) + ) + ) + ) + (set! v0-0 (send-event-function arg0 a1-15)) + ) + (when v0-0 + (let* ((v1-63 (-> self game)) + (a0-68 (+ (-> v1-63 attack-id) 1)) + ) + (set! (-> v1-63 attack-id) a0-68) + (set! (-> self board attack-id) a0-68) + ) + ) + v0-0 + ) + ) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as (state symbol attack-info target) target-board-hit) + ) + ) + (('shove) + (when (not (focus-test? self hit)) + (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 160) + (when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker))) + (set! (-> self attack-info-rec attacker) (process->handle arg0)) + (logior! (-> self attack-info-rec mask) (attack-mask attacker)) + ) + (go target-board-hit (the-as vector 'shove) (-> self attack-info-rec)) + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) ) ) ) diff --git a/goal_src/jak2/engine/target/gun/gun-dark-shot.gc b/goal_src/jak2/engine/target/gun/gun-dark-shot.gc index c44ef33b7f9..0df9fecabeb 100644 --- a/goal_src/jak2/engine/target/gun/gun-dark-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-dark-shot.gc @@ -205,7 +205,6 @@ (set! (-> v1-6 params mask) (the-as uint 17)) (-> v1-6 id) ) - (none) ) :code (behavior () (set! (-> self state-time) (current-time)) @@ -246,12 +245,10 @@ (suspend) ) #f - (none) ) :post (behavior () (sound-play "pmkr-charge" :id (-> self charge-sound) :position (-> self root trans)) (spawn-impact-particles self) - (none) ) ) @@ -330,7 +327,6 @@ ) ) (draw-beam (-> *part-id-table* 210) (-> self root trans) (-> self core-velocity) #f #t) - (none) ) :trans (behavior () (local-vars (at-0 int)) @@ -409,7 +405,6 @@ ) (sound-play "pmkr-fire" :id (-> self fire-sound) :position (-> self root trans)) (sound-play "pmkr-trail" :id (-> self trail-sound) :position (-> self root trans)) - (none) ) ) ) @@ -517,7 +512,6 @@ :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 1)) @@ -550,7 +544,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior gun-dark-shot) sleep-code) ) @@ -845,6 +838,5 @@ ) ) (deactivate self) - (none) ) ) diff --git a/goal_src/jak2/engine/target/gun/gun-red-shot.gc b/goal_src/jak2/engine/target/gun/gun-red-shot.gc index d0fc316de0d..35b7c6435c2 100644 --- a/goal_src/jak2/engine/target/gun/gun-red-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-red-shot.gc @@ -454,7 +454,6 @@ ) (suspend) ) - (none) ) ) @@ -464,7 +463,6 @@ :code (behavior () (suspend) 0 - (none) ) ) @@ -483,7 +481,6 @@ (suspend) ) ) - (none) ) ) diff --git a/goal_src/jak2/engine/target/gun/gun-states.gc b/goal_src/jak2/engine/target/gun/gun-states.gc index 146db052aaa..9440a4cd651 100644 --- a/goal_src/jak2/engine/target/gun/gun-states.gc +++ b/goal_src/jak2/engine/target/gun/gun-states.gc @@ -8,11 +8,11 @@ ;; DECOMP BEGINS (defstate target-gun-stance (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('gun) - (let ((gp-0 (-> event param 0)) - (v0-0 (target-standard-event-handler proc arg1 event-type event)) + (let ((gp-0 (-> block param 0)) + (v0-0 (target-standard-event-handler proc argc message block)) ) (when v0-0 (cond @@ -40,7 +40,7 @@ #f ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -49,14 +49,12 @@ (set! (-> self control mod-surface) *gun-walk-mods*) (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (set! (-> self control bend-target) 0.0) (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) (target-state-hook-exit) (target-gun-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -116,7 +114,6 @@ ) (slide-down-test) (fall-test target-falling -4096000.0) - (none) ) :code (behavior () (local-vars (v1-232 object)) @@ -309,7 +306,6 @@ ) ) (go target-stance) - (none) ) :post target-gun-post ) @@ -328,13 +324,11 @@ (set! (-> self control unknown-word04) (the-as uint 1)) ) ) - (none) ) :exit (behavior () (target-effect-exit) (target-state-hook-exit) (target-gun-exit) - (none) ) :trans (behavior () (cond @@ -429,11 +423,9 @@ ) (slide-down-test) (fall-test target-falling -4096000.0) - (none) ) :code (behavior () (target-walk-anim -300) - (none) ) :post target-gun-post ) diff --git a/goal_src/jak2/engine/target/gun/gun-util.gc b/goal_src/jak2/engine/target/gun/gun-util.gc index 68a803720f0..b69971c2c91 100644 --- a/goal_src/jak2/engine/target/gun/gun-util.gc +++ b/goal_src/jak2/engine/target/gun/gun-util.gc @@ -426,7 +426,6 @@ (go-virtual idle) ) ) - (none) ) :code (behavior () (ja-channel-set! 0) @@ -434,7 +433,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -452,7 +450,6 @@ ) ) ) - (none) ) :code (behavior () (set! (-> self draw shadow) #f) @@ -469,15 +466,14 @@ ) ) #f - (none) ) :post gun-post ) (defstate use (gun) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go-virtual die) ) @@ -490,11 +486,9 @@ (set! (-> self state-time) (current-time)) (set! (-> self draw shadow) (-> self shadow-backup)) (logior! (-> self skel status) (joint-control-status sync-math)) - (none) ) :exit (behavior () (logclear! (-> self skel status) (joint-control-status sync-math)) - (none) ) :trans (behavior () (local-vars (a0-14 object)) @@ -530,7 +524,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-push! 1 (seconds 0.05)) @@ -786,7 +779,6 @@ ) ) #f - (none) ) :post (behavior () (gun-post) @@ -850,14 +842,13 @@ (set! self s5-1) ) ) - (none) ) ) (defstate die (gun) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('reset) (go-virtual idle) ) @@ -899,7 +890,6 @@ (suspend) ) (go-virtual idle) - (none) ) ) diff --git a/goal_src/jak2/engine/target/logic-target.gc b/goal_src/jak2/engine/target/logic-target.gc index 38d294cc268..9b9e24d1fec 100644 --- a/goal_src/jak2/engine/target/logic-target.gc +++ b/goal_src/jak2/engine/target/logic-target.gc @@ -3082,9 +3082,7 @@ (let ((s0-0 (new 'process 'control-info obj (collide-list-enum hit-by-others)))) (set! (-> s0-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s0-0 reaction) target-collision-reaction) - (set! (-> s0-0 no-reaction) - (the-as (function collide-shape-moving collide-query vector vector object) target-collision-no-reaction) - ) + (set! (-> s0-0 no-reaction) target-collision-no-reaction) (set! sv-16 (new 'process 'collide-shape-prim-group s0-0 (the-as uint 9) 1)) (set! (-> s0-0 total-prims) (the-as uint 10)) (set! (-> sv-16 prim-core action) (collide-action solid can-ride)) diff --git a/goal_src/jak2/engine/target/mech/grunt-mech.gc b/goal_src/jak2/engine/target/mech/grunt-mech.gc index 8e45c48fb3d..27c0c68eab6 100644 --- a/goal_src/jak2/engine/target/mech/grunt-mech.gc +++ b/goal_src/jak2/engine/target/mech/grunt-mech.gc @@ -352,16 +352,13 @@ (nav-enemy-method-167 self) (set! (-> self dismount-dest quad) (-> self root trans quad)) (logclear! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :trans (behavior () (grunt-mech-info-method-9 *grunt-mech-info* (-> self hold-id) self #f) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.07)) @@ -396,7 +393,6 @@ ) ) (go-virtual mech-hold) - (none) ) :post (the-as (function none :behavior grunt-mech) nav-enemy-simple-post) ) @@ -554,7 +550,6 @@ (stop-looking-at-target! self) (set! (-> self state-timeout) (+ (current-time) (get-rand-int-range self 450 900))) (logclear! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -563,13 +558,11 @@ (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) ) (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :trans (behavior () (if (or (not (grunt-mech-info-method-9 *grunt-mech-info* (-> self hold-id) self #f)) (grunt-mech-method-192 self)) (go-virtual mech-dismount) ) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 49) @@ -682,7 +675,6 @@ ) ) #f - (none) ) :post grunt-mech-hold-post ) @@ -710,7 +702,6 @@ ) 0 (logclear! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) @@ -722,7 +713,6 @@ ) 0 (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.07)) @@ -774,7 +764,6 @@ ) (ja-channel-push! 1 (seconds 0.13)) (go-virtual mech-post-circling) - (none) ) :post (the-as (function none :behavior grunt-mech) nav-enemy-simple-post) ) @@ -785,7 +774,6 @@ :enter (behavior () ((-> (method-of-type grunt circling) enter)) (set! (-> self state-timeout) (+ (current-time) (get-rand-int-range self 750 1200))) - (none) ) :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -833,7 +821,6 @@ ) ) ) - (none) ) :code (-> (method-of-type grunt circling) code) :post (-> (method-of-type grunt circling) post) @@ -845,7 +832,6 @@ :enter (behavior () ((-> (method-of-type grunt-mech mech-post-circling) enter)) (set! (-> self state-timeout) (+ (current-time) (get-rand-int-range self 900 1800))) - (none) ) :trans (-> (method-of-type grunt-mech mech-post-circling) trans) :code (-> (method-of-type grunt-mech mech-post-circling) code) diff --git a/goal_src/jak2/engine/target/mech/mech-states.gc b/goal_src/jak2/engine/target/mech/mech-states.gc index c12e9e55cc2..88f454f9e68 100644 --- a/goal_src/jak2/engine/target/mech/mech-states.gc +++ b/goal_src/jak2/engine/target/mech/mech-states.gc @@ -47,13 +47,11 @@ (set! (-> self control did-move-to-pole-or-max-jump-height) 0.0) (rot->dir-targ! (-> self control)) (set! (-> self mech jump-thrust-fuel) (-> *TARGET-bank* mech-jump-thrust-fuel)) - (none) ) :exit (behavior () (target-effect-exit) (target-mech-exit) (rot->dir-targ! (-> self control)) - (none) ) :trans (behavior () (if (and (move-legs?) @@ -101,7 +99,6 @@ (go target-mech-get-off) ) (fall-test target-mech-falling (-> *TARGET-bank* fall-height)) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -177,7 +174,6 @@ ) ) #f - (none) ) :post target-mech-post ) @@ -189,12 +185,10 @@ (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self control unknown-word04) (the-as uint 0.0)) (set! (-> self mech jump-thrust-fuel) (-> *TARGET-bank* mech-jump-thrust-fuel)) - (none) ) :exit (behavior () (target-effect-exit) (target-mech-exit) - (none) ) :trans (behavior () (if (and (cpad-pressed? (-> self control cpad number) circle square) (can-hands? #t)) @@ -263,7 +257,6 @@ (go target-mech-carry-pickup) ) (fall-test target-mech-falling (-> *TARGET-bank* fall-height)) - (none) ) :code (behavior () (let ((f30-0 0.0) @@ -334,7 +327,6 @@ ) ) #f - (none) ) :post target-mech-post ) @@ -458,31 +450,31 @@ ) (defstate target-mech-punch (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond ((focus-test? self dangerous) - (case event-type + (case message (('touched) (if ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 1920) ) (target-send-attack proc (-> self control danger-mode) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as int (-> self control target-attack-id)) (the-as int (-> self control attack-count)) (-> self control penetrate-using) ) - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) (('impact-control) (when (-> self control danger-mode) - (-> event param 1) - (let* ((gp-1 (the-as object (-> event param 3))) + (-> block param 1) + (let* ((gp-1 (the-as object (-> block param 3))) (s5-1 (-> (the-as collide-query gp-1) best-other-tri collide-ptr)) (s4-1 (if (type? s5-1 collide-shape-prim) (the-as collide-shape-prim s5-1) @@ -562,12 +554,12 @@ ) ) (else - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) ) (else - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) ) @@ -576,7 +568,6 @@ (set! (-> self control mod-surface) *mech-punch-mods*) (set! (-> self mech state-impact? 0) #f) (rot->dir-targ! (-> self control)) - (none) ) :exit (behavior () (set! (-> *mech-punch-mods* turnvv) 0.0) @@ -584,7 +575,6 @@ (set! (-> self control last-running-attack-end-time) (current-time)) (target-exit) (target-mech-exit) - (none) ) :code (behavior () (set! (-> self mech forward-vel) (-> self control ctrl-xz-vel)) @@ -750,21 +740,20 @@ ) ) (go target-mech-stance) - (none) ) :post target-mech-post ) (defstate target-mech-falling (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v0-0 (target-mech-bonk-event-handler proc arg1 event-type event))) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v0-0 (target-mech-bonk-event-handler proc argc message block))) (cond (v0-0 (empty) v0-0 ) (else - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) ) @@ -779,7 +768,6 @@ (set! (-> v1-4 attack-id) v0-0) (set! (-> self control target-attack-id) v0-0) ) - (none) ) :exit (behavior () (set! (-> self mech jump-thrust) 0.0) @@ -787,7 +775,6 @@ (set! (-> self mech thruster-flame-length) 0.0) (target-exit) (target-mech-exit) - (none) ) :trans (behavior () (local-vars (a0-0 none)) @@ -866,7 +853,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol)) (until #f @@ -894,7 +880,6 @@ ) ) #f - (none) ) :post target-mech-post ) @@ -914,7 +899,6 @@ (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) (set! (-> self control unknown-symbol03) (the-as float arg2)) (set! (-> self control mod-surface) *mech-jump-mods*) - (none) ) :exit (-> target-mech-falling exit) :trans (-> target-mech-falling trans) @@ -926,7 +910,6 @@ ) ) ((the-as (function none) (-> target-mech-falling code))) - (none) ) :post target-mech-post ) @@ -965,12 +948,10 @@ 1500 ) (activate! *camera-smush-control* 1638.4 15 75 1.0 0.9 (-> *display* camera-clock)) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) (target-mech-exit) - (none) ) :trans (behavior () (if (and (cpad-pressed? (-> self control cpad number) circle square) (can-hands? #t)) @@ -1007,12 +988,10 @@ ) ) (set-forward-vel 0.0) - (none) ) :code (behavior ((arg0 symbol)) (target-hit-ground-anim #f (are-still?)) (go target-mech-stance) - (none) ) :post target-mech-post ) @@ -1022,7 +1001,6 @@ :exit (behavior () ((-> target-hit exit)) (target-mech-exit) - (none) ) :trans (behavior () (when (= *cheat-mode* 'debug) @@ -1032,7 +1010,6 @@ (go target-mech-stance) ) ) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags jump-out)) @@ -1131,7 +1108,6 @@ (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-mech-falling-anim-trans 1.0) ) (go target-mech-hit-ground #f) - (none) ) :post (behavior () (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) @@ -1142,7 +1118,6 @@ (the-as float (-> self control dynam gravity-length)) ) (target-mech-post) - (none) ) ) @@ -1152,7 +1127,6 @@ (set! (-> self mech stick-off) #f) (target-mech-exit) ((-> target-death exit)) - (none) ) :trans (-> target-mech-hit trans) :code (behavior ((arg0 symbol)) @@ -1378,7 +1352,6 @@ ) (set! (-> self state-time) (current-time)) (sleep-code) - (none) ) :post target-mech-post ) @@ -1426,12 +1399,12 @@ ) (defstate target-mech-carry-pickup (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (cond (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 1920) ) @@ -1453,7 +1426,7 @@ #f ) (else - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) ) @@ -1461,7 +1434,7 @@ #f ) (else - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) ) @@ -1475,7 +1448,6 @@ (set! (-> self carry max-distance) 32768.0) (set! (-> self carry mode) (carry-mode carry mech-carry mech-drag)) (carry-info-method-9 (-> self carry)) - (none) ) :exit (behavior () (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -1499,7 +1471,6 @@ ) (set! (-> self mech stick-off) #f) (target-mech-exit) - (none) ) :code (behavior () (let ((f30-0 0.0) @@ -1692,24 +1663,22 @@ ) ) (go target-mech-stance) - (none) ) :post (behavior () (target-mech-post) (carry-info-method-9 (-> self carry)) (target-mech-carry-update) - (none) ) ) (defstate target-mech-carry-drop (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode 'end-mode) #f ) (else - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) ) @@ -1718,7 +1687,6 @@ (set! (-> self state-time) (current-time)) (set-forward-vel 0.0) (set! (-> self mech stick-off) (the-as basic #t)) - (none) ) :exit (-> target-mech-carry-pickup exit) :code (behavior () @@ -1848,16 +1816,15 @@ (ja-eval) ) (go target-mech-stance) - (none) ) :post (-> target-mech-carry-pickup post) ) (defstate target-mech-carry-stance (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('falling) (if (and (-> self next-state) (= (-> self next-state name) 'target-mech-carry-drag)) #f @@ -1865,7 +1832,7 @@ ) ) (('grab) - (if (not (-> event param 1)) + (if (not (-> block param 1)) #t (go target-mech-grab) ) @@ -1873,7 +1840,7 @@ ) ) (else - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) ) @@ -1883,12 +1850,10 @@ (set! (-> self control did-move-to-pole-or-max-jump-height) 0.0) (rot->dir-targ! (-> self control)) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () ((-> target-mech-carry-pickup exit)) (rot->dir-targ! (-> self control)) - (none) ) :trans (behavior () (if (and (move-legs?) @@ -1927,7 +1892,6 @@ (go target-mech-carry-throw) ) (fall-test (the-as (state symbol target) target-mech-carry-falling) (-> *TARGET-bank* fall-height)) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -1969,7 +1933,6 @@ ) ) #f - (none) ) :post target-mech-carry-post ) @@ -1980,7 +1943,6 @@ (set! (-> self state-time) (current-time)) (set! (-> self control mod-surface) *mech-carry-walk-mods*) (set! (-> self control unknown-word04) (the-as uint 0.0)) - (none) ) :exit (-> target-mech-carry-pickup exit) :trans (behavior () @@ -2025,7 +1987,6 @@ (go target-mech-carry-throw) ) (fall-test (the-as (state symbol target) target-mech-carry-falling) (-> *TARGET-bank* fall-height)) - (none) ) :code (behavior () (let ((f30-0 0.0)) @@ -2076,17 +2037,16 @@ ) ) #f - (none) ) :post target-mech-carry-post ) (defstate target-mech-carry-drag (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('push) (when (zero? (-> self control sliding-start-time)) - (set! (-> self control sliding-start-time) (+ (current-time) (the-as time-frame (-> event param 0)))) + (set! (-> self control sliding-start-time) (+ (current-time) (the-as time-frame (-> block param 0)))) (let ((v0-0 (the-as object #t))) (set! (-> self control unknown-word04) (the-as uint v0-0)) v0-0 @@ -2101,7 +2061,7 @@ (go target-mech-stance) ) (else - ((-> target-mech-carry-stance event) proc arg1 event-type event) + ((-> target-mech-carry-stance event) proc argc message block) ) ) ) @@ -2111,7 +2071,6 @@ (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self control mod-surface) *mech-carry-drag-mods*) (set-forward-vel 0.0) - (none) ) :exit (behavior () (set! (-> self mech jump-thrust) 0.0) @@ -2136,7 +2095,6 @@ (-> v1-5 id) ) ((-> target-mech-carry-pickup exit)) - (none) ) :trans (behavior () (when (and (not (cpad-hold? (-> self control cpad number) r1)) @@ -2179,7 +2137,6 @@ (send-event self 'drop) ) ) - (none) ) :code (behavior () (let ((f28-0 0.0) @@ -2299,21 +2256,20 @@ ) ) #f - (none) ) :post target-mech-carry-post ) (defstate target-mech-carry-falling (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v0-0 (target-mech-bonk-event-handler proc arg1 event-type event))) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v0-0 (target-mech-bonk-event-handler proc argc message block))) (cond (v0-0 (empty) v0-0 ) (else - ((-> target-mech-carry-stance event) proc arg1 event-type event) + ((-> target-mech-carry-stance event) proc argc message block) ) ) ) @@ -2321,7 +2277,6 @@ :enter (behavior () (set! (-> self control mod-surface) *mech-carry-jump-mods*) (set! (-> self state-time) (current-time)) - (none) ) :exit (-> target-mech-carry-pickup exit) :trans (behavior () @@ -2337,7 +2292,6 @@ (logior! (-> self control status) (collide-status on-surface)) (go target-mech-carry-hit-ground 'stuck) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -2359,7 +2313,6 @@ (ja :group! (-> self draw art-group data 341) :num! (loop!)) ) #f - (none) ) :post target-mech-carry-post ) @@ -2398,12 +2351,10 @@ 600 1500 ) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) ((-> target-mech-carry-pickup exit)) - (none) ) :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) @@ -2430,12 +2381,10 @@ (go target-mech-carry-walk) ) (fall-test (the-as (state symbol target) target-mech-carry-falling) (-> *TARGET-bank* fall-height)) - (none) ) :code (behavior ((arg0 symbol)) (target-hit-ground-anim #f (are-still?)) (go target-mech-carry-stance) - (none) ) :post target-mech-carry-post ) @@ -2450,7 +2399,6 @@ (set! (-> self control unknown-float36) (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) ) - (none) ) :exit (behavior () (rot->dir-targ! (-> self control)) @@ -2459,7 +2407,6 @@ (set! (-> self mech thruster-flame-width) 0.0) (set! (-> self mech thruster-flame-length) 0.0) (target-exit) - (none) ) :trans (behavior () (set! (-> self control unknown-float36) @@ -2482,7 +2429,6 @@ (set! (-> self mech thruster-flame-length) 0.0) ) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (ja-channel-push! 1 (seconds 0.05)) @@ -2509,7 +2455,6 @@ (suspend) ) (go target-mech-carry-falling) - (none) ) :post target-mech-carry-post ) @@ -2521,7 +2466,6 @@ (set! (-> self state-time) (current-time)) (set-forward-vel 0.0) (set! (-> self mech stick-off) (the-as basic #t)) - (none) ) :exit (-> target-mech-carry-pickup exit) :code (behavior () @@ -2589,7 +2533,6 @@ (ja-eval) ) (go target-mech-stance) - (none) ) :post (-> target-mech-carry-pickup post) ) @@ -2601,7 +2544,6 @@ (set! (-> self mech stick-off) #f) (set! (-> self neck flex-blend) 1.0) (logclear! (-> self state-flags) (state-flags sf5)) - (none) ) :code (behavior ((arg0 handle)) (logior! (-> self state-flags) (state-flags sf5)) @@ -2661,12 +2603,10 @@ (ja :num! (seek!)) ) (go target-mech-stance) - (none) ) :post (behavior () (target-no-move-post) (target-mech-effect) - (none) ) ) @@ -2675,7 +2615,6 @@ :exit (behavior () ((-> target-mech-start exit)) (logclear! (-> self state-flags) (state-flags sf5)) - (none) ) :code (behavior () (logior! (-> self state-flags) (state-flags sf5)) @@ -2736,27 +2675,26 @@ (go target-falling (the-as symbol a0-36)) ) ) - (none) ) :post (-> target-mech-get-on post) ) (defstate target-mech-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) (else - (case event-type + (case message (('end-mode) (go target-mech-stance) ) (('clone-anim) - (go target-mech-clone-anim (process->handle (the-as process (-> event param 0)))) + (go target-mech-clone-anim (process->handle (the-as process (-> block param 0)))) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -2772,7 +2710,6 @@ (sound-stop (-> self mech thrust-sound-id)) (sound-stop (-> self mech drag-sound-id)) (sound-stop (-> self mech whine-sound-id)) - (none) ) :exit (behavior () (set! (-> self mech stick-off) #f) @@ -2780,18 +2717,17 @@ (logclear! (-> self focus-status) (focus-status grabbed)) (logclear! (-> self water flags) (water-flags jump-out)) ((-> target-mech-start exit)) - (none) ) :code (-> target-mech-stance code) :post target-mech-post ) (defstate target-mech-clone-anim (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) (set! (-> self control unknown-word04) (the-as uint #f)) ) - ((-> target-mech-grab event) proc arg1 event-type event) + ((-> target-mech-grab event) proc argc message block) ) :enter (-> target-clone-anim enter) :exit (behavior () @@ -2801,7 +2737,6 @@ ((-> target-clone-anim exit)) ((-> target-mech-start exit)) (vector-reset! (-> self control transv)) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self control unknown-word04) (the-as uint (-> self control draw-offset y))) @@ -2809,13 +2744,11 @@ (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (clone-anim arg0 #t "") (go target-mech-stance) - (none) ) :post (behavior () (vector+! (-> self mech mech-trans) (-> self control trans) (-> self control cspace-offset)) (quaternion-copy! (the-as quaternion (-> self mech mech-quat)) (-> self control quat)) (set! (-> self mech mech-scale quad) (-> self control scale quad)) (target-no-ja-move-post) - (none) ) ) diff --git a/goal_src/jak2/engine/target/mech/mech.gc b/goal_src/jak2/engine/target/mech/mech.gc index 6ecdc9e5c94..63a199863c6 100644 --- a/goal_src/jak2/engine/target/mech/mech.gc +++ b/goal_src/jak2/engine/target/mech/mech.gc @@ -49,53 +49,48 @@ (defstate wait-for-start (mech) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack 'bonk) - (send-event proc 'target-mech-get-off (seconds 0.3)) - (send-event - proc - 'shove - #f - (static-attack-info ((id (new-attack-id)) (shove-back (meters 3)) (shove-up (meters 1)))) - ) - (the-as structure #f) - ) - (('touch) - (send-event proc 'target-mech-get-off (seconds 0.3)) - (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> event param 0)) 0.7 6144.0 16384.0) - (the-as structure #f) - ) - (('trans) - (vector+! (the-as vector (-> event param 0)) (-> self root trans) (-> self extra-trans)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack 'bonk) + (send-event proc 'target-mech-get-off (seconds 0.3)) + (send-event + proc + 'shove + #f + (static-attack-info ((id (new-attack-id)) (shove-back (meters 3)) (shove-up (meters 1)))) ) - (('shadow) - (cond - ((-> event param 0) - (let ((v0-2 (the-as structure (-> self shadow-backup)))) - (set! (-> self draw shadow) (the-as shadow-geo v0-2)) - v0-2 - ) + (the-as structure #f) + ) + (('touch) + (send-event proc 'target-mech-get-off (seconds 0.3)) + (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) + (the-as structure #f) + ) + (('trans) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) + ) + (('shadow) + (cond + ((-> block param 0) + (let ((v0-2 (the-as structure (-> self shadow-backup)))) + (set! (-> self draw shadow) (the-as shadow-geo v0-2)) + v0-2 ) - (else - (set! (-> self draw shadow) #f) - (the-as structure #f) - ) + ) + (else + (set! (-> self draw shadow) #f) + (the-as structure #f) ) ) - ) + ) ) ) :exit (behavior () (set! (-> self root root-prim prim-core action) (collide-action)) (set! (-> self root penetrated-by) (the-as penetrate -1)) - (none) ) :code (behavior () (go-virtual idle) - (none) ) ) @@ -116,12 +111,10 @@ ) ) ) - (none) ) :exit (behavior () (send-event (handle->process (-> self nav-sphere-handle)) 'die-fast) ((-> (method-of-type mech wait-for-start) exit)) - (none) ) :code (behavior () (change-parent self *entity-pool*) @@ -185,15 +178,14 @@ ) ) #f - (none) ) :post (the-as (function none :behavior mech) ja-post) ) (defstate pickup (mech) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('draw) (ja-channel-set! 1) (ja :group! mech-mech-idle-ja) @@ -202,14 +194,14 @@ (transform-post) ) (('trans) - (vector+! (the-as vector (-> event param 0)) (-> self root trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) ) (('touch 'attack 'bonk) #f ) (('shadow) (cond - ((-> event param 0) + ((-> block param 0) (let ((v0-1 (the-as object (-> self shadow-backup)))) (set! (-> self draw shadow) (the-as shadow-geo v0-1)) v0-1 @@ -229,7 +221,6 @@ (t9-0) ) ) - (none) ) :code (behavior ((arg0 (state mech))) (ja-channel-set! 0) @@ -255,39 +246,36 @@ ) ) (go arg0) - (none) ) ) (defstate wait-for-return (mech) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('trans) - (vector+! (the-as vector (-> event param 0)) (-> self root trans) (-> self extra-trans)) - ) - (('shadow) - (cond - ((-> event param 0) - (let ((v0-1 (the-as structure (-> self shadow-backup)))) - (set! (-> self draw shadow) (the-as shadow-geo v0-1)) - v0-1 - ) - ) - (else - (set! (-> self draw shadow) #f) - (the-as structure #f) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trans) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) + ) + (('shadow) + (cond + ((-> block param 0) + (let ((v0-1 (the-as structure (-> self shadow-backup)))) + (set! (-> self draw shadow) (the-as shadow-geo v0-1)) + v0-1 ) + ) + (else + (set! (-> self draw shadow) #f) + (the-as structure #f) + ) + ) + ) + ) ) :code (behavior () (ja-channel-set! 0) (ja-post) (cleanup-for-death self) - (none) ) ) @@ -394,8 +382,8 @@ This commonly includes things such as: (defstate idle (mech-target) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('look-at-point) (set! (-> self state-time) (current-time)) (go-virtual active) @@ -411,7 +399,6 @@ This commonly includes things such as: ) (go-virtual active) ) - (none) ) :code (behavior () (while (< 0.0 (-> self root scale x)) @@ -423,7 +410,6 @@ This commonly includes things such as: (logior! (-> self draw status) (draw-control-status no-draw)) (ja-post) (sleep-code) - (none) ) ) @@ -432,7 +418,6 @@ This commonly includes things such as: :event (-> (method-of-type mech-target idle) event) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (and (or (or (not *target*) (or (< 106496.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) @@ -445,7 +430,6 @@ This commonly includes things such as: ) (go-virtual idle) ) - (none) ) :code (behavior () (sound-play "mech-target") @@ -467,7 +451,6 @@ This commonly includes things such as: ) ) #f - (none) ) ) diff --git a/goal_src/jak2/engine/target/sidekick.gc b/goal_src/jak2/engine/target/sidekick.gc index efd4027b437..679e40828e8 100644 --- a/goal_src/jak2/engine/target/sidekick.gc +++ b/goal_src/jak2/engine/target/sidekick.gc @@ -169,11 +169,11 @@ ) (defstate sidekick-clone (sidekick) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('matrix) - (case (-> event param 0) + (case (-> block param 0) (('play-anim) (set! v0-0 (-> self node-list data)) (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) @@ -230,13 +230,13 @@ v0-0 ) (('shadow) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self shadow-in-movie?) (the-as symbol v0-0)) v0-0 ) (('blend-shape) (cond - ((-> event param 0) + ((-> block param 0) (set! v0-0 (logior (-> self skel status) (joint-control-status blend-shape))) (set! (-> self skel status) (the-as joint-control-status v0-0)) ) @@ -460,7 +460,6 @@ ) ) ) - (none) ) ) diff --git a/goal_src/jak2/engine/target/target-carry.gc b/goal_src/jak2/engine/target/target-carry.gc index eb259f84c2c..a153b205ce1 100644 --- a/goal_src/jak2/engine/target/target-carry.gc +++ b/goal_src/jak2/engine/target/target-carry.gc @@ -114,12 +114,12 @@ ) (defstate target-carry-pickup (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (cond (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 1920) ) @@ -141,12 +141,12 @@ #f ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -159,7 +159,6 @@ (set! (-> self carry max-distance) 12288.0) (set! (-> self carry mode) (carry-mode carry)) (carry-info-method-9 (-> self carry)) - (none) ) :exit (behavior () (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -180,7 +179,6 @@ (target-collide-set! 'normal 0.0) (target-exit) ) - (none) ) :code (behavior () (let ((f30-0 0.0)) @@ -281,13 +279,11 @@ ) ) (go target-stance) - (none) ) :post (behavior () (target-no-stick-post) (carry-info-method-9 (-> self carry)) (target-carry-update) - (none) ) ) @@ -297,7 +293,6 @@ (set! (-> self control mod-surface) *walk-mods*) (set! (-> self state-time) (current-time)) (set-forward-vel 0.0) - (none) ) :code (behavior () (let ((f30-0 1.0)) @@ -412,7 +407,6 @@ (ja-eval) ) (go target-stance) - (none) ) :post (-> target-carry-pickup post) ) @@ -422,13 +416,11 @@ :enter (behavior () (set! (-> self control mod-surface) *carry-walk-mods*) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () ((-> target-carry-pickup exit)) (set! (-> self control bend-target) 0.0) (target-state-hook-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -455,7 +447,6 @@ (go target-carry-throw) ) (fall-test (the-as (state symbol target) target-carry-falling) -4096000.0) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -469,7 +460,6 @@ (ja :num! (loop!)) ) #f - (none) ) :post target-carry-post ) @@ -479,13 +469,11 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self control mod-surface) *carry-walk-mods*) - (none) ) :exit (behavior () ((-> target-carry-pickup exit)) (target-effect-exit) (target-state-hook-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -512,7 +500,6 @@ (go target-carry-throw) ) (fall-test (the-as (state symbol target) target-carry-falling) -4096000.0) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -530,7 +517,6 @@ ) ) #f - (none) ) :post target-carry-post ) @@ -540,7 +526,6 @@ :enter (behavior () (set! (-> self control mod-surface) *carry-jump-mods*) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (logtest? (-> self control status) (collide-status on-surface)) @@ -566,7 +551,6 @@ (go target-carry-hit-ground 'stuck) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -588,7 +572,6 @@ (ja :group! (-> self draw art-group data 27) :num! (loop!)) ) #f - (none) ) :post target-carry-post ) @@ -618,11 +601,9 @@ 600 1500 ) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) - (none) ) :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) @@ -640,12 +621,10 @@ (go target-carry-walk) ) (fall-test (the-as (state symbol target) target-carry-falling) -4096000.0) - (none) ) :code (behavior ((arg0 symbol)) (target-hit-ground-anim #f (are-still?)) (go target-carry-stance) - (none) ) :post target-carry-post ) @@ -664,12 +643,10 @@ (set! (-> self control unknown-float35) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) ) - (none) ) :exit (behavior () ((-> target-carry-pickup exit)) (target-exit) - (none) ) :trans (behavior () (set! (-> self control unknown-float36) @@ -685,7 +662,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) (seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (ja-channel-push! 1 (seconds 0.05)) @@ -712,7 +688,6 @@ (suspend) ) (go target-carry-falling) - (none) ) :post target-carry-post ) @@ -723,7 +698,6 @@ (set! (-> self control mod-surface) *walk-mods*) (set! (-> self state-time) (current-time)) (set-forward-vel 0.0) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -800,7 +774,6 @@ (ja-eval) ) (go target-stance) - (none) ) :post (-> target-carry-pickup post) ) diff --git a/goal_src/jak2/engine/target/target-darkjak.gc b/goal_src/jak2/engine/target/target-darkjak.gc index ffab02893a0..4a8ba02cfae 100644 --- a/goal_src/jak2/engine/target/target-darkjak.gc +++ b/goal_src/jak2/engine/target/target-darkjak.gc @@ -255,16 +255,16 @@ ) (defstate target-darkjak-get-on (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('darkjak) (when (zero? (-> self darkjak want-stage)) - (set! (-> self darkjak want-stage) (the-as darkjak-stage (-> event param 0))) + (set! (-> self darkjak want-stage) (the-as darkjak-stage (-> block param 0))) #t ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -284,7 +284,6 @@ (the-as handle #f) ) ) - (none) ) :code (behavior ((arg0 darkjak-stage)) (send-event (handle->process (-> self notify)) 'notify 'attack 15) @@ -386,22 +385,21 @@ ) ) (go target-stance) - (none) ) :post (-> target-grab post) ) (defstate target-darkjak-get-off (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('pole-grab 'darkjak 'slide 'wade 'launch 'edge-grab) #f ) (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('grab) (when (not (focus-test? self dead)) - (if (not (-> event param 1)) + (if (not (-> block param 1)) #t (go target-grab 'stance) ) @@ -410,7 +408,7 @@ ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -437,12 +435,10 @@ ) ) ) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) (target-darkjak-end-mode) - (none) ) :trans (-> target-darkjak-get-on trans) :code (behavior () @@ -589,7 +585,6 @@ (vector-reset! (-> self control transv)) ((-> target-darkjak-get-off exit)) (go target-stance) - (none) ) :post (-> target-grab post) ) @@ -600,7 +595,6 @@ :exit (behavior () (remove-setting! 'rapid-tracking) ((-> target-running-attack exit)) - (none) ) :trans (-> target-running-attack trans) :code (behavior () @@ -974,7 +968,6 @@ (go target-falling #f) ) (go target-stance) - (none) ) :post target-post ) @@ -1031,14 +1024,14 @@ ) (defstate target-darkjak-bomb0 (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('pole-grab 'darkjak 'slide 'wade 'launch 'edge-grab 'jump 'shove 'attack 'attack-or-shove) #f ) (('hit) - (let ((v1-1 (the-as object (-> event param 1)))) - (when (and (= (-> event param 0) 'bomb) + (let ((v1-1 (the-as object (-> block param 1)))) + (when (and (= (-> block param 0) 'bomb) (logtest? (process-mask enemy) (-> (the-as process v1-1) mask)) (let ((v1-7 (ja-group))) (and v1-7 (= v1-7 (-> self draw art-group data 418))) @@ -1058,7 +1051,7 @@ #f ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -1070,7 +1063,6 @@ (set! (-> self control unknown-sound-id00) (add-process *gui-control* self (gui-channel jak) (gui-action queue) "darkbom0" -99.0 0) ) - (none) ) :exit (behavior () (set-action! @@ -1097,11 +1089,9 @@ (if (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) ((-> target-darkjak-get-off exit)) ) - (none) ) :trans (behavior () (update-clock! (-> self darkjak) 4) - (none) ) :code (behavior () (local-vars @@ -1435,7 +1425,6 @@ (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) (send-event (handle->process (-> self notify)) 'notify 'attack 16) (go target-darkjak-get-off) - (none) ) :post target-no-stick-post ) @@ -1575,7 +1564,6 @@ ) (slide-down-test) (update-clock! (-> self darkjak) 8) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (local-vars @@ -1888,7 +1876,6 @@ (set! (-> self gun surpress-time) (current-time)) (send-event (handle->process (-> self notify)) 'notify 'attack 17) (go target-darkjak-get-off) - (none) ) :post target-post ) @@ -1903,7 +1890,6 @@ (logclear! (-> self darkjak stage) (darkjak-stage giant)) (set! (-> self darkjak want-stage) (-> self darkjak stage)) ) - (none) ) :code (behavior () (send-event (handle->process (-> self notify)) 'notify 'attack 18) @@ -1973,7 +1959,6 @@ ) (send-event *traffic-manager* 'increase-alert-level 4) (go target-stance) - (none) ) :post (-> target-grab post) ) diff --git a/goal_src/jak2/engine/target/target-death.gc b/goal_src/jak2/engine/target/target-death.gc index da613eef5fd..1d9cfa68253 100644 --- a/goal_src/jak2/engine/target/target-death.gc +++ b/goal_src/jak2/engine/target/target-death.gc @@ -42,35 +42,35 @@ ) (defstate target-continue (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('grab 'look-around) #f ) (else - (set! (-> self mode-cache) (the-as basic (-> event param 0))) - (set! (-> self mode-param1) (if (>= arg1 2) - (process->handle (the-as process (-> event param 1))) + (set! (-> self mode-cache) (the-as basic (-> block param 0))) + (set! (-> self mode-param1) (if (>= argc 2) + (process->handle (the-as process (-> block param 1))) (the-as handle #f) ) ) - (set! (-> self mode-param2) (-> event param 2)) - (set! v0-0 (-> event param 3)) + (set! (-> self mode-param2) (-> block param 2)) + (set! v0-0 (-> block param 3)) (set! (-> self mode-param3) (the-as uint v0-0)) v0-0 ) ) ) (('want-continue) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self control unknown-word04) (the-as uint v0-0)) v0-0 ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -99,7 +99,6 @@ (set! (-> self teleport-time) (current-time)) (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) (set! (-> self game kiosk-timeout) (the-as uint (-> *display* game-clock frame-counter))) - (none) ) :code (behavior ((arg0 continue-point)) (local-vars (v1-96 symbol)) @@ -419,7 +418,6 @@ (set! (-> self mode-cache) #f) ) (go target-stance) - (none) ) :post target-no-move-post ) @@ -769,6 +767,7 @@ ) ) +;; WARN: Return type mismatch object vs none. (defbehavior target-hit-setup-anim target ((arg0 attack-info)) (let ((v1-0 (-> arg0 angle))) (cond @@ -957,7 +956,6 @@ ) ((method-of-type focus clear-focused) (the-as focus (-> self gun track-target))) (target-exit) - (none) ) :trans (behavior () (when (= *cheat-mode* 'debug) @@ -967,7 +965,6 @@ (go target-stance) ) ) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (local-vars (sv-32 attack-info) (sv-36 vector)) @@ -1272,7 +1269,6 @@ (go target-death (-> sv-32 mode)) ) (go target-hit-ground #f) - (none) ) :post target-post ) @@ -1491,50 +1487,47 @@ ) (defstate target-death (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'end-mode) - (let ((v0-0 (the-as object #t))) - (set! (-> self control unknown-word04) (the-as uint v0-0)) - v0-0 - ) - ) - ((= v1-0 'change-mode) - (case (-> event param 0) - (('grab) - (case (-> event param 1) - (('dead) - #t - ) - (else - #f - ) - ) - ) - ) - ) - ((= v1-0 'notify) - (when (type? proc pov-camera) - (case (-> event param 0) - (('die 'abort-request) - (set! (-> self control unknown-word04) (the-as uint #t)) - (the-as object (set-blackout-frames (seconds 0.2))) - ) - ) - ) - ) - ((= v1-0 'get-pickup) - #f - ) - ((= v1-0 'touched) - #f - ) - (else - (target-generic-event-handler proc arg1 event-type event) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('end-mode) + (let ((v0-0 (the-as object #t))) + (set! (-> self control unknown-word04) (the-as uint v0-0)) + v0-0 + ) + ) + (('change-mode) + (case (-> block param 0) + (('grab) + (case (-> block param 1) + (('dead) + #t + ) + (else + #f ) + ) + ) + ) + ) + (('notify) + (when (type? proc pov-camera) + (case (-> block param 0) + (('die 'abort-request) + (set! (-> self control unknown-word04) (the-as uint #t)) + (set-blackout-frames (seconds 0.2)) + ) + ) + ) + ) + (('get-pickup) + #f + ) + (('touched) + #f + ) + (else + (target-generic-event-handler proc argc message block) + ) ) ) :exit (behavior () @@ -1560,7 +1553,6 @@ (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) (send-event (ppointer->process (-> self gun gun)) 'reset) (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) - (none) ) :trans (-> target-hit trans) :code (behavior ((arg0 symbol)) @@ -2133,7 +2125,6 @@ ) (label cfg-167) (target-death-reset arg0 #f) - (none) ) :post target-no-stick-post ) diff --git a/goal_src/jak2/engine/target/target-h.gc b/goal_src/jak2/engine/target/target-h.gc index 87d2adc8940..fbf1c52ed2b 100644 --- a/goal_src/jak2/engine/target/target-h.gc +++ b/goal_src/jak2/engine/target/target-h.gc @@ -217,7 +217,7 @@ (target-board-jump meters meters symbol) target-board-jump-kick (target-board-pegasus handle) - (target-board-ride-edge symbol object object float) + (target-board-ride-edge symbol) target-board-stance (target-board-start object) (target-board-trickx float float symbol) diff --git a/goal_src/jak2/engine/target/target-handler.gc b/goal_src/jak2/engine/target/target-handler.gc index 06a400b1481..43946db70c1 100644 --- a/goal_src/jak2/engine/target/target-handler.gc +++ b/goal_src/jak2/engine/target/target-handler.gc @@ -209,7 +209,6 @@ ) ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 711] (defbehavior target-send-attack target ((arg0 process) (arg1 symbol) (arg2 touching-shapes-entry) (arg3 int) (arg4 int) (arg5 penetrate)) (local-vars (sv-96 symbol) @@ -656,403 +655,397 @@ sv-96 ) -;; WARN: Return type mismatch none vs object. (defbehavior target-generic-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) - (the-as - object - (case arg2 - (('get-pickup) - (when (not (focus-test? self dead)) - (let ((s4-0 (-> arg3 param 0)) - (f28-0 (the-as float (-> arg3 param 1))) - ) - (if (!= (pickup-collectable! (-> self fact) (the-as pickup-type s4-0) 0.0 (the-as handle #f)) - (pickup-collectable! (-> self fact) (the-as pickup-type s4-0) f28-0 (process->handle arg0)) - ) - #t - 'full - ) - ) + (case arg2 + (('get-pickup) + (when (not (focus-test? self dead)) + (let ((s4-0 (-> arg3 param 0)) + (f28-0 (the-as float (-> arg3 param 1))) + ) + (if (!= (pickup-collectable! (-> self fact) (the-as pickup-type s4-0) 0.0 (the-as handle #f)) + (pickup-collectable! (-> self fact) (the-as pickup-type s4-0) f28-0 (process->handle arg0)) + ) + #t + 'full + ) ) ) - (('test-pickup) - (let ((a1-6 (-> arg3 param 0))) - (pickup-collectable! (-> self fact) (the-as pickup-type a1-6) 0.0 (the-as handle #f)) - ) + ) + (('test-pickup) + (let ((a1-6 (-> arg3 param 0))) + (pickup-collectable! (-> self fact) (the-as pickup-type a1-6) 0.0 (the-as handle #f)) ) - (('reset-pickup) - (the-as object (reset! (-> self fact) (the-as symbol (-> arg3 param 0)))) + ) + (('reset-pickup) + (reset! (-> self fact) (the-as symbol (-> arg3 param 0))) + ) + (('reset-collide) + (cond + ((-> self control collide-mode) + (target-collide-set! (-> self control collide-mode) (-> self control collide-mode-transition)) + ) + ((-> self control danger-mode) + (target-danger-set! (-> self control danger-mode) #f) + ) ) - (('reset-collide) - (cond - ((-> self control collide-mode) - (target-collide-set! (-> self control collide-mode) (-> self control collide-mode-transition)) - ) - ((-> self control danger-mode) - (the-as object (target-danger-set! (-> self control danger-mode) #f)) - ) + ) + (('level-deactivate) + (when (and (focus-test? self pilot) + (or (= (-> arg3 param 0) 'ctywide) (and (= (-> arg3 param 0) 'lracelit) (-> self pilot as-daxter?))) + ) + (ja-channel-set! 0) + (target-gun-end-mode #t) + (set! (-> self skel top-anim interp) 0.0) + (let ((v1-30 (get-channel (-> self skel top-anim) 0))) + (if v1-30 + (set! (-> v1-30 frame-interp 1) 0.0) + ) ) - ) - (('level-deactivate) - (when (and (focus-test? self pilot) - (or (= (-> arg3 param 0) 'ctywide) (and (= (-> arg3 param 0) 'lracelit) (-> self pilot as-daxter?))) - ) - (ja-channel-set! 0) - (target-gun-end-mode #t) - (set! (-> self skel top-anim interp) 0.0) - (let ((v1-30 (get-channel (-> self skel top-anim) 0))) - (if v1-30 - (set! (-> v1-30 frame-interp 1) 0.0) - ) - ) - (update (-> self skel top-anim)) - (when (not (focus-test? self grabbed)) - (set! (-> self event-hook) #f) - (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) - ) + (update (-> self skel top-anim)) + (when (not (focus-test? self grabbed)) + (set! (-> self event-hook) #f) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) ) - (('level-enter) - (let ((s5-1 (level-get *level* (the-as symbol (-> arg3 param 0))))) - (when s5-1 - (let ((s4-1 (-> s5-1 info))) - (let ((v1-40 (-> s4-1 buzzer))) - (if (nonzero? v1-40) - (set! (-> self fact buzzer) 0.0) - (set! (-> self fact buzzer) - (pickup-collectable! (-> self fact) (pickup-type buzzer) (the float (logior -65536 v1-40)) (the-as handle #f)) - ) - ) - ) - (if (zero? (-> self game task-enter-times (-> s4-1 task-level))) - (set! (-> self game task-enter-times (-> s4-1 task-level)) (-> *display* game-clock frame-counter)) + ) + (('level-enter) + (let ((s5-1 (level-get *level* (the-as symbol (-> arg3 param 0))))) + (when s5-1 + (let ((s4-1 (-> s5-1 info))) + (let ((v1-40 (-> s4-1 buzzer))) + (if (nonzero? v1-40) + (set! (-> self fact buzzer) 0.0) + (set! (-> self fact buzzer) + (pickup-collectable! (-> self fact) (pickup-type buzzer) (the float (logior -65536 v1-40)) (the-as handle #f)) + ) ) ) - (let ((s4-2 (-> *game-info* sub-task-list))) - (dotimes (s3-0 (-> s4-2 length)) - (when (nonzero? s3-0) - (let ((s2-0 (-> s4-2 s3-0))) - (when (and (= (-> s5-1 info taskname) (-> s2-0 level)) - (zero? (-> self game task-close-times (-> s2-0 task))) - (= s3-0 (-> *game-info* play-list (-> s2-0 task) play-node)) - (or (logtest? (-> s2-0 flags) (game-task-node-flag closed)) (open? s2-0)) - (not (task-complete? (-> self game) (-> s2-0 task))) - (not (logtest? (game-task-node-flag utility-node) (-> s2-0 flags))) - ) - (when (zero? (-> self game task-close-times (-> s2-0 task))) - (format #t "--------------> set task start time for ~A~%" (-> s2-0 name)) - (set! (-> self game task-close-times (-> s2-0 task)) (-> *display* game-clock frame-counter)) - ) + (if (zero? (-> self game task-enter-times (-> s4-1 task-level))) + (set! (-> self game task-enter-times (-> s4-1 task-level)) (-> *display* game-clock frame-counter)) + ) + ) + (let ((s4-2 (-> *game-info* sub-task-list))) + (dotimes (s3-0 (-> s4-2 length)) + (when (nonzero? s3-0) + (let ((s2-0 (-> s4-2 s3-0))) + (when (and (= (-> s5-1 info taskname) (-> s2-0 level)) + (zero? (-> self game task-close-times (-> s2-0 task))) + (= s3-0 (-> *game-info* play-list (-> s2-0 task) play-node)) + (or (logtest? (-> s2-0 flags) (game-task-node-flag closed)) (open? s2-0)) + (not (task-complete? (-> self game) (-> s2-0 task))) + (not (logtest? (game-task-node-flag utility-node) (-> s2-0 flags))) + ) + (when (zero? (-> self game task-close-times (-> s2-0 task))) + (format #t "--------------> set task start time for ~A~%" (-> s2-0 name)) + (set! (-> self game task-close-times (-> s2-0 task)) (-> *display* game-clock frame-counter)) ) ) ) ) ) - (update-task-masks 'level) - (format #t "GAMEPLAY: enter ~A~%" (-> arg3 param 0)) ) + (update-task-masks 'level) + (format #t "GAMEPLAY: enter ~A~%" (-> arg3 param 0)) ) ) - (('get-attack-count) - (set! v0-0 (+ (-> self control attack-count) (-> arg3 param 0))) - (set! (-> self control attack-count) (the-as uint v0-0)) - v0-0 + ) + (('get-attack-count) + (set! v0-0 (+ (-> self control attack-count) (-> arg3 param 0))) + (set! (-> self control attack-count) (the-as uint v0-0)) + v0-0 + ) + (('continue) + (logior! (-> self focus-status) (focus-status teleporting)) + (go target-continue (the-as continue-point (-> arg3 param 0))) + ) + (('query) + (case (-> arg3 param 0) + (('powerup) + (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) (-> arg3 param 1)) + (< 0.0 (-> (the-as fact-info-target (-> self fact)) eco-level)) + ) + ) + (('pickup) + (pickup-collectable! (-> self fact) (the-as pickup-type (-> arg3 param 1)) 0.0 (the-as handle #f)) + ) + (('ground-height) + (target-height-above-ground) + ) + (('gun-type) + (-> self gun gun-type) + ) ) - (('continue) - (logior! (-> self focus-status) (focus-status teleporting)) - (go target-continue (the-as continue-point (-> arg3 param 0))) + ) + (('release) + (when (and (nonzero? (-> self gun)) (handle->process (-> self gun charge-active?))) + (set! (-> self gun charge-active?) (the-as handle #f)) + (set! v0-0 (current-time)) + (set! (-> self gun fire-time) (the-as time-frame v0-0)) + v0-0 ) - (('query) - (case (-> arg3 param 0) - (('powerup) - (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) (-> arg3 param 1)) - (< 0.0 (-> (the-as fact-info-target (-> self fact)) eco-level)) - ) - ) - (('pickup) - (pickup-collectable! (-> self fact) (the-as pickup-type (-> arg3 param 1)) 0.0 (the-as handle #f)) - ) - (('ground-height) - (target-height-above-ground) - ) - (('gun-type) - (-> self gun gun-type) + ) + (('trans) + (case (-> arg3 param 0) + (('save) + (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (logior! (-> self state-flags) (state-flags sf12)) + (mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48) + ) + (('restore) + (logclear! (-> self state-flags) (state-flags sf12)) + (let ((gp-1 (-> arg3 param 1))) + (move-to-point! (-> self control) (the-as vector (+ gp-1 0))) + (quaternion-copy! (-> self control quat) (the-as quaternion (+ gp-1 16))) ) - ) + (rot->dir-targ! (-> self control)) + (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! v0-0 (current-time)) + (set! (-> self control last-time-on-surface) (the-as time-frame v0-0)) + v0-0 + ) + (('reset) + (set! v0-0 (logclear (-> self state-flags) (state-flags sf12))) + (set! (-> self state-flags) (the-as state-flags v0-0)) + v0-0 + ) ) - (('release) - (when (and (nonzero? (-> self gun)) (handle->process (-> self gun charge-active?))) - (set! (-> self gun charge-active?) (the-as handle #f)) - (set! v0-0 (current-time)) - (set! (-> self gun fire-time) (the-as time-frame v0-0)) - v0-0 + ) + (('effect) + (target-powerup-effect (the-as symbol (-> arg3 param 0))) + ) + (('color-effect) + (set! (-> self color-effect) (the-as basic (-> arg3 param 0))) + (set! (-> self color-effect-start-time) (current-time)) + (set! v0-0 (-> arg3 param 1)) + (set! (-> self color-effect-duration) (the-as uint v0-0)) + v0-0 + ) + (('do-effect) + (do-effect (-> self skel effect) (the-as symbol (-> arg3 param 0)) (the-as float (-> arg3 param 1)) -1) + (if (-> self sidekick) + (do-effect + (-> self sidekick 0 skel effect) + (the-as symbol (-> arg3 param 0)) + (the-as float (-> arg3 param 1)) + -1 + ) ) - ) - (('trans) + ) + (('effect-control) + (when (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (case (-> arg3 param 0) - (('save) - (set! (-> self alt-cam-pos quad) (-> self control trans quad)) - (logior! (-> self state-flags) (state-flags sf12)) - (mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48) - ) - (('restore) - (logclear! (-> self state-flags) (state-flags sf12)) - (let ((gp-1 (-> arg3 param 1))) - (move-to-point! (-> self control) (the-as vector (+ gp-1 0))) - (quaternion-copy! (-> self control quat) (the-as quaternion (+ gp-1 16))) - ) - (rot->dir-targ! (-> self control)) - (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) - (set! v0-0 (current-time)) - (set! (-> self control last-time-on-surface) (the-as time-frame v0-0)) - v0-0 - ) - (('reset) - (set! v0-0 (logclear (-> self state-flags) (state-flags sf12))) - (set! (-> self state-flags) (the-as state-flags v0-0)) - v0-0 + (('effect-walk-step-left 'effect-walk-step-right 'effect-run-step-left 'effect-run-step-right) + (activate! *camera-smush-control* 409.6 15 75 1.0 0.98 (-> *display* camera-clock)) ) ) ) - (('effect) - (the-as object (target-powerup-effect (the-as symbol (-> arg3 param 0)))) - ) - (('color-effect) - (set! (-> self color-effect) (the-as basic (-> arg3 param 0))) - (set! (-> self color-effect-start-time) (current-time)) - (set! v0-0 (-> arg3 param 1)) - (set! (-> self color-effect-duration) (the-as uint v0-0)) - v0-0 - ) - (('do-effect) - (do-effect (-> self skel effect) (the-as symbol (-> arg3 param 0)) (the-as float (-> arg3 param 1)) -1) - (if (-> self sidekick) - (the-as object (do-effect - (-> self sidekick 0 skel effect) - (the-as symbol (-> arg3 param 0)) - (the-as float (-> arg3 param 1)) - -1 - ) - ) - ) - ) - (('effect-control) - (when (and (focus-test? self dark) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) (darkjak-stage giant)) - ) - (case (-> arg3 param 0) - (('effect-walk-step-left 'effect-walk-step-right 'effect-run-step-left 'effect-run-step-right) - (activate! *camera-smush-control* 409.6 15 75 1.0 0.98 (-> *display* camera-clock)) - ) - ) - ) - ) - (('neck) - (set! (-> self neck flex-blend) (the-as float (-> arg3 param 0))) - (cond - ((-> arg3 param 1) - (logior! (-> self state-flags) (state-flags sf13)) - (set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) - (the-as object (look-at! (-> self neck) (-> self alt-neck-pos) 'force arg0)) - ) - (else - (set! v0-0 (logclear (-> self state-flags) (state-flags sf13))) - (set! (-> self state-flags) (the-as state-flags v0-0)) - v0-0 - ) + ) + (('neck) + (set! (-> self neck flex-blend) (the-as float (-> arg3 param 0))) + (cond + ((-> arg3 param 1) + (logior! (-> self state-flags) (state-flags sf13)) + (set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (look-at! (-> self neck) (-> self alt-neck-pos) 'force arg0) + ) + (else + (set! v0-0 (logclear (-> self state-flags) (state-flags sf13))) + (set! (-> self state-flags) (the-as state-flags v0-0)) + v0-0 ) ) - (('sidekick) - (cond - ((and (-> arg3 param 0) (not (-> self sidekick))) - (let ((gp-2 (get-process *default-dead-pool* sidekick #x4000))) - (set! v0-0 - (when gp-2 - (let ((t9-31 (method-of-type sidekick activate))) - (t9-31 (the-as sidekick gp-2) self (symbol->string (-> sidekick symbol)) (the-as pointer #x70004000)) - ) - (run-now-in-process gp-2 init-sidekick) - (-> gp-2 ppointer) + ) + (('sidekick) + (cond + ((and (-> arg3 param 0) (not (-> self sidekick))) + (let ((gp-2 (get-process *default-dead-pool* sidekick #x4000))) + (set! v0-0 + (when gp-2 + (let ((t9-31 (method-of-type sidekick activate))) + (t9-31 (the-as sidekick gp-2) self (symbol->string (-> sidekick symbol)) (the-as pointer #x70004000)) ) + (run-now-in-process gp-2 init-sidekick) + (-> gp-2 ppointer) ) - ) - (set! (-> self sidekick) (the-as (pointer sidekick) v0-0)) - v0-0 - ) - ((and (not (-> arg3 param 0)) (-> self sidekick)) - (deactivate (-> self sidekick 0)) - (set! (-> self sidekick) (the-as (pointer sidekick) #f)) - #f + ) ) - ) + (set! (-> self sidekick) (the-as (pointer sidekick) v0-0)) + v0-0 + ) + ((and (not (-> arg3 param 0)) (-> self sidekick)) + (deactivate (-> self sidekick 0)) + (set! (-> self sidekick) (the-as (pointer sidekick) #f)) + #f + ) ) - (('blend-shape) - (if (-> arg3 param 0) - (logior! (-> self skel status) (joint-control-status blend-shape)) - (logclear! (-> self skel status) (joint-control-status blend-shape)) - ) - (let ((v1-175 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-175 from) (process->ppointer arg0)) - (set! (-> v1-175 num-params) arg1) - (set! (-> v1-175 message) arg2) - (set! (-> v1-175 param 0) (-> arg3 param 0)) - (set! (-> v1-175 param 1) (-> arg3 param 1)) - (set! (-> v1-175 param 2) (-> arg3 param 2)) - (set! (-> v1-175 param 3) (-> arg3 param 3)) - (set! (-> v1-175 param 4) (-> arg3 param 4)) - (set! (-> v1-175 param 5) (-> arg3 param 5)) - (send-event-function (ppointer->process (-> self sidekick)) v1-175) + ) + (('blend-shape) + (if (-> arg3 param 0) + (logior! (-> self skel status) (joint-control-status blend-shape)) + (logclear! (-> self skel status) (joint-control-status blend-shape)) ) + (let ((v1-175 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-175 from) (process->ppointer arg0)) + (set! (-> v1-175 num-params) arg1) + (set! (-> v1-175 message) arg2) + (set! (-> v1-175 param 0) (-> arg3 param 0)) + (set! (-> v1-175 param 1) (-> arg3 param 1)) + (set! (-> v1-175 param 2) (-> arg3 param 2)) + (set! (-> v1-175 param 3) (-> arg3 param 3)) + (set! (-> v1-175 param 4) (-> arg3 param 4)) + (set! (-> v1-175 param 5) (-> arg3 param 5)) + (send-event-function (ppointer->process (-> self sidekick)) v1-175) ) - (('shadow) - (cond - ((-> arg3 param 0) - (let ((v1-178 (-> self draw shadow-ctrl))) - (logclear! (-> v1-178 settings flags) (shadow-flags disable-draw)) - ) - 0 + ) + (('shadow) + (cond + ((-> arg3 param 0) + (let ((v1-178 (-> self draw shadow-ctrl))) + (logclear! (-> v1-178 settings flags) (shadow-flags disable-draw)) ) - (else - (let ((v1-180 (-> self draw shadow-ctrl))) - (logior! (-> v1-180 settings flags) (shadow-flags disable-draw)) - ) - 0 + 0 + ) + (else + (let ((v1-180 (-> self draw shadow-ctrl))) + (logior! (-> v1-180 settings flags) (shadow-flags disable-draw)) ) + 0 ) ) - (('rotate-y-angle) - (quaternion-rotate-y! - (-> self control quat-for-control) - (-> self control quat-for-control) - (the-as float (-> arg3 param 0)) - ) - (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (rot->dir-targ! (-> self control)) - ) + ) + (('rotate-y-angle) + (quaternion-rotate-y! + (-> self control quat-for-control) + (-> self control quat-for-control) + (the-as float (-> arg3 param 0)) ) - (('touched) - (cond - ((< 0.0 (-> (the-as fact-info-target (-> self fact)) shield-level)) - (let ((s4-3 (-> self control penetrate-using))) - (set! (-> self control penetrate-using) (penetrate touch shield)) - (let* ((v1-193 (-> self game)) - (a0-161 (+ (-> v1-193 attack-id) 1)) - ) - (set! (-> v1-193 attack-id) a0-161) - (set! (-> self fact shield-attack-id) a0-161) - ) - (set! v0-0 (target-send-attack - arg0 - 'shield - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as int (-> (the-as fact-info-target (-> self fact)) shield-attack-id)) - 0 - (-> self control penetrate-using) - ) - ) - (set! (-> self control penetrate-using) s4-3) + (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (rot->dir-targ! (-> self control)) + ) + ) + (('touched) + (cond + ((< 0.0 (-> (the-as fact-info-target (-> self fact)) shield-level)) + (let ((s4-3 (-> self control penetrate-using))) + (set! (-> self control penetrate-using) (penetrate touch shield)) + (let* ((v1-193 (-> self game)) + (a0-161 (+ (-> v1-193 attack-id) 1)) + ) + (set! (-> v1-193 attack-id) a0-161) + (set! (-> self fact shield-attack-id) a0-161) ) - v0-0 + (set! v0-0 (target-send-attack + arg0 + 'shield + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> (the-as fact-info-target (-> self fact)) shield-attack-id)) + 0 + (-> self control penetrate-using) + ) + ) + (set! (-> self control penetrate-using) s4-3) ) - ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) - (or (and (focus-test? self dark) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) (darkjak-stage invinc)) - ) - (logtest? (process-mask crate) (-> arg0 mask)) - ) - ) - (target-send-attack - arg0 - 'darkjak - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as int (-> self darkjak attack-id)) - 0 - (penetrate touch dark-skin) - ) + v0-0 + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (or (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage invinc)) + ) + (logtest? (process-mask crate) (-> arg0 mask)) + ) + ) + (target-send-attack + arg0 + 'darkjak + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self darkjak attack-id)) + 0 + (penetrate touch dark-skin) ) - (else - (send-event arg0 'touch (-> arg3 param 0)) - ) + ) + (else + (send-event arg0 'touch (-> arg3 param 0)) ) ) - (('dry) - (set! (-> self water drip-wetness) 0.0) - ) - (('reset-height) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) - #f - ) - (('draw) - (if (-> arg3 param 0) - (logclear! (-> self draw status) (draw-control-status no-draw)) - (logior! (-> self draw status) (draw-control-status no-draw)) - ) - (let ((v1-223 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-223 from) (process->ppointer arg0)) - (set! (-> v1-223 num-params) arg1) - (set! (-> v1-223 message) arg2) - (set! (-> v1-223 param 0) (-> arg3 param 0)) - (set! (-> v1-223 param 1) (-> arg3 param 1)) - (set! (-> v1-223 param 2) (-> arg3 param 2)) - (set! (-> v1-223 param 3) (-> arg3 param 3)) - (set! (-> v1-223 param 4) (-> arg3 param 4)) - (set! (-> v1-223 param 5) (-> arg3 param 5)) - (send-event-function (ppointer->process (-> self manipy)) v1-223) + ) + (('dry) + (set! (-> self water drip-wetness) 0.0) + ) + (('reset-height) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + #f + ) + (('draw) + (if (-> arg3 param 0) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (logior! (-> self draw status) (draw-control-status no-draw)) ) + (let ((v1-223 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-223 from) (process->ppointer arg0)) + (set! (-> v1-223 num-params) arg1) + (set! (-> v1-223 message) arg2) + (set! (-> v1-223 param 0) (-> arg3 param 0)) + (set! (-> v1-223 param 1) (-> arg3 param 1)) + (set! (-> v1-223 param 2) (-> arg3 param 2)) + (set! (-> v1-223 param 3) (-> arg3 param 3)) + (set! (-> v1-223 param 4) (-> arg3 param 4)) + (set! (-> v1-223 param 5) (-> arg3 param 5)) + (send-event-function (ppointer->process (-> self manipy)) v1-223) ) - (('no-load-wait) - (set! v0-0 (+ (current-time) (the-as time-frame (-> arg3 param 0)))) - (set! (-> self no-load-wait) (the-as uint v0-0)) - v0-0 - ) - (('no-look-around) - (set! (-> self no-look-around-wait) (the-as uint (+ (current-time) (the-as time-frame (-> arg3 param 0))))) - (if (and (-> self next-state) (= (-> self next-state name) 'target-look-around)) - (send-event self 'end-mode) - ) - ) - (('change-state) - (go - (the-as (state object object object object target) (-> arg3 param 0)) - (-> arg3 param 1) - (-> arg3 param 2) - (-> arg3 param 3) - (-> arg3 param 4) + ) + (('no-load-wait) + (set! v0-0 (+ (current-time) (the-as time-frame (-> arg3 param 0)))) + (set! (-> self no-load-wait) (the-as uint v0-0)) + v0-0 + ) + (('no-look-around) + (set! (-> self no-look-around-wait) (the-as uint (+ (current-time) (the-as time-frame (-> arg3 param 0))))) + (if (and (-> self next-state) (= (-> self next-state name) 'target-look-around)) + (send-event self 'end-mode) ) + ) + (('change-state) + (go + (the-as (state object object object object target) (-> arg3 param 0)) + (-> arg3 param 1) + (-> arg3 param 2) + (-> arg3 param 3) + (-> arg3 param 4) ) - (('tobot) - (set! v0-0 (-> arg3 param 0)) - (set! (-> self tobot?) (the-as symbol v0-0)) - v0-0 - ) - (('carry-info) - (-> self carry) - ) - (('gun-type) - (cond - ((-> arg3 param 0) - (the-as object (target-gun-type-set! (the-as int (-> arg3 param 0)))) - ) - (else - (set! v0-0 #t) - (set! (-> self gun put-away?) (the-as symbol v0-0)) - v0-0 - ) + ) + (('tobot) + (set! v0-0 (-> arg3 param 0)) + (set! (-> self tobot?) (the-as symbol v0-0)) + v0-0 + ) + (('carry-info) + (-> self carry) + ) + (('gun-type) + (cond + ((-> arg3 param 0) + (target-gun-type-set! (the-as int (-> arg3 param 0))) + ) + (else + (set! v0-0 #t) + (set! (-> self gun put-away?) (the-as symbol v0-0)) + v0-0 ) ) - (('get-notify) - (set! v0-0 (process->handle (the-as process (-> arg3 param 0)))) - (set! (-> self notify) (the-as handle v0-0)) - v0-0 - ) - ) + ) + (('get-notify) + (set! v0-0 (process->handle (the-as process (-> arg3 param 0)))) + (set! (-> self notify) (the-as handle v0-0)) + v0-0 + ) ) ) -;; WARN: Return type mismatch none vs object. (defbehavior target-standard-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (at-0 int) (s3-0 type)) (rlet ((vf0 :class vf) @@ -1235,7 +1228,7 @@ ) ((= v1-45 'gun) (if (logtest? (-> self game features) (game-feature gun)) - (the-as object (target-gun-init (the-as int (-> arg3 param 2)))) + (target-gun-init (the-as int (-> arg3 param 2))) ) ) ((= v1-45 'tube) @@ -1301,7 +1294,7 @@ (b! #t cfg-291 :delay (nop!)) (label cfg-212) (b! (!= v1-0 'gun) cfg-214 :delay (nop!)) - (set! v0-0 (the-as object (target-gun-fire (the-as pickup-type (-> arg3 param 0))))) + (set! v0-0 (target-gun-fire (the-as pickup-type (-> arg3 param 0)))) (b! #t cfg-291 :delay (nop!)) (label cfg-214) (b! (!= v1-0 'darkjak) cfg-225 :delay (nop!)) @@ -1388,7 +1381,7 @@ (label cfg-290) (set! v0-0 (target-generic-event-handler arg0 arg1 arg2 arg3)) (label cfg-291) - (the-as object v0-0) + v0-0 ) ) ) diff --git a/goal_src/jak2/engine/target/target-part.gc b/goal_src/jak2/engine/target/target-part.gc index 7d6b82a9eb7..1a32639d119 100644 --- a/goal_src/jak2/engine/target/target-part.gc +++ b/goal_src/jak2/engine/target/target-part.gc @@ -2548,7 +2548,7 @@ ) ) ) - (the-as object 0) + 0 ) (defun process-drawable-shock-wall-effect ((arg0 process-drawable) diff --git a/goal_src/jak2/engine/target/target-swim.gc b/goal_src/jak2/engine/target/target-swim.gc index b5af51dde9a..2244df3eb03 100644 --- a/goal_src/jak2/engine/target/target-swim.gc +++ b/goal_src/jak2/engine/target/target-swim.gc @@ -13,7 +13,6 @@ (set! (-> self state-time) (current-time)) (set! (-> self control mod-surface) *wade-mods*) (set-zero! (-> self water bob)) - (none) ) :exit (behavior () (target-state-hook-exit) @@ -22,7 +21,6 @@ (set! (-> v1-1 channel-offset) 0) ) 0 - (none) ) :trans (behavior () ((-> self state-hook)) @@ -65,7 +63,6 @@ ) (go target-gun-stance) ) - (none) ) :code (-> target-stance code) :post target-post @@ -75,7 +72,6 @@ :event target-standard-event-handler :enter (behavior () ((-> target-wade-stance enter)) - (none) ) :exit (-> target-wade-stance exit) :trans (behavior () @@ -113,7 +109,6 @@ (if (and (cpad-pressed? (-> self control cpad number) square) (can-hands? #t)) (go target-running-attack) ) - (none) ) :code (behavior () (let ((gp-0 105) @@ -336,7 +331,6 @@ ) ) #f - (none) ) :post target-post ) @@ -379,7 +373,6 @@ (set! (-> self control mod-surface) *swim-mods*) (logior! (-> self water flags) (water-flags swim-ground)) (logior! (-> self state-flags) (state-flags lleg-no-ik rleg-no-ik)) - (none) ) :exit (behavior () (target-state-hook-exit) @@ -412,7 +405,6 @@ (-> v1-15 id) ) ) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -467,7 +459,6 @@ ) (target-swim-tilt 0.0 2.0 0.0 1.0) (sound-play "swim-bubbles" :id (-> self control board-jump-and-swim-sound)) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -521,7 +512,6 @@ ) ) #f - (none) ) :post target-swim-post ) @@ -533,7 +523,6 @@ (die-on-next-update! (-> self water bob)) (set! (-> self control unknown-word04) (the-as uint (current-time))) (logior! (-> self state-flags) (state-flags lleg-no-ik rleg-no-ik)) - (none) ) :exit (-> target-swim-stance exit) :trans (behavior () @@ -588,7 +577,6 @@ ) (target-swim-tilt 0.0 2.0 0.0 1.0) (sound-play "swim-bubbles" :id (-> self control board-jump-and-swim-sound)) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -641,17 +629,16 @@ ) ) #f - (none) ) :post target-swim-post ) (defstate target-swim-down (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (t0-7 symbol)) - (case event-type + (case message (('attack 'attack-invinc 'attack-or-shove) - (let ((v1-1 (the-as attack-info (-> event param 1)))) + (let ((v1-1 (the-as attack-info (-> block param 1)))) (set! t0-7 (or (not (logtest? (-> v1-1 mask) (attack-mask mode))) (case (-> v1-1 mode) (('bot 'lava 'melt 'dark-eco-pool) @@ -688,7 +675,7 @@ (('slide) ) ) - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) :enter (behavior () (set! (-> self state-time) (current-time)) @@ -700,7 +687,6 @@ (set! (-> self water swim-time) (current-time)) (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self neck flex-blend) 0.0) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) @@ -734,7 +720,6 @@ ) ) (set! (-> self neck flex-blend) 1.0) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self water swim-time)) (seconds 0.5)) @@ -757,7 +742,6 @@ ) ) ) - (none) ) :code (behavior () (let ((gp-0 60) @@ -867,7 +851,6 @@ ) ) #f - (none) ) :post target-swim-post ) @@ -876,7 +859,6 @@ :event (-> target-swim-down event) :enter (behavior () ((-> target-swim-down enter)) - (none) ) :exit (-> target-swim-down exit) :trans (behavior () @@ -908,7 +890,6 @@ ) (sound-play "water-bubbles" :id (-> self control bubbles-sound)) ((-> target-swim-down trans)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -992,7 +973,6 @@ (start-bobbing! (-> self water) -4096.0 600 1500) (set! (-> self water bob start-time) (+ (current-time) (seconds -0.05))) (go target-swim-stance) - (none) ) :post target-swim-post ) @@ -1012,7 +992,6 @@ ) ) ((-> target-jump trans)) - (none) ) :code (-> target-jump code) :post target-post @@ -1026,7 +1005,6 @@ (die-on-next-update! (-> self water bob)) (set! (-> self water align-offset) 0.0) (logior! (-> self water flags) (water-flags jump-out)) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (die-on-next-update! (-> self water bob)) @@ -1061,7 +1039,6 @@ ) (go target-swim-jump-jump (+ f0-7 arg0) (+ f0-7 arg1) (the-as surface #f)) ) - (none) ) :post target-swim-post ) diff --git a/goal_src/jak2/engine/target/target-tube.gc b/goal_src/jak2/engine/target/target-tube.gc index 8bf8c82022a..e92a26e943e 100644 --- a/goal_src/jak2/engine/target/target-tube.gc +++ b/goal_src/jak2/engine/target/target-tube.gc @@ -489,18 +489,18 @@ ) (defstate target-tube-start (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) 'tube ) (else - (case event-type + (case message (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('grab) (when (not (focus-test? self dead)) - (if (-> event param 1) + (if (-> block param 1) (logior! (-> self focus-status) (focus-status grabbed)) ) #t @@ -525,20 +525,20 @@ ) ) (('touched) - (send-event proc 'attack (-> event param 0) 'tube 0 0) + (send-event proc 'attack (-> block param 0) 'tube 0 0) #f ) (('attack 'attack-or-shove 'attack-invinc) (target-attacked 'attack-or-shove - (the-as attack-info (-> event param 1)) + (the-as attack-info (-> block param 1)) proc - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) target-tube-hit ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -568,7 +568,6 @@ (send-event (handle->process (-> self tube tube)) 'end-mode) (target-exit) ) - (none) ) :code (behavior ((arg0 handle)) (set-setting! 'slave-options 'set 0.0 (cam-slave-options BIKE_MODE)) @@ -619,7 +618,6 @@ (go target-tube) ) ) - (none) ) :post target-post ) @@ -687,7 +685,6 @@ :enter (behavior () (set! (-> self control mod-surface) *tube-mods*) (set! (-> self control surf) *tube-surface*) - (none) ) :exit (-> target-tube-start exit) :trans (behavior () @@ -702,7 +699,6 @@ ) (go target-tube-jump (-> *TARGET-bank* tube-jump-height-min) (-> *TARGET-bank* tube-jump-height-max)) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -730,11 +726,9 @@ (suspend) ) #f - (none) ) :post (behavior () (target-tube-post) - (none) ) ) @@ -745,7 +739,6 @@ (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *tube-jump-mods*) - (none) ) :exit (-> target-tube-start exit) :trans (behavior () @@ -758,7 +751,6 @@ (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control ctrl-xz-vel))))) (seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (ja-channel-push! 1 (seconds 0.05)) @@ -791,7 +783,6 @@ (ja :group! (-> self draw art-group data 27) :num! (loop!)) ) #f - (none) ) :post (-> target-tube post) ) @@ -807,7 +798,6 @@ (-> self tube sidetube) (-> self tube foretube) ) - (none) ) :exit (behavior () (if (not (and (-> self next-state) (= (-> self next-state name) 'target-tube-death))) @@ -816,7 +806,6 @@ (logclear! (-> self focus-status) (focus-status grabbed in-head)) (logclear! (-> self state-flags) (state-flags sf1 sf5)) ((-> target-tube-start exit)) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (let ((gp-0 (-> self attack-info))) @@ -917,7 +906,6 @@ ) ) (go target-tube) - (none) ) :post target-post ) @@ -930,7 +918,6 @@ (remove-setting! 'process-mask) (apply-settings *setting-control*) ((-> target-tube-start exit)) - (none) ) :code (behavior ((arg0 symbol)) (local-vars (v1-42 symbol)) @@ -961,7 +948,6 @@ (set! v1-42 (and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (movie?)))) ) (go target-tube) - (none) ) :post target-no-stick-post ) @@ -1038,7 +1024,6 @@ (get-point-in-path! (-> self path) (-> self root trans) 0.2 'interp) (displacement-between-two-points-normalized! (-> self path) (-> self rot) 0.2) (set! (-> self pos) 0.2) - (none) ) :trans (behavior () (if (and (and *target* @@ -1059,15 +1044,14 @@ ) (go-virtual slide-control-ride) ) - (none) ) :code (the-as (function none :behavior slide-control) sleep-code) ) (defstate slide-control-ride (slide-control) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (go-virtual slide-control-watch) ) @@ -1081,10 +1065,10 @@ (if gp-0 (find-target-point (-> (the-as process-drawable gp-0) root trans)) ) - (set! (-> (the-as vector (-> event param 0)) quad) (-> self trans quad)) - (set! (-> (the-as vector (-> event param 1)) quad) (-> self rot quad)) - (set! (-> (the-as vector (-> event param 2)) quad) (-> self side quad)) - (get-point-in-path! (-> self path) (the-as vector (-> event param 3)) (+ 0.2 (-> self pos)) 'interp) + (set! (-> (the-as vector (-> block param 0)) quad) (-> self trans quad)) + (set! (-> (the-as vector (-> block param 1)) quad) (-> self rot quad)) + (set! (-> (the-as vector (-> block param 2)) quad) (-> self side quad)) + (get-point-in-path! (-> self path) (the-as vector (-> block param 3)) (+ 0.2 (-> self pos)) 'interp) (if (>= (-> self pos) (+ -0.2 (get-num-segments (-> self path)))) (send-event gp-0 'end-mode) ) @@ -1097,12 +1081,10 @@ (set! (-> self pos) 0.0) (set! (-> self target) (process->handle *target*)) (process-entity-status! self (entity-perm-status no-kill) #t) - (none) ) :exit (behavior () (set! (-> self target) (the-as handle #f)) (process-entity-status! self (entity-perm-status no-kill) #f) - (none) ) :trans (behavior () (let ((gp-0 (handle->process (-> self target)))) @@ -1116,7 +1098,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior slide-control) sleep-code) ) diff --git a/goal_src/jak2/engine/target/target-turret-shot.gc b/goal_src/jak2/engine/target/target-turret-shot.gc index 3e89d9c8e5f..ffd833bb3b1 100644 --- a/goal_src/jak2/engine/target/target-turret-shot.gc +++ b/goal_src/jak2/engine/target/target-turret-shot.gc @@ -196,8 +196,8 @@ (defstate impact (turret-shot) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (let* ((toucher-proc proc) (toucher (if (type? toucher-proc process-drawable) @@ -210,14 +210,14 @@ (send-event proc 'attack - (-> event param 0) + (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode) (damage (-> self damage)))) ) ) ) ) (else - (projectile-event-handler proc arg1 event-type event) + (projectile-event-handler proc argc message block) ) ) ) @@ -233,7 +233,6 @@ ) (suspend) (go-virtual die) - (none) ) ) diff --git a/goal_src/jak2/engine/target/target-turret.gc b/goal_src/jak2/engine/target/target-turret.gc index 6b876ac9e50..e6327f23d9f 100644 --- a/goal_src/jak2/engine/target/target-turret.gc +++ b/goal_src/jak2/engine/target/target-turret.gc @@ -886,8 +886,8 @@ (defstate idle (base-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'bonk) (send-event proc 'target-turret-get-off 90) (send-event @@ -900,14 +900,14 @@ ) (('touch) (send-event proc 'target-turret-get-off 90) - (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> event param 0)) 0.7 6144.0 16384.0) + (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) #f ) (('exit) #t ) (else - (turret-handler proc arg1 event-type event) + (turret-handler proc argc message block) ) ) ) @@ -915,7 +915,6 @@ (set-zero! (-> self smush-control)) (base-turret-method-43 self) (set! (-> self focus-status) (focus-status disable ignore inactive)) - (none) ) :code (behavior () (ja-channel-set! 1) @@ -984,7 +983,6 @@ ) ) #f - (none) ) :post (behavior () (cond @@ -1009,25 +1007,23 @@ ) ) (transform-post) - (none) ) ) (defstate setup (base-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode) (go-virtual active) ) (else - (turret-handler proc arg1 event-type event) + (turret-handler proc argc message block) ) ) ) :enter (behavior () (set-setting! 'mode-name 'cam-turret 0.0 0) - (none) ) :code (the-as (function none :behavior base-turret) sleep-code) :post (the-as (function none :behavior base-turret) transform-post) @@ -1042,110 +1038,107 @@ (defstate active (base-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'draw) - (cond - ((-> event param 0) - (ja-channel-set! 1) - (ja :group! (-> self draw art-group data 2)) - (transform-post) - ) - (else - (ja-channel-set! 0) - (transform-post) - ) - ) - ) - ((= v1-0 'fire-down) - (cond - ((>= (-> self heat) 1.0) - (let ((v1-8 (- (current-time) (-> self fire-time))) - (a0-7 6) - (a1-1 (-> self fire-time-interval)) - ) - (when (>= v1-8 (* a0-7 a1-1)) - (set! (-> self fire-time) (current-time)) - (the-as object (base-turret-method-45 self a1-1 event-type)) - ) - ) - ) - (else - (when (>= (- (current-time) (-> self fire-time)) (-> self fire-time-interval)) - (set! (-> self fire-time) (current-time)) - (the-as object (base-turret-method-45 self arg1 event-type)) - ) - ) - ) - ) - ((= v1-0 'fire-pressed) - (set! (-> self fire-time) (current-time)) - (the-as object (base-turret-method-45 self arg1 event-type)) - ) - ((= v1-0 'bonk) - #f - ) - ((or (= v1-0 'touch) (= v1-0 'attack)) - (let* ((gp-0 (-> event param 0)) - (s5-0 (the-as object (-> event param 1))) - (s4-0 proc) - (v1-21 (if (type? s4-0 projectile) - s4-0 - ) - ) - ) - (when (and gp-0 v1-21) - (case (-> (the-as attack-info s5-0) mode) - (('wasp-shot 'guard-shot) - (seek! (-> self health) 0.0 0.25) - (activate! (-> self smush-control) 0.2 15 75 1.0 0.9 (-> *display* entity-clock)) - (sound-play "turret-take-hit") - (let ((v0-1 (the-as object (+ (current-time) (seconds 0.08))))) - (set! (-> self red-filter-timer) (the-as time-frame v0-1)) - v0-1 - ) - ) - (('drill-ship-shot) - (seek! (-> self health) 0.0 0.5) - (activate! (-> self smush-control) 0.2 24 144 1.0 0.9 (-> *display* entity-clock)) - (sound-play "turret-take-hit") - ) - ) - ) - ) - ) - ((= v1-0 'test) - (set! (-> self health) (seek (-> self health) 0.0 (the-as float (-> event param 0)))) - ) - ((= v1-0 'exit-valid) - (let ((v1-33 (-> self path-mode))) - (cond - ((or (zero? v1-33) (= v1-33 5) (= v1-33 1)) - (base-turret-method-41 self (the-as vector (-> event param 0))) - #t - ) - (else - #f - ) - ) - ) - ) - ((= v1-0 'exit) - (let ((v1-37 (-> self path-mode))) - (when (if (or (zero? v1-37) (= v1-37 5) (= v1-37 1)) - #t - ) - (go-virtual shutdown) - #f - ) - ) - ) - (else - (turret-handler proc arg1 event-type event) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('draw) + (cond + ((-> block param 0) + (ja-channel-set! 1) + (ja :group! (-> self draw art-group data 2)) + (transform-post) + ) + (else + (ja-channel-set! 0) + (transform-post) + ) + ) + ) + (('fire-down) + (cond + ((>= (-> self heat) 1.0) + (let ((v1-8 (- (current-time) (-> self fire-time))) + (a0-7 6) + (a1-1 (-> self fire-time-interval)) + ) + (when (>= v1-8 (* a0-7 a1-1)) + (set! (-> self fire-time) (current-time)) + (base-turret-method-45 self a1-1 message) + ) + ) + ) + (else + (when (>= (- (current-time) (-> self fire-time)) (-> self fire-time-interval)) + (set! (-> self fire-time) (current-time)) + (base-turret-method-45 self argc message) + ) + ) + ) + ) + (('fire-pressed) + (set! (-> self fire-time) (current-time)) + (base-turret-method-45 self argc message) + ) + (('bonk) + #f + ) + (('touch 'attack) + (let* ((gp-0 (-> block param 0)) + (s5-0 (the-as object (-> block param 1))) + (s4-0 proc) + (v1-21 (if (type? s4-0 projectile) + s4-0 ) - ) + ) ) + (when (and gp-0 v1-21) + (case (-> (the-as attack-info s5-0) mode) + (('wasp-shot 'guard-shot) + (seek! (-> self health) 0.0 0.25) + (activate! (-> self smush-control) 0.2 15 75 1.0 0.9 (-> *display* entity-clock)) + (sound-play "turret-take-hit") + (let ((v0-1 (the-as object (+ (current-time) (seconds 0.08))))) + (set! (-> self red-filter-timer) (the-as time-frame v0-1)) + v0-1 + ) + ) + (('drill-ship-shot) + (seek! (-> self health) 0.0 0.5) + (activate! (-> self smush-control) 0.2 24 144 1.0 0.9 (-> *display* entity-clock)) + (sound-play "turret-take-hit") + ) + ) + ) + ) + ) + (('test) + (set! (-> self health) (seek (-> self health) 0.0 (the-as float (-> block param 0)))) + ) + (('exit-valid) + (let ((v1-33 (-> self path-mode))) + (cond + ((or (zero? v1-33) (= v1-33 5) (= v1-33 1)) + (base-turret-method-41 self (the-as vector (-> block param 0))) + #t + ) + (else + #f + ) + ) + ) + ) + (('exit) + (let ((v1-37 (-> self path-mode))) + (when (if (or (zero? v1-37) (= v1-37 5) (= v1-37 1)) + #t + ) + (go-virtual shutdown) + #f + ) + ) + ) + (else + (turret-handler proc argc message block) + ) ) ) :enter (behavior () @@ -1167,7 +1160,6 @@ (set! (-> v1-14 prim-core action) (collide-action solid)) (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle)) ) - (none) ) :exit (behavior () (set-filter-color! 1.0 1.0 1.0) @@ -1177,13 +1169,11 @@ ) 0 (send-event (handle->process (-> self hud)) 'hide-and-die) - (none) ) :trans (behavior () (if (<= (the int (-> self health)) 0) (go-virtual die) ) - (none) ) :code (behavior () (ja-channel-set! 1) @@ -1251,7 +1241,6 @@ (suspend) ) (go-virtual shutdown) - (none) ) :post (behavior () (when (nonzero? (-> self red-filter-timer)) @@ -1353,7 +1342,6 @@ ) (seek! (-> self heat-target) 0.0 (* 0.4 (seconds-per-frame))) (transform-post) - (none) ) ) @@ -1367,7 +1355,6 @@ (sound-stop (-> self sound-id 2)) (set-zero! (-> self smush-control)) (logclear! (-> self skel status) (joint-control-status sync-math)) - (none) ) :trans (behavior () (when (< 0.99 (vector-dot @@ -1386,7 +1373,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-set! 1) @@ -1398,7 +1384,6 @@ (suspend) ) #f - (none) ) :post (behavior () (when (= (-> self path-mode) 5) @@ -1449,14 +1434,13 @@ ) (base-turret-method-40 self) (transform-post) - (none) ) ) (defstate dormant (base-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'bonk) (send-event proc 'target-turret-get-off 90) (send-event @@ -1469,14 +1453,14 @@ ) (('touch) (send-event proc 'target-turret-get-off 90) - (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> event param 0)) 0.7 6144.0 16384.0) + (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) #f ) (('exit) #t ) (else - (turret-handler proc arg1 event-type event) + (turret-handler proc argc message block) ) ) ) @@ -1484,7 +1468,6 @@ (set-zero! (-> self smush-control)) (base-turret-method-43 self) (set! (-> self focus-status) (focus-status disable ignore inactive)) - (none) ) :code (the-as (function none :behavior base-turret) sleep-code) ) @@ -1562,7 +1545,6 @@ (while (-> self child) (suspend) ) - (none) ) ) @@ -2042,10 +2024,7 @@ This commonly includes things such as: ) (defstate cam-turret (camera-slave) - :event (the-as - (function process int symbol event-message-block object :behavior camera-slave) - cam-standard-event-handler - ) + :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self saved-pt quad) (-> self trans quad)) @@ -2053,13 +2032,11 @@ This commonly includes things such as: (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f @@ -2078,7 +2055,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -2113,13 +2089,13 @@ This commonly includes things such as: ) (defstate target-turret-stance (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('grab) (when (not (focus-test? self dead)) - (if (-> event param 1) + (if (-> block param 1) (set! (-> self turret grabbed?) #t) ) #t @@ -2143,17 +2119,17 @@ This commonly includes things such as: ) (('attack 'attack-invinc) (let ((gp-0 - (the-as object (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> event param 1)) 160)) + (the-as object (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> block param 1)) 160)) ) ) ((method-of-type attack-info compute-intersect-info) (the-as attack-info gp-0) - (-> event param 1) + (-> block param 1) self (if (type? proc process-drawable) proc ) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) ) (case (-> (the-as attack-info gp-0) mode) (('turret) @@ -2204,7 +2180,7 @@ This commonly includes things such as: ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -2217,7 +2193,6 @@ This commonly includes things such as: (logior! (-> self state-flags) (state-flags sf2 sf5)) (logior! (-> self focus-status) (focus-status disable grabbed)) (set! (-> self control mod-surface) *empty-mods*) - (none) ) :exit (behavior () (target-exit) @@ -2229,11 +2204,9 @@ This commonly includes things such as: (deactivate (-> v1-6 0)) ) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior ((arg0 handle)) (local-vars @@ -2276,11 +2249,9 @@ This commonly includes things such as: ) (send-event self 'end-mode) (go target-turret-get-off) - (none) ) :post (behavior () (target-turret-post) - (none) ) ) @@ -2293,7 +2264,6 @@ This commonly includes things such as: :event target-generic-event-handler :exit (behavior () (logclear! (-> self state-flags) (state-flags sf6)) - (none) ) :code (behavior ((arg0 handle)) (when (zero? (-> self turret)) @@ -2364,7 +2334,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (go target-turret-stance arg0) - (none) ) :post target-no-move-post ) @@ -2374,7 +2343,6 @@ This commonly includes things such as: :exit (behavior () (target-exit) (logclear! (-> self state-flags) (state-flags sf6)) - (none) ) :code (behavior () (set! (-> self control mod-surface) *empty-mods*) @@ -2471,10 +2439,8 @@ This commonly includes things such as: (go target-falling (the-as symbol a0-61)) ) ) - (none) ) :post (behavior () (target-no-move-post) - (none) ) ) diff --git a/goal_src/jak2/engine/target/target.gc b/goal_src/jak2/engine/target/target.gc index 0ed50d21b49..943d745e687 100644 --- a/goal_src/jak2/engine/target/target.gc +++ b/goal_src/jak2/engine/target/target.gc @@ -40,7 +40,6 @@ (suspend) (suspend) (go target-stance) - (none) ) :post target-no-move-post ) @@ -50,13 +49,11 @@ :enter (behavior () (set! (-> self control mod-surface) *walk-mods*) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) (set! (-> self control bend-target) 0.0) (target-state-hook-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -138,7 +135,6 @@ ) (slide-down-test) (fall-test target-falling -4096000.0) - (none) ) :code target-stance-anim :post target-post @@ -152,12 +148,10 @@ ) (set! (-> self state-time) (current-time)) (set! (-> self control mod-surface) *walk-mods*) - (none) ) :exit (behavior () (target-effect-exit) (target-state-hook-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -246,11 +240,9 @@ ) (slide-down-test) (fall-test target-falling -4096000.0) - (none) ) :code (behavior () (target-walk-anim -300) - (none) ) :post target-post ) @@ -261,7 +253,6 @@ (vector-turn-to (-> self control transv)) (set! (-> self control mod-surface) *turn-around-mods*) (set! (-> self control bend-target) 1.0) - (none) ) :exit (behavior () (target-state-hook-exit) @@ -269,7 +260,6 @@ (set! (-> self control ctrl-xz-vel) 0.0) (set-quaternion! (-> self control) (-> self control dir-targ)) (set! (-> self control bend-target) 0.0) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -296,7 +286,6 @@ (go target-falling #f) ) (slide-down-test) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.04)) @@ -315,7 +304,6 @@ (set-forward-vel (-> self control ctrl-xz-vel)) (target-state-hook-exit) (go target-walk) - (none) ) :post target-no-stick-post ) @@ -324,11 +312,9 @@ :event target-walk-event-handler :enter (behavior () (set! (-> self control mod-surface) *jump-mods*) - (none) ) :exit (behavior () (set! (-> self control unknown-time-frame13) (current-time)) - (none) ) :trans (behavior () (when (or (logtest? (-> self control status) (collide-status on-surface)) @@ -342,7 +328,6 @@ (go target-duck-stance #f) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -361,7 +346,6 @@ ) ) #f - (none) ) :post target-post ) @@ -432,13 +416,13 @@ ) (defstate target-slide-down-to-ground (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('slide) #f ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -448,13 +432,11 @@ (set! (-> self control sliding-start-time) 0) (set! (-> self control force-turn-to-strength) 1.0) (set! (-> self control force-turn-to-speed) 1.0) - (none) ) :exit (behavior () (target-effect-exit) (target-exit) (set! (-> self control unknown-time-frame13) (current-time)) - (none) ) :trans (behavior () (if (and (or (and (logtest? (-> self control status) (collide-status on-surface)) @@ -526,7 +508,6 @@ ) ) (set! (-> self control ctrl-xz-vel) (* 40960.0 (-> self darkjak-giant-interp))) - (none) ) :code (-> target-walk code) :post (behavior () @@ -564,7 +545,6 @@ ) (set! (-> self control turn-lockout-end-time) (+ (current-time) (seconds 0.1))) (target-post) - (none) ) ) @@ -789,7 +769,6 @@ (set! (-> self control bend-target) 1.0) (set! (-> self control mod-surface) *duck-mods*) (target-collide-set! 'duck 1.0) - (none) ) :exit (behavior () (if (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -808,7 +787,6 @@ (if (= (-> self control collide-mode) 'duck) (target-collide-set! 'normal 0.0) ) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -863,7 +841,6 @@ ) (fall-test target-falling -4096000.0) (slide-down-test) - (none) ) :code (behavior ((arg0 symbol)) (let ((v1-2 (ja-group))) @@ -945,7 +922,6 @@ ) ) #f - (none) ) :post target-post ) @@ -963,7 +939,6 @@ (set! (-> self control mod-surface) *duck-mods*) ) ) - (none) ) :exit (-> target-duck-stance exit) :trans (behavior () @@ -1019,7 +994,6 @@ ) (fall-test target-falling -4096000.0) (slide-down-test) - (none) ) :code (behavior ((arg0 symbol)) (let ((gp-0 (if (using-gun? self) @@ -1064,7 +1038,6 @@ (suspend) ) #f - (none) ) :post target-post ) @@ -1126,7 +1099,6 @@ (set! (-> self control unknown-float35) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) ) - (none) ) :exit target-exit :trans (behavior () @@ -1190,7 +1162,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) (seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) (let ((f28-0 20.0) @@ -1314,7 +1285,6 @@ ) (target-falling-anim -1 (seconds 0.2)) (go target-falling #f) - (none) ) :post target-post ) @@ -1324,7 +1294,6 @@ :enter (behavior ((arg0 float) (arg1 float)) ((-> target-jump enter) arg0 arg1 (the-as surface #f)) (set! (-> self control mod-surface) *forward-jump-mods*) - (none) ) :exit target-exit :trans (-> target-jump trans) @@ -1375,7 +1344,6 @@ (ja :group! (-> self draw art-group data 27) :num! (loop!)) ) #f - (none) ) :post target-post ) @@ -1399,7 +1367,6 @@ (if (!= (-> self control mod-surface) *slide-jump-mods*) (set! (-> self control mod-surface) *double-jump-mods*) ) - (none) ) :exit target-exit :trans (behavior () @@ -1444,7 +1411,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) (seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (sound-play "jump-double") @@ -1511,7 +1477,6 @@ ) (target-falling-anim -1 (seconds 0.2)) (go target-falling #f) - (none) ) :post target-post ) @@ -1552,7 +1517,6 @@ (set! (-> self control unknown-float35) (fmax 0.0 (fmin 0.5 (* 0.00008138021 (+ -409.6 (-> self control ctrl-xz-vel))))) ) - (none) ) :exit target-exit :trans (behavior () @@ -1601,7 +1565,6 @@ (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control ctrl-xz-vel))))) (seconds-per-frame) ) - (none) ) :code (-> target-jump code) :post target-post @@ -1619,7 +1582,6 @@ (else ) ) - (none) ) :exit target-exit :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) @@ -1653,7 +1615,6 @@ ) ) (go target-duck-high-jump-jump arg0 arg1 arg2) - (none) ) :post target-post ) @@ -1675,7 +1636,6 @@ (set! (-> self control mod-surface) *high-jump-mods*) ) ) - (none) ) :exit target-exit :trans (behavior () @@ -1703,7 +1663,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (when (using-gun? self) @@ -1800,7 +1759,6 @@ #f ) ) - (none) ) :post target-post ) @@ -1818,7 +1776,6 @@ ) (set! (-> self control unknown-word04) (the-as uint arg0)) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (target-falling-trans @@ -1829,7 +1786,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol)) (case arg0 @@ -1857,7 +1813,6 @@ ) ) (target-falling-anim -1 (seconds 0.33)) - (none) ) :post target-post ) @@ -1959,11 +1914,9 @@ ) ) ) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) - (none) ) :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) @@ -2010,12 +1963,10 @@ ) (fall-test target-falling -4096000.0) (slide-down-test) - (none) ) :code (behavior ((arg0 symbol)) (target-hit-ground-anim #f (are-still?)) (go target-stance) - (none) ) :post target-post ) @@ -2081,19 +2032,19 @@ ) (defstate target-attack (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (cond (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 1920) ) (when (target-send-attack proc (-> self control danger-mode) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as int (-> self control target-attack-id)) (the-as int (-> self control attack-count)) (-> self control penetrate-using) @@ -2106,12 +2057,12 @@ ) ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) (('gun-combo) - (when (-> event param 0) + (when (-> block param 0) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) @@ -2126,7 +2077,7 @@ #f ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -2149,7 +2100,6 @@ (quaternion-copy! (-> self control unknown-quaternion04) (-> self control dir-targ)) (set! (-> self control unknown-float41) 0.0) (set! (-> self control unknown-float42) 0.0) - (none) ) :exit (behavior () (if (zero? (-> self gun track-target-hold-time)) @@ -2157,7 +2107,6 @@ ) (set! (-> self control last-attack-end-time) (current-time)) (target-exit) - (none) ) :code (behavior () (let ((gp-0 (-> self draw art-group data 40))) @@ -2303,7 +2252,6 @@ ) ) (go target-stance) - (none) ) :post target-post ) @@ -2335,19 +2283,19 @@ ) (defstate target-running-attack (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (cond (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 1920) ) (let ((gp-1 (target-send-attack proc (-> self control danger-mode) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as int (-> self control target-attack-id)) (the-as int (-> self control attack-count)) (-> self control penetrate-using) @@ -2397,12 +2345,12 @@ ) ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) (('gun-combo) - (if (-> event param 0) + (if (-> block param 0) (go target-stance) ) #t @@ -2411,7 +2359,7 @@ #f ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -2452,7 +2400,6 @@ (set! (-> self control bend-target) 1.0) ) (set! (-> self upper-body twist z) 0.0) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) @@ -2461,7 +2408,6 @@ (set! (-> *run-attack-mods* turnvv) 0.0) (set! (-> self control last-running-attack-end-time) (current-time)) (target-exit) - (none) ) :trans (behavior () (when (!= (-> self state-time) (current-time)) @@ -2536,7 +2482,6 @@ (talker-spawn-func (-> *talker-speech* 328) *entity-pool* (target-pos 0) (the-as region #f)) ) ) - (none) ) :code (behavior () (if (logtest? (water-flags touch-water) (-> self water flags)) @@ -2799,7 +2744,6 @@ ) ) (go target-stance) - (none) ) :post target-post ) @@ -2855,15 +2799,15 @@ ) (defstate target-attack-air (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v0-0 (target-bonk-event-handler proc arg1 event-type event))) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v0-0 (target-bonk-event-handler proc argc message block))) (cond (v0-0 (empty) v0-0 ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -2941,14 +2885,12 @@ ) (set! (-> self control dynam gravity-length) 122880.0) (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) (set! (-> self control last-attack-end-time) (current-time)) (target-exit) - (none) ) :trans (behavior () (when (logtest? (-> self control status) (collide-status on-surface)) @@ -2989,12 +2931,10 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol)) (target-attack-air-anim) (go target-falling #f) - (none) ) :post target-post ) @@ -3059,7 +2999,6 @@ ) (set! (-> self control unknown-sound-id00) (new 'static 'sound-id)) 0 - (none) ) :exit (behavior () (if (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-bomb1))) @@ -3075,7 +3014,6 @@ ) ) (target-exit) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (let* ((v1-2 (ja-group)) @@ -3161,16 +3099,15 @@ ) ) (go target-attack-uppercut-jump arg0 arg1) - (none) ) :post target-post ) (defstate target-attack-uppercut-jump (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('gun-combo) - (when (-> event param 0) + (when (-> block param 0) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) @@ -3202,7 +3139,7 @@ #t ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -3221,7 +3158,6 @@ (set! (-> self gun combo-window-state) (-> self state name)) (set! (-> self gun track-target-hold-time) 0) 0 - (none) ) :exit target-exit :trans (behavior () @@ -3273,7 +3209,6 @@ (target-danger-set! 'harmless #f) ) (slide-down-test) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (when (or (= (-> self skel top-anim frame-group) (-> self draw art-group data 267)) @@ -3344,21 +3279,20 @@ ) (set! (-> self gun surpress-time) (current-time)) (go target-falling #f) - (none) ) :post target-post ) (defstate target-flop (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v1-0 symbol)) - (let ((v0-0 (target-bonk-event-handler proc arg1 event-type event))) + (let ((v0-0 (target-bonk-event-handler proc argc message block))) (cond (v0-0 (empty) v0-0 ) - ((begin (set! v1-0 event-type) (= v1-0 'slide)) + ((begin (set! v1-0 message) (= v1-0 'slide)) #f ) ((= v1-0 'swim) @@ -3374,7 +3308,7 @@ ) ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -3418,7 +3352,6 @@ ) ) ) - (none) ) :exit (behavior () (let ((v1-2 (get-channel (-> self skel top-anim) 0))) @@ -3435,7 +3368,6 @@ (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) (set! (-> self control dynam gravity quad) (-> self control standard-dynamics gravity quad)) (set! (-> self neck flex-blend) 1.0) - (none) ) :trans (behavior () (delete-back-vel) @@ -3501,7 +3433,6 @@ (target-start-attack) (target-danger-set! 'flop #f) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 float)) (if (using-gun? self) @@ -3627,26 +3558,25 @@ ) ) #f - (none) ) :post target-post ) (defstate target-flop-hit-ground (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond ((and (-> self next-state) (= (-> self next-state name) 'target-flop-hit-ground)) - (case event-type + (case message (('swim 'slide) #f ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) (else - (target-jump-event-handler proc arg1 event-type event) + (target-jump-event-handler proc argc message block) ) ) ) @@ -3676,7 +3606,6 @@ (else ) ) - (none) ) :exit target-exit :trans (behavior () @@ -3709,24 +3638,22 @@ ) ) (slide-down-test) - (none) ) :code (behavior ((arg0 symbol)) (target-hit-ground-anim arg0 (are-still?)) (go target-falling #f) - (none) ) :post target-post ) (defstate target-roll (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (= event-type 'touched) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (= message 'touched) (send-event proc 'roll) ) - (case event-type + (case message (('gun-combo) - (when (-> event param 0) + (when (-> block param 0) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) @@ -3740,7 +3667,7 @@ #t ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -3762,7 +3689,6 @@ (set! (-> self control unknown-word04) (the-as uint 0)) (set! (-> self control did-move-to-pole-or-max-jump-height) 0.0) (set! (-> self gun track-target-hold-time) 0) - (none) ) :exit (behavior () (when (not (and (-> self next-state) (= (-> self next-state name) 'target-roll))) @@ -3771,7 +3697,6 @@ ) (target-exit) (target-collide-set! 'normal 0.0) - (none) ) :code (behavior () (let ((gp-0 0)) @@ -3884,16 +3809,15 @@ ) (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) (go target-duck-stance 'roll) - (none) ) :post target-post ) (defstate target-roll-flip (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('gun-combo) - (when (-> event param 0) + (when (-> block param 0) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) @@ -3905,7 +3829,7 @@ #t ) (else - (target-jump-event-handler proc arg1 event-type event) + (target-jump-event-handler proc argc message block) ) ) ) @@ -3917,12 +3841,10 @@ (set! (-> self gun combo-window-start) (current-time)) (set! (-> self gun combo-window-state) (-> self state name)) (target-collide-set! 'duck 1.0) - (none) ) :exit (behavior () (target-exit) (target-collide-set! 'normal 0.0) - (none) ) :trans (behavior () (if (and (or (smack-surface? #f) @@ -3947,7 +3869,6 @@ ) (go target-attack-air #f) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (local-vars (v1-37 symbol)) @@ -4075,7 +3996,6 @@ ) ) ) - (none) ) :post target-post ) diff --git a/goal_src/jak2/engine/target/target2.gc b/goal_src/jak2/engine/target/target2.gc index a98b12b491a..ad4d5f3e899 100644 --- a/goal_src/jak2/engine/target/target2.gc +++ b/goal_src/jak2/engine/target/target2.gc @@ -16,14 +16,14 @@ ) (defstate target-load-wait (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('loading) (set! (-> self state-time) (current-time)) #f ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -79,19 +79,18 @@ ) ) (go target-stance) - (none) ) :post target-no-stick-post ) (defstate target-stance-ambient (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('movie) (go target-stance) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -138,7 +137,6 @@ ) ) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (set! (-> self ambient-time) (current-time)) @@ -152,7 +150,6 @@ (set! (-> self spool-anim) #f) ((-> target-stance exit)) (target-exit) - (none) ) :trans (behavior () (gui-control-method-12 @@ -171,7 +168,6 @@ ) (go target-stance) ) - (none) ) :code (behavior () (while (let ((v1-15 (file-status *art-control* (-> self spool-anim name) 0))) @@ -190,7 +186,6 @@ (lambda ((arg0 process-drawable)) (!= (-> *cpad-list* cpads 0 stick0-speed) 0.0)) ) (go target-stance) - (none) ) :post target-post ) @@ -212,7 +207,6 @@ (suspend) ) (go target-stance) - (none) ) :post target-post ) @@ -223,46 +217,43 @@ ) (defstate target-look-around (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) - (-> self state name) - ) - (else - (let ((v1-4 event-type)) - (cond - ((= v1-4 'end-mode) - (if (not (focus-test? self dead)) - (go target-stance-look-around) - ) - ) - ((= v1-4 'gun) - (the-as object (target-gun-fire (the-as pickup-type (-> event param 0)))) - ) - ((-> self control danger-mode) - (target-dangerous-event-handler proc arg1 event-type event) - ) - (else - (target-standard-event-handler proc arg1 event-type event) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (cond + ((and (= message 'query) (= (-> block param 0) 'mode)) + (-> self state name) + ) + (else + (let ((v1-4 message)) + (cond + ((= v1-4 'end-mode) + (if (not (focus-test? self dead)) + (go target-stance-look-around) + ) + ) + ((= v1-4 'gun) + (target-gun-fire (the-as pickup-type (-> block param 0))) + ) + ((-> self control danger-mode) + (target-dangerous-event-handler proc argc message block) + ) + (else + (target-standard-event-handler proc argc message block) + ) ) + ) + ) + ) ) :enter (behavior () (set! (-> self cam-user-mode) 'look-around) (set! (-> self control mod-surface) *look-around-mods*) (logior! (-> self focus-status) (focus-status in-head)) (set-setting! 'mode-name 'cam-eye 0.0 0) - (none) ) :exit (behavior () (set! (-> self cam-user-mode) 'normal) (target-exit) (remove-setting! 'mode-name) - (none) ) :trans (behavior () (when (or (cpad-pressed? (-> self control cpad number) r3) (< 2048.0 (target-height-above-ground))) @@ -270,7 +261,6 @@ (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (pad-buttons r3)) (set! (-> self cam-user-mode) 'normal) ) - (none) ) :code (behavior () (local-vars (a1-0 event-message-block) (f30-0 float)) @@ -296,7 +286,6 @@ (suspend) ) #f - (none) ) :post (behavior () (target-no-move-post) @@ -311,72 +300,70 @@ (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) (target-gun-check) ) - (none) ) ) (defstate target-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) - (-> self state name) - ) - (else - (case event-type - (('end-mode) - (go target-stance) - ) - (('play-anim) - (go target-grab (the-as symbol (-> event param 0))) - ) - (('clone-anim) - (go target-clone-anim (process->handle (the-as process (-> event param 0)))) - ) - (('change-mode) - (case (-> event param 0) - (('normal) - (cond - ((and (focus-test? self dark) (nonzero? (-> self darkjak))) - (the-as object (target-darkjak-end-mode)) - ) - ((using-gun? self) - (target-gun-end-mode #t) - ) - ) - ) - (('gun) - (cond - ((using-gun? self) - (send-event self 'gun-type (-> event param 2)) - ) - ((want-to-gun? self #t) - (if (logtest? (-> self game features) (game-feature gun)) - (the-as object (target-gun-init (the-as int (-> event param 2)))) - ) - ) - ) - ) - (('demo) - (go target-demo #f) - ) - (('title) - (go target-title #f) - ) - ) - ) - (('anim) - (let ((v0-0 (the-as object (-> event param 0)))) - (set! (-> self control unknown-word04) (the-as uint v0-0)) - v0-0 - ) - ) - (else - (target-generic-event-handler proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (cond + ((and (= message 'query) (= (-> block param 0) 'mode)) + (-> self state name) + ) + (else + (case message + (('end-mode) + (go target-stance) + ) + (('play-anim) + (go target-grab (the-as symbol (-> block param 0))) + ) + (('clone-anim) + (go target-clone-anim (process->handle (the-as process (-> block param 0)))) + ) + (('change-mode) + (case (-> block param 0) + (('normal) + (cond + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) + (target-darkjak-end-mode) + ) + ((using-gun? self) + (target-gun-end-mode #t) + ) + ) + ) + (('gun) + (cond + ((using-gun? self) + (send-event self 'gun-type (-> block param 2)) + ) + ((want-to-gun? self #t) + (if (logtest? (-> self game features) (game-feature gun)) + (target-gun-init (the-as int (-> block param 2))) ) + ) + ) + ) + (('demo) + (go target-demo #f) + ) + (('title) + (go target-title #f) + ) + ) + ) + (('anim) + (let ((v0-0 (the-as object (-> block param 0)))) + (set! (-> self control unknown-word04) (the-as uint v0-0)) + v0-0 + ) + ) + (else + (target-generic-event-handler proc argc message block) ) + ) + ) + ) ) :enter (behavior ((arg0 symbol)) (set! (-> self control mod-surface) *grab-mods*) @@ -385,13 +372,11 @@ (logior! (-> self focus-status) (focus-status grabbed)) (set! (-> self control unknown-word04) (the-as uint arg0)) (logior! (-> self skel effect flags) (effect-control-flag ecf2)) - (none) ) :exit (behavior () (set! (-> self ambient-time) (current-time)) (logclear! (-> self state-flags) (state-flags sf2)) (target-exit) - (none) ) :code (behavior ((arg0 symbol)) (set-forward-vel 0.0) @@ -532,7 +517,6 @@ (label cfg-82) ) #f - (none) ) :post (behavior () (if (logtest? (-> self control status) (collide-status on-surface)) @@ -540,15 +524,14 @@ ) (set! (-> self game kiosk-timeout) (the-as uint (-> *display* game-clock frame-counter))) (target-no-stick-post) - (none) ) ) (defstate target-pole-cycle (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'query) (= (-> event param 0) 'mode)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) :enter (behavior ((arg0 handle)) @@ -562,13 +545,11 @@ (send-event *camera* 'ease-in) (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float #f)) (set! (-> self control hand-to-edge-dist) 0.5) - (none) ) :exit (behavior () (target-collide-set! 'normal 0.0) (logclear! (-> self focus-status) (focus-status pole)) (set! (-> self control anim-handle) (the-as handle #f)) - (none) ) :trans (behavior () (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) @@ -614,7 +595,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 handle)) (sound-play "edge-grab") @@ -669,7 +649,6 @@ ) ) #f - (none) ) :post target-no-move-post ) @@ -690,7 +669,6 @@ ) (set-forward-vel arg2) (go target-pole-flip-up-jump (the-as float arg0) (the-as float arg1)) - (none) ) :post target-no-move-post ) @@ -700,13 +678,11 @@ :enter (behavior ((arg0 float) (arg1 float)) ((-> target-jump-forward enter) arg0 arg1) (set! (-> self control mod-surface) *forward-pole-jump-mods*) - (none) ) :exit target-exit :trans (behavior () ((-> target-jump-forward trans)) (vector-flatten! (-> self control transv) (-> self control transv) (-> self control edge-grab-edge-dir)) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (send-event *camera* 'damp-up) @@ -728,7 +704,6 @@ (ja :group! (-> self draw art-group data 27) :num! (loop!)) ) #f - (none) ) :post target-post ) @@ -749,7 +724,6 @@ ) (set-forward-vel arg2) (go target-pole-flip-forward-jump arg0 arg1) - (none) ) :post target-no-move-post ) @@ -759,13 +733,11 @@ :enter (behavior ((arg0 float) (arg1 float)) ((-> target-jump enter) arg0 arg1 (the-as surface #f)) (set! (-> self control mod-surface) *forward-pole-jump-mods*) - (none) ) :exit target-exit :trans (behavior () ((-> target-jump-forward trans)) (vector-flatten! (-> self control transv) (-> self control transv) (-> self control edge-grab-edge-dir)) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (until (ja-done? 0) @@ -773,19 +745,18 @@ (ja :num! (seek!)) ) ((the-as (function none :behavior target) (-> target-pole-flip-up-jump code))) - (none) ) :post target-post ) (defstate target-edge-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (go target-falling 'target-edge-grab) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -803,7 +774,6 @@ (if (!= (-> self skel top-anim interp) 0.0) (set! (-> self skel top-anim interp) 0.000000000000000000000000000000001) ) - (none) ) :exit (behavior () (let ((v1-2 (handle->process (-> self control unknown-handle000)))) @@ -826,7 +796,6 @@ (set! (-> self skel top-anim interp) 1.0) ) (set! (-> self control draw-offset y) 0.0) - (none) ) :trans (behavior () (when (and (>= (- (current-time) (-> self state-time)) (seconds 0.2)) @@ -895,7 +864,6 @@ (if (using-gun? self) (seek! (-> self control draw-offset y) 778.24 (* 4096.0 (seconds-per-frame))) ) - (none) ) :code (behavior () (target-compute-edge) @@ -957,19 +925,18 @@ ) ) (target-edge-grab-anim (the-as float (-> self control unknown-word04))) - (none) ) :post target-no-move-post ) (defstate target-edge-grab-jump (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (go target-falling 'target-edge-grab) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -1028,7 +995,6 @@ (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) (send-event *camera* 'damp-up) (go target-jump-forward arg0 arg1) - (none) ) :post target-no-move-post ) @@ -1073,7 +1039,6 @@ (send-event self 'push-transv (-> self control rider-last-move) (seconds 100)) ) (go target-falling 'target-edge-grab) - (none) ) :post target-no-move-post ) @@ -1091,14 +1056,12 @@ (set-forward-vel 0.0) (set! (-> self control mod-surface) *hit-ground-hard-mods*) (logior! (-> self focus-status) (focus-status hit)) - (none) ) :exit (behavior () (if (not (and (-> self next-state) (= (-> self next-state name) 'target-death))) (logclear! (-> self focus-status) (focus-status dead hit)) ) (target-exit) - (none) ) :code (behavior ((arg0 float)) (when (!= arg0 0.0) @@ -1138,7 +1101,6 @@ (go target-stance) ) ) - (none) ) :post target-no-stick-post ) @@ -1182,7 +1144,6 @@ (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) ) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (if (using-gun? self) @@ -1190,7 +1151,6 @@ ) (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) (set! (-> self control bend-target) 0.0) - (none) ) :trans (behavior () (if (and (logtest? (water-flags wading) (-> self water flags)) (not (using-gun? self))) @@ -1269,7 +1229,6 @@ (slide-down-test) (fall-test target-falling -4096000.0) (set-forward-vel (* 0.7 (-> self control ctrl-xz-vel))) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1434,16 +1393,15 @@ ) ) #f - (none) ) :post target-post ) (defstate target-launch (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'query) (= (-> event param 0) 'mode)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'query) (= (-> block param 0) 'mode)) 'target-launch - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) :code (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) @@ -1531,7 +1489,6 @@ ) ) (go target-high-jump arg0 arg0 'launch) - (none) ) :post target-no-stick-post ) @@ -1543,12 +1500,10 @@ (move-to-ground (-> self control) 40960.0 40960.0 #f (-> self control root-prim prim-core collide-with)) (logior! (-> self focus-status) (focus-status grabbed)) (set! (-> self neck flex-blend) 0.0) - (none) ) :exit (behavior () (send-event (handle->process (-> self control anim-handle)) 'end-mode) (target-exit) - (none) ) :code (behavior ((arg0 string) (arg1 handle)) (let ((gp-0 (get-art-by-name (-> self draw art-group) arg0 art-joint-anim))) @@ -1564,17 +1519,16 @@ ) ) (go target-stance) - (none) ) :post target-no-stick-post ) (defstate target-clone-anim (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) (set! (-> self control unknown-word04) (the-as uint #f)) ) - ((-> target-grab event) proc arg1 event-type event) + ((-> target-grab event) proc argc message block) ) :enter (behavior ((arg0 handle)) (set! (-> self control anim-handle) arg0) @@ -1585,7 +1539,6 @@ (vector-reset! (-> self control transv)) (set! (-> self neck flex-blend) 0.0) (send-event (ppointer->process (-> self sidekick)) 'shadow #t) - (none) ) :exit (behavior () (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) @@ -1624,12 +1577,10 @@ (ja-channel-set! 0) (ja-post) (target-exit) - (none) ) :code (behavior ((arg0 handle)) (clone-anim arg0 #t "") (go target-stance) - (none) ) :post target-no-ja-move-post ) @@ -1668,7 +1619,6 @@ (set! (-> self control dynam gravity-length) 0.0) (set! (-> self control mod-surface) *float-mods*) (target-darkjak-end-mode) - (none) ) :exit (behavior () (sound-play-by-spec (static-sound-spec "menu-back" :fo-curve 1) (new-sound-id) (the-as vector #t)) @@ -1684,7 +1634,6 @@ (if (nonzero? (-> self board)) (set! (-> self board latch?) #f) ) - (none) ) :trans (behavior () (set! (-> self control time-of-last-debug-float) (current-time)) @@ -1755,7 +1704,6 @@ ) ) ) - (none) ) :code target-stance-anim :post target-post diff --git a/goal_src/jak2/engine/ui/progress/progress.gc b/goal_src/jak2/engine/ui/progress/progress.gc index e86e0b6f61c..7da5f0e48c0 100644 --- a/goal_src/jak2/engine/ui/progress/progress.gc +++ b/goal_src/jak2/engine/ui/progress/progress.gc @@ -264,7 +264,6 @@ (suspend) ) #f - (none) ) :post (behavior () (vector<-cspace! @@ -345,7 +344,6 @@ ) (quaternion-normalize! (-> self root quat)) (ja-post) - (none) ) ) @@ -1396,7 +1394,6 @@ :enter (behavior () (sound-play "ring-appear") (set! (-> self pos-transition) 1.0) - (none) ) :trans (behavior () (let ((f30-0 (if (= (-> *progress-state* starting-state) 'main) @@ -1423,7 +1420,6 @@ (go-virtual idle) ) ) - (none) ) :code (behavior () (until #f @@ -1432,7 +1428,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior progress) ja-post) ) @@ -1645,7 +1640,6 @@ ) :enter (behavior () (set! (-> self menu-transition) 1.0) - (none) ) :trans progress-trans :code (behavior () @@ -1654,7 +1648,6 @@ (suspend) ) #f - (none) ) :post progress-post ) @@ -1672,7 +1665,6 @@ ) ) ) - (none) ) :trans (behavior () ;; og:preserve-this added variable @@ -1690,7 +1682,6 @@ ) ) (set-ring-position self) - (none) )) :code (behavior () (let ((gp-0 #f)) @@ -1704,7 +1695,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior progress) ja-post) ) @@ -1722,7 +1712,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) diff --git a/goal_src/jak2/kernel/gkernel-h.gc b/goal_src/jak2/kernel/gkernel-h.gc index dc04d2560c7..b16e98b6489 100644 --- a/goal_src/jak2/kernel/gkernel-h.gc +++ b/goal_src/jak2/kernel/gkernel-h.gc @@ -432,13 +432,13 @@ ;; a "protect" frame is a way to indicate there's a "exit" function that should ;; run if there's a "throw" or "abandon". (deftype protect-frame (stack-frame) - ((exit (function none) :offset-assert 12) + ((exit (function object) :offset-assert 12) ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 (:methods - (new (symbol type (function none)) protect-frame 0) + (new (symbol type (function object)) protect-frame 0) ) ) @@ -526,7 +526,7 @@ ;; This type is just a container to hold those functions. (deftype state (protect-frame) ((code function :offset-assert 16) - (trans (function none) :offset-assert 20) + (trans (function object) :offset-assert 20) (post function :offset-assert 24) (enter function :offset-assert 28) (event (function process int symbol event-message-block object) :offset-assert 32) @@ -539,9 +539,9 @@ type symbol function - (function none) + (function object) function - (function none) + (function object) (function process int symbol event-message-block object)) _type_ 0) ) diff --git a/goal_src/jak2/kernel/gkernel.gc b/goal_src/jak2/kernel/gkernel.gc index 1274aa19b45..4b1b39e89c7 100644 --- a/goal_src/jak2/kernel/gkernel.gc +++ b/goal_src/jak2/kernel/gkernel.gc @@ -1990,7 +1990,7 @@ ) ;; decomp deviation -(defmethod new protect-frame ((allocation symbol) (type-to-make type) (arg0 (function none))) +(defmethod new protect-frame ((allocation symbol) (type-to-make type) (arg0 (function object))) "Create a new protect frame, must be on the stack." (with-pp (let ((v0-0 (the-as protect-frame (+ (the-as int allocation) 4)))) diff --git a/goal_src/jak2/kernel/gstate.gc b/goal_src/jak2/kernel/gstate.gc index d0ce9b71657..e2a07929947 100644 --- a/goal_src/jak2/kernel/gstate.gc +++ b/goal_src/jak2/kernel/gstate.gc @@ -263,9 +263,9 @@ It type checks the arguments for the entry function. (type-to-make type) (name symbol) (code function) - (trans (function none)) + (trans (function object)) (enter function) - (exit (function none)) + (exit (function object)) (event (function process int symbol event-message-block object))) "Allocate a new state. It seems like this isn't really used much and most states are statically allocated and as a result don't have the constructor called." diff --git a/goal_src/jak2/levels/atoll/atoll-obs.gc b/goal_src/jak2/levels/atoll/atoll-obs.gc index 6b869257ecd..de912c1b355 100644 --- a/goal_src/jak2/levels/atoll/atoll-obs.gc +++ b/goal_src/jak2/levels/atoll/atoll-obs.gc @@ -37,13 +37,12 @@ (defstate idle (piston) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('sync) - (-> self sync) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('sync) + (-> self sync) + ) + ) ) :trans (behavior () (cond @@ -70,7 +69,6 @@ (go-virtual running) ) ) - (none) ) :code (the-as (function none :behavior piston) sleep-code) ) @@ -88,7 +86,6 @@ (let ((f1-1 (- (-> self range-top) (-> self range-bottom)))) (set! (-> self root trans y) (+ (-> self init-height) (+ (-> self range-bottom) f1-1))) ) - (none) ) :code (the-as (function none :behavior piston) transform-and-sleep) ) @@ -100,7 +97,6 @@ (if (logtest? (actor-option user18) (-> self fact options)) (set! (-> self sound-time 0) (+ (get-timeframe-offset! (-> self sync) 0) (seconds -0.1))) ) - (none) ) :trans (the-as (function none :behavior piston) rider-trans) :code (the-as (function none :behavior piston) sleep-code) @@ -116,7 +112,6 @@ (+! (-> self sound-time 0) (the int (* 0.5 (the float (-> self sync period))))) ) (rider-post) - (none) ) ) @@ -246,8 +241,8 @@ This commonly includes things such as: (defstate idle (turbine) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('rise) (go-virtual risen) ) @@ -258,7 +253,6 @@ This commonly includes things such as: (go-virtual risen) ) (rider-trans) - (none) ) :code (the-as (function none :behavior turbine) sleep-code) :post (behavior () @@ -270,7 +264,6 @@ This commonly includes things such as: ) (update! (-> self sound)) (rider-post) - (none) ) ) @@ -278,7 +271,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self dest-height) (+ (-> self root trans y) (-> self rise-height))) - (none) ) :trans (the-as (function none :behavior turbine) rider-trans) :code (the-as (function none :behavior turbine) sleep-code) @@ -291,7 +283,6 @@ This commonly includes things such as: ) (update! (-> self sound)) (rider-post) - (none) ) ) @@ -388,8 +379,8 @@ This commonly includes things such as: (defstate idle-up (liftcat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden 'edge-grabbed) (go-virtual going-down) ) @@ -405,18 +396,16 @@ This commonly includes things such as: (defstate going-down (liftcat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('query) - 1 - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('query) + 1 + ) + ) ) :enter (behavior () (set! (-> self state-time) (current-time)) (sound-play "liftcat") - (none) ) :trans (behavior () (rider-trans) @@ -433,7 +422,6 @@ This commonly includes things such as: (set! (-> gp-0 trans y) (-> self down-y)) ) ) - (none) ) :code (the-as (function none :behavior liftcat) sleep-code) :post (the-as (function none :behavior liftcat) rider-post) @@ -441,17 +429,15 @@ This commonly includes things such as: (defstate idle-down (liftcat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('query) - 2 - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('query) + 2 + ) + ) ) :enter (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (none) ) :code (the-as (function none :behavior liftcat) sleep-code) ) @@ -584,7 +570,6 @@ This commonly includes things such as: (quaternion*! (-> self root quat) (-> self init-quat) a2-1) ) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -637,11 +622,9 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (rider-post) - (none) ) ) @@ -737,44 +720,41 @@ This commonly includes things such as: (defstate idle (slider) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touch 'attack) - (when (>= (- (current-time) (the-as int (-> self collide-off-timer))) (seconds 2)) - (let* ((s4-0 proc) - (s3-0 (if (type? s4-0 process-focusable) - s4-0 - ) - ) - ) - (when s3-0 - (let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) - (let* ((v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s3-0) 0))) - (f0-1 (vector-dot s4-1 v1-7)) - ) - (if (< 0.0 f0-1) - (vector-float*! s4-1 s4-1 -1.0) - ) - ) - (sound-play "slide-zap") - (send-event - proc - 'attack-or-shove - (-> event param 0) - (static-attack-info ((id (-> self attack-id)) (vector s4-1) (shove-back (meters 8)) (shove-up (meters 3)))) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (when (>= (- (current-time) (the-as int (-> self collide-off-timer))) (seconds 2)) + (let* ((s4-0 proc) + (s3-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when s3-0 + (let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (let* ((v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s3-0) 0))) + (f0-1 (vector-dot s4-1 v1-7)) + ) + (if (< 0.0 f0-1) + (vector-float*! s4-1 s4-1 -1.0) + ) ) - (let ((v0-0 (current-time))) - (set! (-> self collide-off-timer) (the-as uint v0-0)) - v0-0 + (sound-play "slide-zap") + (send-event + proc + 'attack-or-shove + (-> block param 0) + (static-attack-info ((id (-> self attack-id)) (vector s4-1) (shove-back (meters 8)) (shove-up (meters 3)))) ) ) + (let ((v0-0 (current-time))) + (set! (-> self collide-off-timer) (the-as uint v0-0)) + v0-0 + ) ) ) ) - ) + ) ) ) :code (the-as (function none :behavior slider) sleep-code) @@ -816,7 +796,6 @@ This commonly includes things such as: (sound-play "slide-lightning" :id (the-as sound-id (-> self sound-id))) (update! (-> self sound)) (transform-post) - (none) ) ) @@ -1006,7 +985,6 @@ This commonly includes things such as: (quaternion-normalize! (-> self root quat)) (update! (-> self sound)) (ja-post) - (none) ) ) @@ -1196,7 +1174,6 @@ This commonly includes things such as: :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak2/levels/atoll/atoll-tank.gc b/goal_src/jak2/levels/atoll/atoll-tank.gc index 46c99ef5527..73773440be4 100644 --- a/goal_src/jak2/levels/atoll/atoll-tank.gc +++ b/goal_src/jak2/levels/atoll/atoll-tank.gc @@ -1687,7 +1687,6 @@ (if (-> self is-master?) (spawn (-> self aftermath-part) (-> self root trans)) ) - (none) ) :code (behavior () (when (-> self is-master?) @@ -1695,7 +1694,6 @@ (process-spawn atoll-tank self 2 :to self) ) (sleep-code) - (none) ) ) diff --git a/goal_src/jak2/levels/atoll/juicer.gc b/goal_src/jak2/levels/atoll/juicer.gc index 9ca43426967..590dad5a015 100644 --- a/goal_src/jak2/levels/atoll/juicer.gc +++ b/goal_src/jak2/levels/atoll/juicer.gc @@ -146,7 +146,6 @@ :virtual #t :enter (behavior () (go-virtual impact) - (none) ) ) @@ -894,7 +893,6 @@ ) ) #f - (none) ) ) @@ -913,6 +911,7 @@ (none) ) +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-93 juicer ((obj juicer)) (case (-> obj jump-why) ((2) @@ -938,7 +937,6 @@ (go-virtual notice) ) (get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp) - (none) ) :code (behavior () (set! (-> self ambush-path-pt) 1) @@ -960,7 +958,6 @@ (suspend) ) #f - (none) ) ) @@ -994,7 +991,6 @@ (suspend) ) #f - (none) ) ) @@ -1043,7 +1039,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -1064,7 +1059,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -1077,7 +1071,6 @@ ) ) (set! (-> self focus-is-up) #f) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) @@ -1085,7 +1078,6 @@ (t9-0) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -1116,7 +1108,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -1184,7 +1175,6 @@ ) ) (nav-enemy-travel-post) - (none) ) ) @@ -1280,7 +1270,6 @@ (set! (-> v1-9 attack-id) v0-0) (set! (-> self attack-id) v0-0) ) - (none) ) :exit (behavior () (set! (-> self torso-track-player) #f) @@ -1292,12 +1281,10 @@ (logclear! (-> self focus-status) (focus-status dangerous)) ) (send-event (handle->process (-> self current-projectile)) 'die) - (none) ) :trans (behavior () (when (skip-check-los? (-> self los) 90) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1379,7 +1366,6 @@ (go-virtual victory) ) (go-hostile self) - (none) ) :post juicer-face-player-post ) @@ -1462,7 +1448,6 @@ ) ) #f - (none) ) ) @@ -1513,7 +1498,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (go-virtual hostile) - (none) ) ) @@ -1536,7 +1520,6 @@ ) ) #f - (none) ) ) @@ -1576,7 +1559,6 @@ ) ) (go-virtual stare) - (none) ) ) diff --git a/goal_src/jak2/levels/atoll/sniper.gc b/goal_src/jak2/levels/atoll/sniper.gc index 62bc8e9946f..d93dbf7ab1c 100644 --- a/goal_src/jak2/levels/atoll/sniper.gc +++ b/goal_src/jak2/levels/atoll/sniper.gc @@ -251,7 +251,6 @@ ) ) (set! (-> self next-pick-time) (current-time)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -275,7 +274,6 @@ ) ) #f - (none) ) :post (behavior () (when (or (logtest? (-> self nav state flags) (nav-state-flag at-target)) @@ -287,7 +285,6 @@ (set! (-> self next-pick-time) (+ (current-time) (get-rand-int-range self 300 1050))) ) (nav-enemy-method-176 self) - (none) ) ) diff --git a/goal_src/jak2/levels/castle/boss/castle-baron.gc b/goal_src/jak2/levels/castle/boss/castle-baron.gc index b854c517901..1b12df98394 100644 --- a/goal_src/jak2/levels/castle/boss/castle-baron.gc +++ b/goal_src/jak2/levels/castle/boss/castle-baron.gc @@ -38,7 +38,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior cboss-tractor) ja-post) ) @@ -86,7 +85,6 @@ This commonly includes things such as: ) ) (process-grab? *target* #f) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type elevator running) exit))) @@ -97,7 +95,6 @@ This commonly includes things such as: (process-release? *target*) (sound-stop (-> self sound-id)) (sound-play "cas-elevate-end") - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type elevator running) post))) @@ -106,7 +103,6 @@ This commonly includes things such as: ) ) (sound-play "cas-elevate" :id (-> self sound-id) :position (-> self root trans)) - (none) ) ) @@ -871,11 +867,9 @@ For example for an elevator pre-compute the distance between the first and last ) :enter (behavior () (sound-play "krew-spawn") - (none) ) :exit (behavior () (set! (-> self id) (sound-play "krew-travel")) - (none) ) :trans (behavior () (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans))) @@ -888,7 +882,6 @@ For example for an elevator pre-compute the distance between the first and last (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (vector-y-angle a0-8)) ) ) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 12) @@ -900,7 +893,6 @@ For example for an elevator pre-compute the distance between the first and last (ja :num! (seek!)) ) (go-virtual hostile) - (none) ) :post (behavior () (logior! (-> self enemy-flags) (enemy-flag directed)) @@ -919,7 +911,6 @@ For example for an elevator pre-compute the distance between the first and last ) (enemy-method-111 self) (track-target! self) - (none) ) ) @@ -932,7 +923,6 @@ For example for an elevator pre-compute the distance between the first and last (t9-2) ) ) - (none) ) ) @@ -1101,10 +1091,8 @@ For example for an elevator pre-compute the distance between the first and last ) ) -;; WARN: Return type mismatch object vs none. (defmethod go-stare2 krew-boss-clone ((obj krew-boss-clone)) (go (method-of-object obj hostile)) - (none) ) (defstate hostile (krew-boss-clone) @@ -1121,7 +1109,6 @@ For example for an elevator pre-compute the distance between the first and last (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)) :num! min) ) ) - (none) ) :code (behavior () (set! (-> self wiggle-time) (+ (current-time) (seconds -10))) @@ -1137,12 +1124,10 @@ For example for an elevator pre-compute the distance between the first and last ) ) #f - (none) ) :post (behavior () (krew-boss-clone-method-179 self (target-pos 0)) (nav-enemy-method-176 self) - (none) ) ) @@ -1185,7 +1170,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (none) ) :code (behavior () (while (not (ja-done? 0)) @@ -1197,7 +1181,6 @@ For example for an elevator pre-compute the distance between the first and last (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior krew-boss-clone) enemy-simple-post) ) @@ -1933,8 +1916,8 @@ For example for an elevator pre-compute the distance between the first and last (defstate hidden (krew-boss) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual play-intro) ) @@ -1948,13 +1931,11 @@ For example for an elevator pre-compute the distance between the first and last ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :trans (behavior () (if (task-node-closed? (game-task-node castle-boss-introduction)) (go-virtual play-intro) ) - (none) ) :code (the-as (function none :behavior krew-boss) sleep-code) ) @@ -1968,7 +1949,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> v1-5 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :code (behavior () (when (not (task-node-closed? (game-task-node castle-boss-introduction))) @@ -1982,7 +1962,6 @@ For example for an elevator pre-compute the distance between the first and last (suspend) ) (go-virtual idle) - (none) ) ) @@ -2114,7 +2093,6 @@ For example for an elevator pre-compute the distance between the first and last (krew-hit-speech self) (logclear! (-> self enemy-flags) (enemy-flag enable-on-active)) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) - (none) ) :exit (behavior () (local-vars (v1-5 enemy-flag)) @@ -2135,7 +2113,6 @@ For example for an elevator pre-compute the distance between the first and last (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) ) - (none) ) :post (behavior () (logior! (-> self enemy-flags) (enemy-flag directed)) @@ -2167,7 +2144,6 @@ For example for an elevator pre-compute the distance between the first and last (enemy-method-111 self) (nav-enemy-method-142 self (-> self nav)) (track-target! self) - (none) ) ) @@ -2271,7 +2247,6 @@ For example for an elevator pre-compute the distance between the first and last ) 0 (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) - (none) ) :exit (behavior () (set! (-> self next-shooting-frame) 200) @@ -2288,7 +2263,6 @@ For example for an elevator pre-compute the distance between the first and last (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) ) - (none) ) :trans (behavior () (local-vars @@ -2575,7 +2549,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (none) ) ) :code (behavior () @@ -2588,7 +2561,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) #f - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type nav-enemy idle) post))) @@ -2600,7 +2572,6 @@ For example for an elevator pre-compute the distance between the first and last (seek! (-> self root trans y) 1470464.0 (* 204.8 (-> self clock time-adjust-ratio))) ) (nav-enemy-method-176 self) - (none) ) ) @@ -2770,14 +2741,12 @@ For example for an elevator pre-compute the distance between the first and last (send-event *target* 'get-notify self) ) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) - (none) ) :exit (behavior () (if (logtest? (enemy-flag enemy-flag43) (-> 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)) ) - (none) ) :trans (behavior () (local-vars (v1-25 enemy-flag)) @@ -2830,7 +2799,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (none) ) :code (behavior () (ja-channel-push! 2 (seconds 0.1)) @@ -2854,7 +2822,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) #f - (none) ) :post (behavior () (let ((a0-0 self)) @@ -2976,7 +2943,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (none) ) ) @@ -3045,21 +3011,17 @@ For example for an elevator pre-compute the distance between the first and last ) (iterate-process-tree *entity-pool* - (the-as - (function object object) - (lambda ((arg0 collectable)) - (if (and (or (type? arg0 ammo-collectable) (type? arg0 health)) - (and (nonzero? (-> arg0 root)) (>= 819200.0 (vector-vector-distance (-> arg0 root trans) (target-pos 0)))) - ) - (deactivate arg0) - ) - (none) - ) + (lambda ((arg0 collectable)) + (if (and (or (type? arg0 ammo-collectable) (type? arg0 health)) + (and (nonzero? (-> arg0 root)) (>= 819200.0 (vector-vector-distance (-> arg0 root trans) (target-pos 0)))) + ) + (deactivate arg0) + ) + (none) ) *null-kernel-context* ) (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy die) exit))) @@ -3071,7 +3033,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> v1-4 sphere-mask) (the-as uint #x800f8)) ) 0 - (none) ) :trans (behavior () (let ((f30-0 (vector-vector-xz-distance (target-pos 0) (-> *krew-boss-die-positions* (-> self next-path-point))))) @@ -3091,7 +3052,6 @@ For example for an elevator pre-compute the distance between the first and last 0 ) ) - (none) ) :code (behavior () (while (< 81920.0 @@ -3142,11 +3102,9 @@ For example for an elevator pre-compute the distance between the first and last (suspend) ) (cleanup-for-death self) - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) diff --git a/goal_src/jak2/levels/castle/castle-obs.gc b/goal_src/jak2/levels/castle/castle-obs.gc index 7472c9be320..972b660f154 100644 --- a/goal_src/jak2/levels/castle/castle-obs.gc +++ b/goal_src/jak2/levels/castle/castle-obs.gc @@ -143,7 +143,6 @@ This commonly includes things such as: ((the-as (function none) t9-3)) ) ) - (none) ) ) @@ -197,10 +196,10 @@ This commonly includes things such as: (defstate idle (cas-conveyor-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((v1-1 (the-as object (-> event param 1)))) + (let ((v1-1 (the-as object (-> block param 1)))) (when (!= (-> (the-as attack-info v1-1) id) (-> self incoming-attack-id)) (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-1) id)) (when (and (-> self track-flag) (= (-> self speed) (-> self target-speed))) @@ -275,7 +274,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior cas-conveyor-switch) sleep-code) :post (behavior () @@ -348,7 +346,6 @@ This commonly includes things such as: ) ) (transform-post) - (none) ) ) @@ -479,7 +476,6 @@ This commonly includes things such as: ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (behavior () (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -501,34 +497,32 @@ This commonly includes things such as: ) ) (cleanup-for-death self) - (none) ) ) (defstate idle (cas-electric-fence) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touched) - #f - ) - (('attack) - #f - ) - (('track) - #t - ) - (('stop) - (let ((v0-0 #t)) - (set! (-> self stop) v0-0) - v0-0 - ) - ) - (('stopped?) - (-> self stop) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + #f + ) + (('attack) + #f + ) + (('track) + #t + ) + (('stop) + (let ((v0-0 #t)) + (set! (-> self stop) v0-0) + v0-0 + ) + ) + (('stopped?) + (-> self stop) + ) + ) ) :code (the-as (function none :behavior cas-electric-fence) sleep-code) :post (behavior () @@ -636,7 +630,6 @@ This commonly includes things such as: ) ) ) - (none) ) ) @@ -735,10 +728,10 @@ This commonly includes things such as: (defstate up-idle (cas-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((v1-1 (the-as attack-info (-> event param 1)))) + (let ((v1-1 (the-as attack-info (-> block param 1)))) (case (-> v1-1 mode) (('flop) (when (or (not (or (= (-> v1-1 mode) 'spin) (= (-> v1-1 mode) 'punch))) @@ -875,7 +868,6 @@ This commonly includes things such as: ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -888,7 +880,6 @@ This commonly includes things such as: ) ) (sound-play "cas-elevate" :id (-> self sound-id) :position (-> self root trans)) - (none) ) :post (behavior () (cas-elevator-method-49 self) @@ -916,7 +907,6 @@ This commonly includes things such as: (-> gp-0 id) ) ) - (none) ) ) @@ -930,7 +920,6 @@ This commonly includes things such as: ) (sound-stop (-> self sound-id)) (sound-play "cas-elevate-end") - (none) ) :post (behavior () (if (-> self bouncing) @@ -941,7 +930,6 @@ This commonly includes things such as: ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -1015,70 +1003,69 @@ For example for an elevator pre-compute the distance between the first and last (defstate idle (cas-rot-bridge) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 number)) - (the-as object (case event-type - (('move) - (set! (-> self anim-index) (/ (the-as int (-> event param 0)) 8)) - (set! v0-0 (logclear (-> self mask) (process-mask sleep-code))) - (set! (-> self mask) (the-as process-mask v0-0)) - v0-0 - ) - (('get-pos) - (set! (-> self test-index) (/ (the-as int (-> event param 0)) 8)) - (let ((f0-0 (ja-aframe-num 0))) - (cond - ((zero? (-> self test-index)) - (if (< f0-0 10.0) - (set! f0-0 10.0) - ) - (if (< 40.0 f0-0) - (set! f0-0 40.0) - ) - (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) - ) - ((= (-> self test-index) 1) - (if (< f0-0 50.0) - (set! f0-0 50.0) - ) - (if (< 80.0 f0-0) - (set! f0-0 80.0) - ) - (set! (-> self pos) (* 0.033333335 (+ -50.0 f0-0))) - ) - ((= (-> self test-index) 2) - (if (< f0-0 90.0) - (set! f0-0 90.0) - ) - (if (< 120.0 f0-0) - (set! f0-0 120.0) - ) - (set! (-> self pos) (* 0.033333335 (+ -90.0 f0-0))) - ) - ((= (-> self test-index) 3) - (if (< f0-0 10.0) - (set! f0-0 10.0) - ) - (if (< 40.0 f0-0) - (set! f0-0 40.0) - ) - (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) - ) - ) - ) - (-> self pos) - ) - (('reset) - (when (nonzero? (-> self anim-index)) - (ja-no-eval :group! (-> self draw art-group data 3) :num! min) - (set! (-> self anim-index) (the-as uint 0)) - (set! v0-0 (logclear (-> self mask) (process-mask sleep-code))) - (set! (-> self mask) (the-as process-mask v0-0)) - v0-0 - ) - ) - ) + (case message + (('move) + (set! (-> self anim-index) (/ (the-as int (-> block param 0)) 8)) + (set! v0-0 (logclear (-> self mask) (process-mask sleep-code))) + (set! (-> self mask) (the-as process-mask v0-0)) + v0-0 + ) + (('get-pos) + (set! (-> self test-index) (/ (the-as int (-> block param 0)) 8)) + (let ((f0-0 (ja-aframe-num 0))) + (cond + ((zero? (-> self test-index)) + (if (< f0-0 10.0) + (set! f0-0 10.0) + ) + (if (< 40.0 f0-0) + (set! f0-0 40.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) + ) + ((= (-> self test-index) 1) + (if (< f0-0 50.0) + (set! f0-0 50.0) + ) + (if (< 80.0 f0-0) + (set! f0-0 80.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -50.0 f0-0))) + ) + ((= (-> self test-index) 2) + (if (< f0-0 90.0) + (set! f0-0 90.0) + ) + (if (< 120.0 f0-0) + (set! f0-0 120.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -90.0 f0-0))) + ) + ((= (-> self test-index) 3) + (if (< f0-0 10.0) + (set! f0-0 10.0) + ) + (if (< 40.0 f0-0) + (set! f0-0 40.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) ) + ) + ) + (-> self pos) + ) + (('reset) + (when (nonzero? (-> self anim-index)) + (ja-no-eval :group! (-> self draw art-group data 3) :num! min) + (set! (-> self anim-index) (the-as uint 0)) + (set! v0-0 (logclear (-> self mask) (process-mask sleep-code))) + (set! (-> self mask) (the-as process-mask v0-0)) + v0-0 + ) + ) + ) ) :code (behavior () (until #f @@ -1192,7 +1179,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) #f - (none) ) :post (behavior () (let ((f0-0 (ja-aframe-num 0))) @@ -1285,7 +1271,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) (transform-post) - (none) ) ) @@ -1413,37 +1398,34 @@ This commonly includes things such as: (defstate idle (cas-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (let ((gp-0 (the-as attack-info (-> event param 1)))) - (when (or (= (-> gp-0 mode) 'spin) (= (-> gp-0 mode) 'spin-air)) - (let* ((s5-0 (the-as object (-> event param 0))) - (s4-0 (-> (the-as touching-shapes-entry s5-0) head)) - ) - (while s4-0 - (let ((a0-2 (get-touched-prim s4-0 (the-as collide-shape (-> self root)) (the-as touching-shapes-entry s5-0)))) - (when (= (-> a0-2 prim-id) 1) - (when (!= (-> gp-0 id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> gp-0 id)) - (let ((s3-0 (-> self actor-group 0))) - (dotimes (s2-0 (-> s3-0 length)) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) (process->ppointer self)) - (set! (-> a1-6 num-params) 1) - (set! (-> a1-6 message) 'move) - (set! (-> a1-6 param 0) (* (-> self anim-index) 8)) - (let ((t9-1 send-event-function) - (v1-20 (-> s3-0 data s2-0 actor)) - ) - (t9-1 - (if v1-20 - (-> v1-20 extra process) - ) - a1-6 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((gp-0 (the-as attack-info (-> block param 1)))) + (when (or (= (-> gp-0 mode) 'spin) (= (-> gp-0 mode) 'spin-air)) + (let* ((s5-0 (the-as object (-> block param 0))) + (s4-0 (-> (the-as touching-shapes-entry s5-0) head)) + ) + (while s4-0 + (let ((a0-2 (get-touched-prim s4-0 (the-as collide-shape (-> self root)) (the-as touching-shapes-entry s5-0)))) + (when (= (-> a0-2 prim-id) 1) + (when (!= (-> gp-0 id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> gp-0 id)) + (let ((s3-0 (-> self actor-group 0))) + (dotimes (s2-0 (-> s3-0 length)) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 1) + (set! (-> a1-6 message) 'move) + (set! (-> a1-6 param 0) (* (-> self anim-index) 8)) + (let ((t9-1 send-event-function) + (v1-20 (-> s3-0 data s2-0 actor)) ) + (t9-1 + (if v1-20 + (-> v1-20 extra process) + ) + a1-6 ) ) ) @@ -1451,14 +1433,14 @@ This commonly includes things such as: ) ) ) - (set! s4-0 (-> s4-0 next)) ) + (set! s4-0 (-> s4-0 next)) ) - #f ) + #f ) ) - ) + ) ) ) :trans (the-as (function none :behavior cas-switch) rider-trans) @@ -1519,7 +1501,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior cas-switch) rider-post) ) @@ -1668,20 +1649,19 @@ This commonly includes things such as: (defstate idle (cas-trapdoor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('attack) - (let ((gp-0 (the-as object (-> event param 1)))) - (when (and (not (task-node-closed? (game-task-node castle-boss-resolution))) - (logtest? (-> (the-as attack-info gp-0) penetrate-using) (penetrate flop)) - ) - (go-virtual die) - #f - ) - ) - ) - ) - ) + :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 (not (task-node-closed? (game-task-node castle-boss-resolution))) + (logtest? (-> (the-as attack-info gp-0) penetrate-using) (penetrate flop)) + ) + (go-virtual die) + #f + ) + ) + ) + ) ) :code (the-as (function none :behavior cas-trapdoor) sleep-code) ) @@ -1720,7 +1700,6 @@ This commonly includes things such as: :to self ) ) - (none) ) :code (behavior () (sound-play "trapdoor") @@ -1736,7 +1715,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior cas-trapdoor) ja-post) ) @@ -1807,8 +1785,8 @@ This commonly includes things such as: (defstate idle (cas-chain-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (sound-play "cas-shelf-plat") (go-virtual drop) @@ -1834,7 +1812,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (go-virtual down) - (none) ) :post (the-as (function none :behavior cas-chain-plat) transform-post) ) @@ -1921,26 +1898,23 @@ This commonly includes things such as: (defstate idle (cas-rot-blade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touched) - (let* ((s4-0 (the-as object (-> event param 0))) - (s3-0 (-> (the-as touching-shapes-entry s4-0) head)) - ) - (while s3-0 - (let ((a0-3 (get-touched-prim s3-0 (the-as collide-shape (-> self root)) (the-as touching-shapes-entry s4-0)))) - (if (= (-> a0-3 prim-id) 1) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (new-attack-id))))) - ) - ) - (set! s3-0 (-> s3-0 next)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (let* ((s4-0 (the-as object (-> block param 0))) + (s3-0 (-> (the-as touching-shapes-entry s4-0) head)) + ) + (while s3-0 + (let ((a0-3 (get-touched-prim s3-0 (the-as collide-shape (-> self root)) (the-as touching-shapes-entry s4-0)))) + (if (= (-> a0-3 prim-id) 1) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (new-attack-id))))) + ) ) + (set! s3-0 (-> s3-0 next)) ) - #f ) - ) + #f + ) ) ) :trans (behavior () @@ -1951,7 +1925,6 @@ This commonly includes things such as: :id (-> self sound-id) :position (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)) ) - (none) ) :code (behavior () (until #f @@ -1965,7 +1938,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior cas-rot-blade) transform-post) ) @@ -2080,7 +2052,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior cas-flag-a) ja-post) ) @@ -2135,7 +2106,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior cas-flag-b) ja-post) ) @@ -2192,8 +2162,8 @@ This commonly includes things such as: (defstate idle (cas-robot-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual spawning) ) @@ -2201,7 +2171,6 @@ This commonly includes things such as: ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.6)) @@ -2215,30 +2184,27 @@ This commonly includes things such as: ) (set! (-> self state-time) (current-time)) ) - (none) ) :code (the-as (function none :behavior cas-robot-door) sleep-code) ) (defstate spawning (cas-robot-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('roboguard-die) - (let ((v0-0 (+ (-> self spawn-count) -1))) - (set! (-> self spawn-count) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('roboguard-die) + (let ((v0-0 (+ (-> self spawn-count) -1))) + (set! (-> self spawn-count) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self spawn-count) 0) (set! (-> self spawn-count-total) 0) (set! (-> self player-dist) (-> self notice-dist)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.6)) @@ -2249,7 +2215,6 @@ This commonly includes things such as: ) (set! (-> self state-time) (current-time)) ) - (none) ) :code (behavior () (sound-play "robo-hatch-open") @@ -2412,11 +2377,9 @@ This commonly includes things such as: (suspend) ) (sleep-code) - (none) ) :post (behavior () '() - (none) ) ) @@ -2511,7 +2474,6 @@ This commonly includes things such as: (suspend) ) (sleep-code) - (none) ) ) @@ -2668,7 +2630,6 @@ This commonly includes things such as: ) (set! (-> self timer) (current-time)) ) - (none) ) ) diff --git a/goal_src/jak2/levels/castle/pad/caspad-obs.gc b/goal_src/jak2/levels/castle/pad/caspad-obs.gc index 4f9f446feda..ca27fe9fd11 100644 --- a/goal_src/jak2/levels/castle/pad/caspad-obs.gc +++ b/goal_src/jak2/levels/castle/pad/caspad-obs.gc @@ -99,7 +99,6 @@ (configure-collision self #t) (set-setting! 'jump #f 0.0 0) ) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) @@ -109,7 +108,6 @@ (func) ) ) - (none) ) :code (behavior () (let ((frame-counter (current-time))) @@ -126,7 +124,6 @@ ) ) #f - (none) ) ) @@ -142,7 +139,6 @@ (configure-collision self #f) (remove-setting! 'jump) ) - (none) ) ) diff --git a/goal_src/jak2/levels/castle/roboguard-level.gc b/goal_src/jak2/levels/castle/roboguard-level.gc index 5c7336a59a9..3d0fa95ba18 100644 --- a/goal_src/jak2/levels/castle/roboguard-level.gc +++ b/goal_src/jak2/levels/castle/roboguard-level.gc @@ -367,7 +367,6 @@ (point-toward-point! (-> self root) (get-trans (the-as process-focusable a0-11) 0)) ) ) - (none) ) :exit (behavior () (logclear! (-> self nav flags) (nav-control-flag output-sphere-hash)) @@ -375,7 +374,6 @@ (logclear! (-> v1-2 shape nav-flags) (nav-flags has-extra-sphere)) ) 0 - (none) ) :code (behavior () (let ((a0-0 (-> self skel root-channel 0))) @@ -389,7 +387,6 @@ ) (sound-play "robo-bounce") (go-virtual roll-hostile) - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'vector))) @@ -399,7 +396,6 @@ (nav-enemy-falling-post) ) ) - (none) ) ) @@ -412,7 +408,6 @@ ) ) (roboguard-level-method-185 self (the-as symbol 0)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -482,7 +477,6 @@ ) ) #f - (none) ) :post (behavior () (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) @@ -490,7 +484,6 @@ ) (enemy-method-129 self) (ja-post) - (none) ) ) @@ -503,7 +496,6 @@ ) ) (roboguard-level-method-185 self (the-as symbol 0)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -517,7 +509,6 @@ ) ) #f - (none) ) ) @@ -527,7 +518,6 @@ (logior! (-> self flags) 4) (roboguard-level-method-185 self (the-as symbol 1)) (logand! (-> self flags) -9) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 9) @@ -539,7 +529,6 @@ (ja :num! (seek!)) ) (go-virtual roll-hostile) - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'collide-query)) @@ -550,7 +539,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -598,7 +586,6 @@ (set! (-> self roll-timer) 0) (set! (-> self roll-attack-count) (the-as uint 0)) 0 - (none) ) :exit (behavior () (sound-stop (-> self roll-sound)) @@ -606,7 +593,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (let ((a0-0 (static-sound-spec "robo-roll"))) @@ -694,7 +680,6 @@ (if (>= (-> self roll-attack-count) (the-as uint 3)) (go-virtual roll-to-walk) ) - (none) ) :code (behavior () (ja :group! (-> self draw art-group data 10)) @@ -712,7 +697,6 @@ (suspend) ) #f - (none) ) :post roboguard-roll-travel-post ) @@ -725,7 +709,6 @@ ) :enter (behavior () '() - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 27) @@ -741,7 +724,6 @@ (ja :num! (seek!)) ) (go-virtual idle-dizzy) - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'collide-query)) @@ -752,7 +734,6 @@ ) ) (nav-enemy-face-focus-post) - (none) ) ) @@ -765,7 +746,6 @@ :enter (behavior () (logand! (-> self flags) -5) (roboguard-level-method-185 self (the-as symbol 0)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -778,18 +758,14 @@ (ja :num! (seek!)) ) (go-virtual roll-enter) - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) -;; WARN: Return type mismatch object vs none. (defmethod go-hostile roboguard-level ((obj roboguard-level)) (go (method-of-object obj roll-enter)) - (none) ) (defstate die (roboguard-level) @@ -801,7 +777,6 @@ ) ) (roboguard-level-method-185 self (the-as symbol 0)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -843,7 +818,6 @@ ) ) (go-virtual explode) - (none) ) ) @@ -864,7 +838,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior roboguard-level) #f) ) diff --git a/goal_src/jak2/levels/city/bombbot/bombbot.gc b/goal_src/jak2/levels/city/bombbot/bombbot.gc index 98f489572cd..325d96f4098 100644 --- a/goal_src/jak2/levels/city/bombbot/bombbot.gc +++ b/goal_src/jak2/levels/city/bombbot/bombbot.gc @@ -1346,7 +1346,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -1812,7 +1811,6 @@ ) (logior! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (+! (-> self shield-hit-points) -1.0) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) @@ -1823,7 +1821,6 @@ (sound-stop (-> self lazer-sound)) (sound-stop (-> self head-sound)) (sound-stop (-> self cannon-sound)) - (none) ) :trans (behavior () (rlet ((acc :class vf) @@ -1975,7 +1972,6 @@ ) ) (bombbot-method-180 self) - (none) ) ) :code (behavior () @@ -1991,7 +1987,6 @@ ) ) #f - (none) ) :post (behavior () (-> self current-node) @@ -2031,7 +2026,6 @@ ) ) ) - (none) ) ) @@ -2045,7 +2039,6 @@ (set! (-> self explosing) #f) (set! (-> self beep-time) 0) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (let ((v1-0 (-> self nav))) @@ -2076,7 +2069,6 @@ (+ (current-time) (the int (* 0.2 (the float (- (seconds 2.8) (- (current-time) (-> self state-time))))))) ) ) - (none) ) :code (behavior () (until #f @@ -2091,11 +2083,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -2171,13 +2161,11 @@ 0 (ja-channel-set! 0) (ja-post) - (none) ) :code (behavior () (while (-> self child) (suspend) ) - (none) ) ) diff --git a/goal_src/jak2/levels/city/burning-bush/ctywide-bbush.gc b/goal_src/jak2/levels/city/burning-bush/ctywide-bbush.gc index bcd2c315684..acaf773901f 100644 --- a/goal_src/jak2/levels/city/burning-bush/ctywide-bbush.gc +++ b/goal_src/jak2/levels/city/burning-bush/ctywide-bbush.gc @@ -323,7 +323,6 @@ ) ) ) - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self part-track)))) @@ -365,7 +364,6 @@ ) ) ) - (none) ) :trans (behavior () (cond @@ -437,14 +435,12 @@ (set! (-> self last-target-pos quad) (-> gp-1 quad)) ) ) - (none) ) :code (behavior () (until #f (suspend) ) #f - (none) ) :post (the-as (function none :behavior race-ring) ja-post) ) @@ -456,7 +452,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -1687,8 +1682,8 @@ (defstate idle (bush-collect) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (sound-play "homeing-pickup") (go-virtual die) @@ -1697,11 +1692,9 @@ ) :enter (behavior () '() - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (let ((f30-0 (+ (* 0.0033333334 (the float (current-time))) (* 0.1 (the float (-> self pid)))))) @@ -1737,12 +1730,10 @@ ) ) ) - (none) ) :code (the-as (function none :behavior bush-collect) sleep-code) :post (behavior () (ja-post) - (none) ) ) @@ -1750,7 +1741,6 @@ :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak2/levels/city/common/pilot-states.gc b/goal_src/jak2/levels/city/common/pilot-states.gc index 49b603b4d73..d33b2d09459 100644 --- a/goal_src/jak2/levels/city/common/pilot-states.gc +++ b/goal_src/jak2/levels/city/common/pilot-states.gc @@ -20,7 +20,6 @@ (go target-pilot-stance) (go target-pilot-get-on) ) - (none) ) :post target-post ) @@ -242,7 +241,6 @@ :exit (the-as (function none :behavior target) target-pilot-exit) :trans (behavior () (target-pilot-trans) - (none) ) :code (behavior () (target-pilot-signal-ready) @@ -260,11 +258,9 @@ (target-pilot-car-anim-loop) ) ) - (none) ) :post (behavior () (target-pilot-post) - (none) ) ) @@ -273,7 +269,6 @@ :exit (the-as (function none :behavior target) target-pilot-exit) :trans (behavior () (target-pilot-trans) - (none) ) :code (behavior () (local-vars (v1-1 float) (v1-252 int)) @@ -496,12 +491,10 @@ (.svf (&-> (-> gp-0 accel-array) 0 quad) vf0) ) (go target-pilot-stance) - (none) ) ) :post (behavior () (target-pilot-post) - (none) ) ) @@ -511,8 +504,8 @@ ) (defstate target-pilot-get-on (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (cond ((focus-test? self pilot-riding) @@ -525,7 +518,7 @@ ) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -551,7 +544,6 @@ ) ) ) - (none) ) :code (behavior () (logior! (-> self focus-status) (focus-status pilot)) @@ -607,7 +599,6 @@ (ja :num! (seek!)) ) (go target-pilot-stance) - (none) ) :post target-no-move-post ) @@ -648,7 +639,6 @@ (go target-falling #f) ) ) - (none) ) :code (behavior () (local-vars (f30-0 float)) @@ -704,30 +694,29 @@ (vector+! (-> self control transv) (-> self control transv) (-> gp-2 2)) ) (go target-jump 10240.0 10240.0 *pilot-get-off-mods*) - (none) ) :post target-pilot-post ) (defstate target-pilot-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) (else - (case event-type + (case message (('end-mode) (go target-pilot-stance) ) (('clone-anim) - (go target-pilot-clone-anim (process->handle (the-as process (-> event param 0)))) + (go target-pilot-clone-anim (process->handle (the-as process (-> block param 0)))) ) (('vehicle-crash) (go target-grab 'stance) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -738,14 +727,12 @@ (set! (-> self neck flex-blend) 0.0) (logior! (-> self state-flags) (state-flags sf2)) (logior! (-> self focus-status) (focus-status grabbed)) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags sf2)) (logclear! (-> self focus-status) (focus-status grabbed)) (logclear! (-> self water flags) (water-flags jump-out)) ((-> target-pilot-start exit)) - (none) ) :code (behavior () (until #f @@ -753,17 +740,16 @@ (suspend) ) #f - (none) ) :post target-pilot-post ) (defstate target-pilot-clone-anim (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) (set! (-> self control unknown-word04) (the-as uint #f)) ) - ((-> target-pilot-grab event) proc arg1 event-type event) + ((-> target-pilot-grab event) proc argc message block) ) :enter (-> target-clone-anim enter) :exit (behavior () @@ -773,7 +759,6 @@ ((-> target-clone-anim exit)) ((-> target-pilot-start exit)) (vector-reset! (-> self control transv)) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self control unknown-word04) (the-as uint (-> self control draw-offset y))) @@ -781,14 +766,12 @@ (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (clone-anim arg0 #t "") (go target-pilot-stance) - (none) ) :post (behavior () (vector+! (-> self pilot pilot-trans) (-> self control trans) (-> self control cspace-offset)) (quaternion-copy! (the-as quaternion (-> self pilot pilot-quat)) (-> self control quat)) (set! (-> self pilot pilot-scale quad) (-> self control scale quad)) (target-no-ja-move-post) - (none) ) ) @@ -818,7 +801,6 @@ ) ) ) - (none) ) :exit (-> target-edge-grab exit) :trans (-> target-edge-grab trans) @@ -833,7 +815,6 @@ (logclear! (-> self focus-status) (focus-status dead hit)) ) ((-> target-pilot-start exit)) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (local-vars (sv-16 attack-info)) @@ -854,7 +835,6 @@ (combine! sv-16 arg1 self) (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) (go target-pilot-death (-> sv-16 mode)) - (none) ) :post target-no-stick-post ) @@ -864,7 +844,6 @@ :exit (behavior () ((-> target-pilot-start exit)) ((-> target-death exit)) - (none) ) :code (behavior ((arg0 symbol)) (set! (-> self control unknown-word04) (the-as uint #f)) @@ -1072,7 +1051,6 @@ ) ) (target-death-reset arg0 #f) - (none) ) :post target-pilot-post ) diff --git a/goal_src/jak2/levels/city/common/searchlight.gc b/goal_src/jak2/levels/city/common/searchlight.gc index 7cc943027b1..b52cda2f9e7 100644 --- a/goal_src/jak2/levels/city/common/searchlight.gc +++ b/goal_src/jak2/levels/city/common/searchlight.gc @@ -66,7 +66,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior searchlight) ja-post) ) diff --git a/goal_src/jak2/levels/city/common/target-pilot.gc b/goal_src/jak2/levels/city/common/target-pilot.gc index 1619101949c..368574d132d 100644 --- a/goal_src/jak2/levels/city/common/target-pilot.gc +++ b/goal_src/jak2/levels/city/common/target-pilot.gc @@ -16,100 +16,86 @@ (define *pilot-mods* (new 'static 'surface :name 'empty :seek0 1.0 :seek90 1.0 :seek180 1.0 :fric 1.0)) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 59] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 64] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 82] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 130] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 150] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 182] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 96] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 114] ;; WARN: disable def twice: 124. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 47] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 9] (defbehavior target-pilot-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (cond - ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) - 'pilot - ) - (else - (case arg2 - (('end-mode) - (let ((v1-4 (-> self pilot))) - (when (nonzero? v1-4) - (let ((a0-5 (handle->process (-> v1-4 vehicle)))) - (if a0-5 - (put-rider-in-seat (the-as vehicle a0-5) (-> v1-4 seat-index) (the-as process-focusable #f)) - ) - ) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + 'pilot + ) + (else + (case arg2 + (('end-mode) + (let ((v1-4 (-> self pilot))) + (when (nonzero? v1-4) + (let ((a0-5 (handle->process (-> v1-4 vehicle)))) + (if a0-5 + (put-rider-in-seat (the-as vehicle a0-5) (-> v1-4 seat-index) (the-as process-focusable #f)) + ) ) ) - enter-state - (process->handle arg0) - (go target-pilot-get-off) ) - (('change-mode) - (case (-> arg3 param 0) - (('grab) - (when (not (focus-test? self dead)) - (if (not (-> arg3 param 1)) - #t - (go target-pilot-grab) - ) - ) - ) - (('normal) - enter-state - (process->handle arg0) - (go target-pilot-get-off) - ) - (('gun) - (if (logtest? (-> self game features) (game-feature gun)) - (target-gun-init (the-as int (-> arg3 param 2))) + enter-state + (process->handle arg0) + (go target-pilot-get-off) + ) + (('change-mode) + (case (-> arg3 param 0) + (('grab) + (when (not (focus-test? self dead)) + (if (not (-> arg3 param 1)) + #t + (go target-pilot-grab) ) ) - ) - ) - (('swim) - #f - ) - (('clone-anim) - (go target-pilot-clone-anim (process->handle (the-as process (-> arg3 param 0)))) - ) - (('get-vehicle) - (if (nonzero? (-> self pilot)) - (handle->process (-> self pilot vehicle)) - ) + ) + (('normal) + enter-state + (process->handle arg0) + (go target-pilot-get-off) + ) + (('gun) + (if (logtest? (-> self game features) (game-feature gun)) + (target-gun-init (the-as int (-> arg3 param 2))) + ) + ) ) - (('attack 'attack-or-shove 'attack-invinc) - (target-attacked - arg2 - (the-as attack-info (-> arg3 param 1)) - arg0 - (the-as touching-shapes-entry (-> arg3 param 0)) - target-pilot-hit + ) + (('swim) + #f + ) + (('clone-anim) + (go target-pilot-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (('get-vehicle) + (if (nonzero? (-> self pilot)) + (handle->process (-> self pilot vehicle)) ) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + target-pilot-hit ) - (('vehicle-hit) - (speech-control-method-12 *speech-control* self (if (-> self pilot as-daxter?) - (speech-type speech-type-42) - (speech-type speech-type-33) - ) - ) - ) - (('vehicle-got-hit) - (speech-control-method-12 *speech-control* self (if (-> self pilot as-daxter?) - (speech-type speech-type-43) - (speech-type speech-type-34) - ) - ) - ) - (else - (target-standard-event-handler arg0 arg1 arg2 arg3) - ) + ) + (('vehicle-hit) + (speech-control-method-12 *speech-control* self (if (-> self pilot as-daxter?) + (speech-type speech-type-42) + (speech-type speech-type-33) + ) + ) + ) + (('vehicle-got-hit) + (speech-control-method-12 *speech-control* self (if (-> self pilot as-daxter?) + (speech-type speech-type-43) + (speech-type speech-type-34) + ) + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) ) ) ) @@ -132,63 +118,60 @@ ;; WARN: Return type mismatch none vs object. (defbehavior target-pilot-exit target () - (the-as - object - (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) - (or (= v1-3 'target-pilot-stance) - (= v1-3 'target-pilot-impact) - (= v1-3 'target-pilot-get-off) - (= v1-3 'target-pilot-grab) - (= v1-3 'target-pilot-clone-anim) - (= v1-3 'target-pilot-hit) - (= v1-3 'target-pilot-death) - ) - ) - ) - ) - (let ((v1-4 (-> self manipy))) - (when v1-4 - (deactivate (-> v1-4 0)) - (set! (-> self manipy) (the-as (pointer manipy) #f)) - ) + (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-pilot-stance) + (= v1-3 'target-pilot-impact) + (= v1-3 'target-pilot-get-off) + (= v1-3 'target-pilot-grab) + (= v1-3 'target-pilot-clone-anim) + (= v1-3 'target-pilot-hit) + (= v1-3 'target-pilot-death) + ) + ) + ) + ) + (let ((v1-4 (-> self manipy))) + (when v1-4 + (deactivate (-> v1-4 0)) + (set! (-> self manipy) (the-as (pointer manipy) #f)) ) - (if (-> self pilot as-daxter?) - (target-pilot-pidax-exit) - ) - (let ((v1-11 (-> self pilot))) - (when (nonzero? v1-11) - (set! (-> self control nav-radius) (-> v1-11 backup-nav-radius)) - (let ((gp-0 (handle->process (-> v1-11 vehicle)))) - (when gp-0 - (remove-rider (the-as vehicle gp-0) self) - (send-event gp-0 'player-get-off) - ) + ) + (if (-> self pilot as-daxter?) + (target-pilot-pidax-exit) + ) + (let ((v1-11 (-> self pilot))) + (when (nonzero? v1-11) + (set! (-> self control nav-radius) (-> v1-11 backup-nav-radius)) + (let ((gp-0 (handle->process (-> v1-11 vehicle)))) + (when gp-0 + (remove-rider (the-as vehicle gp-0) self) + (send-event gp-0 'player-get-off) ) ) ) - (set! (-> self neck flex-blend) 1.0) - (let ((v1-22 (-> self control root-prim))) - (set! (-> v1-22 prim-core collide-as) (-> self control backup-collide-as)) - (set! (-> v1-22 prim-core collide-with) (-> self control backup-collide-with)) - ) - (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) - (logclear! (-> self control root-prim prim-core action) (collide-action stuck-wall-escape)) - (set! (-> self control mod-surface) *walk-mods*) - (logclear! (-> self state-flags) (state-flags sf6)) - (enable-set! (-> self arm-ik 0) #f) - (enable-set! (-> self arm-ik 1) #f) - (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) - (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) - (let ((v1-43 (-> self node-list data))) - (set! (-> v1-43 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) - (set! (-> v1-43 0 param1) (the-as basic (-> self control trans))) - (set! (-> v1-43 0 param2) (the-as basic (-> self control cspace-offset))) - ) - (target-collide-set! 'normal 0.0) - (set! (-> self control reaction) target-collision-reaction) - (set! (-> self control cspace-offset quad) (the-as uint128 0)) - (target-exit) ) + (set! (-> self neck flex-blend) 1.0) + (let ((v1-22 (-> self control root-prim))) + (set! (-> v1-22 prim-core collide-as) (-> self control backup-collide-as)) + (set! (-> v1-22 prim-core collide-with) (-> self control backup-collide-with)) + ) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (logclear! (-> self control root-prim prim-core action) (collide-action stuck-wall-escape)) + (set! (-> self control mod-surface) *walk-mods*) + (logclear! (-> self state-flags) (state-flags sf6)) + (enable-set! (-> self arm-ik 0) #f) + (enable-set! (-> self arm-ik 1) #f) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (let ((v1-43 (-> self node-list data))) + (set! (-> v1-43 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) + (set! (-> v1-43 0 param1) (the-as basic (-> self control trans))) + (set! (-> v1-43 0 param2) (the-as basic (-> self control cspace-offset))) + ) + (target-collide-set! 'normal 0.0) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control cspace-offset quad) (the-as uint128 0)) + (target-exit) ) ) @@ -286,7 +269,7 @@ (set! (-> self control root-prim prim-core collide-as) (collide-spec jak-vehicle)) (set! (-> self neck flex-blend) 0.0) (set! (-> self control status) (collide-status)) - (the-as object 0) + 0 ) (defbehavior pilot-on-ground? target () diff --git a/goal_src/jak2/levels/city/ctyport-obs.gc b/goal_src/jak2/levels/city/ctyport-obs.gc index 44d6dd98bef..9bf0c8dd773 100644 --- a/goal_src/jak2/levels/city/ctyport-obs.gc +++ b/goal_src/jak2/levels/city/ctyport-obs.gc @@ -577,11 +577,9 @@ :virtual #t :enter (behavior () (go-virtual idle) - (none) ) :exit (behavior () '() - (none) ) ) @@ -589,11 +587,9 @@ :virtual #t :enter (behavior () (go-virtual idle) - (none) ) :exit (behavior () '() - (none) ) ) @@ -603,20 +599,16 @@ :enter (behavior () (logior! (-> self flags) (rigid-body-object-flag riding)) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () '() - (none) ) :post (behavior () (rigid-body-object-method-37 self) (update-transforms (-> self root)) - (none) ) ) @@ -899,11 +891,9 @@ :virtual #t :enter (behavior () '() - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (dotimes (gp-0 4) @@ -913,7 +903,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior boat-manager) sleep-code) ) diff --git a/goal_src/jak2/levels/city/ctywide-obs.gc b/goal_src/jak2/levels/city/ctywide-obs.gc index 9d6200d9c01..01fff4676af 100644 --- a/goal_src/jak2/levels/city/ctywide-obs.gc +++ b/goal_src/jak2/levels/city/ctywide-obs.gc @@ -228,7 +228,7 @@ (defstate idle-close (security-wall) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -237,157 +237,153 @@ (vf7 :class vf) ) (init-vf0-vector) - (the-as - object - (case event-type - (('on) - (let ((v1-2 (-> self root root-prim))) - (set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as)) - (let ((v0-0 (the-as int (-> self root backup-collide-with)))) - (set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0)) - v0-0 - ) + (case message + (('on) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as)) + (let ((v0-0 (the-as object (-> self root backup-collide-with)))) + (set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0)) + v0-0 ) ) - (('off) - (let ((v1-4 (-> self root root-prim))) - (set! (-> v1-4 prim-core collide-as) (collide-spec)) - (set! (-> v1-4 prim-core collide-with) (collide-spec)) - ) - 0 + ) + (('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)) ) - (('attack) - (let ((v1-5 (the-as object (-> event param 1)))) - (when (!= (-> (the-as attack-info v1-5) id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-5) id)) - (let* ((s5-0 proc) - (s3-0 (if (type? s5-0 process-drawable) - (the-as process-drawable s5-0) - ) - ) - ) - (when s3-0 - (let ((s5-1 (process-spawn - manipy - :init manipy-init - (-> s3-0 root trans) - (-> self entity) - (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer uint32) #f)) - #f - 0 - :to self - ) + 0 + ) + (('attack) + (let ((v1-5 (the-as object (-> block param 1)))) + (when (!= (-> (the-as attack-info v1-5) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-5) id)) + (let* ((s5-0 proc) + (s3-0 (if (type? s5-0 process-drawable) + (the-as process-drawable s5-0) + ) + ) + ) + (when s3-0 + (let ((s5-1 (process-spawn + manipy + :init manipy-init + (-> s3-0 root trans) + (-> self entity) + (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer uint32) #f)) + #f + 0 + :to self ) + ) + ) + (when s5-1 + (send-event (ppointer->process s5-1) 'anim-mode 'play1) + (send-event (ppointer->process s5-1) 'speed 1.5) + (send-event (ppointer->process s5-1) 'art-joint-anim "generic-ripples-idle" 0) + (set-vector! (-> (the-as process-drawable (-> s5-1 0)) root scale) 1.0 1.0 1.0 1.0) + (quaternion-rotate-local-x! (-> (the-as process-drawable (-> s5-1 0)) root quat) (-> self root quat) -16384.0) + (let ((v1-45 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a0-29 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a1-11 *up-vector*)) + (let ((a2-9 8192.0)) + (.mov vf7 a2-9) + ) + (.lvf vf5 (&-> a1-11 quad)) + ) + (.lvf vf4 (&-> a0-29 quad)) ) - (when s5-1 - (send-event (ppointer->process s5-1) 'anim-mode 'play1) - (send-event (ppointer->process s5-1) 'speed 1.5) - (send-event (ppointer->process s5-1) 'art-joint-anim "generic-ripples-idle" 0) - (set-vector! (-> (the-as process-drawable (-> s5-1 0)) root scale) 1.0 1.0 1.0 1.0) - (quaternion-rotate-local-x! (-> (the-as process-drawable (-> s5-1 0)) root quat) (-> self root quat) -16384.0) - (let ((v1-45 (-> (the-as process-drawable (-> s5-1 0)) root trans))) - (let ((a0-29 (-> (the-as process-drawable (-> s5-1 0)) root trans))) - (let ((a1-11 *up-vector*)) - (let ((a2-9 8192.0)) - (.mov vf7 a2-9) + (.add.x.vf 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-45 quad) vf6) + ) + (let ((f0-6 (vector4-dot (-> (the-as process-drawable (-> s5-1 0)) root trans) (the-as vector (-> self plane))))) + (let ((v1-52 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a0-33 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a1-12 (-> self plane))) + (let ((a2-10 (- f0-6))) + (.mov vf7 a2-10) ) - (.lvf vf5 (&-> a1-11 quad)) + (.lvf vf5 (&-> a1-12 quad)) ) - (.lvf vf4 (&-> a0-29 quad)) + (.lvf vf4 (&-> a0-33 quad)) ) (.add.x.vf vf6 vf0 vf0 :mask #b1000) (.mul.x.vf acc vf5 vf7 :mask #b111) (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) - (.svf (&-> v1-45 quad) vf6) + (.svf (&-> v1-52 quad) vf6) ) - (let ((f0-6 (vector4-dot (-> (the-as process-drawable (-> s5-1 0)) root trans) (the-as vector (-> self plane))))) - (let ((v1-52 (-> (the-as process-drawable (-> s5-1 0)) root trans))) - (let ((a0-33 (-> (the-as process-drawable (-> s5-1 0)) root trans))) - (let ((a1-12 (-> self plane))) - (let ((a2-10 (- f0-6))) - (.mov vf7 a2-10) - ) - (.lvf vf5 (&-> a1-12 quad)) - ) - (.lvf vf4 (&-> a0-33 quad)) - ) - (.add.x.vf vf6 vf0 vf0 :mask #b1000) - (.mul.x.vf acc vf5 vf7 :mask #b111) - (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) - (.svf (&-> v1-52 quad) vf6) - ) - (let ((v1-55 (-> (the-as process-drawable (-> s5-1 0)) root trans))) - (let ((a0-36 (-> (the-as process-drawable (-> s5-1 0)) root trans))) - (let ((a1-13 (-> self plane))) - (let ((a2-12 (the-as float (if (< 0.0 f0-6) - -989855744 - #x45000000 - ) - ) - ) - ) - (.mov vf7 a2-12) - ) - (.lvf vf5 (&-> a1-13 quad)) + (let ((v1-55 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a0-36 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a1-13 (-> self plane))) + (let ((a2-12 (the-as float (if (< 0.0 f0-6) + -989855744 + #x45000000 + ) + ) + ) + ) + (.mov vf7 a2-12) ) - (.lvf vf4 (&-> a0-36 quad)) + (.lvf vf5 (&-> a1-13 quad)) ) - (.add.x.vf vf6 vf0 vf0 :mask #b1000) - (.mul.x.vf acc vf5 vf7 :mask #b111) - (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) - (.svf (&-> v1-55 quad) vf6) + (.lvf vf4 (&-> a0-36 quad)) ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-55 quad) vf6) ) - (send-event (ppointer->process s5-1) 'trans-hook (lambda () #f)) ) + (send-event (ppointer->process s5-1) 'trans-hook (lambda () #f)) ) ) ) - (when (zero? (-> self touch-count)) - (+! (-> self touch-count) 1) - (set! (-> self flash) 0.375) - ) + ) + (when (zero? (-> self touch-count)) (+! (-> self touch-count) 1) - (if (and (logtest? (-> proc mask) (process-mask target)) - (not (logtest? (process-mask projectile) (-> proc mask))) - ) - (the-as int (security-wall-method-23 self)) - ) + (set! (-> self flash) 0.375) ) - ) - ) - (('touched) - (when (zero? (-> self touch-count)) (+! (-> self touch-count) 1) - (set! (-> self flash) 0.375) + (if (and (logtest? (-> proc mask) (process-mask target)) + (not (logtest? (process-mask projectile) (-> proc mask))) + ) + (security-wall-method-23 self) + ) ) + ) + ) + (('touched) + (when (zero? (-> self touch-count)) (+! (-> self touch-count) 1) - (let ((v1-83 (if (type? proc process-focusable) - (the-as process-focusable proc) - ) - ) - ) - (when v1-83 - (let* ((gp-1 (-> v1-83 root)) - (a0-45 (if (type? gp-1 collide-shape) - gp-1 - ) - ) + (set! (-> self flash) 0.375) + ) + (+! (-> self touch-count) 1) + (let ((v1-83 (if (type? proc process-focusable) + (the-as process-focusable proc) + ) ) - (if (and a0-45 (logtest? (-> a0-45 root-prim prim-core collide-as) (collide-spec jak))) - (the-as int (security-wall-method-23 self)) - ) - ) + ) + (when v1-83 + (let* ((gp-1 (-> v1-83 root)) + (a0-45 (if (type? gp-1 collide-shape) + gp-1 + ) + ) + ) + (if (and a0-45 (logtest? (-> a0-45 root-prim prim-core collide-as) (collide-spec jak))) + (security-wall-method-23 self) + ) ) ) ) - ) + ) ) ) ) :trans (behavior () (security-wall-method-24 self) - (none) ) ;; og:preserve-this :code (behavior () @@ -418,32 +414,30 @@ (suspend) ) #f - (none) ) ) (defstate idle-open (security-wall) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('on) - (let ((v1-2 (-> self root root-prim))) - (set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as)) - (let ((v0-0 (the-as int (-> self root backup-collide-with)))) - (set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0)) - v0-0 - ) - ) - ) - (('off) - (let ((v1-4 (-> self root root-prim))) - (set! (-> v1-4 prim-core collide-as) (collide-spec)) - (set! (-> v1-4 prim-core collide-with) (collide-spec)) - ) - 0 - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('on) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as)) + (let ((v0-0 (the-as int (-> self root backup-collide-with)))) + (set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0)) + v0-0 + ) + ) + ) + (('off) + (let ((v1-4 (-> self root root-prim))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) ) :enter (behavior () (let ((v1-1 (-> self root root-prim))) @@ -451,7 +445,6 @@ (set! (-> v1-1 prim-core collide-with) (collide-spec)) ) 0 - (none) ) :trans (behavior () (let* ((f28-0 (vector4-dot (the-as vector (-> self plane)) (target-pos 0))) @@ -469,14 +462,12 @@ (set! (-> gp-1 w) 1.0) (set-security-color! gp-1) ) - (none) ) :code (behavior () (until #f (suspend) ) #f - (none) ) ) @@ -893,26 +884,25 @@ This commonly includes things such as: ;; WARN: Return type mismatch int vs object. (defbehavior fruit-stand-event-handler fruit-stand ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('attack) - (let ((v1-1 (the-as object (-> arg3 param 1)))) - (when (!= (-> (the-as attack-info v1-1) id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-1) id)) - (let ((v0-0 1)) - (set! (-> self part state-mode 0) (the-as uint v0-0)) - v0-0 - ) - ) - ) - ) - ) - ) + (case arg2 + (('attack) + (let ((v1-1 (the-as object (-> arg3 param 1)))) + (when (!= (-> (the-as attack-info v1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-1) id)) + (let ((v0-0 1)) + (set! (-> self part state-mode 0) (the-as uint v0-0)) + v0-0 + ) + ) + ) + ) + ) ) (defstate idle (fruit-stand) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (fruit-stand-event-handler proc arg1 event-type event) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (fruit-stand-event-handler proc argc message block) ) :code (behavior () (until #f @@ -926,7 +916,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (dotimes (gp-0 (the-as int (-> self num-sparts))) @@ -963,7 +952,6 @@ This commonly includes things such as: (set! (-> self count-sparts) (the-as uint 0)) (spawn-with-cspace (-> self part) (the-as cspace (-> self node-list data))) (ja-post) - (none) ) ) @@ -1419,11 +1407,9 @@ This commonly includes things such as: (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) (transform-post) (logior! (-> self focus-status) (focus-status ignore)) - (none) ) :exit (behavior () (logclear! (-> self focus-status) (focus-status ignore)) - (none) ) :code (the-as (function none :behavior cty-guard-turret) sleep-code) :post (behavior () @@ -1473,22 +1459,20 @@ This commonly includes things such as: ) ) (transform-post) - (none) ) ) (defstate explode (cty-guard-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('button-down) - (let ((v0-0 #t)) - (set! (-> self button-down?) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('button-down) + (let ((v0-0 #t)) + (set! (-> self button-down?) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior () (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -1531,7 +1515,6 @@ This commonly includes things such as: ) (setup-masks (-> self draw) 0 2) (set! (-> self root root-prim specific 0) (+ (-> self root root-prim specific 1) -1)) - (none) ) :code (behavior () (local-vars (v1-6 handle)) @@ -1607,26 +1590,23 @@ This commonly includes things such as: (set! (-> self root root-prim specific 0) (-> self root root-prim specific 1)) (setup-masks (-> self draw) 2 0) (go-virtual idle) - (none) ) :post (behavior () (ja-post) - (none) ) ) (defstate wait-for-pushing (cty-guard-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('button-down) - (let ((v0-0 #t)) - (set! (-> self button-down?) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('button-down) + (let ((v0-0 #t)) + (set! (-> self button-down?) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior () (set! (-> self button-down?) #f) @@ -1651,7 +1631,6 @@ This commonly includes things such as: ) (setup-masks (-> self draw) 0 2) (set! (-> self root root-prim specific 0) (+ (-> self root root-prim specific 1) -1)) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! 20.0) :frame-num 20.0) @@ -1686,26 +1665,23 @@ This commonly includes things such as: (set! (-> self root root-prim specific 0) (-> self root root-prim specific 1)) (setup-masks (-> self draw) 2 0) (go-virtual idle) - (none) ) :post (behavior () (ja-post) - (none) ) ) (defstate pushed (cty-guard-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('close) - (let ((v0-0 #t)) - (set! (-> self button-down?) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('close) + (let ((v0-0 #t)) + (set! (-> self button-down?) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior () (set! (-> self button-down?) #f) @@ -1731,7 +1707,6 @@ This commonly includes things such as: (setup-masks (-> self draw) 0 2) (set! (-> self root root-prim specific 0) (+ (-> self root root-prim specific 1) -1)) (set! (-> self button-down?) #f) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 3) @@ -1761,11 +1736,9 @@ This commonly includes things such as: (set! (-> self root root-prim specific 0) (-> self root root-prim specific 1)) (setup-masks (-> self draw) 2 0) (go-virtual idle) - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -1977,11 +1950,9 @@ This commonly includes things such as: (set! (-> self state-time) (current-time)) (set! (-> self num-shots) (the-as uint 0)) 0 - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! 20.0 0.5) :frame-num 0.0) @@ -2045,11 +2016,9 @@ This commonly includes things such as: (ja :num! (seek! 32.0 0.5)) ) (go-virtual idle) - (none) ) :post (behavior () (transform-post) - (none) ) ) @@ -2399,7 +2368,6 @@ This commonly includes things such as: :exit (behavior () (parking-spot-method-21 self) (send-event (handle->process (-> self vehicle)) 'traffic-off-force) - (none) ) :code (the-as (function none :behavior parking-spot) sleep-code) :post (behavior () @@ -2425,7 +2393,6 @@ This commonly includes things such as: ) ) 0 - (none) ) ) @@ -2572,7 +2539,7 @@ This commonly includes things such as: (defstate idle (propa) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -2581,98 +2548,95 @@ This commonly includes things such as: (vf7 :class vf) ) (init-vf0-vector) - (the-as - object - (case event-type - (('attack) - (get-penetrate-using-from-attack-event (the-as process-drawable proc) event) - (let ((v1-2 (the-as object (-> event param 1)))) - (when (!= (-> (the-as attack-info v1-2) id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-2) id)) - (let ((gp-1 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) - (if (and (not (logtest? (penetrate dark-skin) gp-1)) (zero? (propa-pu->knocked-type gp-1))) - (set! (-> self hit-points) (- (-> self hit-points) (penetrate-using->damage gp-1))) - (+! (-> self hit-points) -10) - ) - ) - (cond - ((< (-> self hit-points) 3) - (setup-masks (-> self draw) 0 -1) - (setup-masks (-> self draw) 1 0) - (let* ((a0-9 (the-as collide-shape-prim-group (-> self root root-prim))) - (v1-17 (-> a0-9 child 0)) - ) - (let ((a0-11 (-> a0-9 child 1))) - (set! (-> a0-11 prim-core collide-as) (-> v1-17 prim-core collide-as)) - (set! (-> a0-11 prim-core collide-with) (-> v1-17 prim-core collide-with)) - ) - (set! (-> v1-17 prim-core collide-as) (collide-spec)) - (set! (-> v1-17 prim-core collide-with) (collide-spec)) + (case message + (('attack) + (get-penetrate-using-from-attack-event (the-as process-drawable proc) block) + (let ((v1-2 (the-as object (-> block param 1)))) + (when (!= (-> (the-as attack-info v1-2) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-2) id)) + (let ((gp-1 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) + (if (and (not (logtest? (penetrate dark-skin) gp-1)) (zero? (propa-pu->knocked-type gp-1))) + (set! (-> self hit-points) (- (-> self hit-points) (penetrate-using->damage gp-1))) + (+! (-> self hit-points) -10) + ) + ) + (cond + ((< (-> self hit-points) 3) + (setup-masks (-> self draw) 0 -1) + (setup-masks (-> self draw) 1 0) + (let* ((a0-9 (the-as collide-shape-prim-group (-> self root root-prim))) + (v1-17 (-> a0-9 child 0)) + ) + (let ((a0-11 (-> a0-9 child 1))) + (set! (-> a0-11 prim-core collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> a0-11 prim-core collide-with) (-> v1-17 prim-core collide-with)) ) - 0 - (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-2 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 - (the-as part-tracker gp-2) - *entity-pool* - (symbol->string (-> part-tracker symbol)) - (the-as pointer #x70004000) - ) + (set! (-> v1-17 prim-core collide-as) (collide-spec)) + (set! (-> v1-17 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-2 + (let ((t9-7 (method-of-type part-tracker activate))) + (t9-7 + (the-as part-tracker gp-2) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) ) - (let ((t9-8 run-function-in-process) - (a0-14 gp-2) - (a1-10 part-tracker-init) - (a2-7 (-> *part-group-id-table* 161)) - (a3-2 0) - (t0-0 #f) - (t1-0 #f) - (t2-0 #f) - (t3-0 *launch-matrix*) + ) + (let ((t9-8 run-function-in-process) + (a0-14 gp-2) + (a1-10 part-tracker-init) + (a2-7 (-> *part-group-id-table* 161)) + (a3-2 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (let ((v1-25 (-> t3-0 trans)) + (t4-0 (new 'stack-no-clear 'vector)) ) - (let ((v1-25 (-> t3-0 trans)) - (t4-0 (new 'stack-no-clear 'vector)) + (let ((t5-1 (-> self root trans))) + (let ((t6-0 *up-vector*)) + (let ((t7-1 8192.0)) + (.mov vf7 t7-1) ) - (let ((t5-1 (-> self root trans))) - (let ((t6-0 *up-vector*)) - (let ((t7-1 8192.0)) - (.mov vf7 t7-1) - ) - (.lvf vf5 (&-> t6-0 quad)) - ) - (.lvf vf4 (&-> t5-1 quad)) + (.lvf vf5 (&-> t6-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 (&-> t4-0 quad) vf6) - (set! (-> v1-25 quad) (-> t4-0 quad)) + (.lvf vf4 (&-> t5-1 quad)) ) - ((the-as (function object object object object object object object object none) t9-8) - a0-14 - a1-10 - a2-7 - a3-2 - t0-0 - t1-0 - t2-0 - t3-0 - ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> t4-0 quad) vf6) + (set! (-> v1-25 quad) (-> t4-0 quad)) ) - (-> gp-2 ppointer) + ((the-as (function object object object object object object object object none) t9-8) + a0-14 + a1-10 + a2-7 + a3-2 + t0-0 + t1-0 + t2-0 + t3-0 + ) ) + (-> gp-2 ppointer) ) - (go-virtual broken) - ) - ((< (-> self hit-points) 6) - (setup-masks (-> self draw) 0 -1) - (the-as object (setup-masks (-> self draw) 2 0)) ) - ) + (go-virtual broken) + ) + ((< (-> self hit-points) 6) + (setup-masks (-> self draw) 0 -1) + (setup-masks (-> self draw) 2 0) + ) ) ) ) - ) + ) ) ) ) @@ -2682,7 +2646,6 @@ This commonly includes things such as: (set! (-> self sound-id) (new 'static 'sound-id)) 0 ) - (none) ) :code (the-as (function none :behavior propa) sleep-code) :post (behavior () @@ -2789,7 +2752,6 @@ This commonly includes things such as: (matrix<-trans gp-3 s5-1) (spawn-with-matrix (-> self part) gp-3) ) - (none) ) ) @@ -2997,7 +2959,6 @@ This commonly includes things such as: :virtual #t :exit (behavior () '() - (none) ) :trans (behavior () (let ((gp-0 (get-current-task-event (-> self task))) @@ -3082,7 +3043,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior burning-bush) sleep-code) :post (behavior () @@ -3115,7 +3075,6 @@ This commonly includes things such as: (t9-0 a0-0 a1-0 #f self) ) ) - (none) ) ) ) @@ -3126,7 +3085,6 @@ This commonly includes things such as: (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self time) -1.0) (process-entity-status! self (entity-perm-status no-kill) #t) - (none) ) :exit (behavior () (remove-setting! 'music-volume) @@ -3138,7 +3096,6 @@ This commonly includes things such as: (send-event *camera* 'change-target *target*) (remove-setting! 'interp-time) (remove-setting! 'mode-name) - (none) ) :trans (behavior () (local-vars (sv-272 vector) (sv-288 quaternion)) @@ -3218,7 +3175,6 @@ This commonly includes things such as: ) (spawn-with-matrix (-> self part) gp-1) ) - (none) ) ) :code (behavior () @@ -3272,7 +3228,6 @@ This commonly includes things such as: ) (task-node-close! (-> self task current-node)) (go-virtual idle) - (none) ) :post (behavior () (rlet ((acc :class vf) @@ -3304,7 +3259,6 @@ This commonly includes things such as: (t9-0 a0-0 a1-0 #f self) ) ) - (none) ) ) ) @@ -3315,14 +3269,12 @@ This commonly includes things such as: (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self time) -1.0) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (remove-setting! 'minimap) (send-event *camera* 'change-target *target*) (remove-setting! 'interp-time) (remove-setting! 'mode-name) - (none) ) :trans (behavior () (local-vars @@ -3710,7 +3662,6 @@ This commonly includes things such as: ) (spawn-with-matrix (-> self part-off) gp-2) ) - (none) ) ) :code (behavior () @@ -3761,7 +3712,6 @@ This commonly includes things such as: (suspend) ) (go-virtual idle) - (none) ) :post (behavior () (rlet ((acc :class vf) @@ -3793,7 +3743,6 @@ This commonly includes things such as: (t9-0 a0-0 a1-0 #f self) ) ) - (none) ) ) ) @@ -4056,7 +4005,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior barons-ship-lores) ja-post) ) @@ -4116,26 +4064,22 @@ This commonly includes things such as: (defstate idle (lurker-pipe-lid) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('spin) - (set! (-> self angle) 196608.0) - (set! (-> self rot) -655360.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('spin) + (set! (-> self angle) 196608.0) + (set! (-> self rot) -655360.0) + ) + ) ) :enter (behavior () '() - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () '() - (none) ) :code (the-as (function none :behavior lurker-pipe-lid) sleep-code) :post (behavior () @@ -4147,7 +4091,6 @@ This commonly includes things such as: ) (quaternion-vector-angle! (-> self root quat) *x-vector* (-> self angle)) (ja-post) - (none) ) ) @@ -4246,10 +4189,10 @@ This commonly includes things such as: (defstate idle (ctyn-lamp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (-> event param 1) + (-> block param 1) (let ((s5-0 (the-as process-drawable proc)) (gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1))) ) @@ -4289,7 +4232,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior ctyn-lamp) #f) ) diff --git a/goal_src/jak2/levels/city/ctywide-scenes.gc b/goal_src/jak2/levels/city/ctywide-scenes.gc index d173647b701..a10806e19bc 100644 --- a/goal_src/jak2/levels/city/ctywide-scenes.gc +++ b/goal_src/jak2/levels/city/ctywide-scenes.gc @@ -1494,18 +1494,17 @@ ) ) (let ((gp-1 (level-get *level* 'lyskdcd))) - (the-as object (when gp-1 - (clear-mood-context (-> gp-1 mood-context)) - (if #f - ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) - ) - (set! (-> gp-1 mood-func) update-mood-copy-ctywide) - (let ((v0-4 #t)) - (set! (-> gp-1 info sky) v0-4) - v0-4 - ) - ) - ) + (when gp-1 + (clear-mood-context (-> gp-1 mood-context)) + (if #f + ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) + ) + (set! (-> gp-1 mood-func) update-mood-copy-ctywide) + (let ((v0-4 #t)) + (set! (-> gp-1 info sky) v0-4) + v0-4 + ) + ) ) ) ) @@ -1541,17 +1540,14 @@ ) ) (let ((gp-1 (level-get *level* 'lyskdcd))) - (the-as - object - (when gp-1 - (clear-mood-context (-> gp-1 mood-context)) - (if #f - ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) - ) - (set! (-> gp-1 mood-func) (the-as (function mood-context float int none) update-mood-hideout)) - (set! (-> gp-1 info sky) #f) - #f - ) + (when gp-1 + (clear-mood-context (-> gp-1 mood-context)) + (if #f + ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) + ) + (set! (-> gp-1 mood-func) (the-as (function mood-context float int none) update-mood-hideout)) + (set! (-> gp-1 info sky) #f) + #f ) ) ) @@ -1726,18 +1722,17 @@ ) ) (let ((gp-1 (level-get *level* 'ltrntess))) - (the-as object (when gp-1 - (clear-mood-context (-> gp-1 mood-context)) - (if #f - ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) - ) - (set! (-> gp-1 mood-func) update-mood-copy-ctywide) - (let ((v0-4 #t)) - (set! (-> gp-1 info sky) v0-4) - v0-4 - ) - ) - ) + (when gp-1 + (clear-mood-context (-> gp-1 mood-context)) + (if #f + ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) + ) + (set! (-> gp-1 mood-func) update-mood-copy-ctywide) + (let ((v0-4 #t)) + (set! (-> gp-1 info sky) v0-4) + v0-4 + ) + ) ) ) ) @@ -1784,17 +1779,14 @@ ) ) (let ((gp-1 (level-get *level* 'ltrntess))) - (the-as - object - (when gp-1 - (clear-mood-context (-> gp-1 mood-context)) - (if #f - ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) - ) - (set! (-> gp-1 mood-func) (the-as (function mood-context float int none) update-mood-hideout)) - (set! (-> gp-1 info sky) #f) - #f - ) + (when gp-1 + (clear-mood-context (-> gp-1 mood-context)) + (if #f + ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) + ) + (set! (-> gp-1 mood-func) (the-as (function mood-context float int none) update-mood-hideout)) + (set! (-> gp-1 info sky) #f) + #f ) ) ) diff --git a/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc b/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc index 98825b14fa7..a42f654437e 100644 --- a/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc +++ b/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc @@ -1028,17 +1028,16 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior farm-marrow) #f) ) (defstate idle (farm-marrow) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((a1-1 (the-as object (-> event param 1))) + (let ((a1-1 (the-as object (-> block param 1))) (a0-2 proc) ) (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) @@ -1046,7 +1045,7 @@ (when a0-2 (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) (when s5-0 - (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) (cond ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) (sound-play "hit-veggies") @@ -1170,7 +1169,6 @@ ) :exit (behavior () '() - (none) ) :code (the-as (function none :behavior farm-marrow) sleep-code) :post (behavior () @@ -1178,7 +1176,6 @@ (shaker-method-9 (-> self shakers gp-0)) ) (transform-post) - (none) ) ) @@ -1321,17 +1318,16 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior farm-beetree) #f) ) (defstate idle (farm-beetree) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((a1-1 (the-as object (-> event param 1))) + (let ((a1-1 (the-as object (-> block param 1))) (a0-2 proc) ) (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) @@ -1339,7 +1335,7 @@ This commonly includes things such as: (when a0-2 (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) (when s5-0 - (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) (cond ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) (sound-play "hit-veggies") @@ -1429,7 +1425,6 @@ This commonly includes things such as: (shaker-method-9 (-> self shakers gp-0)) ) (transform-post) - (none) ) ) @@ -1568,17 +1563,16 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior farm-cabbage) #f) ) (defstate idle (farm-cabbage) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((a1-1 (the-as object (-> event param 1))) + (let ((a1-1 (the-as object (-> block param 1))) (a0-2 proc) ) (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) @@ -1586,7 +1580,7 @@ This commonly includes things such as: (when a0-2 (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) (when s5-0 - (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) (cond ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) (sound-play "hit-veggies") @@ -1676,7 +1670,6 @@ This commonly includes things such as: (shaker-method-9 (-> self shakers gp-0)) ) (transform-post) - (none) ) ) @@ -1817,17 +1810,16 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior farm-small-cabbage) #f) ) (defstate idle (farm-small-cabbage) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((a1-1 (the-as object (-> event param 1))) + (let ((a1-1 (the-as object (-> block param 1))) (a0-2 proc) ) (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) @@ -1835,7 +1827,7 @@ This commonly includes things such as: (when a0-2 (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) (when s5-0 - (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) (cond ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) (sound-play "hit-veggies") @@ -1910,7 +1902,6 @@ This commonly includes things such as: (shaker-method-9 (-> self shakers gp-0)) ) (transform-post) - (none) ) ) @@ -2051,17 +2042,16 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior farm-chilirots) #f) ) (defstate idle (farm-chilirots) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((a1-1 (the-as object (-> event param 1))) + (let ((a1-1 (the-as object (-> block param 1))) (a0-2 proc) ) (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) @@ -2069,7 +2059,7 @@ This commonly includes things such as: (when a0-2 (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) (when s5-0 - (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) (cond ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) (sound-play "hit-veggies") @@ -2188,7 +2178,6 @@ This commonly includes things such as: (shaker-method-9 (-> self shakers gp-0)) ) (transform-post) - (none) ) ) @@ -2283,11 +2272,9 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (transform-post) - (none) ) ) diff --git a/goal_src/jak2/levels/city/farm/yakow.gc b/goal_src/jak2/levels/city/farm/yakow.gc index 0730ade0a2e..25466cfaeec 100644 --- a/goal_src/jak2/levels/city/farm/yakow.gc +++ b/goal_src/jak2/levels/city/farm/yakow.gc @@ -292,7 +292,6 @@ ) ) #f - (none) ) :post (behavior () (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) @@ -300,7 +299,6 @@ ) (enemy-method-129 self) (ja-post) - (none) ) ) @@ -312,7 +310,6 @@ (go-virtual idle) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -412,7 +409,6 @@ ) ) #f - (none) ) ) @@ -426,15 +422,12 @@ ) 0 (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.05)) @@ -447,7 +440,6 @@ (ja :num! (seek!)) ) (go-virtual active) - (none) ) :post (the-as (function none :behavior yakow) ja-post) ) diff --git a/goal_src/jak2/levels/city/generic/neon-praxis-part.gc b/goal_src/jak2/levels/city/generic/neon-praxis-part.gc index 6bc624de820..5518b169e35 100644 --- a/goal_src/jak2/levels/city/generic/neon-praxis-part.gc +++ b/goal_src/jak2/levels/city/generic/neon-praxis-part.gc @@ -1150,7 +1150,6 @@ (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/city/kiddogescort/crocesc-states.gc b/goal_src/jak2/levels/city/kiddogescort/crocesc-states.gc index 10f0a4cbc0e..eeaf15737cb 100644 --- a/goal_src/jak2/levels/city/kiddogescort/crocesc-states.gc +++ b/goal_src/jak2/levels/city/kiddogescort/crocesc-states.gc @@ -28,7 +28,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -45,7 +44,6 @@ ) ) ) - (none) ) :code (behavior () (let ((gp-0 (get-rand-int self 4))) @@ -163,7 +161,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior crocadog-escort) nav-enemy-simple-post) ) @@ -188,7 +185,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -199,7 +195,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -212,12 +207,10 @@ (ja :num! (seek!)) ) (go-idle-or-move self) - (none) ) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 49152.0 (seconds 0.05)) (nav-enemy-simple-post) - (none) ) ) @@ -244,7 +237,6 @@ (stop-looking-at-target! self) (nav-enemy-method-166 self) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -263,7 +255,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -271,7 +262,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -283,7 +273,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -310,7 +299,6 @@ (stop-looking-at-target! self) (nav-enemy-method-166 self) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -365,7 +353,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -373,7 +360,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior crocadog-escort) nav-enemy-travel-post) ) @@ -416,7 +402,6 @@ (logior! (-> self focus-status) (focus-status disable)) (logclear! (-> self focus-status) (focus-status arrestable)) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :exit (behavior () (local-vars (v1-6 enemy-flag)) @@ -430,11 +415,9 @@ ) (set! (-> self enemy-flags) v1-6) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :trans (behavior () (check-vehicle-exit self) - (none) ) :code (behavior () (local-vars (sv-128 float)) @@ -547,7 +530,6 @@ ) (logior! (-> self focus-status) (focus-status pilot-riding pilot)) (go-virtual ride-vehicle) - (none) ) :post (the-as (function none :behavior crocadog-escort) nav-enemy-simple-post) ) @@ -577,7 +559,6 @@ 0 (logior! (-> self focus-status) (focus-status disable pilot-riding pilot)) (set! (-> self anim-speed) 0.0) - (none) ) :exit (behavior () (local-vars (v1-4 enemy-flag)) @@ -590,7 +571,6 @@ ) (set! (-> self enemy-flags) v1-4) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :trans (behavior () (check-vehicle-exit self) @@ -616,7 +596,6 @@ (if (and (logtest? (bot-flags bf16) (-> self bot-flags)) (want-exit-vehicle? self (-> self exit-vehicle-dest))) (go-virtual exit-vehicle) ) - (none) ) :code (behavior () (until #f @@ -633,7 +612,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior crocadog-escort) nav-enemy-simple-post) ) @@ -658,7 +636,6 @@ (logclear! (-> self enemy-flags) (enemy-flag enable-on-active)) (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) (logior! (-> self focus-status) (focus-status disable)) - (none) ) :exit (behavior () (local-vars (v1-11 enemy-flag)) @@ -679,7 +656,6 @@ ) (set! (-> self enemy-flags) v1-11) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :trans (behavior () (check-vehicle-exit self) @@ -693,7 +669,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -800,7 +775,6 @@ ) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior crocadog-escort) nav-enemy-simple-post) ) @@ -826,14 +800,12 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) (go-virtual traveling) ) - (none) ) :code (-> (method-of-type crocadog-escort waiting-idle) code) :post (the-as (function none :behavior crocadog-escort) nav-enemy-simple-post) @@ -852,7 +824,6 @@ ) 0 (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -861,7 +832,6 @@ (go-virtual traveling) ) ) - (none) ) :code (-> (method-of-type crocadog-escort waiting-idle) code) ) @@ -875,7 +845,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () (local-vars (v1-7 enemy-flag) (v1-15 enemy-flag)) @@ -904,7 +873,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -917,7 +885,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) ) @@ -930,7 +897,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () 0.0 @@ -977,7 +943,6 @@ ) ) #f - (none) ) ) @@ -1000,7 +965,6 @@ (set! (-> self travel-anim-interp) 0.0) (logior! (-> self bot-flags) (bot-flags bf09)) (logclear! (-> self bot-flags) (bot-flags bf19)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) @@ -1010,7 +974,6 @@ ) (fail-falling self) ) - (none) ) :code (-> (method-of-type crocadog-escort die-falling) code) ) @@ -1045,7 +1008,6 @@ (logclear! (-> self enemy-flags) (enemy-flag notice)) (logclear! (-> self focus-status) (focus-status disable)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (-> (method-of-type crocadog-escort waiting-idle) code) :post (the-as (function none :behavior crocadog-escort) nav-enemy-simple-post) diff --git a/goal_src/jak2/levels/city/kiddogescort/crocesc.gc b/goal_src/jak2/levels/city/kiddogescort/crocesc.gc index 00472662445..9a201ac0df1 100644 --- a/goal_src/jak2/levels/city/kiddogescort/crocesc.gc +++ b/goal_src/jak2/levels/city/kiddogescort/crocesc.gc @@ -544,13 +544,12 @@ This commonly includes things such as: (react-to-focus obj) ) ) - (none) ) +;; WARN: Return type mismatch none vs object. (defmethod react-to-focus crocadog-escort ((obj crocadog-escort)) "@TODO - flesh out docs" (go-idle-or-move obj) - (none) ) ;; WARN: Return type mismatch object vs none. @@ -648,6 +647,7 @@ This commonly includes things such as: #t ) +;; WARN: Return type mismatch object vs none. (defmethod go-idle crocadog-escort ((obj crocadog-escort)) (cond ((task-node-closed? (game-task-node city-escort-kid-resolution)) diff --git a/goal_src/jak2/levels/city/kiddogescort/kidesc-states.gc b/goal_src/jak2/levels/city/kiddogescort/kidesc-states.gc index f9c25eb55db..96f2d2a0125 100644 --- a/goal_src/jak2/levels/city/kiddogescort/kidesc-states.gc +++ b/goal_src/jak2/levels/city/kiddogescort/kidesc-states.gc @@ -25,7 +25,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -55,7 +54,6 @@ ) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -83,7 +81,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kid-escort) nav-enemy-simple-post) ) @@ -105,7 +102,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -123,7 +119,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -136,12 +131,10 @@ (ja :num! (seek!)) ) (check-arrest self) - (none) ) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 49152.0 (seconds 0.05)) (nav-enemy-simple-post) - (none) ) ) @@ -165,7 +158,6 @@ (stop-looking-at-target! self) (nav-enemy-method-166 self) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -191,7 +183,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -199,7 +190,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -211,7 +201,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -236,7 +225,6 @@ (nav-enemy-method-166 self) (set! (-> self player-blocking) 0.0) (logclear! (-> self focus-status) (focus-status arrestable)) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -298,7 +286,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -306,7 +293,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior kid-escort) nav-enemy-travel-post) ) @@ -337,7 +323,6 @@ (logior! (-> self focus-status) (focus-status disable)) (logclear! (-> self focus-status) (focus-status arrestable)) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :exit (behavior () (local-vars (v1-6 enemy-flag)) @@ -351,11 +336,9 @@ ) (set! (-> self enemy-flags) v1-6) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :trans (behavior () (check-vehicle-exit self) - (none) ) :code (behavior () (local-vars (sv-112 float)) @@ -458,7 +441,6 @@ ) (logior! (-> self focus-status) (focus-status pilot-riding pilot)) (go-virtual ride-vehicle) - (none) ) :post (the-as (function none :behavior kid-escort) nav-enemy-simple-post) ) @@ -485,7 +467,6 @@ 0 (logior! (-> self focus-status) (focus-status disable pilot-riding pilot)) (logclear! (-> self focus-status) (focus-status arrestable)) - (none) ) :exit (behavior () (local-vars (v1-4 enemy-flag)) @@ -498,7 +479,6 @@ ) (set! (-> self enemy-flags) v1-4) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :trans (behavior () (check-vehicle-exit self) @@ -506,7 +486,6 @@ (go-virtual exit-vehicle) ) 0 - (none) ) :code (behavior () (ja-channel-push! 2 (seconds 0.2)) @@ -544,7 +523,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kid-escort) nav-enemy-simple-post) ) @@ -567,7 +545,6 @@ (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) (logior! (-> self focus-status) (focus-status disable)) (logclear! (-> self focus-status) (focus-status arrestable)) - (none) ) :exit (behavior () (local-vars (v1-17 enemy-flag)) @@ -593,11 +570,9 @@ ) (set! (-> self enemy-flags) v1-17) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :trans (behavior () (check-vehicle-exit self) - (none) ) :code (behavior () (local-vars (sv-80 float) (sv-96 float)) @@ -702,7 +677,6 @@ ) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior kid-escort) nav-enemy-simple-post) ) @@ -725,7 +699,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -744,7 +717,6 @@ ) ) ) - (none) ) :code (-> (method-of-type kid-escort waiting-idle) code) :post (the-as (function none :behavior kid-escort) nav-enemy-simple-post) @@ -763,7 +735,6 @@ ) 0 (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -782,7 +753,6 @@ ) ) ) - (none) ) :code (-> (method-of-type kid-escort waiting-idle) code) ) @@ -796,7 +766,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () (local-vars (v1-7 enemy-flag) (v1-15 enemy-flag)) @@ -825,7 +794,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -838,7 +806,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) ) @@ -865,7 +832,6 @@ (if (logtest? (bot-flags bf19) (-> self bot-flags)) (logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water)) ) - (none) ) :trans (behavior () (cond @@ -891,7 +857,6 @@ ) ) ) - (none) ) :code (behavior () (cond @@ -978,7 +943,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kid-escort) nav-enemy-simple-post) ) @@ -994,7 +958,6 @@ (set! (-> self travel-anim-interp) 0.0) (logior! (-> self focus-status) (focus-status arrestable)) (logclear! (-> self focus-status) (focus-status disable)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1030,7 +993,6 @@ ) ) #f - (none) ) ) @@ -1045,7 +1007,6 @@ (set! (-> self travel-anim-interp) 0.0) (logior! (-> self focus-status) (focus-status arrestable)) (logclear! (-> self focus-status) (focus-status disable)) - (none) ) :code (-> (method-of-type kid-escort die-falling) code) ) @@ -1078,7 +1039,6 @@ (logior! (-> self focus-status) (focus-status arrestable)) (logior! (-> self focus-status) (focus-status disable)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1115,7 +1075,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kid-escort) nav-enemy-simple-post) ) diff --git a/goal_src/jak2/levels/city/kiddogescort/kidesc.gc b/goal_src/jak2/levels/city/kiddogescort/kidesc.gc index 99356e55249..3638d07b584 100644 --- a/goal_src/jak2/levels/city/kiddogescort/kidesc.gc +++ b/goal_src/jak2/levels/city/kiddogescort/kidesc.gc @@ -508,10 +508,10 @@ This commonly includes things such as: #f ) +;; WARN: Return type mismatch none vs object. (defmethod react-to-focus kid-escort ((obj kid-escort)) "@TODO - flesh out docs" (check-arrest obj) - (none) ) ;; WARN: Return type mismatch object vs none. @@ -752,7 +752,6 @@ This commonly includes things such as: (react-to-focus obj) ) ) - (none) ) (defmethod enemy-method-102 kid-escort ((obj kid-escort)) @@ -762,6 +761,7 @@ This commonly includes things such as: ) ) +;; WARN: Return type mismatch object vs none. (defmethod go-idle kid-escort ((obj kid-escort)) (cond ((task-node-closed? (game-task-node city-escort-kid-resolution)) diff --git a/goal_src/jak2/levels/city/market/ashelin/ctyasha-obs.gc b/goal_src/jak2/levels/city/market/ashelin/ctyasha-obs.gc index 9e8fbcc1bc8..bd25b26ea6e 100644 --- a/goal_src/jak2/levels/city/market/ashelin/ctyasha-obs.gc +++ b/goal_src/jak2/levels/city/market/ashelin/ctyasha-obs.gc @@ -926,7 +926,6 @@ (set! (-> obj expensive-gnd-collide?) #f) (enemy-method-124 obj) ((method-of-type grunt go-hostile) obj) - (none) ) (defstate jump (tanker-grunt) @@ -938,7 +937,6 @@ ) ) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type grunt jump) trans))) @@ -952,7 +950,6 @@ (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) ) 0 - (none) ) ) @@ -1031,7 +1028,6 @@ (set! (-> obj expensive-gnd-collide?) #f) (enemy-method-124 obj) ((method-of-type juicer go-hostile) obj) - (none) ) (defstate jump (tanker-juicer) @@ -1043,7 +1039,6 @@ ) ) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type juicer jump) trans))) @@ -1057,7 +1052,6 @@ (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) ) 0 - (none) ) ) @@ -1225,7 +1219,6 @@ :enter (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior tanker-container) sleep-code) ) @@ -1240,7 +1233,6 @@ (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) ) (tanker-container-method-22 self) - (none) ) :code (the-as (function none :behavior tanker-container) sleep-code) ) @@ -1338,8 +1330,8 @@ This commonly includes things such as: (defstate dormant (tanker-crash) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual idle) ) @@ -1348,7 +1340,6 @@ This commonly includes things such as: :enter (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior tanker-crash) sleep-code) ) @@ -1362,7 +1353,6 @@ This commonly includes things such as: (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) ) (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior tanker-crash) sleep-code) :post (the-as (function none :behavior tanker-crash) ja-post) @@ -1463,10 +1453,10 @@ This commonly includes things such as: (defstate active (tanker-deadly) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) - (let ((a2-1 (-> event param 0)) + (let ((a2-1 (-> block param 0)) (v1-1 (new 'stack-no-clear 'vector)) ) (vector-! v1-1 (-> self root trans) (-> self prev-pos)) @@ -1500,7 +1490,6 @@ This commonly includes things such as: (if (>= (current-time) (-> self die-time)) (go-virtual die-fast) ) - (none) ) ) @@ -1508,7 +1497,6 @@ This commonly includes things such as: :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak2/levels/city/market/ctymark-obs.gc b/goal_src/jak2/levels/city/market/ctymark-obs.gc index 40d0e28f423..0b20a2da2ed 100644 --- a/goal_src/jak2/levels/city/market/ctymark-obs.gc +++ b/goal_src/jak2/levels/city/market/ctymark-obs.gc @@ -996,10 +996,10 @@ (defstate idle (market-object) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((attack-info (-> event param 1))) + (let ((attack-info (-> block param 1))) (when proc (let ((attacking-proc (find-offending-process-focusable proc (the-as attack-info attack-info)))) (when attacking-proc @@ -1051,7 +1051,6 @@ (suspend) ) ) - (none) ) ) @@ -1073,7 +1072,6 @@ :virtual #t :enter (behavior () (sound-play "break-vase") - (none) ) ) @@ -1154,7 +1152,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (sound-play "break-flour") - (none) ) ) @@ -1235,7 +1232,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (sound-play "break-veg-wood") - (none) ) ) @@ -1316,7 +1312,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (sound-play "break-crate") - (none) ) ) @@ -1397,7 +1392,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (sound-play "break-veg-straw") - (none) ) ) diff --git a/goal_src/jak2/levels/city/meet-brutter/meet-brutter.gc b/goal_src/jak2/levels/city/meet-brutter/meet-brutter.gc index 093fb3e3ef5..22e6124e552 100644 --- a/goal_src/jak2/levels/city/meet-brutter/meet-brutter.gc +++ b/goal_src/jak2/levels/city/meet-brutter/meet-brutter.gc @@ -525,7 +525,6 @@ (t9-1) ) ) - (none) ) ) @@ -533,13 +532,11 @@ :virtual #t :enter (behavior () '() - (none) ) :trans (the-as (function none :behavior paddywagon) #f) :code (the-as (function none :behavior paddywagon) sleep-code) :post (behavior () (vehicle-guard-method-158 self) - (none) ) ) @@ -547,7 +544,6 @@ :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -871,7 +867,6 @@ (quaternion-from-two-vectors! gp-1 s5-2 *up-vector*) (quaternion*! (-> self root quat) gp-1 (-> self root quat)) ) - (none) ) ) ) @@ -889,7 +884,6 @@ ) ) #f - (none) ) ) @@ -978,7 +972,6 @@ ) (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) (go-virtual ride) - (none) ) ) @@ -1011,7 +1004,6 @@ ) ) ) - (none) ) ) @@ -1034,7 +1026,6 @@ (joint-channel-float-delete! a0-2) ) ) - (none) ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'vector))) @@ -1047,7 +1038,6 @@ ) (when (handle->process (-> self vehicle)) ) - (none) ) :code (behavior () (ja-channel-push! 3 (seconds 0.2)) @@ -1157,19 +1147,18 @@ (suspend) ) #f - (none) ) ) (defstate exit-vehicle (city-lurker) :virtual #t :event (the-as (function process int symbol event-message-block object :behavior city-lurker) enemy-event-handler) - :enter (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) - (let ((a0-2 (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)))) - (if a0-2 - (set! (-> self nav-mesh-aid) (-> a0-2 entity aid)) + :enter (behavior () + (let ((a0-1 (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)))) + (if a0-1 + (set! (-> self nav-mesh-aid) (-> a0-1 entity aid)) ) - (change-to a0-2 self) + (change-to a0-1 self) ) (when (not (-> self nav)) (format #t "nav mesh not found~%") @@ -1183,12 +1172,12 @@ self (vector-negate-in-place! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (let ((a0-9 (-> self nav state)) + (let ((a0-8 (-> self nav state)) (v1-17 (-> self controller turn-exit-point)) ) - (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) - (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-9 target-post quad) (-> v1-17 quad)) + (logclear! (-> a0-8 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-8 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-8 target-post quad) (-> v1-17 quad)) ) 0 (citizen-nav-init! self) @@ -1210,7 +1199,6 @@ (set! (-> v1-36 enemy-flags) (the-as enemy-flag (logclear (-> v1-36 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) @@ -1219,9 +1207,8 @@ (t9-0) ) ) - (none) ) - :code (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) + :code (behavior () (local-vars (sv-128 float)) (let ((gp-0 0)) (case (-> (the-as vehicle (handle->process (-> self vehicle))) info object-type) @@ -1283,8 +1270,8 @@ (s0-0 (ja-aframe-num 0)) ) (set! sv-128 (ja-aframe 8.0 0)) - (let* ((t0-1 (ja-aframe 2.0 0)) - (f0-9 (s3-2 s2-1 s1-0 s0-0 sv-128 t0-1)) + (let* ((t0-0 (ja-aframe 2.0 0)) + (f0-9 (s3-2 s2-1 s1-0 s0-0 sv-128 t0-0)) (f30-0 (- 1.0 f0-9)) ) (quaternion-copy! (-> self root quat) s4-2) @@ -1302,7 +1289,6 @@ (set! (-> v1-83 prim-core collide-with) (-> self root backup-collide-with)) ) (go-virtual wait-for-ride) - (none) ) ) @@ -1335,11 +1321,9 @@ ) 0 (set! (-> self vehicle) (the-as handle #f)) - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type civilian wait-for-ride) trans))) @@ -1353,7 +1337,6 @@ (go-virtual go-at-end) ) ) - (none) ) :code (behavior () (until #f @@ -1441,7 +1424,6 @@ (label cfg-28) ) #f - (none) ) :post (behavior () (let ((gp-0 (-> self nav state)) @@ -1453,7 +1435,6 @@ ) 0 (nav-enemy-method-176 self) - (none) ) ) @@ -1481,11 +1462,9 @@ ) 0 (set! (-> self vehicle) (the-as handle #f)) - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) - (none) ) :trans (behavior () (when (and (-> self jump-in-pipe?) (< (vector-vector-xz-distance (-> self root trans) (-> self end-pos)) 24576.0)) @@ -1523,7 +1502,6 @@ ) (go-virtual wait-at-end) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1536,7 +1514,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1548,7 +1525,6 @@ ) 0 (nav-enemy-method-176 self) - (none) ) ) @@ -1577,11 +1553,9 @@ 0 (set! (-> self vehicle) (the-as handle #f)) (logior! (-> self nav flags) (nav-control-flag output-sphere-hash)) - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack 'sphere))) @@ -1621,7 +1595,6 @@ (send-event self 'jump 0 (-> self end-pos)) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1634,7 +1607,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1646,7 +1618,6 @@ ) 0 (nav-enemy-method-176 self) - (none) ) ) @@ -1727,11 +1698,9 @@ ) ) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1753,11 +1722,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -1780,7 +1747,6 @@ (t9-1) ) ) - (none) ) ) @@ -1793,11 +1759,9 @@ ) ) (format #t "city-lurker active~%") - (none) ) :code (behavior () (go-virtual wait-for-ride) - (none) ) ) @@ -1805,7 +1769,6 @@ :virtual #t :code (behavior () (go-virtual wait-for-ride) - (none) ) ) @@ -1813,19 +1776,18 @@ :virtual #t :code (behavior () (go-virtual wait-for-ride) - (none) ) ) (defstate idle (city-lurker) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) @@ -1850,7 +1812,6 @@ 0 (logior! (-> self focus-status) (focus-status pilot-riding pilot)) (set! (-> self coming-from-pw) #t) - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) @@ -1864,7 +1825,6 @@ (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :trans (behavior () (let ((a0-1 (handle->process (-> self vehicle)))) @@ -1884,7 +1844,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1943,11 +1902,9 @@ ) ) #f - (none) ) :post (behavior () (transform-post) - (none) ) ) @@ -2082,79 +2039,67 @@ (none) ) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 134] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 139] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 110] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 114] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 118] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 15] (defmethod general-event-handler city-lurker ((obj city-lurker) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'nav-mesh-kill) - (format 0 "nav-mesh-kill event recieved by ~s ~d~%" (-> obj name) arg2) - (change-to *default-nav-mesh* obj) - #t - ) - ((= v1-0 'traffic-activate) - (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) - (let ((s5-0 (the-as object (-> arg3 param 0)))) - (set! (-> obj root trans quad) (-> (the-as traffic-object-spawn-params s5-0) position quad)) - (quaternion-copy! (-> obj root quat) (-> (the-as traffic-object-spawn-params s5-0) rotation)) - (set! (-> obj root transv quad) (-> (the-as traffic-object-spawn-params s5-0) velocity quad)) - (let ((a0-10 (-> (the-as traffic-object-spawn-params s5-0) nav-mesh))) - (when a0-10 - (change-to a0-10 obj) - (if (not (-> obj nav)) - (go-inactive obj) - ) - (let ((v1-17 (-> obj nav state))) - (set! (-> v1-17 current-poly) (the-as nav-poly #f)) - ) - 0 - (let ((a1-5 (-> (the-as traffic-object-spawn-params s5-0) nav-branch))) - (when a1-5 - (vehicle-controller-method-13 (-> obj controller) a1-5 (-> obj root trans)) - (let ((a0-14 (-> obj nav state)) - (v1-24 (-> obj controller turn-exit-point)) - ) - (logclear! (-> a0-14 flags) (nav-state-flag directional-mode)) - (logior! (-> a0-14 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-14 target-post quad) (-> v1-24 quad)) + (case arg2 + (('nav-mesh-kill) + (format 0 "nav-mesh-kill event recieved by ~s ~d~%" (-> obj name) arg2) + (change-to *default-nav-mesh* obj) + #t + ) + (('traffic-activate) + (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (let ((s5-0 (the-as object (-> arg3 param 0)))) + (set! (-> obj root trans quad) (-> (the-as traffic-object-spawn-params s5-0) position quad)) + (quaternion-copy! (-> obj root quat) (-> (the-as traffic-object-spawn-params s5-0) rotation)) + (set! (-> obj root transv quad) (-> (the-as traffic-object-spawn-params s5-0) velocity quad)) + (let ((a0-10 (-> (the-as traffic-object-spawn-params s5-0) nav-mesh))) + (when a0-10 + (change-to a0-10 obj) + (if (not (-> obj nav)) + (go-inactive obj) + ) + (let ((v1-17 (-> obj nav state))) + (set! (-> v1-17 current-poly) (the-as nav-poly #f)) + ) + 0 + (let ((a1-5 (-> (the-as traffic-object-spawn-params s5-0) nav-branch))) + (when a1-5 + (vehicle-controller-method-13 (-> obj controller) a1-5 (-> obj root trans)) + (let ((a0-14 (-> obj nav state)) + (v1-24 (-> obj controller turn-exit-point)) ) - 0 - ) + (logclear! (-> a0-14 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-14 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-14 target-post quad) (-> v1-24 quad)) ) - (citizen-nav-init! obj) - (citizen-init! obj) - (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) - (set! (-> obj gnd-height) (-> obj root gspot-pos y)) + 0 ) ) - (set-behavior! obj (the-as traffic-object-spawn-params s5-0)) + (citizen-nav-init! obj) + (citizen-init! obj) + (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) + (set! (-> obj gnd-height) (-> obj root gspot-pos y)) ) ) - ((= v1-0 'traffic-off) - #f - ) - ((= v1-0 'traffic-off-force) - #f - ) - ((= v1-0 'traffic-on) - #f - ) - ((or (= v1-0 'hit) (= v1-0 'hit-flinch) (= v1-0 'hit-knocked)) - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) - ) - (else - ((method-of-type civilian general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) + (set-behavior! obj (the-as traffic-object-spawn-params s5-0)) + ) + ) + (('traffic-off) + #f + ) + (('traffic-off-force) + #f + ) + (('traffic-on) + #f + ) + (('hit 'hit-flinch 'hit-knocked) + ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type civilian general-event-handler) obj arg0 arg1 arg2 arg3) ) ) ) diff --git a/goal_src/jak2/levels/city/onintent/onin-game.gc b/goal_src/jak2/levels/city/onintent/onin-game.gc index 1dea67c38f8..078c93236cf 100644 --- a/goal_src/jak2/levels/city/onintent/onin-game.gc +++ b/goal_src/jak2/levels/city/onintent/onin-game.gc @@ -1780,13 +1780,13 @@ (defstate idle (onin-game-bubble) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go empty-state) ) (('attack) - (if (-> event param 0) + (if (-> block param 0) (go empty-state) ) ) @@ -1849,14 +1849,13 @@ ) ) (go-virtual fall) - (none) ) ) (defstate fall (onin-game-bubble) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (when (not (-> self dead?)) (sound-play "onin-pop") @@ -1927,7 +1926,6 @@ 819.2 1.0 ) - (none) ) :code (behavior () (while (and (not (and (< (-> self root transv y) 0.0) (< (-> self root trans y) 36044.8))) (not (-> self dead?))) @@ -1989,14 +1987,12 @@ (while (not (and (< (-> self root transv y) 0.0) (< (-> self root trans y) 31948.8))) (suspend) ) - (none) ) :post (behavior () (+! (-> self root transv y) (* (-> self gravity) (seconds-per-frame))) (set! (-> self root transv x) (* 0.999 (-> self root transv x))) (vector-v+! (-> self root trans) (-> self root trans) (-> self root transv)) (spawn (-> self part) (-> self root trans)) - (none) ) ) @@ -2325,7 +2321,6 @@ (ja-channel-set! 0) (ja-post) (sleep-code) - (none) ) ) @@ -2336,14 +2331,13 @@ (suspend) ) (go-virtual active #t) - (none) ) ) (defstate active (onin-game) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('done) (sound-play "onin-splat") (set! (-> self last-type) -1) @@ -2432,7 +2426,6 @@ ) ) ) - (none) ) :exit (behavior () (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -2502,7 +2495,6 @@ (want-sound-banks *load-state* (the-as (pointer symbol) a1-29)) ) ) - (none) ) :trans (behavior () (cond @@ -2550,7 +2542,6 @@ (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons up right down left l1 r1 triangle circle x square) ) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-set! 0) @@ -2561,12 +2552,10 @@ ) (talker-spawn-func (-> *talker-speech* 145) *entity-pool* (target-pos 0) (the-as region #f)) (sleep-code) - (none) ) :post (behavior () (onin-game-method-25 self) (ja-post) - (none) ) ) @@ -2628,11 +2617,9 @@ (set-blackout-frames (seconds 0.1)) (sleep-code) ) - (none) ) :post (behavior () (onin-game-method-26 self) - (none) ) ) @@ -2692,7 +2679,6 @@ (set-blackout-frames (seconds 0.1)) (send-event (handle->process gp-4) 'complete) ) - (none) ) :post (-> (method-of-type onin-game lose) post) ) diff --git a/goal_src/jak2/levels/city/oracle/oracle-training.gc b/goal_src/jak2/levels/city/oracle/oracle-training.gc index 415fca9c039..93a400cc826 100644 --- a/goal_src/jak2/levels/city/oracle/oracle-training.gc +++ b/goal_src/jak2/levels/city/oracle/oracle-training.gc @@ -316,18 +316,17 @@ TASK_MANAGER_EVENT_HOOK (lambda :behavior task-manager ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('notify) - (case (-> arg3 param 0) - (('attack) - (if (= (-> arg3 param 1) 18) - #f - ) - ) - ) - ) - ) - ) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if (= (-> arg3 param 1) 18) + #f + ) + ) + ) + ) + ) ) ) diff --git a/goal_src/jak2/levels/city/package/delivery-task.gc b/goal_src/jak2/levels/city/package/delivery-task.gc index 5ee60231f84..afc45db189e 100644 --- a/goal_src/jak2/levels/city/package/delivery-task.gc +++ b/goal_src/jak2/levels/city/package/delivery-task.gc @@ -78,7 +78,6 @@ (set-vector! (-> self root scale) f0-5 f0-5 f0-5 1.0) ) (ja-post) - (none) ) ) @@ -86,7 +85,6 @@ :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak2/levels/city/palace/ctypal-obs.gc b/goal_src/jak2/levels/city/palace/ctypal-obs.gc index 19062f0606a..f6347efdd31 100644 --- a/goal_src/jak2/levels/city/palace/ctypal-obs.gc +++ b/goal_src/jak2/levels/city/palace/ctypal-obs.gc @@ -161,12 +161,10 @@ This commonly includes things such as: (process-drawable-from-entity! self (the-as entity-actor (-> self ent))) (go-virtual done) ) - (none) ) :code (the-as (function none :behavior ctypal-broke-wall) sleep-code) :post (behavior () (transform-post) - (none) ) ) @@ -175,7 +173,6 @@ This commonly includes things such as: :code (the-as (function none :behavior ctypal-broke-wall) sleep-code) :post (behavior () (transform-post) - (none) ) ) diff --git a/goal_src/jak2/levels/city/port/ctyport-part.gc b/goal_src/jak2/levels/city/port/ctyport-part.gc index 66df92a2413..76169e37926 100644 --- a/goal_src/jak2/levels/city/port/ctyport-part.gc +++ b/goal_src/jak2/levels/city/port/ctyport-part.gc @@ -3439,7 +3439,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior hiphog-exterior-marquee) ja-post) ) @@ -3555,14 +3554,12 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (ja-post) (if (nonzero? (-> self part)) (spawn-with-cspace (-> self part) (-> self node-list data 5)) ) - (none) ) ) diff --git a/goal_src/jak2/levels/city/port/portrun/portrun.gc b/goal_src/jak2/levels/city/port/portrun/portrun.gc index 0898be8e6ae..a80d81ee7bf 100644 --- a/goal_src/jak2/levels/city/port/portrun/portrun.gc +++ b/goal_src/jak2/levels/city/port/portrun/portrun.gc @@ -971,7 +971,6 @@ (set! (-> self state-time) (current-time)) (set! (-> self beep-time) 0) 0 - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -980,7 +979,6 @@ ) ) (cleanup-for-death self) - (none) ) :post (behavior () (cond @@ -1054,7 +1052,6 @@ ) (ctyport-mine-method-23 self) (transform-post) - (none) ) ) @@ -1062,7 +1059,6 @@ :virtual #t :enter (behavior () (set! (-> self acc-y) (* 4096.0 (+ 8.0 (* 8.0 (rand-vu))))) - (none) ) :code (behavior () (let ((v1-1 (-> self root root-prim))) @@ -1080,7 +1076,6 @@ #f (label cfg-5) (deactivate self) - (none) ) :post (behavior () (set! (-> self speed-y) (- (-> self speed-y) (* (-> self speed-y) (seconds-per-frame)))) @@ -1088,18 +1083,17 @@ (+! (-> self trans-y) (* (-> self speed-y) (seconds-per-frame))) (set! (-> self root trans y) (+ 2048.0 (-> self trans-y))) (transform-post) - (none) ) ) (defstate idle (ctyport-mine) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched 'touch 'attack) (cond ((logtest? (process-mask projectile vehicle) (-> proc mask)) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (new-attack-id)) (mode 'mine)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (new-attack-id)) (mode 'mine)))) (set! (-> self beep) #f) ) (else @@ -1118,7 +1112,6 @@ :post (behavior () (ctyport-mine-method-23 self) (transform-post) - (none) ) ) @@ -1203,7 +1196,6 @@ :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.3)) @@ -1233,7 +1225,6 @@ (quaternion-slerp! (-> self root quat) (-> self root quat) gp-0 0.1) ) ) - (none) ) :code (behavior () (until #f @@ -1247,7 +1238,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior ctyport-spy) ja-post) ) @@ -1335,7 +1325,7 @@ (defstate idle (ctyport-cargo) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1344,7 +1334,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (case event-type + (case message (('attack) (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) (set! (-> gp-0 fountain-rand-transv-lo quad) (-> (target-pos 0) quad)) @@ -1436,7 +1426,6 @@ (set! (-> self speed-y) (- (-> self speed-y) (* 409.6 (seconds-per-frame)))) (+! (-> self trans-y) (* (-> self speed-y) (seconds-per-frame))) (set! (-> self root trans y) (-> self trans-y)) - (none) ) :code (behavior () (until #f @@ -1447,7 +1436,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior ctyport-cargo) transform-post) ) @@ -1470,7 +1458,6 @@ (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) (remove-setting! 'interp-time) (remove-setting! 'mode-name) - (none) ) :trans (behavior () (set! (-> self root trans y) @@ -1481,7 +1468,6 @@ ) ) ) - (none) ) :code (behavior () (set-setting! 'interp-time 'abs 0.0 0) @@ -1500,7 +1486,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior ctyport-cargo) ja-post) ) @@ -1514,7 +1499,6 @@ ) ) (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak2/levels/city/port/race/errol-chal.gc b/goal_src/jak2/levels/city/port/race/errol-chal.gc index 70c7be6cb0d..1b59a4b1a2d 100644 --- a/goal_src/jak2/levels/city/port/race/errol-chal.gc +++ b/goal_src/jak2/levels/city/port/race/errol-chal.gc @@ -436,7 +436,6 @@ :enter (behavior () (format #t "errol-rider::got-passed~%") (speech-control-method-12 *speech-control* self (speech-type speech-type-54)) - (none) ) ) @@ -449,7 +448,6 @@ :enter (behavior () (format #t "errol-rider::taunt race-errol-pass~%") (speech-control-method-12 *speech-control* self (speech-type speech-type-53)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.05)) @@ -476,7 +474,6 @@ ) ) (go-virtual active) - (none) ) :post (behavior () (let ((gp-0 (ppointer->process (-> self parent)))) @@ -486,7 +483,6 @@ ) ) (ja-post) - (none) ) ) @@ -745,54 +741,51 @@ (defstate idle (turbo-ring) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touched) - (let* ((s4-0 (-> (the-as vehicle proc) root)) - (gp-0 (if (type? s4-0 collide-shape-moving) - s4-0 - ) - ) - ) - (when gp-0 - (let ((s4-1 (new 'stack-no-clear 'vehicle-control-point))) - (set! (-> s4-1 local-pos quad) (-> gp-0 trans quad)) - (set! (-> s4-1 normal quad) (-> gp-0 trans-old-old quad)) - (set! (-> s4-1 local-pos w) 1.0) - (set! (-> s4-1 normal w) 1.0) - (let ((f30-0 (vector4-dot (-> self plane) (-> s4-1 local-pos))) - (f28-0 (vector4-dot (-> self plane) (-> s4-1 normal))) - (f0-5 (fmax - (vector-vector-distance-squared (-> self root trans) (-> s4-1 local-pos)) - (vector-vector-distance-squared (-> self root trans) (-> s4-1 normal)) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (let* ((s4-0 (-> (the-as vehicle proc) root)) + (gp-0 (if (type? s4-0 collide-shape-moving) + s4-0 + ) + ) + ) + (when gp-0 + (let ((s4-1 (new 'stack-no-clear 'vehicle-control-point))) + (set! (-> s4-1 local-pos quad) (-> gp-0 trans quad)) + (set! (-> s4-1 normal quad) (-> gp-0 trans-old-old quad)) + (set! (-> s4-1 local-pos w) 1.0) + (set! (-> s4-1 normal w) 1.0) + (let ((f30-0 (vector4-dot (-> self plane) (-> s4-1 local-pos))) + (f28-0 (vector4-dot (-> self plane) (-> s4-1 normal))) + (f0-5 (fmax + (vector-vector-distance-squared (-> self root trans) (-> s4-1 local-pos)) + (vector-vector-distance-squared (-> self root trans) (-> s4-1 normal)) ) - (f1-0 40960.0) + ) + (f1-0 40960.0) + ) + (when (< f0-5 (* f1-0 f1-0)) + (when (or (and (< f30-0 0.0) (>= f28-0 0.0)) (and (< f28-0 0.0) (>= f30-0 0.0))) + (send-event proc 'turbo-ring (-> self boost)) + (set! (-> self touch-time) (current-time)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1059) + 0 + #f + #f + #f + (-> self mat) + :to *entity-pool* ) - (when (< f0-5 (* f1-0 f1-0)) - (when (or (and (< f30-0 0.0) (>= f28-0 0.0)) (and (< f28-0 0.0) (>= f30-0 0.0))) - (send-event proc 'turbo-ring (-> self boost)) - (set! (-> self touch-time) (current-time)) - (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 1059) - 0 - #f - #f - #f - (-> self mat) - :to *entity-pool* - ) - (when (logtest? (-> gp-0 root-prim prim-core collide-as) (collide-spec jak)) - (set! (-> self player-got) #t) - (send-event (ppointer->process (-> self parent)) 'turbo-ring-pickup (-> self id)) - (if (not (-> self persistent)) - (the-as symbol (kill-callback (-> *minimap* engine) (-> self minimap))) - ) - ) + (when (logtest? (-> gp-0 root-prim prim-core collide-as) (collide-spec jak)) + (set! (-> self player-got) #t) + (send-event (ppointer->process (-> self parent)) 'turbo-ring-pickup (-> self id)) + (if (not (-> self persistent)) + (kill-callback (-> *minimap* engine) (-> self minimap)) + ) ) ) ) @@ -800,7 +793,7 @@ ) ) ) - ) + ) ) ) :code (the-as (function none :behavior turbo-ring) sleep-code) @@ -817,7 +810,6 @@ ) (spawn-with-matrix (-> self part) (-> self mat)) 0 - (none) ) ) @@ -833,7 +825,6 @@ (until (>= (- (current-time) (-> self state-time)) (seconds 2)) (suspend) ) - (none) ) ) @@ -1429,15 +1420,14 @@ TASK_MANAGER_EVENT_HOOK (lambda :behavior task-manager ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('race-win 'race-lose) - (let ((v0-0 1)) - (set! (-> self sub-state) (the-as uint v0-0)) - v0-0 - ) - ) - ) - ) + (case arg2 + (('race-win 'race-lose) + (let ((v0-0 1)) + (set! (-> self sub-state) (the-as uint v0-0)) + v0-0 + ) + ) + ) ) ) diff --git a/goal_src/jak2/levels/city/protect/protect.gc b/goal_src/jak2/levels/city/protect/protect.gc index c720053121d..24b398ae92c 100644 --- a/goal_src/jak2/levels/city/protect/protect.gc +++ b/goal_src/jak2/levels/city/protect/protect.gc @@ -58,7 +58,6 @@ :post (behavior () (spawn (-> self part) (-> self node-list data 3 bone transform trans)) (ja-post) - (none) ) ) @@ -66,7 +65,6 @@ :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak2/levels/city/sack/collection-task.gc b/goal_src/jak2/levels/city/sack/collection-task.gc index 7a725bc7aa9..546e17fb177 100644 --- a/goal_src/jak2/levels/city/sack/collection-task.gc +++ b/goal_src/jak2/levels/city/sack/collection-task.gc @@ -125,7 +125,6 @@ ) ) ) - (none) ) :code (behavior () (let ((beam-params (new 'stack-no-clear 'task-arrow-params))) @@ -150,7 +149,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior krew-collection-item) ja-post) ) @@ -159,7 +157,6 @@ :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -366,7 +363,7 @@ *game-info* (game-task-node city-krew-collection-collection) TASK_MANAGER_FAIL_HOOK - (lambda :behavior task-manager () (the-as object (kill-all-children self))) + (lambda :behavior task-manager () (kill-all-children self)) ) (set-subtask-hook! diff --git a/goal_src/jak2/levels/city/shuttle/shuttle.gc b/goal_src/jak2/levels/city/shuttle/shuttle.gc index f974ccc4986..8ec6feb041e 100644 --- a/goal_src/jak2/levels/city/shuttle/shuttle.gc +++ b/goal_src/jak2/levels/city/shuttle/shuttle.gc @@ -310,7 +310,6 @@ (go-virtual active) (go-virtual wait-for-ride) ) - (none) ) ) @@ -335,7 +334,6 @@ (go-virtual active) (go-virtual wait-for-ride) ) - (none) ) ) @@ -368,19 +366,18 @@ (t9-8) ) ) - (none) ) ) (defstate exit-vehicle (citizen-rebel) :virtual #t :event (the-as (function process int symbol event-message-block object :behavior citizen-rebel) enemy-event-handler) - :enter (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) - (let ((a0-2 (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)))) - (if a0-2 - (set! (-> self nav-mesh-aid) (the-as actor-id (-> a0-2 entity aid))) + :enter (behavior () + (let ((a0-1 (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)))) + (if a0-1 + (set! (-> self nav-mesh-aid) (the-as actor-id (-> a0-1 entity aid))) ) - (change-to a0-2 self) + (change-to a0-1 self) ) (when (not (-> self nav)) (format #t "nav mesh not found~%") @@ -394,12 +391,12 @@ self (vector-negate-in-place! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (let ((a0-9 (-> self nav state)) + (let ((a0-8 (-> self nav state)) (v1-17 (-> self controller turn-exit-point)) ) - (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) - (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-9 target-post quad) (-> v1-17 quad)) + (logclear! (-> a0-8 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-8 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-8 target-post quad) (-> v1-17 quad)) ) 0 (citizen-nav-init! self) @@ -421,7 +418,6 @@ (set! (-> v1-36 enemy-flags) (the-as enemy-flag (logclear (-> v1-36 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type civilian exit-vehicle) exit))) @@ -429,9 +425,8 @@ (t9-0) ) ) - (none) ) - :code (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) + :code (behavior () (local-vars (sv-176 float) (sv-192 float) (sv-208 float)) (remove-rider (the-as vehicle (handle->process (-> self vehicle))) self) (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) @@ -470,8 +465,8 @@ (s0-0 (ja-aframe-num 0)) ) (set! sv-176 (ja-aframe 10.0 0)) - (let* ((t0-1 (ja-aframe 7.0 0)) - (f0-4 (s3-2 s2-0 s1-0 s0-0 sv-176 t0-1)) + (let* ((t0-0 (ja-aframe 7.0 0)) + (f0-4 (s3-2 s2-0 s1-0 s0-0 sv-176 t0-0)) ) (quaternion-rotate-local-y! (-> self root quat) s4-2 (* f0-4 (if (zero? (-> self seat)) -16384.0 @@ -506,12 +501,12 @@ :frame-num (ja-aframe 5.0 0) ) (until (ja-done? 0) - (let ((a0-60 (handle->process (-> self vehicle))) + (let ((a0-59 (handle->process (-> self vehicle))) (s2-1 (new 'stack-no-clear 'vector)) (s4-6 (new 'stack-no-clear 'vector)) (s3-4 (new 'stack-no-clear 'quaternion)) ) - (compute-seat-position (the-as vehicle a0-60) s2-1 (-> self seat)) + (compute-seat-position (the-as vehicle a0-59) s2-1 (-> self seat)) (vector-! s4-6 s2-1 gp-0) (let ((s2-2 lerp-scale) (s1-1 0.0) @@ -519,8 +514,8 @@ ) (set! sv-192 (ja-aframe-num 0)) (set! sv-208 (ja-aframe 5.0 0)) - (let* ((t0-2 (ja-aframe 1.0 0)) - (f0-13 (s2-2 s1-1 s0-1 sv-192 sv-208 t0-2)) + (let* ((t0-1 (ja-aframe 1.0 0)) + (f0-13 (s2-2 s1-1 s0-1 sv-192 sv-208 t0-1)) (f30-0 (- 1.0 f0-13)) ) (quaternion-rotate-local-y! s3-4 s5-0 (if (zero? (-> self seat)) @@ -528,10 +523,10 @@ 16384.0 ) ) - (let ((a1-40 (vector-y-quaternion! (new 'stack-no-clear 'vector) s3-4)) + (let ((a1-39 (vector-y-quaternion! (new 'stack-no-clear 'vector) s3-4)) (s2-3 (new 'stack-no-clear 'quaternion)) ) - (quaternion-from-two-vectors! s2-3 a1-40 *up-vector*) + (quaternion-from-two-vectors! s2-3 a1-39 *up-vector*) (quaternion*! s3-4 s2-3 s3-4) ) (quaternion-copy! (-> self root quat) s3-4) @@ -548,7 +543,6 @@ (set! (-> v1-96 prim-core collide-with) (-> self root backup-collide-with)) ) (go-virtual wait-for-ride) - (none) ) ) @@ -585,7 +579,6 @@ ) (go-virtual active) ) - (none) ) :code (behavior () (until #f @@ -642,7 +635,6 @@ ) ) #f - (none) ) ) @@ -671,7 +663,6 @@ ) ) ) - (none) ) ) @@ -747,7 +738,6 @@ :virtual #t :trans (behavior () '() - (none) ) :code (behavior () (until #f @@ -807,7 +797,6 @@ ) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/city/slums/kor/kid-states.gc b/goal_src/jak2/levels/city/slums/kor/kid-states.gc index 550de6834b5..8882622dc94 100644 --- a/goal_src/jak2/levels/city/slums/kor/kid-states.gc +++ b/goal_src/jak2/levels/city/slums/kor/kid-states.gc @@ -27,7 +27,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -52,7 +51,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -80,7 +78,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kid) nav-enemy-simple-post) ) @@ -102,7 +99,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -118,7 +114,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (local-vars (s4-1 art-element) (f0-9 float)) @@ -224,7 +219,6 @@ ) ) (kid-method-232 self) - (none) ) :post (the-as (function none :behavior kid) nav-enemy-simple-post) ) @@ -241,7 +235,6 @@ (go-virtual traveling) ) ) - (none) ) :code (-> (method-of-type kid waiting-idle) code) :post (-> (method-of-type kid waiting-idle) post) @@ -265,7 +258,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -290,7 +282,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -318,7 +309,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kid) nav-enemy-simple-post) ) @@ -343,7 +333,6 @@ (stop-looking-at-target! self) (nav-enemy-method-166 self) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -366,7 +355,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -374,7 +362,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -386,7 +373,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -408,7 +394,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -424,7 +409,6 @@ ) ) ) - (none) ) :code (-> (method-of-type kid waiting-idle) code) :post (the-as (function none :behavior kid) nav-enemy-simple-post) @@ -443,7 +427,6 @@ ) 0 (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -459,7 +442,6 @@ (go-virtual traveling) ) ) - (none) ) :code (-> (method-of-type kid waiting-idle) code) ) @@ -473,7 +455,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () (local-vars (v1-31 enemy-flag) (v1-39 enemy-flag)) @@ -511,7 +492,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -524,7 +504,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) ) @@ -549,7 +528,6 @@ (if (logtest? (bot-flags bf20) (-> self bot-flags)) (logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water)) ) - (none) ) :trans (behavior () (cond @@ -575,7 +553,6 @@ ) ) ) - (none) ) :code (behavior () (when (not (logtest? (bot-flags bf20) (-> self bot-flags))) @@ -623,7 +600,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kid) nav-enemy-simple-post) ) @@ -633,7 +609,6 @@ :enter (behavior () (logior! (-> self bot-flags) (bot-flags bf20)) ((-> (method-of-type kid arrested) enter)) - (none) ) :trans (-> (method-of-type kid arrested) trans) :code (-> (method-of-type kid arrested) code) diff --git a/goal_src/jak2/levels/city/slums/kor/kid.gc b/goal_src/jak2/levels/city/slums/kor/kid.gc index ab1fc636820..f35903bb32e 100644 --- a/goal_src/jak2/levels/city/slums/kor/kid.gc +++ b/goal_src/jak2/levels/city/slums/kor/kid.gc @@ -480,15 +480,15 @@ #f ) +;; WARN: Return type mismatch none vs object. (defmethod go-hostile kid ((obj kid)) (kid-method-232 obj) - (none) ) +;; WARN: Return type mismatch none vs object. (defmethod react-to-focus kid ((obj kid)) "@TODO - flesh out docs" (kid-method-232 obj) - (none) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/city/slums/kor/kor-states.gc b/goal_src/jak2/levels/city/slums/kor/kor-states.gc index 200e9c342b6..dc26da7ce24 100644 --- a/goal_src/jak2/levels/city/slums/kor/kor-states.gc +++ b/goal_src/jak2/levels/city/slums/kor/kor-states.gc @@ -25,7 +25,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -50,7 +49,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -78,7 +76,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kor) nav-enemy-simple-post) ) @@ -101,7 +98,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -117,7 +113,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (local-vars (s4-1 art-element) (f0-9 float)) @@ -233,7 +228,6 @@ ) ) (kor-method-232 self) - (none) ) :post (the-as (function none :behavior kor) nav-enemy-simple-post) ) @@ -250,7 +244,6 @@ (go-virtual traveling) ) ) - (none) ) :code (-> (method-of-type kor waiting-idle) code) :post (-> (method-of-type kor waiting-idle) post) @@ -274,7 +267,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -299,7 +291,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -327,7 +318,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kor) nav-enemy-simple-post) ) @@ -352,7 +342,6 @@ (stop-looking-at-target! self) (nav-enemy-method-166 self) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -375,7 +364,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -383,7 +371,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -395,7 +382,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -417,7 +403,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -433,7 +418,6 @@ ) ) ) - (none) ) :code (-> (method-of-type kor waiting-idle) code) :post (the-as (function none :behavior kor) nav-enemy-simple-post) @@ -452,7 +436,6 @@ ) 0 (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -468,7 +451,6 @@ (go-virtual traveling) ) ) - (none) ) :code (-> (method-of-type kor waiting-idle) code) ) @@ -482,7 +464,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () (local-vars (v1-31 enemy-flag) (v1-39 enemy-flag)) @@ -520,7 +501,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -533,7 +513,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) ) @@ -558,7 +537,6 @@ (if (logtest? (bot-flags bf20) (-> self bot-flags)) (logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water)) ) - (none) ) :trans (behavior () (cond @@ -584,7 +562,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.25)) @@ -647,7 +624,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kor) nav-enemy-simple-post) ) @@ -657,7 +633,6 @@ :enter (behavior () (logior! (-> self bot-flags) (bot-flags bf20)) ((-> (method-of-type kor arrested) enter)) - (none) ) :trans (-> (method-of-type kor arrested) trans) :code (-> (method-of-type kor arrested) code) diff --git a/goal_src/jak2/levels/city/slums/kor/kor.gc b/goal_src/jak2/levels/city/slums/kor/kor.gc index d43309ddf54..c75effa73b9 100644 --- a/goal_src/jak2/levels/city/slums/kor/kor.gc +++ b/goal_src/jak2/levels/city/slums/kor/kor.gc @@ -484,15 +484,15 @@ #f ) +;; WARN: Return type mismatch none vs object. (defmethod go-hostile kor ((obj kor)) (kor-method-232 obj) - (none) ) +;; WARN: Return type mismatch none vs object. (defmethod react-to-focus kor ((obj kor)) "@TODO - flesh out docs" (kor-method-232 obj) - (none) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/city/slums/neon-baron-part.gc b/goal_src/jak2/levels/city/slums/neon-baron-part.gc index 92167e3a148..782dc3ae7ed 100644 --- a/goal_src/jak2/levels/city/slums/neon-baron-part.gc +++ b/goal_src/jak2/levels/city/slums/neon-baron-part.gc @@ -3274,7 +3274,6 @@ :virtual #t :trans (behavior () (spawn-parts self) - (none) ) :code (behavior () (until #f @@ -3465,7 +3464,6 @@ ) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-chick.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-chick.gc index 47ca9ec871e..8e15c2c6c91 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-chick.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-chick.gc @@ -452,7 +452,6 @@ (set! (-> v1-5 child 1 prim-core collide-with) (collide-spec)) ) 0 - (none) ) ) @@ -472,7 +471,6 @@ (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) ) ) - (none) ) ) @@ -492,7 +490,6 @@ (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) ) ) - (none) ) ) @@ -513,7 +510,6 @@ ) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-enemy.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-enemy.gc index 532e80f13f8..c92df39a4fa 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-enemy.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-enemy.gc @@ -244,7 +244,6 @@ ) ) #f - (none) ) ) @@ -260,7 +259,6 @@ (t9-0) ) ) - (none) ) ) @@ -306,16 +304,12 @@ ((method-of-type nav-enemy kill-prefer-falling) obj) ) -;; WARN: Return type mismatch object vs none. (defmethod go-hostile citizen-enemy ((obj citizen-enemy)) (if (not (and (-> obj next-state) (= (-> obj next-state name) 'hostile))) (go (method-of-object obj hostile)) ) - (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-stare citizen-enemy ((obj citizen-enemy)) (go (method-of-object obj active)) - (none) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-fat.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-fat.gc index 9ecfda48c10..2814da793e5 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-fat.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-fat.gc @@ -452,7 +452,6 @@ (set! (-> v1-5 child 1 prim-core collide-with) (collide-spec)) ) 0 - (none) ) ) @@ -472,7 +471,6 @@ (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) ) ) - (none) ) ) @@ -492,7 +490,6 @@ (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) ) ) - (none) ) ) @@ -500,7 +497,6 @@ :virtual #t :trans (behavior () '() - (none) ) :code (behavior () (until #f @@ -554,7 +550,6 @@ ) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc index 5cee19854a5..1f54ba43bd7 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc @@ -497,7 +497,6 @@ (set! (-> v1-5 child 1 prim-core collide-with) (collide-spec)) ) 0 - (none) ) ) @@ -517,7 +516,6 @@ (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) ) ) - (none) ) ) @@ -537,7 +535,6 @@ (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) ) ) - (none) ) ) @@ -545,7 +542,6 @@ :virtual #t :trans (behavior () '() - (none) ) :code (behavior () (until #f @@ -599,7 +595,6 @@ ) ) #f - (none) ) ) @@ -690,12 +685,10 @@ :event (the-as (function process int symbol event-message-block object :behavior citizen-norm) enemy-event-handler) :enter (behavior () '() - (none) ) :code (behavior () (suspend) (throw-off-vehicle self) - (none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen.gc index c54152ce45a..b32b33e4d78 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen.gc @@ -115,28 +115,22 @@ 3 ) -;; WARN: Return type mismatch object vs none. (defmethod go-stare citizen ((obj citizen)) (go (method-of-object obj flee)) - (none) ) +;; WARN: Return type mismatch none vs object. (defmethod go-hostile citizen ((obj citizen)) (go-inactive obj) - (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-flee citizen ((obj citizen)) (go (method-of-object obj flee)) - (none) ) -;; WARN: Return type mismatch object vs none. (defmethod react-to-focus citizen ((obj citizen)) "@TODO - flesh out docs" (go (method-of-object obj active)) - (none) ) ;; WARN: Return type mismatch none vs object. @@ -144,7 +138,7 @@ "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (logclear! (-> obj flags) (citizen-flag persistent)) (send-event (ppointer->process (-> obj parent)) 'child-killed) - (the-as object (go-inactive obj)) + (go-inactive obj) ) (defmethod cleanup-for-death citizen ((obj citizen)) @@ -243,103 +237,94 @@ (none) ) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 193] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 198] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 69] (defmethod general-event-handler citizen ((obj citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (let ((v1-0 arg2)) - (the-as - object - (cond - ((or (= v1-0 'hit) (= v1-0 'hit-flinch) (= v1-0 'hit-knocked)) - (let ((v1-1 #f)) - (case (-> obj incoming knocked-type) - (((knocked-type knocked-type-4) - (knocked-type knocked-type-6) - (knocked-type knocked-type-5) - (knocked-type knocked-type-2) - ) - (set! v1-1 #t) - ) - (((knocked-type knocked-type-0)) - (+! (-> obj hit-by-player-count) 1) - (set! v1-1 (>= (-> obj hit-by-player-count) 2)) - ) - ) - (when v1-1 - (let* ((s5-0 (handle->process (-> obj incoming attacker-handle))) - (a2-5 (if (type? s5-0 process-focusable) - s5-0 - ) + (case arg2 + (('hit 'hit-flinch 'hit-knocked) + (let ((v1-1 #f)) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-4) + (knocked-type knocked-type-6) + (knocked-type knocked-type-5) + (knocked-type knocked-type-2) + ) + (set! v1-1 #t) + ) + (((knocked-type knocked-type-0)) + (+! (-> obj hit-by-player-count) 1) + (set! v1-1 (>= (-> obj hit-by-player-count) 2)) + ) + ) + (when v1-1 + (let* ((s5-0 (handle->process (-> obj incoming attacker-handle))) + (a2-5 (if (type? s5-0 process-focusable) + s5-0 ) - ) - (if a2-5 - (trigger-alert obj 1 (the-as target a2-5)) - ) + ) + ) + (if a2-5 + (trigger-alert obj 1 (the-as target a2-5)) ) - ) ) - (go (method-of-object obj knocked)) ) - ((= v1-0 'traffic-off) - (if (not (logtest? (-> obj flags) (citizen-flag persistent))) - (go-inactive obj) - ) - ) - ((= v1-0 'traffic-off-force) + ) + (go (method-of-object obj knocked)) + ) + (('traffic-off) + (if (not (logtest? (-> obj flags) (citizen-flag persistent))) (go-inactive obj) ) - ((= v1-0 'traffic-activate) - (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) - (let ((s5-1 (the-as object (-> arg3 param 0)))) - (set! (-> obj root trans quad) (-> (the-as traffic-object-spawn-params s5-1) position quad)) - (quaternion-copy! (-> obj root quat) (-> (the-as traffic-object-spawn-params s5-1) rotation)) - (set! (-> obj root transv quad) (-> (the-as traffic-object-spawn-params s5-1) velocity quad)) - (let ((a0-24 (-> (the-as traffic-object-spawn-params s5-1) nav-mesh))) - (when a0-24 - (change-to a0-24 obj) - (if (not (-> obj nav)) - (go-inactive obj) - ) - (let ((v1-31 (-> obj nav state))) - (set! (-> v1-31 current-poly) (the-as nav-poly #f)) - ) - 0 - (let ((a1-11 (-> (the-as traffic-object-spawn-params s5-1) nav-branch))) - (when a1-11 - (vehicle-controller-method-13 (-> obj controller) a1-11 (-> obj root trans)) - (let ((a0-28 (-> obj nav state)) - (v1-38 (-> obj controller turn-exit-point)) - ) - (logclear! (-> a0-28 flags) (nav-state-flag directional-mode)) - (logior! (-> a0-28 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-28 target-post quad) (-> v1-38 quad)) + ) + (('traffic-off-force) + (go-inactive obj) + ) + (('traffic-activate) + (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (let ((s5-1 (the-as object (-> arg3 param 0)))) + (set! (-> obj root trans quad) (-> (the-as traffic-object-spawn-params s5-1) position quad)) + (quaternion-copy! (-> obj root quat) (-> (the-as traffic-object-spawn-params s5-1) rotation)) + (set! (-> obj root transv quad) (-> (the-as traffic-object-spawn-params s5-1) velocity quad)) + (let ((a0-24 (-> (the-as traffic-object-spawn-params s5-1) nav-mesh))) + (when a0-24 + (change-to a0-24 obj) + (if (not (-> obj nav)) + (go-inactive obj) + ) + (let ((v1-31 (-> obj nav state))) + (set! (-> v1-31 current-poly) (the-as nav-poly #f)) + ) + 0 + (let ((a1-11 (-> (the-as traffic-object-spawn-params s5-1) nav-branch))) + (when a1-11 + (vehicle-controller-method-13 (-> obj controller) a1-11 (-> obj root trans)) + (let ((a0-28 (-> obj nav state)) + (v1-38 (-> obj controller turn-exit-point)) ) - 0 - ) + (logclear! (-> a0-28 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-28 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-28 target-post quad) (-> v1-38 quad)) ) - (citizen-nav-init! obj) - (citizen-init! obj) - (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) - (set! (-> obj gnd-height) (-> obj root gspot-pos y)) - (set-behavior! obj (the-as traffic-object-spawn-params s5-1)) + 0 ) ) + (citizen-nav-init! obj) + (citizen-init! obj) + (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) + (set! (-> obj gnd-height) (-> obj root gspot-pos y)) + (set-behavior! obj (the-as traffic-object-spawn-params s5-1)) ) ) - ((= v1-0 'nav-mesh-kill) - (remove-process-drawable (-> obj nav state mesh) obj) - (set! (-> obj nav) #f) - (go-inactive obj) - #t - ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) + ) + ) + (('nav-mesh-kill) + (remove-process-drawable (-> obj nav state mesh) obj) + (set! (-> obj nav) #f) + (go-inactive obj) + #t + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) ) ) @@ -1280,11 +1265,9 @@ This commonly includes things such as: (splash-spawn 0.2 a1-3 1) ) ) - (none) ) :exit (behavior () '() - (none) ) :trans (the-as (function none :behavior citizen) #f) :code (behavior () @@ -1338,11 +1321,9 @@ This commonly includes things such as: #f ) ) - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -1360,17 +1341,14 @@ This commonly includes things such as: (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (if (and (-> self wait-return-state) (>= (- (current-time) (-> self state-time)) (-> self wait-time))) (go (-> self wait-return-state)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1392,14 +1370,12 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((a1-1 (vector-! (new 'stack-no-clear 'vector) (-> self controller turn-exit-point) (-> self root trans)))) (seek-toward-heading-vec! (-> self root) a1-1 32768.0 (seconds 0.05)) ) (nav-enemy-simple-post) - (none) ) ) @@ -1440,11 +1416,9 @@ This commonly includes things such as: (format 0 "citizen has no branch in active enter state~%") (citizen-method-195 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) @@ -1483,11 +1457,9 @@ This commonly includes things such as: (citizen-method-195 self a1-3) ) ) - (none) ) :code (behavior () (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 300) - (none) ) :post (behavior () (if (and (nonzero? (-> self controller branch)) @@ -1508,16 +1480,15 @@ This commonly includes things such as: ) 0 (nav-enemy-method-176 self) - (none) ) ) (defstate inactive (citizen) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('nav-mesh-kill 'traffic-activate 'traffic-off-force 'traffic-off) - (general-event-handler self proc arg1 event-type event) + (general-event-handler self proc argc message block) ) ) ) @@ -1539,11 +1510,9 @@ This commonly includes things such as: (logior! (-> self draw status) (draw-control-status no-draw)) (logclear! (-> self root nav-flags) (nav-flags has-root-sphere has-extra-sphere)) (vehicle-controller-method-11 (-> self controller)) - (none) ) :exit (behavior () '() - (none) ) :code (the-as (function none :behavior citizen) sleep-code) ) @@ -1562,6 +1531,5 @@ This commonly includes things such as: (t9-3) ) ) - (none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/civilian.gc b/goal_src/jak2/levels/city/traffic/citizen/civilian.gc index 2e1ac39f1d2..0d550fd55dc 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/civilian.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/civilian.gc @@ -86,7 +86,7 @@ (move-to-vehicle () _type_ :state 209) (board-vehicle () _type_ :state 210) (ride () _type_ :state 211) - (exit-vehicle (object object int symbol event-message-block) _type_ :state 212) + (exit-vehicle () _type_ :state 212) (wait-at-dest () _type_ :state 213) (civilian-method-214 (_type_ nav-branch int vector float) float 214) (civilian-method-215 (_type_ vector) none 215) @@ -107,6 +107,7 @@ #f ) +;; WARN: Return type mismatch object vs none. (defmethod cleanup-for-death civilian ((obj civilian)) (cond ((zero? (-> obj hit-points)) @@ -194,15 +195,15 @@ 0 ) +;; WARN: Return type mismatch none vs object. (defmethod go-hostile civilian ((obj civilian)) (cleanup-for-death obj) - (none) ) ;; WARN: Return type mismatch none vs object. (defmethod kill-prefer-falling civilian ((obj civilian)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - (the-as object (cleanup-for-death obj)) + (cleanup-for-death obj) ) (defmethod set-behavior! civilian ((obj civilian) (arg0 traffic-object-spawn-params)) @@ -259,121 +260,115 @@ (none) ) -;; WARN: Return type mismatch none vs object. (defmethod general-event-handler civilian ((obj civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'track) - #f - ) - ((= v1-0 'combo) - #f - ) - ((= v1-0 'touched) - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + (case arg2 + (('track) + #f + ) + (('combo) + #f + ) + (('touched) + ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (('panic) + (let ((a0-6 (-> arg3 param 0))) + (set! (-> obj danger-pos quad) (-> (the-as sphere (+ a0-6 0)) quad)) + ) + (if (and (-> obj next-state) (let ((v1-6 (-> obj next-state name))) + (or (= v1-6 'active) (= v1-6 'wait) (= v1-6 'avoid-danger)) + ) + ) + (go (method-of-object obj flee)) ) - ((= v1-0 'panic) - (let ((a0-6 (-> arg3 param 0))) - (set! (-> obj danger-pos quad) (-> (the-as sphere (+ a0-6 0)) quad)) - ) - (if (and (-> obj next-state) (let ((v1-6 (-> obj next-state name))) - (or (= v1-6 'active) (= v1-6 'wait) (= v1-6 'avoid-danger)) - ) - ) - (go (method-of-object obj flee)) - ) + ) + (('event-death) + (if (zero? (-> obj hit-points)) + (do-effect (-> obj skel effect) 'death-default 0.0 -1) ) - ((= v1-0 'event-death) - (if (zero? (-> obj hit-points)) - (the-as object (do-effect (-> obj skel effect) 'death-default 0.0 -1)) - ) + ) + (('avoid) + (set! (-> obj last-danger-time) (current-time)) + (let ((a0-15 (-> arg3 param 0))) + (set! (-> obj danger-pos quad) (-> (the-as vector (+ a0-15 0)) quad)) + ) + (if (and (-> obj next-state) (let ((v1-18 (-> obj next-state name))) + (or (= v1-18 'active) (= v1-18 'wait)) + ) + ) + (go (method-of-object obj avoid-danger)) ) - ((= v1-0 'avoid) - (set! (-> obj last-danger-time) (current-time)) - (let ((a0-15 (-> arg3 param 0))) - (set! (-> obj danger-pos quad) (-> (the-as vector (+ a0-15 0)) quad)) - ) - (if (and (-> obj next-state) (let ((v1-18 (-> obj next-state name))) - (or (= v1-18 'active) (= v1-18 'wait)) - ) - ) - (go (method-of-object obj avoid-danger)) - ) + ) + (('clear-path) + (set! (-> obj last-danger-time) (current-time)) + (let ((v1-23 (the-as traffic-danger-info (-> arg3 param 0)))) + (set! (-> obj cp-valid?) #t) + (set! (-> obj cp-sphere quad) (-> v1-23 sphere quad)) + (set! (-> obj cp-vec quad) (-> v1-23 velocity quad)) + (case (-> v1-23 danger-type) + (((traffic-danger-type tdt0)) + (set! (-> obj allow-dive) #f) + (set! (-> obj cp-factor) 20.0) + ) + (((traffic-danger-type tdt1)) + (set! (-> obj allow-dive) #f) + (set! (-> obj cp-factor) 20.0) + ) + (((traffic-danger-type tdt2)) + (set! (-> obj allow-dive) #t) + (set! (-> obj cp-factor) 50.0) + ) + (((traffic-danger-type tdt3)) + (set! (-> obj allow-dive) #t) + (set! (-> obj cp-factor) 50.0) + ) + (((traffic-danger-type tdt4)) + (set! (-> obj allow-dive) #f) + (set! (-> obj cp-factor) 2.0) + ) + (((traffic-danger-type tdt5)) + (set! (-> obj allow-dive) #t) + (set! (-> obj cp-factor) 50.0) + ) + (((traffic-danger-type tdt6)) + (set! (-> obj allow-dive) #t) + (set! (-> obj cp-factor) 50.0) + ) ) - ((= v1-0 'clear-path) - (set! (-> obj last-danger-time) (current-time)) - (let ((v1-23 (the-as traffic-danger-info (-> arg3 param 0)))) - (set! (-> obj cp-valid?) #t) - (set! (-> obj cp-sphere quad) (-> v1-23 sphere quad)) - (set! (-> obj cp-vec quad) (-> v1-23 velocity quad)) - (case (-> v1-23 danger-type) - (((traffic-danger-type tdt0)) - (set! (-> obj allow-dive) #f) - (set! (-> obj cp-factor) 20.0) - ) - (((traffic-danger-type tdt1)) - (set! (-> obj allow-dive) #f) - (set! (-> obj cp-factor) 20.0) - ) - (((traffic-danger-type tdt2)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) - ) - (((traffic-danger-type tdt3)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) - ) - (((traffic-danger-type tdt4)) - (set! (-> obj allow-dive) #f) - (set! (-> obj cp-factor) 2.0) - ) - (((traffic-danger-type tdt5)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) - ) - (((traffic-danger-type tdt6)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) + ) + (let ((s5-1 (-> obj cp-plane))) + (set! (-> s5-1 quad) (-> obj cp-vec quad)) + (set! (-> s5-1 y) 0.0) + (vector-rotate90-around-y! s5-1 s5-1) + (vector-normalize! s5-1 1.0) + (set! (-> s5-1 w) (- (vector-dot (the-as vector s5-1) (the-as vector (-> obj cp-sphere))))) + ) + (set! (-> obj cp-exit-time) (+ (current-time) (seconds 4))) + (if (and (-> obj next-state) (let ((v1-54 (-> obj next-state name))) + (or (= v1-54 'active) (= v1-54 'wait) (= v1-54 'avoid-danger)) + ) ) - ) - ) - (let ((s5-1 (-> obj cp-plane))) - (set! (-> s5-1 quad) (-> obj cp-vec quad)) - (set! (-> s5-1 y) 0.0) - (vector-rotate90-around-y! s5-1 s5-1) - (vector-normalize! s5-1 1.0) - (set! (-> s5-1 w) (- (vector-dot (the-as vector s5-1) (the-as vector (-> obj cp-sphere))))) - ) - (set! (-> obj cp-exit-time) (+ (current-time) (seconds 4))) - (if (and (-> obj next-state) (let ((v1-54 (-> obj next-state name))) - (or (= v1-54 'active) (= v1-54 'wait) (= v1-54 'avoid-danger)) - ) - ) - (go (method-of-object obj clear-path)) - ) + (go (method-of-object obj clear-path)) ) - ((or (= v1-0 'hit) (= v1-0 'hit-flinch) (= v1-0 'hit-knocked)) - (speech-control-method-13 *speech-control* (the-as handle obj)) - (if (logtest? (-> obj flags) (citizen-flag female)) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-27)) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-19)) - ) - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ((= v1-0 'end-task) - (let ((v0-0 (the-as object (logclear (-> obj flags) (citizen-flag persistent))))) - (set! (-> obj flags) (the-as citizen-flag v0-0)) - v0-0 - ) + ) + (('hit 'hit-flinch 'hit-knocked) + (speech-control-method-13 *speech-control* (the-as handle obj)) + (if (logtest? (-> obj flags) (citizen-flag female)) + (speech-control-method-12 *speech-control* obj (speech-type speech-type-27)) + (speech-control-method-12 *speech-control* obj (speech-type speech-type-19)) ) - (else - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) + ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (('end-task) + (let ((v0-0 (the-as object (logclear (-> obj flags) (citizen-flag persistent))))) + (set! (-> obj flags) (the-as citizen-flag v0-0)) + v0-0 + ) + ) + (else + ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) ) ) ) @@ -412,7 +407,6 @@ (t9-0) ) ) - (none) ) ) @@ -536,13 +530,11 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 0.0 0.0 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) ) - (none) ) :trans (behavior () (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) @@ -560,15 +552,12 @@ (go-virtual in-ditch) ) (citizen-method-192 self) - (none) ) :code (behavior () (citizen-travel-anim (the-as int (-> self draw art-group data (-> self anim-panic-run))) 30) - (none) ) :post (behavior () (civilian-flee-post) - (none) ) ) @@ -749,13 +738,11 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 0.0 0.0 1.0 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) ) - (none) ) :trans (behavior () (if (< (+ (-> self last-danger-time) (seconds 1)) (current-time)) @@ -776,15 +763,12 @@ ) ) ) - (none) ) :code (behavior () (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) - (none) ) :post (behavior () (civilian-avoid-danger-post2) - (none) ) ) @@ -928,13 +912,11 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 0.0 1.0 0.0 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) ) - (none) ) :trans (behavior () (when (citizen-method-187 self) @@ -984,15 +966,12 @@ (if (< (-> self cp-exit-time) (current-time)) (go-virtual active) ) - (none) ) :code (behavior () (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 30) - (none) ) :post (behavior () (civilian-clear-path-post2) - (none) ) ) @@ -1028,7 +1007,6 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 0.5 0.5 1.0 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* @@ -1039,13 +1017,11 @@ (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) ) (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :trans (behavior () (if (< (+ (-> self last-danger-time) (seconds 1)) (current-time)) (go-virtual get-up-front) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1066,11 +1042,9 @@ (suspend) ) #f - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -1121,7 +1095,6 @@ (set-vector! (-> self draw color-mult) 0.5 0.5 1.0 1.0) ) (set! (-> self dive-finished?) #f) - (none) ) :exit (behavior () (if *citizen-debug* @@ -1136,11 +1109,9 @@ (set! (-> v1-9 sphere-mask) (the-as uint #x800fe)) ) 0 - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1164,7 +1135,6 @@ (set! (-> self dive-finished?) #t) (set! (-> self root transv quad) (the-as uint128 0)) (go-virtual cower-ground) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1178,7 +1148,6 @@ (track-target! self) (nav-enemy-method-176 self) ) - (none) ) ) @@ -1209,7 +1178,6 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 0.2 0.2 0.2 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* @@ -1224,11 +1192,9 @@ (set! (-> v1-9 sphere-mask) (the-as uint #x800fe)) ) 0 - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1291,7 +1257,6 @@ (ja :num! (seek! max (-> self speed-scale))) ) (go-virtual get-up-front) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1302,7 +1267,6 @@ ) 0 (track-target! self) - (none) ) ) @@ -1323,17 +1287,14 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1353,7 +1314,6 @@ (ja :num! (seek! max (-> self speed-scale))) ) (go-virtual flee) - (none) ) :post (behavior () (enemy-method-49 self) @@ -1365,7 +1325,6 @@ ) 0 (track-target! self) - (none) ) ) @@ -1386,17 +1345,14 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1414,7 +1370,6 @@ (ja :num! (seek! max (-> self speed-scale))) ) (go-virtual flee) - (none) ) :post (behavior () (enemy-method-49 self) @@ -1426,7 +1381,6 @@ ) 0 (track-target! self) - (none) ) ) @@ -1477,7 +1431,6 @@ ) ) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) @@ -1489,7 +1442,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type citizen knocked) trans))) @@ -1498,16 +1450,15 @@ ) ) (enemy-method-49 self) - (none) ) ) (defstate wait-for-ride (civilian) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('board-vehicle) - (let ((a0-1 (the-as vehicle (-> event param 0)))) + (let ((a0-1 (the-as vehicle (-> block param 0)))) (when a0-1 (let ((v0-0 (the-as object (process->handle a0-1)))) (set! (-> self vehicle) (the-as handle v0-0)) @@ -1517,7 +1468,7 @@ ) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) @@ -1541,11 +1492,9 @@ ) 0 (set! (-> self vehicle) (the-as handle #f)) - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) - (none) ) :trans (behavior () (if (and (not (logtest? (-> self nav state flags) (nav-state-flag in-mesh))) (< (-> self root trans y) 4096.0)) @@ -1558,7 +1507,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1580,11 +1528,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -1683,8 +1629,8 @@ (defstate move-to-vehicle (civilian) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (enemy-event-handler proc arg1 event-type event) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (enemy-event-handler proc argc message block) ) :enter (behavior () (logior! (-> self flags) (citizen-flag persistent)) @@ -1710,7 +1656,6 @@ (set! (-> v1-14 sphere-mask) (the-as uint #x800f8)) ) 0 - (none) ) :exit (behavior () (let ((v1-0 (-> self nav))) @@ -1718,7 +1663,6 @@ ) 0 (logclear! (-> self flags) (citizen-flag persistent)) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -1777,22 +1721,19 @@ (go-virtual wait-for-ride) ) ) - (none) ) :code (behavior () (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) (defstate board-vehicle (civilian) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('vehicle-crash) #f ) @@ -1800,7 +1741,7 @@ (kill-prefer-falling self) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) @@ -1821,12 +1762,10 @@ (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logclear (-> v1-10 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) (logclear! (-> self focus-status) (focus-status pilot)) - (none) ) :trans (behavior () (let ((v1-1 (handle->process (-> self vehicle)))) @@ -1834,7 +1773,6 @@ (throw-off-vehicle self) ) ) - (none) ) :code (behavior () (local-vars (sv-128 float) (sv-144 float)) @@ -1921,46 +1859,29 @@ ) (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) (go-virtual ride) - (none) ) :post (behavior () (track-target! self) - (none) ) ) (defstate ride (civilian) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type) - (t0-0 'exit-vehicle) - ) - (cond - ((= v1-0 t0-0) - (let ((a0-1 (the-as object (-> event param 0)))) - (set! (-> self event-param-point quad) (-> (the-as vector a0-1) quad)) - ) - (let ((v1-3 (current-time)) - (a0-3 (-> self state-time)) - ) - (if (>= (- v1-3 a0-3) (seconds 1)) - (go-virtual - exit-vehicle - a0-3 - arg1 - (the-as int event-type) - (the-as symbol event) - (the-as event-message-block t0-0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('exit-vehicle) + (let ((a0-1 (the-as object (-> block param 0)))) + (set! (-> self event-param-point quad) (-> (the-as vector a0-1) quad)) ) - ((= v1-0 'end-task) - (kill-prefer-falling self) - ) - (else - (enemy-event-handler proc arg1 event-type event) - ) + (if (>= (- (current-time) (-> self state-time)) (seconds 1)) + (go-virtual exit-vehicle) + ) + ) + (('end-task) + (kill-prefer-falling self) + ) + (else + (enemy-event-handler proc argc message block) ) ) ) @@ -1982,7 +1903,6 @@ ) 0 (logior! (-> self focus-status) (focus-status pilot-riding pilot)) - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) @@ -1996,7 +1916,6 @@ (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :trans (behavior () (let ((v1-1 (handle->process (-> self vehicle)))) @@ -2004,25 +1923,22 @@ (throw-off-vehicle self) ) ) - (none) ) :code (behavior () (until #f (suspend) ) #f - (none) ) :post (behavior () (track-target! self) - (none) ) ) (defstate exit-vehicle (civilian) :virtual #t :event (the-as (function process int symbol event-message-block object :behavior civilian) enemy-event-handler) - :enter (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) + :enter (behavior () (change-to (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)) self) (if (not (-> self nav)) (go-inactive self) @@ -2035,12 +1951,12 @@ self (vector-negate-in-place! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (let ((a0-8 (-> self nav state)) + (let ((a0-7 (-> self nav state)) (v1-14 (-> self controller turn-exit-point)) ) - (logclear! (-> a0-8 flags) (nav-state-flag directional-mode)) - (logior! (-> a0-8 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-8 target-post quad) (-> v1-14 quad)) + (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-7 target-post quad) (-> v1-14 quad)) ) 0 (citizen-nav-init! self) @@ -2062,12 +1978,10 @@ (set! (-> v1-33 enemy-flags) (the-as enemy-flag (logclear (-> v1-33 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) - (none) ) :trans (behavior () (let ((v1-1 (handle->process (-> self vehicle)))) @@ -2075,9 +1989,8 @@ (throw-off-vehicle self) ) ) - (none) ) - :code (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) + :code (behavior () (local-vars (sv-128 float) (sv-144 float)) (ja-channel-push! 1 (seconds 0.1)) (remove-rider (the-as vehicle (handle->process (-> self vehicle))) self) @@ -2129,12 +2042,12 @@ :frame-num (ja-aframe 5.0 0) ) (until (ja-done? 0) - (let ((a0-47 (handle->process (-> self vehicle))) + (let ((a0-46 (handle->process (-> self vehicle))) (s2-1 (new 'stack-no-clear 'vector)) (s4-3 (new 'stack-no-clear 'vector)) (s3-2 (new 'stack-no-clear 'quaternion)) ) - (compute-seat-position (the-as vehicle a0-47) s2-1 (-> self seat)) + (compute-seat-position (the-as vehicle a0-46) s2-1 (-> self seat)) (vector-! s4-3 s2-1 gp-3) (let ((s2-2 lerp-scale) (s1-1 0.0) @@ -2142,8 +2055,8 @@ ) (set! sv-128 (ja-aframe-num 0)) (set! sv-144 (ja-aframe 5.0 0)) - (let* ((t0-2 (ja-aframe 1.0 0)) - (f0-12 (s2-2 s1-1 s0-0 sv-128 sv-144 t0-2)) + (let* ((t0-1 (ja-aframe 1.0 0)) + (f0-12 (s2-2 s1-1 s0-0 sv-128 sv-144 t0-1)) (f30-0 (- 1.0 f0-12)) ) (quaternion-rotate-local-y! s3-2 s5-2 (if (zero? (-> self seat)) @@ -2165,11 +2078,9 @@ (set! (-> v1-74 prim-core collide-with) (-> self root backup-collide-with)) ) (go-virtual active) - (none) ) :post (behavior () (track-target! self) - (none) ) ) @@ -2188,11 +2099,9 @@ (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2214,10 +2123,8 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/guard.gc b/goal_src/jak2/levels/city/traffic/citizen/guard.gc index 500fd3acde9..ea3cfefdf23 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/guard.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/guard.gc @@ -492,7 +492,6 @@ (go (method-of-object obj active)) (go-hostile obj) ) - (none) ) (defmethod damage-amount-from-attack crimson-guard ((obj crimson-guard) (arg0 process) (arg1 event-message-block)) @@ -503,198 +502,191 @@ ) ) -;; WARN: Return type mismatch none vs object. ;; WARN: disable def twice: 122. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod general-event-handler crimson-guard ((obj crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (let ((v1-0 arg2)) - (the-as - object - (cond - ((or (= v1-0 'hit) (= v1-0 'hit-flinch) (= v1-0 'hit-knocked)) - (speech-control-method-13 *speech-control* (the-as handle obj)) - (logior! (-> obj flags) (citizen-flag hostile)) - (let* ((s0-0 (handle->process (-> obj incoming attacker-handle))) - (s1-0 (if (type? s0-0 process-focusable) - s0-0 - ) + (case arg2 + (('hit 'hit-flinch 'hit-knocked) + (speech-control-method-13 *speech-control* (the-as handle obj)) + (logior! (-> obj flags) (citizen-flag hostile)) + (let* ((s0-0 (handle->process (-> obj incoming attacker-handle))) + (s1-0 (if (type? s0-0 process-focusable) + s0-0 ) - ) - (when s1-0 - (speech-control-method-12 *speech-control* obj (speech-type speech-type-11)) - (trigger-alert obj 1 (the-as target s1-0)) - ) - ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ((= v1-0 'event-death) - (if (zero? (-> obj hit-points)) - (the-as object (do-effect (-> obj skel effect) 'death-default 0.0 -1)) - ) + ) + ) + (when s1-0 + (speech-control-method-12 *speech-control* obj (speech-type speech-type-11)) + (trigger-alert obj 1 (the-as target s1-0)) ) - ((= v1-0 'bouncing-off) - (when (or (and (-> obj next-state) (= (-> obj next-state name) 'active)) - (and (-> obj next-state) (= (-> obj next-state name) 'wait)) - ) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-14)) - (go (method-of-object obj close-attack-active)) - ) + ) + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (('event-death) + (if (zero? (-> obj hit-points)) + (do-effect (-> obj skel effect) 'death-default 0.0 -1) ) - ((= v1-0 'combo) - (and (not (and (-> obj next-state) (= (-> obj next-state name) 'inactive))) - (and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points))) - ) + ) + (('bouncing-off) + (when (or (and (-> obj next-state) (= (-> obj next-state name) 'active)) + (and (-> obj next-state) (= (-> obj next-state name) 'wait)) + ) + (speech-control-method-12 *speech-control* obj (speech-type speech-type-14)) + (go (method-of-object obj close-attack-active)) + ) + ) + (('combo) + (and (not (and (-> obj next-state) (= (-> obj next-state name) 'inactive))) + (and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points))) + ) + ) + (('avoid) + #f + ) + (('panic) + (set! (-> obj last-danger-time) (current-time)) + (let ((v1-38 (the-as traffic-danger-info (-> arg3 param 0)))) + (case (-> v1-38 danger-type) + (((traffic-danger-type tdt7)) + (set! (-> obj cp-factor) 20.0) + (let ((s5-1 (method-of-object obj trigger-alert)) + (s4-1 1) + (s3-1 (handle->process (-> v1-38 handle))) + ) + (s5-1 obj s4-1 (the-as target (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + ) + ) ) - ((= v1-0 'avoid) - #f + ) + ) + (('clear-path) + (set! (-> obj last-danger-time) (current-time)) + (let ((v1-44 (the-as traffic-danger-info (-> arg3 param 0)))) + (set! (-> obj cp-valid?) #t) + (set! (-> obj cp-sphere quad) (-> v1-44 sphere quad)) + (set! (-> obj cp-vec quad) (-> v1-44 velocity quad)) + (case (-> v1-44 danger-type) + (((traffic-danger-type tdt0)) + (trigger-alert obj 1 *target*) + ) + (((traffic-danger-type tdt1)) + ) + (((traffic-danger-type tdt2)) + ) + (((traffic-danger-type tdt3)) + ) + (((traffic-danger-type tdt4)) + ) + (((traffic-danger-type tdt5)) + ) + (((traffic-danger-type tdt6)) + ) + (((traffic-danger-type tdt7)) + (trigger-alert obj 1 *target*) + ) ) - ((= v1-0 'panic) - (set! (-> obj last-danger-time) (current-time)) - (let ((v1-38 (the-as traffic-danger-info (-> arg3 param 0)))) - (case (-> v1-38 danger-type) - (((traffic-danger-type tdt7)) - (set! (-> obj cp-factor) 20.0) - (let ((s5-1 (method-of-object obj trigger-alert)) - (s4-1 1) - (s3-1 (handle->process (-> v1-38 handle))) - ) - (the-as object (s5-1 obj s4-1 (the-as target (if (type? s3-1 process-focusable) - s3-1 - ) - ) - ) - ) - ) - ) - ) - ) + ) + (let ((s5-2 (-> obj cp-plane))) + (set! (-> s5-2 quad) (-> obj cp-vec quad)) + (set! (-> s5-2 y) 0.0) + (vector-rotate90-around-y! s5-2 s5-2) + (vector-normalize! s5-2 1.0) + (set! (-> s5-2 w) (- (vector-dot (the-as vector s5-2) (the-as vector (-> obj cp-sphere))))) + ) + (let ((v0-4 (the-as object (+ (current-time) (seconds 1))))) + (set! (-> obj cp-exit-time) (the-as time-frame v0-4)) + v0-4 + ) + ) + (('end-pursuit) + (when *debug-segment* + (when (focus-test? obj inactive) + (format 0 "guard::event end-pursuit recieved by inactive process ~d~%" (-> obj pid)) + (break!) + 0 ) - ((= v1-0 'clear-path) - (set! (-> obj last-danger-time) (current-time)) - (let ((v1-44 (the-as traffic-danger-info (-> arg3 param 0)))) - (set! (-> obj cp-valid?) #t) - (set! (-> obj cp-sphere quad) (-> v1-44 sphere quad)) - (set! (-> obj cp-vec quad) (-> v1-44 velocity quad)) - (case (-> v1-44 danger-type) - (((traffic-danger-type tdt0)) - (trigger-alert obj 1 *target*) - ) - (((traffic-danger-type tdt1)) - ) - (((traffic-danger-type tdt2)) - ) - (((traffic-danger-type tdt3)) - ) - (((traffic-danger-type tdt4)) - ) - (((traffic-danger-type tdt5)) - ) - (((traffic-danger-type tdt6)) - ) - (((traffic-danger-type tdt7)) - (trigger-alert obj 1 *target*) - ) - ) - ) - (let ((s5-2 (-> obj cp-plane))) - (set! (-> s5-2 quad) (-> obj cp-vec quad)) - (set! (-> s5-2 y) 0.0) - (vector-rotate90-around-y! s5-2 s5-2) - (vector-normalize! s5-2 1.0) - (set! (-> s5-2 w) (- (vector-dot (the-as vector s5-2) (the-as vector (-> obj cp-sphere))))) - ) - (let ((v0-4 (the-as object (+ (current-time) (seconds 1))))) - (set! (-> obj cp-exit-time) (the-as time-frame v0-4)) - v0-4 - ) + ) + (when (not (focus-test? obj dead)) + (when (logtest? (-> obj flags) (citizen-flag hostile)) + (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) + (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (go (method-of-object obj active)) ) - ((= v1-0 'end-pursuit) - (when *debug-segment* - (when (focus-test? obj inactive) - (format 0 "guard::event end-pursuit recieved by inactive process ~d~%" (-> obj pid)) - (break!) - 0 - ) - ) - (when (not (focus-test? obj dead)) - (when (logtest? (-> obj flags) (citizen-flag hostile)) - (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) - (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (go (method-of-object obj active)) - ) - ) + ) + ) + (('alert-begin) + (when *debug-segment* + (when (focus-test? obj inactive) + (format 0 "guard::event alert-begin recieved by inactive process ~d~%" (-> obj pid)) + (break!) + 0 ) - ((= v1-0 'alert-begin) - (when *debug-segment* - (when (focus-test? obj inactive) - (format 0 "guard::event alert-begin recieved by inactive process ~d~%" (-> obj pid)) - (break!) - 0 - ) - ) - (when (not (focus-test? obj dead)) - (when (not (logtest? (-> obj flags) (citizen-flag hostile))) - (let ((a1-27 (the-as object (-> arg3 param 0)))) - (when (and (the-as uint a1-27) - (not (logtest? (-> (the-as process-focusable a1-27) focus-status) (focus-status disable dead inactive))) - ) - (set! (-> obj traffic-target-status handle) (process->handle (the-as process-focusable a1-27))) - (try-update-focus (-> obj focus) (the-as process-focusable a1-27) obj) - (if (and (not (and (-> obj next-state) (= (-> obj next-state name) 'jump))) - (not (and (-> obj next-state) (= (-> obj next-state name) 'exit-transport))) - ) - (the-as object (go-hostile obj)) - ) + ) + (when (not (focus-test? obj dead)) + (when (not (logtest? (-> obj flags) (citizen-flag hostile))) + (let ((a1-27 (the-as object (-> arg3 param 0)))) + (when (and (the-as uint a1-27) + (not (logtest? (-> (the-as process-focusable a1-27) focus-status) (focus-status disable dead inactive))) + ) + (set! (-> obj traffic-target-status handle) (process->handle (the-as process-focusable a1-27))) + (try-update-focus (-> obj focus) (the-as process-focusable a1-27) obj) + (if (and (not (and (-> obj next-state) (= (-> obj next-state name) 'jump))) + (not (and (-> obj next-state) (= (-> obj next-state name) 'exit-transport))) + ) + (go-hostile obj) ) - ) ) ) ) - ((= v1-0 'alert-end) - (when *debug-segment* - (when (focus-test? obj inactive) - (format 0 "guard::event alert-end recieved by inactive process ~d~%" (-> obj pid)) - (break!) - 0 - ) - ) - (when (not (focus-test? obj dead)) - (when (logtest? (-> obj flags) (citizen-flag hostile)) - (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-5)) - (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (go (method-of-object obj active)) - ) - ) + ) + ) + (('alert-end) + (when *debug-segment* + (when (focus-test? obj inactive) + (format 0 "guard::event alert-end recieved by inactive process ~d~%" (-> obj pid)) + (break!) + 0 ) - ((= v1-0 'track) - (if (and (-> obj next-state) (let ((v1-129 (-> obj next-state name))) - (or (= v1-129 'exit-transport) (= v1-129 'jump)) - ) - ) - #f - #t - ) + ) + (when (not (focus-test? obj dead)) + (when (logtest? (-> obj flags) (citizen-flag hostile)) + (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) + (speech-control-method-12 *speech-control* obj (speech-type speech-type-5)) + (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (go (method-of-object obj active)) ) - ((= v1-0 'notify) - (let ((a0-84 (-> arg3 param 0)) - (v1-130 (the-as object (-> arg3 param 1))) - ) - (when (= a0-84 'attack) - (when (logtest? (-> (the-as process-focusable v1-130) mask) (process-mask target)) - (when (focus-test? (the-as process-focusable v1-130) dead) - (format #t "guard killed player~%") - (the-as object (speech-control-method-12 *speech-control* obj (speech-type speech-type-10))) - ) - ) + ) + ) + (('track) + (if (and (-> obj next-state) (let ((v1-129 (-> obj next-state name))) + (or (= v1-129 'exit-transport) (= v1-129 'jump)) + ) + ) + #f + #t + ) + ) + (('notify) + (let ((a0-84 (-> arg3 param 0)) + (v1-130 (the-as object (-> arg3 param 1))) + ) + (when (= a0-84 'attack) + (when (logtest? (-> (the-as process-focusable v1-130) mask) (process-mask target)) + (when (focus-test? (the-as process-focusable v1-130) dead) + (format #t "guard killed player~%") + (speech-control-method-12 *speech-control* obj (speech-type speech-type-10)) ) ) ) - (else - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) + ) + ) + (else + ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) ) ) ) @@ -720,7 +712,6 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* @@ -735,11 +726,9 @@ (collide-spec backgnd jak civilian hit-by-others-list player-list) ) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -760,7 +749,6 @@ ) (set! (-> self hit-face) (the-as uint -1)) (react-to-focus self) - (none) ) :post (behavior () (enemy-method-49 self) @@ -772,7 +760,6 @@ ) 0 (track-target! self) - (none) ) ) @@ -793,7 +780,6 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* @@ -808,11 +794,9 @@ (collide-spec backgnd jak civilian hit-by-others-list player-list) ) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -831,7 +815,6 @@ ) (set! (-> self hit-face) (the-as uint -1)) (react-to-focus self) - (none) ) :post (behavior () (enemy-method-49 self) @@ -843,7 +826,6 @@ ) 0 (track-target! self) - (none) ) ) @@ -876,7 +858,6 @@ ) ) ) - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) @@ -888,7 +869,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy knocked) trans))) @@ -897,7 +877,6 @@ ) ) (enemy-method-49 self) - (none) ) ) @@ -1219,15 +1198,14 @@ :event (the-as (function process int symbol event-message-block object :behavior crimson-guard) enemy-event-handler) :enter (behavior () '() - (none) ) :code (behavior () (suspend) (throw-off-vehicle self) - (none) ) ) +;; WARN: Return type mismatch int vs object. (defmethod go-hostile crimson-guard ((obj crimson-guard)) (cond ((handle->process (-> obj focus handle)) @@ -1251,7 +1229,6 @@ ) ) 0 - (none) ) (defmethod crimson-guard-method-214 crimson-guard ((obj crimson-guard)) @@ -1297,7 +1274,6 @@ ) (logclear! (-> self flags) (citizen-flag in-pursuit hostile)) (set! (-> self already-shot) #f) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type citizen active) trans))) @@ -1317,7 +1293,6 @@ ) ) ) - (none) ) ) @@ -1345,7 +1320,6 @@ ) 0 (logior! (-> self focus-status) (focus-status dangerous)) - (none) ) :exit (behavior () (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) @@ -1355,11 +1329,9 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1380,11 +1352,9 @@ ) ) (go-virtual active) - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -1402,7 +1372,6 @@ ) (logclear! (-> self flags) (citizen-flag in-pursuit hostile)) (set! (-> self already-shot) #f) - (none) ) ) @@ -1705,11 +1674,9 @@ (if (zero? (-> self controller branch)) (citizen-method-195 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (-> self target-flags) @@ -1723,11 +1690,9 @@ (speech-control-method-12 *speech-control* self (speech-type speech-type-4)) ) ) - (none) ) :code (behavior () (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) - (none) ) :post (behavior () (if (and (nonzero? (-> self controller branch)) @@ -1748,7 +1713,6 @@ ) 0 (nav-enemy-method-176 self) - (none) ) ) @@ -1858,12 +1822,10 @@ ) (logior! (-> self flags) (citizen-flag persistent in-pursuit)) (set! (-> self root nav-radius) 6144.0) - (none) ) :exit (behavior () (when (-> self nav) ) - (none) ) :trans (behavior () (crimson-guard-method-220 self) @@ -1952,11 +1914,9 @@ ) ) ) - (none) ) :code (behavior () (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) - (none) ) :post (behavior () (rlet ((acc :class vf) @@ -2026,7 +1986,6 @@ ) ) (nav-enemy-method-176 self) - (none) ) ) ) @@ -2059,7 +2018,6 @@ (set! (-> v1-10 target-speed) 0.0) ) 0 - (none) ) :exit (behavior () (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) @@ -2070,11 +2028,9 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (crimson-guard-method-220 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2095,11 +2051,9 @@ ) ) (go-virtual hostile) - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -2145,12 +2099,10 @@ ) (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self joint-enable) #t) - (none) ) :exit (behavior () (set! (-> self joint-enable) #f) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (crimson-guard-method-220 self) @@ -2181,7 +2133,6 @@ ) ) ) - (none) ) :code (behavior () (local-vars (v1-35 object)) @@ -2281,15 +2232,14 @@ ) ) (crimson-guard-method-226 self) - (none) ) :post (behavior () (citizen-method-200 self) (nav-enemy-method-176 self) - (none) ) ) +;; WARN: Return type mismatch object vs none. (defmethod crimson-guard-method-226 crimson-guard ((obj crimson-guard)) (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) (s5-0 (-> obj root)) @@ -2435,7 +2385,6 @@ ) ) (go-virtual gun-shoot) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -2457,7 +2406,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -2548,7 +2496,6 @@ ) ) (go-virtual gun-shoot) - (none) ) :post (-> (method-of-type crimson-guard roll-right) post) ) @@ -2581,17 +2528,14 @@ (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self joint-enable) #t) (crimson-guard-method-221 self) - (none) ) :exit (behavior () (set! (-> self joint-enable) #f) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (crimson-guard-method-220 self) (send-event (handle->process (-> self focus handle)) 'arrest) - (none) ) :code (behavior () (speech-control-method-12 *speech-control* self (speech-type speech-type-13)) @@ -2644,12 +2588,10 @@ ) ) (go-hostile self) - (none) ) :post (behavior () (citizen-method-200 self) (nav-enemy-simple-post) - (none) ) ) @@ -2680,19 +2622,16 @@ (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self joint-enable) #t) (crimson-guard-method-221 self) - (none) ) :exit (behavior () (set! (-> self joint-enable) #f) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (crimson-guard-method-220 self) (if (logtest? (-> self flags) (citizen-flag target-in-sight)) (speech-control-method-12 *speech-control* self (speech-type speech-type-3)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2734,12 +2673,10 @@ ) ) (go-hostile self) - (none) ) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) (nav-enemy-simple-post) - (none) ) ) @@ -2889,6 +2826,7 @@ ) ) +;; WARN: Return type mismatch object vs none. (defmethod crimson-guard-method-222 crimson-guard ((obj crimson-guard)) (local-vars (sv-800 vector)) (rlet ((acc :class vf) @@ -3151,7 +3089,6 @@ (set! (-> self state-time) (current-time)) (set! (-> self lazer-sound) (new 'static 'sound-id)) 0 - (none) ) :exit (behavior () (if (nonzero? (-> self lazer-sound)) @@ -3185,7 +3122,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (crimson-guard-method-220 self) @@ -3204,7 +3140,6 @@ (go-virtual active) ) ) - (none) ) :code (behavior () (local-vars (v1-94 symbol)) @@ -3390,12 +3325,10 @@ ) ) #f - (none) ) :post (behavior () (citizen-method-200 self) (nav-enemy-method-176 self) - (none) ) ) @@ -3679,12 +3612,10 @@ ) 0 (set! (-> self already-shot) #f) - (none) ) :exit (behavior () (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) (logclear! (-> self nav flags) (nav-control-flag output-sphere-hash)) - (none) ) :trans (behavior () (rlet ((acc :class vf) @@ -3741,7 +3672,6 @@ ) (crimson-guard-method-223 self 0.0) ) - (none) ) ) :code (behavior () @@ -3767,11 +3697,9 @@ (suspend) ) #f - (none) ) :post (behavior () (ja-post) - (none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc b/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc index 96309efd779..c13d4dc4b45 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc @@ -267,13 +267,11 @@ ) ) -;; WARN: Return type mismatch object vs none. (defmethod go-stare2 metalhead-flitter ((obj metalhead-flitter)) (if (and (= (-> obj focus aware) (enemy-aware enemy-aware-2)) (not (nav-enemy-method-163 obj))) (go (method-of-object obj pacing)) (go (method-of-object obj stare)) ) - (none) ) (defstate ambush (metalhead-flitter) @@ -308,7 +306,6 @@ ) ) ) - (none) ) :code (behavior () (case (-> self level name) @@ -401,7 +398,6 @@ ) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) - (none) ) ) @@ -430,7 +426,6 @@ (vector-reset! (-> gp-0 transv)) (set! (-> gp-0 transv y) (* 4096.0 (get-rand-float-range self 34.0 38.0))) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -524,7 +519,6 @@ #f (label cfg-33) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior metalhead-flitter) nav-enemy-falling-post) ) @@ -653,7 +647,6 @@ ) ) ) - (none) ) ) @@ -705,7 +698,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a0-0 self)) @@ -716,7 +708,6 @@ ) ) ) - (none) ) ) @@ -731,7 +722,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type citizen-enemy hostile) trans))) @@ -740,7 +730,6 @@ ) ) (metalhead-flitter-method-205 self) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -752,7 +741,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -765,7 +753,6 @@ (t9-2) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -776,7 +763,6 @@ ) (send-event self 'death-end) (cleanup-for-death self) - (none) ) ) @@ -809,7 +795,6 @@ (set! (-> v1-8 attack-id) v0-2) (set! (-> self attack-id) v0-2) ) - (none) ) :exit (behavior () (metalhead-flitter-method-208 self #f) @@ -817,7 +802,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (local-vars (s5-2 vector)) @@ -852,7 +836,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 2 (seconds 0.1)) @@ -903,7 +886,6 @@ ) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior metalhead-flitter) nav-enemy-travel-post) ) @@ -913,7 +895,6 @@ :post (behavior () (metalhead-flitter-method-206 self) (nav-enemy-simple-post) - (none) ) ) @@ -965,7 +946,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a0-0 self)) @@ -976,7 +956,6 @@ ) ) ) - (none) ) ) @@ -989,7 +968,6 @@ ) ) (set! (-> self off-screen-timer) (the-as uint (current-time))) - (none) ) :trans (behavior () (let ((gp-0 (handle->process (-> self focus handle)))) @@ -1035,7 +1013,6 @@ ) ) ) - (none) ) :code (behavior () (nav-enemy-method-166 self) @@ -1058,7 +1035,6 @@ ) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/metalhead-grunt.gc b/goal_src/jak2/levels/city/traffic/citizen/metalhead-grunt.gc index f970aca8d79..c59a6d0336f 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-grunt.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-grunt.gc @@ -326,7 +326,6 @@ (go-hostile obj) ) ) - (none) ) (defstate falling-ambush (metalhead-grunt) @@ -366,7 +365,6 @@ (set! (-> v1-17 attack-id) v0-9) (set! (-> self attack-id) v0-9) ) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim)) @@ -385,11 +383,11 @@ ) (sound-play "grunt-notice") (go-virtual hostile) - (none) ) :post (the-as (function none :behavior metalhead-grunt) nav-enemy-falling-post) ) +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-93 metalhead-grunt ((obj metalhead-grunt)) (case (-> obj jump-why) ((2) @@ -415,7 +413,6 @@ (go-virtual notice) ) (get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp) - (none) ) :code (behavior () (set! (-> self jumping-ambush-path-pt) 1) @@ -437,7 +434,6 @@ (suspend) ) #f - (none) ) ) @@ -474,7 +470,6 @@ (suspend) ) #f - (none) ) ) @@ -615,7 +610,6 @@ ) ) #f - (none) ) ) @@ -693,7 +687,6 @@ ) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -749,7 +742,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior metalhead-grunt) nav-enemy-chase-post) ) @@ -781,7 +773,6 @@ #t (t9-1 a0-6) ) - (none) ) :exit (behavior () (let* ((a0-0 self) @@ -794,7 +785,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (enemy-method-49 self) @@ -802,7 +792,6 @@ (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "grunt-hit") ) - (none) ) :code (behavior () (set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (get-rand-int self 2))) @@ -865,7 +854,6 @@ (set! (-> self use-charge-anim-index) v1-57) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior metalhead-grunt) nav-enemy-chase-post) ) @@ -907,7 +895,6 @@ #t (t9-3 a0-14) ) - (none) ) :exit (behavior () (let* ((a0-0 self) @@ -920,14 +907,12 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "grunt-hit") ) - (none) ) :code (behavior () (set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (get-rand-int self 2))) @@ -960,7 +945,6 @@ ) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior metalhead-grunt) nav-enemy-simple-post) ) @@ -998,7 +982,6 @@ ) ) #f - (none) ) ) @@ -1239,7 +1222,6 @@ ) ) ) - (none) ) :code (-> (method-of-type nav-enemy idle) code) :post (-> (method-of-type nav-enemy idle) post) diff --git a/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc b/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc index f52c9e5f2b6..0d5b85a88ea 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc @@ -793,7 +793,6 @@ ) ) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type citizen-enemy active) trans))) @@ -801,7 +800,6 @@ (t9-0) ) ) - (none) ) ) @@ -819,7 +817,6 @@ (if (zero? (get-rand-int self 3)) (sound-play "pred-talk") ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type citizen-enemy hostile) trans))) @@ -850,7 +847,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -873,7 +869,6 @@ ) ) #f - (none) ) ) @@ -893,14 +888,12 @@ ) (traffic-danger-init! self) (logior! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (let ((v1-2 (handle->process (-> self focus handle)))) @@ -914,7 +907,6 @@ (go-virtual active) ) ) - (none) ) :code (behavior () (label cfg-0) @@ -956,7 +948,6 @@ (b! (not #f) cfg-0 :delay (empty-form)) (label cfg-26) (go-hostile self) - (none) ) :post (the-as (function none :behavior metalhead-predator) enemy-simple-post) ) @@ -983,7 +974,6 @@ (set! (-> v1-10 target-speed) 4096.0) ) 0 - (none) ) :exit (behavior () (metalhead-predator-method-205 self #f) @@ -992,11 +982,9 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (enemy-method-49 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1030,7 +1018,6 @@ (sound-play "pred-talk") ) (go-hostile self) - (none) ) :post (the-as (function none :behavior metalhead-predator) nav-enemy-chase-post) ) diff --git a/goal_src/jak2/levels/city/traffic/traffic-manager.gc b/goal_src/jak2/levels/city/traffic/traffic-manager.gc index 99cc21bb585..70b25803e07 100644 --- a/goal_src/jak2/levels/city/traffic/traffic-manager.gc +++ b/goal_src/jak2/levels/city/traffic/traffic-manager.gc @@ -766,13 +766,11 @@ :event traffic-manager-event-handler :enter (behavior () (spawn-all self) - (none) ) :code (behavior () (suspend) (suspend) (go-virtual active) - (none) ) ) @@ -782,7 +780,6 @@ :code (the-as (function none :behavior traffic-manager) sleep-code) :post (behavior () (update self) - (none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/transport.gc b/goal_src/jak2/levels/city/traffic/vehicle/transport.gc index 116a843c1af..084abaf4fa6 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/transport.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/transport.gc @@ -84,7 +84,6 @@ (turret-control-method-11 (-> self turret) self s5-1 (-> (the-as process-focusable gp-0) root transv)) ) ) - (none) ) :code (the-as (function none :behavior vehicle-turret) sleep-code) :post (the-as (function none :behavior vehicle-turret) transform-post) @@ -282,7 +281,6 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self last-guard-spawn-time) (current-time)) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -295,7 +293,6 @@ (ja :num! (seek!)) ) (sleep-code) - (none) ) :post (behavior () (set! (-> self root transv y) (* 2.0 (- (-> self y-dest) (-> self root trans y)))) @@ -306,7 +303,6 @@ ) (transport-method-35 self) (transform-post) - (none) ) ) @@ -318,11 +314,9 @@ (set! (-> self root transv y) 0.0) (set! (-> self last-guard-spawn-time) 0) 0 - (none) ) :exit (behavior () (transport-method-34 self (the-as process #f)) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -336,7 +330,6 @@ (ja :num! (seek! max 0.5)) ) (sleep-code) - (none) ) :post (behavior () (local-vars (gp-0 symbol)) @@ -374,7 +367,6 @@ (transport-method-34 self *target*) (transport-method-35 self) (transform-post) - (none) ) ) @@ -383,7 +375,6 @@ :code (behavior () (sound-stop (-> self ambient-sound-id)) (cleanup-for-death self) - (none) ) ) @@ -393,7 +384,6 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self root transv y) 0.0) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -408,7 +398,6 @@ (ja :num! (seek! max 0.2)) ) (sleep-code) - (none) ) :post (behavior () (transport-method-35 self) @@ -421,7 +410,6 @@ (go-virtual die-fast) ) (transform-post) - (none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc index 69a8ba86090..72c681b7ce0 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc @@ -993,6 +993,7 @@ (none) ) +;; WARN: Return type mismatch object vs none. (defmethod vehicle-method-130 vehicle-guard ((obj vehicle-guard) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((9) @@ -1208,7 +1209,6 @@ (t9-3) ) ) - (none) ) :trans (the-as (function none :behavior vehicle-guard) #f) :code (the-as (function none :behavior vehicle-guard) sleep-code) @@ -1234,7 +1234,6 @@ ) (check-player-get-on self) (vehicle-method-122 self) - (none) ) ) @@ -1246,7 +1245,6 @@ ) :enter (behavior () (set! (-> self ai-hook) (method-of-object self vehicle-method-93)) - (none) ) :trans (the-as (function none :behavior vehicle-guard) #f) :code (the-as (function none :behavior vehicle-guard) sleep-code) @@ -1289,7 +1287,6 @@ (go-virtual slow-pursuit) ) (vehicle-guard-method-154 self) - (none) ) ) @@ -1301,7 +1298,6 @@ ) :enter (behavior () (set! (-> self ai-hook) (method-of-object self vehicle-guard-method-156)) - (none) ) :trans (the-as (function none :behavior vehicle-guard) #f) :code (the-as (function none :behavior vehicle-guard) sleep-code) @@ -1319,7 +1315,6 @@ ) ) (vehicle-guard-method-154 self) - (none) ) ) @@ -1332,7 +1327,6 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self ai-hook) (method-of-object self vehicle-guard-method-156)) - (none) ) :trans (the-as (function none :behavior vehicle-guard) #f) :code (the-as (function none :behavior vehicle-guard) sleep-code) @@ -1356,7 +1350,6 @@ ) ) (vehicle-guard-method-154 self) - (none) ) ) @@ -1369,7 +1362,6 @@ :enter (behavior () (logior! (-> self flags) (rigid-body-object-flag riding ignition ai-driving)) (set! (-> self ai-hook) (method-of-object self vehicle-guard-method-156)) - (none) ) :trans (the-as (function none :behavior vehicle-guard) #f) :code (the-as (function none :behavior vehicle-guard) sleep-code) @@ -1393,6 +1385,5 @@ (the-as rigid-body-object-flag (logior (rigid-body-object-flag in-pursuit) (-> self flags))) ) (vehicle-guard-method-154 self) - (none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc index f0c03ca3cab..91a308c274d 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc @@ -116,6 +116,7 @@ ) (defbehavior vehicle-rider-event-handler vehicle-rider ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) (case arg2 (('traffic-on) (logior! (-> self flags) 2) @@ -161,10 +162,14 @@ (go-virtual got-passed) ) (('hide) - (logior! (-> self draw status) (draw-control-status no-draw)) + (set! v0-0 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + v0-0 ) (('unhide) - (logclear! (-> self draw status) (draw-control-status no-draw)) + (set! v0-0 (logclear (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + v0-0 ) (('rider-on) (logior! (-> self flags) 1) @@ -177,68 +182,49 @@ (vehicle-rider-method-35 self) ) ) - (none) ) (defstate active (vehicle-rider) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior vehicle-rider) - vehicle-rider-event-handler - ) + :event vehicle-rider-event-handler :enter (behavior () (ja-channel-push! 1 (seconds 0.05)) (ja :group! (-> self draw art-group data (-> self riding-anim))) - (none) ) :code (the-as (function none :behavior vehicle-rider) sleep-code) :post (behavior () (vehicle-rider-method-34 self) - (none) ) ) (defstate taunt (vehicle-rider) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior vehicle-rider) - vehicle-rider-event-handler - ) + :event vehicle-rider-event-handler :code (the-as (function none :behavior vehicle-rider) sleep-code) :post (behavior () (go-virtual active) (vehicle-rider-method-34 self) - (none) ) ) (defstate got-passed (vehicle-rider) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior vehicle-rider) - vehicle-rider-event-handler - ) + :event vehicle-rider-event-handler :code (the-as (function none :behavior vehicle-rider) sleep-code) :post (behavior () (go-virtual active) (vehicle-rider-method-34 self) - (none) ) ) (defstate inactive (vehicle-rider) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior vehicle-rider) - vehicle-rider-event-handler - ) + :event vehicle-rider-event-handler :enter (behavior () (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior vehicle-rider) sleep-code) ) @@ -255,6 +241,7 @@ This commonly includes things such as: (none) ) +;; WARN: Return type mismatch object vs none. (defbehavior vehicle-rider-init-by-other vehicle-rider ((arg0 traffic-object-spawn-params)) (initialize-collision self) (set! (-> self root trans quad) (-> arg0 position quad)) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-states.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-states.gc index 646b38849ba..c83488fe1a4 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-states.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-states.gc @@ -7,34 +7,30 @@ ;; DECOMP BEGINS -;; WARN: Return type mismatch object vs none. (defbehavior vehicle-event-handler vehicle ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (rigid-body-object-method-46 self (the-as process-drawable arg0) arg1 arg2 arg3) - (none) ) (defstate idle (vehicle) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior vehicle) vehicle-event-handler) + :event vehicle-event-handler :enter (behavior () (set! (-> self state-time) (current-time)) (rigid-body-object-method-39 self) (go-virtual waiting) - (none) ) :code (the-as (function none :behavior vehicle) sleep-code) :post (behavior () (ja-post) - (none) ) ) (defstate inactive (vehicle) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('nav-mesh-kill 'traffic-activate 'traffic-off-force 'traffic-off 'rider-on 'rider-off) - (rigid-body-object-method-46 self (the-as process-drawable proc) arg1 event-type event) + (rigid-body-object-method-46 self (the-as process-drawable proc) argc message block) ) ) ) @@ -44,44 +40,39 @@ (rigid-body-object-method-41 self) (vehicle-method-88 self) (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (behavior () (rigid-body-object-method-40 self) (logclear! (-> self focus-status) (focus-status disable inactive)) (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior vehicle) sleep-code) ) (defstate active (vehicle) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior vehicle) vehicle-event-handler) + :event vehicle-event-handler :enter (behavior () (set! (-> self state-time) (current-time)) (vehicle-method-139 self) (logior! (-> self flags) (rigid-body-object-flag riding ai-driving)) (vehicle-method-142 self) (set! (-> self flight-level-index) 1) - (none) ) :exit (behavior () '() - (none) ) :trans (the-as (function none :behavior vehicle) #f) :code (the-as (function none :behavior vehicle) sleep-code) :post (behavior () (check-player-get-on self) (vehicle-method-122 self) - (none) ) ) (defstate waiting (vehicle) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior vehicle) vehicle-event-handler) + :event vehicle-event-handler :enter (behavior () (set! (-> self state-time) (current-time)) (vehicle-method-140 self) @@ -104,7 +95,6 @@ 0 ) ) - (none) ) :exit (behavior () (logclear! (-> self flags) (rigid-body-object-flag waiting-for-player)) @@ -126,19 +116,17 @@ (set! (-> v1-3 prim-core collide-as) (collide-spec vehicle-sphere)) ) ) - (none) ) :trans (the-as (function none :behavior vehicle) #f) :code (the-as (function none :behavior vehicle) sleep-code) :post (behavior () (vehicle-method-123 self) - (none) ) ) (defstate player-control (vehicle) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior vehicle) vehicle-event-handler) + :event vehicle-event-handler :enter (behavior () (set-setting! 'sound-flava #f 31.0 5) (set! (-> self state-time) (current-time)) @@ -163,7 +151,6 @@ (logior! (-> self root penetrated-by) (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot)) (set! (-> self damage-factor) (* 0.7518797 (-> self damage-factor))) 0 - (none) ) :exit (behavior () (logclear! (-> self root penetrated-by) (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot)) @@ -191,7 +178,6 @@ (rigid-body-object-method-42 self) (logclear! (-> self flags) (rigid-body-object-flag player-driving)) (remove-setting! 'sound-flava) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) @@ -209,7 +195,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior vehicle) sleep-code) :post (behavior () @@ -245,13 +230,12 @@ ) (label cfg-4) 0 - (none) ) ) (defstate crash (vehicle) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior vehicle) vehicle-event-handler) + :event vehicle-event-handler :enter (behavior () (logclear! (-> self flags) (rigid-body-object-flag player-driving)) (set! (-> self state-time) (current-time)) @@ -261,19 +245,16 @@ (dotimes (gp-0 (-> self info seat-count)) (send-event (handle->process (-> self rider-array gp-0)) 'vehicle-crash) ) - (none) ) :trans (behavior () (set! (-> self hit-points) (- (-> self hit-points) (* 0.5 (seconds-per-frame)))) (if (and (>= (- (current-time) (-> self state-time)) 1) (< (-> self hit-points) -0.25)) (go-virtual explode) ) - (none) ) :code (the-as (function none :behavior vehicle) sleep-code) :post (behavior () (vehicle-method-121 self) - (none) ) ) @@ -378,7 +359,7 @@ (defstate explode (vehicle) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior vehicle) vehicle-event-handler) + :event vehicle-event-handler :enter (behavior () (rlet ((vf0 :class vf)) (init-vf0-vector) @@ -462,13 +443,11 @@ ) ) (set! (-> self state-time) (current-time)) - (none) ) ) :code (the-as (function none :behavior vehicle) sleep-code) :post (behavior () (vehicle-explode-post) - (none) ) ) @@ -484,7 +463,6 @@ (cleanup-for-death self) ) ) - (none) ) ) @@ -492,26 +470,21 @@ :virtual #t :enter (behavior () '() - (none) ) :exit (behavior () (set! (-> self flags) (the-as rigid-body-object-flag (logclear (-> self flags) (rigid-body-object-flag measure-control-parameters))) ) - (none) ) :trans (behavior () (if (cpad-pressed? 1 square) (vehicle-method-138 self) ) - (none) ) :code (behavior () (vehicle-method-138 self) - (none) ) :post (behavior () (vehicle-method-121 self) - (none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc index c3d691875bb..d1dd809f8aa 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc @@ -1732,16 +1732,6 @@ ) ) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 71] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 182] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 215] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 222] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 257] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 273] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 323] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 290] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 307] (defmethod rigid-body-object-method-46 vehicle ((obj vehicle) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (and (= arg2 'touched) arg0 (logtest? (process-mask bit18) (-> arg0 mask))) (dotimes (s1-0 4) @@ -1759,110 +1749,105 @@ ) ) ) - (let ((v1-19 arg2)) - (the-as - object - (cond - ((= v1-19 'traffic-off) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag persistent))) - (cond - ((logtest? (-> obj flags) (rigid-body-object-flag dead)) - (go (method-of-object obj die)) - ) - (else - (if (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) - (vehicle-method-113 obj) - ) + (case arg2 + (('traffic-off) + (when (not (logtest? (-> obj flags) (rigid-body-object-flag persistent))) + (cond + ((logtest? (-> obj flags) (rigid-body-object-flag dead)) + (go (method-of-object obj die)) + ) + (else + (if (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) + (vehicle-method-113 obj) ) - ) ) ) - ((= v1-19 'traffic-off-force) - (vehicle-method-113 obj) - ) - ((= v1-19 'traffic-activate) - (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) - (logior! (-> obj flags) (rigid-body-object-flag traffic-managed)) - (let ((s5-1 (the-as traffic-object-spawn-params (-> arg3 param 0)))) - (set! (-> obj root trans quad) (-> s5-1 position quad)) - (quaternion-copy! (-> obj root quat) (-> s5-1 rotation)) - (set! (-> obj root transv quad) (-> s5-1 velocity quad)) - (vehicle-method-130 obj s5-1) + ) + ) + (('traffic-off-force) + (vehicle-method-113 obj) + ) + (('traffic-activate) + (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (logior! (-> obj flags) (rigid-body-object-flag traffic-managed)) + (let ((s5-1 (the-as traffic-object-spawn-params (-> arg3 param 0)))) + (set! (-> obj root trans quad) (-> s5-1 position quad)) + (quaternion-copy! (-> obj root quat) (-> s5-1 rotation)) + (set! (-> obj root transv quad) (-> s5-1 velocity quad)) + (vehicle-method-130 obj s5-1) + ) + ) + (('attack) + (let ((s3-1 (the-as attack-info (-> arg3 param 1))) + (s2-1 (get-penetrate-using-from-attack-event arg0 arg3)) ) - ) - ((= v1-19 'attack) - (let ((s3-1 (the-as attack-info (-> arg3 param 1))) - (s2-1 (get-penetrate-using-from-attack-event arg0 arg3)) - ) - (when (and (!= (-> s3-1 id) (-> obj incoming-attack-id)) - (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) - (or (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) - (not (logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot) s2-1)) - ) + (when (and (!= (-> s3-1 id) (-> obj incoming-attack-id)) + (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) + (or (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) + (not (logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot) s2-1)) ) - (set! (-> obj incoming-attack-id) (-> s3-1 id)) - (when (and (logtest? (-> obj info flags) 4) (logtest? (rigid-body-object-flag ai-driving) (-> obj flags))) - (let ((a1-8 (find-offending-process-focusable arg0 s3-1))) - (if (and a1-8 (logtest? (-> a1-8 mask) (process-mask target))) - (vehicle-method-134 obj a1-8) - ) + ) + (set! (-> obj incoming-attack-id) (-> s3-1 id)) + (when (and (logtest? (-> obj info flags) 4) (logtest? (rigid-body-object-flag ai-driving) (-> obj flags))) + (let ((a1-8 (find-offending-process-focusable arg0 s3-1))) + (if (and a1-8 (logtest? (-> a1-8 mask) (process-mask target))) + (vehicle-method-134 obj a1-8) ) - ) - (rigid-body-object-method-47 obj arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) s2-1) ) ) + (rigid-body-object-method-47 obj arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) s2-1) ) - ((= v1-19 'turbo-ring) - (set! (-> obj turbo-boost-factor) (the-as float (-> arg3 param 0))) - (set! (-> obj turbo-boost-time) (current-time)) - (set! (-> obj turbo-boost-duration) (the-as uint 75)) - (logior! (-> obj flags) (rigid-body-object-flag turbo-boost)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (sound-play "boost-ring") - ) + ) + ) + (('turbo-ring) + (set! (-> obj turbo-boost-factor) (the-as float (-> arg3 param 0))) + (set! (-> obj turbo-boost-time) (current-time)) + (set! (-> obj turbo-boost-duration) (the-as uint 75)) + (logior! (-> obj flags) (rigid-body-object-flag turbo-boost)) + (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (sound-play "boost-ring") ) - ((= v1-19 'get-offending-focusable) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - *target* - ) + ) + (('get-offending-focusable) + (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + *target* ) - ((= v1-19 'pilot-on) - (let* ((s3-2 (-> arg3 param 0)) - (s2-2 arg0) - (s5-3 (if (type? s2-2 process-focusable) - s2-2 - ) + ) + (('pilot-on) + (let* ((s3-2 (-> arg3 param 0)) + (s2-2 arg0) + (s5-3 (if (type? s2-2 process-focusable) + s2-2 ) - ) - (when s5-3 - (format #t "vehicle::event-handler: pilot-on (pid ~d) from pid ~d~%" (-> obj pid) (-> arg0 pid)) - (logior! (-> obj flags) (rigid-body-object-flag riding)) - (put-rider-in-seat obj (the-as int s3-2) (the-as process-focusable s5-3)) - (if (logtest? (-> s5-3 mask) (process-mask target)) - (logior! (-> obj flags) (rigid-body-object-flag player-driving)) - ) - #t - ) - ) - ) - ((= v1-19 'player-get-off) - (if (and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) (!= (-> obj crash-level) 3)) - (go (method-of-object obj waiting)) + ) + ) + (when s5-3 + (format #t "vehicle::event-handler: pilot-on (pid ~d) from pid ~d~%" (-> obj pid) (-> arg0 pid)) + (logior! (-> obj flags) (rigid-body-object-flag riding)) + (put-rider-in-seat obj (the-as int s3-2) (the-as process-focusable s5-3)) + (if (logtest? (-> s5-3 mask) (process-mask target)) + (logior! (-> obj flags) (rigid-body-object-flag player-driving)) ) + #t ) - ((= v1-19 'rider-off) - (send-event (ppointer->process (-> obj child)) 'rider-off) - ) - ((= v1-19 'rider-on) - (send-event (ppointer->process (-> obj child)) 'rider-on) - ) - ((= v1-19 'nav-mesh-kill) - (vehicle-method-142 obj) + ) + ) + (('player-get-off) + (if (and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) (!= (-> obj crash-level) 3)) + (go (method-of-object obj waiting)) ) - (else - ((method-of-type rigid-body-object rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) - ) - ) + ) + (('rider-off) + (send-event (ppointer->process (-> obj child)) 'rider-off) + ) + (('rider-on) + (send-event (ppointer->process (-> obj child)) 'rider-on) + ) + (('nav-mesh-kill) + (vehicle-method-142 obj) + ) + (else + ((method-of-type rigid-body-object rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) ) ) ) diff --git a/goal_src/jak2/levels/city/vinroom/vinroom-obs.gc b/goal_src/jak2/levels/city/vinroom/vinroom-obs.gc index 802d54731c3..ede5ed1d22e 100644 --- a/goal_src/jak2/levels/city/vinroom/vinroom-obs.gc +++ b/goal_src/jak2/levels/city/vinroom/vinroom-obs.gc @@ -85,17 +85,14 @@ :virtual #t :enter (behavior () (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :trans (behavior () (if (>= (vector4-dot (the-as vector (-> self outside-plane)) (math-camera-pos)) 0.0) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior vin-turbine) sleep-code) ) @@ -108,7 +105,6 @@ ) (go-virtual dormant) ) - (none) ) :code (behavior () (until #f @@ -122,7 +118,6 @@ ) ) #f - (none) ) :post (behavior () (when (and (or (not (-> self dont-draw-outside?)) @@ -196,7 +191,6 @@ ) ) (ja-post) - (none) ) ) diff --git a/goal_src/jak2/levels/common/ai/ashelin/ash-states.gc b/goal_src/jak2/levels/common/ai/ashelin/ash-states.gc index 9543adbddb2..43982f42ac8 100644 --- a/goal_src/jak2/levels/common/ai/ashelin/ash-states.gc +++ b/goal_src/jak2/levels/common/ai/ashelin/ash-states.gc @@ -24,7 +24,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -39,7 +38,6 @@ ) ) 0 - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -100,7 +98,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) ) @@ -123,7 +120,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) (logclear! (-> self bot-flags) (bot-flags bf21)) - (none) ) :trans (behavior () (bot-method-223 self #t) @@ -192,7 +188,6 @@ ) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -248,7 +243,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) ) @@ -271,7 +265,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) (logclear! (-> self bot-flags) (bot-flags bf21)) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -290,7 +283,6 @@ ) ) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'bot-turn-info))) @@ -338,7 +330,6 @@ ) ) (go-virtual standing-idle) - (none) ) :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) ) @@ -363,7 +354,6 @@ (stop-looking-at-target! self) (nav-enemy-method-165 self) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (if (focus-test? self grabbed) @@ -385,7 +375,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -393,7 +382,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -405,7 +393,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -426,7 +413,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -438,7 +424,6 @@ (go-virtual traveling) ) ) - (none) ) :code (-> (method-of-type ashelin waiting-idle) code) :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) @@ -457,7 +442,6 @@ ) 0 (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -471,7 +455,6 @@ (go-virtual traveling) ) ) - (none) ) :code (-> (method-of-type ashelin waiting-idle) code) ) @@ -492,11 +475,9 @@ (react-to-focus self) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :code (behavior () (bot-method-223 self #t) @@ -533,7 +514,6 @@ ) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) ) @@ -544,7 +524,6 @@ :enter (behavior () ((-> (method-of-type nav-enemy hostile) enter)) (nav-enemy-method-166 self) - (none) ) :trans (behavior () (bot-method-223 self #t) @@ -572,7 +551,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -580,7 +558,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((gp-0 (-> self nav state)) @@ -592,7 +569,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -614,14 +590,12 @@ (nav-enemy-method-167 self) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (if (logtest? (enemy-flag enemy-flag43) (-> 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)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -722,7 +696,6 @@ (ja :num! (seek!)) ) (react-to-focus self) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -734,7 +707,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -756,14 +728,12 @@ (nav-enemy-method-167 self) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (if (logtest? (enemy-flag enemy-flag43) (-> 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)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -857,7 +827,6 @@ (ja :num! (seek!)) ) (react-to-focus self) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -869,7 +838,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -891,14 +859,12 @@ (nav-enemy-method-167 self) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (if (logtest? (enemy-flag enemy-flag43) (-> 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)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -992,7 +958,6 @@ (ja :num! (seek!)) ) (react-to-focus self) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1004,7 +969,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -1019,7 +983,6 @@ (set! (-> self travel-anim-interp) 0.0) (set! (-> self last-fire-time) 0) 0 - (none) ) :code (behavior () (local-vars (v1-7 enemy-flag) (v1-15 enemy-flag)) @@ -1048,7 +1011,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -1069,7 +1031,6 @@ (logior! (-> self bot-flags) (bot-flags bf23)) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type bot knocked) trans))) @@ -1081,7 +1042,6 @@ (logclear! (-> self bot-flags) (bot-flags bf23)) (ashelin-method-244 self) ) - (none) ) ) @@ -1094,7 +1054,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () (let ((v1-1 (get-rand-int self 3))) @@ -1148,7 +1107,6 @@ (suspend) ) #f - (none) ) ) @@ -1156,6 +1114,5 @@ :virtual #t :enter (behavior () (go-virtual die-falling) - (none) ) ) diff --git a/goal_src/jak2/levels/common/ai/ashelin/ash.gc b/goal_src/jak2/levels/common/ai/ashelin/ash.gc index 4c7423836da..ae78ee37272 100644 --- a/goal_src/jak2/levels/common/ai/ashelin/ash.gc +++ b/goal_src/jak2/levels/common/ai/ashelin/ash.gc @@ -702,7 +702,6 @@ (go (method-of-object obj standing-idle)) ) ) - (none) ) (defmethod react-to-focus ashelin ((obj ashelin)) @@ -711,7 +710,6 @@ (go-hostile obj) (ashelin-method-239 obj) ) - (none) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/common/ai/bot-states.gc b/goal_src/jak2/levels/common/ai/bot-states.gc index cbfb549cdec..b7221566c9f 100644 --- a/goal_src/jak2/levels/common/ai/bot-states.gc +++ b/goal_src/jak2/levels/common/ai/bot-states.gc @@ -18,7 +18,6 @@ (stop-speech self (the-as uint 0) #t) (bot-method-191 self) (logclear! (-> self bot-flags) (bot-flags bf11)) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hit) exit))) @@ -27,7 +26,6 @@ ) ) (logior! (-> self bot-flags) (bot-flags bf11)) - (none) ) :code (behavior () (local-vars (v1-37 enemy-flag) (v1-45 enemy-flag)) @@ -74,7 +72,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -100,7 +97,6 @@ (t9-2) ) ) - (none) ) :exit (behavior () (let ((gp-0 (-> self incoming attack-id))) @@ -113,7 +109,6 @@ ) (logior! (-> self bot-flags) (bot-flags bf11)) (logclear! (-> self bot-flags) (bot-flags bf12)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy knocked) trans))) @@ -125,7 +120,6 @@ (logclear! (-> self bot-flags) (bot-flags bf12)) (play-attacked-speech self) ) - (none) ) ) @@ -143,7 +137,6 @@ (set! (-> self delay-too-far-check) -1) (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) (fail-mission! self) - (none) ) :exit (behavior () (logior! (-> self bot-flags) (bot-flags bf11)) @@ -153,11 +146,9 @@ (t9-0) ) ) - (none) ) :trans (behavior () (fail-falling self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -188,7 +179,6 @@ (suspend) ) #f - (none) ) ) @@ -209,18 +199,15 @@ ) ) ) - (none) ) :exit (behavior () (logior! (-> self bot-flags) (bot-flags bf11)) - (none) ) :trans (behavior () ((-> (method-of-type bot die-falling) trans)) (if (channel-active? self (the-as uint 0)) (set! (-> self state-time) (current-time)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -247,7 +234,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior bot) nav-enemy-die-falling-post) ) @@ -265,7 +251,6 @@ (logior! (-> self draw status) (draw-control-status no-draw)) (set! (-> self notice-enemy-dist) 0.0) (logclear! (-> self enemy-flags) (enemy-flag trackable-backup)) - (none) ) :exit (behavior () (local-vars (v0-0 enemy-flag)) @@ -282,7 +267,6 @@ ) ) (set! (-> self enemy-flags) v0-0) - (none) ) :code (the-as (function none :behavior bot) sleep-code) :post (the-as (function none :behavior bot) nav-enemy-simple-post) diff --git a/goal_src/jak2/levels/common/ai/bot.gc b/goal_src/jak2/levels/common/ai/bot.gc index 956b830ac8b..0de8ed61589 100644 --- a/goal_src/jak2/levels/common/ai/bot.gc +++ b/goal_src/jak2/levels/common/ai/bot.gc @@ -431,6 +431,7 @@ 3 ) +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-129 bot ((obj bot)) (local-vars (s5-1 process)) (let ((s5-0 (-> obj focus))) @@ -708,232 +709,205 @@ (and (not (focus-test? obj dead grabbed)) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) ) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 17] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 23] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 87] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 111] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 128] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 141] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 180] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 186] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 192] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 32] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 224] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 232] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 238] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 213] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 302] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 312] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 348] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 252] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 267] ;; WARN: disable def twice: 280. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 5] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 9] (defmethod general-event-handler bot ((obj bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (local-vars (v0-0 none)) - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'track) - #f - ) - ((= v1-0 'combo) - #f + (local-vars (v0-0 object)) + (case arg2 + (('track) + #f + ) + (('combo) + #f + ) + (('query) + (case (-> arg3 param 0) + (('waypoint) + (-> obj waypoint waypoint-id) + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) - ((= v1-0 'query) - (case (-> arg3 param 0) - (('waypoint) - (-> obj waypoint waypoint-id) - ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) + ) + ) + (('request) + (case (-> arg3 param 0) + (('waypoint) + (set! (-> obj waypoint-request) (the-as int (-> arg3 param 1))) + #t + ) + (('health-meter) + (cond + ((-> arg3 param 1) + (set! v0-0 (logior (-> obj bot-flags) (bot-flags bf06))) + (set! (-> obj bot-flags) (the-as bot-flags v0-0)) ) - ) - ((= v1-0 'request) - (case (-> arg3 param 0) - (('waypoint) - (set! (-> obj waypoint-request) (the-as int (-> arg3 param 1))) - #t + (else + (set! v0-0 (logclear (-> obj bot-flags) (bot-flags bf06))) + (set! (-> obj bot-flags) (the-as bot-flags v0-0)) ) - (('health-meter) - (cond - ((-> arg3 param 1) - (set! v0-0 (the-as none (logior (-> obj bot-flags) (bot-flags bf06)))) - (set! (-> obj bot-flags) (the-as bot-flags v0-0)) - ) - (else - (set! v0-0 (the-as none (logclear (-> obj bot-flags) (bot-flags bf06)))) - (set! (-> obj bot-flags) (the-as bot-flags v0-0)) - ) - ) - v0-0 - ) - (('too-far-fail) - (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail bf09))) - (logior! (-> obj bot-flags) (bot-flags bf09)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag check-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (go (method-of-object obj failed)) - ) - ) - (('move-to-vehicle) - (let ((a0-19 (-> arg3 param 2))) - (cond - ((>= (the-as int a0-19) 0) - (let ((v1-29 (the-as object (-> arg3 param 1)))) - (cond - ((focus-test? obj pilot) - (if (= (-> obj vehicle-seat-index) a0-19) - (= (the-as uint v1-29) (handle->process (-> obj vehicle-handle))) - ) + ) + v0-0 + ) + (('too-far-fail) + (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail bf09))) + (logior! (-> obj bot-flags) (bot-flags bf09)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + (logclear! (-> obj enemy-flags) (enemy-flag check-water)) + (logclear! (-> obj mask) (process-mask collectable)) + (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> obj enemy-flags) (enemy-flag notice)) + (go (method-of-object obj failed)) + ) + ) + (('move-to-vehicle) + (let ((a0-19 (-> arg3 param 2))) + (cond + ((>= (the-as int a0-19) 0) + (let ((v1-29 (the-as object (-> arg3 param 1)))) + (cond + ((focus-test? obj pilot) + (if (= (-> obj vehicle-seat-index) a0-19) + (= (the-as uint v1-29) (handle->process (-> obj vehicle-handle))) ) - (else - (set! (-> obj vehicle-seat-index) (the-as int a0-19)) - (set! (-> obj vehicle-handle) (process->handle (the-as uint v1-29))) - (logior! (-> obj bot-flags) (bot-flags bf15)) - #t - ) - ) + ) + (else + (set! (-> obj vehicle-seat-index) (the-as int a0-19)) + (set! (-> obj vehicle-handle) (process->handle (the-as uint v1-29))) + (logior! (-> obj bot-flags) (bot-flags bf15)) + #t ) ) - (else - (when (not (focus-test? obj pilot)) - (set! (-> obj vehicle-seat-index) -1) - (set! (-> obj vehicle-handle) (the-as handle #f)) - (logclear! (-> obj bot-flags) (bot-flags bf15)) - #t - ) - ) + ) + ) + (else + (when (not (focus-test? obj pilot)) + (set! (-> obj vehicle-seat-index) -1) + (set! (-> obj vehicle-handle) (the-as handle #f)) + (logclear! (-> obj bot-flags) (bot-flags bf15)) + #t ) ) ) - (('exit-vehicle) - (when (focus-test? obj pilot) - (let ((v1-43 (-> arg3 param 1)) - (s5-1 (-> arg3 param 2)) - ) - (cond - (v1-43 - (logior! (-> obj bot-flags) (bot-flags bf16)) - (when (and (>= (the-as int s5-1) 0) (!= s5-1 (-> obj nav-mesh-index))) - (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor (the-as int s5-1)) obj) - (set! (-> obj nav-mesh-index) (the-as int s5-1)) - ) - ) - (else - (logclear! (-> obj bot-flags) (bot-flags bf16)) - ) + ) + ) + (('exit-vehicle) + (when (focus-test? obj pilot) + (let ((v1-43 (-> arg3 param 1)) + (s5-1 (-> arg3 param 2)) + ) + (cond + (v1-43 + (logior! (-> obj bot-flags) (bot-flags bf16)) + (when (and (>= (the-as int s5-1) 0) (!= s5-1 (-> obj nav-mesh-index))) + (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor (the-as int s5-1)) obj) + (set! (-> obj nav-mesh-index) (the-as int s5-1)) ) ) - #t - ) - ) - (('slave-id) - (set! (-> obj slave-id) (the-as int (-> arg3 param 1))) - #t - ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) - ) - ((= v1-0 'notify) - (case (-> arg3 param 0) - (('attack) - (let ((s5-2 (-> arg3 param 1))) - (when (if (type? s5-2 process-focusable) - s5-2 - ) - (logior! (-> obj enemy-flags) (enemy-flag look-at-focus)) - (set! (-> obj hit-focus-time) (current-time)) + (else + (logclear! (-> obj bot-flags) (bot-flags bf16)) ) ) - #t - ) - (('mission-failed) - (logior! (-> obj bot-flags) (bot-flags bf09)) - (logclear! (-> obj bot-flags) (bot-flags bf06)) - #t ) - (('follow-dir) - (set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) - #t - ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) - ) - ((= v1-0 'set-task) - (let ((a1-11 (/ (the-as int (-> arg3 param 0)) 8))) - (logior! (-> obj bot-task-bits) (ash 1 a1-11)) - ) - #t - ) - ((= v1-0 'clear-task) - (let ((a1-13 (/ (the-as int (-> arg3 param 0)) 8))) - (logclear! (-> obj bot-task-bits) (ash 1 a1-13)) - ) - #t - ) - ((= v1-0 'skip) - (skip-waypoint obj) - ) - ((= v1-0 'change-mode) - (when (= (-> arg3 param 0) 'grab) - (set! v0-0 (the-as none (alive? obj))) - (if (and (the-as symbol v0-0) (-> arg3 param 1)) - (logior! (-> obj focus-status) (focus-status grabbed)) - ) - v0-0 - ) - ) - ((= v1-0 'end-mode) - (when (focus-test? obj grabbed) - (logclear! (-> obj focus-status) (focus-status grabbed)) - #t - ) + #t + ) + ) + (('slave-id) + (set! (-> obj slave-id) (the-as int (-> arg3 param 1))) + #t + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) - ((= v1-0 'hide) - (cond - ((-> arg3 param 0) - (go (method-of-object obj hidden)) + ) + ) + (('notify) + (case (-> arg3 param 0) + (('attack) + (let ((s5-2 (-> arg3 param 1))) + (when (if (type? s5-2 process-focusable) + s5-2 + ) + (logior! (-> obj enemy-flags) (enemy-flag look-at-focus)) + (set! (-> obj hit-focus-time) (current-time)) ) - (else - (if (and (-> obj next-state) (= (-> obj next-state name) 'hidden)) - (react-to-focus obj) - ) - ) - ) + ) + #t + ) + (('mission-failed) + (logior! (-> obj bot-flags) (bot-flags bf09)) + (logclear! (-> obj bot-flags) (bot-flags bf06)) + #t + ) + (('follow-dir) + (set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) + #t + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) - ((= v1-0 'draw) - (cond - ((-> arg3 param 0) - (set! v0-0 (the-as none (logclear (-> obj draw status) (draw-control-status no-draw)))) - (set! (-> obj draw status) (the-as draw-control-status v0-0)) - ) - (else - (set! v0-0 (the-as none (logior (-> obj draw status) (draw-control-status no-draw)))) - (set! (-> obj draw status) (the-as draw-control-status v0-0)) - ) + ) + ) + (('set-task) + (let ((a1-11 (/ (the-as int (-> arg3 param 0)) 8))) + (logior! (-> obj bot-task-bits) (ash 1 a1-11)) + ) + #t + ) + (('clear-task) + (let ((a1-13 (/ (the-as int (-> arg3 param 0)) 8))) + (logclear! (-> obj bot-task-bits) (ash 1 a1-13)) + ) + #t + ) + (('skip) + (skip-waypoint obj) + ) + (('change-mode) + (when (= (-> arg3 param 0) 'grab) + (set! v0-0 (alive? obj)) + (if (and (the-as symbol v0-0) (-> arg3 param 1)) + (logior! (-> obj focus-status) (focus-status grabbed)) ) - v0-0 + v0-0 + ) + ) + (('end-mode) + (when (focus-test? obj grabbed) + (logclear! (-> obj focus-status) (focus-status grabbed)) + #t + ) + ) + (('hide) + (cond + ((-> arg3 param 0) + (go (method-of-object obj hidden)) + ) + (else + (if (and (-> obj next-state) (= (-> obj next-state name) 'hidden)) + (react-to-focus obj) + ) ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) + ) + ) + (('draw) + (cond + ((-> arg3 param 0) + (set! v0-0 (logclear (-> obj draw status) (draw-control-status no-draw))) + (set! (-> obj draw status) (the-as draw-control-status v0-0)) ) + (else + (set! v0-0 (logior (-> obj draw status) (draw-control-status no-draw))) + (set! (-> obj draw status) (the-as draw-control-status v0-0)) + ) + ) + v0-0 + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) ) ) diff --git a/goal_src/jak2/levels/common/ai/halt/hal.gc b/goal_src/jak2/levels/common/ai/halt/hal.gc index 470ff1f8f60..8b1ae362956 100644 --- a/goal_src/jak2/levels/common/ai/halt/hal.gc +++ b/goal_src/jak2/levels/common/ai/halt/hal.gc @@ -384,116 +384,112 @@ ) ) -;; WARN: Return type mismatch none vs object. (defmethod general-event-handler hal ((obj hal) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (the-as - object - (case arg2 - (('notify) - (case (-> arg3 param 0) - (('hit-by) - (let* ((s4-0 arg0) - (v1-2 (if (type? s4-0 bot) - s4-0 - ) - ) - ) - (when v1-2 - (when (= (-> (the-as process (-> arg3 param 1)) type) target) - (logior! (-> obj bot-flags) (ash 1 (+ (-> (the-as bot v1-2) slave-id) 19))) - (the-as object (stop-speech obj (the-as uint 0) #t)) - ) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('hit-by) + (let* ((s4-0 arg0) + (v1-2 (if (type? s4-0 bot) + s4-0 + ) + ) + ) + (when v1-2 + (when (= (-> (the-as process (-> arg3 param 1)) type) target) + (logior! (-> obj bot-flags) (ash 1 (+ (-> (the-as bot v1-2) slave-id) 19))) + (stop-speech obj (the-as uint 0) #t) ) ) ) - (('mission-failed) - (let* ((s4-1 arg0) - (s5-1 (if (type? s4-1 bot) - s4-1 - ) - ) - ) - (when s5-1 - (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail))) - (when (not (logtest? (-> obj bot-flags) (bot-flags bf09))) - (logior! (-> obj bot-flags) (bot-flags bf09)) - (let ((a1-7 (new 'stack-no-clear 'fail-mission-params))) - (set! (-> a1-7 flags) (fail-mission-flags famflags-5)) - (set! (-> a1-7 message) (fail-mission-message fammsg-0)) - (set! (-> a1-7 retry-continue) #f) - (set! (-> a1-7 fail-continue) #f) - (set! (-> a1-7 reset-delay) (the-as uint 1500)) - (set! (-> a1-7 task) (game-task none)) - (set! (-> a1-7 fail-message) (text-id null)) - (if (start! *fail-mission-control* a1-7) - (set! (-> obj handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) - ) - ) - (set! (-> obj delay-too-far-check) -1) - (stop-speech obj (the-as uint 0) #f) - (countdown (s4-2 3) - (send-event (handle->process (-> obj slave-handle s4-2)) 'notify 'mission-failed) - ) + ) + (('mission-failed) + (let* ((s4-1 arg0) + (s5-1 (if (type? s4-1 bot) + s4-1 + ) + ) + ) + (when s5-1 + (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail))) + (when (not (logtest? (-> obj bot-flags) (bot-flags bf09))) + (logior! (-> obj bot-flags) (bot-flags bf09)) + (let ((a1-7 (new 'stack-no-clear 'fail-mission-params))) + (set! (-> a1-7 flags) (fail-mission-flags famflags-5)) + (set! (-> a1-7 message) (fail-mission-message fammsg-0)) + (set! (-> a1-7 retry-continue) #f) + (set! (-> a1-7 fail-continue) #f) + (set! (-> a1-7 reset-delay) (the-as uint 1500)) + (set! (-> a1-7 task) (game-task none)) + (set! (-> a1-7 fail-message) (text-id null)) + (if (start! *fail-mission-control* a1-7) + (set! (-> obj handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) + ) + ) + (set! (-> obj delay-too-far-check) -1) + (stop-speech obj (the-as uint 0) #f) + (countdown (s4-2 3) + (send-event (handle->process (-> obj slave-handle s4-2)) 'notify 'mission-failed) ) - (= (-> obj handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) ) + (= (-> obj handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) ) ) ) - (('follow-dir) - (set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) - #t - ) - ) - ) - (('set-task) - (let ((a1-10 (/ (the-as int (-> arg3 param 0)) 8))) - (logior! (-> obj bot-task-bits) (ash 1 a1-10)) - ) - #t + ) + (('follow-dir) + (set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) + #t + ) ) - (('clear-task) - (let ((a1-12 (/ (the-as int (-> arg3 param 0)) 8))) - (logclear! (-> obj bot-task-bits) (ash 1 a1-12)) - ) - #t + ) + (('set-task) + (let ((a1-10 (/ (the-as int (-> arg3 param 0)) 8))) + (logior! (-> obj bot-task-bits) (ash 1 a1-10)) ) - (('change-mode) - (when (= (-> arg3 param 0) 'grab) - (let ((v0-1 (the-as object (alive? obj)))) - (if (and (the-as symbol v0-1) (-> arg3 param 1)) - (logior! (-> obj focus-status) (focus-status grabbed)) - ) - v0-1 - ) - ) + #t + ) + (('clear-task) + (let ((a1-12 (/ (the-as int (-> arg3 param 0)) 8))) + (logclear! (-> obj bot-task-bits) (ash 1 a1-12)) ) - (('end-mode) - (when (focus-test? obj grabbed) - (logclear! (-> obj focus-status) (focus-status grabbed)) - #t + #t + ) + (('change-mode) + (when (= (-> arg3 param 0) 'grab) + (let ((v0-1 (the-as object (alive? obj)))) + (if (and (the-as symbol v0-1) (-> arg3 param 1)) + (logior! (-> obj focus-status) (focus-status grabbed)) + ) + v0-1 ) ) - (('skip) - (the-as object (skip-waypoint obj)) - ) - (('move-trans) - (move-to-point! (-> obj root) (the-as vector (-> arg3 param 0))) - #t - ) - (('die-fast) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) - ) - (('nav-mesh-kill) - (remove-process-drawable (-> obj nav state mesh) obj) - (set! (-> obj nav) #f) - (set! (-> obj nav-mesh-index) -1) + ) + (('end-mode) + (when (focus-test? obj grabbed) + (logclear! (-> obj focus-status) (focus-status grabbed)) #t ) - ) + ) + (('skip) + (skip-waypoint obj) + ) + (('move-trans) + (move-to-point! (-> obj root) (the-as vector (-> arg3 param 0))) + #t + ) + (('die-fast) + (cleanup-for-death obj) + (go (method-of-object obj die-fast)) + ) + (('nav-mesh-kill) + (remove-process-drawable (-> obj nav state mesh) obj) + (set! (-> obj nav) #f) + (set! (-> obj nav-mesh-index) -1) + #t + ) ) ) diff --git a/goal_src/jak2/levels/common/ai/ruffian/ruf-states.gc b/goal_src/jak2/levels/common/ai/ruffian/ruf-states.gc index fe537971be9..50af09198fd 100644 --- a/goal_src/jak2/levels/common/ai/ruffian/ruf-states.gc +++ b/goal_src/jak2/levels/common/ai/ruffian/ruf-states.gc @@ -24,7 +24,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -47,7 +46,6 @@ (if (logtest? (bot-flags bf19) (-> self bot-flags)) (ruffian-method-240 self) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) @@ -70,7 +68,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -84,13 +81,11 @@ ) ) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 49152.0 (seconds 0.05)) (nav-enemy-simple-post) - (none) ) ) @@ -111,7 +106,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -131,7 +125,6 @@ (if (not (logtest? (bot-flags bf19) (-> self bot-flags))) (ruffian-method-240 self) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) @@ -154,7 +147,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -168,13 +160,11 @@ ) ) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 49152.0 (seconds 0.05)) (nav-enemy-simple-post) - (none) ) ) @@ -200,7 +190,6 @@ (if (and (-> self focus-info fproc) (>= (fabs (-> self focus-info ry-diff)) 9102.223)) (ruffian-method-241 self) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) @@ -223,17 +212,14 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #t) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 49152.0 (seconds 0.05)) (nav-enemy-simple-post) - (none) ) ) @@ -257,7 +243,6 @@ (stop-looking-at-target! self) (nav-enemy-method-166 self) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -276,7 +261,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -284,7 +268,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -296,7 +279,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -317,7 +299,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -329,7 +310,6 @@ (go-virtual traveling) ) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) @@ -348,7 +328,6 @@ ) 0 (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -360,7 +339,6 @@ (go-virtual traveling) ) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) ) @@ -385,7 +363,6 @@ (set! (-> self attack-id) a0-6) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -393,17 +370,14 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (bot-method-223 self #f) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 131072.0 (seconds 0.05)) (nav-enemy-simple-post) - (none) ) ) @@ -423,11 +397,9 @@ (react-to-focus self) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) @@ -444,7 +416,6 @@ 0 (nav-enemy-method-167 self) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) @@ -461,7 +432,6 @@ (set! (-> self travel-anim-interp) 0.0) (set! (-> self next-fire-time) 0) 0 - (none) ) :code (the-as (function none :behavior ruffian) nothing) ) @@ -482,7 +452,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type bot knocked) trans))) @@ -494,7 +463,6 @@ (logclear! (-> self bot-flags) (bot-flags bf24)) (ruffian-method-242 self) ) - (none) ) ) @@ -507,7 +475,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) ) @@ -520,7 +487,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (the-as (function none :behavior ruffian) nothing) ) @@ -542,7 +508,6 @@ 0 (stop-looking-at-target! self) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -557,7 +522,6 @@ (react-to-focus self) ) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) diff --git a/goal_src/jak2/levels/common/ai/sig/sig-states.gc b/goal_src/jak2/levels/common/ai/sig/sig-states.gc index 7925480bf84..c12610a5481 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig-states.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig-states.gc @@ -27,7 +27,6 @@ (set! (-> self travel-anim-interp) 0.0) (logclear! (-> self enemy-flags) (enemy-flag enable-on-active)) (logior! (-> self focus-status) (focus-status disable)) - (none) ) :exit (behavior () (local-vars (v1-1 enemy-flag)) @@ -39,7 +38,6 @@ ) (set! (-> self enemy-flags) v1-1) (logclear! (-> self focus-status) (focus-status disable)) - (none) ) :trans (behavior () (if (and (not (focus-test? self grabbed)) @@ -47,7 +45,6 @@ ) (go-virtual traveling) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -62,7 +59,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -85,7 +81,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -118,7 +113,6 @@ ) (go-virtual waiting-close) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -165,7 +159,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -188,7 +181,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -222,7 +214,6 @@ ) (go-virtual waiting-far) ) - (none) ) :code (behavior () (let* ((v1-2 (ja-group)) @@ -296,7 +287,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -319,7 +309,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -339,7 +328,6 @@ ) ) ) - (none) ) :code (behavior () (local-vars (s4-1 art-element) (f0-19 float)) @@ -487,7 +475,6 @@ ) ) (go-virtual waiting-close) - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -512,12 +499,10 @@ (set! (-> self travel-anim-interp) 0.0) (logclear! (-> self plasma flags) (plasma-flags pf02 pf03 pf04)) (logclear! (-> self bot-flags) (bot-flags bf11)) - (none) ) :exit (behavior () (logclear! (-> self plasma flags) (plasma-flags pf01 pf02 pf03)) (logior! (-> self bot-flags) (bot-flags bf11)) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -538,7 +523,6 @@ (logior! (-> self plasma flags) (plasma-flags pf02)) (logclear! (-> self plasma flags) (plasma-flags pf02)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.15)) @@ -594,12 +578,10 @@ ) ) #f - (none) ) :post (behavior () (logclear! (-> self plasma flags) (plasma-flags pf03)) (nav-enemy-simple-post) - (none) ) ) @@ -617,11 +599,9 @@ (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) (logclear! (-> self bot-flags) (bot-flags bf11)) - (none) ) :exit (behavior () (logior! (-> self bot-flags) (bot-flags bf11)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -639,7 +619,6 @@ (ja-eval) ) (go-virtual repair-gun) - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -666,11 +645,9 @@ (reset-attacker! self) ) (logclear! (-> self bot-flags) (bot-flags bf11)) - (none) ) :exit (behavior () (logior! (-> self bot-flags) (bot-flags bf11)) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -683,7 +660,6 @@ (set! (-> self played-unjam-time) (current-time)) (sound-play "sig-gun-unjam") ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -822,7 +798,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -849,11 +824,9 @@ (reset-attacker! self) ) (logclear! (-> self bot-flags) (bot-flags bf11)) - (none) ) :exit (behavior () (logior! (-> self bot-flags) (bot-flags bf11)) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -867,7 +840,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.15)) @@ -930,7 +902,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -956,7 +927,6 @@ (nav-enemy-method-166 self) (set! (-> self skel top-anim interp) 1.0) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -981,7 +951,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -989,7 +958,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1001,7 +969,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -1023,7 +990,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -1041,7 +1007,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.3)) @@ -1056,7 +1021,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -1075,7 +1039,6 @@ 0 (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -1102,7 +1065,6 @@ ) ) ) - (none) ) :code (behavior () (let* ((v1-2 (ja-group)) @@ -1176,7 +1138,6 @@ ) ) #f - (none) ) ) @@ -1201,7 +1162,6 @@ ) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1210,11 +1170,9 @@ (logclear! (-> self focus-status) (focus-status dangerous)) ) (enemy-method-46 self 0) - (none) ) :trans (behavior () (bot-method-223 self #f) - (none) ) :code (behavior () (local-vars (a1-2 art-element)) @@ -1256,12 +1214,10 @@ (reset-attacker! self) ) (react-to-focus self) - (none) ) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 131072.0 (seconds 0.05)) (nav-enemy-simple-post) - (none) ) ) @@ -1282,11 +1238,9 @@ ) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :code (behavior () (local-vars (gp-0 art-element)) @@ -1337,7 +1291,6 @@ (reset-attacker! self) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -1348,7 +1301,6 @@ :enter (behavior () ((-> (method-of-type nav-enemy hostile) enter)) (set! (-> self skel top-anim interp) 1.0) - (none) ) :trans (behavior () (bot-method-223 self #t) @@ -1374,7 +1326,6 @@ (go-virtual chase-attack) ) ) - (none) ) :code (behavior () (until #f @@ -1382,7 +1333,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((gp-0 (-> self nav state)) @@ -1394,7 +1344,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -1408,11 +1357,9 @@ (go-virtual traveling) ) (logior! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :code (behavior () (push-anim-to-targ @@ -1463,7 +1410,6 @@ (reset-attacker! self) ) (go-virtual chase) - (none) ) :post (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -1479,7 +1425,6 @@ ) ) (nav-enemy-travel-post) - (none) ) ) @@ -1493,7 +1438,6 @@ ) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () (local-vars (v1-31 enemy-flag) (v1-39 enemy-flag)) @@ -1531,7 +1475,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -1549,7 +1492,6 @@ (if (logtest? (bot-flags bf19 bf20) (-> self bot-flags)) (logclear! (-> self bot-flags) (bot-flags bf12)) ) - (none) ) ) @@ -1565,7 +1507,6 @@ (set! (-> self travel-anim-interp) 0.0) (set! (-> self skel top-anim interp) 0.0) (play-death-sound self "sigt093") - (none) ) ) @@ -1580,7 +1521,6 @@ (sig-plasma-method-11 (-> self plasma) #f) (set! (-> self travel-anim-interp) 0.0) (set! (-> self skel top-anim interp) 0.0) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1620,7 +1560,6 @@ ) ) #f - (none) ) ) @@ -1642,7 +1581,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) @@ -1662,7 +1600,6 @@ (if (sig-method-257 self) (go-virtual sig-path-idle) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -1681,7 +1618,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -1705,7 +1641,6 @@ (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) (logior! (-> self bot-flags) (bot-flags bf24)) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) @@ -1730,7 +1665,6 @@ (quaternion-copy! (-> v1-27 quat) (-> gp-0 quat)) ) ) - (none) ) :code (behavior () (let ((f30-0 0.0)) @@ -1753,7 +1687,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -1776,7 +1709,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) @@ -1798,7 +1730,6 @@ (quaternion-copy! (-> v1-18 quat) (-> gp-0 quat)) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.15)) @@ -1822,7 +1753,6 @@ ) ) (go-virtual sig-path-run) - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -1847,7 +1777,6 @@ (set! (-> self travel-anim-interp) 0.0) (logior! (-> self bot-flags) (bot-flags bf24)) (logclear! (-> self bot-flags) (bot-flags bf25)) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) @@ -1872,7 +1801,6 @@ (quaternion-copy! (-> v1-29 quat) (-> gp-0 quat)) ) ) - (none) ) :code (behavior () (let ((f30-0 0.0)) @@ -1900,7 +1828,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -1923,7 +1850,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) @@ -1945,7 +1871,6 @@ (quaternion-copy! (-> v1-18 quat) (-> gp-0 quat)) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.15)) @@ -1969,7 +1894,6 @@ ) ) (go-virtual sig-path-run) - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -1993,7 +1917,6 @@ (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) (vector-reset! (-> self root transv)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.15)) @@ -2016,7 +1939,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) diff --git a/goal_src/jak2/levels/common/ai/sig/sig.gc b/goal_src/jak2/levels/common/ai/sig/sig.gc index 40746756950..603e51c8461 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig.gc @@ -349,31 +349,23 @@ ) ) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 33] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 38] (defmethod general-event-handler sig ((obj sig) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'untrigger) - (sig-plasma-method-11 (-> obj plasma) #t) - ) - ((= v1-0 'sig-path) - (when (and (not (focus-test? obj dead)) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) - (let ((a1-2 (-> arg3 param 0))) - (sig-method-249 obj (the-as sig-path a1-2)) - ) - (go (method-of-object obj sig-path-run)) - ) + (case arg2 + (('untrigger) + (sig-plasma-method-11 (-> obj plasma) #t) + ) + (('sig-path) + (when (and (not (focus-test? obj dead)) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) + (let ((a1-2 (-> arg3 param 0))) + (sig-method-249 obj (the-as sig-path a1-2)) ) - (else - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) + (go (method-of-object obj sig-path-run)) + ) + ) + (else + ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) ) ) ) @@ -715,7 +707,6 @@ (go (method-of-object obj chase)) ) ) - (none) ) (defmethod react-to-focus sig ((obj sig)) @@ -746,7 +737,6 @@ (go (method-of-object obj waiting-close)) ) ) - (none) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/common/airlock.gc b/goal_src/jak2/levels/common/airlock.gc index 2d5caaa3ae2..66a53c29169 100644 --- a/goal_src/jak2/levels/common/airlock.gc +++ b/goal_src/jak2/levels/common/airlock.gc @@ -351,66 +351,62 @@ (defstate close (com-airlock) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('close) - (set! (-> self latch-closed-time) (+ (current-time) (if (>= arg1 1) - (the-as int (-> event param 0)) - 3000 - ) - ) - ) - (if (and (>= arg1 2) (and (= (-> event param 1) #t) (not (want-cross-airlock? self)))) - (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) :num! min) - ) - (and (-> self next-state) (= (-> self next-state name) 'open)) - ) - (('open) - (set! (-> self latch-open-time) (+ (current-time) (if (>= arg1 1) - (the-as int (-> event param 0)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('close) + (set! (-> self latch-closed-time) (+ (current-time) (if (>= argc 1) + (the-as int (-> block param 0)) 3000 ) ) - ) - (if (and (>= arg1 2) (and (= (-> event param 1) #t) (want-cross-airlock? self) (destination-loaded? self #f))) - (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) - :num! (identity - (the float (+ (-> (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) frames num-frames) -1)) - ) - ) ) - (and (-> self next-state) (= (-> self next-state name) 'close)) - ) - (('front) - (let ((f30-0 (check-crossing-distance self (target-pos 0) #f)) - (f0-3 (check-crossing-distance self (camera-pos) #f)) - ) - (and (< 2048.0 f30-0) (>= (* f30-0 f0-3) 0.0)) + (if (and (>= argc 2) (and (= (-> block param 1) #t) (not (want-cross-airlock? self)))) + (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) :num! min) ) - ) - (('back) - (let ((f30-1 (check-crossing-distance self (target-pos 0) #f)) - (f0-5 (check-crossing-distance self (camera-pos) #f)) + (and (-> self next-state) (= (-> self next-state name) 'open)) + ) + (('open) + (set! (-> self latch-open-time) (+ (current-time) (if (>= argc 1) + (the-as int (-> block param 0)) + 3000 + ) + ) + ) + (if (and (>= argc 2) (and (= (-> block param 1) #t) (want-cross-airlock? self) (destination-loaded? self #f))) + (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) + :num! (identity + (the float (+ (-> (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) frames num-frames) -1)) + ) ) - (and (< f30-1 -2048.0) (>= (* f30-1 f0-5) 0.0)) ) - ) - (('sound) - (if (>= (check-crossing-distance self (target-pos 0) #f) 0.0) - (the-as object (play-city-voice-sound self (the-as symbol (-> event param 0)))) + (and (-> self next-state) (= (-> self next-state name) 'close)) + ) + (('front) + (let ((f30-0 (check-crossing-distance self (target-pos 0) #f)) + (f0-3 (check-crossing-distance self (camera-pos) #f)) ) + (and (< 2048.0 f30-0) (>= (* f30-0 f0-3) 0.0)) ) - (('distance) - (* (the int (check-crossing-distance self (target-pos 0) #f)) 8) + ) + (('back) + (let ((f30-1 (check-crossing-distance self (target-pos 0) #f)) + (f0-5 (check-crossing-distance self (camera-pos) #f)) + ) + (and (< f30-1 -2048.0) (>= (* f30-1 f0-5) 0.0)) ) - ) + ) + (('sound) + (if (>= (check-crossing-distance self (target-pos 0) #f) 0.0) + (play-city-voice-sound self (the-as symbol (-> block param 0))) + ) + ) + (('distance) + (* (the int (check-crossing-distance self (target-pos 0) #f)) 8) + ) ) ) :enter (behavior ((arg0 symbol)) (set! (-> self visible-move?) #f) - (none) ) :exit (behavior () (when (nonzero? (-> self sound-id)) @@ -439,7 +435,6 @@ (set! (-> self gear-sound-id) (new 'static 'sound-id)) 0 ) - (none) ) :trans (behavior () (if (logtest? (-> self draw status) (draw-control-status on-screen)) @@ -469,7 +464,6 @@ ) (go-virtual open #f) ) - (none) ) :code (behavior ((arg0 symbol)) (process-entity-status! self (entity-perm-status subtask-complete) #f) @@ -606,7 +600,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -615,7 +608,6 @@ :event (-> (method-of-type com-airlock close) event) :enter (behavior ((arg0 symbol)) (set! (-> self visible-move?) #f) - (none) ) :exit (-> (method-of-type com-airlock close) exit) :trans (behavior () @@ -635,7 +627,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol)) (when (not arg0) @@ -781,7 +772,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) diff --git a/goal_src/jak2/levels/common/battle.gc b/goal_src/jak2/levels/common/battle.gc index c09a862a8a2..f39273077a9 100644 --- a/goal_src/jak2/levels/common/battle.gc +++ b/goal_src/jak2/levels/common/battle.gc @@ -1355,7 +1355,6 @@ (spawn-initial-creatures self) ) (unset-battle-music self) - (none) ) :trans (behavior () (let ((v1-1 (-> self info notice-spec))) @@ -1380,7 +1379,6 @@ (if *display-battle-marks* (draw-battle-marks self) ) - (none) ) :code (the-as (function none :behavior battle) sleep-code) ) @@ -1403,17 +1401,14 @@ (go-virtual hostile) ) (logior! (-> self flags) (battle-flags noticed)) - (none) ) :trans (behavior () (if *display-battle-marks* (draw-battle-marks self) ) - (none) ) :code (behavior () (go-virtual hostile) - (none) ) ) @@ -1533,7 +1528,6 @@ (script-eval (the-as pair gp-0) :vector (-> self root trans)) ) ) - (none) ) :trans (behavior () (if (beaten? self) @@ -1542,7 +1536,6 @@ (if *display-battle-marks* (draw-battle-marks self) ) - (none) ) :code (the-as (function none :behavior battle) sleep-code) ) @@ -1558,7 +1551,6 @@ ) ) (unset-battle-music self) - (none) ) :code (the-as (function none :behavior battle) sleep-code) ) diff --git a/goal_src/jak2/levels/common/elec-gate.gc b/goal_src/jak2/levels/common/elec-gate.gc index c2958be746c..165c7c68b0c 100644 --- a/goal_src/jak2/levels/common/elec-gate.gc +++ b/goal_src/jak2/levels/common/elec-gate.gc @@ -172,8 +172,8 @@ (defstate idle (elec-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual active) ) @@ -232,7 +232,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior elec-gate) sleep-code) :post (behavior () @@ -240,14 +239,13 @@ (if (nonzero? (-> self part-off)) (spawn-particles self (-> self part-off)) ) - (none) ) ) (defstate active (elec-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('shutdown) (go-virtual shutdown) ) @@ -337,7 +335,6 @@ (blocking-plane-spawn (the-as curve-control #f) vec-pair f0-6) ) ) - (none) ) :trans (behavior () (local-vars @@ -609,7 +606,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior elec-gate) sleep-code) :post (behavior () @@ -619,7 +615,6 @@ ) (update! (-> self sound)) (elec-gate-post) - (none) ) ) @@ -633,7 +628,6 @@ (if (-> self on-stop) (script-eval (-> self on-stop) :vector (-> self root trans)) ) - (none) ) :trans (behavior () (let ((go-idle? #t)) @@ -705,7 +699,6 @@ (go-virtual idle) ) ) - (none) ) :code (the-as (function none :behavior elec-gate) sleep-code) :post (behavior () @@ -714,7 +707,6 @@ (spawn-particles self (-> self part-off)) ) (elec-gate-post) - (none) ) ) diff --git a/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc b/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc index e8daeddee01..7ada7121a16 100644 --- a/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc +++ b/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc @@ -419,6 +419,7 @@ f0-1 ) +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-52 amphibian ((obj amphibian) (arg0 vector)) (cond ((and (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time)) (!= (-> obj incoming knocked-type) 6)) @@ -845,10 +846,8 @@ ) ) ) - (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-hostile amphibian ((obj amphibian)) (let* ((s4-0 (handle->process (-> obj attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) @@ -865,7 +864,6 @@ ) ) (go (method-of-object obj hostile)) - (none) ) (defmethod track-target! amphibian ((obj amphibian)) @@ -1089,7 +1087,6 @@ ) ) #f - (none) ) ) @@ -1117,7 +1114,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1146,7 +1142,6 @@ ) 0 (react-to-focus self) - (none) ) ) @@ -1159,7 +1154,6 @@ (suspend) ) #f - (none) ) ) @@ -1171,7 +1165,6 @@ (suspend) ) #f - (none) ) ) @@ -1183,7 +1176,6 @@ (suspend) ) #f - (none) ) ) @@ -1226,7 +1218,6 @@ ) ) ) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy stare) exit))) @@ -1235,14 +1226,12 @@ ) ) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "amphib-hit") ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.07)) @@ -1296,7 +1285,6 @@ (ja-eval) ) (go-virtual stare-idle) - (none) ) ) @@ -1309,7 +1297,6 @@ (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (-> (method-of-type nav-enemy stare) exit) :trans (-> (method-of-type nav-enemy stare) trans) @@ -1328,7 +1315,6 @@ ) ) (go-virtual stare) - (none) ) :post (the-as (function none :behavior amphibian) nav-enemy-stare-post) ) @@ -1368,7 +1354,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -1376,7 +1361,6 @@ (suspend) ) #f - (none) ) ) @@ -1408,7 +1392,6 @@ ) (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) ) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1416,14 +1399,12 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "amphib-hit") ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.07)) @@ -1436,7 +1417,6 @@ (ja :num! (seek!)) ) (go-virtual attack-forward-lunge) - (none) ) :post (the-as (function none :behavior amphibian) nav-enemy-simple-post) ) @@ -1467,7 +1447,6 @@ ) 0 (logior! (-> self focus-status) (focus-status dangerous)) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1475,14 +1454,12 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "amphib-hit") ) - (none) ) :code (behavior () (until (>= (ja-aframe-num 0) (ja-aframe 8.0 0)) @@ -1490,7 +1467,6 @@ (ja :num! (seek!)) ) (go-virtual attack-forward-end) - (none) ) :post (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -1507,7 +1483,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -1523,7 +1498,6 @@ ) 0 (nav-enemy-method-167 self) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1531,14 +1505,12 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "amphib-hit") ) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -1547,7 +1519,6 @@ (ja-eval) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior amphibian) nav-enemy-simple-post) ) @@ -1584,7 +1555,6 @@ ) (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) ) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1592,14 +1562,12 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "amphib-hit") ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.07)) @@ -1658,7 +1626,6 @@ (ja-eval) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior amphibian) nav-enemy-simple-post) ) @@ -1684,12 +1651,10 @@ (set! (-> self tongue-mod max-length) (-> gp-1 max-length)) (set! (-> self tongue-mod target quad) (-> gp-1 clamped-pos quad)) ) - (none) ) :exit (behavior () (set! (-> self draw bounds w) 22528.0) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (let ((v1-0 (-> self tongue-mode))) @@ -1739,7 +1704,6 @@ (set! (-> self draw bounds w) 22528.0) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.7)) @@ -1752,7 +1716,6 @@ (ja :num! (seek!)) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior amphibian) nav-enemy-simple-post) ) diff --git a/goal_src/jak2/levels/common/enemy/bouncer.gc b/goal_src/jak2/levels/common/enemy/bouncer.gc index 05136000cf3..3ea0506c33d 100644 --- a/goal_src/jak2/levels/common/enemy/bouncer.gc +++ b/goal_src/jak2/levels/common/enemy/bouncer.gc @@ -32,93 +32,89 @@ (defstate idle (bouncer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('bonk) - (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) - (the-as collide-shape (-> self root)) - (the-as uint 1) - ) - (when (send-event proc 'jump (-> self spring-height) (-> self spring-height) (-> self mods)) - (sound-play "trampoline") - (go-virtual fire) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape (-> self root)) + (the-as uint 1) + ) + (when (send-event proc 'jump (-> self spring-height) (-> self spring-height) (-> self mods)) + (sound-play "trampoline") + (go-virtual fire) ) ) - (('touch) - (let ((gp-2 (-> event param 0))) - (cond - (((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry gp-2) - (the-as collide-shape (-> self root)) - (collide-action solid) - (collide-action) - ) - (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry gp-2) - (the-as collide-shape (-> self root)) - (the-as uint 1) - ) - (if (not (and (-> self next-state) (let ((v1-21 (-> self next-state name))) - (or (= v1-21 'smush) (= v1-21 'fire)) - ) - ) - ) - (go-virtual smush) - ) - ) - ) - (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry gp-2) - (the-as collide-shape (-> self root)) - (the-as uint 4) - ) - (the-as object (persist-with-delay - *setting-control* - (the-as symbol (process->ppointer self)) - (seconds 0.05) - 'double-jump - #f - 0.0 - 0 - ) - ) + ) + (('touch) + (let ((gp-2 (-> block param 0))) + (cond + (((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry gp-2) + (the-as collide-shape (-> self root)) + (collide-action solid) + (collide-action) + ) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry gp-2) + (the-as collide-shape (-> self root)) + (the-as uint 1) + ) + (if (not (and (-> self next-state) (let ((v1-21 (-> self next-state name))) + (or (= v1-21 'smush) (= v1-21 'fire)) + ) + ) + ) + (go-virtual smush) + ) ) + ) + (((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry gp-2) + (the-as collide-shape (-> self root)) + (the-as uint 4) ) + (persist-with-delay + *setting-control* + (the-as symbol (process->ppointer self)) + (seconds 0.05) + 'double-jump + #f + 0.0 + 0 + ) + ) ) ) - (('attack) - (let ((v1-28 (the-as object (-> event param 1))) - (a0-17 (-> event param 0)) - (a2-7 0) - ) - (cond - ((= (-> (the-as attack-info v1-28) mode) 'flop) - (set! a2-7 1) - ) - ((= (-> (the-as attack-info v1-28) mode) 'board) - (set! a2-7 9) - ) - ) - (when (and (nonzero? a2-7) - (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry a0-17) - (the-as collide-shape (-> self root)) - (the-as uint a2-7) - ) - (send-event proc 'jump (-> self spring-height) (-> self spring-height) (-> self mods)) - ) - ) - (sound-play "trampoline") - (go-virtual fire) - #f + ) + (('attack) + (let ((v1-28 (the-as object (-> block param 1))) + (a0-17 (-> block param 0)) + (a2-7 0) ) + (cond + ((= (-> (the-as attack-info v1-28) mode) 'flop) + (set! a2-7 1) + ) + ((= (-> (the-as attack-info v1-28) mode) 'board) + (set! a2-7 9) + ) + ) + (when (and (nonzero? a2-7) + (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry a0-17) + (the-as collide-shape (-> self root)) + (the-as uint a2-7) + ) + (send-event proc 'jump (-> self spring-height) (-> self spring-height) (-> self mods)) + ) + ) + (sound-play "trampoline") + (go-virtual fire) + #f ) ) - ) + ) ) ) :code (behavior () @@ -129,20 +125,19 @@ (suspend) ) #f - (none) ) ) (defstate smush (bouncer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (set! (-> self state-time) (current-time)) #f ) (else - ((-> (method-of-object self idle) event) proc arg1 event-type event) + ((-> (method-of-object self idle) event) proc argc message block) ) ) ) @@ -170,7 +165,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior bouncer) transform-post) ) @@ -190,7 +184,6 @@ (ja :num! (seek!)) ) (go-virtual idle) - (none) ) :post (the-as (function none :behavior bouncer) transform-post) ) diff --git a/goal_src/jak2/levels/common/enemy/centurion.gc b/goal_src/jak2/levels/common/enemy/centurion.gc index 3c925a76f1e..a24f1d043e7 100644 --- a/goal_src/jak2/levels/common/enemy/centurion.gc +++ b/goal_src/jak2/levels/common/enemy/centurion.gc @@ -597,7 +597,6 @@ (centurion-shield-little) (set! (-> self victory-sound) (new 'static 'sound-id)) 0 - (none) ) :exit (behavior () (if (nonzero? (-> self victory-sound)) @@ -611,7 +610,6 @@ (set! (-> self root root-prim specific 0) (-> self root root-prim specific 1)) (set! (-> self can-take-damage?) #f) (centurion-shield-big) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -638,16 +636,13 @@ (react-to-focus self) (set! (-> self victory-sound) (new 'static 'sound-id)) 0 - (none) ) ) -;; WARN: Return type mismatch object vs none. (defmethod go-stare centurion ((obj centurion)) (if (not (and (-> obj next-state) (= (-> obj next-state name) 'hostile))) (go (method-of-object obj hostile)) ) - (none) ) (defstate active (centurion) @@ -658,7 +653,6 @@ (t9-0) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -675,7 +669,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior centurion) nav-enemy-simple-post) ) @@ -776,7 +769,6 @@ (set! (-> v1-8 attack-id) v0-1) (set! (-> self attack-id) v0-1) ) - (none) ) :exit (behavior () (set! (-> self first-shoot?) #f) @@ -787,7 +779,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (let ((f30-0 1.0)) @@ -870,7 +861,6 @@ ) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior centurion) enemy-simple-post) ) @@ -890,7 +880,6 @@ (set! (-> v1-7 attack-id) v0-0) (set! (-> self attack-id) v0-0) ) - (none) ) :exit (behavior () (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3 prim-core action) @@ -901,7 +890,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -914,7 +902,6 @@ (ja :num! (seek!)) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior centurion) enemy-simple-post) ) @@ -1137,7 +1124,6 @@ (nav-enemy-method-165 self) (set! (-> self joint-enable) #t) (set! (-> self can-shoot?) (the-as basic #t)) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) @@ -1145,7 +1131,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (rlet ((acc :class vf) @@ -1203,7 +1188,6 @@ ) ) ) - (none) ) ) :code (behavior () @@ -1309,7 +1293,6 @@ #f ) #f - (none) ) :post (the-as (function none :behavior centurion) nav-enemy-travel-post) ) diff --git a/goal_src/jak2/levels/common/enemy/flitter.gc b/goal_src/jak2/levels/common/enemy/flitter.gc index 0f223f6a977..ed35e83fbba 100644 --- a/goal_src/jak2/levels/common/enemy/flitter.gc +++ b/goal_src/jak2/levels/common/enemy/flitter.gc @@ -609,7 +609,6 @@ ) ) -;; WARN: Return type mismatch object vs none. (defmethod go-stare2 flitter ((obj flitter)) (if (and (= (-> obj focus aware) (enemy-aware enemy-aware-2)) (not (nav-enemy-method-163 obj)) @@ -618,7 +617,6 @@ (go (method-of-object obj pacing)) (go (method-of-object obj stare)) ) - (none) ) (defstate ambush (flitter) @@ -639,7 +637,6 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (behavior () (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) @@ -706,7 +703,6 @@ ) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) - (none) ) ) @@ -732,7 +728,6 @@ (vector-reset! (-> gp-0 transv)) (set! (-> gp-0 transv y) (* 4096.0 (get-rand-float-range self 34.0 38.0))) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -826,7 +821,6 @@ #f (label cfg-33) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior flitter) nav-enemy-falling-post) ) @@ -953,7 +947,6 @@ ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -1005,7 +998,6 @@ ) ) #f - (none) ) :post (behavior () (flitter-method-181 self) @@ -1014,7 +1006,6 @@ ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -1027,7 +1018,6 @@ ) ) (set! (-> self off-screen-timer) (the-as uint (current-time))) - (none) ) :trans (behavior () (let ((gp-0 (handle->process (-> self focus handle)))) @@ -1073,7 +1063,6 @@ ) ) ) - (none) ) :code (behavior () (nav-enemy-method-166 self) @@ -1096,7 +1085,6 @@ ) ) #f - (none) ) ) @@ -1111,7 +1099,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -1120,7 +1107,6 @@ ) ) (flitter-method-180 self) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1132,7 +1118,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -1145,7 +1130,6 @@ (t9-2) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1156,7 +1140,6 @@ ) (send-event self 'death-end) (cleanup-for-death self) - (none) ) ) @@ -1186,17 +1169,15 @@ (set! (-> v1-8 attack-id) v0-2) (set! (-> self attack-id) v0-2) ) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () - (local-vars (s5-2 none)) + (local-vars (s5-2 object)) (let* ((s5-0 (handle->process (-> self focus handle))) (gp-0 (if (type? s5-0 process-focusable) (the-as process-focusable s5-0) @@ -1217,7 +1198,7 @@ (set! (-> s5-1 target-post quad) (-> v1-10 quad)) ) 0 - (set! s5-2 (the-as none (-> self attack-pos))) + (set! s5-2 (-> self attack-pos)) (set! (-> (the-as vector s5-2) quad) (-> (get-trans gp-0 3) quad)) s5-2 ) @@ -1227,7 +1208,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 2 (seconds 0.1)) @@ -1277,7 +1257,6 @@ ) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior flitter) nav-enemy-travel-post) ) @@ -1287,7 +1266,6 @@ :post (behavior () (flitter-method-181 self) (nav-enemy-simple-post) - (none) ) ) diff --git a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc index 43ad47d40fb..38a831342e7 100644 --- a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc +++ b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc @@ -325,6 +325,7 @@ ) ) +;; WARN: Return type mismatch object vs none. (defmethod track-target! fodder ((obj fodder)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn @@ -383,7 +384,6 @@ ) ) (update-transforms (-> self root)) - (none) ) ) @@ -396,7 +396,6 @@ ) ) (logclear! (-> self enemy-flags) (enemy-flag spawn-gem chase-startup use-notice-distance)) - (none) ) :code (behavior () (let ((f30-0 (get-rand-float-range self 0.9 1.1))) @@ -479,7 +478,6 @@ ) ) #f - (none) ) ) @@ -576,7 +574,6 @@ ) ) ) - (none) ) ) @@ -619,7 +616,6 @@ (set! (-> self slow-timer) 0) (set! (-> self fast-timer) 0) 0 - (none) ) :exit (behavior () (let ((v1-0 (-> self nav))) @@ -635,7 +631,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -798,7 +793,6 @@ ) ) ) - (none) ) :code (behavior () (fodder-method-182 self) @@ -814,7 +808,6 @@ ) ) #f - (none) ) ) @@ -827,7 +820,6 @@ ) ) (sound-play "fodder-bite" :position (-> self root trans)) - (none) ) ) @@ -926,7 +918,6 @@ ) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/common/enemy/grenadier.gc b/goal_src/jak2/levels/common/enemy/grenadier.gc index c0ee8a5937e..aa5fb5f2176 100644 --- a/goal_src/jak2/levels/common/enemy/grenadier.gc +++ b/goal_src/jak2/levels/common/enemy/grenadier.gc @@ -498,7 +498,6 @@ ) ) #f - (none) ) ) @@ -511,7 +510,6 @@ ) ) (vector-reset! (-> self root transv)) - (none) ) ) @@ -526,7 +524,6 @@ (grenadier-method-181 self) (look-at-target! self (enemy-flag death-start)) (logclear! (-> self status-flags) (grenadier-flags grflags-0)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -583,7 +580,6 @@ (go-stare self) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -611,7 +607,6 @@ ) ) #f - (none) ) :post (behavior () (let ((gp-0 (-> self bank))) @@ -628,7 +623,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -645,7 +639,6 @@ (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) ) 0 - (none) ) :trans (behavior () (let ((f0-0 (vector-vector-xz-distance (-> self root trans) (-> self move-pos)))) @@ -653,7 +646,6 @@ (go-hostile self) ) ) - (none) ) :code (behavior () (until #f @@ -667,7 +659,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -679,7 +670,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -708,7 +698,6 @@ (set! (-> v1-13 prim-core action) (collide-action deadly)) (set! (-> v1-13 local-sphere w) 7372.8) ) - (none) ) :exit (behavior () (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1))) @@ -719,7 +708,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.135)) @@ -732,7 +720,6 @@ (ja :num! (seek!)) ) (go-hostile self) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -750,7 +737,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -807,8 +793,8 @@ (defstate attack (grenadier) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('event-attack) (let ((s4-0 (handle->process (-> self focus handle)))) (when s4-0 @@ -853,7 +839,7 @@ ) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) @@ -886,7 +872,6 @@ (set! (-> self attack-id) a0-19) ) (look-at-target! self (enemy-flag lock-focus)) - (none) ) :exit (behavior () (if (logtest? (enemy-flag enemy-flag43) (-> self enemy-flags)) @@ -898,7 +883,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (let ((f30-0 (get-rand-float-range self 0.9 1.1))) @@ -1015,7 +999,6 @@ ) ) (go-hostile self) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -1033,7 +1016,6 @@ ) ) (nav-enemy-travel-post) - (none) ) ) @@ -1120,7 +1102,6 @@ (go-stare self) ) ) - (none) ) ) @@ -1137,7 +1118,6 @@ (go (method-of-object obj attack)) ) ((method-of-type nav-enemy go-hostile) obj) - (none) ) (defstate victory (grenadier) @@ -1169,7 +1149,6 @@ ) ) (react-to-focus self) - (none) ) ) diff --git a/goal_src/jak2/levels/common/enemy/grunt.gc b/goal_src/jak2/levels/common/enemy/grunt.gc index d05e6c7e6f2..9ec63c1562f 100644 --- a/goal_src/jak2/levels/common/enemy/grunt.gc +++ b/goal_src/jak2/levels/common/enemy/grunt.gc @@ -409,7 +409,6 @@ (go-hostile obj) ) ) - (none) ) (defstate falling-ambush (grunt) @@ -451,14 +450,12 @@ (set! (-> v1-19 prim-core collide-with) (collide-spec)) ) 0 - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -491,11 +488,11 @@ (suspend) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior grunt) nav-enemy-falling-post) ) +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-93 grunt ((obj grunt)) (case (-> obj jump-why) ((2) @@ -518,7 +515,6 @@ (go-virtual notice) ) (get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp) - (none) ) :code (behavior () (set! (-> self unknown-byte-1ji2n3) 1) @@ -540,7 +536,6 @@ (suspend) ) #f - (none) ) ) @@ -574,7 +569,6 @@ (suspend) ) #f - (none) ) ) @@ -708,7 +702,6 @@ ) ) #f - (none) ) ) @@ -786,7 +779,6 @@ ) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -838,7 +830,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior grunt) nav-enemy-chase-post) ) @@ -861,7 +852,6 @@ (set! (-> v1-10 attack-id) v0-1) (set! (-> self attack-id) v0-1) ) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -869,7 +859,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (enemy-method-49 self) @@ -877,7 +866,6 @@ (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "grunt-hit") ) - (none) ) :code (behavior () (set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (get-rand-int self 2))) @@ -940,7 +928,6 @@ (set! (-> self unknown-byte-n1k2n3) v1-57) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior grunt) nav-enemy-chase-post) ) @@ -973,7 +960,6 @@ (set! (-> v1-21 attack-id) v0-3) (set! (-> self attack-id) v0-3) ) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -981,14 +967,12 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "grunt-hit") ) - (none) ) :code (behavior () (set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (get-rand-int self 2))) @@ -1021,7 +1005,6 @@ ) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior grunt) nav-enemy-simple-post) ) @@ -1128,7 +1111,6 @@ ) ) #f - (none) ) ) @@ -1193,7 +1175,6 @@ ) ) #f - (none) ) ) @@ -1230,7 +1211,6 @@ ) ) #f - (none) ) ) @@ -1472,7 +1452,6 @@ ) ) ) - (none) ) :code (-> (method-of-type nav-enemy idle) code) :post (-> (method-of-type nav-enemy idle) post) diff --git a/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc b/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc index 83e18860325..ed8a75668ed 100644 --- a/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc +++ b/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc @@ -1062,7 +1062,6 @@ ) ) ) - (none) ) (defstate active (crimson-guard-level) @@ -1085,7 +1084,6 @@ ) 0 ) - (none) ) ) @@ -1113,65 +1111,60 @@ ) ) ) - (none) ) ) -;; WARN: Return type mismatch none vs object. (defmethod general-event-handler crimson-guard-level ((obj crimson-guard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'event-death) - (when (<= (-> obj hit-points) 0) - (set! (-> obj root penetrated-by) (the-as penetrate -1)) - (the-as object (do-effect (-> obj skel effect) 'death-default 0.0 -1)) - ) - ) - ((or (= v1-0 'hit) (= v1-0 'hit-flinch) (= v1-0 'hit-knocked)) - (speech-control-method-13 *speech-control* (the-as handle obj)) - (let* ((s1-0 (handle->process (-> obj incoming attacker-handle))) - (a0-13 (if (type? s1-0 process-focusable) - s1-0 - ) - ) - ) - (if (and a0-13 (logtest? (-> a0-13 mask) (process-mask target))) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-11)) - ) - ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ((= v1-0 'trigger) - (let ((v0-0 (the-as object #t))) - (set! (-> obj trigger) (the-as symbol v0-0)) - v0-0 - ) - ) - ((= v1-0 'untrigger) - (set! (-> obj trigger) #f) - #f - ) - ((= v1-0 'notify) - (let ((a0-21 (-> arg3 param 0)) - (v1-16 (the-as object (-> arg3 param 1))) - ) - (when (= a0-21 'attack) - (when (logtest? (-> (the-as process-focusable v1-16) mask) (process-mask target)) - (if (focus-test? (the-as process-focusable v1-16) dead) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-10)) - ) - ) - ) - ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + (case arg2 + (('event-death) + (when (<= (-> obj hit-points) 0) + (set! (-> obj root penetrated-by) (the-as penetrate -1)) + (do-effect (-> obj skel effect) 'death-default 0.0 -1) + ) + ) + (('hit 'hit-flinch 'hit-knocked) + (speech-control-method-13 *speech-control* (the-as handle obj)) + (let* ((s1-0 (handle->process (-> obj incoming attacker-handle))) + (a0-13 (if (type? s1-0 process-focusable) + s1-0 ) - ) + ) ) + (if (and a0-13 (logtest? (-> a0-13 mask) (process-mask target))) + (speech-control-method-12 *speech-control* obj (speech-type speech-type-11)) + ) + ) + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (('trigger) + (let ((v0-0 (the-as object #t))) + (set! (-> obj trigger) (the-as symbol v0-0)) + v0-0 + ) + ) + (('untrigger) + (set! (-> obj trigger) #f) + #f + ) + (('notify) + (let ((a0-21 (-> arg3 param 0)) + (v1-16 (the-as object (-> arg3 param 1))) + ) + (when (= a0-21 'attack) + (when (logtest? (-> (the-as process-focusable v1-16) mask) (process-mask target)) + (if (focus-test? (the-as process-focusable v1-16) dead) + (speech-control-method-12 *speech-control* obj (speech-type speech-type-10)) + ) + ) + ) + ) + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) ) ) @@ -1596,7 +1589,6 @@ ) (speech-control-method-12 *speech-control* self (speech-type speech-type-3)) (logior! (-> self enemy-flags) (enemy-flag chase-startup)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1632,7 +1624,6 @@ (react-to-focus self) ) ) - (none) ) ) @@ -1653,11 +1644,9 @@ (go-virtual gun-shoot) ) (set! (-> self reaction-time) (the-as time-frame (the int (* 300.0 (get-rand-float-range self 1.0 3.0))))) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (let ((gp-0 (-> self focus aware))) @@ -1715,7 +1704,6 @@ (set! (-> a0-21 target-post quad) (-> v1-62 quad)) ) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1728,7 +1716,6 @@ ) ) #f - (none) ) ) @@ -1742,11 +1729,9 @@ ((-> (method-of-type nav-enemy hostile) enter)) (set! (-> self state-time) (current-time)) (set! (-> self reaction-time) (the-as time-frame (the int (* 300.0 (get-rand-float-range self 0.5 1.5))))) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (let ((gp-0 (-> self focus aware))) @@ -1781,7 +1766,6 @@ (set! (-> a0-13 target-post quad) (-> v1-38 quad)) ) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1794,11 +1778,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -1812,11 +1794,9 @@ ((-> (method-of-type nav-enemy hostile) enter)) (set! (-> self state-time) (current-time)) (nav-enemy-method-156 self) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (let ((gp-0 (-> self focus aware))) @@ -1862,7 +1842,6 @@ ) ) ) - (none) ) :code (behavior () (speech-control-method-12 *speech-control* self (speech-type speech-type-9)) @@ -1876,11 +1855,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -1894,11 +1871,9 @@ ((-> (method-of-type nav-enemy hostile) enter)) (set! (-> self state-time) (current-time)) (nav-enemy-method-156 self) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (let ((gp-0 (-> self focus aware))) @@ -1942,7 +1917,6 @@ ) ) ) - (none) ) :code (behavior () (speech-control-method-12 *speech-control* self (speech-type speech-type-9)) @@ -1956,11 +1930,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -1995,12 +1967,10 @@ (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self joint-enable) #t) (set! (-> self reaction-time) (the-as time-frame (the int (* 300.0 (get-rand-float-range self 3.0 5.0))))) - (none) ) :exit (behavior () (set! (-> self joint-enable) #f) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (crimson-guard-level-method-200 self) @@ -2019,7 +1989,6 @@ ) ) ) - (none) ) :code (behavior () (speech-control-method-12 *speech-control* self (speech-type speech-type-13)) @@ -2071,11 +2040,9 @@ ) ) (go-hostile self) - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -2121,11 +2088,9 @@ ) (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self joint-enable) #t) - (none) ) :exit (behavior () (set! (-> self joint-enable) #f) - (none) ) :trans (behavior () (crimson-guard-level-method-200 self) @@ -2142,7 +2107,6 @@ ) ) ) - (none) ) :code (behavior () (local-vars (v1-48 object)) @@ -2266,11 +2230,9 @@ (crimson-guard-level-method-204 self) ) (go-hostile self) - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -2691,7 +2653,6 @@ (set! (-> v1-9 target-speed) 0.0) ) 0 - (none) ) :exit (behavior () (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) @@ -2702,11 +2663,9 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (crimson-guard-level-method-200 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2719,11 +2678,9 @@ (ja :num! (seek!)) ) (go-hostile self) - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -2798,7 +2755,6 @@ (set! (-> v1-9 target-speed) 0.0) ) 0 - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -2806,11 +2762,9 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (crimson-guard-level-method-200 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2858,11 +2812,9 @@ (ja :num! (seek! (ja-aframe 37.0 0))) ) (go-hostile self) - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -2896,7 +2848,6 @@ (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self lazer-sound) (new 'static 'sound-id)) 0 - (none) ) :exit (behavior () (if (nonzero? (-> self lazer-sound)) @@ -2932,14 +2883,12 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (crimson-guard-level-method-200 self) (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) (< 32768.0 (-> self target-self-xz-dist))) (go-hostile self) ) - (none) ) :code (behavior () (local-vars (v1-69 symbol)) @@ -3111,11 +3060,9 @@ #f (label cfg-81) (go-virtual active) - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -3136,7 +3083,6 @@ (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) @@ -3147,11 +3093,9 @@ (collide-spec backgnd jak obstacle hit-by-others-list player-list pusher) ) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -3171,7 +3115,6 @@ ) (set! (-> self hit-face) (the-as uint -1)) (go-hostile self) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -3182,7 +3125,6 @@ ) 0 (track-target! self) - (none) ) ) @@ -3203,7 +3145,6 @@ (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) @@ -3214,11 +3155,9 @@ (collide-spec backgnd jak obstacle hit-by-others-list player-list pusher) ) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -3236,7 +3175,6 @@ ) (set! (-> self hit-face) (the-as uint -1)) (go-hostile self) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -3247,7 +3185,6 @@ ) 0 (track-target! self) - (none) ) ) @@ -3397,7 +3334,6 @@ ) ) (go-virtual gun-shoot) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -3419,7 +3355,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -3513,7 +3448,6 @@ ) ) (go-virtual gun-shoot) - (none) ) :post (-> (method-of-type crimson-guard-level roll-right) post) ) @@ -3547,7 +3481,6 @@ ) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy knocked) trans))) @@ -3555,7 +3488,6 @@ (t9-0) ) ) - (none) ) ) @@ -3656,7 +3588,6 @@ #t ) -;; WARN: Return type mismatch object vs none. (defmethod go-hostile crimson-guard-level ((obj crimson-guard-level)) (let ((v1-0 (-> obj hit-face))) (cond @@ -3680,7 +3611,6 @@ ) ) ) - (none) ) (defmethod enemy-method-78 crimson-guard-level ((obj crimson-guard-level) (arg0 (pointer float))) @@ -3899,7 +3829,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -4179,12 +4108,10 @@ ) 0 (set! (-> self already-shot) (the-as uint #f)) - (none) ) :exit (behavior () (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) (logclear! (-> self nav flags) (nav-control-flag output-sphere-hash)) - (none) ) :trans (behavior () (rlet ((acc :class vf) @@ -4241,7 +4168,6 @@ ) (crimson-guard-level-method-201 self 0.0) ) - (none) ) ) :code (behavior () @@ -4267,11 +4193,9 @@ (suspend) ) #f - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -4390,6 +4314,7 @@ (none) ) +;; WARN: Return type mismatch object vs none. (defmethod nav-enemy-method-156 crimson-guard-level ((obj crimson-guard-level)) (cond ((logtest? (-> obj flags) 36) diff --git a/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc b/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc index ea0d6d38846..6d8b318bb11 100644 --- a/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc +++ b/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc @@ -238,8 +238,8 @@ (defstate dormant (guard-conversation) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (set! (-> self triggered?) #t) (go-virtual active) @@ -255,20 +255,19 @@ (defstate active (guard-conversation) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('trigger) - (let ((v0-0 #t)) - (set! (-> self triggered?) v0-0) - v0-0 - ) - ) - (('untrigger) - (set! (-> self triggered?) #f) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (let ((v0-0 #t)) + (set! (-> self triggered?) v0-0) + v0-0 + ) + ) + (('untrigger) + (set! (-> self triggered?) #f) + #f + ) + ) ) :trans (behavior () (let ((gp-0 #t)) @@ -304,7 +303,6 @@ (if (and (-> self triggered?) (>= (- (current-time) (-> self last-playing-time)) (seconds 6))) (guard-conversation-method-24 self) ) - (none) ) :code (the-as (function none :behavior guard-conversation) sleep-code) ) @@ -352,7 +350,6 @@ (suspend) ) (go-virtual die) - (none) ) ) @@ -363,7 +360,6 @@ (process-entity-status! self (entity-perm-status dead) #t) (suspend) 0 - (none) ) ) diff --git a/goal_src/jak2/levels/common/enemy/guards/transport-level.gc b/goal_src/jak2/levels/common/enemy/guards/transport-level.gc index aea1a302206..e1183f98d3d 100644 --- a/goal_src/jak2/levels/common/enemy/guards/transport-level.gc +++ b/goal_src/jak2/levels/common/enemy/guards/transport-level.gc @@ -109,7 +109,6 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self last-guard-spawn-time) (current-time)) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -122,7 +121,6 @@ (ja :num! (seek!)) ) (sleep-code) - (none) ) :post (behavior () (set! (-> self root transv y) (* 2.0 (- (-> self y-dest) (-> self root trans y)))) @@ -133,7 +131,6 @@ ) (transport-level-method-34 self) (transform-post) - (none) ) ) @@ -145,11 +142,9 @@ (set! (-> self root transv y) 0.0) (set! (-> self last-guard-spawn-time) 0) 0 - (none) ) :exit (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -163,7 +158,6 @@ (ja :num! (seek! max 0.5)) ) (sleep-code) - (none) ) :post (behavior () (local-vars (gp-0 symbol)) @@ -200,7 +194,6 @@ ) (transport-level-method-34 self) (transform-post) - (none) ) ) @@ -209,7 +202,6 @@ :code (behavior () (sound-stop (-> self ambient-sound-id)) (cleanup-for-death self) - (none) ) ) @@ -219,7 +211,6 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self root transv y) 0.0) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -234,7 +225,6 @@ (ja :num! (seek! max 0.2)) ) (sleep-code) - (none) ) :post (behavior () (transport-level-method-34 self) @@ -247,7 +237,6 @@ (go-virtual die-fast) ) (transform-post) - (none) ) ) diff --git a/goal_src/jak2/levels/common/enemy/hopper.gc b/goal_src/jak2/levels/common/enemy/hopper.gc index 91a47b97792..4dc4d1aff69 100644 --- a/goal_src/jak2/levels/common/enemy/hopper.gc +++ b/goal_src/jak2/levels/common/enemy/hopper.gc @@ -486,7 +486,6 @@ (t9-0) ) ) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy jump) exit))) @@ -503,7 +502,6 @@ (set! (-> v1-5 settings bot-plane w) (- -4096.0)) ) 0 - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy jump) trans))) @@ -520,7 +518,6 @@ (set! (-> v1-5 settings top-plane w) (- (+ (- 8192.0 (-> self root trans y)) (-> self root gspot-pos y)))) ) 0 - (none) ) ) @@ -626,7 +623,6 @@ (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) ) @@ -654,7 +650,6 @@ (set! (-> self next-jump-time) (the-as int (+ (current-time) (get-rand-int-range self 0 120)))) (set! (-> self step-num) 0) (set! (-> self best-score) -2.0) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) @@ -662,7 +657,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -792,7 +786,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior hopper) nav-enemy-simple-post) ) @@ -805,7 +798,6 @@ (t9-0) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -822,7 +814,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior hopper) nav-enemy-simple-post) ) @@ -852,7 +843,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -897,18 +887,15 @@ (set! (-> gp-1 trans quad) (-> s5-0 quad)) ) ) - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) @@ -923,7 +910,6 @@ (send-event self 'jump 2 gp-0) ) (go-virtual hostile) - (none) ) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc b/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc index 00926bcc28b..d1e79ec4af1 100644 --- a/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc +++ b/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc @@ -608,11 +608,9 @@ ) (set! (-> self last-fire-time) (+ (current-time) (the int (* 300.0 (get-rand-float-range self 2.0 3.0))))) (go-virtual ambush-fly) - (none) ) :exit (behavior () '() - (none) ) ) @@ -641,7 +639,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior crimson-guard-hover) hover-enemy-fly-code) :post (-> (method-of-type hover-enemy ambush) post) @@ -649,8 +646,8 @@ (defstate ambush-attack (crimson-guard-hover) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('event-attack) (when (< (-> self shots-fired) 2) (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) @@ -680,7 +677,7 @@ ) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) @@ -696,19 +693,16 @@ ) (set! (-> self shots-fired) 0) 0 - (none) ) :exit (behavior () (set! (-> self last-fire-time) (current-time)) (set! (-> self restart-fly-anims) #t) - (none) ) :trans (behavior () ((-> (method-of-type crimson-guard-hover ambush) trans)) (if (or (skip-check-los? (-> self los) 60) (not (enemy-method-95 self (-> self focus-pos) 9102.223))) (go-virtual ambush-fly) ) - (none) ) :code (behavior () (sound-play "hover-warn") @@ -728,7 +722,6 @@ (ja :num! (seek!)) ) (go-virtual ambush-fly) - (none) ) :post (behavior () (let* ((a1-0 (-> self node-list data (-> self hover-info gun-base))) @@ -750,7 +743,6 @@ (* 0.5 (seconds-per-frame) (- (-> self attack-miss-dist-max) (-> self attack-miss-dist-min))) ) ((the-as (function none) (-> (method-of-type crimson-guard-hover ambush) post))) - (none) ) ) @@ -764,7 +756,6 @@ ) (talker-spawn-func (-> *talker-speech* 10) *entity-pool* (target-pos 0) (the-as region #f)) (set! (-> self last-fire-time) (+ (current-time) (seconds -1.5))) - (none) ) ) @@ -786,7 +777,6 @@ ) ) ) - (none) ) ) @@ -798,13 +788,11 @@ ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 4)) (go-hostile self) ) - (none) ) :code (the-as (function none :behavior crimson-guard-hover) hover-enemy-fly-code) :post (behavior () @@ -836,14 +824,13 @@ (hover-nav-control-method-11 (-> self hover) gp-0) ) (hover-enemy-dest-post) - (none) ) ) (defstate attack (crimson-guard-hover) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('event-attack) (when (< (-> self shots-fired) 2) (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) @@ -873,7 +860,7 @@ ) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) @@ -882,18 +869,15 @@ (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) (set! (-> self shots-fired) 0) 0 - (none) ) :exit (behavior () (set! (-> self last-fire-time) (current-time)) (set! (-> self restart-fly-anims) #t) - (none) ) :trans (behavior () (if (or (skip-check-los? (-> self los) 60) (not (enemy-method-95 self (-> self focus-pos) 9102.223))) (go-hostile self) ) - (none) ) :code (behavior () (sound-play "hover-warn") @@ -920,7 +904,6 @@ (ja :num! (seek!)) ) (go-hostile self) - (none) ) :post (behavior () (let* ((a1-0 (-> self node-list data (-> self hover-info gun-base))) @@ -942,7 +925,6 @@ (* 0.5 (seconds-per-frame) (- (-> self attack-miss-dist-max) (-> self attack-miss-dist-min))) ) (hover-enemy-hostile-post) - (none) ) ) @@ -954,7 +936,6 @@ (t9-1) ) ) - (none) ) ) @@ -1004,7 +985,6 @@ (logclear! (-> self focus-status) (focus-status hit)) (hover-nav-control-method-21 (-> self hover)) (go-hostile self) - (none) ) ) @@ -1030,7 +1010,6 @@ ) (send-event self 'death-end) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior crimson-guard-hover) transform-post) ) @@ -1073,7 +1052,6 @@ (-> gp-0 ppointer) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1100,7 +1078,6 @@ ) ) (sleep-code) - (none) ) ) @@ -1154,7 +1131,6 @@ ) ) (sound-stop (-> self sound-id)) - (none) ) ) @@ -1317,6 +1293,7 @@ (none) ) +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-52 crimson-guard-hover ((obj crimson-guard-hover) (arg0 vector)) (let ((s4-0 (-> obj root))) (case (-> obj incoming knocked-type) diff --git a/goal_src/jak2/levels/common/enemy/hover/flamer.gc b/goal_src/jak2/levels/common/enemy/hover/flamer.gc index f3425496779..9a85fb5058d 100644 --- a/goal_src/jak2/levels/common/enemy/hover/flamer.gc +++ b/goal_src/jak2/levels/common/enemy/hover/flamer.gc @@ -565,6 +565,7 @@ (none) ) +;; WARN: Return type mismatch object vs none. (defmethod flamer-method-191 flamer ((obj flamer)) (cond ((and (-> obj draw shadow) @@ -731,7 +732,6 @@ (defmethod go-stare flamer ((obj flamer)) (go-hostile obj) - (none) ) (defstate wait-for-formation (flamer) @@ -751,7 +751,6 @@ (suspend) ) #f - (none) ) :post (-> (method-of-type flamer idle) post) ) @@ -765,7 +764,6 @@ ) ) (set! (-> self root trans quad) (-> self idle-pos quad)) - (none) ) ) @@ -778,7 +776,6 @@ ) ) (set! (-> self root trans quad) (-> self idle-pos quad)) - (none) ) :trans (behavior () (when (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) (flamer-method-183 self)) @@ -787,7 +784,6 @@ (go-virtual active) ) ) - (none) ) ) @@ -802,14 +798,12 @@ (flamer-method-190 self) (set! (-> self ground-mode) 0) 0 - (none) ) :trans (behavior () (if (flamer-method-183 self) (go-virtual active) ) (flamer-method-184 self) - (none) ) ) @@ -823,7 +817,6 @@ ) (set! (-> self ground-mode) 0) 0 - (none) ) :trans (behavior () (if (flamer-method-183 self) @@ -832,7 +825,6 @@ (if (>= 819.2 (vector-vector-xz-distance (-> self root trans) (-> self idle-pos))) (go-virtual idle) ) - (none) ) :post flamer-attack-post ) @@ -869,7 +861,6 @@ (sound-play "flamer-ambush") (quaternion-copy! (-> self root quat) (-> self init-quat)) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy ambush) exit))) @@ -881,7 +872,6 @@ (logior! (-> self enemy-flags) (enemy-flag notice)) (set! (-> self flit-joint twist-min-y) (the-as float #t)) (set! (-> self last-fire-time) (+ (current-time) (seconds -1.5))) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy ambush) trans))) @@ -903,13 +893,11 @@ ) (flamer-method-186 self f30-0) ) - (none) ) :code (the-as (function none :behavior flamer) flamer-fly-code) :post (behavior () (flamer-method-187 self) (nav-enemy-simple-post) - (none) ) ) @@ -943,19 +931,16 @@ ) 0 (set! (-> self ground-mode) 1) - (none) ) :trans (behavior () (if (< (vector-vector-xz-distance (-> self root trans) (-> self dest-pos)) 409.6) (go-virtual exit-ambush-path) ) - (none) ) :code (the-as (function none :behavior flamer) flamer-fly-code) :post (behavior () (flamer-method-187 self) (flamer-flit-post) - (none) ) ) @@ -972,12 +957,10 @@ ) 0 (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self enemy-flags) (enemy-flag notice)) - (none) ) :trans (behavior () (set! (-> self path-pos) (- (-> self path-pos) (* 0.33333334 (seconds-per-frame)))) @@ -1000,7 +983,6 @@ (get-point-at-percent-along-path! (-> self path) (-> self base-pos) f30-0 'interp) (flamer-method-186 self f30-0) ) - (none) ) :code (the-as (function none :behavior flamer) flamer-fly-code) :post (behavior () @@ -1012,7 +994,6 @@ (vector-seek! (-> self root trans) (-> self base-pos) (* 16384.0 (seconds-per-frame))) (flamer-method-184 self) (nav-enemy-simple-post) - (none) ) ) @@ -1025,7 +1006,6 @@ ) ) (go-virtual hostile) - (none) ) ) @@ -1047,7 +1027,6 @@ (flamer-method-189 self) (set! (-> self ground-mode) 0) (set! (-> self flit-timer) (+ (current-time) (seconds -3))) - (none) ) :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -1071,20 +1050,18 @@ (go-virtual attack) ) ) - (none) ) :code (the-as (function none :behavior flamer) flamer-fly-code) :post (behavior () (flamer-method-187 self) (flamer-flit-post) - (none) ) ) (defstate attack (flamer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('event-attack) (let ((s5-0 (handle->process (-> self focus handle)))) (when s5-0 @@ -1120,13 +1097,12 @@ ) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1154,7 +1130,6 @@ ) (set! (-> self last-fire-time) (current-time)) (go-virtual hostile) - (none) ) :post flamer-attack-post ) @@ -1257,7 +1232,6 @@ ) (set-gravity-length (-> self root dynam) 368640.0) (set! (-> self hit-surface?) #f) - (none) ) :trans (behavior () (let ((gp-0 (-> self root))) @@ -1287,7 +1261,6 @@ (go-hostile self) ) ) - (none) ) :post (behavior () (seek! (-> self sound-volume) 0.0 (* 0.5 (seconds-per-frame))) @@ -1297,7 +1270,6 @@ ((the-as (function none) t9-2)) ) ) - (none) ) ) @@ -1324,7 +1296,6 @@ 0 (nav-enemy-method-167 self) (enemy-method-103 self) - (none) ) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc b/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc index 784e11ca3bf..2bd183df067 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc @@ -39,7 +39,7 @@ :flag-assert #x13003000a8 (:methods (idle () _type_ :state 14) - (spawning (object object process pointer) _type_ :state 15) + (spawning () _type_ :state 15) (die () _type_ :state 16) (hover-enemy-manager-init! (_type_ (array hover-enemy-battle-command)) none 17) (spawn-enemy (_type_ uint) none 18) @@ -142,13 +142,13 @@ (defstate idle (hover-enemy-manager) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) - (go-virtual spawning proc arg1 (the-as process event-type) (the-as pointer event)) + (go-virtual spawning) ) (else - (hover-enemy-manager-handler proc arg1 event-type event) + (hover-enemy-manager-handler proc argc message block) ) ) ) @@ -158,25 +158,24 @@ (defstate spawning (hover-enemy-manager) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('spawning?) #t ) (else - (hover-enemy-manager-handler proc arg1 event-type event) + (hover-enemy-manager-handler proc argc message block) ) ) ) - :enter (behavior ((arg0 object) (arg1 object) (arg2 process) (arg3 pointer)) - (let ((a0-1 (-> self formation))) - (if a0-1 - (set-anchor-proc a0-1 (process->handle *target*)) + :enter (behavior () + (let ((a0-0 (-> self formation))) + (if a0-0 + (set-anchor-proc a0-0 (process->handle *target*)) ) ) - (none) ) - :code (behavior ((arg0 object) (arg1 object) (arg2 process) (arg3 pointer)) + :code (behavior () (let ((gp-0 (-> self command-table))) (dotimes (s5-0 (-> gp-0 length)) (case (-> gp-0 s5-0 command) @@ -202,7 +201,6 @@ ) ) (go-virtual die) - (none) ) :post hover-enemy-manager-post ) @@ -215,7 +213,6 @@ (suspend) ) (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) @@ -312,7 +309,6 @@ (none) ) -;; WARN: Return type mismatch process-tree vs process. (defun hover-manager-spawn ((arg0 turret) (arg1 entity-actor) (arg2 (array hover-enemy-battle-command))) - (the-as process (ppointer->process (process-spawn hover-enemy-manager arg1 arg2 :to arg0))) + (ppointer->process (process-spawn hover-enemy-manager arg1 arg2 :to arg0)) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc b/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc index e1e81a646d8..4f73170c1d7 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc @@ -506,7 +506,6 @@ (hover-enemy-method-144 self) (hover-nav-control-method-18 (-> self hover) (-> self path) -1 -1) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (local-vars (v1-5 enemy-flag)) @@ -520,7 +519,6 @@ ) (set! (-> self enemy-flags) v1-5) (hover-enemy-method-153 self) - (none) ) :trans (behavior () (when (hover-nav-control-method-23 (-> self hover)) @@ -530,7 +528,6 @@ ) (go-virtual hostile) ) - (none) ) :code hover-enemy-fly-code :post (behavior () @@ -557,7 +554,6 @@ ) (hover-nav-control-method-11 (-> self hover) (the-as vector #f)) (hover-enemy-dest-post) - (none) ) ) @@ -580,7 +576,6 @@ (hover-nav-control-method-10 (-> self hover) s5-0 gp-0 (the-as vector #t)) ) (hover-enemy-method-144 self) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type enemy notice) exit))) @@ -589,7 +584,6 @@ ) ) (hover-enemy-method-153 self) - (none) ) ) @@ -612,7 +606,6 @@ ) (set! (-> self hit-surface?) #f) (set! (-> self knocked-start-level) (-> self root trans y)) - (none) ) :exit (behavior () (let ((t9-1 (-> (the-as state (find-parent-method hover-enemy 30)) exit))) @@ -621,7 +614,6 @@ ) ) (set! (-> self hit-surface?) #f) - (none) ) :trans (behavior () (let ((gp-0 (-> self root))) @@ -648,7 +640,6 @@ ) (go-virtual knocked-recover) ) - (none) ) ) @@ -702,15 +693,14 @@ (logclear! (-> self focus-status) (focus-status hit)) (hover-nav-control-method-21 (-> self hover)) (go-hostile self) - (none) ) :post hover-enemy-hostile-post ) (defstate flying-death (hover-enemy) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'touched 'attack) (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (go-virtual flying-death-explode) @@ -772,7 +762,6 @@ (set! (-> self flying-death-spin) 0.0) (enemy-method-103 self) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (or (logtest? (-> self root status) @@ -782,7 +771,6 @@ ) (go-virtual flying-death-explode) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -803,7 +791,6 @@ ) ) #f - (none) ) :post (behavior () (seek! (-> self flying-death-spin) (-> self flying-death-spin-dest) (* 196608.0 (seconds-per-frame))) @@ -841,7 +828,6 @@ ) (enemy-simple-post) (hover-enemy-method-143 self (-> self flying-death-engine) (-> self flying-death-thrust-rotate)) - (none) ) ) @@ -855,25 +841,21 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (behavior () (while (-> self child) (suspend) ) (cleanup-for-death self) - (none) ) ) (defmethod go-stare hover-enemy ((obj hover-enemy)) (go-hostile obj) - (none) ) (defmethod go-stare2 hover-enemy ((obj hover-enemy)) (go-hostile obj) - (none) ) ;; WARN: Return type mismatch quaternion vs none. diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc b/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc index 8834cb729ec..5c6ec403d52 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc @@ -581,61 +581,55 @@ (defstate idle (hover-formation) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (the-as - object - (case event-type - (('join) - (hover-formation-control-method-17 (-> self formation) proc) - ) - (('leave) - (hover-formation-control-method-18 (-> self formation) proc) - ) - (('set-type) - (let ((a1-11 1)) - (case (-> event param 0) - (('line) - (set! a1-11 0) - ) - (('circle) - (set! a1-11 2) - ) - (('semicircle) - (set! a1-11 3) - ) - ) - (try-update-formation-type (-> self formation) (the-as formation-type a1-11)) + (case message + (('join) + (hover-formation-control-method-17 (-> self formation) proc) + ) + (('leave) + (hover-formation-control-method-18 (-> self formation) proc) + ) + (('set-type) + (let ((a1-11 1)) + (case (-> block param 0) + (('line) + (set! a1-11 0) + ) + (('circle) + (set! a1-11 2) + ) + (('semicircle) + (set! a1-11 3) + ) ) + (try-update-formation-type (-> self formation) (the-as formation-type a1-11)) ) - (('update-sphere) - (the-as - object - (hover-formation-control-method-20 (-> self formation) (process->handle proc) (-> event param 0)) + ) + (('update-sphere) + (hover-formation-control-method-20 (-> self formation) (process->handle proc) (-> block param 0)) + ) + (('get-formation) + (-> self formation) + ) + (('set-los) + (cond + ((-> block param 0) + (set! v0-0 (logior (-> self formation flags) 2)) + (set! (-> self formation flags) (the-as uint v0-0)) + ) + (else + (set! v0-0 (logand -3 (-> self formation flags))) + (set! (-> self formation flags) (the-as uint v0-0)) ) ) - (('get-formation) - (-> self formation) - ) - (('set-los) - (cond - ((-> event param 0) - (set! v0-0 (logior (-> self formation flags) 2)) - (set! (-> self formation flags) (the-as uint v0-0)) - ) - (else - (set! v0-0 (logand -3 (-> self formation flags))) - (set! (-> self formation flags) (the-as uint v0-0)) - ) + v0-0 + ) + (('path) + (if (not (logtest? (-> self path flags) (path-control-flag not-found))) + (-> self path) ) - v0-0 - ) - (('path) - (if (not (logtest? (-> self path flags) (path-control-flag not-found))) - (-> self path) - ) - ) - ) + ) ) ) :code (the-as (function none :behavior hover-formation) sleep-code) @@ -651,7 +645,6 @@ (if (not (logtest? (-> self path flags) (path-control-flag not-found))) (debug-draw (-> self path)) ) - (none) ) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc index 3388a619c44..8c2afc6839b 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc @@ -28,7 +28,6 @@ :post (behavior () (nav-network-method-29 (-> self nav-network)) (nav-network-method-27 (-> self nav-network)) - (none) ) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/wasp.gc b/goal_src/jak2/levels/common/enemy/hover/wasp.gc index f76fdfeec02..286e33502e9 100644 --- a/goal_src/jak2/levels/common/enemy/hover/wasp.gc +++ b/goal_src/jak2/levels/common/enemy/hover/wasp.gc @@ -469,6 +469,7 @@ ) ) +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-52 wasp ((obj wasp) (arg0 vector)) (let ((s4-0 (-> obj root))) (case (-> obj incoming knocked-type) @@ -522,18 +523,16 @@ (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-hostile wasp ((obj wasp)) (go (method-of-object obj hostile)) - (none) ) (defmethod react-to-focus wasp ((obj wasp)) "@TODO - flesh out docs" (go-hostile obj) - (none) ) +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-129 wasp ((obj wasp)) (if (logtest? (-> obj fact enemy-options) (enemy-option user0)) (set! (-> obj focus-pos quad) (-> obj plat-pos quad)) @@ -565,7 +564,6 @@ (if (logtest? (-> self fact enemy-options) (enemy-option user0)) (go-virtual shoot-bridge-wait) ) - (none) ) ) @@ -578,7 +576,6 @@ ) ) (set! (-> self last-fire-time) (+ (current-time) (seconds -1.5))) - (none) ) ) @@ -591,14 +588,13 @@ ) ) (set! (-> self last-fire-time) (+ (current-time) (seconds -1.5))) - (none) ) ) (defstate shoot-bridge-wait (wasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual shoot-bridge-intro) ) @@ -627,7 +623,6 @@ (logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water)) (logclear! (-> self mask) (process-mask collectable)) (logclear! (-> self enemy-flags) (enemy-flag look-at-move-dest)) - (none) ) :exit (behavior () (let ((gp-0 (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp)) @@ -640,15 +635,14 @@ (the-as vector #t) ) ) - (none) ) :code (the-as (function none :behavior wasp) sleep-code) ) (defstate shoot-bridge-intro (wasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('shoot) (go-virtual shoot-bridge-hostile) ) @@ -656,7 +650,6 @@ ) :enter (behavior () (set! (-> self plat-pos quad) (-> self entity-group data 0 actor extra trans quad)) - (none) ) :trans (behavior () (if (< (vector-vector-distance @@ -667,20 +660,18 @@ ) (go-virtual shoot-bridge-hold) ) - (none) ) :code (the-as (function none :behavior wasp) hover-enemy-fly-code) :post (behavior () (hover-nav-control-method-11 (-> self hover) (the-as vector #f)) (hover-enemy-dest-post) - (none) ) ) (defstate shoot-bridge-hold (wasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('shoot) (go-virtual shoot-bridge-hostile) ) @@ -690,7 +681,6 @@ :post (behavior () (hover-nav-control-method-11 (-> self hover) (the-as vector #f)) (hover-enemy-dest-post) - (none) ) ) @@ -720,7 +710,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior wasp) hover-enemy-fly-code) :post (behavior () @@ -731,14 +720,13 @@ (hover-nav-control-method-11 (-> self hover) a1-0) ) (hover-enemy-dest-post) - (none) ) ) (defstate shoot-bridge-attack (wasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :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)) @@ -760,14 +748,13 @@ (sound-play "wasp-fire" :position (-> self root trans)) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -789,7 +776,6 @@ (set! (-> self last-fire-time) (current-time)) (set! (-> self restart-fly-anims) #t) (go-virtual shoot-bridge-hostile) - (none) ) :post (behavior () (let* ((a1-0 (-> self node-list data (-> self hover-info gun-base))) @@ -817,7 +803,6 @@ (hover-nav-control-method-11 (-> self hover) a1-8) ) (hover-enemy-dest-post) - (none) ) ) @@ -842,7 +827,6 @@ ) ) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (< (vector-vector-distance @@ -854,7 +838,6 @@ (cleanup-for-death self) (go empty-state) ) - (none) ) :code (the-as (function none :behavior wasp) hover-enemy-fly-code) :post (behavior () @@ -866,7 +849,6 @@ ) ) (hover-enemy-dest-post) - (none) ) ) @@ -892,14 +874,13 @@ ) ) ) - (none) ) ) (defstate attack (wasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :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)) @@ -921,14 +902,13 @@ (sound-play "wasp-fire" :position (-> self root trans)) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -950,7 +930,6 @@ (set! (-> self last-fire-time) (current-time)) (set! (-> self restart-fly-anims) #t) (go-hostile self) - (none) ) :post (behavior () (let* ((a1-0 (-> self node-list data (-> self hover-info gun-base))) @@ -972,7 +951,6 @@ (* 0.5 (seconds-per-frame) (- (-> self attack-miss-dist-max) (-> self attack-miss-dist-min))) ) (hover-enemy-hostile-post) - (none) ) ) @@ -1023,7 +1001,6 @@ (logclear! (-> self focus-status) (focus-status hit)) (hover-nav-control-method-21 (-> self hover)) (go-hostile self) - (none) ) ) @@ -1085,7 +1062,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -1108,7 +1084,6 @@ ) (send-event self 'death-end) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior wasp) transform-post) ) diff --git a/goal_src/jak2/levels/common/enemy/metalmonk.gc b/goal_src/jak2/levels/common/enemy/metalmonk.gc index b357c24a692..bde300de2a4 100644 --- a/goal_src/jak2/levels/common/enemy/metalmonk.gc +++ b/goal_src/jak2/levels/common/enemy/metalmonk.gc @@ -552,7 +552,6 @@ (set! (-> v1-6 turning-acceleration) (* 2.0 (-> self enemy-info run-turning-acceleration))) ) 0 - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy notice) exit))) @@ -568,7 +567,6 @@ (set! (-> v1-6 turning-acceleration) (-> self enemy-info run-turning-acceleration)) ) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -590,7 +588,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -622,7 +619,6 @@ (go-virtual attack) ) ) - (none) ) :code (behavior () (talker-spawn-func (-> *talker-speech* 95) *entity-pool* (target-pos 0) (the-as region #f)) @@ -635,7 +631,6 @@ ) ) #f - (none) ) ) @@ -716,7 +711,6 @@ ) ) #f - (none) ) ) @@ -744,7 +738,6 @@ (set! (-> v1-15 attack-id) v0-3) (set! (-> self attack-id) v0-3) ) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -758,11 +751,9 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (enemy-method-49 self) - (none) ) :code (behavior () (let ((gp-0 #f)) @@ -791,7 +782,6 @@ (go-hostile self) ) ) - (none) ) :post (the-as (function none :behavior metalmonk) nav-enemy-chase-post) ) @@ -805,7 +795,6 @@ ) ) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy victory) trans))) @@ -826,7 +815,6 @@ (react-to-focus self) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -843,7 +831,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -860,7 +847,6 @@ ) ) #f - (none) ) ) @@ -890,7 +876,6 @@ ) ) #f - (none) ) ) @@ -907,7 +892,6 @@ (go-virtual notice) ) (get-point-at-percent-along-path! (-> self intro-path) (-> self root trans) 0.0 'interp) - (none) ) :code (behavior () (until #f @@ -928,7 +912,6 @@ (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/common/enemy/spyder.gc b/goal_src/jak2/levels/common/enemy/spyder.gc index 9f21ac1b11c..80dd2d59112 100644 --- a/goal_src/jak2/levels/common/enemy/spyder.gc +++ b/goal_src/jak2/levels/common/enemy/spyder.gc @@ -718,7 +718,6 @@ (set! (-> self shock-effect-end) (+ (current-time) (seconds 1))) (set! (-> self dest-fade) 128.0) ) - (none) ) ) @@ -733,7 +732,6 @@ (dotimes (gp-0 4) (enable-set! (-> self joint-ik gp-0) #t) ) - (none) ) ) @@ -872,7 +870,6 @@ (set! (-> self dest-fade) 128.0) (sound-play "spyder-uncloak") ) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) @@ -882,7 +879,6 @@ ) (logclear! (-> self status-flags) (spyder-flags spflags-5)) (look-at-target! self (enemy-flag lock-focus)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -913,7 +909,6 @@ ) ) ) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -925,7 +920,6 @@ ) 0 (spyder-travel-post) - (none) ) ) @@ -942,7 +936,6 @@ (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) ) 0 - (none) ) :trans (behavior () (let ((f0-0 (vector-vector-xz-distance (-> self root trans) (-> self move-dest)))) @@ -950,7 +943,6 @@ (go-hostile self) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -971,11 +963,9 @@ ) ) #f - (none) ) :post (behavior () (spyder-travel-post) - (none) ) ) @@ -1008,13 +998,14 @@ (defstate attack (spyder) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'event-attack) - (the-as object (spyder-method-183 self (the-as matrix (-> self fire-info)) 307200.0)) - (enemy-event-handler proc arg1 event-type event) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('event-attack) + (spyder-method-183 self (the-as matrix (-> self fire-info)) 307200.0) + ) + (else + (enemy-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -1032,7 +1023,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (logior! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1040,7 +1030,6 @@ (set! (-> v1-2 max-rotation-rate) (-> *spyder-nav-enemy-info* maximum-rotation-rate)) ) 0 - (none) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) @@ -1049,7 +1038,6 @@ (if (or (>= 2 (the-as int (-> self focus aware))) (not (get-enemy-target self))) (go-stare self) ) - (none) ) :code (behavior () (when (not (enemy-method-96 self 2730.6667 #t)) @@ -1142,15 +1130,12 @@ ) 0 (go-hostile self) - (none) ) :post (behavior () (spyder-face-player-post) - (none) ) ) -;; WARN: Return type mismatch object vs none. (defmethod go-hostile spyder ((obj spyder)) (if (and (not (logtest? (-> obj status-flags) (spyder-flags spflags-1))) (-> obj next-state) @@ -1161,7 +1146,6 @@ (go (method-of-object obj attack)) ) (go (method-of-object obj hostile)) - (none) ) (defstate knocked (spyder) @@ -1176,7 +1160,6 @@ (dotimes (gp-0 4) (enable-set! (-> self joint-ik gp-0) #f) ) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy knocked) exit))) @@ -1190,7 +1173,6 @@ (enable-set! (-> self joint-ik gp-0) #t) ) ) - (none) ) ) @@ -1198,11 +1180,9 @@ :virtual #t :enter (behavior () (set! (-> self draw bounds w) 30310.4) - (none) ) :exit (behavior () (set! (-> self draw bounds w) 20480.0) - (none) ) ) diff --git a/goal_src/jak2/levels/common/entities/com-elevator.gc b/goal_src/jak2/levels/common/entities/com-elevator.gc index 25c9b75836c..2c91f1c1131 100644 --- a/goal_src/jak2/levels/common/entities/com-elevator.gc +++ b/goal_src/jak2/levels/common/entities/com-elevator.gc @@ -103,7 +103,6 @@ ) ) (process-entity-status! self (entity-perm-status subtask-complete) #t) - (none) ) ) @@ -119,7 +118,6 @@ (if (not (logtest? (-> self elevator-status) (elevator-status moving))) (set-setting! 'allow-look-around #f 0.0 0) ) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) @@ -131,7 +129,6 @@ ) (com-elevator-method-49 self #f) (remove-setting! 'allow-look-around) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -162,7 +159,6 @@ ) ) #f - (none) ) ) @@ -270,7 +266,6 @@ For example for an elevator pre-compute the distance between the first and last (if (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) (set-setting! 'jump #f 0.0 0) ) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type com-elevator running) exit))) @@ -283,7 +278,6 @@ For example for an elevator pre-compute the distance between the first and last (if (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) (remove-setting! 'jump) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -313,7 +307,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/common/entities/cty-guard-turret-button.gc b/goal_src/jak2/levels/common/entities/cty-guard-turret-button.gc index 7eda5a9daca..087c856e0b8 100644 --- a/goal_src/jak2/levels/common/entities/cty-guard-turret-button.gc +++ b/goal_src/jak2/levels/common/entities/cty-guard-turret-button.gc @@ -124,11 +124,9 @@ ) (ja :group! cty-guard-turret-button-idle-ja :num! min) (go-virtual up-idle) - (none) ) :post (behavior () (rider-post) - (none) ) ) @@ -160,6 +158,5 @@ (setup-masks (-> self draw) 4 0) (setup-masks (-> self draw) 1 0) (press! self #t) - (none) ) ) diff --git a/goal_src/jak2/levels/common/entities/fort-floor-spike.gc b/goal_src/jak2/levels/common/entities/fort-floor-spike.gc index b21b33f1bec..7132f7054a2 100644 --- a/goal_src/jak2/levels/common/entities/fort-floor-spike.gc +++ b/goal_src/jak2/levels/common/entities/fort-floor-spike.gc @@ -85,53 +85,49 @@ (defstate idle (fort-floor-spike) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touched) - (when (+ (current-time) (seconds -2)) - (let* ((s3-0 proc) - (proc-draw (if (type? s3-0 process-drawable) - (the-as process-drawable s3-0) - ) - ) - ) - (when proc-draw - (let ((spike-quat (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) - (touched-from-dir (vector-normalize! - (vector-! (new 'stack-no-clear 'vector) (-> proc-draw root trans) (-> self root trans)) - 1.0 - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (when (+ (current-time) (seconds -2)) + (let* ((s3-0 proc) + (proc-draw (if (type? s3-0 process-drawable) + (the-as process-drawable s3-0) + ) + ) + ) + (when proc-draw + (let ((spike-quat (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (touched-from-dir (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> proc-draw root trans) (-> self root trans)) + 1.0 ) - ) - (vector-flatten! touched-from-dir touched-from-dir spike-quat) - (set! (-> touched-from-dir y) 0.0) - (vector-normalize! touched-from-dir 1.0) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (the-as uint (-> self attack-id))) - (mode 'deadly) - (shove-up (meters 6)) - (shove-back (meters 4)) - (vector touched-from-dir) - ) - ) - ) - ) - (let ((frame-count (current-time))) - (set! (-> self no-overlap-timer) (the-as uint frame-count)) - frame-count - ) + ) + ) + (vector-flatten! touched-from-dir touched-from-dir spike-quat) + (set! (-> touched-from-dir y) 0.0) + (vector-normalize! touched-from-dir 1.0) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (the-as uint (-> self attack-id))) + (mode 'deadly) + (shove-up (meters 6)) + (shove-back (meters 4)) + (vector touched-from-dir) + ) + ) + ) + ) + (let ((frame-count (current-time))) + (set! (-> self no-overlap-timer) (the-as uint frame-count)) + frame-count ) ) ) ) - ) + ) ) ) :enter (behavior () (set! (-> self no-overlap-timer) (the-as uint 0)) 0 - (none) ) :code (the-as (function none :behavior fort-floor-spike) sleep-code) :post (behavior () @@ -168,7 +164,6 @@ ) ) (transform-post) - (none) ) ) diff --git a/goal_src/jak2/levels/common/entities/gun-buoy.gc b/goal_src/jak2/levels/common/entities/gun-buoy.gc index 94371d6773b..324b9649e9b 100644 --- a/goal_src/jak2/levels/common/entities/gun-buoy.gc +++ b/goal_src/jak2/levels/common/entities/gun-buoy.gc @@ -400,8 +400,8 @@ (defstate dormant-aware (gun-buoy) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('kill-player) (logior! (-> self flags) (gun-buoy-flags gubflags-2)) (go-virtual ambush) @@ -412,7 +412,6 @@ (set! (-> self root trans quad) (-> self start-pos quad)) (logclear! (-> self flags) (gun-buoy-flags gubflags-1)) (logclear! (-> self flags) (gun-buoy-flags gubflags-2)) - (none) ) :trans (behavior () (when (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) @@ -424,7 +423,6 @@ ) (go-ambush self) ) - (none) ) ) @@ -501,7 +499,6 @@ ) ) ) - (none) ) :trans (behavior () (when (< (fabs (-> self y-offset)) 409.6) @@ -514,7 +511,6 @@ ) (go-virtual open-guns) ) - (none) ) :code (the-as (function none :behavior gun-buoy) sleep-code) :post (behavior () @@ -543,7 +539,6 @@ (update-vol! (-> self sound) f30-0) ) (gun-buoy-chase-post) - (none) ) ) @@ -551,17 +546,14 @@ :virtual #t :enter (behavior () (logclear! (-> self flags) (gun-buoy-flags gubflags-0)) - (none) ) :exit (behavior () (nav-enemy-method-167 self) - (none) ) :trans (behavior () (if (< (-> self y-offset) -81510.4) (go-virtual dormant-aware) ) - (none) ) :code (the-as (function none :behavior gun-buoy) sleep-code) :post (behavior () @@ -583,7 +575,6 @@ (update-vol! (-> self sound) f30-0) ) (gun-buoy-chase-post) - (none) ) ) @@ -596,7 +587,6 @@ (if (and *target* (< 102400.0 (vector-length (get-transv *target*)))) (go-virtual attack) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -643,7 +633,6 @@ (go-virtual exit-ambush) ) ) - (none) ) :post gun-buoy-chase-post ) @@ -652,7 +641,6 @@ :virtual #t :enter (behavior () (set! (-> self stare-down-timer) (current-time)) - (none) ) :trans (behavior () (let ((v1-0 (-> self focus aware))) @@ -668,7 +656,6 @@ ) ) ) - (none) ) :code (behavior () (sound-play "buoy-guns-in") @@ -685,15 +672,14 @@ ) (set! (-> self gun-elev-jmod mode) (the-as joint-mod-mode #f)) (sleep-code) - (none) ) :post gun-buoy-chase-post ) (defstate warning (gun-buoy) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('kill-player) (logior! (-> self flags) (gun-buoy-flags gubflags-2)) (go-virtual attack) @@ -728,14 +714,12 @@ ) (set! (-> self warning-timer) (current-time)) (set! (-> self warning-id) (sound-play "buoy-alarm")) - (none) ) :exit (behavior () (when (nonzero? (-> self warning-id)) (sound-stop (-> self warning-id)) (set! (-> self warning-id) (the-as sound-id -1)) ) - (none) ) :trans (behavior () (let ((gp-0 (-> self focus aware))) @@ -759,7 +743,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior gun-buoy) sleep-code) :post (behavior () @@ -774,7 +757,6 @@ ) ) (gun-buoy-chase-post) - (none) ) ) @@ -798,7 +780,6 @@ (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-7 enemy-flags)))) ) 0 - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) @@ -820,7 +801,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior gun-buoy) sleep-code) :post gun-buoy-chase-post @@ -849,7 +829,6 @@ (go-virtual exit-ambush) ) ) - (none) ) :code (behavior () (dotimes (gp-0 4) @@ -870,7 +849,6 @@ ) ) (go-virtual hostile) - (none) ) :post gun-buoy-chase-post ) @@ -883,7 +861,6 @@ (t9-0) ) ) - (none) ) :code (behavior () (set! *gun-buoy-victory-index* (rand-vu-int-range 0 (+ (-> *gun-buoy-victory-speech* length) -1))) @@ -904,7 +881,6 @@ ) ) (go-virtual exit-ambush) - (none) ) :post gun-buoy-chase-post ) @@ -913,7 +889,6 @@ :virtual #t :code (behavior () (go-virtual idle) - (none) ) ) @@ -1002,13 +977,11 @@ (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-hostile gun-buoy ((obj gun-buoy)) (if (logtest? (-> obj flags) (gun-buoy-flags gubflags-1)) (go (method-of-object obj hostile)) (go (method-of-object obj warning)) ) - (none) ) (defmethod enemy-method-61 gun-buoy ((obj gun-buoy) (arg0 int)) diff --git a/goal_src/jak2/levels/common/entities/spydroid.gc b/goal_src/jak2/levels/common/entities/spydroid.gc index 464e14c05b5..15cdf95f8e3 100644 --- a/goal_src/jak2/levels/common/entities/spydroid.gc +++ b/goal_src/jak2/levels/common/entities/spydroid.gc @@ -824,7 +824,6 @@ ) ) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy die-falling) trans))) @@ -835,7 +834,6 @@ (if (< (- (current-time) (-> self state-time)) (seconds 2)) (spawn (-> self explode-part) (-> self root trans)) ) - (none) ) :code (behavior () (dotimes (v1-0 4) @@ -884,7 +882,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -917,7 +914,6 @@ ) (ja-channel-push! 1 (seconds 0.1)) (ja :group! spydroid-attack-jump-ja :num! min) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -930,7 +926,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (enemy-method-49 self) @@ -1003,7 +998,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior spydroid) sleep-code) :post (the-as (function none :behavior spydroid) nav-enemy-chase-post) @@ -1018,7 +1012,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -1080,7 +1073,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -1088,7 +1080,6 @@ (suspend) ) #f - (none) ) ) @@ -1137,7 +1128,6 @@ ) ) ) - (none) ) :code (behavior () (nav-enemy-method-165 self) @@ -1146,7 +1136,6 @@ (suspend) ) #f - (none) ) ) @@ -1195,7 +1184,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -1203,7 +1191,6 @@ (suspend) ) #f - (none) ) ) @@ -1252,7 +1239,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -1260,7 +1246,6 @@ (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/common/guard-projectile.gc b/goal_src/jak2/levels/common/guard-projectile.gc index 18c419cf53c..ea366b8c336 100644 --- a/goal_src/jak2/levels/common/guard-projectile.gc +++ b/goal_src/jak2/levels/common/guard-projectile.gc @@ -531,7 +531,6 @@ (send-event *traffic-manager* 'add-danger-sphere v1-5) ) ) - (none) ) ) @@ -768,16 +767,13 @@ (defstate impact (vehicle-grenade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touched) - (if (send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) - #t - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (if (send-event proc 'attack (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) + #t + ) + ) ) ) :code (behavior () @@ -802,7 +798,6 @@ (suspend) ) (deactivate self) - (none) ) ) @@ -902,7 +897,6 @@ :virtual #t :enter (behavior () (go-virtual impact) - (none) ) ) diff --git a/goal_src/jak2/levels/common/metalhead-projectile.gc b/goal_src/jak2/levels/common/metalhead-projectile.gc index 6bb5e70ddd4..7c55385bccd 100644 --- a/goal_src/jak2/levels/common/metalhead-projectile.gc +++ b/goal_src/jak2/levels/common/metalhead-projectile.gc @@ -722,8 +722,8 @@ (defstate impact (metalhead-grenade-shot) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (let* ((s4-0 proc) (v1-1 (if (type? s4-0 process-drawable) @@ -751,7 +751,7 @@ (set! (-> v1-6 action-mask) (collide-action solid)) ) (when (< (fill-and-probe-using-line-sphere *collide-cache* a1-3) 0.0) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) (let ((v1-15 (-> self notify-handle))) (if (handle->process v1-15) (send-event (-> v1-15 process 0) 'notify 'attack proc) @@ -790,7 +790,6 @@ (suspend) ) (deactivate self) - (none) ) ) @@ -798,7 +797,6 @@ :virtual #t :enter (behavior () (go-virtual impact) - (none) ) ) diff --git a/goal_src/jak2/levels/common/race/race-manager.gc b/goal_src/jak2/levels/common/race/race-manager.gc index 350185f699a..9fda30ea5ac 100644 --- a/goal_src/jak2/levels/common/race/race-manager.gc +++ b/goal_src/jak2/levels/common/race/race-manager.gc @@ -1360,7 +1360,6 @@ ) ) (go-virtual active) - (none) ) ) @@ -1435,7 +1434,6 @@ ) ) ) - (none) ) ) @@ -1494,11 +1492,9 @@ (suspend) ) #f - (none) ) :post (behavior () (update self) - (none) ) ) @@ -1537,11 +1533,9 @@ (suspend) ) #f - (none) ) :post (behavior () (update self) - (none) ) ) @@ -1557,7 +1551,6 @@ (suspend) ) #f - (none) ) ) @@ -1565,7 +1558,6 @@ :virtual #t :code (behavior () '() - (none) ) ) diff --git a/goal_src/jak2/levels/common/race/race-obs.gc b/goal_src/jak2/levels/common/race/race-obs.gc index bca7dfe2c13..5653af41d7d 100644 --- a/goal_src/jak2/levels/common/race/race-obs.gc +++ b/goal_src/jak2/levels/common/race/race-obs.gc @@ -43,7 +43,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior race-signal-banner) ja-post) ) @@ -155,7 +154,6 @@ ) (ja :num-func num-func-identity :frame-num (ja-aframe 0.0 0)) (go-virtual idle) - (none) ) ) @@ -165,7 +163,6 @@ :code (the-as (function none :behavior race-signal) sleep-code) :post (behavior () (race-signal-method-29 self) - (none) ) ) @@ -184,11 +181,9 @@ (suspend) ) #f - (none) ) :post (behavior () (race-signal-method-29 self) - (none) ) ) @@ -207,11 +202,9 @@ (suspend) ) #f - (none) ) :post (behavior () (race-signal-method-29 self) - (none) ) ) @@ -230,11 +223,9 @@ (suspend) ) #f - (none) ) :post (behavior () (race-signal-method-29 self) - (none) ) ) @@ -274,7 +265,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((f30-0 (* 0.0033333334 (the float (- (current-time) (-> self start-time)))))) @@ -284,7 +274,6 @@ ) ) (race-signal-method-29 self) - (none) ) ) @@ -292,7 +281,6 @@ :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -348,11 +336,9 @@ ) ) #f - (none) ) :post (behavior () (race-signal-method-29 self) - (none) ) ) @@ -594,11 +580,9 @@ ) ) (go-virtual active) - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -616,7 +600,6 @@ :enter (behavior () (format #t "errol-rider::taunt race-errol-pass~%") (speech-control-method-12 *speech-control* self (speech-type speech-type-53)) - (none) ) ) @@ -625,7 +608,6 @@ :enter (behavior () (format #t "errol-rider::got-passed~%") (speech-control-method-12 *speech-control* self (speech-type speech-type-54)) - (none) ) ) @@ -692,8 +674,8 @@ (defstate idle (turbo-pickup) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (when (-> self available) (when (send-event proc 'turbo-pickup) @@ -708,7 +690,6 @@ :post (behavior () (spawn (-> self part) (-> self root trans)) 0 - (none) ) ) @@ -759,7 +740,6 @@ (until (>= (- (current-time) (-> self state-time)) (seconds 2)) (suspend) ) - (none) ) ) diff --git a/goal_src/jak2/levels/common/race/vehicle-racer.gc b/goal_src/jak2/levels/common/race/vehicle-racer.gc index 487a772c70c..1a8449e8ca8 100644 --- a/goal_src/jak2/levels/common/race/vehicle-racer.gc +++ b/goal_src/jak2/levels/common/race/vehicle-racer.gc @@ -357,143 +357,124 @@ (none) ) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 16] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 43] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 49] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 108] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 156] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 166] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 275] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 295] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 318] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 324] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 329] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 219] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 242] ;; WARN: disable def twice: 12. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod rigid-body-object-method-46 vehicle-racer ((obj vehicle-racer) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'test-ready) - (and (and (-> obj next-state) (= (-> obj next-state name) 'waiting-for-start)) - (logtest? (-> obj flags) (rigid-body-object-flag riding)) - ) - ) - ((= v1-0 'begin-race) - (logclear! (-> obj focus-status) (focus-status grabbed)) - (when (and (-> obj next-state) (= (-> obj next-state name) 'waiting-for-start)) - (cond - ((logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag player-grabbed))) - ) - (go (method-of-object obj player-control)) - ) - (else - (go (method-of-object obj racing)) - ) - ) + (case arg2 + (('test-ready) + (and (and (-> obj next-state) (= (-> obj next-state name) 'waiting-for-start)) + (logtest? (-> obj flags) (rigid-body-object-flag riding)) + ) + ) + (('begin-race) + (logclear! (-> obj focus-status) (focus-status grabbed)) + (when (and (-> obj next-state) (= (-> obj next-state name) 'waiting-for-start)) + (cond + ((logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (set! (-> obj flags) + (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag player-grabbed))) + ) + (go (method-of-object obj player-control)) + ) + (else + (go (method-of-object obj racing)) ) ) - ((= v1-0 'turbo-pickup) - (when (< (-> obj turbo-pickup-count) 3) - (sound-play "turbo-pickup") - (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (sound-play "turbo-pickup-pl") - (send-event *target* 'color-effect 'eco-pill-dark (seconds 0.2)) - ) - (+! (-> obj turbo-pickup-count) 1) - #t - ) + ) + ) + (('turbo-pickup) + (when (< (-> obj turbo-pickup-count) 3) + (sound-play "turbo-pickup") + (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (sound-play "turbo-pickup-pl") + (send-event *target* 'color-effect 'eco-pill-dark (seconds 0.2)) ) - ((= v1-0 'race-decision-point) - (when (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) - (let* ((v1-37 (the-as race-decision-point (-> arg3 param 0))) - (a0-16 (-> v1-37 decision-type)) - ) - (cond - ((zero? a0-16) - (cond - ((and (nonzero? (-> v1-37 shortcuts)) - (>= (-> obj race racer-state speed-factor) (-> obj race state info ai-max-speed-factor)) - (< 0.1 (- (+ (-> obj race state target-pos) (-> obj race racer-state target-pos-offset)) - (-> obj race racer-state pos) - ) - ) - ) - (select-path-randomly-from-mask obj (-> v1-37 shortcuts)) - (set! (-> obj shortcut-time) (current-time)) - (set! (-> obj shortcut-speed-factor) 1.0) - ) - (else - (select-path-randomly-from-mask obj (-> v1-37 safe-paths)) - (set! (-> obj shortcut-speed-factor) 0.0) + (+! (-> obj turbo-pickup-count) 1) + #t + ) + ) + (('race-decision-point) + (when (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) + (let* ((v1-37 (the-as race-decision-point (-> arg3 param 0))) + (a0-16 (-> v1-37 decision-type)) + ) + (cond + ((zero? a0-16) + (cond + ((and (nonzero? (-> v1-37 shortcuts)) + (>= (-> obj race racer-state speed-factor) (-> obj race state info ai-max-speed-factor)) + (< 0.1 (- (+ (-> obj race state target-pos) (-> obj race racer-state target-pos-offset)) + (-> obj race racer-state pos) + ) + ) ) - ) - ) - ((= a0-16 1) - (when (and (> (-> obj turbo-pickup-count) 0) - (< (-> obj path-deviation) 1.0) - (>= (-> obj race racer-state speed-factor) (-> obj race state info ai-max-speed-factor)) - ) - (rigid-body-object-method-38 obj) - (vehicle-method-66 obj) - ) - ) + (select-path-randomly-from-mask obj (-> v1-37 shortcuts)) + (set! (-> obj shortcut-time) (current-time)) + (set! (-> obj shortcut-speed-factor) 1.0) ) - ) + (else + (select-path-randomly-from-mask obj (-> v1-37 safe-paths)) + (set! (-> obj shortcut-speed-factor) 0.0) + ) + ) + ) + ((= a0-16 1) + (when (and (> (-> obj turbo-pickup-count) 0) + (< (-> obj path-deviation) 1.0) + (>= (-> obj race racer-state speed-factor) (-> obj race state info ai-max-speed-factor)) + ) + (rigid-body-object-method-38 obj) + (vehicle-method-66 obj) + ) + ) ) ) - ((= v1-0 'hide) - (logior! (-> obj draw status) (draw-control-status no-draw)) - (send-event (ppointer->process (-> obj child)) 'hide) - ) - ((= v1-0 'unhide) - (logclear! (-> obj draw status) (draw-control-status no-draw)) - (send-event (ppointer->process (-> obj child)) 'unhide) - ) - ((= v1-0 'race-pass) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (speech-control-method-12 *speech-control* obj (if (-> *target* pilot as-daxter?) - (speech-type speech-type-45) - (speech-type speech-type-36) - ) - ) - (send-event (ppointer->process (-> obj child)) 'race-pass) - ) + ) + ) + (('hide) + (logior! (-> obj draw status) (draw-control-status no-draw)) + (send-event (ppointer->process (-> obj child)) 'hide) + ) + (('unhide) + (logclear! (-> obj draw status) (draw-control-status no-draw)) + (send-event (ppointer->process (-> obj child)) 'unhide) + ) + (('race-pass) + (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (speech-control-method-12 *speech-control* obj (if (-> *target* pilot as-daxter?) + (speech-type speech-type-45) + (speech-type speech-type-36) + ) + ) + (send-event (ppointer->process (-> obj child)) 'race-pass) ) - ((= v1-0 'race-got-passed) - (if (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) - (send-event (ppointer->process (-> obj child)) 'race-got-passed) - ) + ) + (('race-got-passed) + (if (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) + (send-event (ppointer->process (-> obj child)) 'race-got-passed) ) - ((= v1-0 'race-finished) - (let ((s5-2 (-> arg3 param 0))) - (select-path-randomly-from-mask obj s5-2) - (set! (-> obj damage-factor) 0.0) - (cond - ((logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag player-grabbed) (-> obj flags))) - ) - (when (zero? s5-2) - (set! (-> obj race path) #f) - #f + ) + (('race-finished) + (let ((s5-2 (-> arg3 param 0))) + (select-path-randomly-from-mask obj s5-2) + (set! (-> obj damage-factor) 0.0) + (cond + ((logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (set! (-> obj flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag player-grabbed) (-> obj flags))) ) - ) - (else - (go (method-of-object obj race-finished)) - ) - ) + (when (zero? s5-2) + (set! (-> obj race path) #f) + #f + ) + ) + (else + (go (method-of-object obj race-finished)) ) ) - (else - ((method-of-type vehicle rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) - ) - ) + ) + ) + (else + ((method-of-type vehicle rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) ) ) ) @@ -928,7 +909,6 @@ 0 ) ) - (none) ) :exit (behavior () (set! (-> self hit-points) 1.0) @@ -951,7 +931,6 @@ (set! (-> v1-4 prim-core collide-as) (collide-spec vehicle-sphere)) ) ) - (none) ) :trans (the-as (function none :behavior vehicle-racer) #f) :code (the-as (function none :behavior vehicle-racer) sleep-code) @@ -966,7 +945,6 @@ (update-transforms (-> self root)) (vehicle-method-119 self) (rigid-body-object-method-39 self) - (none) ) ) @@ -981,7 +959,6 @@ (set! (-> self damage-factor) (-> self info damage-factor)) (vehicle-method-143 self) (logior! (-> self flags) (rigid-body-object-flag ignition)) - (none) ) :code (the-as (function none :behavior vehicle-racer) sleep-code) :post (behavior () @@ -995,7 +972,6 @@ (clear-momentum! (-> self rbody state)) (vehicle-method-120 self) (vehicle-method-119 self) - (none) ) ) @@ -1011,7 +987,6 @@ (set! (-> self controls throttle) 0.0) (set! (-> self controls brake) 0.0) (set! (-> self controls steering) 0.0) - (none) ) :exit (behavior () (logclear! (-> self flags) (rigid-body-object-flag waiting-for-player)) @@ -1033,13 +1008,11 @@ (set! (-> v1-3 prim-core collide-as) (collide-spec vehicle-sphere)) ) ) - (none) ) :trans (the-as (function none :behavior vehicle-racer) #f) :code (the-as (function none :behavior vehicle-racer) sleep-code) :post (behavior () (vehicle-racer-method-152 self) - (none) ) ) @@ -1059,12 +1032,10 @@ (set! (-> self controls throttle) 0.0) (set! (-> self controls brake) 0.0) (set! (-> self controls steering) 0.0) - (none) ) :trans (the-as (function none :behavior vehicle-racer) #f) :code (the-as (function none :behavior vehicle-racer) sleep-code) :post (behavior () (vehicle-racer-method-155 self) - (none) ) ) diff --git a/goal_src/jak2/levels/common/scene-actor.gc b/goal_src/jak2/levels/common/scene-actor.gc index 525ce6ac5f9..ff44e698a2d 100644 --- a/goal_src/jak2/levels/common/scene-actor.gc +++ b/goal_src/jak2/levels/common/scene-actor.gc @@ -333,7 +333,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior metalkor-highres) ja-post) ) @@ -828,7 +827,6 @@ This commonly includes things such as: ) (process-taskable-anim-loop (lambda ((arg0 process-taskable)) (handle->process (-> arg0 slave)))) (go-virtual idle) - (none) ) ) diff --git a/goal_src/jak2/levels/common/scene-looper.gc b/goal_src/jak2/levels/common/scene-looper.gc index 5757d1b86dd..ae1e3e4d24d 100644 --- a/goal_src/jak2/levels/common/scene-looper.gc +++ b/goal_src/jak2/levels/common/scene-looper.gc @@ -27,7 +27,6 @@ :virtual #t :exit (behavior () (kill-by-type scene-player *active-pool*) - (none) ) :code (behavior () (until #f @@ -42,7 +41,6 @@ ) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/common/warp-gate.gc b/goal_src/jak2/levels/common/warp-gate.gc index f2d93cb2967..2dfb6c41870 100644 --- a/goal_src/jak2/levels/common/warp-gate.gc +++ b/goal_src/jak2/levels/common/warp-gate.gc @@ -506,8 +506,8 @@ (defstate idle (warp-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide) (go-virtual hidden) ) @@ -603,38 +603,34 @@ (ja :num! (loop! (-> self anim-speed))) ) #f - (none) ) ) (defstate use (warp-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('effect) - (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 130) - 0 - #f - #f - #f - (-> self node-list data 4 bone transform) - :to *entity-pool* - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('effect) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 130) + 0 + #f + #f + #f + (-> self node-list data 4 bone transform) + :to *entity-pool* + ) + ) + ) ) :exit (behavior () (remove-setting! 'mode-name) (remove-setting! 'interp-time) - (none) ) :trans (behavior () (send-event *camera* 'joystick 0.0 0.0) - (none) ) :code (behavior ((arg0 continue-point)) (local-vars (v1-38 symbol)) @@ -709,7 +705,6 @@ ) (logior! (-> self mask) (process-mask actor-pause)) (go-virtual idle) - (none) ) ) @@ -826,8 +821,8 @@ This commonly includes things such as: ) (defstate target-warp-out (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('death-end) (let ((v0-0 (the-as object (logior (-> self draw status) (draw-control-status no-draw))))) (set! (-> self draw status) (the-as draw-control-status v0-0)) @@ -840,7 +835,7 @@ This commonly includes things such as: ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -861,11 +856,9 @@ This commonly includes things such as: (vector-! (new 'stack-no-clear 'vector) arg1 (-> self control trans)) (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) ) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags sf6)) - (none) ) :code (behavior ((arg0 vector) (arg1 vector) (arg2 target)) (ja-channel-push! 1 (seconds 0.2)) @@ -960,7 +953,6 @@ This commonly includes things such as: (ja :num! (seek! (ja-aframe 40.0 0))) ) (sleep-code) - (none) ) :post target-no-stick-post ) @@ -970,7 +962,6 @@ This commonly includes things such as: :enter (behavior ((arg0 vector) (arg1 vector) (arg2 target)) (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float arg2)) ((-> target-warp-out enter) arg0 arg1 arg2) - (none) ) :exit (-> target-warp-out exit) :trans (behavior () @@ -983,7 +974,6 @@ This commonly includes things such as: (if (logtest? (-> self control status) (collide-status on-surface)) (go target-hit-ground #f) ) - (none) ) :code (behavior ((arg0 vector) (arg1 vector) (arg2 target)) (let ((a0-1 (-> self control did-move-to-pole-or-max-jump-height))) @@ -1097,7 +1087,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (target-falling-anim -1 (seconds 0.33)) - (none) ) :post target-no-move-post ) @@ -1253,7 +1242,6 @@ This commonly includes things such as: ) ) (sound-play "air-train" :id (-> self hover-sound) :position (-> self root trans)) - (none) ) ) @@ -1275,7 +1263,6 @@ This commonly includes things such as: (set! (-> self hover-sound) (new 'static 'sound-id)) (script-eval (-> self on-activate)) (sleep-code) - (none) ) ) diff --git a/goal_src/jak2/levels/consite/consite-obs.gc b/goal_src/jak2/levels/consite/consite-obs.gc index e2e3a83fdd1..a0a2c363c63 100644 --- a/goal_src/jak2/levels/consite/consite-obs.gc +++ b/goal_src/jak2/levels/consite/consite-obs.gc @@ -95,7 +95,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior consite-bomb-elevator-hinges) ja-post) ) @@ -170,7 +169,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior consite-bomb-elevator) ja-post) ) @@ -252,7 +250,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior consite-silo-doors) ja-post) ) diff --git a/goal_src/jak2/levels/demo/demo-obs.gc b/goal_src/jak2/levels/demo/demo-obs.gc index 3ecefc254a4..63392b95976 100644 --- a/goal_src/jak2/levels/demo/demo-obs.gc +++ b/goal_src/jak2/levels/demo/demo-obs.gc @@ -359,7 +359,7 @@ ) (send-event (handle->process (-> *game-info* controller 0)) 'pause) (time-of-day-setup #t) - (the-as object (remove-setting! 'half-speed)) + (remove-setting! 'half-speed) ) ) ) @@ -552,16 +552,15 @@ (defstate idle (demo-control) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('pause) - (let ((v0-0 2)) - (set! (-> *game-info* demo-state) (the-as uint v0-0)) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pause) + (let ((v0-0 2)) + (set! (-> *game-info* demo-state) (the-as uint v0-0)) + v0-0 + ) + ) + ) ) :code (behavior () (let ((v1-1 (-> *game-info* demo-state))) @@ -860,7 +859,6 @@ ) ) (sleep-code) - (none) ) :post (behavior () (local-vars (v1-70 external-art-buffer)) @@ -981,7 +979,6 @@ ) ) ) - (none) ) ) @@ -1068,12 +1065,12 @@ ) (defstate target-demo (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('grab) - (if (not (-> event param 1)) + (if (not (-> block param 1)) #t (go target-grab 'stance) ) @@ -1081,7 +1078,7 @@ ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -1105,7 +1102,6 @@ (ppointer->handle (process-spawn demo-control :init demo-control-init :to *entity-pool*)) ) ) - (none) ) :code (the-as (function symbol none :behavior target) sleep-code) :post target-no-move-post diff --git a/goal_src/jak2/levels/dig/dig-digger.gc b/goal_src/jak2/levels/dig/dig-digger.gc index 504ce501dd3..72282391cda 100644 --- a/goal_src/jak2/levels/dig/dig-digger.gc +++ b/goal_src/jak2/levels/dig/dig-digger.gc @@ -574,13 +574,12 @@ (defstate broken (dig-clasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('broken?) - #t - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('broken?) + #t + ) + ) ) :enter (behavior () (when (-> self conn) @@ -602,20 +601,18 @@ ) ) (ja-post) - (none) ) :code (the-as (function none :behavior dig-clasp) sleep-code) ) (defstate break-it (dig-clasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('broken?) - #t - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('broken?) + #t + ) + ) ) :enter (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) @@ -642,7 +639,6 @@ :to self ) ) - (none) ) :trans (behavior () (ja :num! (seek!)) @@ -652,7 +648,6 @@ (if (ja-done? 0) (go-virtual broken) ) - (none) ) :code (the-as (function none :behavior dig-clasp) sleep-code) :post (the-as (function none :behavior dig-clasp) ja-post) @@ -660,13 +655,13 @@ (defstate idle (dig-clasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('tether-position) - (dig-clasp-method-23 self (the-as vector (-> event param 0))) + (dig-clasp-method-23 self (the-as vector (-> block param 0))) ) (('attack) - (let ((v1-2 (the-as attack-info (-> event param 1)))) + (let ((v1-2 (the-as attack-info (-> block param 1)))) (when (and (logtest? (-> v1-2 mask) (attack-mask mode)) (= (-> v1-2 mode) 'board)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 85 (seconds 0.1)) (go-virtual break-it) @@ -680,7 +675,6 @@ ) :enter (behavior () (ja-post) - (none) ) :code (the-as (function none :behavior dig-clasp) sleep-code) ) @@ -969,38 +963,35 @@ This commonly includes things such as: ;; WARN: Return type mismatch vector vs object. (defbehavior dig-tether-handler dig-tether ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('set-pos) - (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> self digger-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) - (let ((v0-0 (-> self digger-vertical))) - (set! (-> v0-0 quad) (-> (the-as vector (-> arg3 param 2)) quad)) - v0-0 - ) - ) - ) - ) + (case arg2 + (('set-pos) + (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set! (-> self digger-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (let ((v0-0 (-> self digger-vertical))) + (set! (-> v0-0 quad) (-> (the-as vector (-> arg3 param 2)) quad)) + v0-0 + ) + ) + ) ) (defstate broken (dig-tether) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('broken?) #t ) (else - (dig-tether-handler proc arg1 event-type event) + (dig-tether-handler proc argc message block) ) ) ) :enter (behavior () (dig-tether-method-23 self) - (none) ) :trans (behavior () (dig-tether-method-24 self) - (none) ) :code (the-as (function none :behavior dig-tether) sleep-code) :post (the-as (function none :behavior dig-tether) ja-post) @@ -1014,7 +1005,6 @@ This commonly includes things such as: (set-params! (-> self frame) 0.5 0.01 0.02 0.97) (set-params! (-> self frame-kicker) 9 30 0.4) (set! (-> self old-dist) 0.0) - (none) ) :trans (behavior () (dig-tether-method-22 self) @@ -1045,7 +1035,6 @@ This commonly includes things such as: (update! (-> self frame) (-> self frame-kicker value)) (ja :num-func num-func-identity :frame-num (* 10.0 (-> self frame value))) ) - (none) ) :code (the-as (function none :behavior dig-tether) sleep-code) :post (the-as (function none :behavior dig-tether) ja-post) @@ -1247,11 +1236,11 @@ This commonly includes things such as: (defstate idle (dig-digger) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape (-> self root)) (the-as uint 1) ) @@ -1261,7 +1250,7 @@ This commonly includes things such as: ) ) (when a0-7 - (if (send-event a0-7 'attack (-> event param 0) (static-attack-info ((id (new-attack-id))))) + (if (send-event a0-7 'attack (-> block param 0) (static-attack-info ((id (new-attack-id))))) #f ) ) @@ -1284,14 +1273,12 @@ This commonly includes things such as: (dig-digger-method-23 self) (set! (-> self motor-sound) (new-sound-id)) (set! (-> self bit-sound) (new-sound-id)) - (none) ) :exit (behavior () (sound-stop (-> self motor-sound)) (sound-stop (-> self bit-sound)) (send-event (handle->process (-> self hud-counter)) 'hide-and-die) (set! (-> self hud-counter) (the-as handle #f)) - (none) ) :trans (behavior () (let ((f0-0 (vector-vector-distance-squared (ear-trans 0) (-> self root trans))) @@ -1343,26 +1330,23 @@ This commonly includes things such as: (if (nonzero? (-> self part)) (spawn (-> self part) (-> self root trans)) ) - (none) ) :code (the-as (function none :behavior dig-digger) sleep-code) :post (behavior () (transform-post) (dig-digger-method-24 self) - (none) ) ) (defstate hidden (dig-digger) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v1-0 message) (a0-1 'explode) ) - (the-as object (if (= v1-0 a0-1) - (set-dig1-explosion! (the-as float a0-1)) - ) - ) + (if (= v1-0 a0-1) + (set-dig1-explosion! (the-as float a0-1)) + ) ) ) :enter (behavior () @@ -1370,7 +1354,6 @@ This commonly includes things such as: (deactivate (-> self child 0)) ) (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior dig-digger) sleep-code) ) diff --git a/goal_src/jak2/levels/dig/dig-obs.gc b/goal_src/jak2/levels/dig/dig-obs.gc index 00b379a6e94..92d66d8e5d4 100644 --- a/goal_src/jak2/levels/dig/dig-obs.gc +++ b/goal_src/jak2/levels/dig/dig-obs.gc @@ -232,13 +232,13 @@ (defstate idle (dig-sinking-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (set! (-> self last-ridden-time) (current-time)) ) ) - (rigid-body-object-event-handler proc arg1 event-type event) + (rigid-body-object-event-handler proc argc message block) ) ) @@ -549,11 +549,9 @@ :virtual #t :enter (behavior () (set-setting! 'ignore-target #t 0.0 0) - (none) ) :exit (behavior () (remove-setting! 'ignore-target) - (none) ) :code (behavior () (local-vars (v1-12 object)) @@ -654,7 +652,6 @@ (suspend) ) (go-virtual idle) - (none) ) :post (the-as (function none :behavior dig-log) transform-post) ) @@ -759,17 +756,14 @@ This commonly includes things such as: (defstate idle-up (dig-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (when (logtest? (-> (the-as attack-info (-> event param 1)) penetrate-using) (penetrate flop)) - (go-virtual going-down) - #f - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (logtest? (-> (the-as attack-info (-> block param 1)) penetrate-using) (penetrate flop)) + (go-virtual going-down) + #f ) - ) + ) ) ) :code (behavior () @@ -777,7 +771,6 @@ This commonly includes things such as: (suspend) (transform-post) (sleep-code) - (none) ) ) @@ -799,7 +792,6 @@ This commonly includes things such as: ) ) (go-virtual idle-down) - (none) ) ) @@ -811,7 +803,6 @@ This commonly includes things such as: (suspend) (transform-post) (sleep-code) - (none) ) ) diff --git a/goal_src/jak2/levels/dig/dig1-obs.gc b/goal_src/jak2/levels/dig/dig1-obs.gc index b4d2da72294..6bac96e1255 100644 --- a/goal_src/jak2/levels/dig/dig1-obs.gc +++ b/goal_src/jak2/levels/dig/dig1-obs.gc @@ -390,7 +390,6 @@ :virtual #t :code (behavior () (go-virtual die) - (none) ) ) @@ -404,7 +403,6 @@ ) (set! (-> self flash-counter) 0) 0 - (none) ) :trans (behavior () (let ((v1-2 (ja-group))) @@ -440,7 +438,6 @@ ) ) ) - (none) ) :code (behavior () (let ((f30-0 (rand-vu-float-range 0.22 0.27))) @@ -572,7 +569,6 @@ ) ) (go-virtual die) - (none) ) ) @@ -586,7 +582,6 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (behavior () (sound-play "dig-bomb-explo") @@ -605,7 +600,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -884,8 +878,8 @@ (defstate idle (dig-bomb-crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual die) @@ -918,7 +912,6 @@ (dig-bomb-crate-method-29 self (get-trans a0-4 0)) ) ) - (none) ) :code (behavior () (suspend) @@ -956,7 +949,6 @@ ) ) (cleanup-for-death self) - (none) ) ) @@ -1122,6 +1114,5 @@ This commonly includes things such as: ((the-as (function none) t9-6)) ) ) - (none) ) ) diff --git a/goal_src/jak2/levels/dig/dig2-obs.gc b/goal_src/jak2/levels/dig/dig2-obs.gc index c4afc0c87c4..e819f5d6237 100644 --- a/goal_src/jak2/levels/dig/dig2-obs.gc +++ b/goal_src/jak2/levels/dig/dig2-obs.gc @@ -37,7 +37,6 @@ (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/dig/dig3-obs.gc b/goal_src/jak2/levels/dig/dig3-obs.gc index 1af4c86eac0..7d66c05bc53 100644 --- a/goal_src/jak2/levels/dig/dig3-obs.gc +++ b/goal_src/jak2/levels/dig/dig3-obs.gc @@ -315,7 +315,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a2-1 (quaternion-vector-angle! @@ -328,7 +327,6 @@ (quaternion*! (-> self root quat) (-> self init-quat) a2-1) ) (rider-post) - (none) ) ) @@ -434,7 +432,6 @@ This commonly includes things such as: ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (behavior () (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -459,7 +456,6 @@ This commonly includes things such as: ((the-as (function none) t9-7)) ) ) - (none) ) ) @@ -680,7 +676,6 @@ This commonly includes things such as: (go-virtual active) ) ) - (none) ) :code (the-as (function none :behavior dig-spikey-sphere-door) sleep-code) ) @@ -731,7 +726,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (go-virtual idle) - (none) ) :post (the-as (function none :behavior dig-spikey-sphere-door) ja-post) ) @@ -903,7 +897,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior dig-balloon-lurker-trapeze) ja-post) ) @@ -1187,7 +1180,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior dig-balloon-lurker) transform-post) ) @@ -1216,7 +1208,6 @@ This commonly includes things such as: :trans (behavior () (sound-play "wheel-plat-loop" :id (-> self wheel-sound-id)) (rider-trans) - (none) ) :code (behavior () (until #f @@ -1230,7 +1221,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior dig-wheel-step) rider-post) ) @@ -1398,19 +1388,18 @@ This commonly includes things such as: (defstate idle (dig-tipping-rock) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (set! (-> self last-ridden-time) (current-time)) ) ) - (rigid-body-object-event-handler proc arg1 event-type event) + (rigid-body-object-event-handler proc argc message block) ) :trans (the-as (function none :behavior dig-tipping-rock) rider-trans) :code (the-as (function none :behavior dig-tipping-rock) sleep-code) :post (behavior () (rigid-body-object-method-37 self) - (none) ) ) @@ -1624,8 +1613,8 @@ This commonly includes things such as: (defstate waiting (dig-stomp-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('set-flag) (let ((v0-0 (the-as object #t))) (set! (-> self flag) (the-as basic v0-0)) @@ -1637,7 +1626,7 @@ This commonly includes things such as: #f ) (('attack) - (case (-> (the-as attack-info (-> event param 1)) mode) + (case (-> (the-as attack-info (-> block param 1)) mode) (('flop) (when (not (-> self flag)) (set! (-> self desty) (+ -12288.0 (-> self root trans y))) @@ -1659,8 +1648,8 @@ This commonly includes things such as: (defstate hit (dig-stomp-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('broken) (go-virtual active) ) @@ -1677,7 +1666,6 @@ This commonly includes things such as: (set! (-> self flag) #f) (send-event (ppointer->process (-> self parent)) 'clear-flag) (go-virtual waiting) - (none) ) :post (the-as (function none :behavior dig-stomp-block) transform-post) ) @@ -1698,7 +1686,6 @@ This commonly includes things such as: (set! (-> gp-0 z) (rand-vu-float-range -10000.0 10000.0)) (vector-float*! (-> self rbody state ang-momentum) gp-0 (-> self info info mass)) ) - (none) ) ) @@ -1886,26 +1873,25 @@ This commonly includes things such as: (defstate idle (dig-stomp-block-controller) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('set-flag) - (dotimes (gp-0 4) - (if (-> self stomp-blocks gp-0) - (send-event (ppointer->process (-> self stomp-blocks gp-0)) 'set-flag) - ) - ) - #f - ) - (('clear-flag) - (dotimes (gp-1 4) - (if (-> self stomp-blocks gp-1) - (send-event (ppointer->process (-> self stomp-blocks gp-1)) 'clear-flag) - ) - ) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('set-flag) + (dotimes (gp-0 4) + (if (-> self stomp-blocks gp-0) + (send-event (ppointer->process (-> self stomp-blocks gp-0)) 'set-flag) + ) + ) + #f + ) + (('clear-flag) + (dotimes (gp-1 4) + (if (-> self stomp-blocks gp-1) + (send-event (ppointer->process (-> self stomp-blocks gp-1)) 'clear-flag) + ) + ) + #f + ) + ) ) :enter (behavior () (change-parent self *pusher-pool*) @@ -1916,7 +1902,6 @@ This commonly includes things such as: (set! (-> self stomp-blocks s5-0) (process-spawn dig-stomp-block gp-0 :to self)) ) ) - (none) ) :code (the-as (function none :behavior dig-stomp-block-controller) sleep-code) :post (behavior () @@ -1948,7 +1933,6 @@ This commonly includes things such as: ) ) ) - (none) ) ) diff --git a/goal_src/jak2/levels/drill/drill-baron.gc b/goal_src/jak2/levels/drill/drill-baron.gc index 9a210da7c40..90b0b80ac30 100644 --- a/goal_src/jak2/levels/drill/drill-baron.gc +++ b/goal_src/jak2/levels/drill/drill-baron.gc @@ -1152,15 +1152,14 @@ This commonly includes things such as: (suspend) (ja :num! (seek!)) ) - (none) ) :post (the-as (function none :behavior drill-barons-ship-explode) ja-post) ) (defstate hidden (drill-barons-ship) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger-back) (set! (-> self pass) 1) (dotimes (gp-0 (length *ship-turrets-first-pass*)) @@ -1201,7 +1200,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (cond @@ -1236,7 +1234,6 @@ This commonly includes things such as: #f ) ) - (none) ) :post (behavior () (set! (-> self current-y-position) @@ -1255,20 +1252,18 @@ This commonly includes things such as: ) (drill-barons-ship-method-22 self) (transform-post) - (none) ) ) (defstate idle (drill-barons-ship) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('pass-complete?) - (set! (-> self end-of-pass) #t) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pass-complete?) + (set! (-> self end-of-pass) #t) + #f + ) + ) ) :enter (behavior () (set-setting! 'music 'danger4 0.0 0) @@ -1283,11 +1278,9 @@ This commonly includes things such as: (set! (-> self inc-y) 2048.0) (set! (-> self ease-y) 40960.0) (set! (-> self end-of-pass) #f) - (none) ) :exit (behavior () (remove-setting! 'music) - (none) ) :code (behavior () (until #f @@ -1295,7 +1288,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (let ((gp-0 (if (= (-> self pass) 1) @@ -1377,7 +1369,6 @@ This commonly includes things such as: (drill-barons-ship-method-22 self) (+! (-> self x-offset-angle) (* 0.7 (-> self clock time-adjust-ratio))) (transform-post) - (none) ) ) @@ -1494,7 +1485,6 @@ This commonly includes things such as: ) 0 (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (vector<-cspace! @@ -1509,7 +1499,6 @@ This commonly includes things such as: ) (go-virtual going-down) ) - (none) ) :code (behavior () (until #f @@ -1517,11 +1506,9 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (transform-post) - (none) ) ) @@ -1619,7 +1606,6 @@ This commonly includes things such as: ) ) ) - (none) ) :trans (behavior () (vector<-cspace! @@ -1632,7 +1618,6 @@ This commonly includes things such as: ) (go-virtual dead) ) - (none) ) :code (behavior () (until #f @@ -1640,11 +1625,9 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (transform-post) - (none) ) ) @@ -1681,8 +1664,8 @@ This commonly includes things such as: (defstate attack (drill-barons-ship-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (when (and (-> self info alive) (= (-> self anim-frame) 1.0)) (+! (-> self hit-count) 1) @@ -1813,7 +1796,6 @@ This commonly includes things such as: (if (zero? (-> self info mesh)) (set! (-> self soundid) (sound-play "ship-gun1-chain")) ) - (none) ) :exit (behavior () (if (zero? (-> self info mesh)) @@ -1835,7 +1817,6 @@ This commonly includes things such as: (sound-play "ship-gun1-down") ) ) - (none) ) :code (behavior () (cond @@ -1873,7 +1854,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (drill-barons-ship-turret-method-24 self) @@ -1979,7 +1959,6 @@ This commonly includes things such as: (go-virtual idle) ) (transform-post) - (none) ) ) @@ -1988,7 +1967,6 @@ This commonly includes things such as: :enter (behavior () (set! (-> self hit-count) 0) 0 - (none) ) :code (behavior () (until #f @@ -2015,7 +1993,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (cond @@ -2030,6 +2007,5 @@ This commonly includes things such as: ) ) (transform-post) - (none) ) ) diff --git a/goal_src/jak2/levels/drill/drill-mech-master.gc b/goal_src/jak2/levels/drill/drill-mech-master.gc index 920049536d7..faa27520b5b 100644 --- a/goal_src/jak2/levels/drill/drill-mech-master.gc +++ b/goal_src/jak2/levels/drill/drill-mech-master.gc @@ -150,7 +150,6 @@ (set! (-> self next-warn-time) (+ (current-time) (seconds 10))) (talker-spawn-func (-> *talker-speech* 182) *entity-pool* (target-pos 0) (the-as region #f)) ) - (none) ) :code (the-as (function none :behavior drill-mech-master) sleep-code) ) @@ -179,7 +178,6 @@ ) ) (go-virtual hostile) - (none) ) ) @@ -192,7 +190,6 @@ (set! (-> self next-warn-time) (+ (current-time) (seconds 1))) (set! (-> self started-timer-time) (current-time)) (set! (-> self exited?) #f) - (none) ) :trans (behavior () (if (and (-> self exited?) (process-grab? *target* #f)) @@ -226,12 +223,10 @@ ) ) ) - (none) ) :code (behavior () (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to self))) (sleep-code) - (none) ) ) @@ -242,13 +237,11 @@ (set! (-> self state-time) (current-time)) (set-setting! 'allow-pause #f 0.0 0) (set-setting! 'allow-progress #f 0.0 0) - (none) ) :exit (behavior () (disable *screen-filter*) (remove-setting! 'allow-pause) (remove-setting! 'allow-progress) - (none) ) :trans (behavior () (when (and (not (-> self killed-jak?)) @@ -264,7 +257,6 @@ (bucket-id tex-all-map) ) ) - (none) ) :code (behavior () (remove-setting! 'music) @@ -308,7 +300,6 @@ ) ) (sleep-code) - (none) ) ) @@ -329,7 +320,6 @@ ) (process-release? *target*) (sleep-code) - (none) ) ) @@ -410,7 +400,7 @@ TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () (let ((v0-3 (ppointer->handle (process-spawn drill-mech-master :to self)))) (set! (-> self slave 0) (the-as handle v0-3)) - (the-as object v0-3) + v0-3 ) ) ) diff --git a/goal_src/jak2/levels/drill/drill-obs.gc b/goal_src/jak2/levels/drill/drill-obs.gc index 7c2c3972e46..e12f2086146 100644 --- a/goal_src/jak2/levels/drill/drill-obs.gc +++ b/goal_src/jak2/levels/drill/drill-obs.gc @@ -133,8 +133,8 @@ and translate the platform via the `smush` (defstate idle (drill-plat-falling) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden 'edge-grabbed) (start-bouncing! self) (go-virtual falling) @@ -144,7 +144,6 @@ and translate the platform via the `smush` :enter (behavior () (ja :group! (-> self draw art-group data 2) :num! min) (logior! (-> self root root-prim prim-core action) (collide-action rideable)) - (none) ) :trans drill-plat-falling-trans :code (the-as (function none :behavior drill-plat-falling) sleep-code) @@ -158,7 +157,6 @@ and translate the platform via the `smush` (logclear! (-> self root root-prim prim-core action) (collide-action rideable)) ) (drill-plat-falling-trans) - (none) ) :code (behavior () (ja-no-eval :group! (ja-group) @@ -170,7 +168,6 @@ and translate the platform via the `smush` (ja :num! (seek!)) ) (go-virtual idle) - (none) ) :post (the-as (function none :behavior drill-plat-falling) plat-post) ) @@ -305,7 +302,6 @@ This commonly includes things such as: ) ) #f - (none) ) ) @@ -339,7 +335,6 @@ This commonly includes things such as: ) (logclear! (-> self elevator-status) (elevator-status waiting-to-ascend)) (sleep-code) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type elevator running) post))) @@ -348,7 +343,6 @@ This commonly includes things such as: ) ) (set-extent! (-> self shaft 0) (-> self root trans)) - (none) ) ) @@ -365,7 +359,6 @@ This commonly includes things such as: (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) (-> self skel root-channel 0) (ja-post) - (none) ) :code (behavior () (until #f @@ -384,7 +377,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -535,7 +527,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) (set! (-> self running-sound-id) (sound-play "mech-lift")) - (none) ) :exit (behavior () (remove-setting! 'pilot) @@ -546,7 +537,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) (sound-stop (-> self running-sound-id)) - (none) ) :code (behavior () (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) @@ -569,7 +559,6 @@ For example for an elevator pre-compute the distance between the first and last (sound-stop (-> self sound-id)) (logclear! (-> self elevator-status) (elevator-status waiting-to-ascend)) (sleep-code) - (none) ) ) @@ -672,63 +661,60 @@ For example for an elevator pre-compute the distance between the first and last (defstate idle (fire-floor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touch 'attack) - (let* ((s4-0 proc) - (gp-0 (if (type? s4-0 process-focusable) - s4-0 - ) - ) - ) - (when gp-0 - (when (or (focus-test? (the-as process-focusable gp-0) mech) - (>= (- (current-time) (-> self no-collision-timer)) - (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) - ) - ) - (let ((f0-0 (get-norm! (-> self sync) 0))) - (when (and (< (-> self generous) f0-0) (< f0-0 (- (-> self flames-end-tt) (-> self generous)))) - (let ((s4-1 (new 'stack-no-clear 'vector))) - (vector-matrix*! s4-1 (get-trans (the-as process-focusable gp-0) 0) (-> self world-to-local)) - (when (and (>= (-> s4-1 x) 0.0) - (>= (-> self deadly-width) (-> s4-1 x)) - (>= (-> s4-1 z) 0.0) - (>= (-> self deadly-length) (-> s4-1 z)) - (>= (-> s4-1 y) -2048.0) - (>= 2048.0 (-> s4-1 y)) - ) - (let ((s4-2 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) - (let* ((v1-23 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as process-focusable gp-0) root quat))) - (f0-8 (vector-dot s4-2 v1-23)) - ) - (if (< 0.0 f0-8) - (vector-float*! s4-2 s4-2 -1.0) - ) - ) - (when (send-event - gp-0 - 'attack - (-> event param 0) - (static-attack-info ((id (-> self attack-id)) - (mode 'burnup) - (vector s4-2) - (shove-back (meters 0.1)) - (shove-up (meters 3)) - (control (if (focus-test? (the-as process-focusable gp-0) board) - 1.0 - 0.0 - ) - ) - ) - ) - ) - (let ((v0-0 (current-time))) - (set! (-> self no-collision-timer) v0-0) - v0-0 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (let* ((s4-0 proc) + (gp-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when gp-0 + (when (or (focus-test? (the-as process-focusable gp-0) mech) + (>= (- (current-time) (-> self no-collision-timer)) + (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) + ) + ) + (let ((f0-0 (get-norm! (-> self sync) 0))) + (when (and (< (-> self generous) f0-0) (< f0-0 (- (-> self flames-end-tt) (-> self generous)))) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (vector-matrix*! s4-1 (get-trans (the-as process-focusable gp-0) 0) (-> self world-to-local)) + (when (and (>= (-> s4-1 x) 0.0) + (>= (-> self deadly-width) (-> s4-1 x)) + (>= (-> s4-1 z) 0.0) + (>= (-> self deadly-length) (-> s4-1 z)) + (>= (-> s4-1 y) -2048.0) + (>= 2048.0 (-> s4-1 y)) + ) + (let ((s4-2 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (let* ((v1-23 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as process-focusable gp-0) root quat))) + (f0-8 (vector-dot s4-2 v1-23)) + ) + (if (< 0.0 f0-8) + (vector-float*! s4-2 s4-2 -1.0) ) + ) + (when (send-event + gp-0 + 'attack + (-> block param 0) + (static-attack-info ((id (-> self attack-id)) + (mode 'burnup) + (vector s4-2) + (shove-back (meters 0.1)) + (shove-up (meters 3)) + (control (if (focus-test? (the-as process-focusable gp-0) board) + 1.0 + 0.0 + ) + ) + ) + ) + ) + (let ((v0-0 (current-time))) + (set! (-> self no-collision-timer) v0-0) + v0-0 ) ) ) @@ -739,7 +725,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - ) + ) ) ) :trans (behavior () @@ -749,7 +735,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> a1-0 tlist) *touching-list*) (find-overlapping-shapes (-> self root) a1-0) ) - (none) ) :code (the-as (function none :behavior fire-floor) sleep-code) :post (behavior () @@ -827,7 +812,6 @@ For example for an elevator pre-compute the distance between the first and last ) (debug-draw (-> self path)) (transform-post) - (none) ) ) @@ -1118,13 +1102,13 @@ This commonly includes things such as: (defstate up-idle (drill-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('track) #t ) (else - ((-> (method-of-type basebutton up-idle) event) proc arg1 event-type event) + ((-> (method-of-type basebutton up-idle) event) proc argc message block) ) ) ) @@ -1135,7 +1119,6 @@ This commonly includes things such as: ) ) (setup-masks (-> self draw) 4 2) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type basebutton up-idle) trans))) @@ -1144,13 +1127,11 @@ This commonly includes things such as: ) ) (set-switch-color self #f) - (none) ) :code (behavior () (ja :group! (-> self draw art-group data 2) :num! (identity 1.0)) (transform-post) (sleep-code) - (none) ) ) @@ -1174,7 +1155,6 @@ This commonly includes things such as: (set! (-> self down-frame) 2.0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type basebutton going-down) trans))) @@ -1183,7 +1163,6 @@ This commonly includes things such as: ) ) (set-switch-color self #f) - (none) ) :code (behavior () (ja-no-eval :num! (seek! (-> self down-frame) (-> self anim-speed))) @@ -1198,7 +1177,6 @@ This commonly includes things such as: ) ) (go-virtual down-idle) - (none) ) ) @@ -1212,7 +1190,6 @@ This commonly includes things such as: ) ) (setup-masks (-> self draw) 2 4) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type basebutton down-idle) trans))) @@ -1221,7 +1198,6 @@ This commonly includes things such as: ) ) (set-switch-color self #t) - (none) ) :code (behavior () (ja :group! (-> self draw art-group data 2) :num! (identity (-> self down-frame))) @@ -1238,7 +1214,6 @@ This commonly includes things such as: (go-virtual going-up) ) ) - (none) ) ) @@ -1251,7 +1226,6 @@ This commonly includes things such as: ) ) (setup-masks (-> self draw) 4 2) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type basebutton going-up) trans))) @@ -1260,7 +1234,6 @@ This commonly includes things such as: ) ) (set-switch-color self #f) - (none) ) :code (behavior () (local-vars @@ -1291,7 +1264,6 @@ This commonly includes things such as: (send-event! self (-> self event-up)) (sound-play "drill-switch") (go-virtual up-idle) - (none) ) ) @@ -1431,7 +1403,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (let* ((f0-2 (+ (* 0.0033333334 (the float (- (current-time) (-> self state-time)))) @@ -1523,7 +1494,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior drill-laser) sleep-code) ) @@ -1569,100 +1539,91 @@ This commonly includes things such as: (game-task-node drill-ship-resolution) TASK_MANAGER_INIT_HOOK (lambda () - (speech-table-set! - *speech-control* - (speech-type speech-type-6) - (new 'static 'speech-type-info - :min-delay (seconds 4) - :max-delay (seconds 8) - :list (new 'static 'boxed-array :type string - "kg001" - "kg006" - "kg001a" - "kg013" - "kg018" - "kg023" - "kg078a" - "kg079a" - "kg080a" - "kg081a" - "kg082a" - "kg083a" - "kg084a" - "kg085a" - "kg086a" - "kg088a" - "kg091a" - "kg023a" - "kg006a" - "kg092a" - "kg093a" - "kg094a" - "kg095a" - "kg103a" - "kg104a" - "kg112a" - "kg134" - "kg136" - "kg138" - "kg139" - "kg140" - "kg141" - "kg130" - "kg135" - "kg156" - "kg157" - ) - ) - ) - (speech-table-set! - *speech-control* - (speech-type speech-type-9) - (new 'static 'speech-type-info - :priority 1 - :min-delay (seconds 1) - :max-delay (seconds 2) - :list (new 'static 'boxed-array :type string - "kg133" - "kg142" - "kg144" - "kg145" - "kg146" - "kg147" - "kg148" - "kg149" - "kg150" - "kg138" - "kg151" - "kg152" - "kg153" - "kg154" - "kg155" - "kg159" - "kg163" - "kg164" - ) - ) - ) - (the-as - object - (speech-table-set! *speech-control* (speech-type speech-type-10) (new 'static 'speech-type-info - :priority 10 - :max-delay (seconds 1) - :list (new 'static 'boxed-array :type string - "kg166" - "kg167" - "kg168" - "kg169" - "kg171" - "kg172" - "kg173" - "kg174" - "kg175" - ) + (speech-table-set! *speech-control* (speech-type speech-type-6) (new 'static 'speech-type-info + :min-delay (seconds 4) + :max-delay (seconds 8) + :list (new 'static 'boxed-array :type string + "kg001" + "kg006" + "kg001a" + "kg013" + "kg018" + "kg023" + "kg078a" + "kg079a" + "kg080a" + "kg081a" + "kg082a" + "kg083a" + "kg084a" + "kg085a" + "kg086a" + "kg088a" + "kg091a" + "kg023a" + "kg006a" + "kg092a" + "kg093a" + "kg094a" + "kg095a" + "kg103a" + "kg104a" + "kg112a" + "kg134" + "kg136" + "kg138" + "kg139" + "kg140" + "kg141" + "kg130" + "kg135" + "kg156" + "kg157" + ) + ) + ) + (speech-table-set! *speech-control* (speech-type speech-type-9) (new 'static 'speech-type-info + :priority 1 + :min-delay (seconds 1) + :max-delay (seconds 2) + :list (new 'static 'boxed-array :type string + "kg133" + "kg142" + "kg144" + "kg145" + "kg146" + "kg147" + "kg148" + "kg149" + "kg150" + "kg138" + "kg151" + "kg152" + "kg153" + "kg154" + "kg155" + "kg159" + "kg163" + "kg164" + ) + ) + ) + (speech-table-set! *speech-control* (speech-type speech-type-10) (new 'static 'speech-type-info + :priority 10 + :max-delay (seconds 1) + :list (new 'static 'boxed-array :type string + "kg166" + "kg167" + "kg168" + "kg169" + "kg171" + "kg172" + "kg173" + "kg174" + "kg175" ) - ) - ) + ) + ) ) ) @@ -1670,7 +1631,7 @@ This commonly includes things such as: *game-info* (game-task-node drill-ship-resolution) TASK_MANAGER_CLEANUP_HOOK - (lambda () (the-as object (speech-control-method-9 *speech-control*))) + (lambda () (speech-control-method-9 *speech-control*)) ) (defun drill-login () diff --git a/goal_src/jak2/levels/drill/drill-obs2.gc b/goal_src/jak2/levels/drill/drill-obs2.gc index bfc487fa5cb..bf5904f16d8 100644 --- a/goal_src/jak2/levels/drill/drill-obs2.gc +++ b/goal_src/jak2/levels/drill/drill-obs2.gc @@ -32,8 +32,8 @@ (defstate down (drill-flip-step) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual swing-up) ) @@ -41,7 +41,7 @@ #t ) (('query) - (case (-> event param 0) + (case (-> block param 0) (('arrived?) #t ) @@ -54,19 +54,18 @@ (ja :group! (-> self draw art-group data 2) :num! min) (transform-post) (sleep-code) - (none) ) ) (defstate up (drill-flip-step) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go-virtual swing-down) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -75,7 +74,6 @@ (ja-channel-push! 1 0) (ja :group! (-> self draw art-group data 3) :num! min) (sleep-code) - (none) ) :post (the-as (function none :behavior drill-flip-step) plat-post) ) @@ -85,7 +83,6 @@ :event (the-as (function process int symbol event-message-block object :behavior drill-flip-step) plat-event) :enter (behavior () (process-entity-status! self (entity-perm-status bit-12) #f) - (none) ) :trans (behavior () (if (>= (ja-aframe-num 0) 67.5) @@ -93,7 +90,6 @@ (logclear! (-> self root root-prim prim-core action) (collide-action rideable)) ) (plat-trans) - (none) ) :code (behavior () (logclear! (-> self root root-prim prim-core action) (collide-action rideable)) @@ -106,7 +102,6 @@ (ja :num! (seek! max 0.75)) ) (go-virtual down) - (none) ) :post (the-as (function none :behavior drill-flip-step) plat-post) ) @@ -116,7 +111,6 @@ :event (the-as (function process int symbol event-message-block object :behavior drill-flip-step) plat-event) :enter (behavior () (process-entity-status! self (entity-perm-status bit-12) #t) - (none) ) :trans (behavior () (if (>= (ja-aframe-num 0) 26.0) @@ -124,7 +118,6 @@ (logclear! (-> self root root-prim prim-core action) (collide-action rideable)) ) (plat-trans) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 2) @@ -136,7 +129,6 @@ (ja :num! (seek!)) ) (go-virtual up) - (none) ) :post (the-as (function none :behavior drill-flip-step) plat-post) ) @@ -293,7 +285,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior drill-falling-door) sleep-code) ) @@ -305,7 +296,6 @@ This commonly includes things such as: (if (>= (-> self hit-state) 3) (go-virtual fall #f) ) - (none) ) :code (behavior () (until #f @@ -333,7 +323,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -354,7 +343,6 @@ This commonly includes things such as: ) ) 0 - (none) ) :code (behavior ((arg0 symbol)) (process-entity-status! self (entity-perm-status bit-12) #t) @@ -376,7 +364,6 @@ This commonly includes things such as: ) ) (sleep-code) - (none) ) :post (the-as (function none :behavior drill-falling-door) transform-post) ) @@ -472,7 +459,6 @@ This commonly includes things such as: (go-virtual open) ) ) - (none) ) :code (the-as (function none :behavior drill-sliding-door) sleep-code) ) @@ -490,7 +476,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (sleep-code) - (none) ) ) @@ -617,7 +602,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type conveyor idle) post))) @@ -626,7 +610,6 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) @@ -661,7 +644,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior drill-breakable-barrel) ja-post) ) @@ -725,11 +707,11 @@ This commonly includes things such as: (defstate idle (drill-metalhead-eggs) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let* ((s5-0 (-> event param 0)) - (gp-0 (the-as object (-> event param 1))) + (let* ((s5-0 (-> block param 0)) + (gp-0 (the-as object (-> block param 1))) (s4-0 proc) (v1-1 (if (type? s4-0 process-drawable) s4-0 @@ -759,7 +741,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior drill-metalhead-eggs) ja-post) ) @@ -811,7 +792,6 @@ This commonly includes things such as: (task-node-close! (game-task-node drill-eggs-resolution)) (talker-spawn-func (-> *talker-speech* 99) *entity-pool* (target-pos 0) (the-as region #f)) ) - (none) ) :code (behavior () (let ((v1-1 (-> self root root-prim))) @@ -866,7 +846,6 @@ This commonly includes things such as: ) ) (cleanup-for-death self) - (none) ) ) @@ -885,7 +864,6 @@ This commonly includes things such as: ) ) (cleanup-for-death self) - (none) ) ) @@ -1122,11 +1100,11 @@ This commonly includes things such as: (defstate idle (drill-bridge-shot) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let* ((gp-0 (-> event param 0)) - (s5-0 (the-as object (-> event param 1))) + (let* ((gp-0 (-> block param 0)) + (s5-0 (the-as object (-> block param 1))) (s4-0 proc) (v1-1 (if (type? s4-0 process-drawable) s4-0 @@ -1163,7 +1141,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior drill-bridge-shot) transform-post) ) @@ -1172,7 +1149,6 @@ This commonly includes things such as: :virtual #t :enter (behavior ((arg0 symbol)) (process-entity-status! self (entity-perm-status subtask-complete) #t) - (none) ) :code (behavior ((arg0 symbol)) (let ((v1-1 (-> self root root-prim))) @@ -1238,7 +1214,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior drill-bridge-shot) transform-post) ) @@ -1334,7 +1309,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior drill-drill) ja-post) ) @@ -1377,8 +1351,8 @@ This commonly includes things such as: (defstate up (drill-drop-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (let ((v0-0 (the-as object #t))) (set! (-> self ridden?) (the-as symbol v0-0)) @@ -1386,7 +1360,7 @@ This commonly includes things such as: ) ) (else - ((-> (method-of-type drill-flip-step up) event) proc arg1 event-type event) + ((-> (method-of-type drill-flip-step up) event) proc argc message block) ) ) ) @@ -1403,7 +1377,6 @@ This commonly includes things such as: (if (>= (- (current-time) (-> self not-ridden-timer)) (seconds 0.4)) (go-virtual swing-down) ) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type drill-flip-step up) post))) @@ -1411,7 +1384,6 @@ This commonly includes things such as: ((the-as (function none) t9-0)) ) ) - (none) ) ) @@ -1426,7 +1398,6 @@ This commonly includes things such as: (if (>= (- (current-time) (-> self not-ridden-timer)) (seconds 2)) (send-event self 'trigger) ) - (none) ) ) diff --git a/goal_src/jak2/levels/drill/drill-panel.gc b/goal_src/jak2/levels/drill/drill-panel.gc index 3f08dd318ee..815fe65fc0d 100644 --- a/goal_src/jak2/levels/drill/drill-panel.gc +++ b/goal_src/jak2/levels/drill/drill-panel.gc @@ -606,13 +606,11 @@ (send-event (ppointer->process *drill-mech-master*) 'drill-control-panel (-> self id)) (sound-play "crush-console") ) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 1)) (spawn-shock-part self) ) - (none) ) :code (behavior ((arg0 symbol)) (when (not arg0) @@ -636,16 +634,15 @@ ) (transform-post) (sleep-code) - (none) ) ) (defstate idle (drill-control-panel) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (case (-> (the-as attack-info (-> event param 1)) mode) + (case (-> (the-as attack-info (-> block param 1)) mode) (('mech-punch 'crush) (go-virtual hit #f) ) @@ -672,20 +669,17 @@ ) ) ) - (none) ) :exit (behavior () (sound-stop (-> self idle-sound-id)) (while (-> self child) (deactivate (-> self child 0)) ) - (none) ) :code (the-as (function none :behavior drill-control-panel) sleep-code) :post (behavior () (spawn-with-cspace (-> self part) (the-as cspace (-> self node-list data))) (sound-play "small-panel" :id (-> self idle-sound-id)) - (none) ) ) @@ -837,7 +831,6 @@ This commonly includes things such as: ) (transform-post) (sleep-code) - (none) ) ) diff --git a/goal_src/jak2/levels/drill/drill-spool.gc b/goal_src/jak2/levels/drill/drill-spool.gc index b44c9ee4d91..ca63e1f88bd 100644 --- a/goal_src/jak2/levels/drill/drill-spool.gc +++ b/goal_src/jak2/levels/drill/drill-spool.gc @@ -745,9 +745,9 @@ (defstate idle (drill-wall) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v1-2 symbol)) - (case event-type + (case message (('trigger) (let ((v1-1 (-> self egg-group))) (when v1-1 @@ -764,8 +764,8 @@ (label cfg-10) (when v1-2 (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual hit (the-as symbol (if (>= arg1 1) - (-> event param 0) + (go-virtual hit (the-as symbol (if (>= argc 1) + (-> block param 0) (the-as uint #f) ) ) @@ -782,7 +782,6 @@ (suspend) ) #f - (none) ) ) @@ -790,7 +789,6 @@ :virtual #t :exit (behavior () (ja-abort-spooled-anim (-> self anim) (the-as art-joint-anim #f) -1) - (none) ) :trans (-> (method-of-type drill-wall idle) trans) :code (behavior ((arg0 symbol)) @@ -855,7 +853,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior drill-wall) transform-post) ) @@ -994,9 +991,9 @@ This commonly includes things such as: (defstate idle (drill-crane) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v1-2 symbol)) - (case event-type + (case message (('trigger) (let ((v1-1 (-> self egg-group))) (when v1-1 @@ -1030,7 +1027,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -1038,7 +1034,6 @@ This commonly includes things such as: :virtual #t :exit (behavior () (ja-abort-spooled-anim (-> self anim) (the-as art-joint-anim #f) -1) - (none) ) :trans (-> (method-of-type drill-crane idle) trans) :code (behavior ((arg0 symbol)) @@ -1134,7 +1129,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior drill-crane) transform-post) ) diff --git a/goal_src/jak2/levels/drill/drillmid-obs.gc b/goal_src/jak2/levels/drill/drillmid-obs.gc index 879d6a3a354..bc958b81a5a 100644 --- a/goal_src/jak2/levels/drill/drillmid-obs.gc +++ b/goal_src/jak2/levels/drill/drillmid-obs.gc @@ -171,7 +171,6 @@ This commonly includes things such as: (set-collide-spec! self #t) (set-setting! 'jump #f 0.0 0) ) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) @@ -181,7 +180,6 @@ This commonly includes things such as: (t9-4) ) ) - (none) ) :post (behavior () (sound-play "drl-elevator-lp" :id (-> self sound-id) :position (-> self root trans)) @@ -190,7 +188,6 @@ This commonly includes things such as: ((the-as (function none) t9-2)) ) ) - (none) ) ) @@ -206,7 +203,6 @@ This commonly includes things such as: (set-collide-spec! self #f) (remove-setting! 'jump) ) - (none) ) ) @@ -322,7 +318,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type conveyor idle) post))) @@ -331,6 +326,5 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) diff --git a/goal_src/jak2/levels/drill/ginsu.gc b/goal_src/jak2/levels/drill/ginsu.gc index 0eeb9bd7fc2..59187e097a1 100644 --- a/goal_src/jak2/levels/drill/ginsu.gc +++ b/goal_src/jak2/levels/drill/ginsu.gc @@ -574,7 +574,6 @@ (if (< 0.5 (rand-vu)) (set! (-> self enemy-flags) (the-as enemy-flag (logxor (shl 256 32) (the-as int (-> self enemy-flags))))) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy circling) trans))) @@ -583,7 +582,6 @@ ) ) (ginsu-method-182 self) - (none) ) :code (the-as (function none :behavior ginsu) sleep-code) ) @@ -603,7 +601,6 @@ (set! (-> self starting-time) (current-time)) (set! (-> self spiral-time) (current-time)) (set! (-> self desired-distance) (vector-length (ginsu-method-181 self (new 'stack-no-clear 'vector)))) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -623,7 +620,6 @@ (set! (-> self enemy-flags) (the-as enemy-flag (logxor (shl 256 32) (the-as int (-> self enemy-flags))))) ) (ginsu-method-182 self) - (none) ) :code (the-as (function none :behavior ginsu) sleep-code) :post (behavior () @@ -660,7 +656,6 @@ ) 0 (nav-enemy-method-176 self) - (none) ) ) @@ -677,7 +672,6 @@ (set! (-> self state-time) (current-time)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! ginsu-idle-ja :num! min) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -685,7 +679,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (if (not (and (handle->process (-> self focus handle)) @@ -704,7 +697,6 @@ (go-virtual attack) ) (ja :num! (loop!)) - (none) ) :code (the-as (function none :behavior ginsu) sleep-code) :post (behavior () @@ -725,7 +717,6 @@ ) 0 (nav-enemy-method-176 self) - (none) ) ) @@ -750,7 +741,6 @@ 0 (set! (-> self state-time) (current-time)) (ja :group! ginsu-attack-ja :num! min) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -759,7 +749,6 @@ (logclear! (-> self focus-status) (focus-status dangerous)) ) (ginsu-method-183 self #f) - (none) ) :trans (behavior () (enemy-method-49 self) @@ -779,7 +768,6 @@ (if (ja-done? 0) (go-virtual circling) ) - (none) ) :code (the-as (function none :behavior ginsu) sleep-code) :post (the-as (function none :behavior ginsu) nav-enemy-chase-post) @@ -799,12 +787,10 @@ (set! (-> self root scale x) 0.01) (set! (-> self root scale y) 0.01) (set! (-> self root scale z) 0.01) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self enemy-flags) (enemy-flag notice)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type enemy ambush) trans))) @@ -828,7 +814,6 @@ ) (ja :num! (loop!)) ) - (none) ) :code (the-as (function none :behavior ginsu) sleep-code) :post (the-as (function none :behavior ginsu) enemy-simple-post) @@ -856,7 +841,6 @@ ) ) (ginsu-sounds-off) - (none) ) ) @@ -869,7 +853,6 @@ ) ) (ginsu-sounds-off) - (none) ) ) @@ -882,7 +865,6 @@ ) ) (ginsu-sounds-off) - (none) ) ) @@ -895,7 +877,6 @@ ) ) (ginsu-sounds-off) - (none) ) ) @@ -917,7 +898,6 @@ ) ) ) - (none) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/forest/fish.gc b/goal_src/jak2/levels/forest/fish.gc index 6819e2d6d07..c1d93c20201 100644 --- a/goal_src/jak2/levels/forest/fish.gc +++ b/goal_src/jak2/levels/forest/fish.gc @@ -80,7 +80,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior minnow) ja-post) ) @@ -116,8 +115,8 @@ (defstate idle (fish-manager) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (format #t "training-manager received event ~s~%" event-type) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (format #t "training-manager received event ~s~%" message) (format #t "event-from ~s~%" proc) ) :code (the-as (function none :behavior fish-manager) sleep-code) @@ -458,7 +457,6 @@ ) ) ) - (none) ) ) ) diff --git a/goal_src/jak2/levels/forest/forest-obs.gc b/goal_src/jak2/levels/forest/forest-obs.gc index dfcdc3ff1f1..9c8fbcac3ce 100644 --- a/goal_src/jak2/levels/forest/forest-obs.gc +++ b/goal_src/jak2/levels/forest/forest-obs.gc @@ -50,16 +50,10 @@ This commonly includes things such as: (set! (-> t1-0 y) 24576.0) (set! (-> t1-0 z) 61440.0) (set! (-> t1-0 w) 1.0) - (let ((a3-0 arg0)) - (set! (-> obj formation) (t9-3 a0-4 a1-4 a2-2 a3-0 t0-0 t1-0 5461.3335 (the-as handle #f))) - (let ((v1-8 (logior (-> obj formation flags) 4)) - (a0-5 (-> obj formation)) - ) - (set! (-> a0-5 flags) v1-8) - (go (method-of-object obj spawning) a0-5 (the-as object a1-4) (the-as process a2-2) (the-as pointer a3-0)) - ) - ) + (set! (-> obj formation) (t9-3 a0-4 a1-4 a2-2 arg0 t0-0 t1-0 5461.3335 (the-as handle #f))) ) + (logior! (-> obj formation flags) 4) + (go (method-of-object obj spawning)) (none) ) @@ -169,10 +163,10 @@ This commonly includes things such as: (defstate idle (forest-youngsamos) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) - (send-event proc 'touch (-> event param 0)) + (send-event proc 'touch (-> block param 0)) ) (('attack) (let ((s4-0 *target*) @@ -183,7 +177,7 @@ This commonly includes things such as: ) s4-0 ) - (let ((s5-1 (the-as attack-info (-> event param 1)))) + (let ((s5-1 (the-as attack-info (-> block param 1)))) (case (-> s5-1 mode) (('eco-red 'eco-yellow 'eco-blue 'eco-dark) #f @@ -230,7 +224,6 @@ This commonly includes things such as: :enter (behavior () (set! (-> self falling?) #f) (send-event (handle->process (-> self hud)) 'force-show) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -245,19 +238,17 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (sound-play "samos-hover" :id (-> self sound-id)) (forest-youngsamos-post) - (none) ) ) (defstate hit (forest-youngsamos) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die-fast) (cleanup-for-death self) (go empty-state) @@ -269,7 +260,6 @@ This commonly includes things such as: (set! (-> self falling?) (the-as basic #t)) (logior! (-> self focus-status) (focus-status disable)) (set! (-> self focus-disable-timer) (the-as uint (+ (current-time) (seconds 3.5)))) - (none) ) :code (behavior () (set! (-> self root transv quad) (-> self hit-dir quad)) @@ -315,15 +305,14 @@ This commonly includes things such as: ) ) (go-virtual idle) - (none) ) :post forest-youngsamos-post ) (defstate die (forest-youngsamos) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die-fast) (cleanup-for-death self) (go empty-state) @@ -332,7 +321,6 @@ This commonly includes things such as: ) :enter (behavior () (set! (-> self falling?) (the-as basic #t)) - (none) ) :code (behavior () (speech-control-method-12 *speech-control* self (speech-type speech-type-10)) @@ -385,7 +373,6 @@ This commonly includes things such as: ) (send-event *camera* 'change-target #f) (cleanup-for-death self) - (none) ) :post forest-youngsamos-post ) diff --git a/goal_src/jak2/levels/forest/pegasus.gc b/goal_src/jak2/levels/forest/pegasus.gc index 066f41c4283..a2d0493522a 100644 --- a/goal_src/jak2/levels/forest/pegasus.gc +++ b/goal_src/jak2/levels/forest/pegasus.gc @@ -747,7 +747,6 @@ The faster it's moving the fast it flaps it's wings, etc ) ) #f - (none) ) :post (the-as (function none :behavior pegasus) ja-post) ) @@ -792,7 +791,6 @@ The faster it's moving the fast it flaps it's wings, etc (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -817,7 +815,6 @@ The faster it's moving the fast it flaps it's wings, etc ) ) ) - (none) ) :code (behavior () (let ((anim-group (ja-group))) @@ -837,7 +834,6 @@ The faster it's moving the fast it flaps it's wings, etc (suspend) ) #f - (none) ) :post (the-as (function none :behavior pegasus) enemy-simple-post) ) @@ -1011,7 +1007,6 @@ The faster it's moving the fast it flaps it's wings, etc (set! (-> self state-time) (current-time)) (set! (-> self far-time) (current-time)) (set-setting! 'sound-mode #f 0.0 1) - (none) ) :exit (behavior () (let ((func (-> (method-of-type enemy flee) exit))) @@ -1020,7 +1015,6 @@ The faster it's moving the fast it flaps it's wings, etc ) ) (remove-setting! 'sound-mode) - (none) ) :trans (behavior () (let ((func (-> (method-of-type enemy flee) trans))) @@ -1043,7 +1037,6 @@ The faster it's moving the fast it flaps it's wings, etc ) ) (set! (-> self far-time) (current-time)) - (none) ) :code (behavior () (until #f @@ -1052,7 +1045,6 @@ The faster it's moving the fast it flaps it's wings, etc (suspend) ) #f - (none) ) :post (-> (method-of-type enemy flee) post) ) @@ -1068,7 +1060,6 @@ The faster it's moving the fast it flaps it's wings, etc (set! (-> self near-timer) 3000) (set! (-> self far-time) (current-time)) (set-setting! 'sound-mode #f 0.0 1) - (none) ) :exit (behavior () (let ((func (-> (method-of-type enemy flee) exit))) @@ -1078,7 +1069,6 @@ The faster it's moving the fast it flaps it's wings, etc ) (set! (-> self y-offset-desired) 0.0) (remove-setting! 'sound-mode) - (none) ) :trans (behavior () (when (-> self can-run) @@ -1104,7 +1094,6 @@ The faster it's moving the fast it flaps it's wings, etc (if (>= (- (current-time) (-> self far-time)) (seconds 3)) (set! (-> self near-timer) (the-as int (-> self timeout))) ) - (none) ) :code (behavior () (until #f @@ -1113,7 +1102,6 @@ The faster it's moving the fast it flaps it's wings, etc (suspend) ) #f - (none) ) ) @@ -1137,14 +1125,12 @@ The faster it's moving the fast it flaps it's wings, etc (set! (-> self allow-idle) #t) (ja-channel-push! 1 (seconds 0.1)) (sleep-code) - (none) ) :post (behavior () (if (-> self allow-idle) (idle-control-method-10 (-> self idle-anim-player) self) ) (enemy-simple-post) - (none) ) ) @@ -1157,7 +1143,6 @@ The faster it's moving the fast it flaps it's wings, etc ) ) (set-setting! 'sound-mode #f 0.0 1) - (none) ) :exit (behavior () (let ((func (-> (method-of-type enemy notice) exit))) @@ -1166,7 +1151,6 @@ The faster it's moving the fast it flaps it's wings, etc ) ) (remove-setting! 'sound-mode) - (none) ) :code (behavior () (displacement-between-points-at-percent-normalized! @@ -1217,7 +1201,6 @@ The faster it's moving the fast it flaps it's wings, etc ) ) (react-to-focus self) - (none) ) ) @@ -1231,7 +1214,6 @@ The faster it's moving the fast it flaps it's wings, etc ((the-as (function none) func)) ) ) - (none) ) ) diff --git a/goal_src/jak2/levels/forest/predator.gc b/goal_src/jak2/levels/forest/predator.gc index 559a6110038..d32dc02db1b 100644 --- a/goal_src/jak2/levels/forest/predator.gc +++ b/goal_src/jak2/levels/forest/predator.gc @@ -871,7 +871,6 @@ (t9-0) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -888,7 +887,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior predator) nav-enemy-simple-post) ) @@ -898,7 +896,6 @@ :event (the-as (function process int symbol event-message-block object :behavior predator) enemy-event-handler) :enter (behavior () (go-virtual hostile) - (none) ) ) @@ -911,7 +908,6 @@ ) ) (predator-method-183 self) - (none) ) ) @@ -926,20 +922,17 @@ (set! (-> v1-2 attack-id) v0-0) (set! (-> self attack-id) v0-0) ) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (if (not (handle->process (-> self focus handle))) (go-virtual active) ) - (none) ) :code (behavior () (until #f @@ -982,7 +975,6 @@ (the-as none #f) (label cfg-26) (go-virtual hide) - (none) ) :post (the-as (function none :behavior predator) enemy-simple-post) ) @@ -1004,7 +996,6 @@ (set! (-> v1-7 target-speed) 0.0) ) 0 - (none) ) :exit (behavior () (set-dangerous! self #f) @@ -1012,7 +1003,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1040,7 +1030,6 @@ (sound-play "pred-talk") ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior predator) nav-enemy-chase-post) ) @@ -1058,7 +1047,6 @@ (set! (-> self next-change) (the-as uint (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) ) - (none) ) :trans (behavior () (predator-method-186 self) @@ -1083,7 +1071,6 @@ (if (< (the-as time-frame (-> self next-change)) (current-time)) (go-virtual hide) ) - (none) ) :code (behavior () (until #f @@ -1111,11 +1098,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -1136,7 +1121,6 @@ (predator-method-187 self) (set! (-> self next-change) (the-as uint 0)) 0 - (none) ) :trans (behavior () (let ((gp-0 (handle->process (-> self focus handle)))) @@ -1169,7 +1153,6 @@ ) (go-virtual hidden) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1184,11 +1167,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -1208,7 +1189,6 @@ (if (zero? (get-rand-int self 3)) (sound-play "pred-talk") ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -1238,7 +1218,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1261,7 +1240,6 @@ ) ) #f - (none) ) ) @@ -1605,14 +1583,12 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-predator :init hud-init-by-other :to self))) - (none) ) :exit (behavior () (when (-> self hud-counter) (send-event (handle->process (-> self hud-counter)) 'hide-and-die) (set! (-> self hud-counter) (the-as handle #f)) ) - (none) ) :trans (behavior () (predator-manager-method-16 self) @@ -1637,7 +1613,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior predator-manager) sleep-code) ) diff --git a/goal_src/jak2/levels/forest/wren.gc b/goal_src/jak2/levels/forest/wren.gc index 6dee2447d3a..59b37bf9cd7 100644 --- a/goal_src/jak2/levels/forest/wren.gc +++ b/goal_src/jak2/levels/forest/wren.gc @@ -154,7 +154,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) ) - (none) ) :code (behavior () (until #f @@ -168,7 +167,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) #f - (none) ) :post (behavior () (local-vars (at-0 int)) @@ -192,7 +190,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) (ja-post) - (none) ) ) ) @@ -203,7 +200,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (set! (-> self state-time) (current-time)) (set! (-> self peck-timer) (the-as uint (the int (* 300.0 (rand-vu-float-range 1.4 4.3))))) (logclear! (-> self flags) (wren-flags wrflags-1 wrflags-2)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> self peck-timer))) @@ -225,7 +221,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (go-virtual hunt) ) ) - (none) ) :code (behavior () (local-vars (v1-34 symbol)) @@ -271,14 +266,12 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) #f - (none) ) :post (behavior () (if (logtest? (-> self flags) (wren-flags wrflags-0)) (seek-to-point-toward-point! (-> self root) (-> self move-dest) 262144.0 (seconds 0.02)) ) (ja-post) - (none) ) ) @@ -292,7 +285,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (set! (-> self fly-interp) 0.0) (set! (-> self bob-level) 0.0) (set! (-> self bob-level-seek) 0.0) - (none) ) :trans (behavior () (when (< 0.99 (-> self path-u)) @@ -301,7 +293,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (go-virtual die) ) ) - (none) ) :code (behavior () (let ((gp-0 (current-time)) @@ -357,7 +348,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (suspend) ) #f - (none) ) :post fly-post ) @@ -378,12 +368,10 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) (go-virtual on-branch) - (none) ) :post (behavior () (seek! (-> self path-du-mod) 0.0 (* 0.5 (seconds-per-frame))) (fly-post) - (none) ) ) @@ -399,7 +387,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) (vector+! (-> self move-dest) (-> self root trans) v1-6) ) - (none) ) :trans (behavior () (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans)))) @@ -410,7 +397,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) ) - (none) ) :code (behavior () (logclear! (-> self flags) (wren-flags wrflags-0)) @@ -436,7 +422,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (ja :num! (loop! f30-2)) ) ) - (none) ) :post (behavior () (if (logtest? (-> self flags) (wren-flags wrflags-0)) @@ -444,7 +429,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) (debug-draw-path self) (ja-post) - (none) ) ) @@ -454,7 +438,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (cleanup-for-death self) (suspend) 0 - (none) ) ) diff --git a/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc b/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc index 1888ff8a429..9f4c641c1ec 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc @@ -34,8 +34,8 @@ (defstate idle (fort-elec-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (go-virtual die) 'push @@ -67,7 +67,6 @@ ) (talker-spawn-func (-> *talker-speech* 86) *entity-pool* (target-pos 0) (the-as region #f)) (sleep-code) - (none) ) :post (-> (method-of-type fort-elec-switch idle) post) ) @@ -94,7 +93,6 @@ ) (set! (-> v1-0 state mode) (the-as lightning-mode v0-1)) ) - (none) ) :code (behavior () (let ((v1-1 (-> self root root-prim))) @@ -225,7 +223,6 @@ ) ) (cleanup-for-death self) - (none) ) ) @@ -245,8 +242,8 @@ This commonly includes things such as: - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) ;; added (local-vars (sv-16 res-tag)) + (stack-size-set! (-> obj top-thread) 512) ;; og:preserve-this added (let ((s4-0 (new 'process 'collide-shape obj (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)) @@ -372,8 +369,8 @@ This commonly includes things such as: (defstate idle (fort-fence) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('break) (go-virtual breaking) ) @@ -410,7 +407,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior fort-fence) sleep-code) ) @@ -428,7 +424,6 @@ This commonly includes things such as: (set! (-> v1-4 prim-core collide-as) (collide-spec)) ) 0 - (none) ) :exit (behavior () (let ((a0-0 (-> self anim))) @@ -438,7 +433,6 @@ This commonly includes things such as: (ja :group! (-> self exit-anim) :num! min) ) ) - (none) ) :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) @@ -451,7 +445,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior fort-fence) transform-post) ) diff --git a/goal_src/jak2/levels/fortress/dump/fordumpb-obs.gc b/goal_src/jak2/levels/fortress/dump/fordumpb-obs.gc index 48d1f91a125..cbf06eec695 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpb-obs.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpb-obs.gc @@ -49,7 +49,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior fort-plat-orbit) rider-post) ) @@ -182,7 +181,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (behavior () (+! (-> self path-pos) (* (-> self path-speed) (seconds-per-frame))) @@ -202,7 +200,6 @@ This commonly includes things such as: (update-trans! (-> self sound) (-> self root trans)) (update! (-> self sound)) (rider-post) - (none) ) ) @@ -271,8 +268,8 @@ This commonly includes things such as: (defstate dormant (fort-plat-shuttle) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual idle) ) @@ -286,14 +283,12 @@ This commonly includes things such as: :enter (behavior () (fort-plat-shuttle-method-22 self) (set! (-> self next-spawn-time) (get-timeframe-offset! (-> self sync) 0)) - (none) ) :trans (behavior () (when (>= (current-time) (-> self next-spawn-time)) (process-spawn fort-plat-shuttle-plat 0 :to self) (set! (-> self next-spawn-time) (get-timeframe-offset! (-> self sync) 0)) ) - (none) ) :code (the-as (function none :behavior fort-plat-shuttle) sleep-code) ) diff --git a/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc b/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc index 564f623d5fe..4aa1a972f66 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc @@ -65,11 +65,11 @@ (defstate idle (fort-dump-bomb-a) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let* ((s5-0 (-> event param 0)) - (gp-0 (the-as attack-info (-> event param 1))) + (let* ((s5-0 (-> block param 0)) + (gp-0 (the-as attack-info (-> block param 1))) (s4-0 proc) (v1-1 (if (type? s4-0 process-drawable) (the-as process-drawable s4-0) @@ -86,7 +86,6 @@ :code (the-as (function none :behavior fort-dump-bomb-a) sleep-code) :post (behavior () (spawn (-> self part) (-> self root trans)) - (none) ) ) @@ -145,7 +144,6 @@ ) ) (cleanup-for-death self) - (none) ) ) @@ -235,11 +233,11 @@ This commonly includes things such as: (defstate idle (fort-missile-target) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'touch) - (let* ((gp-0 (-> event param 0)) - (s5-0 (the-as attack-info (-> event param 1))) + (let* ((gp-0 (-> block param 0)) + (s5-0 (the-as attack-info (-> block param 1))) (s4-0 proc) (v1-1 (if (type? s4-0 projectile) (the-as projectile s4-0) @@ -315,7 +313,6 @@ This commonly includes things such as: (set! (-> self part-mat 1 trans quad) (-> s4-0 quad)) ) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -373,13 +370,11 @@ This commonly includes things such as: ) (send-event (ppointer->process (-> self parent)) 'died) (sleep-code) - (none) ) :post (behavior () (sound-play "missile-steam" :id (the-as sound-id (-> self sound-id))) (spawn-with-matrix (-> self part) (the-as matrix (-> self part-mat))) (spawn-with-matrix (-> self part) (-> self part-mat 1)) - (none) ) ) @@ -489,8 +484,8 @@ This commonly includes things such as: (defstate idle (fort-missile) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go-virtual die) ) @@ -500,15 +495,14 @@ This commonly includes things such as: (if (and (task-node-closed? (game-task-node fortress-dump-deal)) *target*) (go-virtual targets-active) ) - (none) ) :code (the-as (function none :behavior fort-missile) sleep-code) ) (defstate targets-active (fort-missile) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go-virtual die) ) @@ -537,7 +531,6 @@ This commonly includes things such as: (if *target* (set! (-> self hud) (ppointer->handle (process-spawn hud-rocketsensor :init hud-init-by-other :to *target*))) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -577,18 +570,16 @@ This commonly includes things such as: ) ) (go-virtual missile-countdown) - (none) ) :post (behavior () (set! (-> *game-info* counter) (the float (-> self bomb-count))) - (none) ) ) (defstate missile-countdown (fort-missile) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('halt) (go-virtual dormant) ) @@ -601,7 +592,6 @@ This commonly includes things such as: (set-fordumpc-light-flag! #f) (send-event (handle->process (-> self hud)) 'hide-and-die) (sound-stop (-> self alarm-sound-id)) - (none) ) :code (behavior () (send-event (handle->process (-> self hud)) 'hide-and-die) @@ -711,18 +701,16 @@ This commonly includes things such as: ) ) (go-virtual die) - (none) ) :post (behavior () (sound-play "fort-alarm" :id (-> self alarm-sound-id)) - (none) ) ) (defstate die (fort-missile) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('halt) (go-virtual dormant) ) @@ -731,7 +719,7 @@ This commonly includes things such as: (if (if (type? s4-0 process-drawable) s4-0 ) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) ) ) ) @@ -740,12 +728,10 @@ This commonly includes things such as: :enter (behavior () (set-setting! 'allow-pause #f 0.0 0) (set-setting! 'allow-progress #f 0.0 0) - (none) ) :exit (behavior () (remove-setting! 'allow-pause) (remove-setting! 'allow-progress) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -916,7 +902,6 @@ This commonly includes things such as: ) ) (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc index 987a335ea13..f40d9b3a6d6 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc @@ -121,8 +121,8 @@ (defstate idle (fort-roboscreen) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (set! (-> self state-time) (current-time)) (go-virtual active) @@ -135,15 +135,14 @@ :enter (behavior () (logior! (-> self draw status) (draw-control-status no-draw)) (set! (-> self transition) 0.0) - (none) ) :code (the-as (function none :behavior fort-roboscreen) sleep-code) ) (defstate active (fort-roboscreen) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go-virtual deactive) ) @@ -174,7 +173,6 @@ (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (none) ) :exit (behavior () (set-action! @@ -197,7 +195,6 @@ (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (none) ) :code (behavior () (until #f @@ -210,19 +207,17 @@ (suspend) ) #f - (none) ) :post (behavior () (fort-roboscreen-method-24 self) (ja-post) - (none) ) ) (defstate deactive (fort-roboscreen) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go-virtual die) ) @@ -243,12 +238,10 @@ (suspend) ) #f - (none) ) :post (behavior () (fort-roboscreen-method-24 self) (ja-post) - (none) ) ) @@ -262,7 +255,6 @@ (suspend) ) ) - (none) ) ) @@ -512,12 +504,10 @@ (dotimes (v1-0 3) (set! (-> self ring-jmod v1-0 twist z) (the-as float #t)) ) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 3) :num! zero) (sleep-code) - (none) ) :post (behavior () (when (< (-> self ring-timer) (current-time)) @@ -531,7 +521,6 @@ (set! (-> self ring-timer) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.6 1.8))))) ) (fort-robotank-reticle-post) - (none) ) ) @@ -542,7 +531,6 @@ (dotimes (v1-0 3) (set! (-> self ring-jmod v1-0 twist z) (the-as float #f)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.04)) @@ -555,7 +543,6 @@ (ja :num! (seek!)) ) (sleep-code) - (none) ) :post fort-robotank-reticle-post ) @@ -1141,7 +1128,6 @@ :event robotank-turret-handler :enter (behavior () (set! (-> self gun-timer) (current-time)) - (none) ) :trans (behavior () (if (logtest? (-> self flags) (robotank-turret-flags rotflags-4)) @@ -1157,7 +1143,6 @@ (go-virtual fire) ) ) - (none) ) :code (behavior () (until #f @@ -1171,7 +1156,6 @@ ) ) #f - (none) ) :post turret-post ) @@ -1193,7 +1177,6 @@ (set! (-> self aim-pos-1 quad) (-> self aim-pos 0 quad)) ) ) - (none) ) :trans (behavior () (let ((gp-0 *target*)) @@ -1211,7 +1194,6 @@ (go-virtual ready) ) ) - (none) ) :code (behavior () (until #f @@ -1288,7 +1270,6 @@ ) ) #f - (none) ) :post turret-post ) @@ -1306,7 +1287,6 @@ (while (-> self child) (suspend) ) - (none) ) ) diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc index 104428fc43f..0c5c3406011 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc @@ -471,107 +471,91 @@ (none) ) -;; WARN: Return type mismatch none vs object. (defbehavior fort-robotank-handler fort-robotank ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (case arg2 - (('trigger) - (the-as - object - (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) - ) - (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) - (let ((v1-14 (-> *event-queue* data (-> *event-queue* length)))) - (+! (-> *event-queue* length) 1) - (set! (-> v1-14 form-handle) (process->handle self)) - (set! (-> v1-14 to-handle) (process->handle (handle->process (-> self turret)))) - (set! (-> v1-14 num-params) 0) - (set! (-> v1-14 message) 'trigger) - ) - ) - (logior! (-> self flags) (robotank-flags roflags-5)) - (let ((ret (the-as object (-> arg3 param 0)))) - (set! (-> self continue-index) (the-as int ret)) - ret - ) + (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) + ) + (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) + (let ((v1-14 (-> *event-queue* data (-> *event-queue* length)))) + (+! (-> *event-queue* length) 1) + (set! (-> v1-14 form-handle) (process->handle self)) + (set! (-> v1-14 to-handle) (process->handle (handle->process (-> self turret)))) + (set! (-> v1-14 num-params) 0) + (set! (-> v1-14 message) 'trigger) ) ) + (logior! (-> self flags) (robotank-flags roflags-5)) + (let ((ret (the-as object (-> arg3 param 0)))) + (set! (-> self continue-index) (the-as int ret)) + ret + ) ) - (('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) - ) - (('touch 'attack) - (the-as - object - (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self root) - (the-as uint 1) - ) - (let ((s5-0 (if (type? arg0 process-focusable) - (the-as process-focusable arg0) - ) - ) - ) - (the-as - object - (when s5-0 - (let ((a0-48 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) - (the-as - object - (when (send-event - s5-0 - 'attack-or-shove - (-> arg3 param 0) - (static-attack-info ((id (-> self attack-id)) - (vector a0-48) - (shove-back (if (and (-> self next-state) (= (-> self next-state name) 'idle)) - 16384.0 - 49152.0 - ) - ) - (shove-up (meters 6)) - (control (if (focus-test? s5-0 board) - 1.0 - 0.0 - ) - ) - ) - ) - ) - (set! (-> self no-collision-timer) (current-time)) - (let ((v1-45 (-> self root root-prim))) - (set! (-> v1-45 prim-core collide-as) (collide-spec)) - (set! (-> v1-45 prim-core collide-with) (collide-spec)) - ) - 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) + ) + (('touch 'attack) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self root) + (the-as uint 1) + ) + (let ((s5-0 (if (type? arg0 process-focusable) + (the-as process-focusable arg0) ) - ) ) + ) + (when s5-0 + (let ((a0-48 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (when (send-event + s5-0 + 'attack-or-shove + (-> arg3 param 0) + (static-attack-info ((id (-> self attack-id)) + (vector a0-48) + (shove-back (if (and (-> self next-state) (= (-> self next-state name) 'idle)) + 16384.0 + 49152.0 + ) + ) + (shove-up (meters 6)) + (control (if (focus-test? s5-0 board) + 1.0 + 0.0 + ) + ) + ) + ) + ) + (set! (-> self no-collision-timer) (current-time)) + (let ((v1-45 (-> self root root-prim))) + (set! (-> v1-45 prim-core collide-as) (collide-spec)) + (set! (-> v1-45 prim-core collide-with) (collide-spec)) ) + 0 ) ) ) ) ) - (('stop-music) - (remove-setting! 'music) - (remove-setting! 'music-volume) - (the-as object (remove-setting! 'sound-mode)) - ) - ) + ) + (('stop-music) + (remove-setting! 'music) + (remove-setting! 'music-volume) + (remove-setting! 'sound-mode) + ) ) ) @@ -685,7 +669,6 @@ :enter (behavior () (fort-robotank-method-25 self) (set! (-> self roller-spin-rate) 2730.6667) - (none) ) :trans (behavior () (when (and (name= (-> self name) "fort-robotank-6") (task-node-closed? (game-task-node fortress-dump-deal))) @@ -706,7 +689,6 @@ (set-setting! 'music-volume 'rel 0.9 0) (go-virtual moving) ) - (none) ) :code (the-as (function none :behavior fort-robotank) sleep-code) :post fort-robotank-post @@ -718,7 +700,6 @@ :enter (behavior () (set! (-> self path-info data (-> self path-index) start-y-angle) (quaternion-y-angle (-> self root quat))) (set! (-> self roller-spin-rate) 32768.0) - (none) ) :trans (behavior () (let* ((gp-0 (-> self path-info data (-> self path-index))) @@ -736,12 +717,10 @@ (go-virtual pause) ) ) - (none) ) :code (the-as (function none :behavior fort-robotank) sleep-code) :post (behavior () (fort-robotank-post) - (none) ) ) @@ -757,11 +736,9 @@ (set! (-> v1-4 du-final) 0.01) ) (fort-robotank-method-27 self) - (none) ) :exit (behavior () (logclear! (-> self flags) (robotank-flags roflags-2)) - (none) ) :trans (behavior () (if (not *target*) @@ -813,7 +790,6 @@ ) ) ) - (none) ) :code (behavior () (logclear! (-> self flags) (robotank-flags roflags-2)) @@ -824,7 +800,6 @@ ) (logior! (-> self flags) (robotank-flags roflags-2)) (sleep-code) - (none) ) :post (behavior () (when (logtest? (-> self flags) (robotank-flags roflags-2)) @@ -920,7 +895,6 @@ ) ) (fort-robotank-post) - (none) ) ) @@ -929,14 +903,12 @@ :event fort-robotank-handler :enter (behavior () (set! (-> self roller-spin-rate) 16384.0) - (none) ) :trans (behavior () (when (logtest? (-> self flags) (robotank-flags roflags-5)) (logclear! (-> self flags) (robotank-flags roflags-5)) (go-virtual moving) ) - (none) ) :code (the-as (function none :behavior fort-robotank) sleep-code) :post fort-robotank-post @@ -961,7 +933,6 @@ (while (-> self child) (suspend) ) - (none) ) :post (the-as (function none :behavior fort-robotank) pusher-post) ) diff --git a/goal_src/jak2/levels/fortress/exit/forexita-obs.gc b/goal_src/jak2/levels/fortress/exit/forexita-obs.gc index c4aa717c4e3..e5747989c10 100644 --- a/goal_src/jak2/levels/fortress/exit/forexita-obs.gc +++ b/goal_src/jak2/levels/fortress/exit/forexita-obs.gc @@ -49,7 +49,6 @@ (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (set! (-> self last-val) 0.0) (set! (-> self sound-time) (get-timeframe-offset! (-> self sync) 0)) - (none) ) :trans (the-as (function none :behavior fort-lift-plat) plat-trans) :code (behavior () @@ -66,7 +65,6 @@ (suspend) ) #f - (none) ) :post (behavior () (when (< (-> self sound-time) (current-time)) @@ -75,7 +73,6 @@ ) (sound-play "fort-lift-plat" :id (-> self sound-id) :position (-> self root trans)) (plat-post) - (none) ) ) @@ -90,7 +87,6 @@ ) (set! (-> self last-val) 0.0) (set! (-> self sound-time) (get-timeframe-offset! (-> self sync) 0)) - (none) ) :trans (behavior () (set! (-> self path-pos) (get-norm! (-> self sync) 0)) @@ -102,7 +98,6 @@ ) (set! (-> self last-val) (-> self path-pos)) (plat-trans) - (none) ) :code (the-as (function none :behavior fort-lift-plat) sleep-code) :post (behavior () @@ -112,7 +107,6 @@ ) (sound-play "fort-lift-plat" :id (-> self sound-id) :position (-> self root trans)) (plat-post) - (none) ) ) @@ -276,7 +270,6 @@ otherwise, [[plat::34]] (get-point-at-percent-along-path! (-> self path) (-> self root trans) (ease-value-in-out f30-0 0.2) 'interp) ) (ja-post) - (none) ) ) @@ -284,13 +277,11 @@ otherwise, [[plat::34]] :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 2)) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior fort-claw) sleep-code) ) @@ -339,6 +330,6 @@ This commonly includes things such as: ) ) ) - (the-as object #f) + #f ) ) diff --git a/goal_src/jak2/levels/fortress/fort-turret.gc b/goal_src/jak2/levels/fortress/fort-turret.gc index 44fde06de4d..c248d61334f 100644 --- a/goal_src/jak2/levels/fortress/fort-turret.gc +++ b/goal_src/jak2/levels/fortress/fort-turret.gc @@ -708,7 +708,6 @@ :event (the-as (function process int symbol event-message-block object :behavior fort-turret) enemy-event-handler) :exit (behavior () (set! (-> self flash-state) #f) - (none) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) @@ -727,7 +726,6 @@ (go-virtual hostile) ) (fort-turret-method-139 self) - (none) ) :code (behavior () (sound-play "turret-up") @@ -782,7 +780,6 @@ ) ) #f - (none) ) :post (behavior () (when (-> self flash-state) @@ -790,7 +787,6 @@ (set-forrescb-turret-flash! (the-as int (-> self flash-index))) ) (enemy-simple-post) - (none) ) ) @@ -799,7 +795,6 @@ :event (the-as (function process int symbol event-message-block object :behavior fort-turret) enemy-event-handler) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) @@ -819,11 +814,9 @@ ) (go-virtual attack) ) - (none) ) :code (behavior () (sleep-code) - (none) ) :post (the-as (function none :behavior fort-turret) enemy-simple-post) ) @@ -840,7 +833,6 @@ (set! (-> self desired-twist) 0.0) (ja-channel-push! 1 (seconds 0.5)) (ja :group! fort-turret-idle-ja) - (none) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) @@ -863,11 +855,9 @@ (if (and (< (fabs (-> self gun-twist)) 364.0889) (< (fabs (-> self gun-tilt)) 364.0889)) (go-virtual sweep) ) - (none) ) :code (behavior () (sleep-code) - (none) ) ) @@ -918,7 +908,6 @@ 0 (set! (-> self hit-points) 0) 0 - (none) ) :code (behavior () (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -953,11 +942,9 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (behavior () (track-target! self) - (none) ) ) diff --git a/goal_src/jak2/levels/fortress/fortress-obs.gc b/goal_src/jak2/levels/fortress/fortress-obs.gc index 4dce6e3113e..7a82890acfa 100644 --- a/goal_src/jak2/levels/fortress/fortress-obs.gc +++ b/goal_src/jak2/levels/fortress/fortress-obs.gc @@ -59,17 +59,14 @@ (defstate idle (fort-trap-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (when (logtest? (-> (the-as attack-info (-> event param 1)) penetrate-using) (penetrate flop)) - (go-virtual die) - #f - ) + :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 (the-as (function none :behavior fort-trap-door) sleep-code) @@ -99,7 +96,6 @@ ) ) ) - (none) ) :code (behavior () ((lambda () @@ -145,7 +141,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior fort-trap-door) ja-post) ) diff --git a/goal_src/jak2/levels/fortress/prison/prison-obs.gc b/goal_src/jak2/levels/fortress/prison/prison-obs.gc index 205e5372ab9..333c7950a1a 100644 --- a/goal_src/jak2/levels/fortress/prison/prison-obs.gc +++ b/goal_src/jak2/levels/fortress/prison/prison-obs.gc @@ -54,160 +54,154 @@ (define *prsn-chair-shackle-lightning-joints* (new 'static 'boxed-array :type int32 4 5 6 7)) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 119] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 195] (defbehavior dark-lightning-handler process-drawable ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (sv-112 sparticle-launcher) (sv-160 vector) (sv-164 vector) (sv-176 lightning-spec)) (let ((s3-0 (new 'static 'vector4w :x -1)) (s4-0 (new 'static 'vector4w :x -1)) (s5-0 (command-get-process "jak-highres-prison" *target*)) ) - (the-as - object - (cond - ((= arg2 'lightning-claw) - (let ((s1-0 (command-get-process "prsn-chair-shackle" *target*)) - (gp-1 (new 'stack-no-clear 'matrix)) - (s2-0 *prsn-torture-lightning-joints*) - (s3-1 (rand-vu-int-range-exclude 0 (+ (-> *prsn-torture-lightning-joints* length) -1) (-> s3-0 x))) - ) - *prsn-chair-shackle-lightning-joints* - (let ((v1-7 (rand-vu-int-range-exclude 0 (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) (-> s4-0 x)))) - (when s1-0 - (set! (-> s4-0 x) v1-7) - (vector<-cspace! (the-as vector (-> gp-1 vector)) (-> self node-list data 13)) - (vector<-cspace! (-> gp-1 vector 1) (-> self node-list data (-> s2-0 s3-1))) - (vector<-cspace! (-> gp-1 vector 2) (-> self node-list data (+ (-> s2-0 s3-1) 1))) - (vector<-cspace! (-> gp-1 trans) (-> (the-as process-drawable s5-0) node-list data 8)) - (dotimes (s5-1 3) - (process-spawn - lightning-tracker - :init lightning-tracker-init - (-> *lightning-spec-id-table* 19) - (the int (* 300.0 (rand-vu-float-range 1.0 2.0))) - lightning-probe-callback - #f - (+ (the-as uint gp-1) (* s5-1 16)) - (+ (the-as uint gp-1) (* (+ s5-1 1) 16)) - :to self - ) + (cond + ((= arg2 'lightning-claw) + (let ((s1-0 (command-get-process "prsn-chair-shackle" *target*)) + (gp-1 (new 'stack-no-clear 'matrix)) + (s2-0 *prsn-torture-lightning-joints*) + (s3-1 (rand-vu-int-range-exclude 0 (+ (-> *prsn-torture-lightning-joints* length) -1) (-> s3-0 x))) + ) + *prsn-chair-shackle-lightning-joints* + (let ((v1-7 (rand-vu-int-range-exclude 0 (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) (-> s4-0 x)))) + (when s1-0 + (set! (-> s4-0 x) v1-7) + (vector<-cspace! (the-as vector (-> gp-1 vector)) (-> self node-list data 13)) + (vector<-cspace! (-> gp-1 vector 1) (-> self node-list data (-> s2-0 s3-1))) + (vector<-cspace! (-> gp-1 vector 2) (-> self node-list data (+ (-> s2-0 s3-1) 1))) + (vector<-cspace! (-> gp-1 trans) (-> (the-as process-drawable s5-0) node-list data 8)) + (dotimes (s5-1 3) + (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 19) + (the int (* 300.0 (rand-vu-float-range 1.0 2.0))) + lightning-probe-callback + #f + (+ (the-as uint gp-1) (* s5-1 16)) + (+ (the-as uint gp-1) (* (+ s5-1 1) 16)) + :to self ) - #f ) + #f ) ) ) - ((= arg2 'lightning-needle) - (let ((gp-2 (command-get-process "prsn-chair-shackle" *target*))) - *prsn-chair-shackle-lightning-joints* - (let ((v1-38 (rand-vu-int-range-exclude 0 (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) (-> s4-0 x)))) - (when gp-2 - (set! (-> s4-0 x) v1-38) - (let ((s4-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 8))) - (s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s5-0) node-list data 5))) - (s3-3 (get-process *default-dead-pool* lightning-tracker #x4000)) + ) + ((= arg2 'lightning-needle) + (let ((gp-2 (command-get-process "prsn-chair-shackle" *target*))) + *prsn-chair-shackle-lightning-joints* + (let ((v1-38 (rand-vu-int-range-exclude 0 (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) (-> s4-0 x)))) + (when gp-2 + (set! (-> s4-0 x) v1-38) + (let ((s4-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 8))) + (s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s5-0) node-list data 5))) + (s3-3 (get-process *default-dead-pool* lightning-tracker #x4000)) + ) + (when s3-3 + (let ((t9-17 (method-of-type lightning-tracker activate))) + (t9-17 + (the-as lightning-tracker s3-3) + self + (symbol->string (-> lightning-tracker symbol)) + (the-as pointer #x70004000) ) - (when s3-3 - (let ((t9-17 (method-of-type lightning-tracker activate))) - (t9-17 - (the-as lightning-tracker s3-3) - self - (symbol->string (-> lightning-tracker symbol)) - (the-as pointer #x70004000) + ) + (let ((s2-2 run-function-in-process) + (s1-2 s3-3) + (s0-1 lightning-tracker-init) ) - ) - (let ((s2-2 run-function-in-process) - (s1-2 s3-3) - (s0-1 lightning-tracker-init) + (set! sv-176 (-> *lightning-spec-id-table* 19)) + (let ((a3-4 (the int (* 300.0 (rand-vu-float-range 1.0 2.0)))) + (t0-1 lightning-probe-callback) ) - (set! sv-176 (-> *lightning-spec-id-table* 19)) - (let ((a3-4 (the int (* 300.0 (rand-vu-float-range 1.0 2.0)))) - (t0-1 lightning-probe-callback) - ) - ((the-as (function object object object object object object object object none) s2-2) - s1-2 - s0-1 - sv-176 - a3-4 - t0-1 - gp-2 - s4-2 - s5-2 - ) - ) + ((the-as (function object object object object object object object object none) s2-2) + s1-2 + s0-1 + sv-176 + a3-4 + t0-1 + gp-2 + s4-2 + s5-2 + ) ) - (-> s3-3 ppointer) ) + (-> s3-3 ppointer) ) ) ) ) ) - ((= arg2 'lightning-shackle) - (let ((gp-3 (command-get-process "prsn-chair-shackle" *target*)) - (s2-3 *prsn-torture-lightning-joints*) - (s5-3 *prsn-chair-shackle-lightning-joints*) + ) + ((= arg2 'lightning-shackle) + (let ((gp-3 (command-get-process "prsn-chair-shackle" *target*)) + (s2-3 *prsn-torture-lightning-joints*) + (s5-3 *prsn-chair-shackle-lightning-joints*) + ) + (when gp-3 + (when (and (nonzero? (-> self skel)) (nonzero? (-> (the-as process-drawable gp-3) skel))) + (let* ((v1-52 (-> s2-3 length)) + (s1-3 (-> s5-3 length)) + (s0-2 (rand-vu-int-range-exclude 0 (+ v1-52 -1) (-> s3-0 x))) + (s1-4 (rand-vu-int-range-exclude 0 (+ s1-3 -1) (-> s4-0 x))) + ) + (set! sv-112 (-> *part-id-table* 179)) + (set! (-> s3-0 x) s0-2) + (set! (-> s4-0 x) s1-4) + (set! sv-160 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s2-3 s0-2)))) + (set! sv-164 (vector<-cspace! + (new 'stack-no-clear 'vector) + (-> (the-as process-drawable gp-3) node-list data (-> s5-3 s1-4)) + ) + ) ) - (when gp-3 - (when (and (nonzero? (-> self skel)) (nonzero? (-> (the-as process-drawable gp-3) skel))) - (let* ((v1-52 (-> s2-3 length)) - (s1-3 (-> s5-3 length)) - (s0-2 (rand-vu-int-range-exclude 0 (+ v1-52 -1) (-> s3-0 x))) - (s1-4 (rand-vu-int-range-exclude 0 (+ s1-3 -1) (-> s4-0 x))) - ) - (set! sv-112 (-> *part-id-table* 179)) - (set! (-> s3-0 x) s0-2) - (set! (-> s4-0 x) s1-4) - (set! sv-160 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s2-3 s0-2)))) - (set! sv-164 (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> (the-as process-drawable gp-3) node-list data (-> s5-3 s1-4)) - ) - ) - ) - (let ((s4-3 (process-spawn - lightning-tracker - :init lightning-tracker-init - (-> *lightning-spec-id-table* 19) - (the int (* 300.0 (rand-vu-float-range 1.0 2.0))) - lightning-probe-callback - self - sv-160 - sv-164 - :to gp-3 - ) + (let ((s4-3 (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 19) + (the int (* 300.0 (rand-vu-float-range 1.0 2.0))) + lightning-probe-callback + self + sv-160 + sv-164 + :to gp-3 ) - ) - (when (and sv-112 s4-3) - (let ((v1-74 (get-field-spec-by-id sv-112 (sp-field-id spt-timer)))) - (if v1-74 - (set! (-> v1-74 initial-valuef) (the-as float (-> (the-as lightning-tracker (-> s4-3 0)) duration))) - ) - ) - (let ((t9-30 sp-launch-particles-var) - (a0-35 *sp-particle-system-2d*) - (a1-37 sv-112) - (a2-19 *launch-matrix*) ) - (set! (-> a2-19 trans quad) (-> sv-160 quad)) - (t9-30 a0-35 a1-37 a2-19 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) - ) - (let ((t9-31 sp-launch-particles-var) - (a0-36 *sp-particle-system-2d*) - (a1-38 sv-112) - (a2-20 *launch-matrix*) - ) - (set! (-> a2-20 trans quad) (-> sv-164 quad)) - (t9-31 a0-36 a1-38 a2-20 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) - ) + ) + (when (and sv-112 s4-3) + (let ((v1-74 (get-field-spec-by-id sv-112 (sp-field-id spt-timer)))) + (if v1-74 + (set! (-> v1-74 initial-valuef) (the-as float (-> (the-as lightning-tracker (-> s4-3 0)) duration))) + ) + ) + (let ((t9-30 sp-launch-particles-var) + (a0-35 *sp-particle-system-2d*) + (a1-37 sv-112) + (a2-19 *launch-matrix*) + ) + (set! (-> a2-19 trans quad) (-> sv-160 quad)) + (t9-30 a0-35 a1-37 a2-19 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-31 sp-launch-particles-var) + (a0-36 *sp-particle-system-2d*) + (a1-38 sv-112) + (a2-20 *launch-matrix*) + ) + (set! (-> a2-20 trans quad) (-> sv-164 quad)) + (t9-31 a0-36 a1-38 a2-20 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) ) ) ) ) - ) + ) ) ) ) @@ -245,7 +239,6 @@ (ja :num! (loop!)) ) #f - (none) ) :post (behavior () (seek! (-> self path-u) 1.0 (* (-> self path-du) (seconds-per-frame))) @@ -255,7 +248,6 @@ ) (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-u) 'interp) (ja-post) - (none) ) ) @@ -385,8 +377,8 @@ This commonly includes things such as: (defstate idle (prsn-cell-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('open) (set! (-> self desired) 1.0) (format #t "open~%") @@ -412,7 +404,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior prsn-cell-door) transform-post) ) @@ -487,7 +478,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior prsn-vent-fan) ja-post) ) @@ -542,11 +532,9 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (transform-post) - (none) ) ) diff --git a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc index e54abf94408..3912966ceed 100644 --- a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc @@ -45,8 +45,8 @@ (defstate waiting (fort-elec-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual pop-up) ) @@ -136,8 +136,8 @@ (defstate red (fort-led) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual green) ) @@ -147,14 +147,13 @@ (setup-masks (-> self draw) 4 2) (ja-post) (sleep-code) - (none) ) ) (defstate green (fort-led) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go-virtual red) ) @@ -164,7 +163,6 @@ (setup-masks (-> self draw) 2 4) (ja-post) (sleep-code) - (none) ) ) @@ -211,15 +209,15 @@ This commonly includes things such as: (defstate active (elec-lock-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (if (elec-lock-gate-method-31 self (the-as symbol proc)) (go-virtual pre-shutdown) ) ) (else - ((-> (method-of-type elec-gate active) event) proc arg1 event-type event) + ((-> (method-of-type elec-gate active) event) proc argc message block) ) ) ) @@ -249,7 +247,6 @@ This commonly includes things such as: ) ) (go-virtual shutdown) - (none) ) :post (-> (method-of-type elec-lock-gate active) post) ) @@ -263,7 +260,6 @@ This commonly includes things such as: ) ) (set! (-> self all-gone?) #f) - (none) ) :trans (behavior () (let ((gp-0 #t)) @@ -337,7 +333,6 @@ This commonly includes things such as: ) (set! (-> self all-gone?) gp-0) ) - (none) ) :code (behavior () (until (-> self all-gone?) @@ -356,7 +351,6 @@ This commonly includes things such as: (remove-setting! 'interp-time) (process-release? *target*) (go-virtual idle) - (none) ) ) @@ -381,6 +375,7 @@ This commonly includes things such as: #t ) +;; WARN: Return type mismatch object vs none. (defmethod set-state! elec-lock-gate ((obj elec-lock-gate)) "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed make the gate `idle`. diff --git a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc index 8078d05d598..50a66bc46d5 100644 --- a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc @@ -35,7 +35,6 @@ (quaternion-rotate-y! (-> self root quat) (-> self init-quat) (+ -2730.6667 (* 5461.3335 f0-0))) ) (rider-post) - (none) ) ) @@ -167,7 +166,6 @@ This commonly includes things such as: (set! (-> v1-0 state mode) (the-as lightning-mode a0-0)) ) (go-virtual running) - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -182,7 +180,6 @@ This commonly includes things such as: ) (+! (-> self path-u) (* (-> self path-du) (seconds-per-frame))) (ja-post) - (none) ) ) @@ -190,13 +187,11 @@ This commonly includes things such as: :virtual #t :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (if (>= (-> self path-u) 1.0) (go-virtual die) ) - (none) ) :code (the-as (function none :behavior fort-elec-belt-inst) sleep-code) :post (behavior () @@ -357,7 +352,6 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) @@ -384,7 +378,6 @@ This commonly includes things such as: ) (suspend) (cleanup-for-death self) - (none) ) ) @@ -467,18 +460,17 @@ This commonly includes things such as: (defstate idle (fort-elec-belt) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('get-point-norm) - (get-point-at-percent-along-path! - (-> self path) - (the-as vector (-> event param 0)) - (the-as float (-> event param 1)) - 'interp - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('get-point-norm) + (get-point-at-percent-along-path! + (-> self path) + (the-as vector (-> block param 0)) + (the-as float (-> block param 1)) + 'interp + ) + ) + ) ) :trans (behavior () (set-forrescb-electricity-scale! 1.0 0) @@ -494,7 +486,6 @@ This commonly includes things such as: ) (set! (-> self next-spawn-time) (get-timeframe-offset! (-> self sync) 0)) ) - (none) ) :code (the-as (function none :behavior fort-elec-belt) sleep-code) ) diff --git a/goal_src/jak2/levels/gungame/gun-dummy.gc b/goal_src/jak2/levels/gungame/gun-dummy.gc index 9b09c89861e..2eb4879de20 100644 --- a/goal_src/jak2/levels/gungame/gun-dummy.gc +++ b/goal_src/jak2/levels/gungame/gun-dummy.gc @@ -2179,79 +2179,76 @@ (defstate idle (gun-dummy) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('combo) - (set! (-> self last-combo-time) (current-time)) - #t - ) - (('track) - (cond - ((-> event param 0) - (if (and (not (logtest? (-> self info flags) (tpath-flags citizen))) (> (-> self hit-points) 0)) - #t - 'abort - ) - ) - (else - (and (not (logtest? (-> self info flags) (tpath-flags citizen))) (> (-> self hit-points) 0)) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('combo) + (set! (-> self last-combo-time) (current-time)) + #t + ) + (('track) + (cond + ((-> block param 0) + (if (and (not (logtest? (-> self info flags) (tpath-flags citizen))) (> (-> self hit-points) 0)) + #t + 'abort + ) + ) + (else + (and (not (logtest? (-> self info flags) (tpath-flags citizen))) (> (-> self hit-points) 0)) ) ) - (('attack) - (let ((attack-info (the-as attack-info (-> event param 1)))) - (get-penetrate-using-from-attack-event (the-as process-drawable proc) event) - (when (or (not (logtest? (-> self info flags) (tpath-flags peace))) - (and (logtest? (-> self info flags) (tpath-flags peace)) - (or (= (-> attack-info mode) 'eco-dark) (= (-> attack-info mode) 'explode)) - ) - ) - (when (!= (-> attack-info id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> attack-info id)) - (let ((proc-draw (if (type? proc process-drawable) - (the-as process-drawable proc) - ) - ) - ) - (when proc-draw - (let ((cshape (-> proc-draw root))) - (when (if (type? cshape collide-shape) - cshape - ) - (vector+float*! (-> self impact) (-> self root trans) *up-vector* 8192.0) - (vector+! - (-> self impact) - (-> self impact) - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)) 4096.0) - ) + ) + (('attack) + (let ((attack-info (the-as attack-info (-> block param 1)))) + (get-penetrate-using-from-attack-event (the-as process-drawable proc) block) + (when (or (not (logtest? (-> self info flags) (tpath-flags peace))) + (and (logtest? (-> self info flags) (tpath-flags peace)) + (or (= (-> attack-info mode) 'eco-dark) (= (-> attack-info mode) 'explode)) + ) + ) + (when (!= (-> attack-info id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> attack-info id)) + (let ((proc-draw (if (type? proc process-drawable) + (the-as process-drawable proc) + ) + ) + ) + (when proc-draw + (let ((cshape (-> proc-draw root))) + (when (if (type? cshape collide-shape) + cshape + ) + (vector+float*! (-> self impact) (-> self root trans) *up-vector* 8192.0) + (vector+! + (-> self impact) + (-> self impact) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)) 4096.0) ) ) - (cond - ((= (-> self hit-points) 2) - (set! (-> self rot-y-offset) 262144.0) - (set! (-> self spin-sound) (sound-play "target-spin")) - ) - (else - (if (and (logtest? (process-mask projectile) (-> proc-draw mask)) - (< (- (current-time) (-> self last-combo-time)) (seconds 1)) - ) - (send-event (ppointer->process (-> self parent)) 'combo) - ) - ) + ) + (cond + ((= (-> self hit-points) 2) + (set! (-> self rot-y-offset) 262144.0) + (set! (-> self spin-sound) (sound-play "target-spin")) + ) + (else + (if (and (logtest? (process-mask projectile) (-> proc-draw mask)) + (< (- (current-time) (-> self last-combo-time)) (seconds 1)) + ) + (send-event (ppointer->process (-> self parent)) 'combo) + ) ) - (if (> (-> self hit-points) 0) - (+! (-> self hit-points) -1) - ) - #t ) + (if (> (-> self hit-points) 0) + (+! (-> self hit-points) -1) + ) + #t ) ) ) ) ) - ) + ) ) ) :enter (behavior () @@ -2261,11 +2258,9 @@ (set! (-> self rot-y-offset) 0.0) (set! (-> self first-time-command) #t) (set! (-> self done? value) (the-as object #f)) - (none) ) :exit (behavior () (logior! (-> self info flags) (tpath-flags broken)) - (none) ) :code (behavior () (while (not (-> self done? value)) @@ -2287,7 +2282,6 @@ 0 ) (cleanup-for-death self) - (none) ) :post (behavior () (set! (-> self done? value) (not (path-playing? self))) @@ -2316,7 +2310,6 @@ (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (-> self rot-y-offset)) (quaternion-slerp! (-> self root quat) (-> self root quat) (-> self quat-ground) (-> self inout-percent)) (transform-post) - (none) ) ) diff --git a/goal_src/jak2/levels/gungame/gungame-obs.gc b/goal_src/jak2/levels/gungame/gungame-obs.gc index 885dda30ed3..8deb4dfce3c 100644 --- a/goal_src/jak2/levels/gungame/gungame-obs.gc +++ b/goal_src/jak2/levels/gungame/gungame-obs.gc @@ -140,7 +140,6 @@ ) ) ) - (none) ) ) @@ -249,11 +248,9 @@ This commonly includes things such as: :enter (behavior () (set! (-> self start-time) 0) 0 - (none) ) :exit (behavior () '() - (none) ) :code (behavior () (until #f @@ -348,12 +345,10 @@ This commonly includes things such as: ) (task-node-close! (game-task-node city-red-gun-training-introduction)) (go-virtual red-training) - (none) ) :post (behavior () (training-manager-method-32 self) (training-manager-method-31 self) - (none) ) ) @@ -362,11 +357,9 @@ This commonly includes things such as: :enter (behavior () (set! (-> self start-time) 0) 0 - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (when (and (zero? (-> self start-time)) @@ -450,7 +443,6 @@ This commonly includes things such as: (if (task-node-open? (game-task-node city-yellow-gun-training-introduction)) (go-virtual yellow-training-intro) ) - (none) ) :code (behavior () (suspend) @@ -507,12 +499,10 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (training-manager-method-32 self) (training-manager-method-31 self) - (none) ) ) @@ -520,11 +510,9 @@ This commonly includes things such as: :enter (behavior () (set! (-> self start-time) 0) 0 - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (when (and (zero? (-> self start-time)) (cpad-pressed? 0 confirm)) @@ -569,7 +557,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (training-manager-method-24 self) @@ -628,12 +615,10 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (training-manager-method-32 self) (training-manager-method-31 self) - (none) ) ) @@ -642,11 +627,9 @@ This commonly includes things such as: :enter (behavior () (set! (-> self start-time) 0) 0 - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (if (task-node-open? (game-task-node city-yellow-gun-training-introduction)) @@ -828,7 +811,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (local-vars (a0-3 object) (a0-7 object)) @@ -909,12 +891,10 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (training-manager-method-32 self) (training-manager-method-31 self) - (none) ) ) @@ -943,10 +923,10 @@ This commonly includes things such as: (defstate yellow-training-intro (training-manager) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('path) - (let ((v1-2 (training-manager-method-21 self (the-as handle (-> event param 0))))) + (let ((v1-2 (training-manager-method-21 self (the-as handle (-> block param 0))))) (if v1-2 (-> (the-as process-drawable (if v1-2 (the-as process-drawable (-> v1-2 extra process)) @@ -971,11 +951,9 @@ This commonly includes things such as: :enter (behavior () (set! (-> self start-time) 0) (training-manager-method-27 self *yellow-training-path-combo-info*) - (none) ) :exit (behavior () '() - (none) ) :code (behavior () (until #f @@ -1069,7 +1047,6 @@ This commonly includes things such as: ) (task-node-close! (game-task-node city-yellow-gun-training-introduction)) (go yellow-training) - (none) ) :post (behavior () (training-manager-method-32 self) @@ -1077,17 +1054,16 @@ This commonly includes things such as: (training-manager-method-22 self #t) ) (training-manager-method-31 self) - (none) ) ) (defstate course (training-manager) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('score) - (let ((a1-3 (-> event param 0)) + (let ((a1-3 (-> block param 0)) (v1-1 (the-as process-taskable proc)) ) (+! (-> self score) a1-3) @@ -1109,7 +1085,7 @@ This commonly includes things such as: v0-0 ) (('path) - (let ((v1-9 (training-manager-method-21 self (the-as handle (-> event param 0))))) + (let ((v1-9 (training-manager-method-21 self (the-as handle (-> block param 0))))) (if v1-9 (-> (the-as process-drawable (if v1-9 (the-as process-drawable (-> v1-9 extra process)) @@ -1229,7 +1205,6 @@ This commonly includes things such as: (sound-play "course-clear") ) ) - (none) ) :exit (behavior () (cond @@ -1242,7 +1217,6 @@ This commonly includes things such as: ((= (-> self course) *peace-training-path-global-info*) ) ) - (none) ) :trans (behavior () (set! (-> *game-info* score) (the float (-> self score))) @@ -1416,7 +1390,6 @@ This commonly includes things such as: ((= (-> self course) *peace-training-path-global-info*) ) ) - (none) ) :code (the-as (function none :behavior training-manager) sleep-code) :post (behavior () @@ -1629,16 +1602,15 @@ This commonly includes things such as: ) (vector-rotate-around-y! gp-5 gp-5 4460.999) ) - (none) ) ) (defstate end-course (training-manager) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('path) - (let ((v1-2 (training-manager-method-21 self (the-as handle (-> event param 0))))) + (let ((v1-2 (training-manager-method-21 self (the-as handle (-> block param 0))))) (if v1-2 (-> (the-as process-drawable (if v1-2 (the-as process-drawable (-> v1-2 extra process)) @@ -1822,18 +1794,15 @@ This commonly includes things such as: ) ) ) - (none) ) :exit (behavior () (set! (-> self egg-count) 0) (remove-setting! 'features) (send-event (handle->process (-> self hud-score)) 'hide-and-die) (send-event (handle->process (-> self hud-goal)) 'hide-and-die) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) @@ -1887,11 +1856,9 @@ This commonly includes things such as: (suspend) ) (training-manager-method-28 self) - (none) ) :post (behavior () '() - (none) ) ) @@ -2144,13 +2111,12 @@ This commonly includes things such as: (defstate wait (training-manager) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('start) - (the-as symbol (training-manager-method-28 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('start) + (training-manager-method-28 self) + ) + ) ) :code (the-as (function none :behavior training-manager) sleep-code) ) @@ -2254,15 +2220,15 @@ This commonly includes things such as: (defstate idle (gungame-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('open) (set! (-> self train) (process->handle proc)) - (set! (-> self open-side) (the-as symbol (-> event param 0))) + (set! (-> self open-side) (the-as symbol (-> block param 0))) (go-virtual open) ) (('player-in-open-area?) - (set! (-> self open-side) (the-as symbol (-> event param 0))) + (set! (-> self open-side) (the-as symbol (-> block param 0))) (gungame-door-method-24 self) ) (('closed?) @@ -2276,17 +2242,16 @@ This commonly includes things such as: (defstate open (gungame-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('closed?) - #f - ) - (('player-in-open-area?) - (set! (-> self open-side) (the-as symbol (-> event param 0))) - (gungame-door-method-24 self) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('closed?) + #f + ) + (('player-in-open-area?) + (set! (-> self open-side) (the-as symbol (-> block param 0))) + (gungame-door-method-24 self) + ) + ) ) :enter (behavior () (set! (-> self last-player-dist) @@ -2302,11 +2267,9 @@ This commonly includes things such as: ) (set! (-> self close-state) (the-as uint 0)) 0 - (none) ) :trans (behavior () (gungame-door-method-23 self) - (none) ) :code (behavior () (sound-play "gungame-door") @@ -2331,7 +2294,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior gungame-door) transform-post) ) @@ -2411,21 +2373,19 @@ This commonly includes things such as: (defstate close (gungame-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('closed?) - #f - ) - (('player-in-open-area?) - (set! (-> self open-side) (the-as symbol (-> event param 0))) - (gungame-door-method-24 self) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('closed?) + #f + ) + (('player-in-open-area?) + (set! (-> self open-side) (the-as symbol (-> block param 0))) + (gungame-door-method-24 self) + ) + ) ) :enter (behavior () (set! (-> self close-sound) (sound-play "door-close-all")) - (none) ) :code (behavior () (let ((gp-0 #t)) @@ -2456,7 +2416,6 @@ This commonly includes things such as: #f (label cfg-12) (go-virtual idle) - (none) ) :post (the-as (function none :behavior gungame-door) transform-post) ) @@ -2548,7 +2507,7 @@ This commonly includes things such as: ) ) ) - (the-as object 0) + 0 ) ) @@ -2556,17 +2515,16 @@ This commonly includes things such as: *game-info* (game-task-node sewer-enemy-resolution) TASK_MANAGER_UPDATE_HOOK - (lambda :behavior task-manager () (the-as object (gui-control-method-12 - *gui-control* - self - (gui-channel art-load) - (gui-action queue) - (-> self info resolution-scene) - 0 - -99.0 - (new 'static 'sound-id) - ) - ) + (lambda :behavior task-manager () (gui-control-method-12 + *gui-control* + self + (gui-channel art-load) + (gui-action queue) + (-> self info resolution-scene) + 0 + -99.0 + (new 'static 'sound-id) + ) ) ) @@ -2596,7 +2554,7 @@ This commonly includes things such as: ) ) ) - (the-as object 0) + 0 ) ) @@ -2604,17 +2562,16 @@ This commonly includes things such as: *game-info* (game-task-node sewer-escort-get-gun) TASK_MANAGER_UPDATE_HOOK - (lambda :behavior task-manager () (the-as object (gui-control-method-12 - *gui-control* - self - (gui-channel art-load) - (gui-action queue) - (-> self info resolution-scene) - 0 - -99.0 - (new 'static 'sound-id) - ) - ) + (lambda :behavior task-manager () (gui-control-method-12 + *gui-control* + self + (gui-channel art-load) + (gui-action queue) + (-> self info resolution-scene) + 0 + -99.0 + (new 'static 'sound-id) + ) ) ) diff --git a/goal_src/jak2/levels/hideout/hideout-obs.gc b/goal_src/jak2/levels/hideout/hideout-obs.gc index db08cb931ec..958a0642e8f 100644 --- a/goal_src/jak2/levels/hideout/hideout-obs.gc +++ b/goal_src/jak2/levels/hideout/hideout-obs.gc @@ -150,7 +150,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior hide-light) ja-post) ) diff --git a/goal_src/jak2/levels/hiphog/hiphog-scenes.gc b/goal_src/jak2/levels/hiphog/hiphog-scenes.gc index 1f4cc42988b..90b1bf6c9de 100644 --- a/goal_src/jak2/levels/hiphog/hiphog-scenes.gc +++ b/goal_src/jak2/levels/hiphog/hiphog-scenes.gc @@ -101,7 +101,6 @@ This commonly includes things such as: :code (behavior () (ja-post) (sleep-code) - (none) ) ) @@ -152,7 +151,6 @@ This commonly includes things such as: (process-taskable-anim-loop (lambda ((arg0 process-taskable)) (handle->process (-> arg0 slave)))) (remove-setting! 'borrow) (go-virtual idle) - (none) ) ) @@ -183,7 +181,6 @@ This commonly includes things such as: (ja :num-func num-func-identity :frame-num (ja-aframe f0-1 0)) ) (ja-post) - (none) ) ) diff --git a/goal_src/jak2/levels/hiphog/whack.gc b/goal_src/jak2/levels/hiphog/whack.gc index 02564ebfdb0..c35cc0f8619 100644 --- a/goal_src/jak2/levels/hiphog/whack.gc +++ b/goal_src/jak2/levels/hiphog/whack.gc @@ -1465,10 +1465,10 @@ (defstate idle (hip-mole) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('active) - (go-virtual active (the-as time-frame (-> event param 0)) (-> event param 1)) + (go-virtual active (the-as time-frame (-> block param 0)) (-> block param 1)) ) ) ) @@ -1478,7 +1478,6 @@ (ja-channel-push! 1 (seconds 0.05)) (ja :group! (-> self draw art-group data 3) :num! min) (sleep-code) - (none) ) :post (behavior () (let* ((s5-0 (handle->process (-> self cabinet))) @@ -1523,14 +1522,13 @@ ) ) (ja-post) - (none) ) ) (defstate active (hip-mole) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (case (-> self mode) ((10) @@ -1569,11 +1567,9 @@ (sound-play "whack-up") (set! (-> self sound-id) (sound-play "whack-bounce")) (set! (-> self abort?) #f) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (case (-> self mode) @@ -1603,7 +1599,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 time-frame) (arg1 uint)) (ja-no-eval :group! (-> self draw art-group data 3) @@ -1641,7 +1636,6 @@ ) ) (go-virtual idle) - (none) ) :post (-> (method-of-type hip-mole idle) post) ) @@ -2051,7 +2045,6 @@ (ja-channel-set! 0) (ja-post) (sleep-code) - (none) ) ) @@ -2069,22 +2062,20 @@ (send-event-function *target* a1-1) (go-virtual active #t (the-as int a1-1)) ) - (none) ) ) (defstate active (whack-a-metal) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('done) - (let ((v0-0 (+ (-> self miss-count) 1))) - (set! (-> self miss-count) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('done) + (let ((v0-0 (+ (-> self miss-count) 1))) + (set! (-> self miss-count) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior ((arg0 symbol) (arg1 int)) (when arg0 @@ -2114,7 +2105,6 @@ (set! (-> self hud-goal) (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :to self))) ) ) - (none) ) :exit (behavior () (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -2145,7 +2135,6 @@ (want-display-level *load-state* 'ctyport 'display) (want-display-level *load-state* 'ctywide 'display) ) - (none) ) :trans (behavior () (cond @@ -2171,7 +2160,6 @@ (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons up right down left l1 r1 triangle circle x square) ) - (none) ) :code (behavior ((arg0 symbol) (arg1 int)) (local-vars @@ -2305,12 +2293,10 @@ ) ) #f - (none) ) :post (behavior () (whack-a-metal-method-27 self) (ja-post) - (none) ) ) @@ -2609,7 +2595,6 @@ (go-virtual active #f (the-as int a1-9)) ) ) - (none) ) :post (-> (method-of-type whack-a-metal active) post) ) @@ -2679,12 +2664,10 @@ ) ) ) - (none) ) :post (behavior () (whack-a-metal-method-28 self) (ja-post) - (none) ) ) @@ -2753,7 +2736,6 @@ (ja-channel-set! 0) (ja-post) (set-blackout-frames (seconds 0.2)) - (none) ) :post (-> (method-of-type whack-a-metal lose) post) ) diff --git a/goal_src/jak2/levels/intro/intro-obs.gc b/goal_src/jak2/levels/intro/intro-obs.gc index 2ab4dee7179..61117dab534 100644 --- a/goal_src/jak2/levels/intro/intro-obs.gc +++ b/goal_src/jak2/levels/intro/intro-obs.gc @@ -41,8 +41,8 @@ (defstate idle (intro-flamer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go-virtual die) ) @@ -64,7 +64,6 @@ ) (set! (-> self flit-timer) (the-as uint (current-time))) ) - (none) ) :code (behavior () (ja-channel-set! 1) @@ -84,7 +83,6 @@ ) ) #f - (none) ) :post (behavior () (seek! (-> self path-u) 1.0 (* (-> self path-du) (seconds-per-frame))) @@ -192,7 +190,6 @@ ) ) (ja-post) - (none) ) ) @@ -201,7 +198,6 @@ :code (behavior () (suspend) (cleanup-for-death self) - (none) ) ) @@ -282,13 +278,13 @@ This commonly includes things such as: (defstate idle (metalhead-spawner) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual active) ) (('path) - (-> self path-tbl (-> event param 0)) + (-> self path-tbl (-> block param 0)) ) ) ) @@ -297,8 +293,8 @@ This commonly includes things such as: (defstate active (metalhead-spawner) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go-virtual idle) ) @@ -306,7 +302,7 @@ This commonly includes things such as: (go-virtual die) ) (('path) - (-> self path-tbl (-> event param 0)) + (-> self path-tbl (-> block param 0)) ) ) ) @@ -333,13 +329,11 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (dotimes (gp-0 19) (debug-draw (-> self path-tbl gp-0)) ) - (none) ) ) @@ -356,7 +350,6 @@ This commonly includes things such as: (suspend) ) (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) @@ -432,7 +425,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior vil-windmill-sail) ja-post) ) diff --git a/goal_src/jak2/levels/mountain/canyon/mincan-obs.gc b/goal_src/jak2/levels/mountain/canyon/mincan-obs.gc index 98278cd46f9..dd1a4d0b810 100644 --- a/goal_src/jak2/levels/mountain/canyon/mincan-obs.gc +++ b/goal_src/jak2/levels/mountain/canyon/mincan-obs.gc @@ -73,7 +73,6 @@ (if (task-node-closed? (game-task-node canyon-insert-items-resolution)) (go-virtual erect) ) - (none) ) :code (behavior () (until #f @@ -87,7 +86,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior mincan-lighthouse-lens) ja-post) ) @@ -107,7 +105,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior mincan-lighthouse-lens) ja-post) ) @@ -176,7 +173,6 @@ This commonly includes things such as: (if (task-node-closed? (game-task-node canyon-insert-items-resolution)) (go-virtual erect) ) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -191,7 +187,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior mincan-lighthouse) ja-post) ) @@ -211,7 +206,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior mincan-lighthouse) ja-post) ) @@ -261,7 +255,6 @@ This commonly includes things such as: (if (task-node-closed? (game-task-node canyon-insert-items-resolution)) (go-virtual open) ) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -276,7 +269,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior mincan-lens) transform-post) ) @@ -296,7 +288,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior mincan-lens) transform-post) ) @@ -416,7 +407,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior mincan-cogs) ja-post) ) diff --git a/goal_src/jak2/levels/mountain/mountain-obs.gc b/goal_src/jak2/levels/mountain/mountain-obs.gc index eb46163ecf5..3e5bacea9ee 100644 --- a/goal_src/jak2/levels/mountain/mountain-obs.gc +++ b/goal_src/jak2/levels/mountain/mountain-obs.gc @@ -143,7 +143,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type basebutton down-idle) trans))) @@ -154,7 +153,6 @@ (if (and (not (task-node-closed? (game-task-node mountain-shard-dice))) (< 1 *dice-back-way-num*)) (go-virtual going-up) ) - (none) ) ) @@ -163,7 +161,6 @@ :enter (behavior () (sound-play "dice-button") (press! self #t) - (none) ) ) @@ -360,7 +357,6 @@ ) (sound-play "dice-sink") (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (set! (-> self draw color-mult quad) (-> self color quad)) @@ -413,7 +409,6 @@ (set! (-> self active) (-> self first)) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior mtn-dice) sleep-code) :post (the-as (function none :behavior mtn-dice) transform-post) @@ -714,10 +709,10 @@ (defstate idle (mtn-dice) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (sv-192 vector)) (cond - ((= event-type 'print-info) + ((= message 'print-info) (dotimes (gp-1 6) (let ((s5-1 (-> self face-matrix gp-1))) (format #t "(static-mtn-dice-info (") @@ -730,7 +725,7 @@ ) #f ) - ((= event-type 'trigger) + ((= message 'trigger) (mem-set32! (the-as pointer *dice-blocked-array*) 13 0) (set! (-> *dice-blocked-array* 1) (the-as uint 256)) (set! *dice-back-way-num* 0) @@ -742,7 +737,7 @@ (go-virtual restart) ) ) - ((= event-type 'hint) + ((= message 'hint) (when (>= (-> self hint-count) 0.0) (+! (-> self hint-count) (seconds-per-frame)) (if (< 6.0 (-> self hint-count)) @@ -750,7 +745,7 @@ ) ) ) - ((= event-type 'touch) + ((= message 'touch) (let* ((s3-0 proc) (s2-0 proc) (s4-1 (if (type? s2-0 process-focusable) @@ -764,7 +759,7 @@ ) ) (when s3-1 - (let* ((s2-2 (the-as object (-> event param 0))) + (let* ((s2-2 (the-as object (-> block param 0))) (s1-0 (-> (the-as touching-shapes-entry s2-2) head)) ) (while s1-0 @@ -798,7 +793,7 @@ (s0-2 (vector-! s0-1 sv-192 v1-42)) ) (vector-float*! s0-2 s0-2 0.5) - (send-event proc 'shove (-> event param 0) (static-attack-info ((id (new-attack-id)) (vector s0-2)))) + (send-event proc 'shove (-> block param 0) (static-attack-info ((id (new-attack-id)) (vector s0-2)))) ) ) ) @@ -813,9 +808,9 @@ ) ) ) - ((= event-type 'attack) + ((= message 'attack) (when (= (-> self active) 1) - (let ((v1-56 (the-as object (-> event param 1)))) + (let ((v1-56 (the-as object (-> block param 1)))) (when (!= (-> (the-as attack-info v1-56) id) (-> self incoming-attack-id)) (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-56) id)) (let ((s3-2 proc) @@ -829,7 +824,7 @@ (empty) ) ) - (let* ((gp-3 (-> event param 0)) + (let* ((gp-3 (-> block param 0)) (a1-26 (mtn-dice-method-26 self s4-2 (the-as touching-shapes-entry gp-3))) ) (cond @@ -858,7 +853,6 @@ (set! (-> self curtime) 0) (set! (-> self first-touch-time) 0) 0 - (none) ) :trans (behavior () (if (nonzero? (-> self curtime)) @@ -867,7 +861,6 @@ (set! (-> self curtime) (current-time)) (when (and (zero? (-> self active)) (dice-wrong-way?)) ) - (none) ) :code (the-as (function none :behavior mtn-dice) sleep-code) :post (behavior () @@ -908,7 +901,6 @@ (when (= (-> self first) 1) ) (rider-post) - (none) ) ) @@ -918,17 +910,14 @@ (set! (-> self curtime) 0) (set! (-> self first-touch-time) 0) 0 - (none) ) :trans (behavior () '() - (none) ) :code (the-as (function none :behavior mtn-dice) sleep-code) :post (behavior () (rider-trans) (rider-post) - (none) ) ) @@ -952,7 +941,6 @@ (set! (-> self state-time) (current-time)) (set! (-> self time-anim) 1.0) (set! (-> self speed-anim) -0.5) - (none) ) :trans (behavior () (set! (-> self draw color-mult quad) (-> self color quad)) @@ -1002,12 +990,10 @@ ) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior mtn-dice) sleep-code) :post (behavior () (transform-post) - (none) ) ) @@ -1018,7 +1004,6 @@ (set! (-> self speed-anim) 0.0) (set! (-> self state-time) (current-time)) (sound-play "dice-sink") - (none) ) :trans (behavior () (set! (-> self draw color-mult quad) (-> self color quad)) @@ -1037,7 +1022,6 @@ ) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior mtn-dice) sleep-code) :post (the-as (function none :behavior mtn-dice) transform-post) @@ -1554,7 +1538,6 @@ This commonly includes things such as: (set! (-> self path-pos) (get-norm! (-> self sync) 0)) (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (plat-trans) - (none) ) :code (behavior () (until #f @@ -1568,7 +1551,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior mtn-plat-updown) plat-post) ) @@ -1686,8 +1668,8 @@ This commonly includes things such as: (defstate wait (mtn-plat-eject) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('eject) (go-virtual eject) ) @@ -1702,7 +1684,6 @@ This commonly includes things such as: (process-entity-status! self (entity-perm-status subtask-complete) #t) (ja-channel-push! 1 0) (ja-no-eval :group! (-> self draw art-group data 3) :num! (loop!) :frame-num 0.0) - (none) ) :code (the-as (function none :behavior mtn-plat-eject) sleep-code) :post (behavior () @@ -1711,7 +1692,6 @@ This commonly includes things such as: (vector+! (-> self root trans) (-> self root trans) gp-1) ) (transform-post) - (none) ) ) @@ -1805,7 +1785,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior mtn-plat-long) plat-post) ) @@ -1892,8 +1871,8 @@ This commonly includes things such as: (defstate idle (mtn-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual open) ) @@ -1931,7 +1910,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior mtn-gate) transform-post) ) @@ -2110,7 +2088,6 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) @@ -2146,10 +2123,10 @@ This commonly includes things such as: (defstate idle (mtn-aval-rocks) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('draw) - (if (-> event param 0) + (if (-> block param 0) (go-virtual fall) ) ) @@ -2163,7 +2140,6 @@ This commonly includes things such as: (go-virtual fall) ) ) - (none) ) :code (behavior () (ja-channel-set! 0) @@ -2171,17 +2147,16 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) (defstate fall (mtn-aval-rocks) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (a2-3 int)) - (case event-type + (case message (('touch 'attack) - (let ((s3-0 (-> event param 0)) + (let ((s3-0 (-> block param 0)) (s4-0 0) ) (when s3-0 @@ -2205,7 +2180,7 @@ This commonly includes things such as: (set! (-> a1-4 from) (process->ppointer self)) (set! (-> a1-4 num-params) 2) (set! (-> a1-4 message) 'attack) - (set! (-> a1-4 param 0) (-> event param 0)) + (set! (-> a1-4 param 0) (-> block param 0)) (let ((v1-11 (new 'static 'attack-info :mask (attack-mask shove-up id damage)))) (set! a2-3 (cond ((nonzero? s4-0) @@ -2230,7 +2205,7 @@ This commonly includes things such as: ) ) (('draw) - (if (not (-> event param 0)) + (if (not (-> block param 0)) (go-virtual idle) ) ) @@ -2254,7 +2229,6 @@ This commonly includes things such as: (set! (-> v1-10 params mask) (the-as uint 17)) (-> v1-10 id) ) - (none) ) :code (behavior () (let ((gp-0 2) @@ -2297,7 +2271,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (local-vars (sv-16 vector-array) (sv-20 vector) (sv-48 float) (sv-52 symbol)) @@ -2397,7 +2370,6 @@ This commonly includes things such as: ) (seek! (-> sv-16 data gp-0 w) 0.0 1.0) ) - (none) ) ) @@ -2565,8 +2537,8 @@ This commonly includes things such as: (defstate waiting (mtn-plat-return) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (let ((v0-0 (the-as object (logior (-> self flags) (mtn-plat-flags mtpflags-0))))) (set! (-> self flags) (the-as mtn-plat-flags v0-0)) @@ -2574,14 +2546,13 @@ This commonly includes things such as: ) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) :enter (behavior () (set! (-> self ride-timer) (current-time)) (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) - (none) ) :trans (behavior () (logclear! (-> self flags) (mtn-plat-flags mtpflags-0)) @@ -2606,7 +2577,6 @@ This commonly includes things such as: (go-virtual running) ) ) - (none) ) :code (the-as (function none :behavior mtn-plat-return) sleep-code) :post (the-as (function none :behavior mtn-plat-return) plat-post) @@ -2614,8 +2584,8 @@ This commonly includes things such as: (defstate running (mtn-plat-return) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (let ((v0-0 (the-as object (logior (-> self flags) (mtn-plat-flags mtpflags-0))))) (set! (-> self flags) (the-as mtn-plat-flags v0-0)) @@ -2623,7 +2593,7 @@ This commonly includes things such as: ) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -2632,7 +2602,6 @@ This commonly includes things such as: (go-virtual waiting-for-no-player) ) (plat-trans) - (none) ) :code (the-as (function none :behavior mtn-plat-return) sleep-code) :post (behavior () @@ -2644,14 +2613,13 @@ This commonly includes things such as: 'interp ) (plat-post) - (none) ) ) (defstate waiting-for-no-player (mtn-plat-return) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (let ((v0-0 (the-as object (current-time)))) (set! (-> self ride-timer) (the-as time-frame v0-0)) @@ -2659,7 +2627,7 @@ This commonly includes things such as: ) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -2676,7 +2644,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior mtn-plat-return) sleep-code) :post (the-as (function none :behavior mtn-plat-return) plat-post) @@ -2757,12 +2724,11 @@ This commonly includes things such as: (defstate running (mtn-plat-gap) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (plat-event proc arg1 event-type event) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (plat-event proc argc message block) ) :trans (behavior () (plat-trans) - (none) ) :code (the-as (function none :behavior mtn-plat-gap) sleep-code) :post (behavior () @@ -2774,31 +2740,28 @@ This commonly includes things such as: 'interp ) (plat-post) - (none) ) ) (defstate waiting (mtn-plat-gap) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (set! (-> self dest-pos) 0.0) (go-virtual running) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) :enter (behavior () (set! (-> self path-pos) 1.0) (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) - (none) ) :trans (behavior () (plat-trans) - (none) ) :code (the-as (function none :behavior mtn-plat-gap) sleep-code) :post (the-as (function none :behavior mtn-plat-gap) plat-post) @@ -2827,8 +2790,8 @@ This commonly includes things such as: (defstate idle (mtn-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual open) ) @@ -2850,15 +2813,14 @@ This commonly includes things such as: (ja :num! (seek!)) ) (go-virtual waiting) - (none) ) :post (the-as (function none :behavior mtn-button) rider-post) ) (defstate waiting (mtn-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('bonk) (go-virtual pressed #f) ) @@ -2870,7 +2832,6 @@ This commonly includes things such as: :frame-num 0.0 ) (transform-post) - (none) ) :code (the-as (function none :behavior mtn-button) sleep-code) ) @@ -2900,7 +2861,6 @@ This commonly includes things such as: (transform-post) (process-entity-status! self (entity-perm-status subtask-complete) #t) (sleep-code) - (none) ) ) @@ -3005,7 +2965,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior mtn-gear-device) ja-post) ) @@ -3227,7 +3186,6 @@ This commonly includes things such as: ) ) (go-virtual waiting) - (none) ) :post (the-as (function none :behavior trans-plat) plat-post) ) @@ -3253,7 +3211,6 @@ This commonly includes things such as: ((the-as (function none) t9-5)) ) ) - (none) ) :exit (behavior () (while (-> self child) @@ -3264,7 +3221,6 @@ This commonly includes things such as: (t9-2) ) ) - (none) ) :trans (behavior () (cond @@ -3289,7 +3245,6 @@ This commonly includes things such as: (t9-2) ) ) - (none) ) ) @@ -3304,7 +3259,6 @@ This commonly includes things such as: (if (logtest? (-> self flags) (mtn-plat-flags mtpflags-0)) (process-release? *target*) ) - (none) ) ) @@ -3315,7 +3269,6 @@ This commonly includes things such as: (if (>= (- (current-time) (-> self ride-timer)) (seconds 1)) (go-virtual waiting) ) - (none) ) ) diff --git a/goal_src/jak2/levels/mountain/mountain-obs2.gc b/goal_src/jak2/levels/mountain/mountain-obs2.gc index 02048472c6e..7a593f764bb 100644 --- a/goal_src/jak2/levels/mountain/mountain-obs2.gc +++ b/goal_src/jak2/levels/mountain/mountain-obs2.gc @@ -33,7 +33,6 @@ (if (task-node-closed? (game-task-node canyon-insert-items-door)) (go-virtual open) ) - (none) ) :code (behavior () (let ((root-prim (-> self root root-prim))) @@ -43,7 +42,6 @@ (ja :num-func num-func-identity :frame-num 0.0) (ja-post) (sleep-code) - (none) ) ) @@ -53,7 +51,6 @@ (if (not (task-node-closed? (game-task-node canyon-insert-items-door))) (go-virtual close) ) - (none) ) :code (behavior () (let ((root-prim (-> self root root-prim))) @@ -64,7 +61,6 @@ (ja :num-func num-func-identity :frame-num max) (ja-post) (sleep-code) - (none) ) ) @@ -187,83 +183,80 @@ For example for an elevator pre-compute the distance between the first and last (defstate plat-path-active (mtn-plat-shoot) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('bonk) - (the-as object (start-bouncing! self)) - ) - (('attack) - (when (zero? (-> self state-flip)) - (let ((attack-info (the-as object (-> event param 1)))) - (when (!= (-> (the-as attack-info attack-info) id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> (the-as attack-info attack-info) id)) - (let* ((attacking-proc proc) - (attacker (if (type? attacking-proc process-drawable) - (the-as process-drawable attacking-proc) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (start-bouncing! self) + ) + (('attack) + (when (zero? (-> self state-flip)) + (let ((attack-info (the-as object (-> block param 1)))) + (when (!= (-> (the-as attack-info attack-info) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info attack-info) id)) + (let* ((attacking-proc proc) + (attacker (if (type? attacking-proc process-drawable) + (the-as process-drawable attacking-proc) + ) + ) + ) + (when attacker + (let* ((attacker-root (-> attacker root)) + (cshape (if (type? attacker-root collide-shape) + (the-as collide-shape attacker-root) ) ) - ) - (when attacker - (let* ((attacker-root (-> attacker root)) - (cshape (if (type? attacker-root collide-shape) - (the-as collide-shape attacker-root) - ) - ) - ) - (when cshape - (when (logtest? (-> cshape root-prim prim-core collide-as) (collide-spec projectile)) - (when (zero? (-> self state-flip)) - (sound-play "mtn-plat-flip1") - (set! (-> self state-flip) (the-as uint 1)) - ) - (set! (-> self hint-count) -1.0) - (vector-! (-> self axe-flip) (-> cshape trans) (-> self root trans)) - (set! (-> self axe-flip y) 0.0) - (vector-normalize! (-> self axe-flip) 1.0) - (vector-rotate90-around-y! (-> self axe-flip) (-> self axe-flip)) - (set! (-> self angle-flip-vel) -10.0) - (set! (-> self state-time) (current-time)) + ) + (when cshape + (when (logtest? (-> cshape root-prim prim-core collide-as) (collide-spec projectile)) + (when (zero? (-> self state-flip)) + (sound-play "mtn-plat-flip1") + (set! (-> self state-flip) (the-as uint 1)) ) + (set! (-> self hint-count) -1.0) + (vector-! (-> self axe-flip) (-> cshape trans) (-> self root trans)) + (set! (-> self axe-flip y) 0.0) + (vector-normalize! (-> self axe-flip) 1.0) + (vector-rotate90-around-y! (-> self axe-flip) (-> self axe-flip)) + (set! (-> self angle-flip-vel) -10.0) + (set! (-> self state-time) (current-time)) ) ) ) ) - #f ) + #f ) ) ) - (('hint) - (when (>= (-> self hint-count) 0.0) - (+! (-> self hint-count) (seconds-per-frame)) - (when (< (rand-vu-float-range 6.0 10.0) (-> self hint-count)) - (talker-spawn-func (-> *talker-speech* 56) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self hint-count) 0.0) - ) + ) + (('hint) + (when (>= (-> self hint-count) 0.0) + (+! (-> self hint-count) (seconds-per-frame)) + (when (< (rand-vu-float-range 6.0 10.0) (-> self hint-count)) + (talker-spawn-func (-> *talker-speech* 56) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self hint-count) 0.0) ) ) - (('track) - (cond - ((-> event param 0) - (if (zero? (-> self state-flip)) - #t - 'abort - ) - ) - ((and *target* - (-> self disable-track-under) - (< (-> *target* control trans y) (+ -20480.0 (-> self root trans y))) - ) - #f - ) - (else - (zero? (-> self state-flip)) - ) + ) + (('track) + (cond + ((-> block param 0) + (if (zero? (-> self state-flip)) + #t + 'abort + ) + ) + ((and *target* + (-> self disable-track-under) + (< (-> *target* control trans y) (+ -20480.0 (-> self root trans y))) + ) + #f + ) + (else + (zero? (-> self state-flip)) ) ) - ) + ) ) ) :enter (behavior () @@ -275,7 +268,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> self dest-angle) 180.0) (set! (-> self on-shake) #f) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (the int (-> self time-flip))) @@ -328,7 +320,6 @@ For example for an elevator pre-compute the distance between the first and last (func) ) ) - (none) ) :post (behavior () (let ((func (-> (method-of-type plat plat-path-active) post))) @@ -336,7 +327,6 @@ For example for an elevator pre-compute the distance between the first and last ((the-as (function none) func)) ) ) - (none) ) ) diff --git a/goal_src/jak2/levels/mountain/mountain-scenes.gc b/goal_src/jak2/levels/mountain/mountain-scenes.gc index 1cdf2d08807..df800a2623e 100644 --- a/goal_src/jak2/levels/mountain/mountain-scenes.gc +++ b/goal_src/jak2/levels/mountain/mountain-scenes.gc @@ -1643,27 +1643,25 @@ (defstate idle (mtn-plat-buried-rocks) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('trigger) - (process-spawn scene-player :init scene-player-init "mtn-plat-buried-rocks-a" #t #f) - ) - (('done) - (go-virtual done #f) - ) - (('die) - (cleanup-for-death self) - (the-as object (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (process-spawn scene-player :init scene-player-init "mtn-plat-buried-rocks-a" #t #f) + ) + (('done) + (go-virtual done #f) + ) + (('die) + (cleanup-for-death self) + (deactivate self) + ) + ) ) :code (behavior () (ja-post) (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -1690,7 +1688,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -1820,11 +1817,11 @@ otherwise, [[plat::34]] (defstate plat-idle (mtn-plat-buried) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('bonk) (if (not (logtest? (-> self options) (actor-option blocked))) - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) (('trigger) @@ -1835,7 +1832,7 @@ otherwise, [[plat::34]] ) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -1851,13 +1848,11 @@ otherwise, [[plat::34]] (func) ) ) - (none) ) :trans (behavior () (if (not (logtest? (-> self options) (actor-option blocked))) (execute-effects self) ) - (none) ) ) @@ -3000,7 +2995,6 @@ This commonly includes things such as: :code (the-as (function none :behavior mtn-lens-floor) transform-and-sleep-code) :post (behavior () (spawn-with-cspace (-> self part) (-> self node-list data 3)) - (none) ) ) diff --git a/goal_src/jak2/levels/mountain/rhino-wall.gc b/goal_src/jak2/levels/mountain/rhino-wall.gc index 59f98183c7b..8f5562e07b4 100644 --- a/goal_src/jak2/levels/mountain/rhino-wall.gc +++ b/goal_src/jak2/levels/mountain/rhino-wall.gc @@ -71,8 +71,8 @@ (defstate unbroken (rhino-wall) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual hit) ) @@ -84,7 +84,6 @@ (suspend) (transform-post) (sleep-code) - (none) ) ) @@ -104,7 +103,6 @@ ) ) (go-virtual broken) - (none) ) :post (the-as (function none :behavior rhino-wall) transform-post) ) @@ -129,7 +127,6 @@ (suspend) (transform-post) (sleep-code) - (none) ) ) diff --git a/goal_src/jak2/levels/mountain/rhino.gc b/goal_src/jak2/levels/mountain/rhino.gc index 2a0d46daed4..858306543b9 100644 --- a/goal_src/jak2/levels/mountain/rhino.gc +++ b/goal_src/jak2/levels/mountain/rhino.gc @@ -367,16 +367,6 @@ ) ) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 10] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 25] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 30] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 45] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 151] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 216] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 272] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 318] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 323] (defmethod general-event-handler rhino ((obj rhino) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" @@ -394,187 +384,182 @@ (sv-256 vector) (sv-272 matrix) ) - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'charge) - (if (-> obj wall) - (go (method-of-object obj charge)) - ) + (case arg2 + (('charge) + (if (-> obj wall) + (go (method-of-object obj charge)) ) - ((= v1-0 'hit) - (cond - ((zero? (-> obj hit-points)) - (set! (-> *rhino-nav-enemy-info* die-anim) 15) - (set! (-> obj frame-die-smush) 11.0) - (kill-prefer-falling obj) - ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) + ) + (('hit) + (cond + ((zero? (-> obj hit-points)) + (set! (-> *rhino-nav-enemy-info* die-anim) 15) + (set! (-> obj frame-die-smush) 11.0) + (kill-prefer-falling obj) + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) - ((= v1-0 'hit-flinch) - (cond - ((zero? (-> obj hit-points)) - (set! (-> *rhino-nav-enemy-info* die-anim) 14) - (set! (-> obj frame-die-smush) 16.0) - (kill-prefer-falling obj) - ) - (else - (let* ((s5-0 arg0) - (s2-0 (if (type? s5-0 process-drawable) - s5-0 - ) + ) + ) + (('hit-flinch) + (cond + ((zero? (-> obj hit-points)) + (set! (-> *rhino-nav-enemy-info* die-anim) 14) + (set! (-> obj frame-die-smush) 16.0) + (kill-prefer-falling obj) + ) + (else + (let* ((s5-0 arg0) + (s2-0 (if (type? s5-0 process-drawable) + s5-0 ) - (s3-0 (new 'stack-no-clear 'vector)) - (s4-0 (new 'stack-no-clear 'vector)) - (s5-1 (new 'stack-no-clear 'vector)) - ) - (vector-z-quaternion! s3-0 (-> obj root quat)) - (vector-x-quaternion! s4-0 (-> obj root quat)) - (vector-! s5-1 (-> (the-as process-focusable s2-0) root trans) (-> obj root trans)) - (set! (-> s5-1 y) 0.0) - (vector-normalize! s5-1 1.0) - (let* ((f30-0 (vector-dot s3-0 s5-1)) - (f28-0 (vector-dot s4-0 s5-1)) - (a0-16 (cond - ((>= f30-0 (cos 8192.0)) - (-> obj draw art-group data 16) - ) - ((>= (cos 24576.0) f30-0) - (-> obj draw art-group data 19) - ) - ((>= f28-0 (cos 8192.0)) - (-> obj draw art-group data 17) - ) - ((>= (cos 24576.0) f28-0) - (-> obj draw art-group data 18) - ) - (else - (-> obj draw art-group data 16) - ) - ) - ) - (v0-9 (ja-channel-float! (the-as art-joint-anim a0-16) 0.0 0.0 0.0)) ) - (when v0-9 - (set! (-> obj skel interp-select 0) (the-as int (the-as uint #x1c9002228))) - (set! (-> obj skel interp-select 1) 0) - (set! (-> v0-9 param 0) 1.0) - (set! (-> v0-9 param 1) 1.0) - (set! (-> v0-9 param 2) 3.0) - (set! (-> v0-9 num-func) num-func-interp1-play!) - ) - ) + (s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (vector-z-quaternion! s3-0 (-> obj root quat)) + (vector-x-quaternion! s4-0 (-> obj root quat)) + (vector-! s5-1 (-> (the-as process-focusable s2-0) root trans) (-> obj root trans)) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (let* ((f30-0 (vector-dot s3-0 s5-1)) + (f28-0 (vector-dot s4-0 s5-1)) + (a0-16 (cond + ((>= f30-0 (cos 8192.0)) + (-> obj draw art-group data 16) + ) + ((>= (cos 24576.0) f30-0) + (-> obj draw art-group data 19) + ) + ((>= f28-0 (cos 8192.0)) + (-> obj draw art-group data 17) + ) + ((>= (cos 24576.0) f28-0) + (-> obj draw art-group data 18) + ) + (else + (-> obj draw art-group data 16) + ) + ) + ) + (v0-9 (ja-channel-float! (the-as art-joint-anim a0-16) 0.0 0.0 0.0)) + ) + (when v0-9 + (set! (-> obj skel interp-select 0) (the-as int (the-as uint #x1c9002228))) + (set! (-> obj skel interp-select 1) 0) + (set! (-> v0-9 param 0) 1.0) + (set! (-> v0-9 param 1) 1.0) + (set! (-> v0-9 param 2) 3.0) + (set! (-> v0-9 num-func) num-func-interp1-play!) ) - (+! (-> obj num-hit-flinch) 1) - 'back ) ) + (+! (-> obj num-hit-flinch) 1) + 'back ) - ((= v1-0 'event-slide-poof) - (let ((s5-2 (-> arg3 param 1))) - (cond - ((= (-> obj root ground-pat material) (pat-material grass)) - (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-1 - (let ((t9-14 (method-of-type part-tracker activate))) - (t9-14 (the-as part-tracker s4-1) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) - ) - (let ((s3-1 run-function-in-process) - (s2-1 s4-1) - (s1-0 part-tracker-init) - (s0-0 (-> *part-group-id-table* 351)) - ) - (set! sv-96 0) - (set! sv-112 (the-as symbol #f)) - (set! sv-128 (the-as symbol #f)) - (set! sv-144 (the-as symbol #f)) - (set! sv-176 *launch-matrix*) - (set! sv-160 (-> sv-176 trans)) - (let ((v1-52 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data s5-2)) quad))) - (set! (-> sv-160 quad) v1-52) - ) - ((the-as (function object object object object object object object object none) s3-1) - s2-1 - s1-0 - s0-0 - sv-96 - sv-112 - sv-128 - sv-144 - sv-176 - ) + ) + ) + (('event-slide-poof) + (let ((s5-2 (-> arg3 param 1))) + (cond + ((= (-> obj root ground-pat material) (pat-material grass)) + (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when s4-1 + (let ((t9-14 (method-of-type part-tracker activate))) + (t9-14 (the-as part-tracker s4-1) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((s3-1 run-function-in-process) + (s2-1 s4-1) + (s1-0 part-tracker-init) + (s0-0 (-> *part-group-id-table* 351)) ) - (-> s4-1 ppointer) + (set! sv-96 0) + (set! sv-112 (the-as symbol #f)) + (set! sv-128 (the-as symbol #f)) + (set! sv-144 (the-as symbol #f)) + (set! sv-176 *launch-matrix*) + (set! sv-160 (-> sv-176 trans)) + (let ((v1-52 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data s5-2)) quad))) + (set! (-> sv-160 quad) v1-52) ) + ((the-as (function object object object object object object object object none) s3-1) + s2-1 + s1-0 + s0-0 + sv-96 + sv-112 + sv-128 + sv-144 + sv-176 + ) ) + (-> s4-1 ppointer) ) - (else - (let ((s4-2 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-2 - (let ((t9-18 (method-of-type part-tracker activate))) - (t9-18 (the-as part-tracker s4-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) - ) - (let ((s3-2 run-function-in-process) - (s2-2 s4-2) - (s1-1 part-tracker-init) - (s0-1 (-> *part-group-id-table* 350)) - ) - (set! sv-192 0) - (set! sv-208 (the-as symbol #f)) - (set! sv-224 (the-as symbol #f)) - (set! sv-240 (the-as symbol #f)) - (set! sv-272 *launch-matrix*) - (set! sv-256 (-> sv-272 trans)) - (let ((v1-64 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data s5-2)) quad))) - (set! (-> sv-256 quad) v1-64) - ) - ((the-as (function object object object object object object object object none) s3-2) - s2-2 - s1-1 - s0-1 - sv-192 - sv-208 - sv-224 - sv-240 - sv-272 - ) + ) + ) + (else + (let ((s4-2 (get-process *default-dead-pool* part-tracker #x4000))) + (when s4-2 + (let ((t9-18 (method-of-type part-tracker activate))) + (t9-18 (the-as part-tracker s4-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((s3-2 run-function-in-process) + (s2-2 s4-2) + (s1-1 part-tracker-init) + (s0-1 (-> *part-group-id-table* 350)) ) - (-> s4-2 ppointer) + (set! sv-192 0) + (set! sv-208 (the-as symbol #f)) + (set! sv-224 (the-as symbol #f)) + (set! sv-240 (the-as symbol #f)) + (set! sv-272 *launch-matrix*) + (set! sv-256 (-> sv-272 trans)) + (let ((v1-64 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data s5-2)) quad))) + (set! (-> sv-256 quad) v1-64) ) + ((the-as (function object object object object object object object object none) s3-2) + s2-2 + s1-1 + s0-1 + sv-192 + sv-208 + sv-224 + sv-240 + sv-272 + ) ) + (-> s4-2 ppointer) ) ) ) ) - ((= v1-0 'interesting) - (+! (-> obj interest) 1) - (let ((v1-67 (process->ppointer obj))) - (set-setting! 'handle-of-interest v1-67 0.0 (-> v1-67 0 pid)) - ) - ) - ((= v1-0 'uninteresting) - (+! (-> obj interest) -1) - (when (<= (-> obj interest) 0) - (set! (-> obj interest) 0) - (remove-setting! 'handle-of-interest) - ) - ) - ((= v1-0 'death-end) - (let ((v1-74 (-> obj root root-prim))) - (set! (-> v1-74 prim-core collide-as) (collide-spec)) - (set! (-> v1-74 prim-core collide-with) (collide-spec)) - ) - 0 - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) + ) + ) + (('interesting) + (+! (-> obj interest) 1) + (let ((v1-67 (process->ppointer obj))) + (set-setting! 'handle-of-interest v1-67 0.0 (-> v1-67 0 pid)) + ) + ) + (('uninteresting) + (+! (-> obj interest) -1) + (when (<= (-> obj interest) 0) + (set! (-> obj interest) 0) + (remove-setting! 'handle-of-interest) + ) + ) + (('death-end) + (let ((v1-74 (-> obj root root-prim))) + (set! (-> v1-74 prim-core collide-as) (collide-spec)) + (set! (-> v1-74 prim-core collide-with) (collide-spec)) + ) + 0 + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) ) ) @@ -591,7 +576,6 @@ ) ) (logclear! (-> self enemy-flags) (enemy-flag enable-on-active)) - (none) ) :exit (behavior () (local-vars (v0-1 enemy-flag)) @@ -607,7 +591,6 @@ ) ) (set! (-> self enemy-flags) v0-1) - (none) ) :trans (behavior () (cond @@ -631,7 +614,6 @@ ) ) ) - (none) ) ) @@ -642,7 +624,6 @@ (dispose! self) (set! (-> self hit-points) 0) 0 - (none) ) :code (behavior () (set! (-> self smush-target) (the-as smush-control #t)) @@ -676,7 +657,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -743,7 +723,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (go-hostile self) - (none) ) ) @@ -783,40 +762,37 @@ ) ) ) - (the-as - object - (when (and (the-as uint touch-entry) v1-0) - (cond - ((and (focus-test? obj dangerous) ((method-of-type touching-shapes-entry prims-touching-action?) - touch-entry - (-> obj root) - (collide-action deadly) - (collide-action) - ) - ) - (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) - touch-entry - (-> obj root) - (collide-action persistent-attack) - (collide-action) - ) - (-> obj persistent-attack-id) - (-> obj attack-id) - ) - ) - ) - (enemy-method-104 obj arg0 touch-entry a3-2) - ) - ) - (((method-of-type touching-shapes-entry prims-touching-action?) - touch-entry - (-> obj root) - (collide-action no-standon) - (collide-action) - ) - (send-shoves (-> obj root) arg0 touch-entry 0.7 6144.0 16384.0) + (when (and (the-as uint touch-entry) v1-0) + (cond + ((and (focus-test? obj dangerous) ((method-of-type touching-shapes-entry prims-touching-action?) + touch-entry + (-> obj root) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + touch-entry + (-> obj root) + (collide-action persistent-attack) + (collide-action) + ) + (-> obj persistent-attack-id) + (-> obj attack-id) + ) + ) + ) + (enemy-method-104 obj arg0 touch-entry a3-2) ) + ) + (((method-of-type touching-shapes-entry prims-touching-action?) + touch-entry + (-> obj root) + (collide-action no-standon) + (collide-action) ) + (send-shoves (-> obj root) arg0 touch-entry 0.7 6144.0 16384.0) + ) ) ) ) @@ -859,7 +835,6 @@ (t9-0) ) ) - (none) ) ) @@ -871,7 +846,6 @@ (t9-0) ) ) - (none) ) ) @@ -901,7 +875,6 @@ (if (and (= (-> self victory-count) 3) (not (-> self stomach-touched-once?))) (talker-spawn-func (-> *talker-speech* 59) *entity-pool* (target-pos 0) (the-as region #f)) ) - (none) ) :exit (behavior () (set! (-> self can-hit?) #f) @@ -921,7 +894,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1022,7 +994,6 @@ ) ) ) - (none) ) ) @@ -1072,13 +1043,11 @@ ) ) 0 - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 1.5)) (go-virtual active) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.05)) @@ -1094,11 +1063,9 @@ (suspend) ) #f - (none) ) :post (behavior () (nav-enemy-travel-post) - (none) ) ) @@ -1116,7 +1083,6 @@ (nav-enemy-method-166 self) (set! (-> self state-time) (current-time)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -1202,7 +1168,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1215,7 +1180,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1227,7 +1191,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -1260,7 +1223,6 @@ (set! (-> a0-10 target-post quad) (-> v1-17 quad)) ) 0 - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1268,11 +1230,9 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (enemy-method-49 self) - (none) ) :code (behavior () (let ((gp-0 #f)) @@ -1293,7 +1253,6 @@ (go-hostile self) ) ) - (none) ) :post (the-as (function none :behavior rhino) nav-enemy-travel-post) ) @@ -1355,7 +1314,6 @@ (set! (-> self angle-speed) 0.0) (set! (-> self num-hit-flinch) 0) 0 - (none) ) :exit (behavior () (let ((v1-1 (-> self nav state))) @@ -1367,7 +1325,6 @@ ) 0 (set! (-> self in-stop-run) #f) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1436,7 +1393,6 @@ (go-virtual victory) (go-virtual hostile) ) - (none) ) :post (the-as (function none :behavior rhino) nav-enemy-travel-post) ) @@ -1469,11 +1425,9 @@ (vector-xz-normalize! s5-1 163840.0) (vector+! (-> self dest) gp-0 s5-1) ) - (none) ) :exit (behavior () (set! (-> self wall) #f) - (none) ) :code (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -1518,7 +1472,6 @@ (ja :num! (seek!)) ) (go-virtual victory) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1530,7 +1483,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -1546,7 +1498,6 @@ (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) ) @@ -1562,7 +1513,6 @@ (set! (-> v1-5 speed) 0.0) ) 0 - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -1657,7 +1607,6 @@ ) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/nest/boss/metalkor-extras.gc b/goal_src/jak2/levels/nest/boss/metalkor-extras.gc index 3b87d0603b0..43ad3123093 100644 --- a/goal_src/jak2/levels/nest/boss/metalkor-extras.gc +++ b/goal_src/jak2/levels/nest/boss/metalkor-extras.gc @@ -38,13 +38,11 @@ ) ) ) - (none) ) :code (the-as (function none :behavior metalkor-egg) sleep-code) :post (behavior () (ja-post) (do-push-aways (-> self root)) - (none) ) ) @@ -84,7 +82,6 @@ (send-event-function (ppointer->process (-> self parent)) gp-0) ) ) - (none) ) :trans (behavior () (let ((v1-2 (ja-group))) @@ -101,13 +98,11 @@ ) ) ) - (none) ) :code (the-as (function none :behavior metalkor-egg) sleep-code) :post (behavior () (ja-post) (do-push-aways (-> self root)) - (none) ) ) @@ -116,7 +111,6 @@ :event metalkor-egg-handler :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (local-vars (v1-5 float) (v1-27 float) (v1-34 float)) @@ -212,14 +206,12 @@ ) ) ) - (none) ) ) :code (the-as (function none :behavior metalkor-egg) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -228,7 +220,6 @@ :event metalkor-egg-handler :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 3)) @@ -254,13 +245,11 @@ ) ) ) - (none) ) :code (the-as (function none :behavior metalkor-egg) sleep-code) :post (behavior () (ja-post) (do-push-aways (-> self root)) - (none) ) ) @@ -696,7 +685,6 @@ ((method-of-type cam-float-seeker init) (the-as cam-float-seeker (-> self foot-locks gp-0)) 0.0 0.1 0.3 0.9) (set! (-> self foot-locks gp-0 initialized) #f) ) - (none) ) :trans (behavior () (clone-anim-once (ppointer->handle (-> self parent)) #t (-> self prefix)) @@ -733,13 +721,11 @@ ) ) (metalkor-update-ik) - (none) ) :code (the-as (function none :behavior metalkor-legs) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1267,131 +1253,127 @@ (defstate idle (metalkor-lowtorso) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (the-as - object - (case event-type - (('egg-toss) - (set! (-> self egg-toss-joint-angle target) (the-as float (-> event param 0))) - ) - (('color) - (set! (-> self draw color-mult quad) (-> (the-as rgbaf (-> event param 0)) quad)) - (set! v0-0 (-> self draw color-emissive)) - (set! (-> (the-as rgbaf v0-0) quad) (-> (the-as rgbaf (-> event param 1)) quad)) - v0-0 - ) - (('move-chain) - (let ((v1-7 (-> event param 0)) - (a0-9 (-> self tail)) - ) - (dotimes (a1-1 (the-as int (-> a0-9 num-joints))) - (vector+! - (the-as vector (-> a0-9 chain-joints a1-1)) - (the-as vector (-> a0-9 chain-joints a1-1)) - (the-as vector v1-7) - ) + (case message + (('egg-toss) + (set! (-> self egg-toss-joint-angle target) (the-as float (-> block param 0))) + ) + (('color) + (set! (-> self draw color-mult quad) (-> (the-as rgbaf (-> block param 0)) quad)) + (set! v0-0 (-> self draw color-emissive)) + (set! (-> (the-as rgbaf v0-0) quad) (-> (the-as rgbaf (-> block param 1)) quad)) + v0-0 + ) + (('move-chain) + (let ((v1-7 (-> block param 0)) + (a0-9 (-> self tail)) + ) + (dotimes (a1-1 (the-as int (-> a0-9 num-joints))) + (vector+! + (the-as vector (-> a0-9 chain-joints a1-1)) + (the-as vector (-> a0-9 chain-joints a1-1)) + (the-as vector v1-7) ) ) - #f ) - (('spinner) - (let ((v1-10 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))) - (the-as object (metalkor-lowtorso-start-spinner (the-as int (-> event param 0)) (-> v1-10 vector 2))) - ) + #f + ) + (('spinner) + (let ((v1-10 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))) + (metalkor-lowtorso-start-spinner (the-as int (-> block param 0)) (-> v1-10 vector 2)) ) - (('spinner-off) - (let ((gp-1 (-> event param 0))) - (when (< (the-as int gp-1) 4) - (let ((a0-17 (handle->process (-> self spinners gp-1)))) - (when a0-17 - (send-event a0-17 'break) - (set! (-> self spinners gp-1) (the-as handle #f)) - #f - ) + ) + (('spinner-off) + (let ((gp-1 (-> block param 0))) + (when (< (the-as int gp-1) 4) + (let ((a0-17 (handle->process (-> self spinners gp-1)))) + (when a0-17 + (send-event a0-17 'break) + (set! (-> self spinners gp-1) (the-as handle #f)) + #f ) ) ) ) - (('ja-float) - (dotimes (s5-1 3) - (when (not (-> (the-as metalkor-lowtorso (+ (the-as uint self) (* s5-1 16))) ja-float-info 0 float-anim)) - (set! (-> (the-as metalkor-lowtorso (+ (the-as uint self) (* s5-1 16))) ja-float-info 0 float-anim) - (get-art-by-name (-> self draw art-group) (the-as string (-> event param 0)) art-joint-anim) - ) - (set! (-> (the-as metalkor-lowtorso (+ (the-as uint self) (* s5-1 16))) ja-float-info 0 channel-index) - (the-as int (-> event param 1)) - ) - (set! v0-0 #t) - (goto cfg-31) - ) + ) + (('ja-float) + (dotimes (s5-1 3) + (when (not (-> (the-as metalkor-lowtorso (+ (the-as uint self) (* s5-1 16))) ja-float-info 0 float-anim)) + (set! (-> (the-as metalkor-lowtorso (+ (the-as uint self) (* s5-1 16))) ja-float-info 0 float-anim) + (get-art-by-name (-> self draw art-group) (the-as string (-> block param 0)) art-joint-anim) + ) + (set! (-> (the-as metalkor-lowtorso (+ (the-as uint self) (* s5-1 16))) ja-float-info 0 channel-index) + (the-as int (-> block param 1)) + ) + (set! v0-0 #t) + (goto cfg-31) ) - (set! v0-0 #f) - (label cfg-31) - v0-0 ) - (('attack) - (let ((v1-32 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-32 from) (process->ppointer proc)) - (set! (-> v1-32 num-params) arg1) - (set! (-> v1-32 message) event-type) - (set! (-> v1-32 param 0) (-> event param 0)) - (set! (-> v1-32 param 1) (-> event param 1)) - (set! (-> v1-32 param 2) (-> event param 2)) - (set! (-> v1-32 param 3) (-> event param 3)) - (set! (-> v1-32 param 4) (-> event param 4)) - (set! (-> v1-32 param 5) (-> event param 5)) - (send-event-function (ppointer->process (-> self parent)) v1-32) - ) + (set! v0-0 #f) + (label cfg-31) + v0-0 + ) + (('attack) + (let ((v1-32 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-32 from) (process->ppointer proc)) + (set! (-> v1-32 num-params) argc) + (set! (-> v1-32 message) message) + (set! (-> v1-32 param 0) (-> block param 0)) + (set! (-> v1-32 param 1) (-> block param 1)) + (set! (-> v1-32 param 2) (-> block param 2)) + (set! (-> v1-32 param 3) (-> block param 3)) + (set! (-> v1-32 param 4) (-> block param 4)) + (set! (-> v1-32 param 5) (-> block param 5)) + (send-event-function (ppointer->process (-> self parent)) v1-32) ) - (('touch) - (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> self entity trans quad)) - (let* ((s3-0 proc) - (v1-36 (if (type? s3-0 process-drawable) - s3-0 - ) - ) - ) - (when v1-36 - (let ((s3-2 (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable v1-36) root trans) s4-0)) - (s4-2 - (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable v1-36) root trans) (-> self root trans)) + ) + (('touch) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> self entity trans quad)) + (let* ((s3-0 proc) + (v1-36 (if (type? s3-0 process-drawable) + s3-0 + ) ) + ) + (when v1-36 + (let ((s3-2 (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable v1-36) root trans) s4-0)) + (s4-2 + (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable v1-36) root trans) (-> self root trans)) ) - (set! (-> s3-2 y) 0.0) - (set! (-> s4-2 y) 0.0) - (when (< (vector-dot s3-2 s4-2) 0.0) - (vector-normalize! s3-2 1.0) - (vector-normalize! s4-2 1.0) - (vector-flatten! s4-2 s4-2 s3-2) ) - (vector-normalize! s4-2 32768.0) - (when (send-event - proc - 'attack - (-> event param 0) - (static-attack-info ((id (new-attack-id)) (mode 'deadly) (vector s4-2) (shove-up (meters 4)))) - ) - (set! (-> self no-collision-timer) (current-time)) - (let ((v1-52 (-> self root root-prim))) - (set! (-> v1-52 prim-core collide-as) (collide-spec)) - (set! (-> v1-52 prim-core collide-with) (collide-spec)) - ) - 0 + (set! (-> s3-2 y) 0.0) + (set! (-> s4-2 y) 0.0) + (when (< (vector-dot s3-2 s4-2) 0.0) + (vector-normalize! s3-2 1.0) + (vector-normalize! s4-2 1.0) + (vector-flatten! s4-2 s4-2 s3-2) + ) + (vector-normalize! s4-2 32768.0) + (when (send-event + proc + 'attack + (-> block param 0) + (static-attack-info ((id (new-attack-id)) (mode 'deadly) (vector s4-2) (shove-up (meters 4)))) + ) + (set! (-> self no-collision-timer) (current-time)) + (let ((v1-52 (-> self root root-prim))) + (set! (-> v1-52 prim-core collide-as) (collide-spec)) + (set! (-> v1-52 prim-core collide-with) (collide-spec)) ) + 0 ) ) ) ) ) - ) + ) ) ) :enter (behavior () (set! (-> self state-time) (current-time)) (set-params! (-> self egg-toss-joint-angle) 0.0 0.05 0.3 0.9) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self no-collision-timer)) (seconds 0.1)) @@ -1456,13 +1438,11 @@ ) ) (update (-> self tail) self) - (none) ) :code (the-as (function none :behavior metalkor-lowtorso) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1633,16 +1613,15 @@ (defstate idle (rift-ring-ingame) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('stutter) - (set! (-> self stutter) (the-as symbol (-> event param 0))) - (set-params! (-> self anim-speed) 3 15 0.25) - (reset! (-> self anim-speed)) - (set! (-> self anim-speed value) -0.25) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('stutter) + (set! (-> self stutter) (the-as symbol (-> block param 0))) + (set-params! (-> self anim-speed) 3 15 0.25) + (reset! (-> self anim-speed)) + (set! (-> self anim-speed value) -0.25) + ) + ) ) :trans (behavior () (cond @@ -1656,13 +1635,11 @@ ) (sound-play "warp-ring" :id (-> self spin-sound) :position (-> self root trans)) (set! (-> self spin-sound-playing) #t) - (none) ) :code (the-as (function none :behavior rift-ring-ingame) sleep-code) :post (behavior () (spawn (-> self part) (-> self root trans)) (ja-post) - (none) ) ) @@ -1741,7 +1718,6 @@ This commonly includes things such as: (turn-off (-> self chain) (the-as time-frame (the int (* 300.0 (rand-vu-float-range 0.9 1.2))))) (ja-channel-push! 1 (seconds 0.1)) (ja :group! (-> self draw art-group data 52) :num! min) - (none) ) :trans (behavior () (let* ((v1-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) @@ -1773,7 +1749,6 @@ This commonly includes things such as: (ja :group! (-> self draw art-group data 53) :num! min) ) ) - (none) ) :code (the-as (function none :behavior metalkor-spinner) sleep-code) :post (the-as (function none :behavior metalkor-spinner) ja-post) @@ -1781,8 +1756,8 @@ This commonly includes things such as: (defstate idle (metalkor-spinner) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('break) (go-virtual break-it) ) @@ -1790,7 +1765,6 @@ This commonly includes things such as: ) :enter (behavior () (ja :group! (-> self draw art-group data 50)) - (none) ) :trans (behavior () (ja :num! (loop!)) @@ -1819,7 +1793,6 @@ This commonly includes things such as: (quaternion-from-two-vectors! (-> self root quat) (new 'static 'vector :y -1.0) gp-1) (set! (-> self root scale y) (* 0.000009042245 f30-0)) ) - (none) ) :code (the-as (function none :behavior metalkor-spinner) sleep-code) :post (the-as (function none :behavior metalkor-spinner) ja-post) @@ -1827,13 +1800,12 @@ This commonly includes things such as: (defstate shoot-out (metalkor-spinner) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('break) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('break) + (deactivate self) + ) + ) ) :enter (behavior () (let* ((f30-0 0.9) @@ -1843,7 +1815,6 @@ This commonly includes things such as: ) (set! (-> self anim-speed) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-4))))) ) - (none) ) :trans (behavior () (let ((v1-2 (ja-group))) @@ -1885,7 +1856,6 @@ This commonly includes things such as: ) (quaternion-from-two-vectors! (-> self root quat) (new 'static 'vector :y -1.0) gp-2) ) - (none) ) :code (the-as (function none :behavior metalkor-spinner) sleep-code) :post (the-as (function none :behavior metalkor-spinner) ja-post) @@ -1913,7 +1883,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (ja-post) - (none) ) :code (the-as (function none :behavior nest-break-precipice) sleep-code) ) @@ -1923,7 +1892,6 @@ This commonly includes things such as: :trans (behavior () (cleanup-for-death self) (deactivate self) - (none) ) :code (the-as (function none :behavior nest-break-precipice) sleep-code) ) @@ -2029,7 +1997,6 @@ This commonly includes things such as: :trans (behavior () (ja :num! (loop!)) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) - (none) ) :code (the-as (function none :behavior metalkor-kid) sleep-code) :post (the-as (function none :behavior metalkor-kid) ja-post) @@ -2039,7 +2006,6 @@ This commonly includes things such as: :virtual #t :trans (behavior () (clone-anim-once (ppointer->handle (-> self parent)) #t (-> self prefix)) - (none) ) :code (the-as (function none :behavior metalkor-wings) sleep-code) :post (the-as (function none :behavior metalkor-wings) ja-post) @@ -2081,14 +2047,12 @@ This commonly includes things such as: :virtual #t :enter (behavior () (metalkor-distort-update) - (none) ) :trans (behavior () (ja :num! (seek!)) (if (ja-done? 0) (deactivate self) ) - (none) ) :code (the-as (function none :behavior metalkor-distort) sleep-code) :post (the-as (function none :behavior metalkor-distort) ja-post) @@ -2115,14 +2079,12 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 0.0) - (none) ) :trans (behavior () (clone-anim-once (ppointer->handle (-> self parent)) #t "") (let ((f0-0 (calc-fade-from-fog (-> self root trans)))) (set-vector! (-> self draw color-emissive) f0-0 f0-0 f0-0 1.0) ) - (none) ) :code (the-as (function none :behavior metalkor-rays) sleep-code) :post (the-as (function none :behavior metalkor-rays) ja-post) @@ -2185,7 +2147,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (process-spawn metalkor-rays (-> self root trans) (-> self root quat) :to self) - (none) ) :trans (behavior () (local-vars (sv-384 symbol) (sv-400 symbol) (sv-416 vector) (sv-432 matrix)) @@ -2276,7 +2237,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior metalkor-explode) sleep-code) :post (the-as (function none :behavior metalkor-explode) ja-post) @@ -2284,34 +2244,29 @@ This commonly includes things such as: (defstate idle (rift-occlude) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('movie-pos) - (format 0 "changing to movie position~%") - (let ((a2-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))) - (vector+! - (-> self root trans) - (-> self original-trans) - (vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :x -10240.0 :y -7168.0 :z 11264.0) a2-1) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('movie-pos) + (format 0 "changing to movie position~%") + (let ((a2-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))) + (vector+! + (-> self root trans) + (-> self original-trans) + (vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :x -10240.0 :y -7168.0 :z 11264.0) a2-1) ) - (the-as symbol (ja-post)) ) - ) + (ja-post) + ) ) ) :enter (behavior () (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 0.0) (ja-post) - (none) ) :trans (behavior () (let ((f0-0 (calc-fade-from-fog (-> self root trans)))) (set-vector! (-> self draw color-emissive) f0-0 f0-0 f0-0 1.0) ) - (none) ) :code (the-as (function none :behavior rift-occlude) sleep-code) ) @@ -2473,13 +2428,13 @@ This commonly includes things such as: (defstate idle (metalkor-bomb) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched 'touch) (send-event proc 'attack - (-> event param 0) + (-> block param 0) (static-attack-info ((id (new-attack-id)) (mode 'deadly) (shove-back (meters 0)) (shove-up (meters 4)))) ) ) @@ -2492,7 +2447,6 @@ This commonly includes things such as: ) (metalkor-bomb-ground-check) (metalkor-bomb-collide) - (none) ) :code (the-as (function none :behavior metalkor-bomb) sleep-code) :post (the-as (function none :behavior metalkor-bomb) ja-post) diff --git a/goal_src/jak2/levels/nest/boss/metalkor-setup.gc b/goal_src/jak2/levels/nest/boss/metalkor-setup.gc index 94420d3a22b..260aff4ba72 100644 --- a/goal_src/jak2/levels/nest/boss/metalkor-setup.gc +++ b/goal_src/jak2/levels/nest/boss/metalkor-setup.gc @@ -142,8 +142,8 @@ (defstate idle (gem-tracker) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('spawn-with-gem?) (!= (gem-tracker-get-slot (the-as process #f)) -1) ) @@ -151,9 +151,9 @@ (!= (gem-tracker-get-slot proc) -1) ) (('change-gem 'flitter-change-gem 'wasp-change-gem) - (let ((v1-3 (gem-tracker-get-slot (the-as process (-> event param 0))))) + (let ((v1-3 (gem-tracker-get-slot (the-as process (-> block param 0))))) (when (!= v1-3 -1) - (let ((gp-1 (-> event param 1))) + (let ((gp-1 (-> block param 1))) (set! (-> self gems v1-3) (process->handle (the-as process gp-1))) (if (type? gp-1 gem) (send-event (the-as process-tree gp-1) 'get-notify self) @@ -163,7 +163,7 @@ ) ) (('notify) - (case (-> event param 0) + (case (-> block param 0) (('pickup) (+! (-> self gems-collected) 1) (let ((v1-14 (-> self entity extra perm))) @@ -1656,10 +1656,7 @@ This commonly includes things such as: (let ((s5-2 (-> v1-48 data 0 actor))) (let ((a0-52 (search-process-tree *active-pool* - (the-as - (function process-tree object) - (lambda ((arg0 gem-tracker)) (= (-> arg0 type) flitter-gem-tracker) (none)) - ) + (lambda ((arg0 gem-tracker)) (= (-> arg0 type) flitter-gem-tracker) (none)) ) ) ) @@ -1673,11 +1670,7 @@ This commonly includes things such as: ) ) (let ((a0-63 - (search-process-tree *active-pool* (the-as - (function process-tree object) - (lambda ((arg0 gem-tracker)) (= (-> arg0 type) wasp-gem-tracker) (none)) - ) - ) + (search-process-tree *active-pool* (lambda ((arg0 gem-tracker)) (= (-> arg0 type) wasp-gem-tracker) (none))) ) ) (if a0-63 diff --git a/goal_src/jak2/levels/nest/boss/metalkor-states.gc b/goal_src/jak2/levels/nest/boss/metalkor-states.gc index e80b3b67b97..a8028347306 100644 --- a/goal_src/jak2/levels/nest/boss/metalkor-states.gc +++ b/goal_src/jak2/levels/nest/boss/metalkor-states.gc @@ -538,301 +538,296 @@ (none) ) -;; WARN: Return type mismatch none vs object. (defbehavior metalkor-handler metalkor ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-2 object)) - (the-as - object - (case arg2 - (('skip) - (dotimes (gp-1 10) - (let ((a0-4 (handle->process (-> self flitters gp-1)))) - (if a0-4 - (send-event a0-4 'die-fast) - ) - ) - ) - (dotimes (gp-2 3) - (let ((a0-8 (handle->process (-> self wasps gp-2)))) - (if a0-8 - (send-event a0-8 'die-fast) - ) - ) - ) - (the-as object (metalkor-go-next-stage)) - ) - (('track) - (-> self trackable) - ) - (('flitter-change-gem) - (let ((v1-23 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-23 from) (process->ppointer arg0)) - (set! (-> v1-23 num-params) arg1) - (set! (-> v1-23 message) arg2) - (set! (-> v1-23 param 0) (-> arg3 param 0)) - (set! (-> v1-23 param 1) (-> arg3 param 1)) - (set! (-> v1-23 param 2) (-> arg3 param 2)) - (set! (-> v1-23 param 3) (-> arg3 param 3)) - (set! (-> v1-23 param 4) (-> arg3 param 4)) - (set! (-> v1-23 param 5) (-> arg3 param 5)) - (send-event-function (handle->process (-> self flitter-gem-tracker)) v1-23) + (case arg2 + (('skip) + (dotimes (gp-1 10) + (let ((a0-4 (handle->process (-> self flitters gp-1)))) + (if a0-4 + (send-event a0-4 'die-fast) + ) ) ) - (('wasp-change-gem) - (let ((v1-24 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-24 from) (process->ppointer arg0)) - (set! (-> v1-24 num-params) arg1) - (set! (-> v1-24 message) arg2) - (set! (-> v1-24 param 0) (-> arg3 param 0)) - (set! (-> v1-24 param 1) (-> arg3 param 1)) - (set! (-> v1-24 param 2) (-> arg3 param 2)) - (set! (-> v1-24 param 3) (-> arg3 param 3)) - (set! (-> v1-24 param 4) (-> arg3 param 4)) - (set! (-> v1-24 param 5) (-> arg3 param 5)) - (send-event-function (handle->process (-> self wasp-gem-tracker)) v1-24) + (dotimes (gp-2 3) + (let ((a0-8 (handle->process (-> self wasps gp-2)))) + (if a0-8 + (send-event a0-8 'die-fast) + ) ) ) - (('have-gem?) - (let ((s4-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> s4-0 from) (process->ppointer arg0)) - (set! (-> s4-0 num-params) arg1) - (set! (-> s4-0 message) arg2) - (set! (-> s4-0 param 0) (-> arg3 param 0)) - (set! (-> s4-0 param 1) (-> arg3 param 1)) - (set! (-> s4-0 param 2) (-> arg3 param 2)) - (set! (-> s4-0 param 3) (-> arg3 param 3)) - (set! (-> s4-0 param 4) (-> arg3 param 4)) - (set! (-> s4-0 param 5) (-> arg3 param 5)) - (send-event-function (the-as process-tree (metalkor-get-gem-tracker (the-as process-focusable arg0))) s4-0) - ) + (metalkor-go-next-stage) + ) + (('track) + (-> self trackable) + ) + (('flitter-change-gem) + (let ((v1-23 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-23 from) (process->ppointer arg0)) + (set! (-> v1-23 num-params) arg1) + (set! (-> v1-23 message) arg2) + (set! (-> v1-23 param 0) (-> arg3 param 0)) + (set! (-> v1-23 param 1) (-> arg3 param 1)) + (set! (-> v1-23 param 2) (-> arg3 param 2)) + (set! (-> v1-23 param 3) (-> arg3 param 3)) + (set! (-> v1-23 param 4) (-> arg3 param 4)) + (set! (-> v1-23 param 5) (-> arg3 param 5)) + (send-event-function (handle->process (-> self flitter-gem-tracker)) v1-23) ) - (('setup-flitter-gem) - (let ((gp-3 (-> self entity extra))) - (cond - ((send-event (handle->process (-> self flitter-gem-tracker)) 'spawn-with-gem?) - (set! v0-2 (logclear (-> gp-3 perm status) (entity-perm-status save))) - (set! (-> gp-3 perm status) (the-as entity-perm-status v0-2)) - ) - (else - (set! v0-2 (logior (-> gp-3 perm status) (entity-perm-status save))) - (set! (-> gp-3 perm status) (the-as entity-perm-status v0-2)) - ) - ) - ) - v0-2 + ) + (('wasp-change-gem) + (let ((v1-24 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-24 from) (process->ppointer arg0)) + (set! (-> v1-24 num-params) arg1) + (set! (-> v1-24 message) arg2) + (set! (-> v1-24 param 0) (-> arg3 param 0)) + (set! (-> v1-24 param 1) (-> arg3 param 1)) + (set! (-> v1-24 param 2) (-> arg3 param 2)) + (set! (-> v1-24 param 3) (-> arg3 param 3)) + (set! (-> v1-24 param 4) (-> arg3 param 4)) + (set! (-> v1-24 param 5) (-> arg3 param 5)) + (send-event-function (handle->process (-> self wasp-gem-tracker)) v1-24) ) - (('hatch) - (let ((v1-41 (-> arg3 param 0))) - (set! (-> self flitters v1-41) (the-as handle (-> arg3 param 1))) - (send-event - (handle->process (-> self flitter-gem-tracker)) - 'change-gem - #f - (handle->process (-> self flitters v1-41)) - ) - ) + ) + (('have-gem?) + (let ((s4-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-0 from) (process->ppointer arg0)) + (set! (-> s4-0 num-params) arg1) + (set! (-> s4-0 message) arg2) + (set! (-> s4-0 param 0) (-> arg3 param 0)) + (set! (-> s4-0 param 1) (-> arg3 param 1)) + (set! (-> s4-0 param 2) (-> arg3 param 2)) + (set! (-> s4-0 param 3) (-> arg3 param 3)) + (set! (-> s4-0 param 4) (-> arg3 param 4)) + (set! (-> s4-0 param 5) (-> arg3 param 5)) + (send-event-function (the-as process-tree (metalkor-get-gem-tracker (the-as process-focusable arg0))) s4-0) ) - (('child-die) + ) + (('setup-flitter-gem) + (let ((gp-3 (-> self entity extra))) (cond - ((not (and (-> self next-state) (= (-> self next-state name) 'hang-shoot-n-launch))) - #f - ) - ((>= 1 (-> self countdown-to-roar)) - (set-countdown-to-roar) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! (-> self draw art-group data 21) :num! min) - (metalkor-all-spinners-on) + ((send-event (handle->process (-> self flitter-gem-tracker)) 'spawn-with-gem?) + (set! v0-2 (logclear (-> gp-3 perm status) (entity-perm-status save))) + (set! (-> gp-3 perm status) (the-as entity-perm-status v0-2)) ) (else - (set! v0-2 (+ (-> self countdown-to-roar) -1)) - (set! (-> self countdown-to-roar) (the-as int v0-2)) - v0-2 + (set! v0-2 (logior (-> gp-3 perm status) (entity-perm-status save))) + (set! (-> gp-3 perm status) (the-as entity-perm-status v0-2)) ) ) ) - (('attack) - (let ((f28-0 1.0) - (s5-2 (the-as object (-> arg3 param 1))) - (f30-0 (* 0.2 (the float (the int (* 4.99 (-> self stage-hit-points)))))) - ) - (when (!= (-> self stage-hit-points) 0.0) - (when (or (not (logtest? (-> (the-as attack-info s5-2) mask) (attack-mask id))) - (!= (-> self last-attack-id) (-> (the-as attack-info s5-2) id)) - ) - (if (logtest? (-> (the-as attack-info s5-2) mask) (attack-mask id)) - (set! (-> self last-attack-id) (-> (the-as attack-info s5-2) id)) - ) - (if (logtest? (attack-mask damage) (-> (the-as attack-info s5-2) mask)) - (set! f28-0 (-> (the-as attack-info s5-2) damage)) - ) - (let* ((s4-1 arg0) - (f0-4 (cond - ((if (type? s4-1 gun-blue-shot) - s4-1 + v0-2 + ) + (('hatch) + (let ((v1-41 (-> arg3 param 0))) + (set! (-> self flitters v1-41) (the-as handle (-> arg3 param 1))) + (send-event + (handle->process (-> self flitter-gem-tracker)) + 'change-gem + #f + (handle->process (-> self flitters v1-41)) + ) + ) + ) + (('child-die) + (cond + ((not (and (-> self next-state) (= (-> self next-state name) 'hang-shoot-n-launch))) + #f + ) + ((>= 1 (-> self countdown-to-roar)) + (set-countdown-to-roar) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 21) :num! min) + (metalkor-all-spinners-on) + ) + (else + (set! v0-2 (+ (-> self countdown-to-roar) -1)) + (set! (-> self countdown-to-roar) (the-as int v0-2)) + v0-2 + ) + ) + ) + (('attack) + (let ((f28-0 1.0) + (s5-2 (the-as object (-> arg3 param 1))) + (f30-0 (* 0.2 (the float (the int (* 4.99 (-> self stage-hit-points)))))) + ) + (when (!= (-> self stage-hit-points) 0.0) + (when (or (not (logtest? (-> (the-as attack-info s5-2) mask) (attack-mask id))) + (!= (-> self last-attack-id) (-> (the-as attack-info s5-2) id)) + ) + (if (logtest? (-> (the-as attack-info s5-2) mask) (attack-mask id)) + (set! (-> self last-attack-id) (-> (the-as attack-info s5-2) id)) + ) + (if (logtest? (attack-mask damage) (-> (the-as attack-info s5-2) mask)) + (set! f28-0 (-> (the-as attack-info s5-2) damage)) + ) + (let* ((s4-1 arg0) + (f0-4 (cond + ((if (type? s4-1 gun-blue-shot) + s4-1 + ) + (if (= (-> self stage) 3) + (* 0.0012 f28-0) + (* 0.0024 f28-0) + ) + ) + (else + (let ((s4-2 arg0)) + (cond + ((if (type? s4-2 gun-dark-shot) + s4-2 + ) + (if (= (-> self stage) 3) + (* 0.003 f28-0) + (* 0.006 f28-0) + ) ) - (if (= (-> self stage) 3) - (* 0.0012 f28-0) - (* 0.0024 f28-0) + ((= (-> self stage) 3) + (* 0.004 f28-0) ) - ) - (else - (let ((s4-2 arg0)) - (cond - ((if (type? s4-2 gun-dark-shot) - s4-2 - ) - (if (= (-> self stage) 3) - (* 0.003 f28-0) - (* 0.006 f28-0) - ) - ) - ((= (-> self stage) 3) - (* 0.004 f28-0) - ) - (else - (* 0.008 f28-0) - ) + (else + (* 0.008 f28-0) ) ) ) ) ) - ) - (if (and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info s5-2) mask)) - (logtest? (penetrate dark-bomb) (-> (the-as attack-info s5-2) penetrate-using)) ) - (set! f0-4 0.5) - ) - (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) - (set! f0-4 (* 0.6666667 f0-4)) - ) + ) + (if (and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info s5-2) mask)) + (logtest? (penetrate dark-bomb) (-> (the-as attack-info s5-2) penetrate-using)) + ) + (set! f0-4 0.5) + ) + (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) + (set! f0-4 (* 0.6666667 f0-4)) + ) ;; og:preserve-this if -> when - (when (not (and (-> self next-state) (let ((v1-109 (-> self next-state name))) - (or (= v1-109 'fall-down) - (= v1-109 'overload-recover) - (= v1-109 'tail-attack) - (= v1-109 'foot-attack) - (= v1-109 'start-second-stage) - ) - ) - ) - ) - ;; og:preserve-this damage number cheat - (#when PC_PORT - (let* ((old-hp (-> self stage-hit-points)) - (dmg-to-use (if (= (-> self stage) 3) - f0-4 - (/ f0-4 2.0))) - (dmg-taken (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) - (* dmg-to-use 1.5) dmg-to-use))) - (when (> dmg-taken 0.0) - (process-spawn damage-number-metalkor dmg-taken (-> self root trans) (-> self mask)) - ;(send-damage-to-bar *health-bar-manager* self dmg-taken old-hp) - ) + (when (not (and (-> self next-state) (let ((v1-109 (-> self next-state name))) + (or (= v1-109 'fall-down) + (= v1-109 'overload-recover) + (= v1-109 'tail-attack) + (= v1-109 'foot-attack) + (= v1-109 'start-second-stage) + ) + ) + ) + ) + ;; og:preserve-this damage number cheat + (#when PC_PORT + (let* ((old-hp (-> self stage-hit-points)) + (dmg-to-use (if (= (-> self stage) 3) + f0-4 + (/ f0-4 2.0))) + (dmg-taken (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) + (* dmg-to-use 1.5) dmg-to-use))) + (when (> dmg-taken 0.0) + (process-spawn damage-number-metalkor dmg-taken (-> self root trans) (-> self mask)) + ;(send-damage-to-bar *health-bar-manager* self dmg-taken old-hp) ) ) - (set! (-> self stage-hit-points) (fmax 0.0 (- (-> self stage-hit-points) f0-4))) - ) - ) - (metalkor-update-hud) - (cond - ((and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info s5-2) mask)) - (logtest? (penetrate dark-bomb) (-> (the-as attack-info s5-2) penetrate-using)) - (= (-> self stage-hit-points) 0.0) - ) - (set! v0-2 (+ (current-time) (seconds 1))) - (set! (-> self next-stage-timer) (the-as time-frame v0-2)) - v0-2 - ) - ((= (-> self stage-hit-points) 0.0) - (the-as object (metalkor-go-next-stage)) - ) - ((and (-> self next-state) (= (-> self next-state name) 'hang-shoot-n-launch)) - (metalkor-setup-hit-anim - (the-as attack-info s5-2) - (the-as process-drawable arg0) - (-> self draw art-group data 18) - (-> self draw art-group data 20) - (the-as float (-> self draw art-group data 19)) ) - (metalkor-all-spinners-on) - ) - ((and (and (-> self next-state) (= (-> self next-state name) 'fall-down)) - (let ((v1-139 (ja-group))) - (or (not (and v1-139 (= v1-139 (-> self draw art-group data 7)))) (>= (ja-aframe-num 0) 10.0)) - ) - ) - (the-as object (metalkor-setup-hit-anim - (the-as attack-info s5-2) - (the-as process-drawable arg0) - (-> self draw art-group data 25) - (-> self draw art-group data 27) - (the-as float (-> self draw art-group data 26)) - ) - ) + (set! (-> self stage-hit-points) (fmax 0.0 (- (-> self stage-hit-points) f0-4))) + ) + ) + (metalkor-update-hud) + (cond + ((and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info s5-2) mask)) + (logtest? (penetrate dark-bomb) (-> (the-as attack-info s5-2) penetrate-using)) + (= (-> self stage-hit-points) 0.0) + ) + (set! v0-2 (+ (current-time) (seconds 1))) + (set! (-> self next-stage-timer) (the-as time-frame v0-2)) + v0-2 + ) + ((= (-> self stage-hit-points) 0.0) + (metalkor-go-next-stage) + ) + ((and (-> self next-state) (= (-> self next-state name) 'hang-shoot-n-launch)) + (metalkor-setup-hit-anim + (the-as attack-info s5-2) + (the-as process-drawable arg0) + (-> self draw art-group data 18) + (-> self draw art-group data 20) + (the-as float (-> self draw art-group data 19)) ) - ((and (-> self next-state) (let ((v1-153 (-> self next-state name))) - (or (= v1-153 'chase-target) - (= v1-153 'standing-shot) - (= v1-153 'overload-recover) - (= v1-153 'tail-attack) - (= v1-153 'foot-attack) - (= v1-153 'get-close) - ) - ) + (metalkor-all-spinners-on) + ) + ((and (and (-> self next-state) (= (-> self next-state name) 'fall-down)) + (let ((v1-139 (ja-group))) + (or (not (and v1-139 (= v1-139 (-> self draw art-group data 7)))) (>= (ja-aframe-num 0) 10.0)) ) - (if (< (-> self stage-hit-points) f30-0) - (go-virtual fall-down) - (metalkor-ja-float (the-as art-joint-anim (-> self draw art-group data 34)) 1.0 0.25 2.0) - ) + ) + (metalkor-setup-hit-anim + (the-as attack-info s5-2) + (the-as process-drawable arg0) + (-> self draw art-group data 25) + (-> self draw art-group data 27) + (the-as float (-> self draw art-group data 26)) ) - ) + ) + ((and (-> self next-state) (let ((v1-153 (-> self next-state name))) + (or (= v1-153 'chase-target) + (= v1-153 'standing-shot) + (= v1-153 'overload-recover) + (= v1-153 'tail-attack) + (= v1-153 'foot-attack) + (= v1-153 'get-close) + ) + ) + ) + (if (< (-> self stage-hit-points) f30-0) + (go-virtual fall-down) + (metalkor-ja-float (the-as art-joint-anim (-> self draw art-group data 34)) 1.0 0.25 2.0) + ) + ) ) ) ) ) - (('touch) - (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self root) - (the-as uint 1) + ) + (('touch) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self root) + (the-as uint 1) + ) + (let* ((s4-3 arg0) + (gp-5 (if (type? s4-3 process-focusable) + s4-3 + ) + ) ) - (let* ((s4-3 arg0) - (gp-5 (if (type? s4-3 process-focusable) - s4-3 - ) - ) - ) - (when gp-5 - (let ((s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) - (s4-4 (new 'stack-no-clear 'vector)) - ) - (if (>= (metalkor-ja-float-group? (the-as art-joint-anim (-> self draw art-group data 42))) 0) - (vector+! s4-4 (-> s3-0 vector 2) (the-as vector (-> s3-0 vector))) - (vector-! s4-4 (-> s3-0 vector 2) (the-as vector (-> s3-0 vector))) - ) - (set! (-> s4-4 y) 0.0) - (vector-normalize! s4-4 32768.0) - (set! (-> s4-4 y) 24576.0) - (when (send-event - gp-5 - 'attack - (-> arg3 param 0) - (static-attack-info ((id (new-attack-id)) (vector s4-4) (shove-up (meters 6)))) - ) - (set! (-> self no-collision-timer) (current-time)) - (let ((v1-175 (-> self root root-prim))) - (set! (-> v1-175 prim-core collide-as) (collide-spec)) - (set! (-> v1-175 prim-core collide-with) (collide-spec)) - ) - 0 + (when gp-5 + (let ((s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) + (s4-4 (new 'stack-no-clear 'vector)) ) + (if (>= (metalkor-ja-float-group? (the-as art-joint-anim (-> self draw art-group data 42))) 0) + (vector+! s4-4 (-> s3-0 vector 2) (the-as vector (-> s3-0 vector))) + (vector-! s4-4 (-> s3-0 vector 2) (the-as vector (-> s3-0 vector))) + ) + (set! (-> s4-4 y) 0.0) + (vector-normalize! s4-4 32768.0) + (set! (-> s4-4 y) 24576.0) + (when (send-event + gp-5 + 'attack + (-> arg3 param 0) + (static-attack-info ((id (new-attack-id)) (vector s4-4) (shove-up (meters 6)))) + ) + (set! (-> self no-collision-timer) (current-time)) + (let ((v1-175 (-> self root root-prim))) + (set! (-> v1-175 prim-core collide-as) (collide-spec)) + (set! (-> v1-175 prim-core collide-with) (collide-spec)) + ) + 0 ) ) ) ) ) - ) + ) ) ) @@ -1422,17 +1417,16 @@ (defstate beaten (metalkor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('occlude-off) - (let ((a0-3 (handle->process (-> self rift-occlude)))) - (if a0-3 - (the-as symbol (deactivate a0-3)) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('occlude-off) + (let ((a0-3 (handle->process (-> self rift-occlude)))) + (if a0-3 + (deactivate a0-3) + ) + ) + ) + ) ) :enter (behavior ((arg0 symbol)) (ja-channel-set! 0) @@ -1446,49 +1440,45 @@ (send-event (handle->process (-> self rift-occlude)) 'movie-pos) (outro-play) ) - (none) ) :exit (behavior () (ja-channel-push! 1 (seconds 0.1)) (ja :group! (-> self draw art-group data 3) :num! min) - (none) ) :code (the-as (function symbol none :behavior metalkor) sleep-code) ) (defstate explode (metalkor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('exploding) - (let ((gp-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> gp-0 from) (process->ppointer self)) - (set! (-> gp-0 num-params) 1) - (set! (-> gp-0 message) 'stutter) - (set! (-> gp-0 param 0) (the-as uint #f)) - (let ((s5-0 send-event-function) - (v1-4 (metalkor-get-ring self)) - ) - (s5-0 - (if v1-4 - (-> v1-4 extra process) - ) - gp-0 - ) - ) - ) - ) - (('explode-done) - (the-as object (metalkor-go-next-stage)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('exploding) + (let ((gp-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-0 from) (process->ppointer self)) + (set! (-> gp-0 num-params) 1) + (set! (-> gp-0 message) 'stutter) + (set! (-> gp-0 param 0) (the-as uint #f)) + (let ((s5-0 send-event-function) + (v1-4 (metalkor-get-ring self)) + ) + (s5-0 + (if v1-4 + (-> v1-4 extra process) + ) + gp-0 + ) + ) + ) + ) + (('explode-done) + (metalkor-go-next-stage) + ) + ) ) :enter (behavior () (process-grab? *target* #f) (set-setting! 'entity-name "camera-271" 0.0 0) (send-event *camera* 'change-target self) - (none) ) :exit (behavior () (process-release? *target*) @@ -1517,7 +1507,6 @@ ) (remove-setting! 'entity-name) (send-event *camera* 'change-target #f) - (none) ) :trans (behavior () (when (not (handle->process (-> self explode))) @@ -1601,13 +1590,11 @@ ) ) (update! (-> self ring-cam-pos) 0.0) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1646,7 +1633,6 @@ (set! (-> self explode-sound) (add-process *gui-control* self (gui-channel jak) (gui-action queue) "nbexplo" -99.0 0) ) - (none) ) :exit (behavior () (process-release? *target*) @@ -1662,7 +1648,6 @@ (if (nonzero? (-> self neck)) (set! (-> self neck flex-blend) 0.0) ) - (none) ) :trans (behavior () (let ((v1-2 (ja-group))) @@ -1725,13 +1710,11 @@ ) ) (update! (-> self ring-cam-pos) 0.0) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1746,13 +1729,11 @@ (if (nonzero? (-> self neck)) (set! (-> self neck flex-blend) 0.0) ) - (none) ) :exit (behavior () (process-release? *target*) (remove-setting! 'entity-name) (send-event *camera* 'change-target #f) - (none) ) :trans (behavior () (let ((v1-2 (ja-group))) @@ -1788,13 +1769,11 @@ ) ) ) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1805,13 +1784,11 @@ (set! (-> self state-time) (current-time)) (ja-channel-push! 1 (seconds 0.1)) (ja :group! (-> self draw art-group data 30) :num! min) - (none) ) :exit (behavior () (if (nonzero? (-> self neck)) (set! (-> self neck flex-blend) 1.0) ) - (none) ) :trans (behavior () (ja :num! (seek!)) @@ -1819,13 +1796,11 @@ (go-virtual get-close) ) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1867,7 +1842,6 @@ (add-process *gui-control* self (gui-channel jak) (gui-action queue) "nbshock" -99.0 0) ) (set! (-> self stop-bomb-sound) #t) - (none) ) :exit (behavior () (if (-> self stop-bomb-sound) @@ -1882,7 +1856,6 @@ (the-as process #f) ) ) - (none) ) :trans (behavior () (if (or (>= (- (current-time) (-> self state-time)) (seconds 1)) @@ -1940,13 +1913,11 @@ ) ) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1956,19 +1927,16 @@ (set! (-> self state-time) (current-time)) (process-entity-status! self (entity-perm-status subtask-complete) #t) (process-spawn scene-player :init scene-player-init "nest-kor-boss-fight-mid" #t "nestb-boss") - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (deactivate self) ) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -2145,13 +2113,11 @@ ) ) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -2192,12 +2158,10 @@ ) ) (set! (-> self arm-frame) -1000.0) - (none) ) :exit (behavior () (metalkor-set-deadly self #f 2) (metalkor-set-deadly self #f 3) - (none) ) :trans (behavior () (local-vars (a0-10 int)) @@ -2245,13 +2209,11 @@ ) ) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -2260,7 +2222,6 @@ :event metalkor-handler :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (cond @@ -2290,13 +2251,11 @@ ) (metalkor-walk-the-walk 53248.0 #f) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -2309,11 +2268,9 @@ (set! (-> self current-nav-poly) (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (-> self current-nav-poly)) ) - (none) ) :exit (behavior () (metalkor-ja-float-stop (the-as art-joint-anim (-> self draw art-group data 32))) - (none) ) :trans (behavior () (if (>= (-> self shots-fired) (-> self stage)) @@ -2353,13 +2310,11 @@ ) ) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -2371,7 +2326,6 @@ (set! (-> self current-nav-poly) (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (-> self current-nav-poly)) ) - (none) ) :trans (behavior () (let ((v1-2 (ja-group))) @@ -2400,13 +2354,11 @@ ) (metalkor-walk-the-walk 122880.0 #f) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -2424,7 +2376,6 @@ ) ) ) - (none) ) :trans (behavior () (let ((v1-2 (ja-group))) @@ -2465,13 +2416,11 @@ ) ) ) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -2489,12 +2438,10 @@ (set! (-> self launching-wasps) #f) (set! (-> self egg-timer) 0) 0 - (none) ) :exit (behavior () (send-event (handle->process (-> self lowtorso)) 'egg-toss 0) (metalkor-ja-float-stop (the-as art-joint-anim (-> self draw art-group data 23))) - (none) ) :trans (behavior () (local-vars (sv-16 res-tag)) @@ -2645,35 +2592,31 @@ ) ) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) (defstate hidden (metalkor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('occlude-off) - (let ((a0-3 (handle->process (-> self rift-occlude)))) - (if a0-3 - (the-as symbol (deactivate a0-3)) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('occlude-off) + (let ((a0-3 (handle->process (-> self rift-occlude)))) + (if a0-3 + (deactivate a0-3) + ) + ) + ) + ) ) :trans (behavior () (if (task-node-closed? (game-task-node nest-boss-introduction)) (metalkor-go-next-stage) ) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) ) @@ -2687,7 +2630,6 @@ (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (-> self current-nav-poly)) ) (ja :group! (-> self draw art-group data 5)) - (none) ) :trans (behavior () (local-vars (v1-72 float)) @@ -2850,13 +2792,11 @@ (camera-line-rel gp-1 s5-3 (new 'static 'vector4w :x #xff :w #x80)) ) (metalkor-common) - (none) ) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) diff --git a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc index 5d61e18e039..d89122b94e1 100644 --- a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc +++ b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc @@ -1638,7 +1638,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior nest-gun-parts) ja-post) ) @@ -1695,11 +1694,11 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior nest-unbroken-rocks) ja-post) ) +;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! nest-unbroken-rocks ((obj nest-unbroken-rocks) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: diff --git a/goal_src/jak2/levels/nest/flying-spider.gc b/goal_src/jak2/levels/nest/flying-spider.gc index 203dc645334..387df7e6e2b 100644 --- a/goal_src/jak2/levels/nest/flying-spider.gc +++ b/goal_src/jak2/levels/nest/flying-spider.gc @@ -179,7 +179,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior flying-spider) nav-enemy-simple-post) ) @@ -198,13 +197,11 @@ (logclear! (-> self enemy-flags) (enemy-flag lock-focus death-start)) (set! (-> self path-du) (get-rand-float-range self 0.2 0.5)) (set-vector! (-> self root scale) 0.0 0.0 0.0 0.0) - (none) ) :trans (behavior () (if (= (-> self path-u) 1.0) (go-virtual ambush-falling) ) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -219,7 +216,6 @@ ) ) #f - (none) ) :post (behavior () (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-u) 'interp) @@ -239,7 +235,6 @@ (forward-up-nopitch->quaternion (-> self root quat) a1-3 *y-vector*) ) (nav-enemy-simple-post) - (none) ) ) @@ -276,7 +271,6 @@ ) (enemy-method-127 self 40960.0 40960.0 #t (collide-spec backgnd)) (go-hostile self) - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'collide-query))) @@ -284,7 +278,6 @@ ) (flying-spider-method-182 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (nav-enemy-falling-post) - (none) ) ) @@ -307,7 +300,6 @@ ) ) ) - (none) ) ) @@ -324,7 +316,6 @@ (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) ) 0 - (none) ) :trans (behavior () (if (>= 2 (the-as int (-> self focus aware))) @@ -364,7 +355,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -397,12 +387,10 @@ ) ) #f - (none) ) :post (behavior () (flying-spider-method-182 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (nav-enemy-face-focus-post) - (none) ) ) @@ -418,7 +406,6 @@ (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) ) @@ -430,7 +417,6 @@ (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :trans (behavior () (let ((a0-1 (get-enemy-target self))) @@ -446,7 +432,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -464,18 +449,16 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) (defstate attack-fire (flying-spider) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('event-attack-l) (let* ((s5-0 (-> self node-list data 30)) (gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) s5-0)) @@ -495,7 +478,7 @@ ) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) @@ -504,7 +487,6 @@ (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -541,11 +523,9 @@ (ja :num! (seek! max 2.0)) ) (go-virtual attack) - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -557,7 +537,6 @@ (set! (-> self state-time) (current-time)) (set! (-> self hit-points) 0) (enemy-method-103 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -588,7 +567,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior flying-spider) enemy-simple-post) ) diff --git a/goal_src/jak2/levels/nest/mammoth.gc b/goal_src/jak2/levels/nest/mammoth.gc index a5d63abce40..7d8822fa464 100644 --- a/goal_src/jak2/levels/nest/mammoth.gc +++ b/goal_src/jak2/levels/nest/mammoth.gc @@ -349,8 +349,8 @@ (defstate waiting (mammoth) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('cue-chase) (go-virtual wait-to-walk) ) @@ -367,7 +367,6 @@ ) 0 (logior! (-> self foot-flags) 15) - (none) ) :code (behavior () (move-to-ground (-> self root) 40960.0 122880.0 #t (collide-spec backgnd)) @@ -387,7 +386,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior mammoth) nav-enemy-simple-post) ) @@ -409,7 +407,6 @@ (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-5 enemy-flags)))) ) 0 - (none) ) :code (behavior () (next-path-index) @@ -424,7 +421,6 @@ (ja :num! (seek!)) ) (go-virtual walking) - (none) ) :post mammoth-walk-post ) @@ -447,7 +443,6 @@ ) 0 (logior! (-> self foot-flags) 6) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -488,15 +483,14 @@ ) ) #f - (none) ) :post mammoth-walk-post ) (defstate walking-attack (mammoth) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('event-attack) (let ((v0-0 (the-as object (current-time)))) (set! (-> self lightning-timer) (the-as time-frame v0-0)) @@ -504,7 +498,7 @@ ) ) (else - (mammoth-walk-handler proc arg1 event-type event) + (mammoth-walk-handler proc argc message block) ) ) ) @@ -523,7 +517,6 @@ ) 0 (logior! (-> self foot-flags) 6) - (none) ) :trans (behavior () (when (and (< (- (current-time) (-> self lightning-timer)) (seconds 3)) (< (-> self spawn-timer) (current-time))) @@ -532,7 +525,6 @@ ) (set! (-> self spawn-timer) (+ (current-time) (the int (* 300.0 (get-rand-float-range self 0.0 0.1))))) ) - (none) ) :code (behavior () (set-nav-destination) @@ -563,7 +555,6 @@ ) ) #f - (none) ) :post mammoth-walk-post ) @@ -629,7 +620,6 @@ (set! (-> v1-33 enemy-flags) (the-as enemy-flag (logclear (-> v1-33 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -691,11 +681,9 @@ ) ) (go-virtual walking) - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -732,7 +720,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post mammoth-walk-post ) @@ -832,16 +819,12 @@ ) ) -;; WARN: Return type mismatch object vs none. (defmethod go-stare mammoth ((obj mammoth)) (go (method-of-object obj walking)) - (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-hostile mammoth ((obj mammoth)) (go (method-of-object obj walking)) - (none) ) ;; WARN: Return type mismatch object vs none. @@ -1126,7 +1109,7 @@ ) ) ) - (the-as object (handle-copy! arg0 s5-0)) + (handle-copy! arg0 s5-0) ) ) ) diff --git a/goal_src/jak2/levels/nest/mantis.gc b/goal_src/jak2/levels/nest/mantis.gc index 82e1370ece3..6a619ac94dc 100644 --- a/goal_src/jak2/levels/nest/mantis.gc +++ b/goal_src/jak2/levels/nest/mantis.gc @@ -412,7 +412,6 @@ (if (logtest? (-> self flags) (mantis-flag tracked)) (mantis-method-187 self) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -459,7 +458,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior mantis) nav-enemy-face-focus-post) ) @@ -501,7 +499,6 @@ ) ) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -559,7 +556,6 @@ (go-virtual ambush-jumping) (go-virtual ambush-crawling) ) - (none) ) ) @@ -583,7 +579,6 @@ (set! (-> v1-28 prim-core collide-with) (-> self root backup-collide-with)) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior mantis) nav-enemy-simple-post) ) @@ -615,7 +610,6 @@ (vector-reset! (-> gp-0 transv)) (set! (-> gp-0 transv y) (* 4096.0 (get-rand-float-range self 28.0 32.0))) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -678,7 +672,6 @@ ) (label cfg-32) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior mantis) nav-enemy-falling-post) ) @@ -687,7 +680,6 @@ :virtual #t :exit (behavior () (logclear! (-> self flags) (mantis-flag attack1-enabled)) - (none) ) :trans (behavior () (rlet ((acc :class vf) @@ -766,7 +758,6 @@ ) ) ) - (none) ) ) ) @@ -782,7 +773,6 @@ (set! (-> v1-6 max-rotation-rate) 21845.334) ) 0 - (none) ) :exit (behavior () (change-to (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor 0) self) @@ -790,14 +780,12 @@ (set! (-> v1-2 max-rotation-rate) (-> self enemy-info maximum-rotation-rate)) ) 0 - (none) ) :trans (behavior () (nav-enemy-method-160 self) (if (logtest? (-> self flags) (mantis-flag tracked)) (go-virtual hostile) ) - (none) ) :code (behavior () (until #f @@ -905,7 +893,6 @@ (label cfg-38) ) #f - (none) ) :post (the-as (function none :behavior mantis) nav-enemy-travel-post) ) @@ -924,14 +911,12 @@ ) 0 (set! (-> self attack-timer) (current-time)) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (logior! (-> self focus-status) (focus-status dangerous)) @@ -974,7 +959,6 @@ ) 0 (go-hostile self) - (none) ) :post (the-as (function none :behavior mantis) nav-enemy-chase-post) ) @@ -985,14 +969,12 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self attack-timer) (current-time)) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (let ((v1-0 self)) @@ -1066,7 +1048,6 @@ ) 0 (go-hostile self) - (none) ) :post (the-as (function none :behavior mantis) nav-enemy-chase-post) ) @@ -1111,7 +1092,6 @@ ) (logior! (-> self flags) (mantis-flag attack1-enabled)) (go-hostile self) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -1133,7 +1113,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -1176,7 +1155,6 @@ (ja :num! (seek!)) ) (go-hostile self) - (none) ) :post (-> (method-of-type mantis roll-right) post) ) @@ -1203,11 +1181,9 @@ 0 (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self starting-time) (current-time)) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (rlet ((acc :class vf) @@ -1267,7 +1243,6 @@ ) ) #f - (none) ) ) :post (the-as (function none :behavior mantis) nav-enemy-face-focus-post) @@ -1644,7 +1619,6 @@ ) ) -;; WARN: Return type mismatch object vs none. (defmethod go-stare mantis ((obj mantis)) (let ((a0-2 (handle->process (-> obj focus handle)))) (if (and a0-2 @@ -1656,7 +1630,6 @@ ) ) (go (method-of-object obj hop-away)) - (none) ) (defmethod mantis-method-190 mantis ((obj mantis) (arg0 vector) (arg1 vector)) diff --git a/goal_src/jak2/levels/nest/nest-obs.gc b/goal_src/jak2/levels/nest/nest-obs.gc index 432a9a6c756..709a45d087b 100644 --- a/goal_src/jak2/levels/nest/nest-obs.gc +++ b/goal_src/jak2/levels/nest/nest-obs.gc @@ -33,10 +33,10 @@ (defstate up (nest-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((v1-1 (the-as attack-info (-> event param 1)))) + (let ((v1-1 (the-as attack-info (-> block param 1)))) (when (or (= (-> v1-1 mode) 'spin) (= (-> v1-1 mode) 'spin-air)) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) (process->ppointer self)) @@ -69,7 +69,6 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self set-camera) #f) - (none) ) :trans (behavior () (when (and (not (-> self set-camera)) (>= (- (current-time) (-> self state-time)) (seconds 0.6))) @@ -80,7 +79,6 @@ (set! (-> self set-camera) #t) ) (rider-trans) - (none) ) :code (behavior () (set! (-> self y-rot-rate) 0.0) @@ -117,7 +115,6 @@ (process-release? *target*) (logior! (-> self mask) (process-mask actor-pause)) (sleep-code) - (none) ) :post (the-as (function none :behavior nest-switch) rider-post) ) @@ -201,8 +198,8 @@ This commonly includes things such as: (defstate idle (nest-piston) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual up) ) @@ -227,7 +224,6 @@ This commonly includes things such as: ) (logior! (-> self mask) (process-mask actor-pause)) (sleep-code) - (none) ) :post (the-as (function none :behavior nest-piston) rider-post) ) diff --git a/goal_src/jak2/levels/nest/nest-scenes.gc b/goal_src/jak2/levels/nest/nest-scenes.gc index 097c5a73b68..041189f13b3 100644 --- a/goal_src/jak2/levels/nest/nest-scenes.gc +++ b/goal_src/jak2/levels/nest/nest-scenes.gc @@ -79,7 +79,6 @@ :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (dotimes (v1-0 5) @@ -102,7 +101,6 @@ (set! (-> control state mode) (the-as lightning-mode mode)) ) ) - (none) ) :trans (behavior () (cond @@ -166,7 +164,6 @@ (spawn (-> self part) (-> self root trans)) ) ) - (none) ) :code (the-as (function none :behavior canyon-lightning-thingy) sleep-code) ) diff --git a/goal_src/jak2/levels/palace/boss/squid-extras.gc b/goal_src/jak2/levels/palace/boss/squid-extras.gc index 93fad118dbd..76e2b61ac2c 100644 --- a/goal_src/jak2/levels/palace/boss/squid-extras.gc +++ b/goal_src/jak2/levels/palace/boss/squid-extras.gc @@ -9,56 +9,52 @@ (defstate idle (squid-driver) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('matrix) - (let ((v0-0 (the-as object (-> event param 0)))) - (let* ((a2-1 (-> self node-list data 3 bone transform)) - (v1-3 (-> a2-1 quad 0)) - (a0-2 (-> a2-1 quad 1)) - (a1-1 (-> a2-1 quad 2)) - (a2-2 (-> a2-1 trans quad)) - ) - (set! (-> (the-as matrix v0-0) quad 0) v1-3) - (set! (-> (the-as matrix v0-0) quad 1) a0-2) - (set! (-> (the-as matrix v0-0) quad 2) a1-1) - (set! (-> (the-as matrix v0-0) trans quad) a2-2) - ) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('matrix) + (let ((v0-0 (the-as object (-> block param 0)))) + (let* ((a2-1 (-> self node-list data 3 bone transform)) + (v1-3 (-> a2-1 quad 0)) + (a0-2 (-> a2-1 quad 1)) + (a1-1 (-> a2-1 quad 2)) + (a2-2 (-> a2-1 trans quad)) + ) + (set! (-> (the-as matrix v0-0) quad 0) v1-3) + (set! (-> (the-as matrix v0-0) quad 1) a0-2) + (set! (-> (the-as matrix v0-0) quad 2) a1-1) + (set! (-> (the-as matrix v0-0) trans quad) a2-2) + ) + v0-0 + ) + ) + ) ) :trans (behavior () (ja :num! (loop!)) (ja-post) - (none) ) :code (the-as (function none :behavior squid-driver) sleep-code) ) (defstate idle (squid-baron) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (rlet ((vf0 :class vf)) (init-vf0-vector) - (the-as object (case event-type - (('color) - (.svf (&-> (-> self draw color-mult) quad) vf0) - (set! (-> self draw color-mult w) 1.0) - (let ((v0-0 (-> self draw color-emissive))) - (set! (-> v0-0 quad) (-> (the-as rgbaf (-> event param 0)) quad)) - v0-0 - ) - ) - ) - ) + (case message + (('color) + (.svf (&-> (-> self draw color-mult) quad) vf0) + (set! (-> self draw color-mult w) 1.0) + (let ((v0-0 (-> self draw color-emissive))) + (set! (-> v0-0 quad) (-> (the-as rgbaf (-> block param 0)) quad)) + v0-0 + ) + ) + ) ) ) :trans (behavior () (clone-anim-once (ppointer->handle (-> self parent)) #f "") - (none) ) :code (the-as (function none :behavior squid-baron) sleep-code) ) @@ -68,20 +64,17 @@ :event squid-tentacle-handler :enter (behavior () (joint-setup self) - (none) ) :trans (behavior () (ja :num! (loop!)) (squid-tentacle-method-23 self) (dotimes (v1-6 11) ) - (none) ) :code (the-as (function none :behavior squid-tentacle) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -92,13 +85,11 @@ (ja :num! (loop!)) (ja-post) (go-virtual test) - (none) ) :code (the-as (function none :behavior squid-tentacle) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -127,7 +118,6 @@ (set! (-> gp-1 penetrate-using) (penetrate explode)) (explosion-spawn (the-as process-drawable *default-pool*) explosion gp-1) ) - (none) ) ) @@ -140,7 +130,6 @@ (t9-1) ) ) - (none) ) ) @@ -391,7 +380,6 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self duration) (the-as time-frame (+ (the int (* 150.0 (rand-vu))) 1050))) - (none) ) :trans (behavior () (squid-whirlwind-move) @@ -424,7 +412,6 @@ (sound-play "sqd-whirl-xplod") (deactivate self) ) - (none) ) :code (the-as (function none :behavior squid-whirlwind) sleep-code) ) diff --git a/goal_src/jak2/levels/palace/boss/squid-states.gc b/goal_src/jak2/levels/palace/boss/squid-states.gc index 5a25966770e..231dcfe3223 100644 --- a/goal_src/jak2/levels/palace/boss/squid-states.gc +++ b/goal_src/jak2/levels/palace/boss/squid-states.gc @@ -227,7 +227,6 @@ :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (ja :num! (loop!)) @@ -238,12 +237,10 @@ (debug-draw (-> self first-path)) (debug-draw (-> self second-path)) (debug-draw (-> self third-path)) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -350,7 +347,6 @@ (set! (-> self tentacle-sound-playing) #f) ) (remove-setting! 'point-of-interest) - (none) ) :code (the-as (function none :behavior squid) sleep-code) ) @@ -360,7 +356,6 @@ :event squid-handler :enter (behavior () (remove-setting! 'point-of-interest) - (none) ) :trans (behavior () (let ((v1-1 (squid-method-42 self (new 'stack-no-clear 'vector)))) @@ -370,7 +365,6 @@ (go-virtual fire-whirlwind) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) ) @@ -380,14 +374,12 @@ :event squid-handler :enter (behavior () (remove-setting! 'point-of-interest) - (none) ) :trans (behavior () (vector-reset! (-> self residual-velocity)) (if (>= (-> self max-plane) 8) (go-virtual fly-to-post) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) ) @@ -438,14 +430,12 @@ ) (set! (-> self gate-intact) #t) (set! (-> self force-onto-mesh) #f) - (none) ) :exit (behavior () (set! (-> self hit-points) 10) (set! (-> self stage) (min 2 (+ (-> self stage) 1))) (change-to (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor (-> self stage)) self) (set! (-> self current-nav-poly) #f) - (none) ) :trans (behavior () (ja :num! (loop!)) @@ -494,12 +484,10 @@ ) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -529,7 +517,6 @@ (set! (-> self tentacle-base-rotation-speed target) 1.0) (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data 36) :num! min) - (none) ) :exit (behavior () (process-release? *target*) @@ -538,7 +525,6 @@ (sound-stop (-> self spin-sound)) (set! (-> self spin-sound-playing) #f) ) - (none) ) :trans (behavior () (local-vars @@ -681,12 +667,10 @@ ) (sound-play "squid-spin" :id (-> self spin-sound) :position (-> self root trans)) (set! (-> self spin-sound-playing) #t) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -705,14 +689,12 @@ (set! (-> self driver-blend target) 0.0) (ja-channel-push! 1 (seconds 0.5)) (ja :group! (-> self draw art-group data 33) :num! min) - (none) ) :exit (behavior () (squid-talker 'done-recharging) (dotimes (gp-0 6) (send-event (handle->process (-> self tentacles gp-0)) 'set-anim 45) ) - (none) ) :trans (behavior () (if (and (zero? (-> self hit-points)) @@ -797,12 +779,10 @@ ) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -903,7 +883,6 @@ (set-traj-towards-vec self (-> self trans) (-> self trans) *squid-first-pole*) ) ) - (none) ) :trans (behavior () (if (and (zero? (-> self hit-points)) @@ -920,12 +899,10 @@ (go-virtual recharge) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -938,7 +915,6 @@ (set! (-> self traj-timer) (current-time)) (vector-reset! (-> self residual-velocity)) (set! (-> self can-play-squid-boost) #t) - (none) ) :exit (behavior () (sound-play "squid-rush-end") @@ -953,7 +929,6 @@ (set! (-> self negate-jet-pitch) #t) ) ) - (none) ) :trans (behavior () (if (and (zero? (-> self hit-points)) @@ -1058,12 +1033,10 @@ ) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -1095,14 +1068,12 @@ (dotimes (gp-0 6) (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel 0.76) ) - (none) ) :exit (behavior () (set! (-> self tentacle-base-rotation-speed target) 0.0) (dotimes (gp-0 6) (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel 0.7) ) - (none) ) :trans (behavior () (if (and (zero? (-> self hit-points)) @@ -1130,12 +1101,10 @@ (spawn-whirlwind self) (set! (-> self traj-timer) (current-time)) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -1222,13 +1191,11 @@ (dotimes (gp-0 6) (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel 0.76) ) - (none) ) :exit (behavior () (dotimes (gp-0 6) (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel 0.7) ) - (none) ) :trans (behavior () (if (and (zero? (-> self hit-points)) @@ -1396,12 +1363,10 @@ ) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -1430,13 +1395,11 @@ (dotimes (gp-1 6) (send-event (handle->process (-> self tentacles gp-1)) 'set-stretch-vel 0.76) ) - (none) ) :exit (behavior () (dotimes (gp-0 6) (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel 0.7) ) - (none) ) :trans (behavior () (if (and (zero? (-> self hit-points)) @@ -1573,12 +1536,10 @@ ) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -1592,11 +1553,9 @@ (send-event (handle->process (-> self tentacles gp-0)) 'set-gravity-slow (new 'static 'vector :y -1.0)) ) (set! (-> self reload-played) #f) - (none) ) :exit (behavior () (set! (-> self force-onto-mesh) #t) - (none) ) :trans (behavior () (squid-talker 'general) @@ -1646,12 +1605,10 @@ ) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -1675,18 +1632,15 @@ ) (sound-play "squid-reload") (go-virtual fire) - (none) ) :trans (behavior () (ja :num! (loop!)) (when (>= (- (current-time) (-> self state-time)) (seconds 3)) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -1695,12 +1649,10 @@ :enter (behavior () (ja-channel-set! 0) (ja-post) - (none) ) :exit (behavior () (ja-channel-push! 1 0) (ja :group! (-> self draw art-group data 3) :num! min) - (none) ) :trans (behavior () (cond @@ -1726,7 +1678,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) ) diff --git a/goal_src/jak2/levels/palace/cable/palcab-obs.gc b/goal_src/jak2/levels/palace/cable/palcab-obs.gc index df7606ad531..82a015a4bd3 100644 --- a/goal_src/jak2/levels/palace/cable/palcab-obs.gc +++ b/goal_src/jak2/levels/palace/cable/palcab-obs.gc @@ -57,62 +57,58 @@ (defstate idle (pal-electric-fan) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touch) - (let* ((s4-0 proc) - (gp-0 (if (type? s4-0 process-focusable) - s4-0 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (let* ((s4-0 proc) + (gp-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when (and gp-0 ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self root) + (the-as uint 1) ) - ) - ) - (when (and gp-0 ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) - (-> self root) - (the-as uint 1) - ) - ) - (let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) - (let ((v1-5 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as process-focusable gp-0) root quat)))) - (if (< 0.0 (vector-dot s4-1 v1-5)) - (vector-float*! s4-1 s4-1 -1.0) - ) - ) - (when (send-event - gp-0 - 'attack - (-> event param 0) - (static-attack-info ((id (-> self attack-id)) - (vector s4-1) - (shove-back (meters 3)) - (shove-up (meters 9)) - (control (if (focus-test? (the-as process-focusable gp-0) board) - 1.0 - 0.0 - ) - ) - ) - ) - ) - (set! (-> self no-collision-timer) (current-time)) - (let ((v1-19 (-> self root root-prim))) - (set! (-> v1-19 prim-core collide-as) (collide-spec)) - (set! (-> v1-19 prim-core collide-with) (collide-spec)) + ) + (let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (let ((v1-5 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as process-focusable gp-0) root quat)))) + (if (< 0.0 (vector-dot s4-1 v1-5)) + (vector-float*! s4-1 s4-1 -1.0) ) - 0 + ) + (when (send-event + gp-0 + 'attack + (-> block param 0) + (static-attack-info ((id (-> self attack-id)) + (vector s4-1) + (shove-back (meters 3)) + (shove-up (meters 9)) + (control (if (focus-test? (the-as process-focusable gp-0) board) + 1.0 + 0.0 + ) + ) + ) + ) + ) + (set! (-> self no-collision-timer) (current-time)) + (let ((v1-19 (-> self root root-prim))) + (set! (-> v1-19 prim-core collide-as) (collide-spec)) + (set! (-> v1-19 prim-core collide-with) (collide-spec)) ) + 0 ) ) ) ) - ) + ) ) ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (and (nonzero? (-> self no-collision-timer)) @@ -128,7 +124,6 @@ 0 ) (rider-trans) - (none) ) :code (the-as (function none :behavior pal-electric-fan) sleep-code) :post (behavior () @@ -201,7 +196,6 @@ ) (update! (-> self sound)) (rider-post) - (none) ) ) ) @@ -405,7 +399,6 @@ This commonly includes things such as: :enter (behavior () (set! (-> self sound-played? 0) #f) (set! (-> self sound-played? 1) #f) - (none) ) :trans (the-as (function none :behavior pal-cable-nut) rider-trans) :code (behavior () @@ -447,7 +440,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior pal-cable-nut) rider-post) ) @@ -676,7 +668,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (go-virtual impact) - (none) ) ) @@ -775,8 +766,8 @@ This commonly includes things such as: (defstate idle (pal-rot-gun) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual spin) ) @@ -787,8 +778,8 @@ This commonly includes things such as: (defstate spin (pal-rot-gun) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (sound-stop (-> self sound-id)) (sound-stop (-> self shot-sound-id)) @@ -800,7 +791,6 @@ This commonly includes things such as: (set! (-> self fire-timer) (current-time)) (set! (-> self gun-index) 0) 0 - (none) ) :code (the-as (function none :behavior pal-rot-gun) sleep-code) :post (behavior () @@ -851,14 +841,13 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) (defstate spin-down (pal-rot-gun) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual spin) ) @@ -866,13 +855,11 @@ This commonly includes things such as: ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (if (>= 0.0 (-> self spin-rate)) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior pal-rot-gun) sleep-code) :post (behavior () @@ -896,7 +883,6 @@ This commonly includes things such as: #t ) (ja-post) - (none) ) ) @@ -1001,7 +987,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior pal-windmill) ja-post) ) @@ -1049,8 +1034,8 @@ This commonly includes things such as: (defstate idle (pal-flip-step) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual fall) ) @@ -1063,7 +1048,6 @@ This commonly includes things such as: ) (go-virtual fall) ) - (none) ) :code (the-as (function none :behavior pal-flip-step) sleep-code) ) @@ -1081,7 +1065,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (go-virtual fallen) - (none) ) ) diff --git a/goal_src/jak2/levels/palace/pal-obs.gc b/goal_src/jak2/levels/palace/pal-obs.gc index 2a57ffc66c4..f60923a7e72 100644 --- a/goal_src/jak2/levels/palace/pal-obs.gc +++ b/goal_src/jak2/levels/palace/pal-obs.gc @@ -28,8 +28,8 @@ (defstate idle (pal-falling-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (go-virtual fall) ) @@ -37,42 +37,38 @@ ) :enter (behavior () (logior! (-> self root root-prim prim-core action) (collide-action rideable)) - (none) ) :trans (the-as (function none :behavior pal-falling-plat) rider-trans) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) (transform-post) (sleep-code) - (none) ) :post (the-as (function none :behavior pal-falling-plat) rider-post) ) (defstate fall (pal-falling-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) - (-> self root) - (the-as uint 8) - ) - (when (< 18.0 (ja-frame-num 0)) - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 num-func) num-func-identity) - (set! (-> v1-6 frame-num) 18.0) - ) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self root) + (the-as uint 8) + ) + (when (< 18.0 (ja-frame-num 0)) + (let ((v1-6 (-> self skel root-channel 0))) + (set! (-> v1-6 num-func) num-func-identity) + (set! (-> v1-6 frame-num) 18.0) + ) + ) + ) + ) + ) ) :enter (behavior () (sound-play "pal-fall-plat") - (none) ) :trans (the-as (function none :behavior pal-falling-plat) rider-trans) :code (behavior () @@ -94,7 +90,6 @@ (ja :num! (seek!)) ) (go-virtual idle) - (none) ) :post (the-as (function none :behavior pal-falling-plat) rider-post) ) @@ -272,8 +267,8 @@ This commonly includes things such as: (defstate idle (pal-grind-ring-center) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('track) #t ) @@ -294,11 +289,9 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -328,7 +321,6 @@ This commonly includes things such as: ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (the-as (function none :behavior pal-grind-ring-center) #f) :trans (the-as (function none :behavior pal-grind-ring-center) #f) @@ -338,7 +330,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior pal-grind-ring-center) #f) ) @@ -421,8 +412,8 @@ This commonly includes things such as: (defstate idle (pal-grind-ring) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('track) #t ) @@ -443,12 +434,10 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (spawn (-> self part) (-> self root trans)) (ja-post) - (none) ) ) @@ -493,7 +482,6 @@ This commonly includes things such as: (-> gp-1 ppointer) ) ) - (none) ) :trans (behavior () (+! (-> self speed-y) (* -163840.0 (seconds-per-frame))) @@ -506,7 +494,6 @@ This commonly includes things such as: (set! (-> self root trans y) 1441792.0) (set! (-> self speed-y) (* -0.3 (-> self speed-y))) ) - (none) ) :code (behavior () (until #f @@ -520,7 +507,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior pal-grind-ring) transform-post) ) @@ -645,15 +631,14 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior pal-ent-glass) #f) ) (defstate idle (pal-ent-glass) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (when (not (and (-> self next-state) (= (-> self next-state name) 'die))) (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -678,12 +663,10 @@ This commonly includes things such as: ) :exit (behavior () '() - (none) ) :code (the-as (function none :behavior pal-ent-glass) sleep-code) :post (behavior () '() - (none) ) ) @@ -796,11 +779,9 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (cond @@ -846,12 +827,10 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior palent-turret) sleep-code) :post (behavior () (transform-post) - (none) ) ) @@ -1006,15 +985,14 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior pal-breakable-window) #f) ) (defstate idle (pal-breakable-window) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (sound-play "glass-crash-big") (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -1038,12 +1016,10 @@ This commonly includes things such as: ) :exit (behavior () '() - (none) ) :code (the-as (function none :behavior pal-breakable-window) sleep-code) :post (behavior () '() - (none) ) ) diff --git a/goal_src/jak2/levels/palace/roof/palroof-obs.gc b/goal_src/jak2/levels/palace/roof/palroof-obs.gc index ceae29416cb..1b815545279 100644 --- a/goal_src/jak2/levels/palace/roof/palroof-obs.gc +++ b/goal_src/jak2/levels/palace/roof/palroof-obs.gc @@ -185,7 +185,6 @@ This commonly includes things such as: (setup-masks (-> self draw) 0 1) (pal-prong-small-collision) (transform-post) - (none) ) :code (the-as (function none :behavior pal-prong) sleep-code) ) @@ -207,19 +206,17 @@ This commonly includes things such as: :to self ) ) - (none) ) :trans (behavior () (go-virtual broken) - (none) ) :code (the-as (function none :behavior pal-prong) sleep-code) ) (defstate idle (pal-prong) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual break-it) ) @@ -227,7 +224,6 @@ This commonly includes things such as: ) :enter (behavior () (transform-post) - (none) ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'vector))) @@ -235,7 +231,6 @@ This commonly includes things such as: (+! (-> a1-0 y) 36864.0) (spawn (-> self part) a1-0) ) - (none) ) :code (the-as (function none :behavior pal-prong) sleep-code) ) diff --git a/goal_src/jak2/levels/palace/throne/palace-scenes.gc b/goal_src/jak2/levels/palace/throne/palace-scenes.gc index 8db99d5c36b..c9b81433266 100644 --- a/goal_src/jak2/levels/palace/throne/palace-scenes.gc +++ b/goal_src/jak2/levels/palace/throne/palace-scenes.gc @@ -38,7 +38,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior throne-throne) ja-post) ) diff --git a/goal_src/jak2/levels/ruins/breakable-wall.gc b/goal_src/jak2/levels/ruins/breakable-wall.gc index 56b8e9c383e..8bbeb2a00e1 100644 --- a/goal_src/jak2/levels/ruins/breakable-wall.gc +++ b/goal_src/jak2/levels/ruins/breakable-wall.gc @@ -270,11 +270,11 @@ (defstate unbroken (ruins-breakable-wall) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (when (task-node-closed? (game-task-node ruins-mech-introduction)) - (let ((s4-0 (the-as object (-> event param 1)))) + (let ((s4-0 (the-as object (-> block param 1)))) (case (-> (the-as attack-info s4-0) mode) (('mech-punch 'crush) (let ((s3-0 @@ -288,7 +288,7 @@ (if (type? proc process-drawable) proc ) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) ) (if (logtest? (-> (the-as attack-info s3-0) mask) (attack-mask intersection)) (go-virtual hit) @@ -323,13 +323,11 @@ (if (and (-> self nav-mesh) (not (nav-mesh-connect-from-ent self))) (set! (-> self nav-mesh) #f) ) - (none) ) :exit (behavior () (while (-> self child) (deactivate (-> self child 0)) ) - (none) ) :code (behavior () (if (task-node-closed? (game-task-node ruins-mech-introduction)) @@ -341,7 +339,6 @@ (suspend) ) #f - (none) ) ) @@ -378,14 +375,12 @@ ) ) (ruins-breakable-wall-method-30 self 'hit) - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :code (behavior () (let ((a2-1 (get-art-by-name (-> self draw art-group) (-> self side end-anim) art-joint-anim))) @@ -398,7 +393,6 @@ ) ) (go-virtual broken) - (none) ) :post (the-as (function none :behavior ruins-breakable-wall) ja-post) ) @@ -417,7 +411,6 @@ (suspend) (transform-post) (sleep-code) - (none) ) ) diff --git a/goal_src/jak2/levels/ruins/mechtest-obs.gc b/goal_src/jak2/levels/ruins/mechtest-obs.gc index 1ed2c810535..3c73b10c5d3 100644 --- a/goal_src/jak2/levels/ruins/mechtest-obs.gc +++ b/goal_src/jak2/levels/ruins/mechtest-obs.gc @@ -33,8 +33,8 @@ (defstate idle (mechblock) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('carry? 'carry-info) (-> self carry) ) @@ -42,15 +42,15 @@ (cond ((-> self allow-drag?) (carry! - (the-as carry-info (-> event param 0)) + (the-as carry-info (-> block param 0)) (-> self carry) - (the-as vector (-> event param 1)) - (the-as vector (-> event param 2)) + (the-as vector (-> block param 1)) + (the-as vector (-> block param 2)) ) (go-virtual drag) ) (else - (drag! (the-as carry-info (-> event param 0)) (-> self carry)) + (drag! (the-as carry-info (-> block param 0)) (-> self carry)) (go-virtual carry) ) ) @@ -67,7 +67,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -79,7 +78,6 @@ (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :trans (behavior () (when (or (not *target*) (< 40960.0 (vector-vector-distance (-> self origin) (-> *target* control trans)))) @@ -92,7 +90,6 @@ (set! (-> self drop-point quad) (-> self origin quad)) (go-virtual fall) ) - (none) ) :code (behavior () (let ((v1-1 (-> self root root-prim))) @@ -104,19 +101,18 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) (defstate carry (mechblock) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('carry? 'carry-info) (-> self carry) ) (('drop) - (set! (-> self root transv quad) (-> (the-as vector (-> event param 1)) quad)) + (set! (-> self root transv quad) (-> (the-as vector (-> block param 1)) quad)) (set! (-> self drop-point quad) (-> self root trans quad)) (go-virtual fall) ) @@ -128,20 +124,19 @@ (carry-info-method-9 (-> self carry)) (carry-info-method-13 (-> self carry)) (update-transforms (-> self root)) - (none) ) ) (defstate drag (mechblock) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) - (case event-type + (case message (('carry? 'carry-info) (-> self carry) ) @@ -149,7 +144,7 @@ (if (handle->process (-> self carry other)) (drop! (the-as carry-info (send-event (handle->process (-> self carry other)) 'carry-info)) (-> self carry)) ) - (set! (-> self root transv quad) (-> (the-as vector (-> event param 1)) quad)) + (set! (-> self root transv quad) (-> (the-as vector (-> block param 1)) quad)) (set! (-> self drop-point quad) (-> self root trans quad)) (go-virtual fall) ) @@ -158,7 +153,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> s5-0 quad) (-> s4-0 trans quad)) - (set! (-> s4-0 transv quad) (-> (the-as vector (-> event param 0)) quad)) + (set! (-> s4-0 transv quad) (-> (the-as vector (-> block param 0)) quad)) (let ((s2-0 (-> self nav)) (s1-0 (-> s4-0 root-prim prim-core)) (s3-0 (new 'stack-no-clear 'vector)) @@ -249,7 +244,7 @@ (set! (-> v1-50 prim-core collide-with) (collide-spec)) ) 0 - (vector-! (the-as vector (-> event param 1)) (-> s4-0 trans) s5-0) + (vector-! (the-as vector (-> block param 1)) (-> s4-0 trans) s5-0) ) ) ) @@ -261,34 +256,30 @@ (carry-info-method-9 (-> self carry)) (translate! (-> self carry)) (update-transforms (-> self root)) - (none) ) ) (defstate fall (mechblock) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('carry-info) - (-> self carry) - ) - (('carry? 'pickup) - (the-as basic #f) - ) - (('touched) - (when (and (!= (-> proc type) target) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'crush)))) - ) - (sound-play "block-hit") - (let ((v0-0 (the-as basic (-> proc entity)))) - (set! (-> self hit-something?) (the-as symbol v0-0)) - v0-0 - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('carry-info) + (-> self carry) + ) + (('carry? 'pickup) + (the-as basic #f) + ) + (('touched) + (when (and (!= (-> proc type) target) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'crush)))) + ) + (sound-play "block-hit") + (let ((v0-0 (the-as basic (-> proc entity)))) + (set! (-> self hit-something?) (the-as symbol v0-0)) + v0-0 ) ) - ) + ) ) ) :enter (behavior () @@ -302,7 +293,6 @@ ) (set! (-> self root status) (collide-status)) (set! (-> self root root-prim local-sphere w) (-> self carry carry-radius)) - (none) ) :trans (behavior () (when (or (and (logtest? (-> self root status) (collide-status on-surface)) (< 0.8 (-> self root surface-angle))) @@ -394,7 +384,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior mechblock) sleep-code) :post (behavior () @@ -433,7 +422,6 @@ ) (transform-post) (carry-info-method-9 (-> self carry)) - (none) ) ) diff --git a/goal_src/jak2/levels/ruins/pillar-collapse.gc b/goal_src/jak2/levels/ruins/pillar-collapse.gc index f9e340ddc23..338e84c8547 100644 --- a/goal_src/jak2/levels/ruins/pillar-collapse.gc +++ b/goal_src/jak2/levels/ruins/pillar-collapse.gc @@ -48,11 +48,11 @@ (defstate idle (ruins-pillar-collapse) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (when (task-node-closed? (game-task-node ruins-mech-introduction)) - (let* ((gp-1 (the-as attack-info (-> event param 1))) + (let* ((gp-1 (the-as attack-info (-> block param 1))) (s4-0 (-> gp-1 id)) (s5-0 (vector-x-quaternion! (new-stack-vector0) (-> self root quat))) (a0-6 (vector-z-quaternion! (new-stack-vector0) (-> self root quat))) @@ -117,13 +117,11 @@ ) ) ) - (none) ) :exit (behavior () (while (-> self child) (deactivate (-> self child 0)) ) - (none) ) :code (behavior () (if (task-node-closed? (game-task-node ruins-mech-introduction)) @@ -133,7 +131,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior ruins-pillar-collapse) transform-post) ) @@ -144,7 +141,6 @@ :trans (the-as (function none :behavior ruins-pillar-collapse) rider-trans) :code (behavior () (go-virtual idle) - (none) ) :post (the-as (function none :behavior ruins-pillar-collapse) rider-post) ) @@ -159,17 +155,16 @@ (go-virtual fall #f) ) (go-virtual idle) - (none) ) :post (the-as (function none :behavior ruins-pillar-collapse) rider-post) ) (defstate fall (ruins-pillar-collapse) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) - (let* ((s5-0 (-> event param 0)) + (let* ((s5-0 (-> block param 0)) (s4-0 proc) (gp-0 (if (type? s4-0 process-focusable) s4-0 @@ -230,7 +225,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior ruins-pillar-collapse) rider-post) ) diff --git a/goal_src/jak2/levels/ruins/rapid-gunner.gc b/goal_src/jak2/levels/ruins/rapid-gunner.gc index d8007d79f98..2581d8e8a21 100644 --- a/goal_src/jak2/levels/ruins/rapid-gunner.gc +++ b/goal_src/jak2/levels/ruins/rapid-gunner.gc @@ -394,6 +394,7 @@ ) ) +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-52 rapid-gunner ((obj rapid-gunner) (arg0 vector)) (cond ((> (-> obj hit-points) 0) @@ -597,10 +598,8 @@ ) ) -;; WARN: Return type mismatch object vs none. (defmethod go-stare rapid-gunner ((obj rapid-gunner)) (go (method-of-object obj hostile)) - (none) ) (defstate notice (rapid-gunner) @@ -647,7 +646,6 @@ (vector-reset! (-> self focus-dir)) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -669,7 +667,6 @@ ) ) (react-to-focus self) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -687,7 +684,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -723,14 +719,12 @@ (set! (-> self shoot-anim-index) 15) (set! (-> self shoot-anim-index) 14) ) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (seek! (-> self joint-blend) 0.95 (seconds-per-frame)) @@ -794,7 +788,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -835,7 +828,6 @@ ) ) #f - (none) ) :post (behavior () (rapid-gunner-method-185 self (-> self target-next-pos) 4.0) @@ -854,7 +846,6 @@ ) (rapid-gunner-common-post) (nav-enemy-simple-post) - (none) ) ) @@ -900,18 +891,15 @@ (set! (-> v1-9 attack-id) v0-0) (set! (-> self attack-id) v0-0) ) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (rlet ((acc :class vf) @@ -997,13 +985,11 @@ ) 0 (go-hostile self) - (none) ) ) :post (behavior () (rapid-gunner-common-post) (nav-enemy-travel-post) - (none) ) ) @@ -1028,14 +1014,12 @@ (set! (-> v1-9 attack-id) v0-0) (set! (-> self attack-id) v0-0) ) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (seek! (-> self joint-blend) 0.0 (seconds-per-frame)) @@ -1047,7 +1031,6 @@ ) (go-hostile self) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1062,7 +1045,6 @@ ) ) #f - (none) ) :post (behavior () (rapid-gunner-method-185 self (-> self target-next-pos) 4.0) @@ -1081,7 +1063,6 @@ ) (rapid-gunner-common-post) (nav-enemy-simple-post) - (none) ) ) @@ -1092,13 +1073,11 @@ (set! (-> self state-time) (current-time)) (set! (-> self shots-fired) (the-as uint 0)) 0 - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (go-hostile self) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1113,12 +1092,10 @@ ) ) #f - (none) ) :post (behavior () (rapid-gunner-common-post) (nav-enemy-face-focus-post) - (none) ) ) @@ -1137,7 +1114,6 @@ (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1154,12 +1130,10 @@ (go-virtual hop) ) (go-hostile self) - (none) ) :post (behavior () (rapid-gunner-common-post) (nav-enemy-face-focus-post) - (none) ) ) @@ -1188,7 +1162,6 @@ (set! (-> v1-18 nav callback-info) *nav-enemy-null-callback-info*) ) 0 - (none) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) @@ -1229,7 +1202,6 @@ (go-virtual active) ) ) - (none) ) :code (behavior () (when (not (enemy-method-96 self 2730.6667 #t)) @@ -1273,13 +1245,11 @@ ) ) #f - (none) ) :post (behavior () (rapid-gunner-method-185 self (-> self target-next-pos) 3.6) (rapid-gunner-common-post) (nav-enemy-face-focus-post) - (none) ) ) @@ -1308,7 +1278,6 @@ (set! (-> v1-13 prim-core action) (collide-action deadly)) (set! (-> v1-13 local-sphere w) 7372.8) ) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) @@ -1319,7 +1288,6 @@ (set! (-> v1-9 prim-core action) (collide-action)) (set! (-> v1-9 local-sphere w) 4096.0) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.135)) @@ -1332,7 +1300,6 @@ (ja :num! (seek!)) ) (go-hostile self) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -1350,7 +1317,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -1367,7 +1333,6 @@ (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) ) 0 - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -1382,7 +1347,6 @@ (ja :num! (loop!)) ) #f - (none) ) :post (the-as (function none :behavior rapid-gunner) nav-enemy-simple-post) ) diff --git a/goal_src/jak2/levels/ruins/ruins-obs.gc b/goal_src/jak2/levels/ruins/ruins-obs.gc index 2056cde12dd..8d816aa6f0e 100644 --- a/goal_src/jak2/levels/ruins/ruins-obs.gc +++ b/goal_src/jak2/levels/ruins/ruins-obs.gc @@ -133,13 +133,11 @@ ) ) #f - (none) ) :post (behavior () (set! (-> self info) *ruins-sinking-platform-constants*) (set! (-> self rbody state info) (-> self info info)) (rigid-body-object-method-37 self) - (none) ) ) @@ -171,7 +169,6 @@ (go-virtual collapse) ) ) - (none) ) :code (the-as (function none :behavior beam) sleep-code) ) @@ -191,7 +188,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior beam) ja-post) ) @@ -296,7 +292,6 @@ and translate the platform via the `smush` (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -449,8 +444,8 @@ and translate the platform via the `smush` (defstate fall (ruins-drop-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('collide-shape) (let ((v1-2 (-> self root root-prim))) (set! (-> v1-2 prim-core collide-as) (collide-spec)) @@ -464,7 +459,7 @@ and translate the platform via the `smush` 0 ) (else - ((-> (method-of-type drop-plat fall) event) proc arg1 event-type event) + ((-> (method-of-type drop-plat fall) event) proc argc message block) ) ) ) @@ -506,7 +501,6 @@ and translate the platform via the `smush` ) (suspend) (cleanup-for-death self) - (none) ) :post (behavior () (when (and (nonzero? (-> self root root-prim prim-core collide-as)) @@ -523,7 +517,6 @@ and translate the platform via the `smush` ((the-as (function none) t9-0)) ) ) - (none) ) ) diff --git a/goal_src/jak2/levels/ruins/ruins-scenes.gc b/goal_src/jak2/levels/ruins/ruins-scenes.gc index 926cff18a86..906ff0377e4 100644 --- a/goal_src/jak2/levels/ruins/ruins-scenes.gc +++ b/goal_src/jak2/levels/ruins/ruins-scenes.gc @@ -1339,7 +1339,6 @@ The scale will be linearly-interpolated based on the distance from the camera" (deactivate self) ) (ja-post) - (none) ) ) @@ -1388,23 +1387,20 @@ Touching it flips the `play?` field which will trigger the cutscene" (defstate idle (ruins-precipice) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('trigger) - (when (not (-> self play?)) - (set! (-> self play?) #t) - (process-spawn scene-player :init scene-player-init "ruins-tower-victory" #t #f) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (when (not (-> self play?)) + (set! (-> self play?) #t) + (process-spawn scene-player :init scene-player-init "ruins-tower-victory" #t #f) ) - (('touch 'attack) - (when (and (not (-> self play?)) *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (set! (-> self play?) #t) - (process-spawn scene-player :init scene-player-init "ruins-tower-victory" #t #f) - ) + ) + (('touch 'attack) + (when (and (not (-> self play?)) *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) + (set! (-> self play?) #t) + (process-spawn scene-player :init scene-player-init "ruins-tower-victory" #t #f) ) - ) + ) ) ) :code (behavior () @@ -1435,7 +1431,6 @@ Touching it flips the `play?` field which will trigger the cutscene" (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/sewer/escort/grim.gc b/goal_src/jak2/levels/sewer/escort/grim.gc index 63a54728ae6..bcb7cc9a544 100644 --- a/goal_src/jak2/levels/sewer/escort/grim.gc +++ b/goal_src/jak2/levels/sewer/escort/grim.gc @@ -162,6 +162,5 @@ ) ) (play-death-sound self "hal159") - (none) ) ) diff --git a/goal_src/jak2/levels/sewer/escort/jinx-bomb.gc b/goal_src/jak2/levels/sewer/escort/jinx-bomb.gc index 638e6098c8d..0156f1f79d5 100644 --- a/goal_src/jak2/levels/sewer/escort/jinx-bomb.gc +++ b/goal_src/jak2/levels/sewer/escort/jinx-bomb.gc @@ -33,8 +33,8 @@ (defstate idle (jinx-bomb) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual explode) ) @@ -45,7 +45,6 @@ ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (and (nonzero? (-> self fuse-delay)) @@ -53,7 +52,6 @@ ) (go-virtual explode) ) - (none) ) :code (behavior () (let ((v1-1 (-> self root root-prim))) @@ -61,7 +59,6 @@ (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) ) (sleep-code) - (none) ) :post (the-as (function none :behavior jinx-bomb) ja-post) ) @@ -97,7 +94,6 @@ (suspend) ) (deactivate self) - (none) ) ) diff --git a/goal_src/jak2/levels/sewer/escort/jinx-states.gc b/goal_src/jak2/levels/sewer/escort/jinx-states.gc index 7a5a10e3a7d..0465f18fe24 100644 --- a/goal_src/jak2/levels/sewer/escort/jinx-states.gc +++ b/goal_src/jak2/levels/sewer/escort/jinx-states.gc @@ -79,7 +79,6 @@ (look-at-target! self (enemy-flag lock-focus)) ) #f - (none) ) ) @@ -193,7 +192,6 @@ ) ) (ruffian-method-240 self) - (none) ) :post (the-as (function none :behavior jinx) nav-enemy-simple-post) ) @@ -270,7 +268,6 @@ ) ) #f - (none) ) ) @@ -381,7 +378,6 @@ ) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior jinx) nav-enemy-simple-post) ) @@ -419,7 +415,6 @@ ) ) #f - (none) ) ) @@ -457,7 +452,6 @@ (reset-attacker! self) ) (react-to-focus self) - (none) ) ) @@ -541,7 +535,6 @@ (reset-attacker! self) ) (react-to-focus self) - (none) ) ) @@ -562,7 +555,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -595,7 +587,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -629,7 +620,6 @@ ) ) #f - (none) ) ) @@ -639,7 +629,6 @@ (if (logtest? (bot-flags bf21) (-> self bot-flags)) (logior! (-> self bot-flags) (bot-flags bf22)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -682,7 +671,6 @@ (ja :num! (seek!)) ) (react-to-focus self) - (none) ) ) @@ -695,6 +683,5 @@ ) ) (play-death-sound self "hal116") - (none) ) ) diff --git a/goal_src/jak2/levels/sewer/escort/mog.gc b/goal_src/jak2/levels/sewer/escort/mog.gc index d99b1a960d3..28ff4192a54 100644 --- a/goal_src/jak2/levels/sewer/escort/mog.gc +++ b/goal_src/jak2/levels/sewer/escort/mog.gc @@ -355,6 +355,5 @@ ) ) (play-death-sound self "hal143") - (none) ) ) diff --git a/goal_src/jak2/levels/sewer/gator.gc b/goal_src/jak2/levels/sewer/gator.gc index 5b5dd1fe79d..60bd328de69 100644 --- a/goal_src/jak2/levels/sewer/gator.gc +++ b/goal_src/jak2/levels/sewer/gator.gc @@ -295,10 +295,8 @@ 0 ) -;; WARN: Return type mismatch object vs none. (defmethod go-hostile gator ((obj gator)) (go (method-of-object obj hostile)) - (none) ) (defmethod get-enemy-target gator ((obj gator)) @@ -353,7 +351,6 @@ ) ) ) - (none) ) :code (behavior () (let ((circle-for (get-rand-float-range self 0.9 1.1))) @@ -364,7 +361,6 @@ ) ) #f - (none) ) ) @@ -397,7 +393,6 @@ (set! (-> game-info attack-id) id) (set! (-> self attack-id) id) ) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -405,7 +400,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (let ((focus (handle->process (-> self focus handle)))) @@ -454,7 +448,6 @@ 0 ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.07)) @@ -479,7 +472,6 @@ (ja :num! (seek!)) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior gator) nav-enemy-travel-post) ) @@ -495,7 +487,6 @@ ) ) #f - (none) ) ) @@ -503,7 +494,6 @@ :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (let ((func (-> (method-of-type nav-enemy stare) trans))) @@ -514,7 +504,6 @@ (if (>= (- (current-time) (-> self state-time)) (seconds 0.017)) (go-virtual pacing) ) - (none) ) :code (behavior () (let ((circle-for? (get-rand-float-range self 0.9 1.1))) @@ -525,7 +514,6 @@ ) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/sewer/hosehead-fake.gc b/goal_src/jak2/levels/sewer/hosehead-fake.gc index 26e971c245e..3b0628c3e2c 100644 --- a/goal_src/jak2/levels/sewer/hosehead-fake.gc +++ b/goal_src/jak2/levels/sewer/hosehead-fake.gc @@ -264,12 +264,10 @@ ) ) #f - (none) ) :post (behavior () (ja-post) 0 - (none) ) ) @@ -283,7 +281,6 @@ (go-virtual idle) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -306,7 +303,6 @@ ) ) #f - (none) ) :post (-> (method-of-type hosehead-fake idle) post) ) diff --git a/goal_src/jak2/levels/sewer/hosehead.gc b/goal_src/jak2/levels/sewer/hosehead.gc index 04d1ae8ba35..867f33a83e4 100644 --- a/goal_src/jak2/levels/sewer/hosehead.gc +++ b/goal_src/jak2/levels/sewer/hosehead.gc @@ -958,7 +958,6 @@ (go-virtual active) ) ) - (none) ) :code (-> (method-of-type nav-enemy idle) code) :post (-> (method-of-type nav-enemy idle) post) @@ -981,7 +980,6 @@ (set! (-> self allow-head) #t) (set! (-> self lazer-length) 0.0) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (sound-stop (-> self lazer-sound)) @@ -993,7 +991,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (rlet ((acc :class vf) @@ -1055,7 +1052,6 @@ (if (not (-> self fire-beam?)) (set! (-> self lazer-length) 0.0) ) - (none) ) ) :code (behavior () @@ -1085,14 +1081,12 @@ (ja :num! (seek! max f30-0)) ) ) - (none) ) :post (behavior () (enemy-simple-post) (if (-> self fire-beam?) (hosehead-method-197 self) ) - (none) ) ) @@ -1259,7 +1253,6 @@ (t9-0) ) ) - (none) ) ) @@ -1326,11 +1319,9 @@ (logior! (-> self enemy-flags) (enemy-flag trackable-backup enable-on-hostile)) ) (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (behavior () (logclear! (-> self focus-status) (focus-status dangerous)) - (none) ) :trans (behavior () (when (>= 61440.0 (- (-> self root trans y) (-> self jump-point y))) @@ -1339,7 +1330,6 @@ (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.17)) @@ -1355,14 +1345,12 @@ (suspend) ) #f - (none) ) :post (behavior () (nav-enemy-falling-post) (if (logtest? (-> self root status) (collide-status on-surface)) (go-virtual ambush-land) ) - (none) ) ) @@ -1380,7 +1368,6 @@ (ja :num! (seek!)) ) (go-hostile self) - (none) ) :post (the-as (function none :behavior hosehead) nav-enemy-falling-post) ) @@ -1403,11 +1390,9 @@ ) 0 (stop-looking-at-target! self) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.05)) @@ -1423,7 +1408,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior hosehead) nav-enemy-simple-post) ) @@ -1618,7 +1602,6 @@ ) ) ) - (none) ) ) :code (behavior () @@ -1643,11 +1626,9 @@ (suspend) ) #f - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -1662,7 +1643,6 @@ (t9-1) ) ) - (none) ) ) @@ -1677,7 +1657,6 @@ (t9-0) ) ) - (none) ) ) @@ -1692,7 +1671,6 @@ (t9-0) ) ) - (none) ) ) @@ -1760,7 +1738,6 @@ ) (set! (-> self lazer-dist) 0.0) (set! (-> self lazer-length) 0.0) - (none) ) ) :exit (behavior () @@ -1773,7 +1750,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (let ((f30-0 (get-rand-float-range self 0.9 1.1))) @@ -1814,14 +1790,12 @@ ) ) (go-hostile self) - (none) ) :post (behavior () (enemy-simple-post) (if (-> self fire-beam?) (hosehead-method-197 self) ) - (none) ) ) @@ -1836,14 +1810,12 @@ (set! (-> v1-2 attack-id) v0-0) (set! (-> self attack-id) v0-0) ) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1898,7 +1870,6 @@ ) ) (go-hostile self) - (none) ) :post (the-as (function none :behavior hosehead) enemy-simple-post) ) @@ -1915,7 +1886,6 @@ (set! (-> self last-time-dist-changed) (current-time)) (set! (-> self next-lazer-time) 0) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) @@ -1924,7 +1894,6 @@ ) ) (set! (-> self come-from-notice) #f) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -1952,7 +1921,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1968,7 +1936,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior hosehead) nav-enemy-chase-post) ) @@ -2007,7 +1974,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -2030,7 +1996,6 @@ ) ) #f - (none) ) ) @@ -2383,19 +2348,15 @@ (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-ambush hosehead ((obj hosehead)) (go (method-of-object obj ambush)) - (none) ) -;; WARN: Return type mismatch object vs none. (defmethod go-hostile hosehead ((obj hosehead)) (if (-> obj sentry?) (go (method-of-object obj hostile-sentry)) (go (method-of-object obj hostile)) ) - (none) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/sewer/sew-gunturret.gc b/goal_src/jak2/levels/sewer/sew-gunturret.gc index 1c230291cfb..c8c0afa8bd7 100644 --- a/goal_src/jak2/levels/sewer/sew-gunturret.gc +++ b/goal_src/jak2/levels/sewer/sew-gunturret.gc @@ -702,7 +702,6 @@ ) (ja :group! (-> self draw art-group data (-> self params idle-anim))) (set! (-> self flash-state) #f) - (none) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) @@ -714,7 +713,6 @@ ) ) (set! (-> self root penetrated-by) (get-penetrate-info self)) - (none) ) :code (behavior () (set-aim-at-default! self) @@ -773,7 +771,6 @@ ) ) #f - (none) ) ) @@ -788,7 +785,6 @@ (if (!= (-> self activate-distance) 0.0) (aim-turret! self #f) ) - (none) ) ) @@ -839,7 +835,6 @@ 0 (set! (-> self hit-points) 0) (play-communicator-speech! (-> *talker-speech* 53)) - (none) ) :code (behavior () (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -876,11 +871,9 @@ (while (-> self child) (suspend) ) - (none) ) :post (behavior () (track-target! self) - (none) ) ) diff --git a/goal_src/jak2/levels/sewer/sewer-obs.gc b/goal_src/jak2/levels/sewer/sewer-obs.gc index c00dae33256..d48bc284035 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs.gc @@ -77,8 +77,8 @@ (defstate idle (sew-single-blade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (let* ((_proc proc) (hit-proc (if (type? _proc process-focusable) @@ -96,7 +96,7 @@ (send-event hit-proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((id (-> self attack-id)) (vector v1-5) (shove-back (meters 5)) (shove-up (meters 3)))) ) ) @@ -117,12 +117,10 @@ ) ) #f - (none) ) :post (behavior () (update-sound! self) (transform-post) - (none) ) ) @@ -230,8 +228,8 @@ This commonly includes things such as: (defstate idle (sew-tri-blade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (let* ((_proc proc) (hit-proc (if (type? _proc process-focusable) @@ -243,7 +241,7 @@ This commonly includes things such as: (send-event hit-proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((id (-> self attack-id)) (shove-back (meters 5)) (shove-up (meters 2)))) ) ) @@ -306,12 +304,10 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (update-sound! self) (transform-post) - (none) ) ) @@ -417,8 +413,8 @@ This commonly includes things such as: (defstate idle (sew-arm-blade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (let* ((s5-0 proc) (a0-2 (if (type? s5-0 process-focusable) @@ -430,7 +426,7 @@ This commonly includes things such as: (send-event a0-2 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((id (-> self attack-id)) (shove-back (meters 5)) (shove-up (meters 2)))) ) ) @@ -450,12 +446,10 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (update-sound! self) (transform-post) - (none) ) ) @@ -534,8 +528,8 @@ This commonly includes things such as: (defstate idle (sew-multi-blade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (let* ((_proc proc) (hit-proc (if (type? _proc process-focusable) @@ -553,7 +547,7 @@ This commonly includes things such as: (send-event hit-proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((id (-> self attack-id)) (vector v1-5) (shove-back (meters 7)) (shove-up (meters 4)))) ) ) @@ -574,12 +568,10 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (update-sound! self) (transform-post) - (none) ) ) @@ -660,41 +652,38 @@ This commonly includes things such as: (defstate idle (sew-twist-blade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touch 'attack) - (let* ((_proc proc) - (hit-proc (if (type? _proc process-focusable) - (the-as process-focusable _proc) - ) - ) - ) - (when hit-proc - (let ((hit-direction (vector-! (new 'stack-no-clear 'vector) (-> hit-proc root trans) (-> self root-overide trans))) - (v1-5 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-overide quat))) - ) - (if (< (vector-dot v1-5 hit-direction) 0.0) - (vector-float*! v1-5 v1-5 -1.0) - ) - (send-event - hit-proc - 'attack-or-shove - (-> event param 0) - (static-attack-info ((id (-> self attack-id)) (vector v1-5) (shove-back (meters 4)) (shove-up (meters 2)))) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (let* ((_proc proc) + (hit-proc (if (type? _proc process-focusable) + (the-as process-focusable _proc) + ) + ) + ) + (when hit-proc + (let ((hit-direction (vector-! (new 'stack-no-clear 'vector) (-> hit-proc root trans) (-> self root-overide trans))) + (v1-5 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-overide quat))) ) + (if (< (vector-dot v1-5 hit-direction) 0.0) + (vector-float*! v1-5 v1-5 -1.0) + ) + (send-event + hit-proc + 'attack-or-shove + (-> block param 0) + (static-attack-info ((id (-> self attack-id)) (vector v1-5) (shove-back (meters 4)) (shove-up (meters 2)))) ) - (set! (-> self no-collision-timer) (the-as uint (current-time))) - (let ((root-prim (-> self root-overide root-prim))) - (set! (-> root-prim prim-core collide-as) (collide-spec)) - (set! (-> root-prim prim-core collide-with) (collide-spec)) - ) - 0 ) + (set! (-> self no-collision-timer) (the-as uint (current-time))) + (let ((root-prim (-> self root-overide root-prim))) + (set! (-> root-prim prim-core collide-as) (collide-spec)) + (set! (-> root-prim prim-core collide-with) (collide-spec)) + ) + 0 ) ) - ) + ) ) ) :trans (behavior () @@ -716,7 +705,6 @@ This commonly includes things such as: (set! (-> overlap-params tlist) *touching-list*) (find-overlapping-shapes (-> self root-overide) overlap-params) ) - (none) ) :code (behavior () (until #f @@ -730,12 +718,10 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (update-sound! self) (transform-post) - (none) ) ) @@ -838,14 +824,14 @@ This commonly includes things such as: (defstate idle (sew-light-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (broadcast-to-actors self 'cue-chase) (go-virtual pressed) ) (('touch 'attack) - (let* ((gp-0 (-> event param 0)) + (let* ((gp-0 (-> block param 0)) (_proc proc) (target-proc (if (type? _proc target) _proc @@ -862,26 +848,23 @@ This commonly includes things such as: ) :enter (behavior () (set! (-> self light-state) #f) - (none) ) :code (behavior () (ja-channel-set! 1) (ja :group! (-> self draw art-group data 2) :num! min) (transform-post) (sleep-code) - (none) ) :post (behavior () (launch-particles (-> *part-id-table* 1442) (-> self root trans)) (ja-post) - (none) ) ) (defstate pressed (sew-light-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go-virtual idle) ) @@ -890,7 +873,6 @@ This commonly includes things such as: :enter (behavior () (set! (-> self light-state) #t) (sound-play "sew-light-switc") - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 2) @@ -903,7 +885,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (sleep-code) - (none) ) ) @@ -1004,6 +985,7 @@ This commonly includes things such as: (none) ) +;; ERROR: failed type prop at 53: Could not figure out load: (set! v1 (l.w s4)) (defmethod sew-light-control-method-16 sew-light-control ((a0-0 sew-light-control) (a1-0 object) (a2-0 vector) (a3-0 float)) ;; og:preserve-this (format 0 "SEWER - FIX ME!~%") @@ -1012,28 +994,26 @@ This commonly includes things such as: (defstate idle (sew-light-control) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (actor entity)) - (the-as object (case event-type - (('use-switch) - (set! actor (entity-by-name (the-as string (-> event param 0)))) - (set! (-> self switch-ent) (the-as entity-actor actor)) - actor - ) - (('use-turret) - (set! actor (entity-by-name (the-as string (-> event param 0)))) - (set! (-> self turret-ent) (the-as entity-actor actor)) - actor - ) - ) - ) + (case message + (('use-switch) + (set! actor (entity-by-name (the-as string (-> block param 0)))) + (set! (-> self switch-ent) (the-as entity-actor actor)) + actor + ) + (('use-turret) + (set! actor (entity-by-name (the-as string (-> block param 0)))) + (set! (-> self turret-ent) (the-as entity-actor actor)) + actor + ) + ) ) :code (behavior () (until #f (suspend) ) #f - (none) ) :post (behavior () (let* ((target *target*) @@ -1076,7 +1056,6 @@ This commonly includes things such as: ) ) ) - (none) ) ) diff --git a/goal_src/jak2/levels/sewer/sewer-obs2.gc b/goal_src/jak2/levels/sewer/sewer-obs2.gc index c75ad3c5abf..f26825c84d4 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs2.gc @@ -104,7 +104,6 @@ (configure-collision self #t) (set-setting! 'jump #f 0.0 0) ) - (none) ) :post (behavior () (let ((func (-> (method-of-type elevator running) post))) @@ -113,7 +112,6 @@ ) ) (sound-play "sew-elevator-lp" :id (-> self sound-id) :position (-> self root trans)) - (none) ) ) @@ -133,7 +131,6 @@ (configure-collision self #f) (remove-setting! 'jump) ) - (none) ) ) @@ -244,10 +241,10 @@ For example for an elevator pre-compute the distance between the first and last (defstate idle (sew-valve) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (case (-> (the-as attack-info (-> event param 1)) mode) + (case (-> (the-as attack-info (-> block param 1)) mode) (('spin 'punch 'flop 'uppercut) (if (!= (-> self water-height) (get-base-height *ocean-map-sewer*)) (go-virtual turn) @@ -281,18 +278,15 @@ For example for an elevator pre-compute the distance between the first and last (script-eval (the-as pair data)) ) ) - (none) ) :exit (behavior () (set! (-> self joint enable) #f) (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (if (= (-> self water-height) (get-base-height *ocean-map-sewer*)) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior sew-valve) sleep-code) :post (behavior () @@ -316,7 +310,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) (ja-post) - (none) ) ) @@ -568,7 +561,6 @@ This commonly includes things such as: (setup-masks (-> self draw) 4 2) (setup-masks (-> self draw) 2 4) ) - (none) ) :code (the-as (function none :behavior sew-mar-statue) sleep-code) ) @@ -583,7 +575,6 @@ This commonly includes things such as: ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior sew-mar-statue) sleep-code) ) @@ -691,7 +682,6 @@ and translate the platform via the `smush` (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -805,8 +795,8 @@ This commonly includes things such as: (defstate idle (sew-mine) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (let* ((_proc proc) (focus-proc (if (type? _proc process-focusable) @@ -825,7 +815,7 @@ This commonly includes things such as: (send-event focus-proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((id (new-attack-id)) (vector a0-4) (shove-back (meters 5)) @@ -854,7 +844,6 @@ This commonly includes things such as: ) (set! (-> self last-time) (the-as time-frame gp-0)) ) - (none) ) ) @@ -905,7 +894,6 @@ This commonly includes things such as: (suspend) ) ) - (none) ) ) @@ -1006,7 +994,6 @@ This commonly includes things such as: (set! (-> self root trans y) (+ (-> self center y) (* 819.2 f28-0))) ) (transform-post) - (none) ) ) @@ -1132,8 +1119,8 @@ This commonly includes things such as: (defstate idle (sew-wall) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (logclear! (-> self mask) (process-mask actor-pause)) (if (-> self first-wall?) @@ -1155,7 +1142,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -1164,11 +1150,9 @@ This commonly includes things such as: :enter (behavior ((arg0 symbol)) (set! (-> self deadly-radius) -1.0) (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (behavior () (ja-abort-spooled-anim (-> self anim) (the-as art-joint-anim #f) -1) - (none) ) :trans (behavior () (let ((f0-0 (-> self deadly-radius))) @@ -1177,7 +1161,6 @@ This commonly includes things such as: (attack-target! self) ) ) - (none) ) :code (behavior ((arg0 symbol)) (if (not (-> self first-wall?)) @@ -1236,7 +1219,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior sew-wall) ja-post) ) @@ -1385,7 +1367,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior sew-grill) ja-post) ) @@ -1552,7 +1533,6 @@ This commonly includes things such as: :enter (behavior () (set! (-> self state-time) (current-time)) (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :trans (behavior () (let* ((target *target*) @@ -1581,7 +1561,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (until #f @@ -1595,7 +1574,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior sew-scare-grunt) ja-post) ) @@ -1635,7 +1613,6 @@ This commonly includes things such as: (set! (-> self spooled-sound-id) (lookup-gui-connection-id *gui-control* (-> self anim name) (gui-channel art-load) (gui-action none)) ) - (none) ) :exit (behavior () (let* ((actor (-> self grill-actor)) @@ -1651,7 +1628,6 @@ This commonly includes things such as: ;; og:preserve-this fix bug where the spool anim never gets aborted (#when PC_PORT (ja-abort-spooled-anim (-> self anim) (the-as art-joint-anim #f) -1)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1672,7 +1648,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (behavior () (let* ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) @@ -1708,7 +1683,6 @@ This commonly includes things such as: ) ) (transform-post) - (none) ) ) diff --git a/goal_src/jak2/levels/stadium/skate/skatea-obs.gc b/goal_src/jak2/levels/stadium/skate/skatea-obs.gc index f37dea13878..55a65c0d4f0 100644 --- a/goal_src/jak2/levels/stadium/skate/skatea-obs.gc +++ b/goal_src/jak2/levels/stadium/skate/skatea-obs.gc @@ -203,11 +203,9 @@ ) ) ) - (none) ) :exit (behavior () (set-continue! *game-info* "skatea-training" #f) - (none) ) :trans (behavior () (when (-> self board-picked-up) @@ -231,7 +229,6 @@ (send-event (handle->process (-> self arrow)) 'leave) (go-virtual jump) ) - (none) ) :code (the-as (function none :behavior hoverboard-training-manager) sleep-code) ) @@ -260,17 +257,14 @@ ) ) ) - (none) ) :exit (behavior () (set-continue! *game-info* "skatea-training" #f) - (none) ) :trans (behavior () (if (-> self board-picked-up) (go-virtual idle-training) ) - (none) ) :code (the-as (function none :behavior hoverboard-training-manager) sleep-code) ) @@ -282,7 +276,6 @@ (if (task-node-open? (game-task-node stadium-board1-board)) (go-virtual wait-for-pickup) ) - (none) ) :code (the-as (function none :behavior hoverboard-training-manager) sleep-code) ) @@ -294,7 +287,6 @@ (if (task-node-open? (game-task-node stadium-board1-training-judge)) (go-virtual jump) ) - (none) ) :code (the-as (function none :behavior hoverboard-training-manager) sleep-code) ) @@ -338,7 +330,6 @@ (label cfg-51) (send-event *target* 'get-notify #f) (go-virtual duck-jump) - (none) ) ) @@ -376,7 +367,6 @@ (label cfg-36) (send-event *target* 'get-notify #f) (go-virtual boost-jump) - (none) ) ) @@ -385,7 +375,6 @@ :event hoverboard-training-manager-event-handler :exit (behavior () (send-event (handle->process (-> self arrow)) 'leave) - (none) ) :code (behavior () (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) @@ -452,7 +441,6 @@ (label cfg-42) (send-event *target* 'get-notify #f) (go-virtual grind) - (none) ) ) @@ -461,7 +449,6 @@ :event hoverboard-training-manager-event-handler :exit (behavior () (send-event (handle->process (-> self arrow)) 'leave) - (none) ) :code (behavior () (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) @@ -521,7 +508,6 @@ (label cfg-35) (send-event *target* 'get-notify #f) (go-virtual spin) - (none) ) ) @@ -562,7 +548,6 @@ (label cfg-36) (send-event *target* 'get-notify #f) (go-virtual flip) - (none) ) ) @@ -600,7 +585,6 @@ (label cfg-36) (send-event *target* 'get-notify #f) (go-virtual trick) - (none) ) ) @@ -646,7 +630,6 @@ (label cfg-47) (send-event *target* 'get-notify #f) (go-virtual game) - (none) ) ) @@ -675,7 +658,6 @@ ) (task-node-close! (game-task-node stadium-board1-training)) (go-virtual idle) - (none) ) ) @@ -906,11 +888,9 @@ (if (task-node-closed? (game-task-node stadium-board1-training-judge)) (set! (-> self training?) #f) ) - (none) ) :exit (behavior () (send-event *target* 'get-notify #f) - (none) ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -972,7 +952,6 @@ (set! (-> self hint-time) (current-time)) ) ) - (none) ) :code (behavior () (suspend) @@ -1157,7 +1136,6 @@ ) ) #f - (none) ) ) @@ -1177,11 +1155,9 @@ (set! (-> self task-gold) (the-as uint 71)) (set! (-> self task-silver) (the-as uint 70)) (set! (-> self task-bronze) (the-as uint 69)) - (none) ) :exit (behavior () (send-event *target* 'get-notify #f) - (none) ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -1233,7 +1209,6 @@ ) ) (hoverboard-training-manager-method-29 self) - (none) ) :code (behavior () (send-event *target* 'get-notify self) @@ -1328,13 +1303,11 @@ ) ) #f - (none) ) :post (behavior () (if (not (logtest? (-> *game-info* features) (game-feature board))) (go-virtual wait-for-pickup-training) ) - (none) ) ) @@ -1444,24 +1417,22 @@ This commonly includes things such as: (defstate idle (skate-training-ramp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('open) - (let ((v0-0 #t)) - (set! (-> self onoff) v0-0) - v0-0 - ) - ) - (('close) - (set! (-> self onoff) #f) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open) + (let ((v0-0 #t)) + (set! (-> self onoff) v0-0) + v0-0 + ) + ) + (('close) + (set! (-> self onoff) #f) + #f + ) + ) ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :code (behavior () (until #f @@ -1472,11 +1443,9 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (transform-post) - (none) ) ) @@ -1574,26 +1543,24 @@ This commonly includes things such as: (defstate idle (skate-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('open) - (remove-setting! 'minimap) - (let ((v0-1 #t)) - (set! (-> self onoff) v0-1) - v0-1 - ) - ) - (('close) - (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) - (set! (-> self onoff) #f) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open) + (remove-setting! 'minimap) + (let ((v0-1 #t)) + (set! (-> self onoff) v0-1) + v0-1 + ) + ) + (('close) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set! (-> self onoff) #f) + #f + ) + ) ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :code (behavior () (until #f @@ -1604,7 +1571,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (if (logtest? (-> *game-info* features) (game-feature board)) @@ -1612,7 +1578,6 @@ This commonly includes things such as: (send-event self 'open) ) (transform-post) - (none) ) ) @@ -1799,7 +1764,6 @@ This commonly includes things such as: ((the-as (function none) t9-6)) ) ) - (none) ) ) @@ -1827,7 +1791,6 @@ This commonly includes things such as: :virtual #t :exit (behavior () '() - (none) ) :code (the-as (function none :behavior skatea-floating-ring) sleep-code) :post (behavior () @@ -1867,7 +1830,6 @@ This commonly includes things such as: ) ) (transform-post) - (none) ) ) ) diff --git a/goal_src/jak2/levels/stadium/stadium-obs.gc b/goal_src/jak2/levels/stadium/stadium-obs.gc index 83c452ca4f3..14c7bebcce1 100644 --- a/goal_src/jak2/levels/stadium/stadium-obs.gc +++ b/goal_src/jak2/levels/stadium/stadium-obs.gc @@ -67,7 +67,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior dummy-vehicle) ja-post) ) @@ -183,7 +182,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior gar-curtain) transform-post) ) @@ -657,14 +655,14 @@ This commonly includes things such as: ) (defstate defend-stadium-wait (rift-rider) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (sound-play "rift-lift-off") (go-virtual defend-stadium-move) ) (else - (defend-stadium-rift-rider-handler proc arg1 event-type event) + (defend-stadium-rift-rider-handler proc argc message block) ) ) ) @@ -681,11 +679,9 @@ This commonly includes things such as: (set! (-> self height) 49152.0) (set! (-> self hover-volume) 0.0) (set! (-> self dest-pos quad) (-> self root trans quad)) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (dotimes (gp-0 2) @@ -720,7 +716,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior rift-rider) sleep-code) :post (behavior () @@ -738,23 +733,22 @@ This commonly includes things such as: (seek! (-> self hover-volume) 1.0 (seconds-per-frame)) (spawn (-> self part) (-> self root trans)) (rift-rider-travel-post) - (none) ) ) (defstate defend-stadium-land (rift-rider) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('get-position) - (set! (-> (the-as vector (-> event param 1)) quad) (-> self root trans quad)) - (set! (-> (the-as vector (-> event param 1)) y) + (set! (-> (the-as vector (-> block param 1)) quad) (-> self root trans quad)) + (set! (-> (the-as vector (-> block param 1)) y) (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self path-pos) 'interp) y) ) - (-> event param 1) + (-> block param 1) ) (else - (defend-stadium-rift-rider-handler proc arg1 event-type event) + (defend-stadium-rift-rider-handler proc argc message block) ) ) ) @@ -790,13 +784,11 @@ This commonly includes things such as: (rigid-body-object-method-39 self) (rigid-body-object-method-41 self) (logclear! (-> self rbody state flags) (rigid-body-flag enable-collision)) - (none) ) :exit (behavior () (rigid-body-object-method-38 self) (rigid-body-object-method-40 self) (logior! (-> self rbody state flags) (rigid-body-flag enable-collision)) - (none) ) :trans (behavior () (if (< (vector-vector-xz-distance @@ -807,7 +799,6 @@ This commonly includes things such as: ) (go-virtual defend-stadium-complete) ) - (none) ) :code (the-as (function none :behavior rift-rider) sleep-code) :post (behavior () @@ -849,7 +840,6 @@ This commonly includes things such as: ) (spawn (-> self part) (-> self root trans)) (pusher-post) - (none) ) ) @@ -874,7 +864,6 @@ This commonly includes things such as: ) ) (cleanup-for-death self) - (none) ) ) @@ -883,13 +872,11 @@ This commonly includes things such as: :event defend-stadium-rift-rider-handler :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (< (-> self height) (-> self init-height)) (go-virtual defend-stadium-explode) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -899,7 +886,6 @@ This commonly includes things such as: ) (rigid-body-object-method-39 self) (sleep-code) - (none) ) :post (behavior () (dotimes (gp-0 2) @@ -917,7 +903,6 @@ This commonly includes things such as: ) (rigid-body-object-method-37 self) (pusher-post) - (none) ) ) @@ -956,7 +941,6 @@ This commonly includes things such as: ) (suspend) (cleanup-for-death self) - (none) ) ) @@ -1099,7 +1083,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior spotlight) ja-post) ) @@ -1524,7 +1507,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (go-virtual raise-rift-rider) - (none) ) :post stad-samos-post ) @@ -1571,7 +1553,6 @@ This commonly includes things such as: (set! (-> self speed) 12288.0) (set! (-> self observed-speed) 0.0) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (and (nonzero? (-> self state-time)) (>= (- (current-time) (-> self state-time)) (seconds 1))) @@ -1612,7 +1593,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (send-event (handle->process (-> self hud)) 'force-show) @@ -1631,12 +1611,10 @@ This commonly includes things such as: (ja :num! (seek! max 0.75)) ) (sleep-code) - (none) ) :post (behavior () (spawn-energy) (stad-samos-post) - (none) ) ) @@ -1668,7 +1646,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1680,7 +1657,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (when (not (-> self enable-move?)) @@ -1761,7 +1737,6 @@ This commonly includes things such as: ) (spawn-energy) (stad-samos-post) - (none) ) ) @@ -1806,7 +1781,6 @@ This commonly includes things such as: ) ) (set! (-> self falling?) #t) - (none) ) :exit (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -1824,7 +1798,6 @@ This commonly includes things such as: ) ) ) - (none) ) :trans (behavior () (let ((v1-0 (-> self rift-rider-actor))) @@ -1835,7 +1808,6 @@ This commonly includes things such as: (go empty-state) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1872,7 +1844,6 @@ This commonly includes things such as: ) (spawn-lightning self) (go-virtual move-rift-rider) - (none) ) :post (behavior () (if (-> self falling?) @@ -1894,22 +1865,20 @@ This commonly includes things such as: ) ) (stad-samos-post) - (none) ) ) (defstate die (stad-samos) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('death-end) - (let ((v0-0 (logior (-> self draw status) (draw-control-status no-draw)))) - (set! (-> self draw status) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('death-end) + (let ((v0-0 (logior (-> self draw status) (draw-control-status no-draw)))) + (set! (-> self draw status) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior () (logior! (-> self focus-status) (focus-status ignore)) @@ -1930,7 +1899,6 @@ This commonly includes things such as: ) ) (kill-lightning self) - (none) ) :code (behavior () (send-event *camera* 'change-target self) @@ -1993,7 +1961,6 @@ This commonly includes things such as: ) (send-event *camera* 'change-target #f) (cleanup-for-death self) - (none) ) :post stad-samos-post ) @@ -2246,7 +2213,6 @@ This commonly includes things such as: ) ) #f - (none) ) ) @@ -2321,7 +2287,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (sound-play "stadium-shield") - (none) ) :code (the-as (function none :behavior stadium-barrier) sleep-code) :post (behavior () @@ -2340,7 +2305,6 @@ This commonly includes things such as: (if (and (= (-> self colorf) 0.0) (= (-> self flashf) 0.0)) (go-virtual die) ) - (none) ) ) @@ -2348,7 +2312,6 @@ This commonly includes things such as: :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -2597,50 +2560,47 @@ This commonly includes things such as: (defstate idle (stad-force-field) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (let ((v1-1 (the-as object (-> event param 1))) - (a1-1 (-> event param 0)) - ) - (when (!= (-> (the-as attack-info v1-1) id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-1) id)) - (stad-force-field-method-29 self (the-as touching-shapes-entry a1-1)) - (send-event - proc - 'shove - (-> event param 0) - (static-attack-info - ((id (new-attack-id)) (vector (-> self plane)) (shove-back (meters 1)) (shove-up (meters 1.5))) - ) - ) - (when (< (-> self next-message-time) (current-time)) - (set! (-> self next-message-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) - (add-process *gui-control* self (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((v1-1 (the-as object (-> block param 1))) + (a1-1 (-> block param 0)) + ) + (when (!= (-> (the-as attack-info v1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-1) id)) + (stad-force-field-method-29 self (the-as touching-shapes-entry a1-1)) + (send-event + proc + 'shove + (-> block param 0) + (static-attack-info + ((id (new-attack-id)) (vector (-> self plane)) (shove-back (meters 1)) (shove-up (meters 1.5))) ) ) - ) - ) - (('touch) - (let ((a1-5 (-> event param 0))) - (stad-force-field-method-29 self (the-as touching-shapes-entry a1-5)) - ) - (send-event - proc - 'shove - (-> event param 0) - (static-attack-info - ((id (new-attack-id)) (vector (-> self plane)) (shove-back (meters 1)) (shove-up (meters 1.5))) + (when (< (-> self next-message-time) (current-time)) + (set! (-> self next-message-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) + (add-process *gui-control* self (gui-channel alert) (gui-action play) "cityv014" -99.0 0) ) ) - (when (< (-> self next-message-time) (current-time)) - (set! (-> self next-message-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) - (add-process *gui-control* self (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + ) + ) + (('touch) + (let ((a1-5 (-> block param 0))) + (stad-force-field-method-29 self (the-as touching-shapes-entry a1-5)) + ) + (send-event + proc + 'shove + (-> block param 0) + (static-attack-info + ((id (new-attack-id)) (vector (-> self plane)) (shove-back (meters 1)) (shove-up (meters 1.5))) ) ) - ) + (when (< (-> self next-message-time) (current-time)) + (set! (-> self next-message-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) + (add-process *gui-control* self (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + ) + ) ) ) :code (the-as (function none :behavior stad-force-field) sleep-code) @@ -2808,8 +2768,8 @@ This commonly includes things such as: (defstate idle (stad-keira) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go empty-state) ) @@ -2827,7 +2787,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -2869,7 +2828,6 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) @@ -2909,8 +2867,8 @@ This commonly includes things such as: (defstate idle (stad-brutter) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go empty-state) ) @@ -2928,7 +2886,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -2970,7 +2927,6 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) diff --git a/goal_src/jak2/levels/stadium/stadium-race-obs.gc b/goal_src/jak2/levels/stadium/stadium-race-obs.gc index 81d8525bc65..523ad040338 100644 --- a/goal_src/jak2/levels/stadium/stadium-race-obs.gc +++ b/goal_src/jak2/levels/stadium/stadium-race-obs.gc @@ -30,16 +30,15 @@ (defstate idle (stdmb-race-hatch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('open) - (set! (-> self tt-target) 1.0) - ) - (('close) - (set! (-> self tt-target) 0.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open) + (set! (-> self tt-target) 1.0) + ) + (('close) + (set! (-> self tt-target) 0.0) + ) + ) ) :code (the-as (function none :behavior stdmb-race-hatch) sleep-code) :post (behavior () @@ -53,7 +52,6 @@ (ja-post) ) ) - (none) ) ) diff --git a/goal_src/jak2/levels/stadium/stadium-scenes.gc b/goal_src/jak2/levels/stadium/stadium-scenes.gc index 2a8d4a350e6..3c52db4d16a 100644 --- a/goal_src/jak2/levels/stadium/stadium-scenes.gc +++ b/goal_src/jak2/levels/stadium/stadium-scenes.gc @@ -1930,7 +1930,7 @@ (set! (-> gp-0 info sky) #f) ) ) - (the-as object (race-start 2 (the-as process #f) #t)) + (race-start 2 (the-as process #f) #t) ) ) ) diff --git a/goal_src/jak2/levels/strip/chaincrate.gc b/goal_src/jak2/levels/strip/chaincrate.gc index dede5b7ec4a..db3e94dfb49 100644 --- a/goal_src/jak2/levels/strip/chaincrate.gc +++ b/goal_src/jak2/levels/strip/chaincrate.gc @@ -178,7 +178,6 @@ ) (update-trans! (-> self sound) (-> self root trans)) (update! (-> self sound)) - (none) ) :code (the-as (function none :behavior strip-chain-crate-slave) sleep-code) :post (the-as (function none :behavior strip-chain-crate-slave) rider-post) @@ -315,7 +314,6 @@ (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/levels/strip/strip-drop.gc b/goal_src/jak2/levels/strip/strip-drop.gc index bddbd1c1a51..29fb36d448c 100644 --- a/goal_src/jak2/levels/strip/strip-drop.gc +++ b/goal_src/jak2/levels/strip/strip-drop.gc @@ -217,8 +217,8 @@ (defstate idle (strip-game-crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('go-final) (go-virtual final-position) ) @@ -240,7 +240,6 @@ (set! (-> self swing-angle x) (+ f28-1 f0-15)) ) (rider-post) - (none) ) ) @@ -249,7 +248,6 @@ :enter (behavior () (ja :group! (-> self draw art-group data 3) :num! min) (ja-post) - (none) ) :code (the-as (function none :behavior strip-game-crate) sleep-code) ) @@ -343,55 +341,48 @@ (suspend) ) #f - (none) ) ) (defstate swinging (crane) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('notice) - (when (and *target* - (not (task-complete? *game-info* (game-task strip-drop))) - (or (demo?) (and (task-node-closed? (game-task-node strip-drop-introduction)) - (not (task-node-closed? (game-task-node strip-drop-resolution))) - ) - ) - ) - (let ((gp-0 (if (demo?) - "crane-victory-demo" - "crane-victory" - ) - ) - ) - (process-spawn scene-player :init scene-player-init gp-0 #t #f) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notice) + (when (and *target* + (not (task-complete? *game-info* (game-task strip-drop))) + (or (demo?) (and (task-node-closed? (game-task-node strip-drop-introduction)) + (not (task-node-closed? (game-task-node strip-drop-resolution))) + ) + ) + ) + (let ((gp-0 (if (demo?) + "crane-victory-demo" + "crane-victory" + ) + ) + ) + (process-spawn scene-player :init scene-player-init gp-0 #t #f) ) ) - ) + ) ) ) :enter (behavior () (set! (-> self angle) 0.0) (set! (-> self angle-vel) 0.0) (quaternion-copy! (-> self init-quat) (-> self root quat)) - (none) ) :trans (behavior () (if (task-complete? *game-info* (game-task strip-drop)) (go-virtual final-position) ) - (none) ) :code (behavior () (until #f (suspend) ) #f - (none) ) :post (behavior () (let* ((f0-1 (* 3.640889 (the float (mod (current-time) #x4650)))) @@ -403,7 +394,6 @@ (let ((a1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)))) (strip-game-crate-method-22 (-> self crate 0) a1-2 (-> self root quat)) ) - (none) ) ) @@ -418,7 +408,6 @@ (strip-game-crate-method-22 (-> self crate 0) a1-3 (-> self root quat)) ) ) - (none) ) :code (the-as (function none :behavior crane) sleep-code) :post (the-as (function none :behavior crane) ja-post) @@ -479,14 +468,13 @@ This commonly includes things such as: (suspend) ) (sleep-code) - (none) ) ) (defstate hidden (cranecrate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('wake-up) (go-virtual idle) ) @@ -499,7 +487,6 @@ This commonly includes things such as: (suspend) ) (sleep-code) - (none) ) ) @@ -625,10 +612,10 @@ This commonly includes things such as: (defstate idle (grunt-egg) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) - (let* ((s5-0 (-> event param 0)) + (let* ((s5-0 (-> block param 0)) (s4-0 proc) (v1-2 (if (type? s4-0 process-focusable) (the-as process-focusable s4-0) @@ -663,7 +650,6 @@ This commonly includes things such as: ) (idle-control-method-10 (-> self idle-anim-player) self) (ja-post) - (none) ) ) @@ -671,7 +657,6 @@ This commonly includes things such as: :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak2/levels/strip/strip-obs.gc b/goal_src/jak2/levels/strip/strip-obs.gc index 691e7e78c3b..ede598721e8 100644 --- a/goal_src/jak2/levels/strip/strip-obs.gc +++ b/goal_src/jak2/levels/strip/strip-obs.gc @@ -63,49 +63,46 @@ ;; WARN: Return type mismatch int vs object. (defbehavior strip-handler strip-hazard ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (case arg2 - (('touch 'attack) - (let* ((s4-0 arg0) - (gp-0 (if (type? s4-0 process-focusable) - (the-as process-focusable s4-0) - ) - ) - ) - (when gp-0 - (let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) - (let* ((v1-4 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> gp-0 root quat))) - (f0-1 (vector-dot s4-1 v1-4)) - ) - (if (< 0.0 f0-1) - (vector-float*! s4-1 s4-1 -1.0) - ) - ) - (when (send-event gp-0 'attack (-> arg3 param 0) (static-attack-info ((id (-> self attack-id)) - (vector s4-1) - (shove-back (-> self shove-vec z)) - (shove-up (-> self shove-vec y)) - (control (if (focus-test? gp-0 board) - 1.0 - 0.0 - ) - ) - ) - ) - ) - (set! (-> self no-collision-timer) (the-as uint (current-time))) - (let ((v1-18 (-> self root root-prim))) - (set! (-> v1-18 prim-core collide-as) (collide-spec)) - (set! (-> v1-18 prim-core collide-with) (collide-spec)) + (case arg2 + (('touch 'attack) + (let* ((s4-0 arg0) + (gp-0 (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + ) + (when gp-0 + (let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (let* ((v1-4 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> gp-0 root quat))) + (f0-1 (vector-dot s4-1 v1-4)) + ) + (if (< 0.0 f0-1) + (vector-float*! s4-1 s4-1 -1.0) ) - 0 + ) + (when (send-event gp-0 'attack (-> arg3 param 0) (static-attack-info ((id (-> self attack-id)) + (vector s4-1) + (shove-back (-> self shove-vec z)) + (shove-up (-> self shove-vec y)) + (control (if (focus-test? gp-0 board) + 1.0 + 0.0 + ) + ) + ) + ) + ) + (set! (-> self no-collision-timer) (the-as uint (current-time))) + (let ((v1-18 (-> self root root-prim))) + (set! (-> v1-18 prim-core collide-as) (collide-spec)) + (set! (-> v1-18 prim-core collide-with) (collide-spec)) ) + 0 ) ) ) ) - ) + ) ) ) @@ -149,7 +146,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior strip-hazard) transform-post) ) @@ -235,7 +231,6 @@ This commonly includes things such as: ) (quaternion-rotate-local-x! (-> self root quat) (-> self root quat) (* (-> self spin) (seconds-per-frame))) (strip-trans) - (none) ) ) @@ -353,7 +348,6 @@ This commonly includes things such as: ) (update-trans! (-> self sound) (vector<-cspace! (new 'static 'vector) (-> self node-list data 4))) (update! (-> self sound)) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type strip-hazard idle) post))) @@ -368,7 +362,6 @@ This commonly includes things such as: ) (spawn (-> self part) gp-0) ) - (none) ) ) @@ -460,7 +453,6 @@ This commonly includes things such as: ) (update-trans! (-> self sound) (vector<-cspace! (new 'static 'vector) (-> self node-list data 3))) (update! (-> self sound)) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type strip-hazard idle) post))) @@ -479,7 +471,6 @@ This commonly includes things such as: (spawn (-> self part) s5-0) ) ) - (none) ) ) @@ -748,46 +739,43 @@ This commonly includes things such as: (defstate idle (grenade-point) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch 'attack) - (send-event proc 'ramp) - (when (logtest? (-> self level task-mask) (task-mask task1)) - (cond - ((send-event proc 'grenade (-> self speed)) - (if (-> self camera-name) - (set-setting! 'entity-name (-> self camera-name) 0.0 -1) - ) - ) - ((>= (- (current-time) (-> self enter-time)) (seconds 3)) - (talker-speech-class-method-12 (-> *talker-speech* 194) 1) - ) - ) - (set! (-> self enter-time) (current-time)) - ) - #f - ) - (('exit) - (the-as object (remove-setting! 'entity-name)) - ) - (('die) - (go-virtual die #t) - ) - (('kill) - (process-entity-status! self (entity-perm-status subtask-complete) #t) - (cleanup-for-death self) - (the-as object (deactivate self)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (send-event proc 'ramp) + (when (logtest? (-> self level task-mask) (task-mask task1)) + (cond + ((send-event proc 'grenade (-> self speed)) + (if (-> self camera-name) + (set-setting! 'entity-name (-> self camera-name) 0.0 -1) + ) ) + ((>= (- (current-time) (-> self enter-time)) (seconds 3)) + (talker-speech-class-method-12 (-> *talker-speech* 194) 1) + ) + ) + (set! (-> self enter-time) (current-time)) + ) + #f + ) + (('exit) + (remove-setting! 'entity-name) + ) + (('die) + (go-virtual die #t) + ) + (('kill) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (cleanup-for-death self) + (deactivate self) + ) + ) ) :enter (behavior () (set! (-> self lightning-time) (+ (current-time) -1)) - (none) ) :exit (behavior () (remove-setting! 'entity-name) - (none) ) :code (the-as (function none :behavior grenade-point) sleep-code) :post (behavior () @@ -835,21 +823,19 @@ This commonly includes things such as: ) ) (update! (-> self sound)) - (none) ) ) (defstate die (grenade-point) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('kill) - (process-entity-status! self (entity-perm-status subtask-complete) #t) - (cleanup-for-death self) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('kill) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (cleanup-for-death self) + (deactivate self) + ) + ) ) :code (behavior ((arg0 symbol)) (play-communicator-speech! (-> *talker-speech* 194)) @@ -869,7 +855,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -1226,8 +1211,8 @@ This commonly includes things such as: (defstate impact (grenade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (let* ((s4-0 proc) (v1-1 (if (type? s4-0 process-drawable) @@ -1255,7 +1240,7 @@ This commonly includes things such as: (set! (-> v1-5 action-mask) (collide-action solid)) ) (if (< (fill-and-probe-using-line-sphere *collide-cache* a1-2) 0.0) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) ) ) ) @@ -1272,7 +1257,6 @@ This commonly includes things such as: (set! (-> self state-time) (current-time)) (send-event (handle->process (-> self end-target)) 'die) (remove-setting! 'point-of-interest) - (none) ) :code (behavior () (ja-channel-set! 0) @@ -1298,7 +1282,6 @@ This commonly includes things such as: ) 0 (deactivate self) - (none) ) ) @@ -1306,7 +1289,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (go-virtual impact) - (none) ) ) @@ -1599,13 +1581,13 @@ This commonly includes things such as: (defstate idle (drill-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) #f ) (else - (strip-handler proc arg1 event-type event) + (strip-handler proc argc message block) ) ) ) @@ -1616,7 +1598,6 @@ This commonly includes things such as: ) ) (rider-trans) - (none) ) :code (behavior () (until #f @@ -1636,7 +1617,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type strip-hazard idle) post))) @@ -1651,7 +1631,6 @@ This commonly includes things such as: (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 7)) ) (update! (-> self plat-sound)) - (none) ) ) diff --git a/goal_src/jak2/levels/strip/strip-rescue.gc b/goal_src/jak2/levels/strip/strip-rescue.gc index 1a8ed42978d..c888bc43f2c 100644 --- a/goal_src/jak2/levels/strip/strip-rescue.gc +++ b/goal_src/jak2/levels/strip/strip-rescue.gc @@ -35,7 +35,6 @@ (suspend) ) (sleep-code) - (none) ) ) @@ -48,7 +47,6 @@ (suspend) ) (sleep-code) - (none) ) ) @@ -138,7 +136,6 @@ This commonly includes things such as: (suspend) ) (sleep-code) - (none) ) ) diff --git a/goal_src/jak2/levels/title/title-obs.gc b/goal_src/jak2/levels/title/title-obs.gc index fa55a46c490..d2ab020b943 100644 --- a/goal_src/jak2/levels/title/title-obs.gc +++ b/goal_src/jak2/levels/title/title-obs.gc @@ -609,17 +609,16 @@ (defstate startup (title-control) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('pause) - (set! (-> *game-info* demo-state) (the-as uint 2)) - (the-as object (remove-setting! 'bg-a)) - ) - (('scrap-book) - (go-virtual scrap-book (the-as int (-> event param 0))) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pause) + (set! (-> *game-info* demo-state) (the-as uint 2)) + (remove-setting! 'bg-a) + ) + (('scrap-book) + (go-virtual scrap-book (the-as int (-> block param 0))) + ) + ) ) :exit (behavior () (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -630,7 +629,6 @@ (disable *screen-filter*) (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) ) - (none) ) :code (behavior () (let ((v1-1 (-> *game-info* demo-state))) @@ -710,7 +708,6 @@ ) ) (go-virtual wait) - (none) ) :post (behavior () (local-vars (v1-73 external-art-buffer)) @@ -789,7 +786,6 @@ (set! (-> self active) #t) ) ) - (none) ) ) @@ -805,7 +801,6 @@ (go-virtual idle) ) (sleep-code) - (none) ) :post (-> (method-of-type title-control startup) post) ) @@ -819,7 +814,6 @@ (title-fade-out (* 3.0 (seconds-per-frame))) (title-progress 'title) (sleep-code) - (none) ) :post (-> (method-of-type title-control startup) post) ) @@ -890,7 +884,6 @@ (set-blackout-frames (seconds 0.2)) (set! (-> *game-info* demo-state) (the-as uint 1)) (go-virtual idle) - (none) ) :post (-> (method-of-type title-control startup) post) ) @@ -994,12 +987,12 @@ ) (defstate target-title (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('grab) - (if (not (-> event param 1)) + (if (not (-> block param 1)) #t (go target-grab 'stance) ) @@ -1007,7 +1000,7 @@ ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -1040,7 +1033,6 @@ (ppointer->handle (process-spawn title-control :init title-control-init :to *entity-pool*)) ) ) - (none) ) :code (the-as (function symbol none :behavior target) sleep-code) :post target-no-move-post diff --git a/goal_src/jak2/levels/tomb/monster-frog.gc b/goal_src/jak2/levels/tomb/monster-frog.gc index a898bf70126..bf50bdf7672 100644 --- a/goal_src/jak2/levels/tomb/monster-frog.gc +++ b/goal_src/jak2/levels/tomb/monster-frog.gc @@ -299,7 +299,6 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (behavior () (enemy-method-129 self) @@ -332,7 +331,6 @@ (set! (-> v1-37 prim-core collide-with) (-> self root backup-collide-with)) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior monster-frog) nav-enemy-simple-post) ) @@ -379,7 +377,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -480,7 +477,6 @@ ) ) #f - (none) ) ) @@ -506,7 +502,6 @@ (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) ) @@ -523,7 +518,6 @@ (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :trans (behavior () (nav-enemy-method-160 self) @@ -557,7 +551,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -659,7 +652,6 @@ ) ) #f - (none) ) ) @@ -693,7 +685,6 @@ (ja :num! (seek!)) ) (react-to-focus self) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -711,7 +702,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -754,14 +744,12 @@ ) ) 0 - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior ((arg0 vector)) (ja-channel-push! 1 (seconds 0.04)) @@ -780,7 +768,6 @@ (logclear! (-> self focus-status) (focus-status dangerous)) ) (go-virtual attack-recover) - (none) ) :post (the-as (function none :behavior monster-frog) nav-enemy-travel-post) ) @@ -798,7 +785,6 @@ (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :code (behavior () (ja-no-eval :group! monster-frog-attack0-end-ja @@ -842,7 +828,6 @@ ) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior monster-frog) nav-enemy-simple-post) ) diff --git a/goal_src/jak2/levels/tomb/target-indax.gc b/goal_src/jak2/levels/tomb/target-indax.gc index 4d68e4002a1..77455d09a1e 100644 --- a/goal_src/jak2/levels/tomb/target-indax.gc +++ b/goal_src/jak2/levels/tomb/target-indax.gc @@ -449,7 +449,6 @@ :code (behavior ((arg0 handle)) (target-indax-init) (go target-indax-stance) - (none) ) :post target-indax-post ) @@ -459,12 +458,10 @@ :enter (behavior () ((-> target-stance enter)) (set! (-> self control mod-surface) *indax-walk-mods*) - (none) ) :exit (behavior () ((-> target-stance exit)) (target-indax-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -513,7 +510,6 @@ (go target-indax-attack) ) (fall-test target-indax-falling -4096000.0) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -576,7 +572,6 @@ ) ) #f - (none) ) :post target-indax-post ) @@ -586,13 +581,11 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self control mod-surface) *indax-walk-mods*) - (none) ) :exit (behavior () (target-effect-exit) (target-state-hook-exit) (target-indax-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -640,7 +633,6 @@ (go target-indax-attack) ) (fall-test target-indax-falling -4096000.0) - (none) ) :code (behavior () (let ((f26-0 0.0) @@ -749,7 +741,6 @@ ) ) #f - (none) ) :post target-indax-post ) @@ -759,7 +750,6 @@ :enter (behavior ((arg0 symbol)) ((-> target-falling enter) arg0) (set! (-> self control mod-surface) *indax-jump-mods*) - (none) ) :exit target-indax-exit :trans (behavior () @@ -780,7 +770,6 @@ (seek! (-> self control unknown-float35) f0-3 (* 4.0 (seconds-per-frame))) ) ) - (none) ) :code (behavior ((arg0 symbol)) (let ((a1-0 75)) @@ -813,7 +802,6 @@ (ja :num! (loop!)) ) #f - (none) ) :post target-indax-post ) @@ -835,12 +823,10 @@ (t9-0 arg0 arg1 arg2) ) (set! (-> self control unknown-float35) 0.0) - (none) ) :exit (behavior () (target-exit) (target-indax-exit) - (none) ) :trans (behavior () ((-> target-indax-falling trans)) @@ -858,7 +844,6 @@ (-> *TARGET-bank* indax-double-jump-height-max) ) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) (ja-channel-push! 2 (seconds 0.02)) @@ -892,7 +877,6 @@ (suspend) ) (go target-indax-falling #f) - (none) ) :post target-indax-post ) @@ -915,13 +899,11 @@ ) ) ) - (none) ) :exit (-> target-indax-jump exit) :trans (behavior () ((-> target-indax-falling trans)) (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (sound-play "jump-double") @@ -958,7 +940,6 @@ ) ) (go target-indax-falling #f) - (none) ) :post target-post ) @@ -968,7 +949,6 @@ :enter (behavior ((arg0 symbol)) ((-> target-hit-ground enter) arg0) (set! (-> self control mod-surface) *indax-walk-mods*) - (none) ) :exit target-indax-exit :trans (behavior () @@ -1014,7 +994,6 @@ (go target-indax-attack) ) (fall-test target-falling -4096000.0) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-push! 1 (seconds 0.05)) @@ -1027,7 +1006,6 @@ (ja :num! (seek!)) ) (go target-indax-stance) - (none) ) :post target-indax-post ) @@ -1038,12 +1016,10 @@ (set! (-> self state-time) (current-time)) (sound-play "jump" :vol 70) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) - (none) ) :exit (behavior () (target-exit) (target-indax-exit) - (none) ) :code (behavior () (set! (-> self control mod-surface) *indax-bounce-mods*) @@ -1070,7 +1046,6 @@ (ja :num! (seek!)) ) (sleep-code) - (none) ) :post target-no-stick-post ) @@ -1081,7 +1056,6 @@ :exit (behavior () ((-> target-attack exit)) (target-indax-exit) - (none) ) :code (behavior () (let ((gp-0 (-> self draw art-group data 421))) @@ -1123,7 +1097,6 @@ (ja :num-func num-func-identity :frame-num max) ) (go target-indax-stance) - (none) ) :post target-indax-post ) @@ -1134,7 +1107,6 @@ :exit (behavior () ((-> target-attack-air exit)) (target-indax-exit) - (none) ) :code (behavior ((arg0 symbol)) (let ((gp-0 (-> self draw art-group data 428))) @@ -1172,7 +1144,6 @@ ) (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) (go target-indax-falling #f) - (none) ) :post target-indax-post ) @@ -1183,7 +1154,6 @@ :exit (behavior () ((-> target-running-attack enter)) (target-indax-exit) - (none) ) :code (behavior () (if (logtest? (water-flags touch-water) (-> self water flags)) @@ -1278,7 +1248,6 @@ (go target-indax-falling #f) ) (go target-indax-stance) - (none) ) :post target-post ) @@ -1311,7 +1280,6 @@ :exit (behavior () ((-> target-hit exit)) (target-indax-exit) - (none) ) :trans (behavior () (when (= *cheat-mode* 'debug) @@ -1320,7 +1288,6 @@ (go target-indax-stance) ) ) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags jump-out)) @@ -1426,7 +1393,6 @@ ) ) (go target-indax-hit-ground #f) - (none) ) :post target-indax-post ) @@ -1436,7 +1402,6 @@ :exit (behavior () ((-> target-death exit)) (target-indax-exit) - (none) ) :trans (-> target-indax-hit trans) :code (behavior ((arg0 symbol)) @@ -1557,7 +1522,6 @@ (initialize! (-> self game) 'life (the-as game-save #f) (the-as string #f)) (set! (-> self state-time) (current-time)) (sleep-code) - (none) ) :post target-no-stick-post ) diff --git a/goal_src/jak2/levels/tomb/tomb-baby-spider.gc b/goal_src/jak2/levels/tomb/tomb-baby-spider.gc index 8b88dee87f1..78bb4cb517d 100644 --- a/goal_src/jak2/levels/tomb/tomb-baby-spider.gc +++ b/goal_src/jak2/levels/tomb/tomb-baby-spider.gc @@ -259,7 +259,6 @@ ) ) #f - (none) ) ) @@ -307,7 +306,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -332,7 +330,6 @@ (set! (-> v1-14 attack-id) v0-2) (set! (-> self attack-id) v0-2) ) - (none) ) :exit (behavior () (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1))) @@ -344,14 +341,12 @@ (logclear! (-> self focus-status) (focus-status dangerous)) ) (nav-enemy-method-165 self) - (none) ) :trans (behavior () (enemy-method-49 self) (if (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) ) - (none) ) :code (behavior () (let ((v1-0 (-> self nav))) @@ -375,7 +370,6 @@ (ja :num! (seek! max 0.8)) ) (go-virtual attack-stop) - (none) ) :post (the-as (function none :behavior tomb-baby-spider) nav-enemy-chase-post) ) @@ -395,14 +389,12 @@ (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () (let ((v1-0 self)) (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-0 enemy-flags)))) ) 0 - (none) ) :code (behavior () (ja-no-eval :group! tomb-baby-spider-attack0-stop-ja @@ -470,7 +462,6 @@ ) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior tomb-baby-spider) nav-enemy-face-focus-post) ) @@ -492,7 +483,6 @@ ) ) ) - (none) ) ) diff --git a/goal_src/jak2/levels/tomb/tomb-beetle.gc b/goal_src/jak2/levels/tomb/tomb-beetle.gc index d33dca81179..8f588235cea 100644 --- a/goal_src/jak2/levels/tomb/tomb-beetle.gc +++ b/goal_src/jak2/levels/tomb/tomb-beetle.gc @@ -234,6 +234,7 @@ ) ) +;; WARN: Return type mismatch object vs none. (defmethod tomb-beetle-method-185 tomb-beetle ((obj tomb-beetle)) (cond ((-> obj draw shadow) @@ -305,7 +306,6 @@ (t9-2) ) ) - (none) ) ) @@ -349,20 +349,17 @@ (setup-masks (-> self draw) 4 0) (setup-masks (-> self draw) 8 0) ) - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :trans (behavior () (if (< (fabs (- (-> self root trans y) (-> self move-dest y))) 4096.0) (go-virtual land) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -377,12 +374,10 @@ ) ) #f - (none) ) :post (behavior () (tomb-beetle-method-185 self) (nav-enemy-falling-post) - (none) ) ) @@ -394,7 +389,6 @@ ) 0 (set! (-> self state-time) (current-time)) - (none) ) :code (behavior () (ja-no-eval :group! tomb-beetle-land-ja @@ -424,7 +418,6 @@ (ja :num! (seek!)) ) (go-virtual active) - (none) ) :post (the-as (function none :behavior tomb-beetle) nav-enemy-falling-post) ) @@ -469,13 +462,11 @@ (set! (-> a0-23 target-post quad) (-> v1-19 quad)) ) 0 - (none) ) :trans (behavior () (if (< (vector-vector-xz-distance (-> self root trans) (-> self move-dest)) 16384.0) (go-virtual stand) ) - (none) ) :code (behavior () (until #f @@ -503,11 +494,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-travel-post) - (none) ) ) @@ -526,13 +515,11 @@ ) 0 (set! (-> self state-timeout) (the-as time-frame (the int (* 300.0 (rand-vu-float-range 0.2 0.8))))) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) (go-virtual active) ) - (none) ) :code (behavior () (until #f @@ -546,7 +533,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior tomb-beetle) nav-enemy-simple-post) ) @@ -573,7 +559,6 @@ (set! (-> self fly-away-acc) (get-rand-float-range self 204800.0 512000.0)) (set! (-> self fly-away-ry-speed) (get-rand-float-range self 32768.0 109226.664)) (set! (-> self flying?) #f) - (none) ) :trans (behavior () (let ((f30-0 (- (-> self root trans y) (-> self fly-info 1 dst y)))) @@ -585,7 +570,6 @@ (set-vector! (-> self root scale) f0-2 f0-2 f0-2 1.0) ) ) - (none) ) :code (behavior () (set! (-> self state-timeout) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.0 0.8))))) @@ -644,7 +628,6 @@ ) ) #f - (none) ) :post (behavior () (local-vars (at-0 int)) @@ -689,7 +672,6 @@ ) (tomb-beetle-method-185 self) (transform-post) - (none) ) ) ) @@ -717,7 +699,6 @@ ) (send-event self 'death-end) (go-virtual explode) - (none) ) :post (the-as (function none :behavior tomb-beetle) nav-enemy-simple-post) ) @@ -790,7 +771,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior tomb-beetle) nav-enemy-simple-post) ) @@ -871,7 +851,6 @@ (set! (-> self dest-index) 0) (set! (-> self speed) 122880.0) (vector-reset! (-> self root transv)) - (none) ) :trans (behavior () (when (< (vector-length (vector-! @@ -892,7 +871,6 @@ (quaternion-copy! (-> self src-quat) (-> self root quat)) (+! (-> self dest-index) 1) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -918,7 +896,6 @@ ) ) #f - (none) ) :post (behavior () (local-vars (at-0 int)) @@ -954,7 +931,6 @@ ) (tomb-beetle-method-185 self) (transform-post) - (none) ) ) ) @@ -982,7 +958,6 @@ ) ) ) - (none) ) :trans (the-as (function none :behavior tomb-beetle) ja-post) :code (behavior () @@ -995,7 +970,6 @@ (ja :num! (seek!)) ) (sleep-code) - (none) ) ) diff --git a/goal_src/jak2/levels/tomb/tomb-boulder.gc b/goal_src/jak2/levels/tomb/tomb-boulder.gc index 714fb0f30bc..46a37cf2647 100644 --- a/goal_src/jak2/levels/tomb/tomb-boulder.gc +++ b/goal_src/jak2/levels/tomb/tomb-boulder.gc @@ -113,13 +113,13 @@ (defstate idle (tomb-spider) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (send-event proc 'attack - (-> event param 0) + (-> block param 0) (static-attack-info ((id (new-attack-id)) (shove-up (meters 3)) (mode 'tomb-spider))) ) ) @@ -133,7 +133,6 @@ (suspend) ) #f - (none) ) ) @@ -209,7 +208,6 @@ (suspend) ) #f - (none) ) ) @@ -285,7 +283,6 @@ (suspend) ) #f - (none) ) ) @@ -369,29 +366,27 @@ (defstate idle (tomb-boulder) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('draw) - (if (-> event param 0) - (logclear! (-> self draw status) (draw-control-status no-draw)) - (logior! (-> self draw status) (draw-control-status no-draw)) - ) - (let ((s5-0 (-> self child))) - (while s5-0 - (send-event (ppointer->process s5-0) 'draw (-> event param 0)) - (set! s5-0 (-> s5-0 0 brother)) - ) - ) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('draw) + (if (-> block param 0) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + (let ((s5-0 (-> self child))) + (while s5-0 + (send-event (ppointer->process s5-0) 'draw (-> block param 0)) + (set! s5-0 (-> s5-0 0 brother)) + ) + ) + #f + ) + ) ) :exit (behavior () (while (-> self child) (deactivate (-> self child 0)) ) - (none) ) :trans (behavior () (cond @@ -432,7 +427,6 @@ ) ) ) - (none) ) :code (behavior () (cond @@ -487,21 +481,20 @@ ) ) (sleep-code) - (none) ) ) (defstate chase (tomb-boulder) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('touch 'attack) (if (not (-> self current-pause)) (send-event proc 'attack - (-> event param 0) + (-> block param 0) (static-attack-info ((id (new-attack-id)) (shove-up (meters 3)) (mode 'smush))) ) ) @@ -510,13 +503,13 @@ (go-virtual idle) ) (('pause) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self target-pause) (the-as symbol v0-0)) v0-0 ) (('draw) (cond - ((-> event param 0) + ((-> block param 0) (set! v0-0 (logclear (-> self draw status) (draw-control-status no-draw))) (set! (-> self draw status) (the-as draw-control-status v0-0)) ) @@ -533,7 +526,7 @@ v0-0 ) (('mode) - (set! v0-0 (command-get-int (-> event param 0) 0)) + (set! v0-0 (command-get-int (-> block param 0) 0)) (set! (-> self mode) (the-as uint v0-0)) v0-0 ) @@ -693,7 +686,6 @@ ) (set-setting! 'music 'danger11 0.0 0) (process-entity-status! self (entity-perm-status no-kill) #t) - (none) ) :exit (behavior () (when (= (-> *setting-control* user-current spooling) (process->ppointer self)) @@ -719,7 +711,6 @@ (remove-setting! 'music) (persist-with-delay *setting-control* 'music (seconds 1) 'music 'danger11 0.0 0) (process-entity-status! self (entity-perm-status no-kill) #f) - (none) ) :code (behavior ((arg0 spool-anim)) (play-clean #f) @@ -778,7 +769,6 @@ ) ) (sleep-code) - (none) ) :post (behavior () (let ((v1-0 (-> self mode))) @@ -1020,7 +1010,6 @@ ) ) ) - (none) ) ) @@ -1242,7 +1231,6 @@ This commonly includes things such as: :post (behavior () (spider-eyes-method-21 self) (ja-post) - (none) ) ) diff --git a/goal_src/jak2/levels/tomb/tomb-obs.gc b/goal_src/jak2/levels/tomb/tomb-obs.gc index 67db3260d28..1c179a57607 100644 --- a/goal_src/jak2/levels/tomb/tomb-obs.gc +++ b/goal_src/jak2/levels/tomb/tomb-obs.gc @@ -47,7 +47,6 @@ (set! (-> self sound-id) (new 'static 'sound-id)) 0 ) - (none) ) :trans (behavior () (rlet ((acc :class vf) @@ -94,7 +93,6 @@ (set! (-> self last-pos) f30-0) ) (plat-trans) - (none) ) ) :code (behavior () @@ -109,7 +107,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior tomb-plat-wall) plat-post) ) @@ -207,34 +204,33 @@ This commonly includes things such as: ;; WARN: Return type mismatch int vs object. (defbehavior tomb-stair-block-collision tomb-stair-block-spikes ((arg0 symbol)) (let ((v1-1 (-> self root root-prim))) - (the-as object (cond - (arg0 - (set! (-> v1-1 prim-core collide-with) (collide-spec jak bot player-list)) - (let ((v0-0 (the-as int (-> v1-1 specific 1)))) - (set! (-> v1-1 specific 0) (the-as uint v0-0)) - v0-0 - ) - ) - (else - (set! (-> v1-1 prim-core collide-with) (collide-spec)) - (set! (-> v1-1 specific 0) (the-as uint 0)) - 0 - ) - ) - ) + (cond + (arg0 + (set! (-> v1-1 prim-core collide-with) (collide-spec jak bot player-list)) + (let ((v0-0 (the-as int (-> v1-1 specific 1)))) + (set! (-> v1-1 specific 0) (the-as uint v0-0)) + v0-0 + ) + ) + (else + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + (set! (-> v1-1 specific 0) (the-as uint 0)) + 0 + ) + ) ) ) (defstate idle (tomb-stair-block-spikes) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('sound) (sound-play "tomb-spikes") ) (('set-position) (let ((v0-1 (the-as object (-> self root trans)))) - (set! (-> (the-as vector v0-1) quad) (-> (the-as vector (-> event param 0)) quad)) + (set! (-> (the-as vector v0-1) quad) (-> (the-as vector (-> block param 0)) quad)) v0-1 ) ) @@ -468,20 +464,17 @@ This commonly includes things such as: :num! (identity (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) ) (transform-post) - (none) ) :trans (behavior () (lift-pool 1) (drop-pool 0) (position-spikes 1200) - (none) ) :code (behavior () (suspend) (suspend) (transform-post) (sleep-code) - (none) ) ) @@ -491,13 +484,11 @@ This commonly includes things such as: (set! (-> self camera-state) 0) (set! (-> self state-time) (current-time)) (task-node-close! (game-task-node tomb-poles-block)) - (none) ) :exit (behavior () (remove-setting! 'entity-name) (remove-setting! 'interp-time) (remove-setting! 'string-startup-vector) - (none) ) :trans (behavior () (rider-trans) @@ -518,7 +509,6 @@ This commonly includes things such as: (process-release? *target*) ) ) - (none) ) :code (behavior () (local-vars (v1-5 symbol) (v1-51 symbol)) @@ -565,15 +555,14 @@ This commonly includes things such as: (set! v1-51 (or (not *target*) (process-release? *target*))) ) (go-virtual sunk) - (none) ) :post (the-as (function none :behavior tomb-stair-block) rider-post) ) (defstate moving (tomb-stair-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('cue-chase) (set-action! *gui-control* @@ -596,13 +585,11 @@ This commonly includes things such as: ) (set! (-> self camera-state) 0) 0 - (none) ) :exit (behavior () (remove-setting! 'entity-name) (remove-setting! 'interp-time) (remove-setting! 'string-startup-vector) - (none) ) :trans (behavior () (rider-trans) @@ -643,7 +630,6 @@ This commonly includes things such as: ) (lift-pool 0) (drop-pool 1) - (none) ) :code (behavior () (local-vars (v1-1 symbol)) @@ -669,15 +655,14 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior tomb-stair-block) rider-post) ) (defstate idle (tomb-stair-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('cue-chase) (set-action! *gui-control* @@ -723,7 +708,6 @@ This commonly includes things such as: ) ) ) - (none) ) :trans (behavior () (let ((f0-3 (seek (-> self root trans y) (+ -104448.0 (-> self initial-y)) 409.6))) @@ -733,7 +717,6 @@ This commonly includes things such as: (lift-pool 0) (drop-pool 1) (position-spikes 1500) - (none) ) :code (the-as (function none :behavior tomb-stair-block) sleep-code) :post (the-as (function none :behavior tomb-stair-block) transform-post) @@ -779,7 +762,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior tomb-stair-block) sleep-code) ) @@ -1053,7 +1035,6 @@ This commonly includes things such as: ) ) (set! (-> self speed) 0.0) - (none) ) :code (behavior () (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) @@ -1067,7 +1048,6 @@ This commonly includes things such as: (ja :num! (loop! (* 0.00007771238 (-> self speed)))) ) #f - (none) ) :post (behavior () (set! (-> self last-pos quad) (-> self basetrans quad)) @@ -1077,7 +1057,6 @@ This commonly includes things such as: ) ) (set! (-> self speed) (* (- (-> self last-pos y) (-> self basetrans y)) (-> self clock frames-per-second))) - (none) ) ) @@ -1338,8 +1317,8 @@ This commonly includes things such as: (defstate close (tomb-boulder-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('reset) (if (task-node-closed? (game-task-node tomb-poles-boulder)) (go-virtual close) @@ -1356,7 +1335,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -1369,7 +1347,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -1441,8 +1418,8 @@ This commonly includes things such as: (defstate hidden (tomb-plat-return) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger 'cue-chase) (go-virtual run-intro) ) @@ -1450,7 +1427,6 @@ This commonly includes things such as: ) :enter (behavior () (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior tomb-plat-return) sleep-code) ) @@ -1465,11 +1441,9 @@ This commonly includes things such as: (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) (set! (-> self path-pos) 0.0) (set-vector! (-> self root scale) 0.0 0.0 0.0 0.0) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (when (= (-> self path-pos) 1.0) @@ -1477,7 +1451,6 @@ This commonly includes things such as: (go-virtual waiting) ) (plat-trans) - (none) ) :code (the-as (function none :behavior tomb-plat-return) sleep-code) :post (behavior () @@ -1493,14 +1466,13 @@ This commonly includes things such as: (set-vector! (-> self root scale) f30-0 f30-0 f30-0 f30-0) ) (plat-post) - (none) ) ) (defstate waiting (tomb-plat-return) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (let ((v0-0 (the-as object (logior (-> self flags) (tomb-plat-flags topflags-0))))) (set! (-> self flags) (the-as tomb-plat-flags v0-0)) @@ -1508,14 +1480,13 @@ This commonly includes things such as: ) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) :enter (behavior () (set! (-> self ride-timer) (current-time)) (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) - (none) ) :trans (behavior () (logclear! (-> self flags) (tomb-plat-flags topflags-0)) @@ -1530,7 +1501,6 @@ This commonly includes things such as: ) (go-virtual running) ) - (none) ) :code (the-as (function none :behavior tomb-plat-return) sleep-code) :post (the-as (function none :behavior tomb-plat-return) plat-post) @@ -1538,8 +1508,8 @@ This commonly includes things such as: (defstate running (tomb-plat-return) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (let ((v0-0 (the-as object (logior (-> self flags) (tomb-plat-flags topflags-0))))) (set! (-> self flags) (the-as tomb-plat-flags v0-0)) @@ -1547,20 +1517,18 @@ This commonly includes things such as: ) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (if (= (-> self path-pos) (-> self dest-pos)) (go-virtual waiting-for-no-player) ) (plat-trans) - (none) ) :code (the-as (function none :behavior tomb-plat-return) sleep-code) :post (behavior () @@ -1573,14 +1541,13 @@ This commonly includes things such as: 'interp ) (plat-post) - (none) ) ) (defstate waiting-for-no-player (tomb-plat-return) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (let ((v0-0 (the-as object (current-time)))) (set! (-> self ride-timer) (the-as time-frame v0-0)) @@ -1588,7 +1555,7 @@ This commonly includes things such as: ) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -1605,7 +1572,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior tomb-plat-return) sleep-code) :post (the-as (function none :behavior tomb-plat-return) plat-post) @@ -1789,8 +1755,8 @@ This commonly includes things such as: (defstate idle (tomb-sphinx) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger 'cue-chase) (go-virtual active) ) @@ -1801,8 +1767,8 @@ This commonly includes things such as: (defstate active (tomb-sphinx) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('door-left) (set! (-> self move-dir) -1.0) (go-virtual doors-open) @@ -1815,7 +1781,6 @@ This commonly includes things such as: ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :code (behavior () (local-vars (sv-96 vector)) @@ -1870,7 +1835,6 @@ This commonly includes things such as: ) ) #f - (none) ) ) ) @@ -1879,7 +1843,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :code (behavior () (local-vars (sv-96 vector) (sv-112 vector)) @@ -1954,7 +1917,6 @@ This commonly includes things such as: ) ) #f - (none) ) ) ) diff --git a/goal_src/jak2/levels/tomb/tomb-water.gc b/goal_src/jak2/levels/tomb/tomb-water.gc index 8644d0bebdc..2cae289c1e4 100644 --- a/goal_src/jak2/levels/tomb/tomb-water.gc +++ b/goal_src/jak2/levels/tomb/tomb-water.gc @@ -64,8 +64,8 @@ (defstate idle (tomb-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('simon-done) (sound-play "simon-correct") ) @@ -95,7 +95,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior tomb-door) sleep-code) ) @@ -136,7 +135,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 time-frame)) (let ((s5-0 (current-time))) @@ -155,7 +153,6 @@ (ja :num! (seek!)) ) (sleep-code) - (none) ) ) @@ -247,8 +244,8 @@ This commonly includes things such as: (defstate idle (tomb-beetle-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('add-beetle) (set! (-> self beetle (-> self offset-index)) (process->handle proc)) (+! (-> self offset-index) 1) @@ -268,7 +265,6 @@ This commonly includes things such as: :code (the-as (function none :behavior tomb-beetle-door) sleep-code) :post (behavior () 0 - (none) ) ) @@ -313,7 +309,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 3) @@ -326,7 +321,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (sleep-code) - (none) ) :post (the-as (function none :behavior tomb-beetle-door) ja-post) ) @@ -547,13 +541,13 @@ This commonly includes things such as: (defstate going-down (tomb-beetle-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('get-round) (-> self round) ) (else - ((-> (method-of-type basebutton going-down) event) proc arg1 event-type event) + ((-> (method-of-type basebutton going-down) event) proc argc message block) ) ) ) @@ -564,30 +558,26 @@ This commonly includes things such as: ) ) (process-grab? *target* #f) - (none) ) ) (defstate down-idle (tomb-beetle-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'set-round) - (let ((v0-0 (the-as object (-> event param 0)))) - (set! (-> self round) (the-as uint v0-0)) - v0-0 - ) - ) - ((= v1-0 'door-open) - (remove-setting! 'gun) - (the-as object (remove-setting! 'entity-name)) - ) - (else - ((-> (method-of-type basebutton down-idle) event) proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('set-round) + (let ((v0-0 (the-as object (-> block param 0)))) + (set! (-> self round) (the-as uint v0-0)) + v0-0 + ) + ) + (('door-open) + (remove-setting! 'gun) + (remove-setting! 'entity-name) + ) + (else + ((-> (method-of-type basebutton down-idle) event) proc argc message block) + ) ) ) :trans (behavior () @@ -609,22 +599,21 @@ This commonly includes things such as: (tomb-beetle-button-method-39 self) ) ) - (none) ) ) (defstate going-up (tomb-beetle-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('set-round) - (let ((v0-0 (the-as object (-> event param 0)))) + (let ((v0-0 (the-as object (-> block param 0)))) (set! (-> self round) (the-as uint v0-0)) v0-0 ) ) (else - ((-> (method-of-type basebutton going-up) event) proc arg1 event-type event) + ((-> (method-of-type basebutton going-up) event) proc argc message block) ) ) ) @@ -632,19 +621,19 @@ This commonly includes things such as: (defstate up-idle (tomb-beetle-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('get-round) (-> self round) ) (('set-round) - (let ((v0-0 (the-as object (-> event param 0)))) + (let ((v0-0 (the-as object (-> block param 0)))) (set! (-> self round) (the-as uint v0-0)) v0-0 ) ) (else - ((-> (method-of-type basebutton up-idle) event) proc arg1 event-type event) + ((-> (method-of-type basebutton up-idle) event) proc argc message block) ) ) ) @@ -679,7 +668,6 @@ This commonly includes things such as: ) ) ) - (none) ) ) @@ -820,88 +808,83 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 4) ) -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 135] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 199] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 280] (defbehavior tomb-plat-simon-handler tomb-plat-simon ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('ready-index) - (tomb-plat-simon-method-24 self (the-as int (-> arg3 param 0))) - ) - (('plat-ridden) - (logior! (-> self flags) 1) - (when (= (-> arg3 param 0) (-> self plat-seq (+ (-> self plat-seq-count) -1))) - (when (-> self notify-actor) - (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) 'simon-done) - (let ((t9-1 send-event-function) - (v1-11 (-> self notify-actor)) - ) - (t9-1 - (if v1-11 - (-> v1-11 extra process) - ) - a1-2 - ) - ) - ) - (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) - (let ((v1-20 (-> *event-queue* data (-> *event-queue* length)))) - (+! (-> *event-queue* length) 1) - (set! (-> v1-20 form-handle) (process->handle self)) - (let ((a0-23 (-> self notify-actor))) - (set! (-> v1-20 to-handle) (process->handle (if a0-23 - (-> a0-23 extra process) - ) - ) - ) - ) - (set! (-> v1-20 num-params) 0) - (set! (-> v1-20 message) 'trigger) - ) - ) - ) - (sound-play "tomb-simon-fall") - (dotimes (s5-1 (-> self plat-count)) - (if (!= s5-1 (-> arg3 param 0)) - (send-event (handle->process (-> self plat s5-1)) 'die-unmaskable) - ) - ) - #f - ) - ) - (('finished) - (if (-> self button-handle) - (send-event (handle->process (-> self button-handle)) 'trigger) - ) - (dotimes (gp-1 (-> self plat-count)) - (send-event (handle->process (-> self plat gp-1)) 'die-unmaskable) - ) - (go-virtual dormant) - ) - (('die-but) - (if (-> self button-handle) - (send-event (handle->process (-> self button-handle)) 'untrigger) - ) - (sound-play "tomb-simon-fall") - (dotimes (s5-3 (-> self plat-count)) - (if (!= s5-3 (-> arg3 param 0)) - (send-event (handle->process (-> self plat s5-3)) 'die) - ) - ) - (go-virtual dormant) - ) + (case arg2 + (('ready-index) + (tomb-plat-simon-method-24 self (the-as int (-> arg3 param 0))) + ) + (('plat-ridden) + (logior! (-> self flags) 1) + (when (= (-> arg3 param 0) (-> self plat-seq (+ (-> self plat-seq-count) -1))) + (when (-> self notify-actor) + (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) 'simon-done) + (let ((t9-1 send-event-function) + (v1-11 (-> self notify-actor)) + ) + (t9-1 + (if v1-11 + (-> v1-11 extra process) ) - ) + a1-2 + ) + ) + ) + (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) + (let ((v1-20 (-> *event-queue* data (-> *event-queue* length)))) + (+! (-> *event-queue* length) 1) + (set! (-> v1-20 form-handle) (process->handle self)) + (let ((a0-23 (-> self notify-actor))) + (set! (-> v1-20 to-handle) (process->handle (if a0-23 + (-> a0-23 extra process) + ) + ) + ) + ) + (set! (-> v1-20 num-params) 0) + (set! (-> v1-20 message) 'trigger) + ) + ) + ) + (sound-play "tomb-simon-fall") + (dotimes (s5-1 (-> self plat-count)) + (if (!= s5-1 (-> arg3 param 0)) + (send-event (handle->process (-> self plat s5-1)) 'die-unmaskable) + ) + ) + #f + ) + ) + (('finished) + (if (-> self button-handle) + (send-event (handle->process (-> self button-handle)) 'trigger) + ) + (dotimes (gp-1 (-> self plat-count)) + (send-event (handle->process (-> self plat gp-1)) 'die-unmaskable) + ) + (go-virtual dormant) + ) + (('die-but) + (if (-> self button-handle) + (send-event (handle->process (-> self button-handle)) 'untrigger) + ) + (sound-play "tomb-simon-fall") + (dotimes (s5-3 (-> self plat-count)) + (if (!= s5-3 (-> arg3 param 0)) + (send-event (handle->process (-> self plat s5-3)) 'die) + ) + ) + (go-virtual dormant) + ) + ) ) (defstate dormant (tomb-plat-simon) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger 'cue-chase) (set! (-> self button-handle) (process->handle proc)) (go-virtual appear) @@ -993,7 +976,6 @@ This commonly includes things such as: (set! (-> self plat gp-2) (ppointer->handle s4-0)) ) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -1002,7 +984,6 @@ This commonly includes things such as: ) ) (go-virtual show-sequence) - (none) ) ) @@ -1013,7 +994,6 @@ This commonly includes things such as: (set! (-> self state-time) (+ (current-time) (seconds -1))) (set! (-> self plat-idx) 0) 0 - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 2)) @@ -1029,15 +1009,14 @@ This commonly includes things such as: (go-virtual idle) ) ) - (none) ) :code (the-as (function none :behavior tomb-plat-simon) sleep-code) ) (defstate idle (tomb-plat-simon) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger 'cue-chase) (dotimes (gp-0 (-> self plat-count)) (send-event (handle->process (-> self plat gp-0)) 'reset) @@ -1045,7 +1024,7 @@ This commonly includes things such as: (go-virtual show-sequence) ) (else - (tomb-plat-simon-handler proc arg1 event-type event) + (tomb-plat-simon-handler proc argc message block) ) ) ) @@ -1053,12 +1032,10 @@ This commonly includes things such as: (if (-> self button-handle) (send-event (handle->process (-> self button-handle)) 'untrigger) ) - (none) ) :code (the-as (function none :behavior tomb-plat-simon) sleep-code) :post (behavior () (debug-draw (-> self path)) - (none) ) ) @@ -1172,51 +1149,47 @@ This commonly includes things such as: (defstate idle (tomb-simon-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('reparent) - (change-parent self proc) - ) - (('blink) - (the-as object (set-blink-timers! self)) - ) - (('edge-grabbed) - (go-virtual dangerous) - ) - (('ridden 'bonk) - (let* ((gp-0 *target*) - (a0-12 (if (type? gp-0 process-focusable) - gp-0 - ) - ) - ) - (when a0-12 - (let ((v1-6 (get-trans a0-12 0)) - (a0-14 (-> self root trans)) - ) - (if (and (>= 8192.0 (fabs (- (-> v1-6 x) (-> a0-14 x)))) (>= 8192.0 (fabs (- (-> v1-6 z) (-> a0-14 z))))) - (go-virtual dangerous) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('reparent) + (change-parent self proc) + ) + (('blink) + (set-blink-timers! self) + ) + (('edge-grabbed) + (go-virtual dangerous) + ) + (('ridden 'bonk) + (let* ((gp-0 *target*) + (a0-12 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (when a0-12 + (let ((v1-6 (get-trans a0-12 0)) + (a0-14 (-> self root trans)) + ) + (if (and (>= 8192.0 (fabs (- (-> v1-6 x) (-> a0-14 x)))) (>= 8192.0 (fabs (- (-> v1-6 z) (-> a0-14 z))))) + (go-virtual dangerous) + ) ) ) ) - (('die 'die-unmaskable) - (go-virtual die) - ) - (('ready) - (go-virtual ready) - ) - ) + ) + (('die 'die-unmaskable) + (go-virtual die) + ) + (('ready) + (go-virtual ready) + ) ) ) :enter (behavior () (set! (-> self state-time) (current-time)) (logclear! (-> self flags) (simon-block-flags sbf0 sbf1 sbf2 sbf5)) (set! (-> self move-rate) 122880.0) - (none) ) :trans tomb-simon-block-trans :code (the-as (function none :behavior tomb-simon-block) sleep-code) @@ -1227,14 +1200,13 @@ This commonly includes things such as: (tomb-simon-block-post) (plat-post) ) - (none) ) ) (defstate dangerous (tomb-simon-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die-unmaskable) (go-virtual die) ) @@ -1281,7 +1253,6 @@ This commonly includes things such as: (logior! (-> self flags) (simon-block-flags sbf4)) (set! (-> self ride-timer) (current-time)) (send-event (ppointer->process (-> self parent)) 'die-but (-> self my-idx)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self ride-timer)) (seconds 1)) @@ -1289,7 +1260,6 @@ This commonly includes things such as: (go-virtual die) ) (plat-trans) - (none) ) :code (the-as (function none :behavior tomb-simon-block) sleep-code) :post tomb-simon-block-post @@ -1297,29 +1267,28 @@ This commonly includes things such as: (defstate ready (tomb-simon-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (start-bouncing! self)) - ) - (('reset) - (go-virtual idle) - ) - (('blink) - (the-as object (set-blink-timers! self)) - ) - (('die 'die-unmaskable) - (go-virtual die) - ) - (('ridden) - (send-event (ppointer->process (-> self parent)) 'plat-ridden (-> self my-idx)) - (if (!= (-> self next-idx) -1) - (send-event (ppointer->process (-> self parent)) 'ready-index (-> self next-idx)) - ) - (go-virtual ridden) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (start-bouncing! self) + ) + (('reset) + (go-virtual idle) + ) + (('blink) + (set-blink-timers! self) + ) + (('die 'die-unmaskable) + (go-virtual die) + ) + (('ridden) + (send-event (ppointer->process (-> self parent)) 'plat-ridden (-> self my-idx)) + (if (!= (-> self next-idx) -1) + (send-event (ppointer->process (-> self parent)) 'ready-index (-> self next-idx)) + ) + (go-virtual ridden) + ) + ) ) :trans tomb-simon-block-trans :code (the-as (function none :behavior tomb-simon-block) sleep-code) @@ -1328,32 +1297,30 @@ This commonly includes things such as: (defstate ridden (tomb-simon-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (start-bouncing! self)) - ) - (('reset) - (go-virtual idle) - ) - (('die-unmaskable) - (go-virtual die) - ) - (('die) - (go-virtual temporary) - ) - (('ridden) - (let ((v0-0 (the-as object (current-time)))) - (set! (-> self ride-timer) (the-as time-frame v0-0)) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (start-bouncing! self) + ) + (('reset) + (go-virtual idle) + ) + (('die-unmaskable) + (go-virtual die) + ) + (('die) + (go-virtual temporary) + ) + (('ridden) + (let ((v0-0 (the-as object (current-time)))) + (set! (-> self ride-timer) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) ) :enter (behavior () (set! (-> self ride-timer) (current-time)) - (none) ) :trans (behavior () (let* ((gp-0 *target*) @@ -1387,7 +1354,6 @@ This commonly includes things such as: ) ) (tomb-simon-block-trans) - (none) ) :code (the-as (function none :behavior tomb-simon-block) sleep-code) :post tomb-simon-block-post @@ -1395,33 +1361,31 @@ This commonly includes things such as: (defstate temporary (tomb-simon-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (start-bouncing! self)) - ) - (('reset) - (go-virtual idle) - ) - (('die-unmaskable) - (go-virtual die) - ) - (('ridden) - (when (not (logtest? (-> self flags) (simon-block-flags sbf2))) - (logior! (-> self flags) (simon-block-flags sbf2)) - (let ((v0-0 (the-as object (current-time)))) - (set! (-> self ride-timer) (the-as time-frame v0-0)) - v0-0 - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (start-bouncing! self) + ) + (('reset) + (go-virtual idle) + ) + (('die-unmaskable) + (go-virtual die) + ) + (('ridden) + (when (not (logtest? (-> self flags) (simon-block-flags sbf2))) + (logior! (-> self flags) (simon-block-flags sbf2)) + (let ((v0-0 (the-as object (current-time)))) + (set! (-> self ride-timer) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ) ) :enter (behavior () (logclear! (-> self flags) (simon-block-flags sbf0 sbf1 sbf2)) (set! (-> self draw color-mult quad) (-> self color quad)) - (none) ) :trans (behavior () (if (and (logtest? (-> self flags) (simon-block-flags sbf2)) @@ -1430,7 +1394,6 @@ This commonly includes things such as: (go-virtual wobble-die) ) (plat-trans) - (none) ) :code (the-as (function none :behavior tomb-simon-block) sleep-code) :post tomb-simon-block-post @@ -1438,8 +1401,8 @@ This commonly includes things such as: (defstate wobble-die (tomb-simon-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('reset) (go-virtual idle) ) @@ -1460,7 +1423,6 @@ This commonly includes things such as: ) (sound-play "tomb-simon-last") (go-virtual die) - (none) ) :post tomb-simon-block-post ) @@ -1481,13 +1443,11 @@ This commonly includes things such as: ) ) (cleanup-for-death self) - (none) ) :post (behavior () (set! (-> self root transv y) (- (-> self root transv y) (* (-> self move-rate) (seconds-per-frame)))) (+! (-> self root trans y) (-> self root transv y)) (transform-post) - (none) ) ) @@ -1579,8 +1539,8 @@ This commonly includes things such as: (defstate idle (tomb-simon-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual open #f) ) @@ -1594,7 +1554,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior tomb-simon-button) sleep-code) ) @@ -1605,7 +1564,6 @@ This commonly includes things such as: (let ((v1-2 (-> self entity extra perm))) (set! (-> v1-2 user-int8 0) 1) ) - (none) ) :trans (the-as (function none :behavior tomb-simon-button) rider-trans) :code (behavior ((arg0 symbol)) @@ -1628,18 +1586,17 @@ This commonly includes things such as: ) ) (go-virtual waiting) - (none) ) :post (the-as (function none :behavior tomb-simon-button) rider-post) ) (defstate waiting (tomb-simon-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('bonk 'touch) (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape (-> self root)) (the-as uint 1) ) @@ -1667,15 +1624,14 @@ This commonly includes things such as: :frame-num 0.0 ) (transform-post) - (none) ) :code (the-as (function none :behavior tomb-simon-button) sleep-code) ) (defstate pressed (tomb-simon-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go-virtual unpress) ) @@ -1711,7 +1667,6 @@ This commonly includes things such as: ) ) (sleep-code) - (none) ) ) @@ -1731,7 +1686,6 @@ This commonly includes things such as: (set! (-> v1-26 user-int8 0) 1) ) (go-virtual waiting) - (none) ) ) @@ -1910,13 +1864,12 @@ This commonly includes things such as: ) ) #f - (none) ) ) (defstate idle (tomb-vibe) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (let ((v1-0 (new 'static 'array int32 4 -1 0 0 0)) (gp-0 (new 'static 'array handle 2 (new 'static 'handle :process #xffffffff :pid #xffffffff :u64 #xffffffffffffffff) @@ -1924,9 +1877,9 @@ This commonly includes things such as: ) ) ) - (case event-type + (case message (('attack) - (case (-> (the-as attack-info (-> event param 1)) mode) + (case (-> (the-as attack-info (-> block param 1)) mode) (('flop 'spin 'punch) (cond ((and (= (-> v1-0 0) (-> self pat-tbl (-> self pat-index))) (!= (-> gp-0 0) (process->handle self))) @@ -1947,7 +1900,7 @@ This commonly includes things such as: (('set-pattern) (set! (-> v1-0 0) -1) (set! (-> gp-0 0) (the-as handle #f)) - (let ((v0-0 (the-as object (-> event param 0)))) + (let ((v0-0 (the-as object (-> block param 0)))) (set! (-> self pat-index) (the-as int v0-0)) v0-0 ) @@ -1966,7 +1919,6 @@ This commonly includes things such as: ) :trans (behavior () 0 - (none) ) :code (the-as (function none :behavior tomb-vibe) sleep-code) :post (behavior () @@ -1991,23 +1943,19 @@ This commonly includes things such as: ) ) ) - (none) ) ) (defstate vibrate (tomb-vibe) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('interrupt) - (the-as object (kill-persister *setting-control* (the-as engine-pers (process->ppointer self)) 'sound-tune)) - ) - (('die) - (go-virtual die #f) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('interrupt) + (kill-persister *setting-control* (the-as engine-pers (process->ppointer self)) 'sound-tune) + ) + (('die) + (go-virtual die #f) + ) ) ) :enter (behavior () @@ -2041,17 +1989,14 @@ This commonly includes things such as: ) ) ) - (none) ) :exit (behavior () (process-release? *target*) (kill-persister *setting-control* (the-as engine-pers (process->ppointer self)) 'sound-tune) (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) - (none) ) :trans (behavior () 0 - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -2089,7 +2034,6 @@ This commonly includes things such as: (go-virtual die #f) (go-virtual idle) ) - (none) ) :post (the-as (function none :behavior tomb-vibe) transform-post) ) @@ -2098,7 +2042,6 @@ This commonly includes things such as: :virtual #t :enter (behavior ((arg0 symbol)) (process-entity-status! self (entity-perm-status subtask-complete) #t) - (none) ) :code (behavior ((arg0 symbol)) (cond @@ -2160,7 +2103,6 @@ This commonly includes things such as: ) (label cfg-13) (sleep-code) - (none) ) ) @@ -2339,7 +2281,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask actor-pause)) ) ) - (none) ) :code (the-as (function none :behavior tomb-water-trap) sleep-code) ) @@ -2356,11 +2297,9 @@ This commonly includes things such as: ) ) ) - (none) ) :exit (behavior () (set-tombc-electricity-scale! 0.0) - (none) ) :trans (behavior () (when (-> self can-exit-running?) @@ -2370,7 +2309,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (until #f @@ -2443,12 +2381,10 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (update-vol! (-> self sound) (-> self volume)) (update! (-> self sound)) - (none) ) ) @@ -2668,8 +2604,8 @@ This commonly includes things such as: (defstate idle (tomb-smash-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger 'cue-chase) (set! (-> self button) (process->handle proc)) (go-virtual open) @@ -2683,7 +2619,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (-> self timeout)) @@ -2715,7 +2650,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 3) @@ -2728,7 +2662,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (sleep-code) - (none) ) ) @@ -2746,7 +2679,6 @@ This commonly includes things such as: ) (send-event (handle->process (-> self button)) 'untrigger) (go-virtual idle) - (none) ) ) diff --git a/goal_src/jak2/levels/tomb/widow-baron.gc b/goal_src/jak2/levels/tomb/widow-baron.gc index df61a87f1cf..54a62386bed 100644 --- a/goal_src/jak2/levels/tomb/widow-baron.gc +++ b/goal_src/jak2/levels/tomb/widow-baron.gc @@ -440,30 +440,28 @@ (defstate idle (baron-pod) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('frame) - (let ((v1-3 (ja-group))) - (when (not (and v1-3 (= v1-3 (-> self draw art-group data 4)))) - (ja :group! (-> self draw art-group data 4) :num! min) - (set! (-> self draw bounds w) 81920.0) - ) - ) - (when (and (< (ja-aframe-num 0) 834.0) (>= (the-as float (-> event param 0)) 834.0)) - (setup-masks (-> self draw) 4 2) - (set! (-> self has-stone) #t) - (the-as symbol (baron-pod-method-21 self #t)) - ) - ) - (('finale) - (the-as symbol (setup-masks (-> self draw) 8 0)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('frame) + (let ((v1-3 (ja-group))) + (when (not (and v1-3 (= v1-3 (-> self draw art-group data 4)))) + (ja :group! (-> self draw art-group data 4) :num! min) + (set! (-> self draw bounds w) 81920.0) + ) + ) + (when (and (< (ja-aframe-num 0) 834.0) (>= (the-as float (-> block param 0)) 834.0)) + (setup-masks (-> self draw) 4 2) + (set! (-> self has-stone) #t) + (baron-pod-method-21 self #t) + ) + ) + (('finale) + (setup-masks (-> self draw) 8 0) + ) + ) ) :trans (behavior () (baron-pod-method-21 self #f) - (none) ) :code (the-as (function none :behavior baron-pod) sleep-code) :post (the-as (function none :behavior baron-pod) transform-post) @@ -532,7 +530,6 @@ (cleanup-for-death self) (deactivate self) ) - (none) ) :code (the-as (function none :behavior tomb-boss-bridge) sleep-code) ) @@ -944,186 +941,182 @@ This commonly includes things such as: ) ) -;; WARN: Return type mismatch none vs object. (defbehavior widow-handler widow ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object) (sv-224 symbol) (sv-240 symbol) (sv-256 vector) (sv-272 matrix)) - (the-as - object - (case arg2 - (('attack) - (let ((v1-1 (the-as object (-> arg3 param 1)))) - (when (and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info v1-1) mask)) - (logtest? (penetrate dark-bomb) (-> (the-as attack-info v1-1) penetrate-using)) - (!= (-> self last-attack-id) (-> (the-as attack-info v1-1) id)) - ) - (set! (-> self last-attack-id) (-> (the-as attack-info v1-1) id)) - (send-event self 'bomb-hit (target-pos 0) 4) - (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-2 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 - (the-as part-tracker gp-2) - *entity-pool* - (symbol->string (-> part-tracker symbol)) - (the-as pointer #x70004000) - ) + (case arg2 + (('attack) + (let ((v1-1 (the-as object (-> arg3 param 1)))) + (when (and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info v1-1) mask)) + (logtest? (penetrate dark-bomb) (-> (the-as attack-info v1-1) penetrate-using)) + (!= (-> self last-attack-id) (-> (the-as attack-info v1-1) id)) + ) + (set! (-> self last-attack-id) (-> (the-as attack-info v1-1) id)) + (send-event self 'bomb-hit (target-pos 0) 4) + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-2 + (let ((t9-3 (method-of-type part-tracker activate))) + (t9-3 + (the-as part-tracker gp-2) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) ) - (let ((s5-0 run-function-in-process) - (s4-0 gp-2) - (s3-0 part-tracker-init) - (s2-0 (-> *part-group-id-table* 710)) - (s1-0 600) - (s0-0 #f) - ) - (set! sv-224 (the-as symbol #f)) - (set! sv-240 (the-as symbol #f)) - (set! sv-272 *launch-matrix*) - (set! sv-256 (-> sv-272 trans)) - (let ((v1-16 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 11)) quad))) - (set! (-> sv-256 quad) v1-16) + ) + (let ((s5-0 run-function-in-process) + (s4-0 gp-2) + (s3-0 part-tracker-init) + (s2-0 (-> *part-group-id-table* 710)) + (s1-0 600) + (s0-0 #f) ) - ((the-as (function object object object object object object object object none) s5-0) - s4-0 - s3-0 - s2-0 - s1-0 - s0-0 - sv-224 - sv-240 - sv-272 - ) + (set! sv-224 (the-as symbol #f)) + (set! sv-240 (the-as symbol #f)) + (set! sv-272 *launch-matrix*) + (set! sv-256 (-> sv-272 trans)) + (let ((v1-16 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 11)) quad))) + (set! (-> sv-256 quad) v1-16) ) - (-> gp-2 ppointer) + ((the-as (function object object object object object object object object none) s5-0) + s4-0 + s3-0 + s2-0 + s1-0 + s0-0 + sv-224 + sv-240 + sv-272 + ) ) + (-> gp-2 ppointer) ) ) ) ) - (('shot-hit-target) - (when (< (-> self last-gun-hit-stage) (-> self current-shoot-stage)) - (+! (-> self gun-hits) 1) - (set! v0-0 (-> self current-shoot-stage)) - (set! (-> self last-gun-hit-stage) (the-as int v0-0)) - v0-0 - ) - ) - (('bomb-kicked) - (set! v0-0 (+ (-> self kicked-bombs) 1)) - (set! (-> self kicked-bombs) (the-as int v0-0)) + ) + (('shot-hit-target) + (when (< (-> self last-gun-hit-stage) (-> self current-shoot-stage)) + (+! (-> self gun-hits) 1) + (set! v0-0 (-> self current-shoot-stage)) + (set! (-> self last-gun-hit-stage) (the-as int v0-0)) v0-0 ) - (('widow-get-center) - (-> self circle-center) - ) - (('debris-hit) - (when (< -819.2 (-> self osc vel y)) - (sound-play "wid-debris-hit") - (case (-> arg3 param 0) - ((1) - (set! (-> self osc vel y) (+ -3072.0 (-> self osc vel y))) - ) - ((2) - (set! (-> self osc vel y) (+ -2048.0 (-> self osc vel y))) - ) - ) + ) + (('bomb-kicked) + (set! v0-0 (+ (-> self kicked-bombs) 1)) + (set! (-> self kicked-bombs) (the-as int v0-0)) + v0-0 + ) + (('widow-get-center) + (-> self circle-center) + ) + (('debris-hit) + (when (< -819.2 (-> self osc vel y)) + (sound-play "wid-debris-hit") + (case (-> arg3 param 0) + ((1) + (set! (-> self osc vel y) (+ -3072.0 (-> self osc vel y))) + ) + ((2) + (set! (-> self osc vel y) (+ -2048.0 (-> self osc vel y))) + ) ) ) - (('catwalk-hit) - (let ((v1-26 (-> arg3 param 0))) - (when (and (> (the-as int v1-26) 0) (< (the-as int v1-26) 8)) - (let ((v1-28 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-28 from) (process->ppointer arg0)) - (set! (-> v1-28 num-params) arg1) - (set! (-> v1-28 message) arg2) - (set! (-> v1-28 param 0) (-> arg3 param 0)) - (set! (-> v1-28 param 1) (-> arg3 param 1)) - (set! (-> v1-28 param 2) (-> arg3 param 2)) - (set! (-> v1-28 param 3) (-> arg3 param 3)) - (set! (-> v1-28 param 4) (-> arg3 param 4)) - (set! (-> v1-28 param 5) (-> arg3 param 5)) - (send-event-function (handle->process (-> self catwalk 0)) v1-28) - ) + ) + (('catwalk-hit) + (let ((v1-26 (-> arg3 param 0))) + (when (and (> (the-as int v1-26) 0) (< (the-as int v1-26) 8)) + (let ((v1-28 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-28 from) (process->ppointer arg0)) + (set! (-> v1-28 num-params) arg1) + (set! (-> v1-28 message) arg2) + (set! (-> v1-28 param 0) (-> arg3 param 0)) + (set! (-> v1-28 param 1) (-> arg3 param 1)) + (set! (-> v1-28 param 2) (-> arg3 param 2)) + (set! (-> v1-28 param 3) (-> arg3 param 3)) + (set! (-> v1-28 param 4) (-> arg3 param 4)) + (set! (-> v1-28 param 5) (-> arg3 param 5)) + (send-event-function (handle->process (-> self catwalk 0)) v1-28) ) ) ) - (('child-jumped) - (set! v0-0 (logclear (-> (the-as spydroid arg0) enemy-flags) (enemy-flag alert))) - (set! (-> (the-as spydroid arg0) enemy-flags) (the-as enemy-flag v0-0)) - v0-0 + ) + (('child-jumped) + (set! v0-0 (logclear (-> (the-as spydroid arg0) enemy-flags) (enemy-flag alert))) + (set! (-> (the-as spydroid arg0) enemy-flags) (the-as enemy-flag v0-0)) + v0-0 + ) + (('bomb-hit) + (set! (-> self bomb-hits) (min 4 (+ (-> self bomb-hits) (-> arg3 param 1)))) + (let ((v1-33 (handle->process (-> self hud)))) + (if v1-33 + (set! (-> (the-as hud-widow v1-33) values 1 target) (/ (* 100 (- 4 (-> self bomb-hits))) 4)) + ) ) - (('bomb-hit) - (set! (-> self bomb-hits) (min 4 (+ (-> self bomb-hits) (-> arg3 param 1)))) - (let ((v1-33 (handle->process (-> self hud)))) - (if v1-33 - (set! (-> (the-as hud-widow v1-33) values 1 target) (/ (* 100 (- 4 (-> self bomb-hits))) 4)) - ) - ) - (when (and (not (-> self flying)) (< (-> self bomb-hits) 4)) - (let* ((s4-2 (-> arg3 param 0)) - (v0-9 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) - (s5-2 (-> self node-list data 3 bone transform)) - (s4-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (the-as vector s4-2) v0-9) 1.0)) - (f30-0 (vector-dot s4-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-2 vector 2) 1.0))) - (f28-0 - (vector-dot s4-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> s5-2 vector)) 1.0)) - ) + (when (and (not (-> self flying)) (< (-> self bomb-hits) 4)) + (let* ((s4-2 (-> arg3 param 0)) + (v0-9 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) + (s5-2 (-> self node-list data 3 bone transform)) + (s4-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (the-as vector s4-2) v0-9) 1.0)) + (f30-0 (vector-dot s4-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-2 vector 2) 1.0))) + (f28-0 + (vector-dot s4-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> s5-2 vector)) 1.0)) ) - (ja-channel-push! 1 (seconds 0.03)) - (set! (-> self drill-speed target) 0.0) - (cond - ((< (cos 5461.3335) f30-0) - (ja :group! (-> self draw art-group data 25) :num! min) - (setup-masks (-> self draw) 2 128) - ) - ((and (< (cos 8192.0) f30-0) (< 0.0 f28-0)) - (ja :group! (-> self draw art-group data 26) :num! min) - (setup-masks (-> self draw) 4 256) - ) - ((< (cos 8192.0) f30-0) - (ja :group! (-> self draw art-group data 27) :num! min) - (setup-masks (-> self draw) 8 512) ) - ((< 0.0 f28-0) - (ja :group! (-> self draw art-group data 23) :num! min) - (setup-masks (-> self draw) 16 1024) - ) - (else - (ja :group! (-> self draw art-group data 24) :num! min) - (setup-masks (-> self draw) 32 2048) - ) - ) - ) - ) - (when (-> self flying) + (ja-channel-push! 1 (seconds 0.03)) (set! (-> self drill-speed target) 0.0) (cond - ((>= (-> self bomb-hits) 4) - #f + ((< (cos 5461.3335) f30-0) + (ja :group! (-> self draw art-group data 25) :num! min) + (setup-masks (-> self draw) 2 128) ) - ((begin - (ja-channel-push! 1 (seconds 0.03)) - (let* ((gp-3 (-> arg3 param 0)) - (v0-28 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) - (s5-8 (-> self node-list data 3 bone transform)) - (f0-20 (vector-dot - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (the-as vector gp-3) v0-28) 1.0) - (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> s5-8 vector)) 1.0) - ) - ) - ) - (< 0.0 f0-20) - ) - ) - (ja :group! (-> self draw art-group data 37) :num! min) - (the-as object (setup-masks (-> self draw) 16 1024)) + ((and (< (cos 8192.0) f30-0) (< 0.0 f28-0)) + (ja :group! (-> self draw art-group data 26) :num! min) + (setup-masks (-> self draw) 4 256) + ) + ((< (cos 8192.0) f30-0) + (ja :group! (-> self draw art-group data 27) :num! min) + (setup-masks (-> self draw) 8 512) + ) + ((< 0.0 f28-0) + (ja :group! (-> self draw art-group data 23) :num! min) + (setup-masks (-> self draw) 16 1024) ) (else - (ja :group! (-> self draw art-group data 36) :num! min) - (the-as object (setup-masks (-> self draw) 32 2048)) + (ja :group! (-> self draw art-group data 24) :num! min) + (setup-masks (-> self draw) 32 2048) ) ) ) ) - ) + (when (-> self flying) + (set! (-> self drill-speed target) 0.0) + (cond + ((>= (-> self bomb-hits) 4) + #f + ) + ((begin + (ja-channel-push! 1 (seconds 0.03)) + (let* ((gp-3 (-> arg3 param 0)) + (v0-28 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) + (s5-8 (-> self node-list data 3 bone transform)) + (f0-20 (vector-dot + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (the-as vector gp-3) v0-28) 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> s5-8 vector)) 1.0) + ) + ) + ) + (< 0.0 f0-20) + ) + ) + (ja :group! (-> self draw art-group data 37) :num! min) + (setup-masks (-> self draw) 16 1024) + ) + (else + (ja :group! (-> self draw art-group data 36) :num! min) + (setup-masks (-> self draw) 32 2048) + ) + ) + ) + ) ) ) diff --git a/goal_src/jak2/levels/tomb/widow-extras.gc b/goal_src/jak2/levels/tomb/widow-extras.gc index 85dcaf332a8..bc1bebd62ce 100644 --- a/goal_src/jak2/levels/tomb/widow-extras.gc +++ b/goal_src/jak2/levels/tomb/widow-extras.gc @@ -148,14 +148,12 @@ ) ) ) - (none) ) :trans (behavior () (ja :num! (seek!)) (if (ja-done? 0) (deactivate self) ) - (none) ) :code (the-as (function none :behavior tomb-boss-catwalk) sleep-code) :post (the-as (function none :behavior tomb-boss-catwalk) ja-post) @@ -163,43 +161,42 @@ (defstate idle (tomb-boss-catwalk) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('catwalk-hit) - (when (zero? (-> self which-look)) - (case (-> event param 0) - ((1) - (the-as object (setup-masks (-> self draw) 0 1)) - ) - ((2) - (the-as object (setup-masks (-> self draw) 0 2)) - ) - ((3) - (the-as object (setup-masks (-> self draw) 0 4)) - ) - ((4) - (the-as object (setup-masks (-> self draw) 0 8)) - ) - ((5) - (the-as object (setup-masks (-> self draw) 0 16)) - ) - ((6) - (the-as object (setup-masks (-> self draw) 0 32)) - ) - ((7) - (the-as object (setup-masks (-> self draw) 0 64)) - ) - ) - ) - ) - (('green-hit) - (when (nonzero? (-> self which-look)) - (send-event (ppointer->process (-> self parent)) 'catwalk-hit (-> self which-look)) - (go-virtual shatter) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('catwalk-hit) + (when (zero? (-> self which-look)) + (case (-> block param 0) + ((1) + (setup-masks (-> self draw) 0 1) + ) + ((2) + (setup-masks (-> self draw) 0 2) + ) + ((3) + (setup-masks (-> self draw) 0 4) ) + ((4) + (setup-masks (-> self draw) 0 8) + ) + ((5) + (setup-masks (-> self draw) 0 16) + ) + ((6) + (setup-masks (-> self draw) 0 32) + ) + ((7) + (setup-masks (-> self draw) 0 64) + ) + ) + ) + ) + (('green-hit) + (when (nonzero? (-> self which-look)) + (send-event (ppointer->process (-> self parent)) 'catwalk-hit (-> self which-look)) + (go-virtual shatter) + ) + ) + ) ) :code (the-as (function none :behavior tomb-boss-catwalk) sleep-code) ) @@ -626,7 +623,6 @@ This commonly includes things such as: (none) ) -;; WARN: Return type mismatch object vs none. (defbehavior widow-bomb-handler widow-bomb ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v1-13 float)) (rlet ((acc :class vf) @@ -707,16 +703,16 @@ This commonly includes things such as: (f30-1 600.0) (v1-34 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-35 (the-as number (logior #x3f800000 v1-34))) + (v0-7 (the-as object (- gp-1 (the-as time-frame (the int (* f30-1 (+ -1.0 (the-as float v1-35)))))))) ) - (set! (-> self fizzle-timer) (- gp-1 (the-as time-frame (the int (* f30-1 (+ -1.0 (the-as float v1-35))))))) + (set! (-> self fizzle-timer) (the-as time-frame v0-7)) + v0-7 ) ) ) - (none) ) ) -;; WARN: Return type mismatch object vs none. (defbehavior widow-bomb-back-handler widow-bomb ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('impact-control) @@ -749,20 +745,20 @@ This commonly includes things such as: (f30-0 600.0) (v1-34 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-35 (the-as number (logior #x3f800000 v1-34))) + (v0-6 (the-as object (- gp-1 (the-as time-frame (the int (* f30-0 (+ -1.0 (the-as float v1-35)))))))) ) - (set! (-> self fizzle-timer) (- gp-1 (the-as time-frame (the int (* f30-0 (+ -1.0 (the-as float v1-35))))))) + (set! (-> self fizzle-timer) (the-as time-frame v0-6)) + v0-6 ) ) ) - (none) ) (defstate freefall (widow-bomb) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior widow-bomb) widow-bomb-back-handler) + :event widow-bomb-back-handler :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (and (nonzero? (-> self fizzle-timer)) (>= (- (current-time) (-> self fizzle-timer)) (seconds 3))) @@ -792,7 +788,6 @@ This commonly includes things such as: ) ) (ja :num! (loop!)) - (none) ) :code (the-as (function none :behavior widow-bomb) sleep-code) :post (the-as (function none :behavior widow-bomb) transform-post) @@ -800,7 +795,7 @@ This commonly includes things such as: (defstate back-atcha (widow-bomb) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior widow-bomb) widow-bomb-back-handler) + :event widow-bomb-back-handler :enter (behavior () (set! (-> self state-time) (current-time)) (initialize @@ -814,7 +809,6 @@ This commonly includes things such as: (logior! (-> v1-5 prim-core collide-with) (collide-spec enemy)) (logclear! (-> v1-5 prim-core collide-with) (collide-spec jak)) ) - (none) ) :trans (behavior () (if (and (nonzero? (-> self fizzle-timer)) (>= (- (current-time) (-> self fizzle-timer)) (seconds 3))) @@ -862,7 +856,6 @@ This commonly includes things such as: ) ) (ja :num! (loop!)) - (none) ) :code (the-as (function none :behavior widow-bomb) sleep-code) :post (the-as (function none :behavior widow-bomb) transform-post) @@ -893,7 +886,6 @@ This commonly includes things such as: 0 (sound-play "w-bomb-explode") (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (cond @@ -908,7 +900,6 @@ This commonly includes things such as: (deactivate self) ) ) - (none) ) :code (the-as (function none :behavior widow-bomb) sleep-code) :post (the-as (function none :behavior widow-bomb) ja-post) @@ -961,7 +952,7 @@ This commonly includes things such as: (defstate smoke (widow-bomb) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior widow-bomb) widow-bomb-handler) + :event widow-bomb-handler :enter (behavior () (set! (-> self state-time) (current-time)) (let* ((v1-2 3600) @@ -971,16 +962,13 @@ This commonly includes things such as: (set! (-> self next-countdown-tick) (the-as time-frame (- v1-3 (mod v1-3 (* a0-0 a0-0))))) ) (set! (-> self steam-sound) (new-sound-id)) - (none) ) :exit (behavior () (sound-stop (-> self steam-sound)) - (none) ) :trans (behavior () (widow-bomb-method-32 self) (ja :num! (loop!)) - (none) ) :code (the-as (function none :behavior widow-bomb) sleep-code) :post (the-as (function none :behavior widow-bomb) ja-post) @@ -1005,48 +993,42 @@ This commonly includes things such as: (defstate idle (widow-bomb) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as - object - (cond - ((or (= v1-0 'touch) (= v1-0 'bonk)) - (if (< (-> self which-trajectory) 2) - (send-event - *target* - 'attack - #f - (static-attack-info ((id (new-attack-id)) (shove-up (meters 1)) (shove-back (meters 3)))) - ) - ) - ) - ((= v1-0 'impact-control) - (if (and (!= proc self) (!= proc (-> self parent))) - (send-event proc 'bomb-hit (-> self root trans) 1) - ) - ) - ((= v1-0 'fizzle) - (let* ((gp-0 (current-time)) - (f30-0 600.0) - (v1-17 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-18 (the-as number (logior #x3f800000 v1-17))) - (v0-0 (the-as object (- gp-0 (the-as time-frame (the int (* f30-0 (+ -1.0 (the-as float v1-18)))))))) - ) - (set! (-> self fizzle-timer) (the-as time-frame v0-0)) - v0-0 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'bonk) + (if (< (-> self which-trajectory) 2) + (send-event + *target* + 'attack + #f + (static-attack-info ((id (new-attack-id)) (shove-up (meters 1)) (shove-back (meters 3)))) ) ) - (else - (the-as object (widow-bomb-handler proc arg1 event-type event)) - ) - ) + ) + (('impact-control) + (if (and (!= proc self) (!= proc (-> self parent))) + (send-event proc 'bomb-hit (-> self root trans) 1) + ) + ) + (('fizzle) + (let* ((gp-0 (current-time)) + (f30-0 600.0) + (v1-17 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-18 (the-as number (logior #x3f800000 v1-17))) + (v0-0 (the-as object (- gp-0 (the-as time-frame (the int (* f30-0 (+ -1.0 (the-as float v1-18)))))))) + ) + (set! (-> self fizzle-timer) (the-as time-frame v0-0)) + v0-0 + ) + ) + (else + (widow-bomb-handler proc argc message block) ) ) ) :enter (behavior () (set! (-> self state-time) (current-time)) (initialize (-> self impact) self 3 4096.0 (collide-spec backgnd obstacle hit-by-others-list player-list)) - (none) ) :exit (behavior () (when (nonzero? (-> self fizzle-timer)) @@ -1058,7 +1040,6 @@ This commonly includes things such as: (set! (-> self fizzle-timer) (- gp-0 (the-as time-frame (the int (* f30-0 (+ -1.0 (the-as float v1-5))))))) ) ) - (none) ) :trans (behavior () (let ((v1-0 (-> self which-trajectory))) @@ -1188,13 +1169,11 @@ This commonly includes things such as: ) ) (ja :num! (loop!)) - (none) ) :code (the-as (function none :behavior widow-bomb) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1342,34 +1321,33 @@ This commonly includes things such as: (defstate idle (heart-mar) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('frame) - (let ((v1-3 (ja-group))) - (when (not (and v1-3 (= v1-3 (-> self draw art-group data 3)))) - (ja :group! (-> self draw art-group data 3) :num! min) - (set! (-> self draw bounds w) 81920.0) - (setup-masks (-> self draw) 2 0) - ) - ) - (if (and (< (ja-aframe-num 0) 775.0) (>= (the-as float (-> event param 0)) 775.0)) - (setup-masks (-> self draw) 0 4) - ) - (if (>= (the-as float (-> event param 0)) 834.0) - (deactivate self) - ) - (set-tombboss-gem-light! (lerp-scale 1.0 0.0 (ja-aframe-num 0) 760.0 800.0)) - (ja :num-func num-func-identity :frame-num (ja-aframe (the-as float (-> event param 0)) 0)) - (let ((v0-9 (logclear (-> self mask) (process-mask sleep-code)))) - (set! (-> self mask) v0-9) - v0-9 - ) - ) - (('grab-done) - (the-as process-mask (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('frame) + (let ((v1-3 (ja-group))) + (when (not (and v1-3 (= v1-3 (-> self draw art-group data 3)))) + (ja :group! (-> self draw art-group data 3) :num! min) + (set! (-> self draw bounds w) 81920.0) + (setup-masks (-> self draw) 2 0) + ) + ) + (if (and (< (ja-aframe-num 0) 775.0) (>= (the-as float (-> block param 0)) 775.0)) + (setup-masks (-> self draw) 0 4) + ) + (if (>= (the-as float (-> block param 0)) 834.0) + (deactivate self) + ) + (set-tombboss-gem-light! (lerp-scale 1.0 0.0 (ja-aframe-num 0) 760.0 800.0)) + (ja :num-func num-func-identity :frame-num (ja-aframe (the-as float (-> block param 0)) 0)) + (let ((v0-9 (the-as object (logclear (-> self mask) (process-mask sleep-code))))) + (set! (-> self mask) (the-as process-mask v0-9)) + v0-9 + ) + ) + (('grab-done) + (deactivate self) + ) + ) ) :code (behavior () (until #f @@ -1378,7 +1356,6 @@ This commonly includes things such as: (ja-post) ) #f - (none) ) ) @@ -1503,7 +1480,6 @@ This commonly includes things such as: ) (tomb-boss-pillar-shrink-collision) (ja-post) - (none) ) :code (the-as (function none :behavior tomb-boss-pillar) sleep-code) ) @@ -1513,7 +1489,6 @@ This commonly includes things such as: :enter (behavior () (set! (-> self draw bounds w) 245760.0) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (< (- (current-time) (-> self state-time)) (seconds 1)) @@ -1533,7 +1508,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior tomb-boss-pillar) sleep-code) :post (the-as (function none :behavior tomb-boss-pillar) ja-post) @@ -1541,8 +1515,8 @@ This commonly includes things such as: (defstate idle (tomb-boss-pillar) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (let ((gp-0 proc)) (when (if (type? gp-0 widow-shot) @@ -1582,14 +1556,12 @@ This commonly includes things such as: ) 0 (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status bit-5)) (set! (-> v1-2 user-object 1) (-> self segs-shot)) ) - (none) ) :code (the-as (function none :behavior tomb-boss-pillar) sleep-code) ) @@ -1717,7 +1689,6 @@ This commonly includes things such as: ) (tomb-boss-firepot-shrink-collision) (ja-post) - (none) ) :code (the-as (function none :behavior tomb-boss-firepot) sleep-code) ) @@ -1764,14 +1735,12 @@ This commonly includes things such as: (-> gp-1 ppointer) ) ) - (none) ) :trans (behavior () (ja :num! (seek!)) (if (ja-done? 0) (go-virtual broken) ) - (none) ) :code (the-as (function none :behavior tomb-boss-firepot) sleep-code) :post (the-as (function none :behavior tomb-boss-firepot) ja-post) @@ -1779,14 +1748,14 @@ This commonly includes things such as: (defstate idle (tomb-boss-firepot) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (let ((gp-0 proc)) (when (if (type? gp-0 widow-shot) (the-as widow-shot gp-0) ) - (let ((v1-2 (the-as object (-> event param 1))) + (let ((v1-2 (the-as object (-> block param 1))) (gp-1 (new 'stack-no-clear 'vector)) ) (cond @@ -1794,7 +1763,7 @@ This commonly includes things such as: (set! (-> gp-1 quad) (-> (the-as attack-info v1-2) attacker-velocity quad)) ) (else - (let* ((a3-1 (the-as object (-> event param 0))) + (let* ((a3-1 (the-as object (-> block param 0))) (a1-4 (-> (the-as touching-shapes-entry a3-1) head)) ) (get-intersect-point gp-1 a1-4 (-> self root) (the-as touching-shapes-entry a3-1)) @@ -1823,7 +1792,6 @@ This commonly includes things such as: (set! (-> v1-3 prim-core collide-with) (collide-spec)) ) 0 - (none) ) :code (the-as (function none :behavior tomb-boss-firepot) sleep-code) ) diff --git a/goal_src/jak2/levels/tomb/widow-more-extras.gc b/goal_src/jak2/levels/tomb/widow-more-extras.gc index db0b26c76fd..ee38c61c58a 100644 --- a/goal_src/jak2/levels/tomb/widow-more-extras.gc +++ b/goal_src/jak2/levels/tomb/widow-more-extras.gc @@ -80,20 +80,18 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (behavior () (suspend) (suspend) 0 - (none) ) ) (defstate idle (tomb-boss-debris) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched 'touch 'attack) (let ((v1-2 (-> self look))) (cond @@ -219,7 +217,6 @@ ) :enter (behavior () (set! (-> self sound-floor) 81920.0) - (none) ) :trans (behavior () (local-vars (sv-16 float)) @@ -276,7 +273,6 @@ ) (set-vector! (-> self draw color-mult) f30-1 f30-1 f30-1 1.0) ) - (none) ) :code (the-as (function none :behavior tomb-boss-debris) sleep-code) :post (behavior () @@ -287,7 +283,6 @@ (set! (-> a1-0 tlist) *touching-list*) (find-overlapping-shapes (-> self root) a1-0) ) - (none) ) ) @@ -459,7 +454,6 @@ :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (spawn (-> self part) (-> self root trans)) @@ -471,15 +465,14 @@ ) (set! (-> self state-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.1 0.5))))) ) - (none) ) :code (the-as (function none :behavior cave-in-master) sleep-code) ) (defstate wait (cave-in-master) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('start) (go-virtual idle) ) diff --git a/goal_src/jak2/levels/under/centipede.gc b/goal_src/jak2/levels/under/centipede.gc index 3e767b183ea..4f1bfbf4837 100644 --- a/goal_src/jak2/levels/under/centipede.gc +++ b/goal_src/jak2/levels/under/centipede.gc @@ -755,7 +755,6 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) @@ -764,7 +763,6 @@ (set! (-> v1-5 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :code (the-as (function none :behavior centipede) sleep-code) ) @@ -773,7 +771,6 @@ :virtual #t :exit (behavior () (set-chan1-effects self) - (none) ) :code (behavior () (logior! (-> self enemy-flags) (enemy-flag chase-startup)) @@ -799,7 +796,6 @@ (suspend) ) #f - (none) ) ) @@ -816,7 +812,6 @@ (logior! (-> self enemy-flags) (enemy-flag chase-startup)) (vector-reset! (-> self root transv)) (set! (-> self desired-talking-volume) 1.0) - (none) ) :exit (behavior () (set-chan1-effects self) @@ -825,7 +820,6 @@ (t9-1) ) ) - (none) ) :code (behavior () (until #f @@ -844,7 +838,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior centipede) nav-enemy-simple-post) ) @@ -862,7 +855,6 @@ (logior! (-> self enemy-flags) (enemy-flag chase-startup)) (vector-reset! (-> self root transv)) (set! (-> self desired-talking-volume) 1.0) - (none) ) :exit (behavior () (set-chan1-effects self) @@ -871,7 +863,6 @@ (t9-1) ) ) - (none) ) :code (-> (method-of-type centipede idle) code) :post (-> (method-of-type centipede idle) post) @@ -890,7 +881,6 @@ (logior! (-> self enemy-flags) (enemy-flag chase-startup)) (vector-reset! (-> self root transv)) (set! (-> self desired-talking-volume) 1.0) - (none) ) :exit (behavior () (set-chan1-effects self) @@ -899,7 +889,6 @@ (t9-1) ) ) - (none) ) :code (-> (method-of-type centipede idle) code) ) @@ -914,7 +903,6 @@ ) (stop-looking-at-target! self) (set! (-> self desired-talking-volume) 1.0) - (none) ) :exit (behavior () (set-chan1-effects self) @@ -923,7 +911,6 @@ (t9-1) ) ) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.5)) @@ -941,7 +928,6 @@ (if (target-close? self) (go-virtual attack) ) - (none) ) :code (the-as (function none :behavior centipede) sleep-code) :post (behavior () @@ -961,7 +947,6 @@ ) ) (nav-enemy-method-176 self) - (none) ) ) @@ -975,7 +960,6 @@ ) (stop-looking-at-target! self) (set! (-> self desired-talking-volume) 1.0) - (none) ) :exit (behavior () (set-chan1-effects self) @@ -984,19 +968,16 @@ (t9-1) ) ) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 2)) (react-to-focus self) ) - (none) ) :code (the-as (function none :behavior centipede) sleep-code) :post (behavior () (centipede-method-188 self) (nav-enemy-method-176 self) - (none) ) ) @@ -1067,11 +1048,9 @@ ) (quaternion-copy! (-> self src-quat) (-> self root quat)) (quaternion-copy! (-> self dest-quat) (-> self src-quat)) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (when (-> self grabbed-focus?) @@ -1086,7 +1065,6 @@ ) ) ) - (none) ) :code (behavior () (local-vars (a1-5 event-message-block)) @@ -1123,12 +1101,10 @@ ) ) (go-hostile self) - (none) ) :post (behavior () (transform-post) (centipede-method-183 self) - (none) ) ) @@ -1136,7 +1112,6 @@ :virtual #t :exit (behavior () (set-chan1-effects self) - (none) ) :code (behavior () (set! (-> self state-time) (current-time)) @@ -1155,7 +1130,6 @@ (suspend) ) (go-hostile self) - (none) ) :post (-> (method-of-type centipede attack) post) ) @@ -1171,11 +1145,9 @@ (nav-enemy-method-167 self) (vector-reset! (-> self root transv)) (set! (-> self desired-talking-volume) 1.0) - (none) ) :exit (behavior () (set-chan1-effects self) - (none) ) :code (behavior () (logior! (-> self focus-status) (focus-status disable)) @@ -1198,11 +1170,9 @@ (logior! (-> self draw status) (draw-control-status no-draw)) (cleanup-for-death self) (sleep-code) - (none) ) :post (behavior () (centipede-method-183 self) - (none) ) ) diff --git a/goal_src/jak2/levels/under/jellyfish.gc b/goal_src/jak2/levels/under/jellyfish.gc index 68285e73b12..5a70f91db68 100644 --- a/goal_src/jak2/levels/under/jellyfish.gc +++ b/goal_src/jak2/levels/under/jellyfish.gc @@ -370,7 +370,6 @@ (hover-nav-control-method-10 (-> self hover) gp-1 s5-2 (the-as vector #t)) ) (set! (-> self restart-fly-anims) #t) - (none) ) :trans (behavior () (local-vars (a0-8 vector) (gp-2 vector)) @@ -391,13 +390,11 @@ (set! (-> self path-stare-u) (get-norm! (-> self sync) 0)) (go-virtual stare) ) - (none) ) :code (the-as (function none :behavior jellyfish) hover-enemy-fly-code) :post (behavior () (debug-draw (-> self path)) (hover-enemy-dest-post) - (none) ) ) @@ -429,7 +426,6 @@ ) (set! (-> self charge-path-timer) 0) (look-at-target! self (enemy-flag lock-focus)) - (none) ) :trans (behavior () (local-vars (gp-0 vector)) @@ -462,12 +458,10 @@ (go-virtual threaten) ) ) - (none) ) :post (behavior () (hover-nav-control-method-11 (-> self hover) (-> self stare-pos)) (hover-enemy-dest-post) - (none) ) ) @@ -476,15 +470,12 @@ :event (the-as (function process int symbol event-message-block object :behavior jellyfish) enemy-event-handler) :enter (behavior () (set! *jellyfish-mech-reserved* #t) - (none) ) :exit (behavior () (set! *jellyfish-mech-reserved* #f) - (none) ) :trans (behavior () (seek! (-> self tentacle-blend) 0.0 (seconds-per-frame)) - (none) ) :code (behavior () (set! (-> self restart-fly-anims) #t) @@ -515,12 +506,10 @@ ) ) ) - (none) ) :post (behavior () (hover-nav-control-method-11 (-> self hover) (the-as vector #f)) (hover-enemy-dest-post) - (none) ) ) @@ -539,7 +528,6 @@ ) (logior! (-> self focus-status) (focus-status dangerous)) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (hover-nav-control-method-14 (-> self hover) 1.0 1.0) @@ -549,7 +537,6 @@ ) (hover-nav-control-method-20 (-> self hover)) (set! *jellyfish-mech-reserved* #f) - (none) ) :trans (behavior () (let ((gp-0 (-> self root trans))) @@ -567,7 +554,6 @@ ) ) ) - (none) ) :code (behavior () (ja-no-eval :group! jellyfish-notice-charge-ja @@ -589,7 +575,6 @@ ) ) #f - (none) ) :post (behavior () (let* ((gp-0 (-> self root trans)) @@ -611,7 +596,6 @@ ) (hover-nav-control-method-11 (-> self hover) (-> self charge-pos)) (hover-enemy-dest-post) - (none) ) ) @@ -632,7 +616,6 @@ ) ) ) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) @@ -645,7 +628,6 @@ (initialize-chain-joints (-> self tentacles gp-0)) ) (set! *jellyfish-mech-reserved* #f) - (none) ) :trans (behavior () (let ((gp-0 *target*)) @@ -662,7 +644,6 @@ ) ) ) - (none) ) :code (behavior () (dotimes (gp-0 3) @@ -748,7 +729,6 @@ ) (set! (-> self last-attack-time) (current-time)) (go-virtual active) - (none) ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -764,7 +744,6 @@ ) ) (enemy-simple-post) - (none) ) ) @@ -814,7 +793,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior jellyfish) enemy-falling-post) ) @@ -843,7 +821,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) diff --git a/goal_src/jak2/levels/under/pipe-grunt.gc b/goal_src/jak2/levels/under/pipe-grunt.gc index 9da0421da3f..b51c894d5cc 100644 --- a/goal_src/jak2/levels/under/pipe-grunt.gc +++ b/goal_src/jak2/levels/under/pipe-grunt.gc @@ -21,10 +21,8 @@ ) -;; WARN: Return type mismatch object vs none. (defmethod go-ambush pipe-grunt ((obj pipe-grunt)) (go (method-of-object obj ambush)) - (none) ) (defmethod pipe-grunt-method-186 pipe-grunt ((obj pipe-grunt)) @@ -74,7 +72,6 @@ (vector-normalize! gp-0 (get-rand-float-range self -4096.0 4096.0)) (move-by-vector! (-> self root) gp-0) ) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -90,7 +87,6 @@ ) ) ) - (none) ) :code (behavior () (let ((f30-0 (get-rand-float-range self 0.9 1.1))) @@ -109,7 +105,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior pipe-grunt) nav-enemy-simple-post) ) diff --git a/goal_src/jak2/levels/under/sig5-course.gc b/goal_src/jak2/levels/under/sig5-course.gc index 3ec056073ec..51e730265f9 100644 --- a/goal_src/jak2/levels/under/sig5-course.gc +++ b/goal_src/jak2/levels/under/sig5-course.gc @@ -342,12 +342,10 @@ (logior! (-> self bot-flags) (bot-flags bf11 bf18)) (logior! (-> self root penetrated-by) (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot)) (look-at-target! self (enemy-flag lock-focus)) - (none) ) :exit (behavior () (logclear! (-> self bot-flags) (bot-flags bf18)) (set! (-> self root penetrated-by) (get-penetrate-info self)) - (none) ) :trans (behavior () (if (focus-test? self grabbed) @@ -358,7 +356,6 @@ (bot-method-222 self (get-trans (the-as process-focusable a0-1) 3)) ) ) - (none) ) :code (behavior () (until #f @@ -422,7 +419,6 @@ (logior! (-> self bot-flags) (bot-flags bf18)) ) #f - (none) ) :post (the-as (function none :behavior sig-under) nav-enemy-simple-post) ) diff --git a/goal_src/jak2/levels/under/under-laser.gc b/goal_src/jak2/levels/under/under-laser.gc index edcc67884d7..f9f91bf443b 100644 --- a/goal_src/jak2/levels/under/under-laser.gc +++ b/goal_src/jak2/levels/under/under-laser.gc @@ -163,7 +163,6 @@ (let ((f0-3 (vector-vector-distance (math-camera-pos) (-> self root trans)))) (set! (-> self root scale x) (lerp-scale 0.5 3.5 f0-3 32768.0 245760.0)) ) - (none) ) :code (the-as (function none :behavior under-laser-shadow) sleep-code) :post (the-as (function none :behavior under-laser-shadow) ja-post) @@ -211,7 +210,6 @@ (set! (-> a0-1 trans quad) (-> (the-as under-laser v1-0) root trans quad)) (vector+! (-> a0-1 trans) (-> a0-1 trans) (-> (the-as under-laser v1-0) slave-trans-offset)) ) - (none) ) :code (the-as (function none :behavior under-laser-slave) sleep-code) :post (the-as (function none :behavior under-laser-slave) ja-post) @@ -289,17 +287,14 @@ :virtual #t :enter (behavior () (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :trans (behavior () (if (not (script-eval (the-as pair (-> self draw-test-script)))) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior under-laser) sleep-code) ) @@ -326,7 +321,6 @@ (process-spawn under-laser-shadow (-> self info) gp-1 s5-0 :to self) ) (update-vol! (-> self sound) 1.0) - (none) ) :code (the-as (function none :behavior under-laser) sleep-code) :post (behavior () @@ -365,7 +359,6 @@ (update! (-> self sound)) (under-laser-method-22 self) (ja-post) - (none) ) ) diff --git a/goal_src/jak2/levels/under/under-obs.gc b/goal_src/jak2/levels/under/under-obs.gc index 2b3867a96f5..1dde163072d 100644 --- a/goal_src/jak2/levels/under/under-obs.gc +++ b/goal_src/jak2/levels/under/under-obs.gc @@ -305,15 +305,14 @@ (if (send-event (ppointer->process *underb-master*) 'query 'bubbler) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior bubbler) sleep-code) ) (defstate idle (bubbler) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go-virtual idle) ) @@ -355,7 +354,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior bubbler) sleep-code) ) @@ -439,7 +437,6 @@ This commonly includes things such as: (send-event (ppointer->process *underb-master*) 'request 'big-room 'under-plat 'up #t) ) 0 - (none) ) :trans (behavior () (rider-trans) @@ -450,7 +447,6 @@ This commonly includes things such as: (go-virtual idle-up) ) (set! (-> self ridden) #f) - (none) ) :code (the-as (function none :behavior under-rise-plat) sleep-code) :post (the-as (function none :behavior under-rise-plat) rider-post) @@ -462,7 +458,6 @@ This commonly includes things such as: :enter (behavior () (logior! (-> self mask) (process-mask actor-pause)) 0 - (none) ) :trans (behavior () (rider-trans) @@ -477,7 +472,6 @@ This commonly includes things such as: (go-virtual going-down) ) ) - (none) ) :code (the-as (function none :behavior under-rise-plat) sleep-code) :post (the-as (function none :behavior under-rise-plat) rider-post) @@ -493,7 +487,6 @@ This commonly includes things such as: (send-event (ppointer->process *underb-master*) 'request 'big-room 'under-plat 'up #f) ) 0 - (none) ) :trans (behavior () (rider-trans) @@ -506,7 +499,6 @@ This commonly includes things such as: (set! (-> gp-0 trans y) (-> self down-y)) ) ) - (none) ) :code (the-as (function none :behavior under-rise-plat) sleep-code) :post (the-as (function none :behavior under-rise-plat) rider-post) @@ -519,7 +511,6 @@ This commonly includes things such as: (set! (-> self rider-started) #f) (set! (-> self ridden) #f) 0 - (none) ) :trans (behavior () (rider-trans) @@ -530,7 +521,6 @@ This commonly includes things such as: (go-virtual idle-down) ) (set! (-> self ridden) #f) - (none) ) :code (the-as (function none :behavior under-rise-plat) sleep-code) :post (the-as (function none :behavior under-rise-plat) rider-post) @@ -542,7 +532,6 @@ This commonly includes things such as: :enter (behavior () (logior! (-> self mask) (process-mask actor-pause)) 0 - (none) ) :trans (behavior () (rider-trans) @@ -561,7 +550,6 @@ This commonly includes things such as: (go-virtual going-up) ) ) - (none) ) :code (the-as (function none :behavior under-rise-plat) sleep-code) :post (the-as (function none :behavior under-rise-plat) rider-post) @@ -575,7 +563,6 @@ This commonly includes things such as: (set! (-> self root transv y) 20480.0) (set! (-> self ridden) #f) 0 - (none) ) :trans (behavior () (rider-trans) @@ -597,7 +584,6 @@ This commonly includes things such as: (set! (-> gp-0 trans y) (-> self up-y)) ) ) - (none) ) :code (the-as (function none :behavior under-rise-plat) sleep-code) :post (the-as (function none :behavior under-rise-plat) rider-post) @@ -684,10 +670,10 @@ This commonly includes things such as: (defstate idle (under-buoy-base) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (case (-> (the-as attack-info (-> event param 1)) mode) + (case (-> (the-as attack-info (-> block param 1)) mode) (('mech-punch 'crush) (let ((a0-5 (ppointer->process (-> self parent)))) (send-event a0-5 'base-hit) @@ -705,7 +691,6 @@ This commonly includes things such as: ) :enter (behavior () 0 - (none) ) :trans (behavior () (when (-> self release) @@ -715,7 +700,6 @@ This commonly includes things such as: (go-virtual opened) ) ) - (none) ) :code (the-as (function none :behavior under-buoy-base) sleep-code) :post (the-as (function none :behavior under-buoy-base) ja-post) @@ -725,7 +709,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (none) ) :code (the-as (function none :behavior under-buoy-base) sleep-code) :post (the-as (function none :behavior under-buoy-base) ja-post) @@ -813,13 +796,11 @@ This commonly includes things such as: :virtual #t :enter (behavior () 0 - (none) ) :trans (behavior () (let ((v1-0 (ppointer->process (-> self parent)))) (set! (-> self root trans quad) (-> (the-as process-drawable v1-0) root trans quad)) ) - (none) ) :code (the-as (function none :behavior under-buoy-chain) sleep-code) :post (the-as (function none :behavior under-buoy-chain) ja-post) @@ -1016,10 +997,10 @@ This commonly includes things such as: (defstate waiting (under-buoy-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (case (-> (the-as attack-info (-> event param 1)) mode) + (case (-> (the-as attack-info (-> block param 1)) mode) (('mech-punch 'crush) (go-virtual running) ) @@ -1032,7 +1013,6 @@ This commonly includes things such as: ) :enter (behavior () 0 - (none) ) :code (the-as (function none :behavior under-buoy-plat) sleep-code) :post (the-as (function none :behavior under-buoy-plat) ja-post) @@ -1048,7 +1028,6 @@ This commonly includes things such as: (sound-play "break-chain") (send-event (ppointer->process (-> self base)) 'release) (process-entity-status! self (entity-perm-status subtask-complete) #t) - (none) ) :code (behavior () (until #f @@ -1062,11 +1041,9 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (rigid-body-object-method-37 self) - (none) ) ) @@ -1296,22 +1273,20 @@ This commonly includes things such as: (activate! *camera-smush-control* 819.2 37 210 1.0 0.995 (-> self clock)) (ja-channel-set! 0) (ja-post) - (none) ) :trans (behavior () (when (not (-> self child)) (cleanup-for-death self) (deactivate self) ) - (none) ) :code (the-as (function none :behavior under-mine) sleep-code) ) (defstate idle (under-mine) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'bonk 'touched) (go-virtual explode) ) @@ -1386,7 +1361,6 @@ This commonly includes things such as: ) (update (-> self chain) self) ) - (none) ) ) :code (the-as (function none :behavior under-mine) sleep-code) @@ -1399,7 +1373,6 @@ This commonly includes things such as: (set! (-> self chain-initialized) #t) (initialize-chain-joints (-> self chain)) ) - (none) ) ) @@ -1564,7 +1537,6 @@ This commonly includes things such as: (under-lift-method-49 self #t) (set-setting! 'jump #f 0.0 0) ) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type elevator running) post))) @@ -1573,7 +1545,6 @@ This commonly includes things such as: ) ) (sound-play "under-lift-lp" :id (-> self sound-id) :position (-> self root trans)) - (none) ) ) @@ -1593,7 +1564,6 @@ This commonly includes things such as: (under-lift-method-49 self #f) (remove-setting! 'jump) ) - (none) ) ) @@ -1677,13 +1647,13 @@ For example for an elevator pre-compute the distance between the first and last (defstate idle (under-break-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual hit #f) ) (('attack) - (case (-> (the-as attack-info (-> event param 1)) mode) + (case (-> (the-as attack-info (-> block param 1)) mode) (('mech-punch 'crush) (go-virtual hit #f) ) @@ -1710,7 +1680,6 @@ For example for an elevator pre-compute the distance between the first and last (suspend) ) #f - (none) ) ) @@ -1718,7 +1687,6 @@ For example for an elevator pre-compute the distance between the first and last :virtual #t :exit (behavior () (ja-abort-spooled-anim (the-as spool-anim (-> self anim)) (the-as art-joint-anim #f) -1) - (none) ) :code (behavior ((arg0 symbol)) (set! (-> self draw force-lod) 0) @@ -1751,7 +1719,6 @@ For example for an elevator pre-compute the distance between the first and last (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior under-break-door) ja-post) ) @@ -1873,7 +1840,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () 0 - (none) ) :code (behavior () (until #f @@ -1887,7 +1853,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior under-seaweed-a) ja-post) ) @@ -1978,7 +1943,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () 0 - (none) ) :code (behavior () (until #f @@ -1992,7 +1956,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior under-seaweed-b) ja-post) ) @@ -2037,7 +2000,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () 0 - (none) ) :code (behavior () (until #f @@ -2051,7 +2013,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior under-seaweed-c) ja-post) ) @@ -2096,7 +2057,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () 0 - (none) ) :code (behavior () (until #f @@ -2110,7 +2070,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior under-seaweed-d) ja-post) ) diff --git a/goal_src/jak2/levels/under/under-shoot-block.gc b/goal_src/jak2/levels/under/under-shoot-block.gc index 7fac7aa8212..dba209f33db 100644 --- a/goal_src/jak2/levels/under/under-shoot-block.gc +++ b/goal_src/jak2/levels/under/under-shoot-block.gc @@ -1237,7 +1237,6 @@ :event under-block-event-handler :enter (behavior () (logclear! (-> self flags) (under-block-flags unbflags-0)) - (none) ) :code (the-as (function none :behavior under-block) sleep-code) ) @@ -1267,7 +1266,6 @@ ) (rider-post) (go-virtual idle) - (none) ) ) @@ -1292,7 +1290,6 @@ (rider-post) (go-virtual waiting) 0 - (none) ) ) @@ -1302,7 +1299,6 @@ :enter (behavior () (logior! (-> self flags) (under-block-flags unbflags-0)) (under-block-method-41 self 'active) - (none) ) :code (the-as (function none :behavior under-block) sleep-code) ) @@ -1313,15 +1309,12 @@ :enter (behavior () (logior! (-> self flags) (under-block-flags unbflags-0)) (under-block-method-41 self 'active) - (none) ) :exit (behavior () (logclear! (-> self flags) (under-block-flags unbflags-0)) - (none) ) :trans (behavior () (under-block-method-45 self) - (none) ) :code (the-as (function none :behavior under-block) sleep-code) ) @@ -1335,15 +1328,12 @@ (+! (-> self col) (-> self move-dir-x)) (+! (-> self row) (-> self move-dir-z)) (under-block-method-48 self (-> self col) (-> self row)) - (none) ) :exit (behavior () (under-block-method-46 self (-> self prev-col) (-> self prev-row)) - (none) ) :trans (behavior () (under-block-method-45 self) - (none) ) :code (behavior () (local-vars (at-0 int)) @@ -1422,7 +1412,6 @@ ) ) #f - (none) ) ) ) @@ -1432,7 +1421,6 @@ :event under-block-event-handler :trans (behavior () (under-block-method-45 self) - (none) ) :code (behavior () (sound-play "und-block-knock") @@ -1512,7 +1500,6 @@ ) ) #f - (none) ) ) @@ -1521,11 +1508,9 @@ :event under-block-event-handler :enter (behavior () (logclear! (-> self flags) (under-block-flags unbflags-0)) - (none) ) :trans (behavior () (under-block-method-45 self) - (none) ) :code (behavior () (set! (-> self state-time) (current-time)) @@ -1541,7 +1526,6 @@ ) ) (go-virtual sunk-partially) - (none) ) ) @@ -1550,7 +1534,6 @@ :event under-block-event-handler :trans (behavior () (under-block-method-45 self) - (none) ) :code (the-as (function none :behavior under-block) sleep-code) ) @@ -1560,7 +1543,6 @@ :event under-block-event-handler :trans (behavior () (under-block-method-45 self) - (none) ) :code (behavior () (set! (-> self state-time) (current-time)) @@ -1577,7 +1559,6 @@ ) ) (go-virtual beaten) - (none) ) ) @@ -1587,7 +1568,6 @@ :enter (behavior () (logclear! (-> self flags) (under-block-flags unbflags-0)) (under-block-method-41 self 'beaten) - (none) ) :code (the-as (function none :behavior under-block) sleep-code) ) @@ -1599,11 +1579,9 @@ (logclear! (-> self flags) (under-block-flags unbflags-0)) (logclear! (-> self mask) (process-mask actor-pause)) (under-block-method-41 self 'fall) - (none) ) :trans (behavior () (under-block-method-45 self) - (none) ) :code (behavior () (set! (-> self state-time) (current-time)) @@ -1620,7 +1598,6 @@ ) ) (go-virtual explode) - (none) ) :post (behavior () (let ((gp-0 (-> self root))) @@ -1641,7 +1618,6 @@ ) ) (ja-post) - (none) ) ) @@ -1663,7 +1639,6 @@ (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) (set-vector! (-> self draw color-emissive) 0.0 0.0 0.0 1.0) (send-event (ppointer->process (-> self my-parent)) 'explode (-> self spawner-id)) - (none) ) :code (behavior () (sound-play "und-block-explo") @@ -1677,7 +1652,6 @@ (while (-> self child) (suspend) ) - (none) ) ) @@ -2142,7 +2116,6 @@ ) ) 0 - (none) ) :code (the-as (function none :behavior under-shoot-block) sleep-code) ) @@ -2169,7 +2142,6 @@ (go-virtual victory) ) ) - (none) ) :code (the-as (function none :behavior under-shoot-block) sleep-code) ) @@ -2211,7 +2183,6 @@ ) ) (go-virtual beaten) - (none) ) ) diff --git a/goal_src/jak2/levels/under/under-sig-obs.gc b/goal_src/jak2/levels/under/under-sig-obs.gc index 10fb6eb6471..062e7edb2f5 100644 --- a/goal_src/jak2/levels/under/under-sig-obs.gc +++ b/goal_src/jak2/levels/under/under-sig-obs.gc @@ -139,7 +139,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> v1-4 prim-core collide-with) (collide-spec)) ) 0 - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) @@ -147,7 +146,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :trans (behavior () (when (not (script-eval (the-as pair (-> self draw-test-script)))) @@ -155,116 +153,112 @@ For example for an elevator pre-compute the distance between the first and last #t (go-virtual plat-path-active) ) - (none) ) :code (the-as (function none :behavior under-plat-shoot) sleep-code) ) (defstate plat-path-active (under-plat-shoot) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('bonk) - (the-as object (start-bouncing! self)) - ) - (('attack) - (when (zero? (-> self state-flip)) - (let ((s5-0 (the-as object (-> event param 1)))) - (when (!= (-> (the-as attack-info s5-0) id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> (the-as attack-info s5-0) id)) - (let* ((gp-0 proc) - (s4-0 (if (type? gp-0 process-drawable) - gp-0 - ) - ) - ) - (when s4-0 - (let* ((s3-0 (-> (the-as process-drawable s4-0) root)) - (gp-1 (if (type? (the-as collide-shape s3-0) collide-shape) - s3-0 - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (start-bouncing! self) + ) + (('attack) + (when (zero? (-> self state-flip)) + (let ((s5-0 (the-as object (-> block param 1)))) + (when (!= (-> (the-as attack-info s5-0) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info s5-0) id)) + (let* ((gp-0 proc) + (s4-0 (if (type? gp-0 process-drawable) + gp-0 + ) ) - (when gp-1 - (when (logtest? (-> (the-as collide-shape gp-1) root-prim prim-core collide-as) (collide-spec projectile)) - (when (zero? (-> self state-flip)) - (sound-play "mtn-plat-flip1") - (set! (-> self state-flip) (the-as uint 1)) - ) - (if (= (-> (find-offending-process-focusable s4-0 (the-as attack-info s5-0)) type) target) - (set! (-> self time-flip) (the-as uint 1140)) - (set! (-> self time-flip) (the-as uint 570)) - ) - (set! (-> self hint-count) -1.0) - (vector-! (-> self axe-flip) (-> gp-1 trans) (-> self root trans)) - (set! (-> self axe-flip y) 0.0) - (vector-normalize! (-> self axe-flip) 1.0) - (vector-rotate90-around-y! (-> self axe-flip) (-> self axe-flip)) - (set! (-> self angle-flip-vel) -10.0) - (set! (-> self state-time) (current-time)) + ) + (when s4-0 + (let* ((s3-0 (-> (the-as process-drawable s4-0) root)) + (gp-1 (if (type? (the-as collide-shape s3-0) collide-shape) + s3-0 + ) + ) + ) + (when gp-1 + (when (logtest? (-> (the-as collide-shape gp-1) root-prim prim-core collide-as) (collide-spec projectile)) + (when (zero? (-> self state-flip)) + (sound-play "mtn-plat-flip1") + (set! (-> self state-flip) (the-as uint 1)) ) + (if (= (-> (find-offending-process-focusable s4-0 (the-as attack-info s5-0)) type) target) + (set! (-> self time-flip) (the-as uint 1140)) + (set! (-> self time-flip) (the-as uint 570)) + ) + (set! (-> self hint-count) -1.0) + (vector-! (-> self axe-flip) (-> gp-1 trans) (-> self root trans)) + (set! (-> self axe-flip y) 0.0) + (vector-normalize! (-> self axe-flip) 1.0) + (vector-rotate90-around-y! (-> self axe-flip) (-> self axe-flip)) + (set! (-> self angle-flip-vel) -10.0) + (set! (-> self state-time) (current-time)) ) ) ) ) - #f ) + #f ) ) ) - (('hint) - (when (>= (-> self hint-count) 0.0) - (+! (-> self hint-count) (seconds-per-frame)) - (if (< 6.0 (-> self hint-count)) - #f - ) - ) - ) - (('track) - (cond - ((-> event param 0) - (if (zero? (-> self state-flip)) - #t - 'abort - ) - ) - ((and *target* - (-> self disable-track-under) - (< (-> *target* control trans y) (+ -20480.0 (-> self root trans y))) - ) - #f - ) - (else - (zero? (-> self state-flip)) + ) + (('hint) + (when (>= (-> self hint-count) 0.0) + (+! (-> self hint-count) (seconds-per-frame)) + (if (< 6.0 (-> self hint-count)) + #f ) + ) + ) + (('track) + (cond + ((-> block param 0) + (if (zero? (-> self state-flip)) + #t + 'abort + ) + ) + ((and *target* + (-> self disable-track-under) + (< (-> *target* control trans y) (+ -20480.0 (-> self root trans y))) + ) + #f + ) + (else + (zero? (-> self state-flip)) ) ) - (('centipede) - (when (not (and (-> self next-state) (let ((v1-39 (-> self next-state name))) - (or (= v1-39 'die-falling) (= v1-39 'empty-state)) - ) - ) - ) - (vector-reset! (-> self root transv)) - (let* ((gp-2 proc) - (a0-11 (if (type? (the-as process-focusable gp-2) process-focusable) - gp-2 - ) - ) + ) + (('centipede) + (when (not (and (-> self next-state) (let ((v1-39 (-> self next-state name))) + (or (= v1-39 'die-falling) (= v1-39 'empty-state)) + ) + ) ) - (when a0-11 - (vector-! (-> self root transv) (-> self root trans) (get-trans (the-as process-focusable a0-11) 0)) - (set! (-> self root transv y) 0.0) - (vector-normalize! (-> self root transv) 163840.0) - (set! (-> self root transv y) 20480.0) - ) + (vector-reset! (-> self root transv)) + (let* ((gp-2 proc) + (a0-11 (if (type? (the-as process-focusable gp-2) process-focusable) + gp-2 + ) + ) + ) + (when a0-11 + (vector-! (-> self root transv) (-> self root trans) (get-trans (the-as process-focusable a0-11) 0)) + (set! (-> self root transv y) 0.0) + (vector-normalize! (-> self root transv) 163840.0) + (set! (-> self root transv y) 20480.0) ) - (go-virtual die-falling) ) + (go-virtual die-falling) ) - ) + ) ) ) :enter (behavior () @@ -276,7 +270,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> self dest-angle) 180.0) (set! (-> self on-shake) #f) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> self time-flip))) @@ -332,7 +325,6 @@ For example for an elevator pre-compute the distance between the first and last (t9-12) ) ) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type plat plat-path-active) post))) @@ -340,7 +332,6 @@ For example for an elevator pre-compute the distance between the first and last ((the-as (function none) t9-0)) ) ) - (none) ) ) @@ -354,7 +345,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> v1-7 prim-core collide-with) (collide-spec)) ) 0 - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 1)) @@ -368,7 +358,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (none) ) :code (behavior () (let ((f30-0 (rand-vu-float-range 0.5 0.8))) @@ -399,7 +388,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) #f - (none) ) :post (behavior () (let ((v1-0 (-> self root))) @@ -414,7 +402,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) (ja-post) - (none) ) ) @@ -481,17 +468,14 @@ otherwise, [[plat::34]] (defstate idle (under-break-floor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (when (logtest? (-> (the-as attack-info (-> event param 1)) penetrate-using) (penetrate flop)) - (go-virtual die) - #f - ) + :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 (the-as (function none :behavior under-break-floor) sleep-code) @@ -506,7 +490,6 @@ otherwise, [[plat::34]] ) 0 (process-entity-status! self (entity-perm-status subtask-complete) #t) - (none) ) :code (behavior () ((lambda () @@ -540,7 +523,6 @@ otherwise, [[plat::34]] (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior under-break-floor) ja-post) ) @@ -549,7 +531,6 @@ otherwise, [[plat::34]] :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -645,7 +626,6 @@ This commonly includes things such as: :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -761,7 +741,6 @@ This commonly includes things such as: (ja :group! (-> self draw art-group data 3) :num! min) (transform-post) (sleep-code) - (none) ) ) @@ -769,7 +748,6 @@ This commonly includes things such as: :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -874,8 +852,8 @@ This commonly includes things such as: (defstate idle-closed (under-int-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual open) ) @@ -900,7 +878,6 @@ This commonly includes things such as: ) (logclear! (-> self skel status) (joint-control-status sync-math)) (go-virtual idle-open) - (none) ) :post (the-as (function none :behavior under-int-door) transform-post) ) @@ -1030,7 +1007,6 @@ This commonly includes things such as: :trans (behavior () (plat-trans) (vector-lerp! (-> self root trans) (-> self move-start) (-> self move-end) (get-norm! (-> self sync) 0)) - (none) ) :code (the-as (function none :behavior under-plat-long) sleep-code) :post (the-as (function none :behavior under-plat-long) plat-post) @@ -1155,22 +1131,19 @@ This commonly includes things such as: (defstate active (under-plat-wall) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (the-as (function none :behavior under-plat-wall) rider-trans) :code (behavior () @@ -1200,7 +1173,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior under-plat-wall) rider-post) ) @@ -1329,8 +1301,8 @@ This commonly includes things such as: (defstate intro-shooting (under-pipe-growls) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('sig-shot) (when (>= (-> self volume) 0.6) (when (nonzero? (-> self approach-sound-id)) @@ -1384,7 +1356,6 @@ This commonly includes things such as: (set! (-> self volume) 0.0) (set! (-> self desired-volume) 1.0) (set! (-> self volume-seek-speed) (rand-vu-float-range 0.5 0.2)) - (none) ) :code (the-as (function none :behavior under-pipe-growls) sleep-code) :post (the-as (function none :behavior under-pipe-growls) under-pipe-growls-post) @@ -1392,8 +1363,8 @@ This commonly includes things such as: (defstate block-puzzle (under-pipe-growls) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('fade) (go-virtual block-puzzle-fade) ) @@ -1403,7 +1374,6 @@ This commonly includes things such as: (set! (-> self volume) 0.25) (set! (-> self desired-volume) 1.0) (set! (-> self volume-seek-speed) 0.8) - (none) ) :code (behavior () (sound-play "grunt-notice" :vol 40 :position (target-pos 0)) @@ -1433,7 +1403,6 @@ This commonly includes things such as: ) (sound-play "grunt-notice" :vol 200 :position (target-pos 0)) (sleep-code) - (none) ) :post (the-as (function none :behavior under-pipe-growls) under-pipe-growls-post) ) @@ -1443,14 +1412,12 @@ This commonly includes things such as: :enter (behavior () (set! (-> self desired-volume) 0.0) (set! (-> self volume-seek-speed) 0.5) - (none) ) :trans (behavior () (when (= (-> self volume) (-> self desired-volume)) (cleanup-for-death self) (go empty-state) ) - (none) ) :code (the-as (function none :behavior under-pipe-growls) sleep-code) :post (the-as (function none :behavior under-pipe-growls) under-pipe-growls-post) diff --git a/goal_src/jak2/levels/under/underb-master.gc b/goal_src/jak2/levels/under/underb-master.gc index 6cb765a582f..4e76f9ecf7a 100644 --- a/goal_src/jak2/levels/under/underb-master.gc +++ b/goal_src/jak2/levels/under/underb-master.gc @@ -39,8 +39,8 @@ (defstate idle (under-warp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die-fast) (set-under-fog-interp! 0.0) (go-virtual die-fast) @@ -67,12 +67,10 @@ ) ) #f - (none) ) :post (behavior () (under-warp-method-22 self) (ja-post) - (none) ) ) @@ -435,13 +433,11 @@ :event underb-master-event-handler :enter (behavior () 0 - (none) ) :trans (behavior () (if (-> self big-room-entered) (go-virtual big-room-player-under) ) - (none) ) :code (the-as (function none :behavior underb-master) sleep-code) :post underb-master-post @@ -452,7 +448,6 @@ :event underb-master-event-handler :enter (behavior () 0 - (none) ) :trans (behavior () (if (-> self under-plat-player-on) @@ -461,7 +456,6 @@ (if (not (-> self big-room-entered)) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior underb-master) sleep-code) :post underb-master-post @@ -473,11 +467,9 @@ :enter (behavior () (set-setting! 'entity-name "camera-239" 0.0 0) (send-event (ppointer->process *underb-master*) 'request 'under-warp #f) - (none) ) :exit (behavior () (remove-setting! 'entity-name) - (none) ) :trans (behavior () (let ((gp-0 (target-pos 0))) @@ -488,7 +480,6 @@ (go-virtual big-room-player-falling) ) ) - (none) ) :code (the-as (function none :behavior underb-master) sleep-code) :post underb-master-post @@ -500,13 +491,11 @@ :enter (behavior () (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 600.0 0) (remove-setting! 'mode-name) - (none) ) :trans (behavior () (if (< (-> (target-pos 0) y) -245760.0) (go-virtual big-room-player-falling) ) - (none) ) :code (the-as (function none :behavior underb-master) sleep-code) :post underb-master-post @@ -517,13 +506,11 @@ :event underb-master-event-handler :enter (behavior () (set-setting! 'mode-name 'cam-endlessfall 0.0 0) - (none) ) :exit (behavior () (send-event (ppointer->process *underb-master*) 'request 'under-warp #t) (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) (remove-setting! 'mode-name) - (none) ) :trans (behavior () (cond @@ -541,7 +528,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior underb-master) sleep-code) :post underb-master-post @@ -555,18 +541,15 @@ (set-setting! 'entity-name "camera-244" 0.0 0) (set! (-> self big-room-timer) (current-time)) (send-event (ppointer->process *underb-master*) 'request 'under-warp #t) - (none) ) :exit (behavior () (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 600.0 0) (remove-setting! 'entity-name) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self big-room-timer)) (seconds 1)) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior underb-master) sleep-code) :post underb-master-post @@ -577,7 +560,6 @@ :event underb-master-event-handler :enter (behavior () (go-virtual idle) - (none) ) :code (the-as (function none :behavior underb-master) sleep-code) :post underb-master-post @@ -666,17 +648,15 @@ (defstate startup (under-locking) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('test) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('test) + #f + ) + ) ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (let ((v1-0 (-> self actor-group))) @@ -759,19 +739,18 @@ ) ) ) - (none) ) :code (the-as (function none :behavior under-locking) sleep-code) ) (defstate active (under-locking) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('test) (let ((v1-1 (-> self mode))) (cond - ((-> event param 0) + ((-> block param 0) (when (or (= v1-1 (under-locking-mode want-mech)) (= v1-1 (under-locking-mode want-exit-mech))) (let ((a0-4 *target*)) (and a0-4 (not (logtest? (focus-status mech) (-> a0-4 focus-status)))) @@ -860,7 +839,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior under-locking) sleep-code) ) @@ -878,7 +856,6 @@ 0 ) ) - (none) ) :trans (behavior () (when (and (zero? (-> self state-time)) @@ -923,7 +900,6 @@ ) ) ) - (none) ) :code (behavior () (while (zero? (-> self state-time)) @@ -971,7 +947,6 @@ (suspend) ) #f - (none) ) ) @@ -984,7 +959,6 @@ ) (set! (-> self state-time) 0) 0 - (none) ) :trans (behavior () (when (and (zero? (-> self state-time)) @@ -1024,7 +998,6 @@ ) ) ) - (none) ) :code (behavior () (while (zero? (-> self state-time)) @@ -1073,7 +1046,6 @@ (suspend) ) #f - (none) ) ) diff --git a/goal_src/jak2/pc/damage-number.gc b/goal_src/jak2/pc/damage-number.gc index 41d3cab7635..6d83a871c36 100644 --- a/goal_src/jak2/pc/damage-number.gc +++ b/goal_src/jak2/pc/damage-number.gc @@ -52,8 +52,7 @@ ;; now center (we could do this earlier but it's fine) (-! (-> self font origin x) (/ (-> self font width) 2)) ;; now move it up - (-! (-> self font origin y) (-> self y-ofs)) - (none)) + (-! (-> self font origin y) (-> self y-ofs))) :code (behavior () (let ((state-time (current-time))) @@ -354,9 +353,7 @@ (+ (/ (-> self trans-2d y) 16) -1855 (the int (-> self height)))) (set-depth! (-> self font) (/ (-> self trans-2d z) 16)) ;; now center (we could do this earlier but it's fine) - (-! (-> self font origin x) (/ (-> self width) 2)) - - (none)) + (-! (-> self font origin x) (/ (-> self width) 2))) :code (behavior () (while (and (handle->process (-> self owner)) (not (case (-> (handle->process (-> self owner)) next-state name) (('inactive 'hidden) #t)))) diff --git a/goal_src/jak2/pc/debug/anim-tester-x.gc b/goal_src/jak2/pc/debug/anim-tester-x.gc index a137ff4d0e3..6b96cbc9755 100644 --- a/goal_src/jak2/pc/debug/anim-tester-x.gc +++ b/goal_src/jak2/pc/debug/anim-tester-x.gc @@ -470,7 +470,7 @@ (when (!= *master-mode* 'menu) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> self root trans) *color-white*) ) - (none)) + ) :code (behavior () (let diff --git a/goal_src/jak2/pc/debug/vag-player.gc b/goal_src/jak2/pc/debug/vag-player.gc index c834392509f..45a17a1fe29 100644 --- a/goal_src/jak2/pc/debug/vag-player.gc +++ b/goal_src/jak2/pc/debug/vag-player.gc @@ -193,7 +193,7 @@ :code (behavior () (sleep-code) - (none)) + ) ) @@ -251,7 +251,7 @@ (set! *gui-kick-str* (-> self gui-kick-str)) (if (!= (-> self master-mode) 'menu) (set-master-mode (-> self master-mode))) - (none)) + ) :code (behavior ((index int)) (set! (-> self vag-index) index) @@ -331,7 +331,7 @@ ) (go vag-player-idle) - (none)) + ) ) diff --git a/goal_src/jak2/pc/subtitle2.gc b/goal_src/jak2/pc/subtitle2.gc index 321a194bd19..6d7a2aa4b00 100644 --- a/goal_src/jak2/pc/subtitle2.gc +++ b/goal_src/jak2/pc/subtitle2.gc @@ -635,8 +635,7 @@ (set! (-> self movie-mode?) #f) (clear-queue self)) ) - - (none)) + ) :post (behavior () @@ -667,7 +666,7 @@ :exit (behavior () (unless (= (-> self next-state name) 'subtitle2-debug-checking-lines) (process-mask-set! (-> self mask) pause)) - (none)) + ) :trans (behavior () @@ -745,8 +744,7 @@ (set-master-mode 'game) (go subtitle2-process) ) - - (none)) + ) :code (-> subtitle2-process code) :post (behavior () @@ -771,7 +769,7 @@ (set! (-> self have-minimap?) #f) (set! (-> self have-subtitles?) #f) (setup-subtitle2-font (-> self font)) - (none)) + ) :code (behavior () (protect ((-> *pc-settings* subtitle-speaker?)) diff --git a/goalc/compiler/Env.cpp b/goalc/compiler/Env.cpp index 8d117aeb701..09c3a10ba21 100644 --- a/goalc/compiler/Env.cpp +++ b/goalc/compiler/Env.cpp @@ -254,7 +254,7 @@ RegVal* FunctionEnv::make_ireg(const TypeSpec& ts, RegClass reg_class) { IRegister ireg; ireg.reg_class = reg_class; ireg.id = m_iregs.size(); - auto rv = std::make_unique(ireg, coerce_to_reg_type(ts)); + auto rv = std::make_unique(ireg, ts); m_iregs.push_back(std::move(rv)); ASSERT(reg_class != RegClass::INVALID); return m_iregs.back().get(); diff --git a/goalc/compiler/compilation/ControlFlow.cpp b/goalc/compiler/compilation/ControlFlow.cpp index ca576f2c467..e900d90a678 100644 --- a/goalc/compiler/compilation/ControlFlow.cpp +++ b/goalc/compiler/compilation/ControlFlow.cpp @@ -187,8 +187,8 @@ Val* Compiler::compile_cond(const goos::Object& form, const goos::Object& rest, std::vector case_result_types; for_each_in_list(rest, [&](const goos::Object& o) { - auto test = pair_car(o); - auto clauses = pair_cdr(o); + const auto& test = pair_car(o); + const auto& clauses = pair_cdr(o); if (got_else) { throw_compiler_error(form, "Cond from cannot have any cases after else."); @@ -228,12 +228,14 @@ Val* Compiler::compile_cond(const goos::Object& form, const goos::Object& rest, // CODE Val* case_result = get_none(); + const goos::Object* case_clause = nullptr; for_each_in_list(clauses, [&](const goos::Object& clause) { case_result = compile_error_guard(clause, env); - if (!dynamic_cast(case_result)) { - case_result = case_result->to_reg(clause, env); - } + case_clause = &clause; }); + if (case_clause && !dynamic_cast(case_result)) { + case_result = case_result->to_reg(*case_clause, env); + } case_result_types.push_back(case_result->type()); if (!is_none(case_result)) { @@ -251,15 +253,24 @@ Val* Compiler::compile_cond(const goos::Object& form, const goos::Object& rest, }); if (!got_else) { - // if no else, clause, return #f. But don't retype. todo what does goal do here? + // if no else clause, return #f. auto get_false = std::make_unique(result, "#f"); env->emit(form, std::move(get_false)); } if (case_result_types.empty()) { + // completely empty cond result->set_type(TypeSpec("none")); } else { - result->set_type(coerce_to_reg_type(m_ts.lowest_common_ancestor(case_result_types))); + auto lca = m_ts.lowest_common_ancestor(case_result_types); + if (!got_else && lca == TypeSpec("none")) { + // least common ancestor was none, but there is still the #f from the missing else case. + // elevate cond to an `object` overall so we can capture that #f! + // (`object` is the direct ancestor of `none` and the ancestor to all types overall) + // TODO : what does goal do here? + lca = TypeSpec("object"); + } + result->set_type(coerce_to_reg_type(lca)); } // maybe use 128-bit register diff --git a/goalc/compiler/compilation/Define.cpp b/goalc/compiler/compilation/Define.cpp index c482633b145..ddfd21b5710 100644 --- a/goalc/compiler/compilation/Define.cpp +++ b/goalc/compiler/compilation/Define.cpp @@ -105,17 +105,19 @@ Val* Compiler::compile_define_extern(const goos::Object& form, const goos::Objec auto new_type = parse_typespec(typespec, env); auto existing_type = m_symbol_types.find(symbol_string(sym)); + // symbol already declared, and doesn't match existing definition. do more checks... if (existing_type != m_symbol_types.end() && existing_type->second != new_type) { if (m_allow_inconsistent_definition_symbols.find(symbol_string(sym)) == m_allow_inconsistent_definition_symbols.end()) { - if (m_throw_on_define_extern_redefinition) { + // throw if we have throws enabled, and new definition is NOT just more generic + // (that case is fine in goal) + if (!m_ts.tc(new_type, existing_type->second) && m_throw_on_define_extern_redefinition) { throw_compiler_error(form, "define-extern would redefine the type of symbol {} from {} to {}.", symbol_string(sym), existing_type->second.print(), new_type.print()); } else { print_compiler_warning( - "[Warning] define-extern has redefined the type of symbol {}\npreviously: {}\nnow: " - "{}\n", + "define-extern has redefined the type of symbol {}\npreviously: {}\nnow: {}\n", symbol_string(sym).c_str(), existing_type->second.print().c_str(), new_type.print().c_str()); } diff --git a/goalc/compiler/compilation/Function.cpp b/goalc/compiler/compilation/Function.cpp index b342927bc5b..4458c53c2b8 100644 --- a/goalc/compiler/compilation/Function.cpp +++ b/goalc/compiler/compilation/Function.cpp @@ -255,13 +255,12 @@ Val* Compiler::compile_lambda(const goos::Object& form, const goos::Object& rest if (new_func_env->is_asm_func) { // don't add return automatically! lambda_ts.add_arg(new_func_env->asm_func_return_type); - } else if (result && !dynamic_cast(result)) { + } else if (result && !dynamic_cast(result) && result->type() != TypeSpec("none")) { // got a result, so to_gpr it and return it. RegVal* final_result; emitter::Register ret_hw_reg = emitter::gRegInfo.get_gpr_ret_reg(); - if (result->type() != TypeSpec("none") && - m_ts.lookup_type(result->type())->get_load_size() == 16) { + if (m_ts.lookup_type(result->type())->get_load_size() == 16) { ret_hw_reg = emitter::gRegInfo.get_xmm_ret_reg(); final_result = result->to_xmm128(form, new_func_env.get()); return_reg->change_class(RegClass::INT_128); diff --git a/goalc/compiler/compilation/Type.cpp b/goalc/compiler/compilation/Type.cpp index 9ea91d24c0b..0cd071c4175 100644 --- a/goalc/compiler/compilation/Type.cpp +++ b/goalc/compiler/compilation/Type.cpp @@ -559,22 +559,24 @@ Val* Compiler::compile_defmethod(const goos::Object& form, const goos::Object& _ // compile the function! Val* result = nullptr; bool first_thing = true; + const goos::Object* result_obj = nullptr; for_each_in_list(lambda.body, [&](const goos::Object& o) { result = compile_error_guard(o, func_block_env); - if (!dynamic_cast(result)) { - result = result->to_reg(o, func_block_env); - } + result_obj = &o; if (first_thing) { first_thing = false; // you could probably cheat and do a (begin (blorp) (declare ...)) to get around this. new_func_env->settings.is_set = true; } }); + if (result_obj && !dynamic_cast(result)) { + result = result->to_reg(*result_obj, func_block_env); + } if (new_func_env->is_asm_func) { // don't add return automatically! lambda_ts.add_arg(new_func_env->asm_func_return_type); - } else if (result && !dynamic_cast(result)) { + } else if (result && !dynamic_cast(result) && result->type() != TypeSpec("none")) { RegVal* final_result; emitter::Register ret_hw_reg = emitter::gRegInfo.get_gpr_ret_reg(); if (m_ts.lookup_type(result->type())->get_load_size() == 16) { @@ -746,7 +748,7 @@ Val* Compiler::compile_deref(const goos::Object& form, const goos::Object& _rest // special case (-> enter) should return the appropriate function type. if (in_type.arg_count() > 0 && in_type.base_type() == "state") { if (field_name == "enter" || field_name == "code") { - result->set_type(state_to_go_function(in_type, TypeSpec("none"))); + result->set_type(state_to_go_function(in_type, TypeSpec("object"))); } } diff --git a/test/decompiler/reference/jak1/decompiler-macros.gc b/test/decompiler/reference/jak1/decompiler-macros.gc index 542b5883a87..ff5b17c6188 100644 --- a/test/decompiler/reference/jak1/decompiler-macros.gc +++ b/test/decompiler/reference/jak1/decompiler-macros.gc @@ -1239,23 +1239,18 @@ ) ;; game-h -(defmacro static-attack-info (&key (mask ()) &rest args) - (when (!= (length args) 1) - (error "static-attack-info can only have 1 arg")) - (let ((mask-actual mask) - (arg (car args)) +(defmacro static-attack-info (&key (mask ()) args) + (let ((mask-actual mask)) + (dolist (it args) + (when (not (member (caar it) mask-actual)) + (cons! mask-actual (caar it)) ) - (when (not (null? (assoc 'shove-up arg))) (cons! mask-actual 'shove-up)) - (when (not (null? (assoc 'shove-back arg))) (cons! mask-actual 'shove-back)) - (when (not (null? (assoc 'mode arg))) (cons! mask-actual 'mode)) - (when (not (null? (assoc 'vector arg))) (cons! mask-actual 'vector)) - (when (not (null? (assoc 'angle arg))) (cons! mask-actual 'angle)) - (when (not (null? (assoc 'control arg))) (cons! mask-actual 'control)) + ) `(let ((atk (new 'static 'attack-info :mask (attack-mask ,@mask-actual)))) ,@(apply (lambda (x) (if (eq? (car x) 'vector) `(vector-copy! (-> atk ,(car x)) ,(cadr x)) `(set! (-> atk ,(car x)) ,(cadr x)) - )) arg) + )) args) atk) ) ) diff --git a/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc b/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc index 6e776246d69..0f911e28135 100644 --- a/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc @@ -25,7 +25,7 @@ (a0-7 "align joint-anim") ) (set! (-> pp next-state) process-drawable-art-error) - (t9-0 a0-7 (the-as object a1-0) a2-0) + (t9-0 a0-7 (the-as none a1-0) a2-0) ) (.lw ra-0 return-from-thread s7-0) (.jr ra-0) diff --git a/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc b/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc index 733ff9e6faf..c4ba145b6e0 100644 --- a/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc @@ -553,7 +553,6 @@ (defstate joint-exploder-shatter (joint-exploder) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (let* ((f1-0 (the float (- (-> *display* base-frame-counter) (-> self state-time)))) @@ -610,7 +609,6 @@ ) ) 0 - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -618,7 +616,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior joint-exploder) ja-post) ) diff --git a/test/decompiler/reference/jak1/engine/anim/joint_REF.gc b/test/decompiler/reference/jak1/engine/anim/joint_REF.gc index bbeb1da43a5..97ec0e8a896 100644 --- a/test/decompiler/reference/jak1/engine/anim/joint_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/joint_REF.gc @@ -741,7 +741,7 @@ ;; definition for function joint-control-remap! ;; INFO: Used lq/sq ;; INFO: Return type mismatch symbol vs object. -;; WARN: Failed load: (set! v1-29 (l.wu (+ a0-9 -4))) at op 75 +;; ERROR: Failed load: (set! v1-29 (l.wu (+ a0-9 -4))) at op 75 (defun joint-control-remap! ((arg0 joint-control) (arg1 art-group) (arg2 art-group) (arg3 pair) (arg4 int) (arg5 string)) (local-vars (sv-16 int) @@ -796,7 +796,7 @@ ) ) ) - (the-as object sv-24) + sv-24 ) ;; definition for function flatten-joint-control-to-spr diff --git a/test/decompiler/reference/jak1/engine/camera/cam-combiner_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-combiner_REF.gc index d8f63bedd2e..85e7f953991 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-combiner_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-combiner_REF.gc @@ -3,164 +3,156 @@ ;; failed to figure out what this is: (defstate cam-combiner-active (camera-combiner) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('point-of-interest) - (cond - ((-> event param 0) - (set! (-> self tracking use-point-of-interest) #t) - (set! (-> self tracking point-of-interest quad) (-> (the-as vector (-> event param 0)) quad)) - (set! (-> self tracking point-of-interest-blend target) 1.0) - ) - (else - (set! (-> self tracking use-point-of-interest) #f) - (set! (-> self tracking point-of-interest-blend target) 0.0) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('point-of-interest) + (cond + ((-> block param 0) + (set! (-> self tracking use-point-of-interest) #t) + (set! (-> self tracking point-of-interest quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self tracking point-of-interest-blend target) 1.0) + ) + (else + (set! (-> self tracking use-point-of-interest) #f) + (set! (-> self tracking point-of-interest-blend target) 0.0) ) ) - (('set-interpolation) - (set! (-> self interp-val) 0.0) - (set! (-> self interp-step) (/ 5.0 (the float (-> event param 0)))) - ) - (('teleport) - (when (nonzero? (-> self tracking-status)) - (cam-calc-follow! (-> self tracking) (-> self trans) #f) - (the-as object (slave-set-rotation! - (-> self tracking) - (-> self trans) - (the-as float (-> self tracking-options)) - (-> self fov) - #f - ) - ) + ) + (('set-interpolation) + (set! (-> self interp-val) 0.0) + (set! (-> self interp-step) (/ 5.0 (the float (-> block param 0)))) + ) + (('teleport) + (when (nonzero? (-> self tracking-status)) + (cam-calc-follow! (-> self tracking) (-> self trans) #f) + (slave-set-rotation! + (-> self tracking) + (-> self trans) + (the-as float (-> self tracking-options)) + (-> self fov) + #f ) ) - (('stop-tracking) - (set! (-> self tracking-status) (the-as uint 0)) - 0 - ) - (('start-tracking) - (cond - ((< arg1 1) - (let ((t9-2 format) - (a0-15 0) - (a1-3 "ERROR : missing camera-slave parameter to *camera-combiner* start-tracking~%") - ) - (let ((v1-7 (-> event param 0))) - (rtype-of v1-7) + ) + (('stop-tracking) + (set! (-> self tracking-status) (the-as uint 0)) + 0 + ) + (('start-tracking) + (cond + ((< argc 1) + (let ((t9-2 format) + (a0-15 0) + (a1-3 "ERROR : missing camera-slave parameter to *camera-combiner* start-tracking~%") ) - (t9-2 a0-15 a1-3) + (let ((v1-7 (-> block param 0))) + (rtype-of v1-7) ) + (t9-2 a0-15 a1-3) ) - ((let ((t9-3 type-type?) - (v1-8 (-> event param 0)) - ) - (not (t9-3 (rtype-of v1-8) camera-slave)) + ) + ((let ((t9-3 type-type?) + (v1-8 (-> block param 0)) + ) + (not (t9-3 (rtype-of v1-8) camera-slave)) + ) + (let ((t9-4 format) + (a0-18 0) + (a1-5 "ERROR : invalid type '~A' to *camera-combiner* start-tracking~%") + (v1-10 (-> block param 0)) + ) + (t9-4 a0-18 a1-5 (rtype-of v1-10)) + ) + ) + ((zero? (-> self tracking-status)) + (set! (-> self tracking-status) (the-as uint 1)) + (let ((gp-1 (the-as object (-> block param 0)))) + (set! (-> self tracking-options) (the-as int (-> (the-as camera-slave gp-1) options))) + (set! (-> self tracking no-follow) (-> (the-as camera-slave gp-1) tracking no-follow)) + (copy-cam-float-seeker (-> self tracking tilt-adjust) (-> (the-as camera-slave gp-1) tracking tilt-adjust)) + (copy-cam-float-seeker + (-> self tracking underwater-blend) + (-> (the-as camera-slave gp-1) tracking underwater-blend) ) - (let ((t9-4 format) - (a0-18 0) - (a1-5 "ERROR : invalid type '~A' to *camera-combiner* start-tracking~%") - (v1-10 (-> event param 0)) + (set! (-> self tracking use-point-of-interest) (-> (the-as camera-slave gp-1) tracking use-point-of-interest)) + (set! (-> self tracking point-of-interest quad) + (-> (the-as camera-slave gp-1) tracking point-of-interest quad) ) - (t9-4 a0-18 a1-5 (rtype-of v1-10)) + (copy-cam-float-seeker + (-> self tracking point-of-interest-blend) + (-> (the-as camera-slave gp-1) tracking point-of-interest-blend) ) - ) - ((zero? (-> self tracking-status)) - (set! (-> self tracking-status) (the-as uint 1)) - (let ((gp-1 (the-as object (-> event param 0)))) - (set! (-> self tracking-options) (the-as int (-> (the-as camera-slave gp-1) options))) - (set! (-> self tracking no-follow) (-> (the-as camera-slave gp-1) tracking no-follow)) - (copy-cam-float-seeker (-> self tracking tilt-adjust) (-> (the-as camera-slave gp-1) tracking tilt-adjust)) - (copy-cam-float-seeker - (-> self tracking underwater-blend) - (-> (the-as camera-slave gp-1) tracking underwater-blend) - ) - (set! (-> self tracking use-point-of-interest) (-> (the-as camera-slave gp-1) tracking use-point-of-interest)) - (set! (-> self tracking point-of-interest quad) - (-> (the-as camera-slave gp-1) tracking point-of-interest quad) - ) - (copy-cam-float-seeker - (-> self tracking point-of-interest-blend) - (-> (the-as camera-slave gp-1) tracking point-of-interest-blend) - ) - (let ((gp-2 (+ (the-as uint gp-1) 108))) - (cam-calc-follow! (-> self tracking) (the-as vector gp-2) #f) - (the-as object (slave-set-rotation! - (-> self tracking) - (the-as vector gp-2) - (the-as float (-> self tracking-options)) - (-> self fov) - #f - ) - ) + (let ((gp-2 (+ (the-as uint gp-1) 108))) + (cam-calc-follow! (-> self tracking) (the-as vector gp-2) #f) + (slave-set-rotation! + (-> self tracking) + (the-as vector gp-2) + (the-as float (-> self tracking-options)) + (-> self fov) + #f ) ) ) - ) + ) ) - (('copy-tracking) - (cond - ((< arg1 1) - (let ((t9-10 format) - (a0-27 0) - (a1-11 "ERROR : missing camera-slave parameter to *camera-combiner* copy-tracking~%") - ) - (let ((v1-23 (-> event param 0))) - (rtype-of v1-23) + ) + (('copy-tracking) + (cond + ((< argc 1) + (let ((t9-10 format) + (a0-27 0) + (a1-11 "ERROR : missing camera-slave parameter to *camera-combiner* copy-tracking~%") ) - (t9-10 a0-27 a1-11) + (let ((v1-23 (-> block param 0))) + (rtype-of v1-23) ) + (t9-10 a0-27 a1-11) ) - ((let ((t9-11 type-type?) - (v1-24 (-> event param 0)) - ) - (not (t9-11 (rtype-of v1-24) camera-slave)) - ) - (let ((t9-12 format) - (a0-30 0) - (a1-13 "ERROR : invalid type '~A' to *camera-combiner* copy-tracking~%") - (v1-25 (-> event param 0)) - ) - (t9-12 a0-30 a1-13 (rtype-of v1-25)) - ) + ) + ((let ((t9-11 type-type?) + (v1-24 (-> block param 0)) + ) + (not (t9-11 (rtype-of v1-24) camera-slave)) ) - ((nonzero? (-> self tracking-status)) - #f + (let ((t9-12 format) + (a0-30 0) + (a1-13 "ERROR : invalid type '~A' to *camera-combiner* copy-tracking~%") + (v1-25 (-> block param 0)) + ) + (t9-12 a0-30 a1-13 (rtype-of v1-25)) ) - (else - (set! (-> self tracking-status) (the-as uint 1)) - (let ((gp-3 (the-as camera-slave (-> event param 0)))) - (set! (-> self tracking-options) (the-as int (-> gp-3 options))) - (set! (-> self tracking no-follow) (-> gp-3 tracking no-follow)) - (copy-cam-float-seeker (-> self tracking tilt-adjust) (-> gp-3 tracking tilt-adjust)) - (copy-cam-float-seeker (-> self tracking underwater-blend) (-> gp-3 tracking underwater-blend)) - (set! (-> self tracking follow-off quad) (-> gp-3 tracking follow-off quad)) - (set! (-> self tracking follow-pt quad) (-> gp-3 tracking follow-pt quad)) - (let* ((a2-17 (-> self tracking)) - (a3-3 (-> gp-3 tracking)) - (v1-36 (-> a3-3 inv-mat vector 0 quad)) - (a0-37 (-> a3-3 inv-mat vector 1 quad)) - (a1-16 (-> a3-3 inv-mat vector 2 quad)) - (a3-4 (-> a3-3 inv-mat vector 3 quad)) - ) - (set! (-> a2-17 inv-mat vector 0 quad) v1-36) - (set! (-> a2-17 inv-mat vector 1 quad) a0-37) - (set! (-> a2-17 inv-mat vector 2 quad) a1-16) - (set! (-> a2-17 inv-mat vector 3 quad) a3-4) - ) - (set! (-> self tracking use-point-of-interest) (-> gp-3 tracking use-point-of-interest)) - (set! (-> self tracking point-of-interest quad) (-> gp-3 tracking point-of-interest quad)) - (the-as - object - (copy-cam-float-seeker (-> self tracking point-of-interest-blend) (-> gp-3 tracking point-of-interest-blend)) - ) + ) + ((nonzero? (-> self tracking-status)) + #f + ) + (else + (set! (-> self tracking-status) (the-as uint 1)) + (let ((gp-3 (the-as camera-slave (-> block param 0)))) + (set! (-> self tracking-options) (the-as int (-> gp-3 options))) + (set! (-> self tracking no-follow) (-> gp-3 tracking no-follow)) + (copy-cam-float-seeker (-> self tracking tilt-adjust) (-> gp-3 tracking tilt-adjust)) + (copy-cam-float-seeker (-> self tracking underwater-blend) (-> gp-3 tracking underwater-blend)) + (set! (-> self tracking follow-off quad) (-> gp-3 tracking follow-off quad)) + (set! (-> self tracking follow-pt quad) (-> gp-3 tracking follow-pt quad)) + (let* ((a2-17 (-> self tracking)) + (a3-3 (-> gp-3 tracking)) + (v1-36 (-> a3-3 inv-mat vector 0 quad)) + (a0-37 (-> a3-3 inv-mat vector 1 quad)) + (a1-16 (-> a3-3 inv-mat vector 2 quad)) + (a3-4 (-> a3-3 inv-mat vector 3 quad)) + ) + (set! (-> a2-17 inv-mat vector 0 quad) v1-36) + (set! (-> a2-17 inv-mat vector 1 quad) a0-37) + (set! (-> a2-17 inv-mat vector 2 quad) a1-16) + (set! (-> a2-17 inv-mat vector 3 quad) a3-4) ) + (set! (-> self tracking use-point-of-interest) (-> gp-3 tracking use-point-of-interest)) + (set! (-> self tracking point-of-interest quad) (-> gp-3 tracking point-of-interest quad)) + (copy-cam-float-seeker (-> self tracking point-of-interest-blend) (-> gp-3 tracking point-of-interest-blend)) ) ) ) - ) + ) ) ) :code (behavior () @@ -409,7 +401,6 @@ ) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc index 102e0a74fda..60c90b21f8c 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc @@ -3752,7 +3752,6 @@ (cam-layout-do-menu *clm*) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc index 37c24cf9793..dbbe5453e75 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc @@ -213,7 +213,7 @@ ;; definition for function master-track-target ;; INFO: Used lq/sq -;; INFO: Return type mismatch none vs symbol. +;; INFO: Return type mismatch object vs symbol. (defbehavior master-track-target camera-master () (cond ((and (logtest? (-> self master-options) 2) @@ -653,13 +653,9 @@ ;; definition for function master-switch-to-entity ;; INFO: Used lq/sq -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 166] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 176] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 196] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 220] (defbehavior master-switch-to-entity camera-master ((arg0 entity)) (local-vars - (v0-21 none) + (v0-21 object) (gp-0 (pointer process)) (sv-16 res-tag) (sv-112 process) @@ -861,7 +857,6 @@ (if (and (nonzero? camera-master-debug) *debug-segment*) (add-connection *debug-engine* self camera-master-debug self #f #f) ) - (none) ) :trans (behavior () (when (not (paused?)) @@ -871,7 +866,6 @@ ) (cam-master-effect) ) - (none) ) :code (behavior () (loop @@ -916,7 +910,6 @@ ) (suspend) ) - (none) ) ) @@ -946,7 +939,6 @@ (change-to-last-brother self) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc index d09115e92f3..15692c8e025 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc @@ -24,13 +24,13 @@ ;; failed to figure out what this is: (defstate cam-point-watch (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -40,7 +40,6 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) - (none) ) :code (behavior () (loop @@ -88,7 +87,6 @@ (suspend) 0 ) - (none) ) ) @@ -416,13 +414,13 @@ ;; failed to figure out what this is: (defstate cam-free-floating (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -432,7 +430,6 @@ (set! (-> self blend-to-type) (the-as uint 1)) (send-event *camera-combiner* 'stop-tracking) ) - (none) ) :code (behavior () (loop @@ -449,7 +446,6 @@ ) (suspend) ) - (none) ) ) @@ -522,13 +518,13 @@ ;; failed to figure out what this is: (defstate cam-orbit (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -544,11 +540,9 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) - (none) ) :exit (behavior () '() - (none) ) :code (behavior () (loop @@ -639,6 +633,5 @@ ) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc index e3f2b281dd3..c6d7e2949e1 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc @@ -3,13 +3,13 @@ ;; failed to figure out what this is: (defstate cam-fixed (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -20,7 +20,6 @@ (set! (-> self blend-to-type) (the-as uint 0)) 0 ) - (none) ) :code (behavior () (loop @@ -36,19 +35,18 @@ ) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate cam-fixed-read-entity (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -73,26 +71,24 @@ ) ) (go cam-fixed) - (none) ) :code (behavior () (loop (format *stdcon* "ERROR : stayed in cam-fixed-read-entity~%") (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate cam-pov (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -101,14 +97,12 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) - (none) ) :trans (behavior () (when (not (handle->process (-> *camera* pov-handle))) (set! (-> self blend-from-type) (the-as uint 0)) (cam-slave-go cam-fixed) ) - (none) ) :code (behavior () (loop @@ -140,19 +134,18 @@ ) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate cam-pov180 (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -161,14 +154,12 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) - (none) ) :trans (behavior () (when (not (handle->process (-> *camera* pov-handle))) (set! (-> self blend-from-type) (the-as uint 0)) (cam-slave-go cam-fixed) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -240,7 +231,6 @@ (suspend) ) ) - (none) ) ) @@ -257,13 +247,11 @@ (send-event *camera* 'point-of-interest gp-0) ) ) - (none) ) :trans (behavior () (if (or (not (handle->process (-> *camera* pov-handle))) (not (logtest? (-> *camera* master-options) 2))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -275,7 +263,6 @@ ) (suspend) ) - (none) ) ) @@ -289,10 +276,10 @@ ;; failed to figure out what this is: (defstate cam-standoff (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('set-standoff-dist) - (vector-normalize! (-> self pivot-pt) (the-as float (-> event param 0))) + (vector-normalize! (-> self pivot-pt) (the-as float (-> block param 0))) (cam-standoff-calc-trans) ) (('set-standoff-height) @@ -301,12 +288,12 @@ (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down) - (the-as float (-> event param 0)) + (the-as float (-> block param 0)) ) (cam-standoff-calc-trans) ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -326,13 +313,11 @@ ) ) (cam-calc-follow! (-> self tracking) (-> self trans) #f) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -342,7 +327,6 @@ ) (suspend) ) - (none) ) ) @@ -382,14 +366,12 @@ ) ) (go cam-standoff) - (none) ) :code (behavior () (loop (format *stdcon* "ERROR : stayed in cam-standoff-read-entity~%") (suspend) ) - (none) ) ) @@ -422,13 +404,13 @@ ;; failed to figure out what this is: (defstate cam-eye (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -442,7 +424,6 @@ 0 ) (set! (-> self fov) 11650.845) - (none) ) :exit (behavior () (if (and *target* @@ -451,13 +432,11 @@ ) (send-event *target* 'end-mode) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (go cam-free-floating) ) - (none) ) :code (behavior () (let ((gp-0 (-> *display* base-frame-counter))) @@ -574,7 +553,6 @@ (suspend) ) ) - (none) ) ) @@ -601,13 +579,13 @@ ;; failed to figure out what this is: (defstate cam-billy (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -622,17 +600,14 @@ ) (set! (-> self fov) 9830.4) (matrix-rotate-y! (the-as matrix (-> self tracking)) (the-as float -32768.0)) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -712,7 +687,6 @@ (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) (-> *camera* target-height)) (suspend) ) - (none) ) ) @@ -796,13 +770,11 @@ (send-event *camera* 'point-of-interest gp-2) ) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -814,19 +786,18 @@ ) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate cam-decel (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -834,7 +805,6 @@ (if (not (-> self enter-has-run)) (set! (-> self saved-pt quad) (-> self trans quad)) ) - (none) ) :code (behavior () (loop @@ -867,19 +837,18 @@ ) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate cam-endlessfall (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -888,7 +857,6 @@ (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (the-as uint 2)) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'cam-vector-seeker)) @@ -923,7 +891,6 @@ (suspend) ) ) - (none) ) ) @@ -1109,8 +1076,8 @@ ;; failed to figure out what this is: (defstate cam-circular (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) @@ -1119,7 +1086,7 @@ (cam-circular-position #f) ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -1195,13 +1162,11 @@ (send-event *camera* 'point-of-interest gp-3) ) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -1210,7 +1175,6 @@ ) (suspend) ) - (none) ) ) @@ -1222,19 +1186,16 @@ (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (the-as uint 2)) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) ) @@ -2848,8 +2809,8 @@ ;; failed to figure out what this is: (defstate cam-string (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) (let ((gp-0 (new-stack-vector0))) (cam-string-find-position-rel! gp-0) @@ -2857,8 +2818,8 @@ ) ) (('joystick) - (set! (-> self phony-joystick-x) (the-as float (-> event param 0))) - (set! (-> self phony-joystick-y) (the-as float (-> event param 1))) + (set! (-> self phony-joystick-x) (the-as float (-> block param 0))) + (set! (-> self phony-joystick-y) (the-as float (-> block param 1))) (let ((v0-1 (the-as object #t))) (set! (-> self have-phony-joystick) (the-as symbol v0-1)) v0-1 @@ -2866,10 +2827,10 @@ ) (('set-dist) (cond - ((-> event param 0) + ((-> block param 0) (set! (-> self string-val-locked) #t) - (set! (-> self string-min-val quad) (-> (the-as vector (-> event param 0)) quad)) - (set! (-> self string-max-val quad) (-> (the-as vector (-> event param 1)) quad)) + (set! (-> self string-min-val quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self string-max-val quad) (-> (the-as vector (-> block param 1)) quad)) (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) @@ -2884,7 +2845,7 @@ (-> self los-state) ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -3035,13 +2996,11 @@ (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (the-as uint 2)) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -3053,7 +3012,6 @@ ) (suspend) ) - (none) ) ) @@ -3209,7 +3167,6 @@ (set! (-> self blend-to-type) (the-as uint 2)) (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) @@ -3286,7 +3243,6 @@ ) ) ) - (none) ) :code (behavior () (loop @@ -3295,7 +3251,6 @@ ) (suspend) ) - (none) ) ) @@ -3458,13 +3413,11 @@ (cam-calc-bike-follow! (-> self tracking) (-> self trans) #f) (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -3473,7 +3426,6 @@ ) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/camera/camera_REF.gc b/test/decompiler/reference/jak1/engine/camera/camera_REF.gc index b05a406b2e0..145f758fd70 100644 --- a/test/decompiler/reference/jak1/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/camera_REF.gc @@ -1077,59 +1077,51 @@ ;; definition for function cam-standard-event-handler ;; INFO: Used lq/sq -;; INFO: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 7] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 31] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 45] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 50] (defbehavior cam-standard-event-handler camera-slave ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (case arg2 - (('go) - (let ((v1-1 (-> arg3 param 0)) - (t9-0 (the-as (function object) enter-state)) - ) - (set! (-> self next-state) (the-as state v1-1)) - (t9-0) - ) - ) - (('change-state 'change-state-no-go) - (let ((s5-0 (the-as object (-> arg3 param 0)))) - (cam-slave-init-vars) - (let ((t9-2 (the-as (function object) (-> (the-as state s5-0) enter)))) - (if t9-2 - (t9-2) - ) + (case arg2 + (('go) + (let ((v1-1 (-> arg3 param 0)) + (t9-0 (the-as (function object) enter-state)) ) - (set! (-> self enter-has-run) #t) - (set! (-> self event-hook) (-> (the-as state s5-0) event)) - (when (= arg2 'change-state) - (let ((t9-3 (the-as (function object) enter-state))) - (set! (-> self next-state) (the-as state s5-0)) - (t9-3) + (set! (-> self next-state) (the-as state v1-1)) + (t9-0) + ) + ) + (('change-state 'change-state-no-go) + (let ((s5-0 (the-as object (-> arg3 param 0)))) + (cam-slave-init-vars) + (let ((t9-2 (the-as (function object) (-> (the-as state s5-0) enter)))) + (if t9-2 + (t9-2) ) - ) ) - ) - (('point-of-interest) - (cond - ((-> arg3 param 0) - (set! (-> self tracking use-point-of-interest) #t) - (set! (-> self tracking point-of-interest quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> self tracking point-of-interest-blend target) 1.0) - ) - (else - (set! (-> self tracking use-point-of-interest) #f) - (set! (-> self tracking point-of-interest-blend target) 0.0) + (set! (-> self enter-has-run) #t) + (set! (-> self event-hook) (-> (the-as state s5-0) event)) + (when (= arg2 'change-state) + (let ((t9-3 (the-as (function object) enter-state))) + (set! (-> self next-state) (the-as state s5-0)) + (t9-3) ) ) ) - (('teleport) - (cam-calc-follow! (-> self tracking) (-> self trans) #f) - (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f) + ) + (('point-of-interest) + (cond + ((-> arg3 param 0) + (set! (-> self tracking use-point-of-interest) #t) + (set! (-> self tracking point-of-interest quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set! (-> self tracking point-of-interest-blend target) 1.0) + ) + (else + (set! (-> self tracking use-point-of-interest) #f) + (set! (-> self tracking point-of-interest-blend target) 0.0) + ) ) - ) + ) + (('teleport) + (cam-calc-follow! (-> self tracking) (-> self trans) #f) + (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f) + ) ) ) diff --git a/test/decompiler/reference/jak1/engine/camera/pov-camera_REF.gc b/test/decompiler/reference/jak1/engine/camera/pov-camera_REF.gc index 14f412283ee..9855f478ee6 100644 --- a/test/decompiler/reference/jak1/engine/camera/pov-camera_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/pov-camera_REF.gc @@ -32,7 +32,6 @@ :virtual #t :code (behavior () (go-virtual pov-camera-start-playing) - (none) ) ) @@ -55,7 +54,6 @@ ) ) (go-virtual pov-camera-playing) - (none) ) ) @@ -82,8 +80,8 @@ ;; failed to figure out what this is: (defstate pov-camera-playing (pov-camera) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('abort) (when (logtest? (-> self flags) (pov-camera-flag notify-of-abort)) (logior! (-> self flags) (pov-camera-flag allow-abort)) @@ -99,7 +97,6 @@ (if (= (-> self anim-name type) string) (backup-load-state-and-set-cmds *load-state* (-> self command-list)) ) - (none) ) :exit (behavior () (if (= (-> self anim-name type) string) @@ -107,7 +104,6 @@ ) (remove-setting! 'music-volume) (remove-setting! 'sfx-volume) - (none) ) :code (behavior () (add-setting! 'music-volume 'rel (-> self music-volume-movie) 0) @@ -131,14 +127,12 @@ ) ) (go-virtual pov-camera-done-playing) - (none) ) :post (behavior () (if (= (-> self anim-name type) string) (execute-commands-up-to *load-state* (ja-aframe-num 0)) ) (ja-post) - (none) ) ) @@ -147,14 +141,12 @@ :virtual #t :enter (behavior () (logior! (-> self flags) (pov-camera-flag allow-abort)) - (none) ) :code (behavior () (set-blackout-frames (seconds 0.035)) (suspend) (suspend) (go-virtual pov-camera-done-playing) - (none) ) ) @@ -170,7 +162,6 @@ (suspend) (cleanup-for-death self) (deactivate self) - (none) ) ) @@ -233,25 +224,23 @@ ) ) (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) - (set! (-> self event-hook) - (lambda :behavior pov-camera - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('mask) - (let ((v0-0 (the-as number (-> arg3 param 0)))) - (set! (-> self mask-to-clear) (the-as process-mask v0-0)) - v0-0 - ) - ) - (('music-movie-volume) - (set! (-> self music-volume-movie) (the-as float (-> arg3 param 0))) - ) - (('sfx-movie-volume) - (set! (-> self sfx-volume-movie) (the-as float (-> arg3 param 0))) - ) - ) - ) - ) + (set! (-> self event-hook) (lambda :behavior pov-camera + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('mask) + (let ((v0-0 (the-as number (-> arg3 param 0)))) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) + v0-0 + ) + ) + (('music-movie-volume) + (set! (-> self music-volume-movie) (the-as float (-> arg3 param 0))) + ) + (('sfx-movie-volume) + (set! (-> self sfx-volume-movie) (the-as float (-> arg3 param 0))) + ) + ) + ) ) (pre-startup-callback self) (go-virtual pov-camera-startup) diff --git a/test/decompiler/reference/jak1/engine/common-obs/babak_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/babak_REF.gc index df70220ab86..51a9e032f7d 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/babak_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/babak_REF.gc @@ -47,7 +47,6 @@ ) ) ((the-as (function none) (-> (method-of-type nav-enemy nav-enemy-patrol) code))) - (none) ) ) @@ -81,7 +80,6 @@ (ja :num! (loop! f30-0)) ) ) - (none) ) ) @@ -133,7 +131,6 @@ ) ) ) - (none) ) ) @@ -173,7 +170,6 @@ (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -193,7 +189,6 @@ (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) ) (go-virtual nav-enemy-chase) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/basebutton_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/basebutton_REF.gc index 2ee81f0f175..1ca5abfbd36 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/basebutton_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/basebutton_REF.gc @@ -87,17 +87,16 @@ (go-virtual basebutton-down-idle) (go-virtual basebutton-up-idle) ) - (none) ) ) ;; failed to figure out what this is: (defstate basebutton-up-idle (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (case (-> event param 1) + (case (-> block param 1) (('flop) (basebutton-method-29 self (-> self event-going-down) (-> self notify-actor)) (sound-play "silo-button") @@ -110,19 +109,17 @@ (go-virtual basebutton-going-down) ) (('move-to) - (move-to-vec-or-quat! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1))) + (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) ) ) ) :enter (behavior () (press! self #f) - (none) ) :trans (behavior () (if (-> self move-to?) (rider-trans) ) - (none) ) :code (the-as (function none :behavior basebutton) anim-loop) :post (behavior () @@ -132,27 +129,25 @@ (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) (rider-post) ) - (none) ) ) ;; failed to figure out what this is: (defstate basebutton-going-down (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (sound-play "silo-button") (go-virtual basebutton-going-up) ) (('move-to) - (move-to-vec-or-quat! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1))) + (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) ) ) ) :enter (behavior () (press! self #t) - (none) ) :trans (the-as (function none :behavior basebutton) rider-trans) :code (behavior () @@ -163,7 +158,6 @@ ) (basebutton-method-29 self (-> self event-down) (-> self notify-actor)) (go-virtual basebutton-down-idle) - (none) ) :post (behavior () (when (-> self move-to?) @@ -172,33 +166,30 @@ (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) ) (rider-post) - (none) ) ) ;; failed to figure out what this is: (defstate basebutton-down-idle (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (sound-play "silo-button") (go-virtual basebutton-going-up) ) (('move-to) - (move-to-vec-or-quat! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1))) + (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) ) ) ) :enter (behavior () (press! self #t) - (none) ) :trans (behavior () (if (-> self move-to?) (rider-trans) ) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -215,7 +206,6 @@ (go-virtual basebutton-going-up) ) ) - (none) ) :post (behavior () (when (-> self move-to?) @@ -224,17 +214,16 @@ (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) (rider-post) ) - (none) ) ) ;; failed to figure out what this is: (defstate basebutton-going-up (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('move-to) - (move-to-vec-or-quat! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1))) + (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) ) (('trigger) (sound-play "silo-button") @@ -244,7 +233,6 @@ ) :enter (behavior () (press! self #f) - (none) ) :trans (the-as (function none :behavior basebutton) rider-trans) :code (behavior () @@ -255,7 +243,6 @@ ) (basebutton-method-29 self (-> self event-up) (-> self notify-actor)) (go-virtual basebutton-up-idle) - (none) ) :post (behavior () (when (-> self move-to?) @@ -264,7 +251,6 @@ (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) ) (rider-post) - (none) ) ) @@ -286,6 +272,7 @@ ) ;; definition for method 29 of type basebutton +;; INFO: Return type mismatch object vs none. (defmethod basebutton-method-29 basebutton ((obj basebutton) (arg0 symbol) (arg1 entity)) (with-pp (when arg0 @@ -519,7 +506,6 @@ :virtual #t :trans (behavior () (send-event *camera* 'joystick 0.0 0.0) - (none) ) :code (behavior ((arg0 int) (arg1 level)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -559,7 +545,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -590,8 +575,8 @@ ;; failed to figure out what this is: (defstate target-warp-out (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('death-end) (let ((v0-0 (the-as object (logior (-> self draw status) (draw-status hidden))))) (set! (-> self draw status) (the-as draw-status v0-0)) @@ -599,7 +584,7 @@ ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -614,11 +599,9 @@ (vector-reset! (-> self control transv)) (logior! (-> self state-flags) (state-flags use-alt-cam-pos)) (set! (-> self alt-cam-pos quad) (-> arg1 quad)) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) - (none) ) :code (behavior ((arg0 vector) (arg1 vector)) (send-event *camera* 'change-state cam-fixed 0) @@ -707,7 +690,6 @@ (ja :num! (seek! (ja-aframe 40.0 0))) ) (anim-loop) - (none) ) :post target-no-stick-post ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/baseplat_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/baseplat_REF.gc index 47a88d16cc7..aceefa35130 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/baseplat_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/baseplat_REF.gc @@ -123,12 +123,11 @@ ;; definition for function plat-event ;; INFO: Return type mismatch none vs object. (defbehavior plat-event baseplat ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('bonk) - (baseplat-method-22 self) - ) - ) - ) + (case arg2 + (('bonk) + (baseplat-method-22 self) + ) + ) ) ;; definition of type eco-door @@ -184,23 +183,22 @@ ;; definition for function eco-door-event-handler ;; INFO: Return type mismatch symbol vs object. (defbehavior eco-door-event-handler eco-door ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('trigger) - (set! (-> self locked) (not (-> self locked))) - (cond - ((-> self locked) - (if (= (-> self next-state name) 'door-closed) - (sound-play "door-lock") - ) - ) - (else - (sound-play "door-unlock") - ) - ) - #t - ) - ) - ) + (case arg2 + (('trigger) + (set! (-> self locked) (not (-> self locked))) + (cond + ((-> self locked) + (if (= (-> self next-state name) 'door-closed) + (sound-play "door-lock") + ) + ) + (else + (sound-play "door-unlock") + ) + ) + #t + ) + ) ) ;; failed to figure out what this is: @@ -233,7 +231,6 @@ eco-door-event-handler ) (suspend) ) - (none) ) ) @@ -262,7 +259,6 @@ eco-door-event-handler ) ) (go-virtual door-open) - (none) ) :post (the-as (function none :behavior eco-door) transform-post) ) @@ -297,7 +293,6 @@ eco-door-event-handler ) (suspend) ) - (none) ) ) @@ -324,7 +319,6 @@ eco-door-event-handler (sound-play "door-lock") ) (go-virtual door-closed) - (none) ) :post (the-as (function none :behavior eco-door) transform-post) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc index 9503030ff5b..75ace00da18 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc @@ -430,7 +430,6 @@ (if (task-complete? *game-info* (-> self entity extra perm task)) (go-virtual wait) ) - (none) ) :code (the-as (function none :behavior eco-collectable) anim-loop) ) @@ -475,16 +474,15 @@ (logior! (-> self mask) (process-mask actor-pause)) ) (go-virtual wait) - (none) ) ) ;; failed to figure out what this is: (defstate wait (eco-collectable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-3 object)) - (when (and (or (= event-type 'touch) (= event-type 'attack)) + (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) (!= (-> self next-state name) 'pickup) @@ -494,71 +492,68 @@ (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual pickup #f (process->handle proc)) ) - (the-as - object - (cond - ((= event-type 'eco-blue) - (when (and (not (logtest? (-> self flags) (collectable-flags fading ignore-blue))) - (!= (-> self next-state name) 'pickup) - (begin (check-blue-suck (the-as process-drawable proc)) #t) - (logtest? (-> self flags) (collectable-flags can-collect)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual notice-blue (process->handle proc)) - ) - ) - ((= event-type 'trans) - (set! (-> self root-override trans quad) (-> (the-as vector (-> event param 0)) quad)) - (update-transforms! (-> self root-override)) - (the-as object (ja-post)) - ) - ((= event-type 'jump) + (cond + ((= message 'eco-blue) + (when (and (not (logtest? (-> self flags) (collectable-flags fading ignore-blue))) + (!= (-> self next-state name) 'pickup) + (begin (check-blue-suck (the-as process-drawable proc)) #t) + (logtest? (-> self flags) (collectable-flags can-collect)) + (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) + ) (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self jump-pos quad) (-> (the-as vector (-> event param 0)) quad)) - (go-virtual jump) - ) - ((= event-type 'pickup) - (when (!= (-> self next-state name) 'pickup) - (if (and (> arg1 0) (-> event param 0)) - (move-to-point! (-> self root-override) (the-as vector (-> event param 0))) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual pickup #f (the-as handle #f)) - ) + (go-virtual notice-blue (process->handle proc)) ) - ((= event-type 'die) + ) + ((= message 'trans) + (set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad)) + (update-transforms! (-> self root-override)) + (ja-post) + ) + ((= message 'jump) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self jump-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (go-virtual jump) + ) + ((= message 'pickup) + (when (!= (-> self next-state name) 'pickup) + (if (and (> argc 0) (-> block param 0)) + (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) + ) (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual die) - ) - ((= event-type 'movie-pos) - (set! v0-3 (-> event param 0)) - (set! (-> self movie-pos-index) (the-as int v0-3)) - v0-3 + (go-virtual pickup #f (the-as handle #f)) ) - ((= event-type 'actor-pause) - (cond - ((-> event param 0) - (logior! (-> self mask) (process-mask actor-pause)) - (set! v0-3 #t) - (set! (-> self actor-pause) (the-as symbol v0-3)) - v0-3 - ) - (else - (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self actor-pause) #f) - #f - ) + ) + ((= message 'die) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual die) + ) + ((= message 'movie-pos) + (set! v0-3 (-> block param 0)) + (set! (-> self movie-pos-index) (the-as int v0-3)) + v0-3 + ) + ((= message 'actor-pause) + (cond + ((-> block param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (set! v0-3 #t) + (set! (-> self actor-pause) (the-as symbol v0-3)) + v0-3 + ) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + #f ) ) - ((= event-type 'fade) - (logior! (-> self flags) (collectable-flags fade)) - (set! (-> self fadeout-timeout) (seconds 0.1)) - (set! v0-3 (-> *display* base-frame-counter)) - (set! (-> self birth-time) (the-as time-frame v0-3)) - v0-3 - ) - ) + ) + ((= message 'fade) + (logior! (-> self flags) (collectable-flags fade)) + (set! (-> self fadeout-timeout) (seconds 0.1)) + (set! v0-3 (-> *display* base-frame-counter)) + (set! (-> self birth-time) (the-as time-frame v0-3)) + v0-3 + ) ) ) :enter (behavior () @@ -569,7 +564,6 @@ ) (go-virtual pickup #f (process->handle *target*)) ) - (none) ) :trans (behavior () (cond @@ -613,7 +607,6 @@ ) ) (update-transforms! (-> self root-override)) - (none) ) :code (behavior () (loop @@ -649,15 +642,14 @@ ) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate notice-blue (eco-collectable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (when (and (or (= event-type 'touch) (= event-type 'attack)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) (!= (-> self next-state name) 'pickup) @@ -679,13 +671,11 @@ ) (set! (-> self suck-y-offset) 0.0) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) - (none) ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -698,7 +688,6 @@ (go-virtual wait) ) ) - (none) ) :code (behavior ((arg0 handle)) (loop @@ -720,21 +709,20 @@ ) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate pickup (eco-collectable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (the-as - object - (case event-type + symbol + (case message (('set-movie-pos) (let ((v1-3 (res-lump-struct (-> self entity) 'movie-pos vector :time (the-as float -1000000000.0)))) (the-as symbol (when v1-3 - (set! (-> v1-3 quad) (-> (the-as vector (-> event param 0)) quad)) + (set! (-> v1-3 quad) (-> (the-as vector (-> block param 0)) quad)) (the-as symbol v1-3) ) ) @@ -742,7 +730,7 @@ ) (('actor-pause) (the-as symbol (cond - ((-> event param 0) + ((-> block param 0) (logior! (-> self mask) (process-mask actor-pause)) (let ((v0-1 #t)) (set! (-> self actor-pause) v0-1) @@ -785,7 +773,6 @@ ) ) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :code (behavior ((arg0 object) (arg1 handle)) (clear-collide-with-as (-> self root-override)) @@ -889,7 +876,6 @@ (suspend) ) (go-virtual die) - (none) ) ) @@ -898,7 +884,6 @@ :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) @@ -937,24 +922,22 @@ ;; failed to figure out what this is: (defstate die (eco) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('fade) - (process-entity-status! self (entity-perm-status dead) #t) - (the-as object (deactivate self)) - ) - (('die) - (go-virtual die) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fade) + (process-entity-status! self (entity-perm-status dead) #t) + (deactivate self) + ) + (('die) + (go-virtual die) + ) + ) ) :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) - (none) ) :code (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) @@ -983,7 +966,6 @@ (set! (-> self root-override trans quad) (-> self base quad)) (restore-collide-with-as (-> self root-override)) (go-virtual wait) - (none) ) ) @@ -1259,7 +1241,6 @@ (ja-post) (suspend) ) - (none) ) ) @@ -1294,7 +1275,6 @@ (transform-post) (suspend) ) - (none) ) ) @@ -1306,7 +1286,6 @@ (clear-collide-with-as (-> self root-override)) (process-entity-status! self (entity-perm-status dead) #t) (convert-to-hud-object self (the-as hud (ppointer->process (-> *hud-parts* money)))) - (none) ) ) @@ -1563,9 +1542,9 @@ ;; failed to figure out what this is: (defstate wait (fuel-cell) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-3 object)) - (when (and (or (= event-type 'touch) (= event-type 'attack)) + (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) (and (not (handle->process (-> *game-info* other-camera-handle))) @@ -1581,47 +1560,46 @@ (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual pickup #f (process->handle proc)) ) - (the-as object (cond - ((= event-type 'trans) - (set! (-> self root-override trans quad) (-> (the-as vector (-> event param 0)) quad)) - (set! (-> self base quad) (-> self root-override trans quad)) - (update-transforms! (-> self root-override)) - ) - ((= event-type 'pickup) - (when (!= (-> self next-state name) 'pickup) - (if (and (> arg1 0) (-> event param 0)) - (move-to-point! (-> self root-override) (the-as vector (-> event param 0))) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual pickup #f (process->handle *target*)) - ) - ) - ((= event-type 'collide-shape) - (if (-> event param 0) - (the-as object (restore-collide-with-as (-> self root-override))) - (the-as object (clear-collide-with-as (-> self root-override))) - ) - ) - ((= event-type 'movie-pos) - (set! v0-3 (-> event param 0)) - (set! (-> self movie-pos-index) (the-as int v0-3)) - v0-3 - ) - ((= event-type 'anim) - (cond - ((-> event param 0) - (set! v0-3 (logclear (-> self flags) (collectable-flags anim))) - (set! (-> self flags) (the-as collectable-flags v0-3)) - ) - (else - (set! v0-3 (logior (-> self flags) (collectable-flags anim))) - (set! (-> self flags) (the-as collectable-flags v0-3)) - ) - ) - v0-3 - ) - ) - ) + (cond + ((= message 'trans) + (set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self base quad) (-> self root-override trans quad)) + (update-transforms! (-> self root-override)) + ) + ((= message 'pickup) + (when (!= (-> self next-state name) 'pickup) + (if (and (> argc 0) (-> block param 0)) + (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual pickup #f (process->handle *target*)) + ) + ) + ((= message 'collide-shape) + (if (-> block param 0) + (restore-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root-override)) + ) + ) + ((= message 'movie-pos) + (set! v0-3 (-> block param 0)) + (set! (-> self movie-pos-index) (the-as int v0-3)) + v0-3 + ) + ((= message 'anim) + (cond + ((-> block param 0) + (set! v0-3 (logclear (-> self flags) (collectable-flags anim))) + (set! (-> self flags) (the-as collectable-flags v0-3)) + ) + (else + (set! v0-3 (logior (-> self flags) (collectable-flags anim))) + (set! (-> self flags) (the-as collectable-flags v0-3)) + ) + ) + v0-3 + ) + ) ) :code (behavior () 0.5 @@ -1648,7 +1626,6 @@ ) ) ) - (none) ) ) @@ -1663,7 +1640,6 @@ (t9-1) ) ) - (none) ) :trans (behavior () (let ((f30-0 (the-as float (cond @@ -1720,7 +1696,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 object) (arg1 handle)) (local-vars (sv-96 res-tag)) @@ -2072,14 +2047,12 @@ ) ) (convert-to-hud-object self (the-as hud (ppointer->process (-> *hud-parts* fuel-cell)))) - (none) ) :post (behavior () (transform-post) (if (-> self state-object) (spawn (-> self part) (the-as vector (-> self root-override root-prim prim-core))) ) - (none) ) ) @@ -2181,19 +2154,19 @@ ;; failed to figure out what this is: (defstate fuel-cell-clone-anim (fuel-cell) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('pickup) (when (!= (-> self next-state name) 'pickup) - (if (and (> arg1 0) (-> event param 0)) - (move-to-point! (-> self root-override) (the-as vector (-> event param 0))) + (if (and (> argc 0) (-> block param 0)) + (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual pickup #f (the-as handle #f)) ) ) (('trans) - (set! (-> self root-override trans quad) (-> (the-as vector (-> event param 0)) quad)) + (set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad)) (set! (-> self base quad) (-> self root-override trans quad)) (update-transforms! (-> self root-override)) ) @@ -2213,19 +2186,16 @@ (logior! (-> self mask) (process-mask actor-pause)) ) (logclear! (-> self skel status) (janim-status spool)) - (none) ) :code (behavior ((arg0 handle)) (logclear! (-> self mask) (process-mask actor-pause)) (clone-anim arg0 3 #t "") (format #t "ERROR: clone-anim returned in fuel-cell~%") (deactivate self) - (none) ) :post (behavior () (update-transforms! (-> self root-override)) (animate self) - (none) ) ) @@ -2310,25 +2280,22 @@ (animate self) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate pickup (buzzer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (process-entity-status! self (entity-perm-status dead) #t) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (process-entity-status! self (entity-perm-status dead) #t) + ) + ) ) :enter (behavior ((arg0 object) (arg1 handle)) (set! (-> self pickup-handle) arg1) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :code (behavior ((arg0 object) (arg1 handle)) (logclear! (-> self mask) (process-mask actor-pause)) @@ -2423,7 +2390,6 @@ ) ) ) - (none) ) ) @@ -2539,14 +2505,6 @@ ;; definition for function birth-pickup-at-point ;; INFO: Used lq/sq -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 190] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 221] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 252] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 284] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 320] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 356] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 363] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 122] (defbehavior birth-pickup-at-point process ((arg0 vector) (arg1 pickup-type) (arg2 float) (arg3 symbol) (arg4 process-tree) (arg5 fact-info)) (local-vars (v1-2 basic) @@ -2875,7 +2833,6 @@ ) (suspend) ) - (none) ) ) @@ -3067,8 +3024,8 @@ ;; failed to figure out what this is: (defstate vent-wait-for-touch (vent) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (or (= event-type 'touch) (= event-type 'attack)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (or (= message 'touch) (= message 'attack)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) (set! (-> a1-1 num-params) 2) @@ -3082,7 +3039,7 @@ ) (go vent-pickup (process->handle proc)) ) - (vent-standard-event-handler proc arg1 event-type event) + (vent-standard-event-handler proc argc message block) ) :code (behavior () (loop @@ -3099,14 +3056,13 @@ ) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate vent-blocked (vent) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('show) (go vent-wait-for-touch) ) @@ -3119,7 +3075,6 @@ ) (suspend) ) - (none) ) ) @@ -3172,7 +3127,6 @@ ) ) (go vent-wait-for-touch) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc index 8b5a5b8128c..598ac27b3e5 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc @@ -711,7 +711,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior crate) ja-post) ) @@ -725,7 +724,6 @@ (suspend) ) (go-virtual wait) - (none) ) :post (the-as (function none :behavior crate) crate-post) ) @@ -746,7 +744,6 @@ (logclear! (-> self mask) (process-mask sleep-code)) ) ) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self target) arg0) @@ -803,7 +800,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior crate) crate-post) ) @@ -811,21 +807,21 @@ ;; failed to figure out what this is: (defstate die (crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (case (-> self defense) (('darkeco) (cond ((= (-> proc type) target) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'darkeco)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'darkeco)))) ) (else (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) self) (set! (-> a1-5 num-params) 4) (set! (-> a1-5 message) 'attack) - (set! (-> a1-5 param 0) (-> event param 0)) + (set! (-> a1-5 param 0) (-> block param 0)) (set! (-> a1-5 param 1) (the-as uint 'darkeco)) (let ((v1-12 (+ *global-attack-id* 1))) (set! *global-attack-id* v1-12) @@ -849,7 +845,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol) (arg1 int)) (clear-collide-with-as (-> self root-override)) @@ -964,40 +959,38 @@ (suspend) ) ) - (none) ) ) ;; failed to figure out what this is: (defstate special-contents-die (crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (case (-> event param 0) - (('pickup) - (let ((gp-0 (-> self entity extra perm))) - (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) - (set! (-> gp-0 user-int8 1) (min 127 (+ (-> gp-0 user-int8 1) 1))) - (+! (-> self child-count) -1) - (when (<= (-> self child-count) 0) - (if (or (= (-> self defense) 'iron) (= (-> self defense) 'steel)) - (process-entity-status! self (entity-perm-status bit-4) #f) - ) - (process-entity-status! self (entity-perm-status dead) #t) - (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> gp-0 user-int8 0) 2) - (let ((v0-0 (logclear (-> self mask) (process-mask sleep)))) - (set! (-> self mask) v0-0) - v0-0 - ) - ) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (let ((gp-0 (-> self entity extra perm))) + (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) + (set! (-> gp-0 user-int8 1) (min 127 (+ (-> gp-0 user-int8 1) 1))) + (+! (-> self child-count) -1) + (when (<= (-> self child-count) 0) + (if (or (= (-> self defense) 'iron) (= (-> self defense) 'steel)) + (process-entity-status! self (entity-perm-status bit-4) #f) + ) + (process-entity-status! self (entity-perm-status dead) #t) + (process-entity-status! self (entity-perm-status complete) #t) + (set! (-> gp-0 user-int8 0) 2) + (let ((v0-0 (logclear (-> self mask) (process-mask sleep)))) + (set! (-> self mask) v0-0) + v0-0 + ) + ) ) + ) + ) + ) + ) ) :trans (-> (method-of-type crate die) trans) :code (behavior () @@ -1033,7 +1026,6 @@ (suspend) ) ) - (none) ) ) @@ -1368,7 +1360,6 @@ (if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0)) (spool-push *art-control* (-> self victory-anim name) 0 self -99.0) ) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1398,7 +1389,6 @@ ) (set! (-> self root-override trans y) (-> self base y)) ) - (none) ) :post (the-as (function none :behavior crate-buzzer) #f) ) @@ -1412,7 +1402,6 @@ (suspend) ) (go-virtual wait) - (none) ) ) @@ -1467,6 +1456,5 @@ ) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc index f316f3038d9..d07e16df7d3 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc @@ -403,6 +403,5 @@ ) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc index 541ba17f23b..cf2bf2d1c50 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc @@ -105,7 +105,6 @@ ) (suspend) ) - (none) ) ) @@ -122,7 +121,6 @@ ) ) (go swingpole-stance) - (none) ) ) @@ -243,202 +241,197 @@ ;; failed to figure out what this is: (defstate manipy-idle (manipy) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (let ((v1-0 event-type)) - (the-as - object - (cond - ((= v1-0 'attackable) - (cond - ((-> event param 0) - (set! v0-0 (logior (process-mask attackable) (-> self mask))) - (set! (-> self mask) (the-as process-mask v0-0)) - ) - (else - (set! v0-0 (logclear (-> self mask) (process-mask attackable))) - (set! (-> self mask) (the-as process-mask v0-0)) - ) - ) - v0-0 + (case message + (('attackable) + (cond + ((-> block param 0) + (set! v0-0 (logior (process-mask attackable) (-> self mask))) + (set! (-> self mask) (the-as process-mask v0-0)) + ) + (else + (set! v0-0 (logclear (-> self mask) (process-mask attackable))) + (set! (-> self mask) (the-as process-mask v0-0)) ) - ((= v1-0 'blend-shape) - (cond - ((-> event param 0) - (set! v0-0 (logior (-> self skel status) (janim-status blerc eye))) - (set! (-> self skel status) (the-as janim-status v0-0)) - ) - (else - (set! v0-0 (logclear (-> self skel status) (janim-status blerc eye))) - (set! (-> self skel status) (the-as janim-status v0-0)) - ) - ) - v0-0 + ) + v0-0 + ) + (('blend-shape) + (cond + ((-> block param 0) + (set! v0-0 (logior (-> self skel status) (janim-status blerc eye))) + (set! (-> self skel status) (the-as janim-status v0-0)) + ) + (else + (set! v0-0 (logclear (-> self skel status) (janim-status blerc eye))) + (set! (-> self skel status) (the-as janim-status v0-0)) ) - ((= v1-0 'shadow) - (cond - ((-> event param 0) - (set! v0-0 (-> self shadow-backup)) - (set! (-> self draw shadow) (the-as shadow-geo v0-0)) - v0-0 - ) - (else - (set! (-> self draw shadow) #f) - #f + ) + v0-0 + ) + (('shadow) + (cond + ((-> block param 0) + (set! v0-0 (-> self shadow-backup)) + (set! (-> self draw shadow) (the-as shadow-geo v0-0)) + v0-0 + ) + (else + (set! (-> self draw shadow) #f) + #f + ) + ) + ) + (('trans-hook) + (set! v0-0 (-> block param 0)) + (set! (-> self new-trans-hook) (the-as (function none) v0-0)) + v0-0 + ) + (('post-hook) + (set! v0-0 (-> block param 0)) + (set! (-> self new-post-hook) (the-as (function none) v0-0)) + v0-0 + ) + (('eval) + ((the-as (function manipy none) (-> block param 0)) self) + ) + (('become-hud-object) + (convert-to-hud-object self (the-as hud (-> block param 0))) + ) + (('event-hook) + (set! v0-0 (-> block param 0)) + (set! (-> self cur-event-hook) (the-as (function none) v0-0)) + v0-0 + ) + (('art-joint-anim) + (set! (-> self new-joint-anim) + (the-as + art-joint-anim + (lookup-art (-> self draw art-group) (the-as string (-> block param 0)) art-joint-anim) ) ) - ) - ((= v1-0 'trans-hook) - (set! v0-0 (-> event param 0)) - (set! (-> self new-trans-hook) (the-as (function none) v0-0)) - v0-0 - ) - ((= v1-0 'post-hook) - (set! v0-0 (-> event param 0)) - (set! (-> self new-post-hook) (the-as (function none) v0-0)) + (set! v0-0 (-> block param 1)) + (set! (-> self new-joint-anim-blend) (the-as uint v0-0)) + v0-0 + ) + (('anim-mode) + (when (nonzero? (-> self skel)) + (set! (-> self anim-mode) (the-as symbol (-> block param 0))) + (if (= (-> self anim-mode) 'clone-anim) + (ja-post) + ) + (-> self anim-mode) + ) + ) + (('origin-joint-index 'center-joint) + (set! (-> self draw origin-joint-index) (-> block param 0)) + (set! v0-0 (-> block param 0)) + (set! (-> self draw shadow-joint-index) (the-as uint v0-0)) + v0-0 + ) + (('max-vis-dist) + (set! (-> self draw lod-set lod (-> self draw lod-set max-lod) dist) (the-as float (-> block param 0))) + ) + (('grab) + (set! (-> self cur-grab-handle) (process->handle (the-as process (-> block param 0)))) + (let ((v1-30 (handle->process (-> self cur-grab-handle)))) + (when v1-30 + (set! v0-0 (-> self old-grab-pos)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as process-drawable v1-30) root trans quad)) v0-0 ) - ((= v1-0 'eval) - (the-as object ((the-as (function manipy none) (-> event param 0)) self)) - ) - ((= v1-0 'become-hud-object) - (the-as object (convert-to-hud-object self (the-as hud (-> event param 0)))) - ) - ((= v1-0 'event-hook) - (set! v0-0 (-> event param 0)) - (set! (-> self cur-event-hook) (the-as (function none) v0-0)) + ) + ) + (('target) + (set! v0-0 (process->handle (the-as process (-> block param 0)))) + (set! (-> self cur-target-handle) (the-as handle v0-0)) + v0-0 + ) + (('trans) + (cond + ((type-type? (-> self root type) collide-shape) + (move-to-point! (the-as collide-shape (-> self root)) (the-as vector (-> block param 0))) + ) + (else + (set! v0-0 (-> self root trans)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> block param 0)) quad)) v0-0 ) - ((= v1-0 'art-joint-anim) - (set! (-> self new-joint-anim) - (the-as - art-joint-anim - (lookup-art (-> self draw art-group) (the-as string (-> event param 0)) art-joint-anim) + ) + ) + (('rot) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (matrix-rotate-y! s5-0 (the-as float (-> block param 0))) + (matrix->quaternion (-> self root quat) s5-0) + ) + ) + (('rot-quat) + (quaternion-copy! (-> self root quat) (the-as quaternion (-> block param 0))) + ) + (('clone-copy-trans) + (set! v0-0 (-> block param 0)) + (set! (-> self clone-copy-trans) (the-as symbol v0-0)) + v0-0 + ) + (('release) + (set! (-> self cur-grab-handle) (the-as handle #f)) + #f + ) + (('draw) + (set! (-> self draw?) (the-as symbol (-> block param 0))) + (cond + ((-> block param 0) + (let ((v1-47 (logtest? (-> self draw status) (draw-status hidden)))) + (logclear! (-> self draw status) (draw-status hidden)) + (when v1-47 + (cond + ((nonzero? (-> self skel)) + (let ((gp-1 (-> self skel status))) + (logior! (-> self skel status) (janim-status inited)) + (set! v0-0 (ja-post)) + (set! (-> self skel status) gp-1) ) + v0-0 ) - (set! v0-0 (-> event param 1)) - (set! (-> self new-joint-anim-blend) (the-as uint v0-0)) - v0-0 - ) - ((= v1-0 'anim-mode) - (when (nonzero? (-> self skel)) - (set! (-> self anim-mode) (the-as symbol (-> event param 0))) - (if (= (-> self anim-mode) 'clone-anim) - (ja-post) - ) - (-> self anim-mode) - ) - ) - ((or (= v1-0 'origin-joint-index) (= v1-0 'center-joint)) - (set! (-> self draw origin-joint-index) (-> event param 0)) - (set! v0-0 (-> event param 0)) - (set! (-> self draw shadow-joint-index) (the-as uint v0-0)) - v0-0 - ) - ((= v1-0 'max-vis-dist) - (set! (-> self draw lod-set lod (-> self draw lod-set max-lod) dist) (the-as float (-> event param 0))) - ) - ((= v1-0 'grab) - (set! (-> self cur-grab-handle) (process->handle (the-as process (-> event param 0)))) - (let ((v1-30 (handle->process (-> self cur-grab-handle)))) - (when v1-30 - (set! v0-0 (-> self old-grab-pos)) - (set! (-> (the-as vector v0-0) quad) (-> (the-as process-drawable v1-30) root trans quad)) - v0-0 - ) - ) - ) - ((= v1-0 'target) - (set! v0-0 (process->handle (the-as process (-> event param 0)))) - (set! (-> self cur-target-handle) (the-as handle v0-0)) - v0-0 - ) - ((= v1-0 'trans) - (cond - ((type-type? (-> self root type) collide-shape) - (the-as object (move-to-point! (the-as collide-shape (-> self root)) (the-as vector (-> event param 0)))) - ) - (else - (set! v0-0 (-> self root trans)) - (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> event param 0)) quad)) - v0-0 - ) - ) - ) - ((= v1-0 'rot) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (matrix-rotate-y! s5-0 (the-as float (-> event param 0))) - (matrix->quaternion (-> self root quat) s5-0) - ) - ) - ((= v1-0 'rot-quat) - (quaternion-copy! (-> self root quat) (the-as quaternion (-> event param 0))) - ) - ((= v1-0 'clone-copy-trans) - (set! v0-0 (-> event param 0)) - (set! (-> self clone-copy-trans) (the-as symbol v0-0)) - v0-0 - ) - ((= v1-0 'release) - (set! (-> self cur-grab-handle) (the-as handle #f)) - #f - ) - ((= v1-0 'draw) - (set! (-> self draw?) (the-as symbol (-> event param 0))) - (cond - ((-> event param 0) - (let ((v1-47 (logtest? (-> self draw status) (draw-status hidden)))) - (logclear! (-> self draw status) (draw-status hidden)) - (when v1-47 - (cond - ((nonzero? (-> self skel)) - (let ((gp-1 (-> self skel status))) - (logior! (-> self skel status) (janim-status inited)) - (set! v0-0 (the-as object (ja-post))) - (set! (-> self skel status) gp-1) - ) - v0-0 - ) - (else - (the-as object (ja-post)) - ) - ) + (else + (ja-post) ) ) ) - (else - (set! v0-0 (logior (-> self draw status) (draw-status hidden))) - (set! (-> self draw status) (the-as draw-status v0-0)) - v0-0 - ) - ) - ) - ((= v1-0 'query) - (case (-> event param 0) - (('grab) - (handle->process (-> self cur-grab-handle)) - ) - (('done) - (case (-> self anim-mode) - (('play1 'play) - (>= (ja-frame-num 0) (the float (+ (-> (ja-group) data 0 length) -2))) - ) - ) - ) - ) + ) + ) + (else + (set! v0-0 (logior (-> self draw status) (draw-status hidden))) + (set! (-> self draw status) (the-as draw-status v0-0)) + v0-0 ) - ((= v1-0 'set-frame-num) - (let ((v1-73 (-> self skel root-channel 0))) - (set! (-> v1-73 num-func) num-func-identity) - (set! (-> v1-73 frame-num) (the-as float (-> event param 0))) + ) + ) + (('query) + (case (-> block param 0) + (('grab) + (handle->process (-> self cur-grab-handle)) + ) + (('done) + (case (-> self anim-mode) + (('play1 'play) + (>= (ja-frame-num 0) (the float (+ (-> (ja-group) data 0 length) -2))) ) - ) - (else - (if (-> self cur-event-hook) - (the-as object ((-> self cur-event-hook))) - ) ) ) + ) + ) + (('set-frame-num) + (let ((v1-73 (-> self skel root-channel 0))) + (set! (-> v1-73 num-func) num-func-identity) + (set! (-> v1-73 frame-num) (the-as float (-> block param 0))) + ) + ) + (else + (if (-> self cur-event-hook) + ((-> self cur-event-hook)) + ) ) ) ) @@ -475,7 +468,6 @@ ) ) ((-> self cur-trans-hook)) - (none) ) :code (behavior () (logclear! (-> self mask) (process-mask heap-shrunk)) @@ -533,7 +525,6 @@ ) ) ) - (none) ) ) @@ -670,7 +661,6 @@ (part-tracker-notify) (suspend) 0 - (none) ) ) @@ -1158,26 +1148,25 @@ ;; failed to figure out what this is: (defstate camera-tracker-process (camera-tracker) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 uint)) - (the-as object (case event-type - (('message) - (set! v0-0 (-> event param 0)) - (set! (-> self message) (the-as basic v0-0)) - v0-0 - ) - (('mask) - (set! v0-0 (-> event param 0)) - (set! (-> self mask-to-clear) (the-as process-mask v0-0)) - v0-0 - ) - (('border) - (set! v0-0 (-> event param 0)) - (set! (-> self border-value) (the-as basic v0-0)) - v0-0 - ) - ) - ) + (case message + (('message) + (set! v0-0 (-> block param 0)) + (set! (-> self message) (the-as basic v0-0)) + v0-0 + ) + (('mask) + (set! v0-0 (-> block param 0)) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) + v0-0 + ) + (('border) + (set! v0-0 (-> block param 0)) + (set! (-> self border-value) (the-as basic v0-0)) + v0-0 + ) + ) ) :enter (behavior () (if (-> self entity) @@ -1189,14 +1178,12 @@ (add-setting! 'process-mask 'set 0.0 (-> self mask-to-clear)) (add-setting! 'movie (process->ppointer self) 0.0 0) (hide-hud-quick) - (none) ) :exit (behavior () (if (-> self entity) (set-or-clear-status! (-> self entity) (entity-perm-status bit-3) #f) ) (send-event *camera* 'clear-entity) - (none) ) :code (behavior () (cond @@ -1216,7 +1203,6 @@ (suspend) (suspend) 0 - (none) ) ) @@ -1342,7 +1328,6 @@ ) (suspend) ) - (none) ) ) :post (the-as (function none :behavior med-res-level) ja-post) @@ -1426,8 +1411,8 @@ ;; failed to figure out what this is: (defstate part-spawner-active (part-spawner) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('stop) (process-entity-status! self (entity-perm-status complete) #t) (set! (-> self enable) #f) @@ -1439,7 +1424,7 @@ #t ) (('trans) - (let ((v0-1 (the-as object (-> (the-as vector (-> event param 0)) quad)))) + (let ((v0-1 (the-as object (-> (the-as vector (-> block param 0)) quad)))) (set! (-> self root trans quad) (the-as uint128 v0-1)) v0-1 ) @@ -1456,7 +1441,6 @@ ) (suspend) ) - (none) ) ) @@ -1832,13 +1816,13 @@ ;; failed to figure out what this is: (defstate cam-launcher-shortfall (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -1861,13 +1845,11 @@ (set! (-> self blend-to-type) (the-as uint 0)) 0 ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (let ((gp-0 (-> *display* base-frame-counter))) @@ -1882,7 +1864,6 @@ (suspend) ) ) - (none) ) ) @@ -1905,13 +1886,13 @@ ;; failed to figure out what this is: (defstate cam-launcher-longfall (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('teleport) #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -1927,14 +1908,12 @@ (cam-calc-follow! (-> self tracking) (-> self trans) #f) (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (cam-launcher-long-joystick) - (none) ) :code (behavior () (let ((gp-0 (-> *display* base-frame-counter))) @@ -1995,19 +1974,18 @@ (suspend) ) ) - (none) ) ) ;; failed to figure out what this is: (defstate launcher-idle (launcher) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('instant-death) (go launcher-deactivated) ) (('trans) - (move-to-point! (-> self root-override) (the-as vector (-> event param 0))) + (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) (update-transforms! (-> self root-override)) ) ) @@ -2041,24 +2019,23 @@ ) ) ) - (none) ) :code (the-as (function none :behavior launcher) anim-loop) ) ;; failed to figure out what this is: (defstate launcher-active (launcher) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (when (or (= event-type 'touch) (= event-type 'attack)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (or (= message 'touch) (= message 'attack)) (set! (-> self state-time) (-> *display* base-frame-counter)) (send-event proc 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) (cond - ((= event-type 'instant-death) + ((= message 'instant-death) (go launcher-deactivated) ) - ((= event-type 'trans) - (move-to-point! (-> self root-override) (the-as vector (-> event param 0))) + ((= message 'trans) + (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) (update-transforms! (-> self root-override)) ) ) @@ -2073,7 +2050,6 @@ (set! (-> v1-0 parms mask) (sound-mask volume time)) (-> v1-0 id) ) - (none) ) :trans (behavior () (if (or (or (not *target*) (< (-> self active-distance) @@ -2094,12 +2070,10 @@ ) (send-event *target* 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) - (none) ) :code (behavior () (sound-play "launch-start") (anim-loop) - (none) ) ) @@ -2234,100 +2208,99 @@ ;; failed to figure out what this is: (defstate touch-tracker-idle (touch-tracker) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (the-as object (case event-type - (('touched) - (let ((v1-1 (ppointer->process (-> self parent)))) - (when (!= v1-1 proc) - (cond - ((= (-> self event) 'attack) - (cond - ((= (-> proc type) target) - (send-event - proc - (-> self event) - :from (the-as process v1-1) - #f - (static-attack-info ((mode (the-as symbol (-> self event-mode))))) - ) - ) - ((= (-> v1-1 type) target) - (send-event - proc - (-> self event) - :from (the-as process v1-1) - #f - (-> self event-mode) - (-> *target* control unknown-dword50) - (-> *target* control unknown-dword51) - ) - ) - (else - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) (the-as process v1-1)) - (set! (-> a1-5 num-params) 4) - (set! (-> a1-5 message) (-> self event)) - (set! (-> a1-5 param 0) (the-as uint #f)) - (set! (-> a1-5 param 1) (the-as uint (-> self event-mode))) - (let ((v1-19 (+ *global-attack-id* 1))) - (set! *global-attack-id* v1-19) - (set! (-> a1-5 param 2) (the-as uint v1-19)) - ) - (set! (-> a1-5 param 3) (the-as uint 0)) - (send-event-function proc a1-5) - ) - ) - ) - ) - ((-> self event) - (send-event proc (-> self event) :from (the-as process v1-1)) - ) - (else - (let ((t0-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> t0-5 from) proc) - (set! (-> t0-5 num-params) arg1) - (set! (-> t0-5 message) event-type) - (set! (-> t0-5 param 0) (-> event param 0)) - (set! (-> t0-5 param 1) (-> event param 1)) - (set! (-> t0-5 param 2) (-> event param 2)) - (set! (-> t0-5 param 3) (-> event param 3)) - (set! (-> t0-5 param 4) (-> event param 4)) - (set! (-> t0-5 param 5) (-> event param 5)) - (set! (-> t0-5 param 6) (-> event param 6)) - (send-event-function v1-1 t0-5) - ) - ) - ) - ) - ) - ) - (('target) - (set! v0-0 (process->handle (the-as process (-> event param 0)))) - (set! (-> self target) (the-as handle v0-0)) - v0-0 - ) - (('event) - (set! (-> self event) (the-as symbol (-> event param 0))) - (set! v0-0 (-> event param 1)) - (set! (-> self event-mode) (the-as basic v0-0)) - v0-0 - ) - (('exit) - (set! v0-0 (-> event param 0)) - (set! (-> self run-function) (the-as (function object) v0-0)) - v0-0 - ) - (('eval) - (the-as object ((the-as (function touch-tracker none) (-> event param 0)) self)) - ) - (('function) - (set! v0-0 (-> event param 0)) - (set! (-> self callback) (the-as (function touch-tracker none) v0-0)) - v0-0 + (case message + (('touched) + (let ((v1-1 (ppointer->process (-> self parent)))) + (when (!= v1-1 proc) + (cond + ((= (-> self event) 'attack) + (cond + ((= (-> proc type) target) + (send-event + proc + (-> self event) + :from (the-as process v1-1) + #f + (static-attack-info ((mode (the-as symbol (-> self event-mode))))) + ) + ) + ((= (-> v1-1 type) target) + (send-event + proc + (-> self event) + :from (the-as process v1-1) + #f + (-> self event-mode) + (-> *target* control unknown-dword50) + (-> *target* control unknown-dword51) + ) + ) + (else + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (the-as process v1-1)) + (set! (-> a1-5 num-params) 4) + (set! (-> a1-5 message) (-> self event)) + (set! (-> a1-5 param 0) (the-as uint #f)) + (set! (-> a1-5 param 1) (the-as uint (-> self event-mode))) + (let ((v1-19 (+ *global-attack-id* 1))) + (set! *global-attack-id* v1-19) + (set! (-> a1-5 param 2) (the-as uint v1-19)) ) - ) - ) + (set! (-> a1-5 param 3) (the-as uint 0)) + (send-event-function proc a1-5) + ) + ) + ) + ) + ((-> self event) + (send-event proc (-> self event) :from (the-as process v1-1)) + ) + (else + (let ((t0-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> t0-5 from) proc) + (set! (-> t0-5 num-params) argc) + (set! (-> t0-5 message) message) + (set! (-> t0-5 param 0) (-> block param 0)) + (set! (-> t0-5 param 1) (-> block param 1)) + (set! (-> t0-5 param 2) (-> block param 2)) + (set! (-> t0-5 param 3) (-> block param 3)) + (set! (-> t0-5 param 4) (-> block param 4)) + (set! (-> t0-5 param 5) (-> block param 5)) + (set! (-> t0-5 param 6) (-> block param 6)) + (send-event-function v1-1 t0-5) + ) + ) + ) + ) + ) + ) + (('target) + (set! v0-0 (process->handle (the-as process (-> block param 0)))) + (set! (-> self target) (the-as handle v0-0)) + v0-0 + ) + (('event) + (set! (-> self event) (the-as symbol (-> block param 0))) + (set! v0-0 (-> block param 1)) + (set! (-> self event-mode) (the-as basic v0-0)) + v0-0 + ) + (('exit) + (set! v0-0 (-> block param 0)) + (set! (-> self run-function) (the-as (function object) v0-0)) + v0-0 + ) + (('eval) + ((the-as (function touch-tracker none) (-> block param 0)) self) + ) + (('function) + (set! v0-0 (-> block param 0)) + (set! (-> self callback) (the-as (function touch-tracker none) v0-0)) + v0-0 + ) + ) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -2367,7 +2340,6 @@ (clear-collide-with-as (-> self root-override)) (suspend) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc index 9550c418563..a5f62189472 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc @@ -36,6 +36,7 @@ ) ;; definition for method 9 of type trajectory +;; INFO: this function exists in multiple non-identical object files (defmethod eval-position! trajectory ((obj trajectory) (time float) (result vector)) (vector+float*! result (-> obj initial-position) (-> obj initial-velocity) time) (+! (-> result y) (* 0.5 time time (-> obj gravity))) @@ -149,7 +150,7 @@ (send-event arg0 'get-attack-count 1) (logclear! (-> obj mask) (process-mask actor-pause attackable)) (go (method-of-object obj nav-enemy-die)) - (the-as object 'die) + 'die ) ;; definition for method 43 of type nav-enemy @@ -169,26 +170,22 @@ ;; definition for function nav-enemy-send-attack ;; INFO: Return type mismatch symbol vs object. (defbehavior nav-enemy-send-attack nav-enemy ((arg0 process) (arg1 touching-shapes-entry) (arg2 symbol)) - (the-as - object - (when (send-event - arg0 - 'attack - arg1 - (static-attack-info - ((shove-back (-> self nav-info attack-shove-back)) (shove-up (-> self nav-info attack-shove-up)) (mode arg2)) - ) + (when (send-event + arg0 + 'attack + arg1 + (static-attack-info + ((shove-back (-> self nav-info attack-shove-back)) (shove-up (-> self nav-info attack-shove-up)) (mode arg2)) ) - (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) - #t - ) + ) + (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) + #t ) ) ;; definition for function nav-enemy-default-event-handler ;; INFO: Used lq/sq -;; INFO: Return type mismatch object vs none. (defbehavior nav-enemy-default-event-handler nav-enemy ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) @@ -219,7 +216,10 @@ (('cue-jump-to-point) (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) (set! (-> self event-param-point quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) + (let ((v0-0 (the-as object (logclear (-> self nav-enemy-flags) (nav-enemy-flags navenmf11))))) + (set! (-> self nav-enemy-flags) (the-as nav-enemy-flags v0-0)) + v0-0 + ) ) ) (('cue-chase) @@ -232,7 +232,6 @@ (go-virtual nav-enemy-wait-for-cue) ) ) - (none) ) ;; definition for function nav-enemy-jump-event-handler @@ -250,17 +249,18 @@ ) ;; definition for function process-drawable-death-event-handler -;; INFO: Return type mismatch object vs none. (defbehavior process-drawable-death-event-handler process-drawable ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('death-start) (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0) ) (('death-end) - (logior! (-> self draw status) (draw-status hidden)) + (let ((v0-0 (the-as object (logior (-> self draw status) (draw-status hidden))))) + (set! (-> self draw status) (the-as draw-status v0-0)) + v0-0 + ) ) ) - (none) ) ;; failed to figure out what this is: @@ -818,10 +818,7 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-idle (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (nav-enemy-neck-control-inactive) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -830,7 +827,6 @@ nav-enemy-default-event-handler ) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1 navenmf2)) (set! (-> self state-timeout) (seconds 1)) - (none) ) :trans (behavior () (if (and (and *target* (>= (-> self enemy-info idle-distance) @@ -843,7 +839,6 @@ nav-enemy-default-event-handler ) (go-virtual nav-enemy-patrol) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -855,7 +850,6 @@ nav-enemy-default-event-handler (ja :num! (loop! f30-0)) ) ) - (none) ) :post (the-as (function none :behavior nav-enemy) ja-post) ) @@ -863,10 +857,7 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-patrol (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self nav flags) @@ -879,11 +870,9 @@ nav-enemy-default-event-handler (set! (-> self acceleration) (-> self nav-info walk-acceleration)) (set! (-> self rotate-speed) (-> self nav-info walk-rotate-speed)) (set! (-> self turn-time) (-> self nav-info walk-turn-time)) - (none) ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) @@ -916,7 +905,6 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-notice) ) ) - (none) ) :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) @@ -967,7 +955,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) :post nav-enemy-patrol-post ) @@ -975,10 +962,7 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-notice (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-neck-control-look-at) @@ -994,7 +978,6 @@ nav-enemy-default-event-handler (nav-control-method-11 (-> self nav) (-> self nav target-pos)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1015,7 +998,6 @@ nav-enemy-default-event-handler ) ) (go-virtual nav-enemy-chase) - (none) ) :post nav-enemy-simple-post ) @@ -1028,13 +1010,9 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-flee (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-time)) @@ -1049,7 +1027,6 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-patrol) ) ) - (none) ) :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) @@ -1074,7 +1051,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) :post nav-enemy-face-player-post ) @@ -1109,10 +1085,7 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-chase (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (nav-enemy-neck-control-look-at) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1123,7 +1096,6 @@ nav-enemy-default-event-handler (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) (nav-enemy-reset-frustration) - (none) ) :trans (behavior () (if (logtest? (-> *target* state-flags) (state-flags do-not-notice)) @@ -1161,7 +1133,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1173,7 +1144,6 @@ nav-enemy-default-event-handler (ja :num! (loop! f30-0)) ) ) - (none) ) :post nav-enemy-chase-post ) @@ -1181,10 +1151,7 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-stop-chase (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (let* ((f30-0 (vector-vector-distance (-> self collide-info trans) (target-pos 0))) @@ -1199,7 +1166,6 @@ nav-enemy-default-event-handler (set! (-> self acceleration) (-> self nav-info walk-acceleration)) (set! (-> self rotate-speed) (-> self nav-info walk-rotate-speed)) (set! (-> self turn-time) (-> self nav-info walk-turn-time)) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) @@ -1219,7 +1185,6 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-stare) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1231,7 +1196,6 @@ nav-enemy-default-event-handler (ja :num! (loop! f30-0)) ) ) - (none) ) :post nav-enemy-chase-post ) @@ -1239,10 +1203,7 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-stare (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) @@ -1257,11 +1218,9 @@ nav-enemy-default-event-handler (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) (set! (-> self collide-info transv quad) (-> *null-vector* quad)) - (none) ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) @@ -1303,11 +1262,9 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-give-up) ) ) - (none) ) :code (behavior () (go-virtual nav-enemy-give-up) - (none) ) :post nav-enemy-face-player-post ) @@ -1315,15 +1272,11 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-give-up (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (nav-enemy-neck-control-inactive) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) @@ -1331,11 +1284,9 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-chase) ) ) - (none) ) :code (behavior () (go-virtual nav-enemy-patrol) - (none) ) :post nav-enemy-simple-post ) @@ -1343,13 +1294,9 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-attack (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :code (behavior () (go-virtual nav-enemy-victory) - (none) ) :post nav-enemy-simple-post ) @@ -1357,13 +1304,9 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-victory (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self collide-info transv quad) (-> *null-vector* quad)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1378,7 +1321,6 @@ nav-enemy-default-event-handler ) ) (go-virtual nav-enemy-stare) - (none) ) :post nav-enemy-simple-post ) @@ -1392,7 +1334,6 @@ nav-enemy-default-event-handler ) :enter (behavior () (send-event (ppointer->process (-> self parent)) 'child-die) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1412,7 +1353,6 @@ nav-enemy-default-event-handler (suspend) ) (cleanup-for-death self) - (none) ) :post nav-enemy-death-post ) @@ -1448,7 +1388,6 @@ nav-enemy-default-event-handler ) ) (cleanup-for-death self) - (none) ) ) @@ -1621,11 +1560,9 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-jump-blocked) ) (nav-enemy-initialize-jump (-> self event-param-point)) - (none) ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) - (none) ) :code (behavior () (nav-enemy-execute-jump) @@ -1638,7 +1575,6 @@ nav-enemy-default-event-handler ) ) (go-virtual nav-enemy-jump-land) - (none) ) :post nav-enemy-jump-post ) @@ -1697,10 +1633,7 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-jump-land (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self nav flags) (nav-control-flags navcf19)) @@ -1712,7 +1645,6 @@ nav-enemy-default-event-handler (vector-xz-normalize! gp-0 16384.0) (vector+! (-> self nav target-pos) (-> self collide-info trans) gp-0) ) - (none) ) :trans (behavior () (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) @@ -1720,12 +1652,10 @@ nav-enemy-default-event-handler ) (go-virtual nav-enemy-chase) ) - (none) ) :code (behavior () (nav-enemy-jump-land-anim) (go (-> self jump-return-state)) - (none) ) :post nav-enemy-jump-land-post ) @@ -1733,19 +1663,14 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-jump-blocked (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) (go (-> self jump-return-state)) ) - (none) ) :code (behavior () (when (not (ja-group? (-> self draw art-group data (-> self nav-info idle-anim)))) @@ -1760,7 +1685,6 @@ nav-enemy-default-event-handler (ja :num! (loop! f30-0)) ) ) - (none) ) :post nav-enemy-simple-post ) @@ -1768,10 +1692,7 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-wait-for-cue (nav-enemy) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior nav-enemy) - nav-enemy-default-event-handler - ) + :event nav-enemy-default-event-handler :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) @@ -1795,7 +1716,6 @@ nav-enemy-default-event-handler ) ) (go-virtual nav-enemy-jump-to-point) - (none) ) :post nav-enemy-simple-post ) @@ -1806,11 +1726,9 @@ nav-enemy-default-event-handler :event nav-enemy-jump-event-handler :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) - (none) ) :trans (behavior () 0 - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1827,7 +1745,6 @@ nav-enemy-default-event-handler (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (nav-enemy-jump-land-anim) (go-virtual nav-enemy-wait-for-cue) - (none) ) :post nav-enemy-jump-post ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/orb-cache_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/orb-cache_REF.gc index fe498dba589..38c0640dc99 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/orb-cache_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/orb-cache_REF.gc @@ -53,8 +53,8 @@ ;; failed to figure out what this is: (defstate orb-cache-top-idle (orb-cache-top) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('eco-blue) (process-entity-status! self (entity-perm-status complete) #t) (dotimes (gp-0 5) @@ -64,7 +64,7 @@ (go orb-cache-top-activate #f) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -80,7 +80,6 @@ (game-task none) ) ) - (none) ) :code (behavior ((arg0 symbol)) (if (and (not arg0) (-> self child)) @@ -97,7 +96,6 @@ (ja :group! (-> self draw art-group data 3) :num! (identity (ja-aframe 0.0 0))) (transform-post) (anim-loop) - (none) ) ) @@ -215,7 +213,6 @@ :event (the-as (function process int symbol event-message-block object :behavior orb-cache-top) plat-event) :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :trans (the-as (function none :behavior orb-cache-top) plat-trans) :code (behavior ((arg0 symbol)) @@ -283,7 +280,6 @@ (go orb-cache-top-idle arg0) ) ) - (none) ) :post (the-as (function none :behavior orb-cache-top) plat-post) ) @@ -300,7 +296,6 @@ (new 'stack-no-clear 'vector) (set! (-> self basetrans y) (+ 2048.0 (-> self root-pos))) (anim-loop) - (none) ) :post (the-as (function none :behavior orb-cache-top) plat-post) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/plat-button_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/plat-button_REF.gc index 621c72ededd..6212e96ab30 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/plat-button_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/plat-button_REF.gc @@ -71,12 +71,12 @@ ;; failed to figure out what this is: (defstate plat-button-idle (plat-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (when (can-activate? self) (if (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self root-override) (the-as uint 1) ) @@ -118,7 +118,6 @@ (suspend) ) ) - (none) ) ) @@ -139,7 +138,6 @@ ) (ja-post) (go-virtual plat-button-idle) - (none) ) ) @@ -159,7 +157,6 @@ (go-virtual plat-button-move-downward) (go-virtual plat-button-move-upward) ) - (none) ) :post (the-as (function none :behavior plat-button) rider-post) ) @@ -187,24 +184,21 @@ ;; failed to figure out what this is: (defstate plat-button-move-downward (plat-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (when (or (= event-type 'touch) (= event-type 'attack)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - #f - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (or (= message 'touch) (= message 'attack)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + #f + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (process-entity-status! self (entity-perm-status bit-3) #t) (plat-button-camera-on) (set-setting! 'allow-look-around #f 0.0 0) - (none) ) :exit (behavior () (plat-button-camera-off) (remove-setting! 'allow-look-around) - (none) ) :trans (behavior () (if (= (-> self path-pos) 1.0) @@ -253,7 +247,6 @@ (if (and (-> self grab-player?) (< 0.2 (-> self path-pos))) (set! (-> self grab-player?) (not (process-release? *target*))) ) - (none) ) :code (the-as (function none :behavior plat-button) anim-loop) :post (the-as (function none :behavior plat-button) rider-post) @@ -262,24 +255,21 @@ ;; failed to figure out what this is: (defstate plat-button-move-upward (plat-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (when (or (= event-type 'touch) (= event-type 'attack)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - #f - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (or (= message 'touch) (= message 'attack)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + #f + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (process-entity-status! self (entity-perm-status bit-3) #t) (plat-button-camera-on) (set-setting! 'allow-look-around #f 0.0 0) - (none) ) :exit (behavior () (plat-button-camera-off) (remove-setting! 'allow-look-around) - (none) ) :trans (behavior () (if (= (-> self path-pos) 0.0) @@ -328,7 +318,6 @@ (if (and (-> self grab-player?) (< (-> self path-pos) 0.8)) (set! (-> self grab-player?) (not (process-release? *target*))) ) - (none) ) :code (the-as (function none :behavior plat-button) anim-loop) :post (the-as (function none :behavior plat-button) rider-post) @@ -351,7 +340,6 @@ ) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc index 1571954b581..a07937f2f74 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc @@ -50,8 +50,8 @@ ;; failed to figure out what this is: (defstate plat-idle (plat-eco) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('wake) (go-virtual plat-path-active (the-as plat #f)) ) @@ -68,7 +68,6 @@ ) :enter (behavior () (lods-assign! (-> self draw) (-> self unlit-look)) - (none) ) :trans (behavior () (when (and (and *target* @@ -84,13 +83,11 @@ ) (level-hint-spawn (text-id misty-eco-plat) "sksp0073" (the-as entity #f) *entity-pool* (game-task none)) ) - (none) ) :code (behavior () (ja-post) (update-transforms! (-> self root-override)) (anim-loop) - (none) ) :post (the-as (function none :behavior plat-eco) ja-post) ) @@ -98,8 +95,8 @@ ;; failed to figure out what this is: (defstate notice-blue (plat-eco) :virtual override - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('wake) (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) (go-virtual plat-path-active (the-as plat #f)) @@ -126,7 +123,6 @@ (go-virtual plat-idle) ) ) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self target) arg0) @@ -180,12 +176,10 @@ ) (suspend) ) - (none) ) :post (behavior () (plat-trans) (plat-post) - (none) ) ) @@ -220,7 +214,6 @@ ) ) ) - (none) ) :trans (behavior () (when (!= (-> self sync-offset-faux) (-> self sync-offset-dest)) @@ -232,7 +225,6 @@ ) ) ((-> (method-of-type plat plat-path-active) trans)) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/plat_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/plat_REF.gc index 0fa5e1adb70..9885a5a3492 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/plat_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/plat_REF.gc @@ -206,7 +206,6 @@ (go-virtual plat-idle) ) ) - (none) ) ) @@ -216,7 +215,6 @@ :event (the-as (function process int symbol event-message-block object :behavior plat) plat-event) :trans (behavior () (baseplat-method-20 self) - (none) ) :code (behavior () (plat-trans) @@ -236,7 +234,6 @@ (suspend) ) ) - (none) ) ) @@ -246,7 +243,6 @@ :event (the-as (function process int symbol event-message-block object :behavior plat) plat-event) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (set! (-> self path-pos) (if (logtest? (-> self fact options) (fact-options wrap-phase)) @@ -259,7 +255,6 @@ (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) - (none) ) :code (the-as (function plat none :behavior plat) anim-loop) :post (the-as (function none :behavior plat) plat-post) diff --git a/test/decompiler/reference/jak1/engine/common-obs/process-taskable_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/process-taskable_REF.gc index fd43c17b7ea..6c6c8640940 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/process-taskable_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/process-taskable_REF.gc @@ -319,7 +319,6 @@ ) (process-taskable-method-33 self) ((-> self cur-trans-hook)) - (none) ) :code process-taskable-anim-loop :post (the-as (function none :behavior process-taskable) ja-post) @@ -353,7 +352,6 @@ (go-virtual release) (process-taskable-method-33 self) ((-> self cur-trans-hook)) - (none) ) :code process-taskable-anim-loop :post (the-as (function none :behavior process-taskable) ja-post) @@ -364,7 +362,6 @@ :virtual #t :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 5)) @@ -375,7 +372,6 @@ (go-virtual idle) ) ((-> self cur-trans-hook)) - (none) ) :code process-taskable-anim-loop :post (the-as (function none :behavior process-taskable) ja-post) @@ -520,7 +516,6 @@ :trans (behavior () (process-taskable-play-anim-trans) ((-> self cur-trans-hook)) - (none) ) :code (behavior () (process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (get-accept-anim self #t)) @@ -528,7 +523,6 @@ (suspend) ) (go-virtual enter-playing) - (none) ) :post (the-as (function none :behavior process-taskable) ja-post) ) @@ -541,12 +535,10 @@ :trans (behavior () (process-taskable-play-anim-trans) ((-> self cur-trans-hook)) - (none) ) :code (behavior () (process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (get-reject-anim self #t)) (go-virtual release) - (none) ) :post (the-as (function none :behavior process-taskable) ja-post) ) @@ -564,7 +556,6 @@ #f (lookup-text! *common-text* (text-id quit) #f) ) - (none) ) :exit process-taskable-play-anim-exit :trans (behavior () @@ -596,7 +587,6 @@ (push-reject-anim self) (set! *camera-look-through-other* 2) ((-> self cur-trans-hook)) - (none) ) :code process-taskable-anim-loop :post (the-as (function none :behavior process-taskable) ja-post) @@ -605,11 +595,11 @@ ;; failed to figure out what this is: (defstate play-anim (process-taskable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('shadow) (cond - ((-> event param 0) + ((-> block param 0) (let ((v0-0 (the-as object (-> self shadow-backup)))) (set! (-> self draw shadow) (the-as shadow-geo v0-0)) v0-0 @@ -624,10 +614,10 @@ (('shadow-min-max) (let ((v1-5 (-> self draw shadow-ctrl))) (let ((a0-4 v1-5)) - (set! (-> a0-4 settings bot-plane w) (- (the-as float (-> event param 0)))) + (set! (-> a0-4 settings bot-plane w) (- (the-as float (-> block param 0)))) ) 0 - (set! (-> v1-5 settings top-plane w) (- (the-as float (-> event param 1)))) + (set! (-> v1-5 settings top-plane w) (- (the-as float (-> block param 1)))) ) 0 ) @@ -643,12 +633,10 @@ ) ) ((-> self cur-trans-hook)) - (none) ) :code (behavior () (process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (play-anim! self #t)) (process-taskable-method-38 self) - (none) ) :post (the-as (function none :behavior process-taskable) ja-post) ) @@ -668,7 +656,6 @@ ) ;; definition for function process-taskable-hide-handler -;; INFO: Return type mismatch object vs none. (defbehavior process-taskable-hide-handler process-taskable ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('clone) @@ -683,7 +670,6 @@ (go-virtual hidden-other) ) ) - (none) ) ;; definition for function process-taskable-hide-enter @@ -724,14 +710,10 @@ ;; failed to figure out what this is: (defstate hidden (process-taskable) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior process-taskable) - process-taskable-hide-handler - ) + :event process-taskable-hide-handler :enter (the-as (function none :behavior process-taskable) process-taskable-hide-enter) :exit (behavior () (process-taskable-hide-exit (= (-> self next-state name) 'hidden)) - (none) ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -740,7 +722,6 @@ (if (or (-> self been-kicked) (should-display? self)) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior process-taskable) anim-loop) ) @@ -761,14 +742,10 @@ ;; failed to figure out what this is: (defstate hidden-other (process-taskable) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior process-taskable) - process-taskable-hide-handler - ) + :event process-taskable-hide-handler :enter (the-as (function none :behavior process-taskable) process-taskable-hide-enter) :exit (behavior () (process-taskable-hide-exit (= (-> self next-state name) 'hidden-other)) - (none) ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -785,7 +762,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior process-taskable) anim-loop) ) @@ -793,11 +769,11 @@ ;; failed to figure out what this is: (defstate be-clone (process-taskable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as shadow-geo (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (the-as shadow-geo (case message (('shadow) (the-as shadow-geo (cond - ((-> event param 0) + ((-> block param 0) (let ((v0-0 (-> self shadow-backup))) (set! (-> self draw shadow) v0-0) v0-0 @@ -813,10 +789,10 @@ (('shadow-min-max) (let ((v1-5 (-> self draw shadow-ctrl))) (let ((a0-5 v1-5)) - (set! (-> a0-5 settings bot-plane w) (- (the-as float (-> event param 0)))) + (set! (-> a0-5 settings bot-plane w) (- (the-as float (-> block param 0)))) ) 0 - (set! (-> v1-5 settings top-plane w) (- (the-as float (-> event param 1)))) + (set! (-> v1-5 settings top-plane w) (- (the-as float (-> block param 1)))) ) (the-as shadow-geo 0) ) @@ -834,7 +810,6 @@ (logior! (-> self skel status) (janim-status blerc)) (logclear! (-> self mask) (process-mask actor-pause)) (set-vector! (-> self draw bounds) 0.0 (-> self draw-bounds-y-offset) 0.0 (-> self draw bounds w)) - (none) ) :exit (behavior () (logclear! (-> self skel status) (janim-status blerc spool)) @@ -845,18 +820,15 @@ ) ) (ja-channel-set! 0) - (none) ) :trans (behavior () (draw-npc-shadow self) ((-> self cur-trans-hook)) - (none) ) :code (behavior ((arg0 handle)) (clone-anim arg0 (-> self center-joint-index) #t "") (format #t "ERROR: handle invalid while ~S is cloning~%" (-> self name)) (go-virtual hidden) - (none) ) ) @@ -868,10 +840,10 @@ ;; failed to figure out what this is: (defstate idle (process-taskable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (the-as - object - (case event-type + symbol + (case message (('attack) (the-as symbol @@ -887,7 +859,7 @@ (the-as symbol (send-shove-back (-> self root-override) proc - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0 @@ -895,7 +867,7 @@ ) ) (('clone) - (the-as symbol (go-virtual be-clone (the-as handle (-> event param 0)))) + (the-as symbol (go-virtual be-clone (the-as handle (-> block param 0)))) ) (('play-anim) (logclear! (-> self mask) (process-mask actor-pause)) @@ -913,7 +885,6 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (process-taskable-clean-up-after-talking) - (none) ) :exit (behavior () (cond @@ -930,7 +901,6 @@ (apply-settings *setting-control*) ) ) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) @@ -1018,7 +988,6 @@ (go-virtual play-anim) ) ((-> self cur-trans-hook)) - (none) ) :code process-taskable-anim-loop :post (behavior () @@ -1033,7 +1002,6 @@ ) ) (transform-post) - (none) ) ) @@ -1173,9 +1141,9 @@ ;; failed to figure out what this is: (defstate othercam-running (othercam) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('die) (set! v0-0 #t) (set! (-> self die?) (the-as symbol v0-0)) @@ -1183,13 +1151,13 @@ ) (('joint) (let ((t9-0 type-type?) - (v1-1 (-> event param 0)) + (v1-1 (-> block param 0)) ) (cond ((t9-0 (rtype-of v1-1) string) (let ((v1-8 (lookup-art (-> (the-as process-taskable (-> self hand process 0)) draw jgeo) - (the-as string (-> event param 0)) + (the-as string (-> block param 0)) (the-as type #f) ) ) @@ -1201,8 +1169,8 @@ ) ) ) - ((not (logtest? (-> event param 0) 7)) - (set! v0-0 (-> event param 0)) + ((not (logtest? (-> block param 0) 7)) + (set! v0-0 (-> block param 0)) (set! (-> self cam-joint-index) (the-as int v0-0)) v0-0 ) @@ -1210,7 +1178,7 @@ ) ) (('mask) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self mask-to-clear) (the-as process-mask v0-0)) v0-0 ) @@ -1240,12 +1208,10 @@ ) ) (apply-settings *setting-control*) - (none) ) :exit (behavior () (remove-setting! 'process-mask) (apply-settings *setting-control*) - (none) ) :code (behavior () (loop @@ -1309,7 +1275,6 @@ ) ) ) - (none) ) ) @@ -1338,6 +1303,7 @@ ) ;; definition for method 48 of type process-taskable +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow process-taskable ((obj process-taskable)) (let ((gp-0 (-> obj draw shadow-ctrl))) (cond diff --git a/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc index 8d618d0f26d..c60a05f8201 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc @@ -728,13 +728,11 @@ ) (go-virtual rigid-body-platform-float) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior rigid-body-platform) ja-post) ) @@ -750,13 +748,11 @@ ) (go-virtual rigid-body-platform-idle) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior rigid-body-platform) rigid-body-platform-post) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc index 2dd6c51c229..62ef3033aa5 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc @@ -604,20 +604,20 @@ ;; failed to figure out what this is: (defstate ropebridge-idle (ropebridge) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (let ((f0-0 -1.0)) (cond - ((= event-type 'bonk) + ((= message 'bonk) (when (>= (- (-> *display* base-frame-counter) (-> self bonk-time-stamp)) (seconds 0.2)) (set! (-> self bonk-time-stamp) (-> *display* base-frame-counter)) - (set! f0-0 (the-as float (-> event param 1))) + (set! f0-0 (the-as float (-> block param 1))) (if (>= f0-0 (-> self tuning rider-bonk-max)) (set! f0-0 (-> self tuning rider-bonk-max)) ) ) ) - ((and (= event-type 'attack) (= (-> event param 1) 'flop)) - (let ((v1-17 (-> event param 2))) + ((and (= message 'attack) (= (-> block param 1) 'flop)) + (let ((v1-17 (-> block param 2))) (when (!= v1-17 (-> self player-attack-id)) (set! (-> self player-attack-id) v1-17) (set! (-> self attack-flop-time-stamp) (-> *display* base-frame-counter)) @@ -626,30 +626,27 @@ ) ) ) - (the-as - object - (when (and (>= f0-0 (-> self tuning rider-bonk-min)) (-> event param 0)) - (set! (-> self agitated-time-stamp) (-> *display* base-frame-counter)) - (let* ((f30-0 (/ (* (- f0-0 (-> self tuning rider-bonk-min)) (-> self tuning rider-bonk-force)) - (- (-> self tuning rider-bonk-max) (-> self tuning rider-bonk-min)) - ) - ) - (gp-0 (the-as object (-> event param 0))) - (a0-7 (-> (the-as touching-shapes-entry gp-0) head)) - (s4-0 (-> self root-override)) - (s5-0 (get-touched-prim a0-7 s4-0 (the-as touching-shapes-entry gp-0))) - (v1-33 ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s4-0)) - (gp-1 (new 'stack-no-clear 'vector)) - ) - (vector-matrix*! gp-1 (-> v1-33 trans) (-> self inv-world-matrix)) - (let ((s5-1 (-> s5-0 prim-id))) - (let ((v1-37 (-> self spring-point s5-1))) - (new 'stack-no-clear 'vector) - (&+ v1-37 48) - ) - (set-vel-from-impact self s5-1 gp-1 -1 f30-0) - (the-as symbol (set-vel-from-impact self (+ s5-1 1) gp-1 1 f30-0)) + (when (and (>= f0-0 (-> self tuning rider-bonk-min)) (-> block param 0)) + (set! (-> self agitated-time-stamp) (-> *display* base-frame-counter)) + (let* ((f30-0 (/ (* (- f0-0 (-> self tuning rider-bonk-min)) (-> self tuning rider-bonk-force)) + (- (-> self tuning rider-bonk-max) (-> self tuning rider-bonk-min)) + ) + ) + (gp-0 (the-as object (-> block param 0))) + (a0-7 (-> (the-as touching-shapes-entry gp-0) head)) + (s4-0 (-> self root-override)) + (s5-0 (get-touched-prim a0-7 s4-0 (the-as touching-shapes-entry gp-0))) + (v1-33 ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s4-0)) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (vector-matrix*! gp-1 (-> v1-33 trans) (-> self inv-world-matrix)) + (let ((s5-1 (-> s5-0 prim-id))) + (let ((v1-37 (-> self spring-point s5-1))) + (new 'stack-no-clear 'vector) + (&+ v1-37 48) ) + (set-vel-from-impact self s5-1 gp-1 -1 f30-0) + (set-vel-from-impact self (+ s5-1 1) gp-1 1 f30-0) ) ) ) @@ -665,7 +662,6 @@ (do-integration self) ) ) - (none) ) :post (behavior () (ja-post) @@ -677,7 +673,6 @@ ) ) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc index cce83712324..4f11806974d 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc @@ -83,13 +83,13 @@ ;; definition for method 44 of type sharkey ;; INFO: Return type mismatch symbol vs object. (defmethod touch-handler sharkey ((obj sharkey) (arg0 process) (arg1 event-message-block)) - (the-as object #t) + #t ) ;; definition for method 43 of type sharkey ;; INFO: Return type mismatch symbol vs object. (defmethod attack-handler sharkey ((obj sharkey) (arg0 process) (arg1 event-message-block)) - (the-as object #t) + #t ) ;; failed to figure out what this is: @@ -259,11 +259,9 @@ nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (cond @@ -300,7 +298,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -316,7 +313,6 @@ nav-enemy-default-event-handler ) (logior! (-> self draw status) (draw-status hidden)) (anim-loop) - (none) ) :post (the-as (function none :behavior sharkey) #f) ) @@ -332,7 +328,6 @@ nav-enemy-default-event-handler (if (sharkey-notice-player?) (go-virtual nav-enemy-chase) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -358,11 +353,9 @@ nav-enemy-default-event-handler (ja :num! (seek! max (-> self anim-speed))) ) ) - (none) ) :post (behavior () (nav-enemy-travel-post) - (none) ) ) @@ -375,11 +368,9 @@ nav-enemy-default-event-handler ) :enter (behavior () (go-virtual nav-enemy-chase) - (none) ) :code (behavior () (go-virtual nav-enemy-chase) - (none) ) ) @@ -460,11 +451,9 @@ nav-enemy-default-event-handler (sharkey-reset-position) (logior! (-> self draw status) (draw-status hidden)) (go-virtual nav-enemy-idle) - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -477,7 +466,6 @@ nav-enemy-default-event-handler ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (if (not *target*) @@ -527,7 +515,6 @@ nav-enemy-default-event-handler (set! (-> self target-speed) (-> self chase-speed)) ) ) - (none) ) :code (behavior () (set! (-> self player-water-time) (-> *display* base-frame-counter)) @@ -544,7 +531,6 @@ nav-enemy-default-event-handler (ja :num! (seek! max (-> self anim-speed))) ) ) - (none) ) :post (behavior () (sharkey-get-player-position (-> self nav target-pos)) @@ -560,7 +546,6 @@ nav-enemy-default-event-handler :position (the-as symbol (-> self collide-info trans)) ) ) - (none) ) ) @@ -585,7 +570,6 @@ nav-enemy-default-event-handler (ja :num! (seek! max (-> self anim-speed))) ) ) - (none) ) ) @@ -603,7 +587,6 @@ nav-enemy-default-event-handler (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) (go-virtual nav-enemy-patrol) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.17)) @@ -615,7 +598,6 @@ nav-enemy-default-event-handler (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) (suspend) ) - (none) ) ) @@ -639,7 +621,6 @@ nav-enemy-default-event-handler ) ) (go-virtual nav-enemy-stare) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/voicebox_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/voicebox_REF.gc index 340e83220a2..9492e38c1b6 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/voicebox_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/voicebox_REF.gc @@ -132,8 +132,8 @@ ;; failed to figure out what this is: (defstate enter (voicebox) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go-virtual exit) ) @@ -144,7 +144,6 @@ (if (< 0.1 (-> self blend)) (point-toward-point-clear-roll-pitch! (-> self root) (target-pos 0)) ) - (none) ) :code (behavior () (set-setting! 'sound-flava #f 20.0 (music-flava assistant)) @@ -171,7 +170,6 @@ ) (set! (-> self blend) 0.0) (go-virtual idle) - (none) ) :post (the-as (function none :behavior voicebox) ja-post) ) @@ -186,7 +184,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior voicebox) ja-post) ) @@ -214,7 +211,6 @@ (send-event (ppointer->process (-> self parent-override)) 'go empty-state) (suspend) 0 - (none) ) :post (the-as (function none :behavior voicebox) ja-post) ) @@ -241,7 +237,6 @@ (if (not (logtest? (-> *camera* master-options) 2)) (deactivate self) ) - (none) ) :code (-> cam-string code) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/water-anim_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/water-anim_REF.gc index a1409d7f297..458612a35c3 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/water-anim_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/water-anim_REF.gc @@ -536,21 +536,20 @@ ;; failed to figure out what this is: (defstate water-vol-idle (water-anim) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('move-to) - (set! (-> self root trans quad) (-> (the-as vector (-> event param 0)) quad)) - (set! (-> self water-height) (-> self root trans y)) - (if (nonzero? (-> self sound)) - (update-trans! (-> self sound) (-> self root trans)) - ) - (let ((v0-0 (logclear (-> self mask) (process-mask sleep-code)))) - (set! (-> self mask) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('move-to) + (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self water-height) (-> self root trans y)) + (if (nonzero? (-> self sound)) + (update-trans! (-> self sound) (-> self root trans)) + ) + (let ((v0-0 (logclear (-> self mask) (process-mask sleep-code)))) + (set! (-> self mask) v0-0) + v0-0 + ) + ) + ) ) :trans (behavior () (let ((t9-0 (-> (method-of-type water-vol water-vol-idle) trans))) @@ -565,7 +564,6 @@ (if (and (-> self play-ambient-sound?) (nonzero? (-> self sound))) (update! (-> self sound)) ) - (none) ) :code (behavior () (loop @@ -573,7 +571,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc index 9f817bff4c7..199c8b7de43 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc @@ -1292,28 +1292,24 @@ :virtual #t :code (behavior () (go-virtual water-vol-idle) - (none) ) ) ;; failed to figure out what this is: (defstate water-vol-idle (water-vol) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('update) - (the-as symbol (update! self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('update) + (update! self) + ) + ) ) :exit (behavior () (on-exit-water self) - (none) ) :trans (behavior () (update! self) - (none) ) :code (the-as (function none :behavior water-vol) anim-loop) ) diff --git a/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc b/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc index 848b5f5bc3a..4a0f4c3914a 100644 --- a/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc @@ -972,6 +972,7 @@ ;; definition for function anim-tester-reset ;; INFO: Used lq/sq +;; INFO: Return type mismatch object vs none. (defbehavior anim-tester-reset anim-tester () (let ((v1-0 (-> self obj-list))) "is the list empty, #t = empty" @@ -1721,9 +1722,6 @@ ;; definition for function anim-test-edit-sequence-list-handler ;; INFO: Used lq/sq -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 893] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 938] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 1045] (defun anim-test-edit-sequence-list-handler ((arg0 int) (arg1 list-control)) (local-vars (sv-192 (function string dma-buffer int int font-color font-flags float)) @@ -2478,7 +2476,6 @@ :event anim-tester-standard-event-handler :enter (behavior () (logior! (-> self flags) (anim-tester-flags fanimt1)) - (none) ) :trans (behavior () (if (and (not (logtest? (-> self flags) (anim-tester-flags fanimt1))) (= *master-mode* 'menu)) @@ -2494,7 +2491,6 @@ (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) ) - (none) ) :code (behavior () (local-vars (s4-0 glst-node) (s5-1 anim-test-seq-item) (gp-2 anim-test-sequence)) @@ -2653,7 +2649,6 @@ ) ) ) - (none) ) :post anim-tester-post ) diff --git a/test/decompiler/reference/jak1/engine/debug/default-menu_REF.gc b/test/decompiler/reference/jak1/engine/debug/default-menu_REF.gc index 857d8754ff4..8c99ab36f2a 100644 --- a/test/decompiler/reference/jak1/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/default-menu_REF.gc @@ -1031,23 +1031,16 @@ (debug-menu-append-item s4-1 a1-87) ) ) - (let ((a1-89 (new - 'debug - 'debug-menu-item-flag - "Edit" - '*cam-layout* - (the-as (function object debug-menu-msg object) (lambda ((arg0 symbol) (arg1 debug-menu-msg)) - (when (= arg1 (debug-menu-msg press)) - (if (-> arg0 value) - (cam-layout-stop) - (cam-layout-start) - ) - ) - (-> arg0 value) - (none) - ) - ) - ) + (let ((a1-89 (new 'debug 'debug-menu-item-flag "Edit" '*cam-layout* (lambda ((arg0 symbol) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if (-> arg0 value) + (cam-layout-stop) + (cam-layout-start) + ) + ) + (-> arg0 value) + ) + ) ) ) (debug-menu-append-item gp-0 a1-89) @@ -1136,10 +1129,7 @@ 'debug-menu-item-function "all tweak+" #f - (the-as - (function object object) - (lambda () (the-as object (all-texture-tweak-adjust *texture-page-dir* (the-as float 0.1)))) - ) + (lambda ((arg0 object)) (all-texture-tweak-adjust *texture-page-dir* (the-as float 0.1))) ) ) ) @@ -1150,10 +1140,7 @@ 'debug-menu-item-function "all tweak-" #f - (the-as - (function object object) - (lambda () (the-as object (all-texture-tweak-adjust *texture-page-dir* (the-as float -0.1)))) - ) + (lambda ((arg0 object)) (all-texture-tweak-adjust *texture-page-dir* (the-as float -0.1))) ) ) ) @@ -1996,10 +1983,7 @@ (debug-menu-append-item gp-0 a1-7) ) ) - (let ((a1-9 - (new 'debug 'debug-menu-item-function "Refresh" #f (the-as (function object object) build-instance-list)) - ) - ) + (let ((a1-9 (new 'debug 'debug-menu-item-function "Refresh" #f build-instance-list))) (debug-menu-append-item gp-0 a1-9) ) (let ((s3-0 (new 'debug 'debug-menu-item-var "near" (the-as int '*edit-instance*) 80))) @@ -2009,20 +1993,19 @@ (function int debug-menu-msg float float float) (lambda ((arg0 debug-menu) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) (let ((gp-0 (find-instance-by-name (-> arg0 name)))) - (the-as object (cond - (gp-0 - (when (= arg1 (debug-menu-msg press)) - (set! (-> gp-0 dists x) (* 4096.0 arg2)) - (prototype-bucket-recalc-fields gp-0) - ) - (* 0.00024414062 (-> gp-0 dists x)) - ) - (else - (empty) - arg3 - ) - ) - ) + (cond + (gp-0 + (when (= arg1 (debug-menu-msg press)) + (set! (-> gp-0 dists x) (* 4096.0 arg2)) + (prototype-bucket-recalc-fields gp-0) + ) + (* 0.00024414062 (-> gp-0 dists x)) + ) + (else + (empty) + arg3 + ) + ) ) ) ) @@ -2041,20 +2024,19 @@ (function int debug-menu-msg float float float) (lambda ((arg0 debug-menu) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) (let ((gp-0 (find-instance-by-name (-> arg0 name)))) - (the-as object (cond - (gp-0 - (when (= arg1 (debug-menu-msg press)) - (set! (-> gp-0 dists w) (* 4096.0 arg2)) - (prototype-bucket-recalc-fields gp-0) - ) - (* 0.00024414062 (-> gp-0 dists w)) - ) - (else - (empty) - arg3 - ) - ) - ) + (cond + (gp-0 + (when (= arg1 (debug-menu-msg press)) + (set! (-> gp-0 dists w) (* 4096.0 arg2)) + (prototype-bucket-recalc-fields gp-0) + ) + (* 0.00024414062 (-> gp-0 dists w)) + ) + (else + (empty) + arg3 + ) + ) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/debug/part-tester_REF.gc b/test/decompiler/reference/jak1/engine/debug/part-tester_REF.gc index bac9c90ba6b..c30205dd6e9 100644 --- a/test/decompiler/reference/jak1/engine/debug/part-tester_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/part-tester_REF.gc @@ -88,7 +88,6 @@ ) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/debug/viewer_REF.gc b/test/decompiler/reference/jak1/engine/debug/viewer_REF.gc index 1ad06474990..b0fb64698e0 100644 --- a/test/decompiler/reference/jak1/engine/debug/viewer_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/viewer_REF.gc @@ -51,7 +51,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior viewer) ja-post) ) @@ -247,5 +246,5 @@ viewer (t9-0 arg0 arg1) ) - (the-as object #t) + #t ) diff --git a/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc b/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc index f49895c2abc..6c512ae4eb1 100644 --- a/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc @@ -412,7 +412,6 @@ ) (suspend) ) - (none) ) ) @@ -1100,7 +1099,7 @@ ) ;; definition for function process-drawable-fuel-cell-handler -;; INFO: Return type mismatch int vs none. +;; INFO: Return type mismatch int vs object. (defbehavior process-drawable-fuel-cell-handler process-drawable ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notify) @@ -1113,7 +1112,6 @@ ) ) ) - (none) ) ;; definition for function process-drawable-birth-fuel-cell diff --git a/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc b/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc index 508f7235b59..54683487858 100644 --- a/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc @@ -280,10 +280,9 @@ (kill-current-level-hint '() '() 'exit) ) ) - (the-as object (and (not *hint-semaphore*) - (process-spawn level-hint :init ambient-hint-init-by-other arg0 arg1 arg3 :to arg2) - ) - ) + (and (not *hint-semaphore*) + (process-spawn level-hint :init ambient-hint-init-by-other arg0 arg1 arg3 :to arg2) + ) ) ;; definition for function kill-current-level-hint @@ -363,15 +362,14 @@ (apply-settings *setting-control*) (set! (-> self event-hook) (lambda :behavior level-hint ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('die 'exit) - (if (= (ppointer->process *hint-semaphore*) self) - (set! *hint-semaphore* (the-as (pointer level-hint) #f)) - ) - (deactivate self) - ) - ) - ) + (case arg2 + (('die 'exit) + (if (= (ppointer->process *hint-semaphore*) self) + (set! *hint-semaphore* (the-as (pointer level-hint) #f)) + ) + (deactivate self) + ) + ) ) ) (go level-hint-ambient-sound arg0) @@ -408,22 +406,20 @@ ;; failed to figure out what this is: (defstate level-hint-normal (level-hint) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('exit) - (go level-hint-exit) - ) - (('die) - (the-as object (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('exit) + (go level-hint-exit) + ) + (('die) + (deactivate self) + ) + ) ) :exit (behavior () (if (= (ppointer->process *hint-semaphore*) self) (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) - (none) ) :code (behavior () (cond @@ -460,27 +456,25 @@ ) ) (go level-hint-exit) - (none) ) ) ;; failed to figure out what this is: (defstate level-hint-sidekick (level-hint) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('exit) - (when (nonzero? (-> self sound-id)) - (sound-stop (-> self sound-id)) - (set! (-> self sound-id) (new 'static 'sound-id)) - 0 - ) - (go level-hint-exit) - ) - (('die) - (the-as object (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('exit) + (when (nonzero? (-> self sound-id)) + (sound-stop (-> self sound-id)) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + (go level-hint-exit) + ) + (('die) + (deactivate self) + ) + ) ) :exit (behavior () (if (nonzero? (-> self sound-id)) @@ -493,7 +487,6 @@ (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) (send-event (handle->process (-> self voicebox)) 'die) - (none) ) :code (behavior ((arg0 string)) (when (and (-> *setting-control* current play-hints) (< 0.0 (-> *setting-control* current dialog-volume))) @@ -538,7 +531,6 @@ ) ) (go level-hint-exit) - (none) ) ) @@ -554,7 +546,6 @@ (if (= (ppointer->process *hint-semaphore*) self) (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) - (none) ) :code (behavior ((arg0 string)) (while (not *sound-player-enable*) @@ -600,7 +591,6 @@ ) ) (go level-hint-exit) - (none) ) ) @@ -633,7 +623,6 @@ ) ) (go level-hint-exit) - (none) ) ) @@ -643,7 +632,6 @@ (if (= (ppointer->process *hint-semaphore*) self) (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/entity/entity_REF.gc b/test/decompiler/reference/jak1/engine/entity/entity_REF.gc index cac9e300e62..ce6ade2b702 100644 --- a/test/decompiler/reference/jak1/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/entity_REF.gc @@ -373,6 +373,7 @@ ) ;; definition for method 2 of type process +;; INFO: this function exists in multiple non-identical object files (defmethod print process ((obj process)) (format #t "#<~A ~S ~A :state ~S :flags " (-> obj type) (-> obj name) (-> obj status) (if (-> obj state) (-> obj state name) @@ -1084,21 +1085,20 @@ ) (iterate-process-tree *active-pool* - (the-as (function object object) (lambda ((arg0 process-drawable)) - (when (type-type? (-> arg0 type) process-drawable) - (if (nonzero? (-> arg0 nav)) - (debug-draw (-> arg0 nav)) - ) - (if (nonzero? (-> arg0 path)) - (debug-draw (-> arg0 path)) - ) - (if (nonzero? (-> arg0 vol)) - (init! (-> arg0 vol)) - ) - ) - (none) - ) + (lambda ((arg0 process-drawable)) + (when (type-type? (-> arg0 type) process-drawable) + (if (nonzero? (-> arg0 nav)) + (debug-draw (-> arg0 nav)) + ) + (if (nonzero? (-> arg0 path)) + (debug-draw (-> arg0 path)) ) + (if (nonzero? (-> arg0 vol)) + (init! (-> arg0 vol)) + ) + ) + (none) + ) *null-kernel-context* ) ) @@ -1554,7 +1554,7 @@ ) (iterate-process-tree *entity-pool* - (the-as (function object object) (lambda ((arg0 process-drawable)) (deactivate arg0) (none))) + (lambda ((arg0 process-drawable)) (deactivate arg0) (none)) *null-kernel-context* ) (if (= arg0 'game) diff --git a/test/decompiler/reference/jak1/engine/game/game-save_REF.gc b/test/decompiler/reference/jak1/engine/game/game-save_REF.gc index 54d3626a9ba..6359de9c48c 100644 --- a/test/decompiler/reference/jak1/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/game-save_REF.gc @@ -1395,7 +1395,6 @@ auto-save-post (set! (-> self buffer) a0-1) ) (go-virtual get-card) - (none) ) :post auto-save-post ) @@ -1448,7 +1447,6 @@ auto-save-post (go-virtual done) ) ) - (none) ) :post auto-save-post ) @@ -1490,7 +1488,6 @@ auto-save-post ) ) (go-virtual done) - (none) ) :post auto-save-post ) @@ -1523,7 +1520,6 @@ auto-save-post ) (label cfg-11) (go-virtual done) - (none) ) :post auto-save-post ) @@ -1575,7 +1571,6 @@ auto-save-post ) ) (go-virtual done) - (none) ) :post auto-save-post ) @@ -1645,7 +1640,6 @@ auto-save-post ) (label cfg-21) (go-virtual done) - (none) ) :post auto-save-post ) @@ -1720,7 +1714,6 @@ auto-save-post (suspend) ) (go-virtual done) - (none) ) :post auto-save-post ) @@ -1728,16 +1721,15 @@ auto-save-post ;; failed to figure out what this is: (defstate error (auto-save) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('progress-allowed?) - #t - ) - (('die) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('progress-allowed?) + #t + ) + (('die) + (deactivate self) + ) + ) ) :code (behavior ((arg0 mc-status-code)) (if (-> self buffer) @@ -1833,7 +1825,6 @@ auto-save-post ) ) ) - (none) ) :post auto-save-post ) @@ -1872,7 +1863,6 @@ auto-save-post ) ) ) - (none) ) :post auto-save-post ) diff --git a/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc b/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc index fa77f607cda..b1dbf4d8530 100644 --- a/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc @@ -643,20 +643,20 @@ ;; failed to figure out what this is: (defstate projectile-moving (projectile) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (when (-> self attack-mode) (when (cond ((= (-> proc type) target) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode (-> self attack-mode))))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode (-> self attack-mode))))) ) (else (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) self) (set! (-> a1-2 num-params) 4) (set! (-> a1-2 message) 'attack) - (set! (-> a1-2 param 0) (-> event param 0)) + (set! (-> a1-2 param 0) (-> block param 0)) (set! (-> a1-2 param 1) (the-as uint (-> self attack-mode))) (let ((v1-13 (+ *global-attack-id* 1))) (set! *global-attack-id* v1-13) @@ -686,7 +686,6 @@ ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior () (let ((gp-0 #f)) @@ -742,7 +741,6 @@ ) ) (go-virtual projectile-dissipate) - (none) ) ) @@ -806,7 +804,6 @@ (sound-play "yellow-explode") (suspend) (go-virtual projectile-die) - (none) ) ) @@ -831,7 +828,6 @@ (sound-play "yellow-fizzle") (suspend) (go-virtual projectile-die) - (none) ) ) @@ -887,7 +883,6 @@ ) ) (cleanup-for-death self) - (none) ) ) @@ -1309,7 +1304,6 @@ :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -1318,6 +1312,5 @@ :virtual #t :code (behavior () (go-virtual projectile-die) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc b/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc index 7cd7ed5cb06..706e7bbaf19 100644 --- a/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc @@ -135,7 +135,6 @@ ) (suspend) ) - (none) ) :post time-of-day-update ) diff --git a/test/decompiler/reference/jak1/engine/target/sidekick_REF.gc b/test/decompiler/reference/jak1/engine/target/sidekick_REF.gc index 8c924431cbf..4783686bbcf 100644 --- a/test/decompiler/reference/jak1/engine/target/sidekick_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/sidekick_REF.gc @@ -59,11 +59,11 @@ ;; failed to figure out what this is: (defstate sidekick-clone (sidekick) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('matrix) - (case (-> event param 0) + (case (-> block param 0) (('play-anim) (set! v0-0 (-> self node-list data)) (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) cspace<-cspace+quaternion!) @@ -96,13 +96,13 @@ v0-0 ) (('shadow) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self shadow-in-movie?) (the-as symbol v0-0)) v0-0 ) (('blend-shape) (cond - ((-> event param 0) + ((-> block param 0) (set! v0-0 (logior (-> self skel status) (janim-status blerc))) (set! (-> self skel status) (the-as janim-status v0-0)) ) @@ -206,7 +206,6 @@ (if (logtest? (-> self skel status) (janim-status eye-done eye)) (merc-eye-anim self) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/engine/target/target-death_REF.gc b/test/decompiler/reference/jak1/engine/target/target-death_REF.gc index 56a4d489f04..334e67ec225 100644 --- a/test/decompiler/reference/jak1/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-death_REF.gc @@ -54,7 +54,6 @@ (remove-setting! 'sfx-volume) (remove-setting! 'ambient-volume) (remove-setting! 'music) - (none) ) :code (behavior ((arg0 continue-point)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -450,7 +449,6 @@ (suspend) (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (go target-stance) - (none) ) :post target-no-move-post ) @@ -829,7 +827,6 @@ (logclear! (-> self state-flags) (state-flags being-attacked dying)) ) (target-exit) - (none) ) :trans (behavior () (when (= *cheat-mode* 'debug) @@ -838,7 +835,6 @@ (go target-stance) ) ) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags wt16)) @@ -967,7 +963,6 @@ ) ) (go target-hit-ground #f) - (none) ) :post target-post ) @@ -1043,7 +1038,6 @@ (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) - (none) ) :trans (-> target-hit trans) :code (behavior ((arg0 symbol)) @@ -1358,7 +1352,6 @@ (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) (set! (-> self state-time) (-> *display* base-frame-counter)) (anim-loop) - (none) ) :post target-no-stick-post ) diff --git a/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc b/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc index 6fb17194c72..e3476797fc5 100644 --- a/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc @@ -3,282 +3,278 @@ ;; definition for function target-generic-event-handler ;; INFO: Used lq/sq -;; INFO: Return type mismatch none vs object. (defbehavior target-generic-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) - (the-as - object - (case arg2 - (('get-pickup) - (when (not (logtest? (-> self state-flags) (state-flags dying))) - (let ((s4-0 (-> arg3 param 0)) - (f28-0 (the-as float (-> arg3 param 1))) - ) - (if (!= (pickup-collectable! - (-> self fact-info-target) - (the-as pickup-type s4-0) - (the-as float 0.0) - (the-as handle #f) - ) - (pickup-collectable! (-> self fact-info-target) (the-as pickup-type s4-0) f28-0 (process->handle arg0)) + (case arg2 + (('get-pickup) + (when (not (logtest? (-> self state-flags) (state-flags dying))) + (let ((s4-0 (-> arg3 param 0)) + (f28-0 (the-as float (-> arg3 param 1))) + ) + (if (!= (pickup-collectable! + (-> self fact-info-target) + (the-as pickup-type s4-0) + (the-as float 0.0) + (the-as handle #f) ) - #t - 'full - ) - ) - ) - ) - (('reset-pickup) - (the-as object (reset! (-> self fact-info-target) (the-as symbol (-> arg3 param 0)))) - ) - (('reset-collide) - (cond - ((-> self control unknown-symbol00) - (target-collide-set! (-> self control unknown-symbol00) (-> self control unknown-float90)) - ) - ((-> self control unknown-symbol30) - (target-danger-set! (-> self control unknown-symbol30) #f) - ) + (pickup-collectable! (-> self fact-info-target) (the-as pickup-type s4-0) f28-0 (process->handle arg0)) + ) + #t + 'full + ) ) ) - (('level-deactivate) - #f + ) + (('reset-pickup) + (reset! (-> self fact-info-target) (the-as symbol (-> arg3 param 0))) + ) + (('reset-collide) + (cond + ((-> self control unknown-symbol00) + (target-collide-set! (-> self control unknown-symbol00) (-> self control unknown-float90)) + ) + ((-> self control unknown-symbol30) + (target-danger-set! (-> self control unknown-symbol30) #f) + ) ) - (('level-enter) - (let ((v1-21 (level-get *level* (the-as symbol (-> arg3 param 0))))) - (when v1-21 - (let ((s5-1 (-> v1-21 info))) - (let ((v1-22 (-> s5-1 buzzer))) - (if (zero? v1-22) - (set! (-> self fact-info-target buzzer) 0.0) - (set! (-> self fact-info-target buzzer) (pickup-collectable! - (-> self fact-info-target) - (pickup-type buzzer) - (the float (logior -65536 v1-22)) - (the-as handle #f) - ) - ) - ) - ) - (if (and (zero? (-> *game-info* enter-level-time (-> s5-1 index))) - (>= (-> *level-task-data-remap* length) (-> s5-1 index)) - ) - (set! (-> *game-info* enter-level-time (-> *level-task-data-remap* (+ (-> s5-1 index) -1))) - (-> *display* base-frame-counter) + ) + (('level-deactivate) + #f + ) + (('level-enter) + (let ((v1-21 (level-get *level* (the-as symbol (-> arg3 param 0))))) + (when v1-21 + (let ((s5-1 (-> v1-21 info))) + (let ((v1-22 (-> s5-1 buzzer))) + (if (zero? v1-22) + (set! (-> self fact-info-target buzzer) 0.0) + (set! (-> self fact-info-target buzzer) (pickup-collectable! + (-> self fact-info-target) + (pickup-type buzzer) + (the float (logior -65536 v1-22)) + (the-as handle #f) + ) ) ) ) - (send-event (ppointer->process (-> *hud-parts* buzzers)) 'sync) - (format #t "GAMEPLAY: enter ~A~%" (-> arg3 param 0)) + (if (and (zero? (-> *game-info* enter-level-time (-> s5-1 index))) + (>= (-> *level-task-data-remap* length) (-> s5-1 index)) + ) + (set! (-> *game-info* enter-level-time (-> *level-task-data-remap* (+ (-> s5-1 index) -1))) + (-> *display* base-frame-counter) + ) + ) ) + (send-event (ppointer->process (-> *hud-parts* buzzers)) 'sync) + (format #t "GAMEPLAY: enter ~A~%" (-> arg3 param 0)) ) ) - (('get-attack-count) - (set! v0-0 (+ (-> self control unknown-dword51) (-> arg3 param 0))) - (set! (-> self control unknown-dword51) (the-as int v0-0)) - v0-0 - ) - (('continue) - (go target-continue (the-as continue-point (-> arg3 param 0))) - ) - (('query) - (case (-> arg3 param 0) - (('powerup) - (and (= (-> self fact-info-target eco-type) (-> arg3 param 1)) (< 0.0 (-> self fact-info-target eco-level))) - ) - (('pickup) - (pickup-collectable! - (-> self fact-info-target) - (the-as pickup-type (-> arg3 param 1)) - (the-as float 0.0) - (the-as handle #f) - ) - ) - (('ground-height) - (target-height-above-ground) + ) + (('get-attack-count) + (set! v0-0 (+ (-> self control unknown-dword51) (-> arg3 param 0))) + (set! (-> self control unknown-dword51) (the-as int v0-0)) + v0-0 + ) + (('continue) + (go target-continue (the-as continue-point (-> arg3 param 0))) + ) + (('query) + (case (-> arg3 param 0) + (('powerup) + (and (= (-> self fact-info-target eco-type) (-> arg3 param 1)) (< 0.0 (-> self fact-info-target eco-level))) + ) + (('pickup) + (pickup-collectable! + (-> self fact-info-target) + (the-as pickup-type (-> arg3 param 1)) + (the-as float 0.0) + (the-as handle #f) ) - ) + ) + (('ground-height) + (target-height-above-ground) + ) ) - (('trans) - (case (-> arg3 param 0) - (('save) - (set! (-> self alt-cam-pos quad) (-> self control trans quad)) - (logior! (-> self state-flags) (state-flags has-saved-position)) - (mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48) - ) - (('restore) - (logclear! (-> self state-flags) (state-flags has-saved-position)) - (let ((gp-1 (-> arg3 param 1))) - (move-to-point! (-> self control) (the-as vector (+ gp-1 0))) - (quaternion-copy! (-> self control quat) (the-as quaternion (+ gp-1 16))) - ) - (rot->dir-targ! (-> self control)) - (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) - (set! v0-0 (-> *display* base-frame-counter)) - (set! (-> self control unknown-dword11) (the-as time-frame v0-0)) - v0-0 - ) - (('reset) - (set! v0-0 (logclear (-> self state-flags) (state-flags has-saved-position))) - (set! (-> self state-flags) (the-as state-flags v0-0)) - v0-0 + ) + (('trans) + (case (-> arg3 param 0) + (('save) + (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (logior! (-> self state-flags) (state-flags has-saved-position)) + (mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48) + ) + (('restore) + (logclear! (-> self state-flags) (state-flags has-saved-position)) + (let ((gp-1 (-> arg3 param 1))) + (move-to-point! (-> self control) (the-as vector (+ gp-1 0))) + (quaternion-copy! (-> self control quat) (the-as quaternion (+ gp-1 16))) ) - ) - ) - (('effect) - (the-as object (target-powerup-effect (the-as symbol (-> arg3 param 0)))) + (rot->dir-targ! (-> self control)) + (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) + (set! v0-0 (-> *display* base-frame-counter)) + (set! (-> self control unknown-dword11) (the-as time-frame v0-0)) + v0-0 + ) + (('reset) + (set! v0-0 (logclear (-> self state-flags) (state-flags has-saved-position))) + (set! (-> self state-flags) (the-as state-flags v0-0)) + v0-0 + ) ) - (('do-effect) - (effect-control-method-10 - (-> self skel effect) - (the-as symbol (-> arg3 param 0)) - (the-as float (-> arg3 param 1)) - -1 - ) - (if (-> self sidekick) - (effect-control-method-10 - (-> self sidekick 0 skel effect) - (the-as symbol (-> arg3 param 0)) - (the-as float (-> arg3 param 1)) - -1 - ) - ) + ) + (('effect) + (target-powerup-effect (the-as symbol (-> arg3 param 0))) + ) + (('do-effect) + (effect-control-method-10 + (-> self skel effect) + (the-as symbol (-> arg3 param 0)) + (the-as float (-> arg3 param 1)) + -1 ) - (('neck) - (set! (-> self neck flex-blend) (the-as float (-> arg3 param 0))) - (cond - ((-> arg3 param 1) - (logior! (-> self state-flags) (state-flags looking-at-enemy)) - (set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) - (the-as object (look-at-enemy! (-> self neck) (-> self alt-neck-pos) 'force arg0)) - ) - (else - (set! v0-0 (logclear (-> self state-flags) (state-flags looking-at-enemy))) - (set! (-> self state-flags) (the-as state-flags v0-0)) - v0-0 + (if (-> self sidekick) + (effect-control-method-10 + (-> self sidekick 0 skel effect) + (the-as symbol (-> arg3 param 0)) + (the-as float (-> arg3 param 1)) + -1 ) ) + ) + (('neck) + (set! (-> self neck flex-blend) (the-as float (-> arg3 param 0))) + (cond + ((-> arg3 param 1) + (logior! (-> self state-flags) (state-flags looking-at-enemy)) + (set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (look-at-enemy! (-> self neck) (-> self alt-neck-pos) 'force arg0) + ) + (else + (set! v0-0 (logclear (-> self state-flags) (state-flags looking-at-enemy))) + (set! (-> self state-flags) (the-as state-flags v0-0)) + v0-0 + ) ) - (('sidekick) - (cond - ((and (-> arg3 param 0) (not (-> self sidekick))) - (let ((gp-2 (get-process *default-dead-pool* sidekick #x4000))) - (set! v0-0 (when gp-2 - (let ((t9-21 (method-of-type sidekick activate))) - (t9-21 (the-as sidekick gp-2) self 'sidekick (the-as pointer #x70004000)) - ) - (run-now-in-process gp-2 init-sidekick) - (-> gp-2 ppointer) + ) + (('sidekick) + (cond + ((and (-> arg3 param 0) (not (-> self sidekick))) + (let ((gp-2 (get-process *default-dead-pool* sidekick #x4000))) + (set! v0-0 (when gp-2 + (let ((t9-21 (method-of-type sidekick activate))) + (t9-21 (the-as sidekick gp-2) self 'sidekick (the-as pointer #x70004000)) ) - ) - ) - (set! (-> self sidekick) (the-as (pointer sidekick) v0-0)) - v0-0 - ) - ((and (not (-> arg3 param 0)) (-> self sidekick)) - (deactivate (-> self sidekick 0)) - (set! (-> self sidekick) (the-as (pointer sidekick) #f)) - #f + (run-now-in-process gp-2 init-sidekick) + (-> gp-2 ppointer) + ) + ) ) - ) + (set! (-> self sidekick) (the-as (pointer sidekick) v0-0)) + v0-0 + ) + ((and (not (-> arg3 param 0)) (-> self sidekick)) + (deactivate (-> self sidekick 0)) + (set! (-> self sidekick) (the-as (pointer sidekick) #f)) + #f + ) ) - (('blend-shape) - (if (-> arg3 param 0) - (logior! (-> self skel status) (janim-status blerc)) - (logclear! (-> self skel status) (janim-status blerc)) - ) - (let ((v1-105 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-105 from) arg0) - (set! (-> v1-105 num-params) arg1) - (set! (-> v1-105 message) arg2) - (set! (-> v1-105 param 0) (-> arg3 param 0)) - (set! (-> v1-105 param 1) (-> arg3 param 1)) - (set! (-> v1-105 param 2) (-> arg3 param 2)) - (set! (-> v1-105 param 3) (-> arg3 param 3)) - (set! (-> v1-105 param 4) (-> arg3 param 4)) - (set! (-> v1-105 param 5) (-> arg3 param 5)) - (set! (-> v1-105 param 6) (-> arg3 param 6)) - (send-event-function (ppointer->process (-> self sidekick)) v1-105) + ) + (('blend-shape) + (if (-> arg3 param 0) + (logior! (-> self skel status) (janim-status blerc)) + (logclear! (-> self skel status) (janim-status blerc)) ) + (let ((v1-105 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-105 from) arg0) + (set! (-> v1-105 num-params) arg1) + (set! (-> v1-105 message) arg2) + (set! (-> v1-105 param 0) (-> arg3 param 0)) + (set! (-> v1-105 param 1) (-> arg3 param 1)) + (set! (-> v1-105 param 2) (-> arg3 param 2)) + (set! (-> v1-105 param 3) (-> arg3 param 3)) + (set! (-> v1-105 param 4) (-> arg3 param 4)) + (set! (-> v1-105 param 5) (-> arg3 param 5)) + (set! (-> v1-105 param 6) (-> arg3 param 6)) + (send-event-function (ppointer->process (-> self sidekick)) v1-105) ) - (('shadow) - (cond - ((-> arg3 param 0) - (let ((v1-108 (-> self draw shadow-ctrl))) - (logclear! (-> v1-108 settings flags) (shadow-flags disable-draw)) - ) - 0 + ) + (('shadow) + (cond + ((-> arg3 param 0) + (let ((v1-108 (-> self draw shadow-ctrl))) + (logclear! (-> v1-108 settings flags) (shadow-flags disable-draw)) ) - (else - (let ((v1-110 (-> self draw shadow-ctrl))) - (logior! (-> v1-110 settings flags) (shadow-flags disable-draw)) - ) - 0 + 0 + ) + (else + (let ((v1-110 (-> self draw shadow-ctrl))) + (logior! (-> v1-110 settings flags) (shadow-flags disable-draw)) ) + 0 ) ) - (('rotate-y-angle) - (quaternion-rotate-y! - (-> self control unknown-quaternion00) - (-> self control unknown-quaternion00) - (the-as float (-> arg3 param 0)) - ) - (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (rot->dir-targ! (-> self control)) - ) - ) - (('touched) - (send-event arg0 'touch (-> arg3 param 0)) - ) - (('dry) - (set! (-> self water drip-wetness) 0.0) - ) - (('reset-height) - (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) - #f + ) + (('rotate-y-angle) + (quaternion-rotate-y! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + (the-as float (-> arg3 param 0)) ) - (('draw) - (if (-> arg3 param 0) - (logclear! (-> self draw status) (draw-status skip-bones)) - (logior! (-> self draw status) (draw-status skip-bones)) - ) - (let ((v1-132 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-132 from) arg0) - (set! (-> v1-132 num-params) arg1) - (set! (-> v1-132 message) arg2) - (set! (-> v1-132 param 0) (-> arg3 param 0)) - (set! (-> v1-132 param 1) (-> arg3 param 1)) - (set! (-> v1-132 param 2) (-> arg3 param 2)) - (set! (-> v1-132 param 3) (-> arg3 param 3)) - (set! (-> v1-132 param 4) (-> arg3 param 4)) - (set! (-> v1-132 param 5) (-> arg3 param 5)) - (set! (-> v1-132 param 6) (-> arg3 param 6)) - (send-event-function (ppointer->process (-> self manipy)) v1-132) + (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (rot->dir-targ! (-> self control)) ) + ) + (('touched) + (send-event arg0 'touch (-> arg3 param 0)) + ) + (('dry) + (set! (-> self water drip-wetness) 0.0) + ) + (('reset-height) + (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) + #f + ) + (('draw) + (if (-> arg3 param 0) + (logclear! (-> self draw status) (draw-status skip-bones)) + (logior! (-> self draw status) (draw-status skip-bones)) + ) + (let ((v1-132 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-132 from) arg0) + (set! (-> v1-132 num-params) arg1) + (set! (-> v1-132 message) arg2) + (set! (-> v1-132 param 0) (-> arg3 param 0)) + (set! (-> v1-132 param 1) (-> arg3 param 1)) + (set! (-> v1-132 param 2) (-> arg3 param 2)) + (set! (-> v1-132 param 3) (-> arg3 param 3)) + (set! (-> v1-132 param 4) (-> arg3 param 4)) + (set! (-> v1-132 param 5) (-> arg3 param 5)) + (set! (-> v1-132 param 6) (-> arg3 param 6)) + (send-event-function (ppointer->process (-> self manipy)) v1-132) ) - (('no-load-wait) - (set! v0-0 (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0)))) - (set! (-> self no-load-wait) (the-as time-frame v0-0)) - v0-0 - ) - (('no-look-around) - (set! (-> self no-look-around-wait) - (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0))) - ) - (if (= (-> self next-state name) 'target-look-around) - (send-event self 'end-mode) + ) + (('no-load-wait) + (set! v0-0 (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0)))) + (set! (-> self no-load-wait) (the-as time-frame v0-0)) + v0-0 + ) + (('no-look-around) + (set! (-> self no-look-around-wait) + (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0))) ) - ) - (('change-state) - (go - (the-as (state object object object object target) (-> arg3 param 0)) - (-> arg3 param 1) - (-> arg3 param 2) - (-> arg3 param 3) - (-> arg3 param 4) + (if (= (-> self next-state name) 'target-look-around) + (send-event self 'end-mode) ) + ) + (('change-state) + (go + (the-as (state object object object object target) (-> arg3 param 0)) + (-> arg3 param 1) + (-> arg3 param 2) + (-> arg3 param 3) + (-> arg3 param 4) ) - ) + ) ) ) diff --git a/test/decompiler/reference/jak1/engine/target/target2_REF.gc b/test/decompiler/reference/jak1/engine/target/target2_REF.gc index 6159b5565f9..6603498cd4e 100644 --- a/test/decompiler/reference/jak1/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target2_REF.gc @@ -3,14 +3,14 @@ ;; failed to figure out what this is: (defstate target-load-wait (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('loading) (set! (-> self state-time) (-> *display* base-frame-counter)) #f ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -48,20 +48,19 @@ ) ) (go target-stance) - (none) ) :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-stance-ambient (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('movie) (go target-stance) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -93,7 +92,6 @@ ) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (behavior () (let ((a0-0 (-> self control unknown-spoolanim00))) @@ -105,7 +103,6 @@ ) ((-> target-stance exit)) (target-exit) - (none) ) :trans (behavior () (spool-push *art-control* (-> self control unknown-spoolanim00 name) 0 self (the-as float -99.0)) @@ -114,7 +111,6 @@ ) (go target-stance) ) - (none) ) :code (behavior () (while (let ((v1-13 (file-status *art-control* (-> self control unknown-spoolanim00 name) 0))) @@ -133,7 +129,6 @@ ) (set! (-> self control unknown-uint20) (the-as uint #f)) (go target-stance) - (none) ) :post target-post ) @@ -293,8 +288,8 @@ ;; failed to figure out what this is: (defstate hud-waiting (first-person-hud) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('go-away) (go hud-going-out) ) @@ -302,7 +297,6 @@ ) :enter (behavior () (disable-hud (the-as int (-> *hud-parts* power))) - (none) ) :code (behavior () (loop @@ -316,7 +310,6 @@ (go hud-coming-in) (suspend) ) - (none) ) ) @@ -331,11 +324,9 @@ ) (suspend) ) - (none) ) :post (behavior () (dumb-15 self) - (none) ) ) @@ -353,7 +344,6 @@ ) (suspend) ) - (none) ) ) @@ -367,11 +357,9 @@ ) (suspend) ) - (none) ) :post (behavior () (dumb-15 self) - (none) ) ) @@ -472,28 +460,27 @@ (set! (-> self state) v1-8) ) ((the-as (function none :behavior target) (-> target-stance code))) - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-look-around (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) - ((let ((v1-4 event-type)) + ((let ((v1-4 message)) (= v1-4 'end-mode) ) (go target-stance-look-around) ) ((-> self control unknown-symbol30) - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -512,7 +499,6 @@ (set! (-> self fp-hud) (ppointer->handle (process-spawn first-person-hud :to *dproc* :stack (&+ *fp-hud-stack* #x3800))) ) - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self fp-hud)))) @@ -528,7 +514,6 @@ (send-event *camera* 'clear-entity) (camera-change-to (the-as string 'base) 60 #f) ) - (none) ) :trans (behavior () (local-vars (sv-48 vector)) @@ -613,7 +598,6 @@ ) (set! (-> self cam-user-mode) 'normal) ) - (none) ) ) :code (behavior () @@ -633,25 +617,24 @@ ) (suspend) ) - (none) ) :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-billy-game (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) - ((let ((v1-4 event-type)) + ((let ((v1-4 message)) (= v1-4 'end-mode) ) (go target-stance) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -671,7 +654,6 @@ (set! (-> self fp-hud) (ppointer->handle (process-spawn first-person-hud :to *dproc* :stack (&+ *fp-hud-stack* #x3800))) ) - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self fp-hud)))) @@ -685,7 +667,6 @@ (camera-change-to (the-as string 'base) 0 #f) ) (target-exit) - (none) ) :trans (behavior () (local-vars (sv-48 vector)) @@ -759,52 +740,50 @@ ) (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) ) - (none) ) ) :code (behavior () (ja-channel-set! 0) (set! (-> self control transv quad) (the-as uint128 0)) (anim-loop) - (none) ) :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) (else - (case event-type + (case message (('end-mode) (go target-stance) ) (('play-anim) - (let ((v0-0 (the-as object (-> event param 0)))) + (let ((v0-0 (the-as object (-> block param 0)))) (set! (-> self control unknown-uint20) (the-as uint v0-0)) v0-0 ) ) (('clone-anim) - (go target-clone-anim (process->handle (the-as process (-> event param 0)))) + (go target-clone-anim (process->handle (the-as process (-> block param 0)))) ) (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('final-door) (go target-final-door - (the-as basic (process->handle (the-as process (-> event param 1)))) - (process->handle (the-as process (-> event param 2))) + (the-as basic (process->handle (the-as process (-> block param 1)))) + (process->handle (the-as process (-> block param 2))) ) ) ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -815,12 +794,10 @@ (set! (-> self neck flex-blend) 0.0) (logior! (-> self state-flags) (state-flags invulnerable grabbed)) (set! (-> self control unknown-uint20) (the-as uint 'stance)) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags invulnerable)) (target-exit) - (none) ) :code (behavior () (set-forward-vel (the-as float 0.0)) @@ -930,23 +907,21 @@ ) (label cfg-94) ) - (none) ) :post (behavior () (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (set! (-> self control transv quad) (the-as uint128 0)) ) (target-no-stick-post) - (none) ) ) ;; failed to figure out what this is: (defstate target-pole-cycle (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'query) (= (-> event param 0) 'mode)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) :enter (behavior ((arg0 handle)) @@ -959,13 +934,11 @@ (set! (-> self control transv quad) (the-as uint128 0)) (send-event *camera* 'ease-in) (set! (-> self control unknown-int21) (the-as int #f)) - (none) ) :exit (behavior () (target-collide-set! 'normal (the-as float 0.0)) (logclear! (-> self control root-prim prim-core action) (collide-action swingpole-active)) (set! (-> self control unknown-handle10) (the-as handle #f)) - (none) ) :trans (behavior () (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) @@ -1011,7 +984,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 handle)) (target-compute-pole) @@ -1056,7 +1028,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post target-no-move-post ) @@ -1076,7 +1047,6 @@ ) (set-forward-vel arg2) (go target-pole-flip-up-jump (the-as float arg0) (the-as float arg1)) - (none) ) :post target-no-move-post ) @@ -1089,7 +1059,6 @@ :trans (behavior () ((-> target-jump-forward trans)) (vector-flatten! (-> self control transv) (-> self control transv) (-> self control unknown-vector100)) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (sound-play "jump") @@ -1111,7 +1080,6 @@ (suspend) (ja :group! eichar-jump-loop-ja :num! (loop!)) ) - (none) ) :post target-post ) @@ -1131,7 +1099,6 @@ ) (set-forward-vel arg2) (go target-pole-flip-forward-jump arg0 arg1) - (none) ) :post target-no-move-post ) @@ -1142,13 +1109,11 @@ :enter (behavior ((arg0 float) (arg1 float)) ((-> target-jump enter) arg0 arg1 (the-as surface #f)) (set! (-> self control unknown-surface00) *forward-pole-jump-mods*) - (none) ) :exit target-exit :trans (behavior () ((-> target-jump-forward trans)) (vector-flatten! (-> self control transv) (-> self control transv) (-> self control unknown-vector100)) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (sound-play "jump") @@ -1157,20 +1122,19 @@ (ja :num! (seek!)) ) ((the-as (function none :behavior target) (-> target-pole-flip-up-jump code))) - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-edge-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (go target-falling 'target-edge-grab) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -1182,14 +1146,12 @@ (set! (-> self control unknown-vector102 quad) (-> self control transv quad)) (set! (-> self control transv quad) (the-as uint128 0)) (send-event *camera* 'ease-in) - (none) ) :exit (behavior () (when (logtest? (-> self control root-prim prim-core action) (collide-action edgegrab-cam)) (logclear! (-> self control root-prim prim-core action) (collide-action edgegrab-active edgegrab-cam)) (send-event *camera* 'damp-up) ) - (none) ) :trans (behavior () (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) @@ -1229,7 +1191,6 @@ ) ) ) - (none) ) :code (behavior () (target-compute-edge) @@ -1277,20 +1238,19 @@ (ja :num! (seek!)) ) ) - (none) ) :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-edge-grab-jump (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (go target-falling 'target-edge-grab) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -1318,7 +1278,6 @@ (set-forward-vel (the-as float 16384.0)) (send-event *camera* 'damp-up) (go target-jump-forward arg0 arg1) - (none) ) :post target-no-move-post ) @@ -1355,7 +1314,6 @@ (+! (-> self control transv z) (-> self control rider-last-move z)) ) (go target-falling 'target-edge-grab) - (none) ) :post target-no-move-post ) @@ -1391,14 +1349,12 @@ ) ) ) - (none) ) :exit (behavior () (set! (-> *run-attack-mods* turnv) 0.0) (set! (-> *run-attack-mods* turnvv) 0.0) (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) (target-exit) - (none) ) :code (behavior () (let ((gp-0 (the-as handle #f))) @@ -1481,7 +1437,6 @@ (go target-stance) (go target-falling #f) ) - (none) ) :post target-post ) @@ -1532,13 +1487,11 @@ ) ) ) - (none) ) :exit (behavior () (rot->dir-targ! (-> self control)) (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) (target-exit) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1600,7 +1553,6 @@ (go target-stance) (go target-falling #f) ) - (none) ) :post target-no-stick-post ) @@ -1611,7 +1563,6 @@ :exit target-exit :trans (behavior () (slide-down-test) - (none) ) :code (behavior ((arg0 object) (arg1 float)) (set! (-> self neck flex-blend) 0.0) @@ -1683,7 +1634,6 @@ ) ) (go target-falling 'target-eco-powerup) - (none) ) :post target-post ) @@ -1695,7 +1645,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *wade-mods*) (set-zero! (-> self water bob)) - (none) ) :exit (behavior () (target-state-hook-exit) @@ -1704,7 +1653,6 @@ (set! (-> v1-1 channel-offset) 0) ) 0 - (none) ) :trans (behavior () ((-> self state-hook)) @@ -1741,7 +1689,6 @@ (if (can-hands? #t) (go target-running-attack) ) - (none) ) :code (-> target-stance code) :post target-post @@ -1787,7 +1734,6 @@ (if (can-hands? #t) (go target-running-attack) ) - (none) ) :code (behavior () (let ((gp-0 105) @@ -1961,7 +1907,6 @@ (suspend) ) ) - (none) ) :post target-post ) @@ -2008,7 +1953,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *swim-mods*) (logior! (-> self water flags) (water-flags wt04)) - (none) ) :exit (behavior () (target-state-hook-exit) @@ -2023,7 +1967,6 @@ (quaternion-identity! (-> self control unknown-quaternion01)) (set! (-> self control unknown-float00) 0.0) ) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -2075,7 +2018,6 @@ (go target-swim-walk) ) (target-swim-tilt (the-as float 0.0) (the-as float 2.0) (the-as float 0.0) (the-as float 1.0)) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -2126,7 +2068,6 @@ ) ) ) - (none) ) :post target-swim-post ) @@ -2138,7 +2079,6 @@ ((-> target-swim-stance enter)) (die-on-next-update! (-> self water bob)) (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) - (none) ) :exit (-> target-swim-stance exit) :trans (behavior () @@ -2192,7 +2132,6 @@ ) ) (target-swim-tilt (the-as float 0.0) (the-as float 2.0) (the-as float 0.0) (the-as float 1.0)) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -2232,17 +2171,16 @@ (ja :num! (seek!)) ) ) - (none) ) :post target-swim-post ) ;; failed to figure out what this is: (defstate target-swim-down (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'attack-invinc) - (let ((v1-2 (the-as attack-info (-> event param 1)))) + (let ((v1-2 (the-as attack-info (-> block param 1)))) (when (or (not (logtest? (-> v1-2 mask) (attack-mask mode))) (= (-> v1-2 mode) 'generic) (= (-> v1-2 mode) 'drown)) (set! (-> v1-2 mode) 'damage) (if (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact-info-target health))) @@ -2254,7 +2192,7 @@ ) ) ) - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -2267,7 +2205,6 @@ (if (= (-> self next-state name) 'target-swim-down) (set! (-> self control unknown-float130) 0.0) ) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) @@ -2282,7 +2219,6 @@ (quaternion-identity! (-> self control unknown-quaternion01)) (set! (-> self control unknown-float00) 0.0) ) - (none) ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self water swim-time)) (seconds 0.5)) @@ -2302,7 +2238,6 @@ ) ) ) - (none) ) :code (behavior () (let ((gp-0 60) @@ -2402,7 +2337,6 @@ ) ) ) - (none) ) :post target-swim-post ) @@ -2430,7 +2364,6 @@ (send-event self 'attack #f (static-attack-info ((mode 'drown-death)))) ) ((-> target-swim-down trans)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -2503,7 +2436,6 @@ (start-bobbing! (-> self water) (the-as float -4096.0) 600 1500) (set! (-> self water bob start-time) (+ (-> *display* base-frame-counter) (seconds -0.05))) (go target-swim-stance) - (none) ) :post target-swim-post ) @@ -2524,7 +2456,6 @@ ) ) ((-> target-jump trans)) - (none) ) :code (-> target-jump code) :post target-post @@ -2539,7 +2470,6 @@ (die-on-next-update! (-> self water bob)) (set! (-> self water align-offset) 0.0) (logior! (-> self water flags) (water-flags wt16)) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (die-on-next-update! (-> self water bob)) @@ -2574,7 +2504,6 @@ ) (go target-swim-jump-jump (+ f30-0 arg0) (+ f30-0 arg1) (the-as surface #f)) ) - (none) ) :post target-swim-post ) @@ -2587,7 +2516,6 @@ (set! (-> self control unknown-dword33) 0) (set-forward-vel (the-as float 0.0)) (set! (-> self control unknown-surface00) *walk-mods*) - (none) ) :code (behavior ((arg0 float)) (when (!= arg0 0.0) @@ -2629,17 +2557,16 @@ (go target-stance) ) ) - (none) ) :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-launch (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'query) (= (-> event param 0) 'mode)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'query) (= (-> block param 0) 'mode)) 'target-launch - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) :code (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) @@ -2726,15 +2653,14 @@ ) (sound-play "launch-fire") (go target-high-jump arg0 arg0 'launch) - (none) ) :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-periscope (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode) #f ) @@ -2745,7 +2671,7 @@ ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -2754,7 +2680,6 @@ (set! (-> self cam-user-mode) 'normal) (logior! (-> self state-flags) (state-flags grabbed)) (logclear! (-> self state-flags) (state-flags invulnerable)) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self neck flex-blend) 0.0) @@ -2787,7 +2712,6 @@ (ja :num! (seek! 0.0 2.0)) ) (go target-stance) - (none) ) :post target-no-stick-post ) @@ -2806,12 +2730,10 @@ ) (logior! (-> self state-flags) (state-flags grabbed)) (set! (-> self neck flex-blend) 0.0) - (none) ) :exit (behavior () (send-event (handle->process (-> self control unknown-handle10)) 'end-mode) (target-exit) - (none) ) :code (behavior ((arg0 string) (arg1 handle)) (let ((gp-0 (the-as art-joint-anim (lookup-art (-> self draw art-group) arg0 art-joint-anim)))) @@ -2827,18 +2749,17 @@ ) ) (go target-stance) - (none) ) :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-clone-anim (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) - ((-> target-grab event) proc arg1 event-type event) + ((-> target-grab event) proc argc message block) ) :enter (behavior ((arg0 handle)) (set! (-> self control unknown-handle10) arg0) @@ -2849,7 +2770,6 @@ (vector-reset! (-> self control transv)) (set! (-> self neck flex-blend) 0.0) (send-event (ppointer->process (-> self sidekick)) 'shadow #t) - (none) ) :exit (behavior () (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) @@ -2894,12 +2814,10 @@ (ja-channel-set! 0) (ja-post) (target-exit) - (none) ) :code (behavior ((arg0 handle)) (clone-anim arg0 (the-as int (-> self draw origin-joint-index)) #t "") (go target-stance) - (none) ) :post target-no-ja-move-post ) diff --git a/test/decompiler/reference/jak1/engine/target/target_REF.gc b/test/decompiler/reference/jak1/engine/target/target_REF.gc index 3c59404e32e..7d1fa91a279 100644 --- a/test/decompiler/reference/jak1/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target_REF.gc @@ -326,7 +326,6 @@ (suspend) (suspend) (go target-stance) - (none) ) :post target-no-move-post ) @@ -337,12 +336,10 @@ :enter (behavior () (set! (-> self control unknown-surface00) *walk-mods*) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (behavior () (set! (-> self control unknown-float81) 0.0) (target-state-hook-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -391,7 +388,6 @@ ) (slide-down-test) (fall-test) - (none) ) :code (behavior () (let ((s5-0 22) @@ -564,7 +560,6 @@ ) ) ) - (none) ) :post target-post ) @@ -575,12 +570,10 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *walk-mods*) - (none) ) :exit (behavior () (target-effect-exit) (target-state-hook-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -646,7 +639,6 @@ ) (slide-down-test) (fall-test) - (none) ) :code (behavior () (let ((f28-0 0.0) @@ -948,7 +940,6 @@ ) ) ) - (none) ) :post target-post ) @@ -960,7 +951,6 @@ (vector-turn-to (-> self control transv)) (set! (-> self control unknown-surface00) *turn-around-mods*) (set! (-> self control unknown-float81) 1.0) - (none) ) :exit (behavior () (target-state-hook-exit) @@ -968,7 +958,6 @@ (set! (-> self control unknown-float01) 0.0) (set-quaternion! (-> self control) (-> self control dir-targ)) (set! (-> self control unknown-float81) 0.0) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -995,7 +984,6 @@ (go target-falling #f) ) (slide-down-test) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.04)) @@ -1014,7 +1002,6 @@ (set! (-> self control unknown-float01) 40960.0) (target-state-hook-exit) (go target-walk) - (none) ) :post target-no-stick-post ) @@ -1024,11 +1011,9 @@ :event target-walk-event-handler :enter (behavior () (set! (-> self control unknown-surface00) *jump-mods*) - (none) ) :exit (behavior () (set! (-> self control unknown-dword35) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (when (or (logtest? (-> self control status) (cshape-moving-flags onsurf)) @@ -1039,7 +1024,6 @@ (logior! (-> self control status) (cshape-moving-flags onsurf)) (go target-duck-stance) ) - (none) ) :code (behavior () (if (not (ja-group? eichar-duck-stance-ja)) @@ -1052,7 +1036,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post target-post ) @@ -1199,7 +1182,6 @@ (set! (-> self control unknown-float81) 1.0) (set! (-> self control unknown-surface00) *duck-mods*) (target-collide-set! 'duck (the-as float 1.0)) - (none) ) :exit (behavior () (if (not (or (= (-> self next-state name) 'target-duck-walk) @@ -1213,7 +1195,6 @@ ) (target-exit) (target-collide-set! 'normal (the-as float 0.0)) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -1252,7 +1233,6 @@ ) (fall-test) (slide-down-test) - (none) ) :code (behavior () (cond @@ -1284,7 +1264,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post target-post ) @@ -1298,7 +1277,6 @@ (if (not (ja-group? eichar-duck-roll-ja)) (set! (-> self control unknown-surface00) *duck-mods*) ) - (none) ) :exit (-> target-duck-stance exit) :trans (behavior () @@ -1339,7 +1317,6 @@ ) (fall-test) (slide-down-test) - (none) ) :code (behavior () (cond @@ -1366,7 +1343,6 @@ ) (suspend) ) - (none) ) :post target-post ) @@ -1414,7 +1390,6 @@ (set! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) ) - (none) ) :exit target-exit :trans (behavior () @@ -1468,7 +1443,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) (-> *display* seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) (ja-channel-push! 2 (seconds 0.05)) @@ -1501,7 +1475,6 @@ (suspend) ) (target-falling-anim -1 (seconds 0.2)) - (none) ) :post target-post ) @@ -1512,7 +1485,6 @@ :enter (behavior ((arg0 float) (arg1 float)) ((-> target-jump enter) arg0 arg1 (the-as surface #f)) (set! (-> self control unknown-surface00) *forward-jump-mods*) - (none) ) :exit target-exit :trans (-> target-jump trans) @@ -1529,7 +1501,6 @@ (suspend) (ja :group! eichar-jump-loop-ja :num! (loop!)) ) - (none) ) :post target-post ) @@ -1552,7 +1523,6 @@ (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *double-jump-mods*) - (none) ) :exit target-exit :trans (behavior () @@ -1592,7 +1562,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) (-> *display* seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (ja-channel-push! 2 (seconds 0.05)) @@ -1605,7 +1574,6 @@ (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) ) (target-falling-anim -1 (seconds 0.2)) - (none) ) :post target-post ) @@ -1647,7 +1615,6 @@ (set! (-> self control unknown-float122) (fmax 0.0 (fmin 0.5 (* 0.00008138021 (+ -409.6 (-> self control unknown-float01))))) ) - (none) ) :exit target-exit :trans (behavior () @@ -1691,7 +1658,6 @@ (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01))))) (-> *display* seconds-per-frame) ) - (none) ) :code (-> target-jump code) :post target-post @@ -1704,7 +1670,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *turn-around-mods*) - (none) ) :exit target-exit :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) @@ -1728,7 +1693,6 @@ ) ) (go target-duck-high-jump-jump arg0 arg1 arg2) - (none) ) :post target-post ) @@ -1750,7 +1714,6 @@ (set! (-> self control unknown-surface00) *high-jump-mods*) ) ) - (none) ) :exit target-exit :trans (-> target-high-jump trans) @@ -1807,7 +1770,6 @@ ) ) (the-as none 0) - (none) ) :post target-post ) @@ -1819,7 +1781,6 @@ (set! (-> self control unknown-surface00) *jump-mods*) (set! (-> self control unknown-uint20) (the-as uint arg0)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (target-falling-trans @@ -1830,11 +1791,9 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol)) (target-falling-anim -1 (seconds 0.33)) - (none) ) :post target-post ) @@ -1895,7 +1854,6 @@ 600 1500 ) - (none) ) :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) @@ -1929,12 +1887,10 @@ ) (fall-test) (slide-down-test) - (none) ) :code (behavior ((arg0 symbol)) (target-hit-ground-anim #f) (go target-stance) - (none) ) :post target-post ) @@ -1949,12 +1905,10 @@ (set! (-> self control unknown-surface00) *attack-mods*) (set! (-> self water drip-mult) 4.0) (set! (-> self neck flex-blend) 0.0) - (none) ) :exit (behavior () (set! (-> self control unknown-dword33) (-> *display* base-frame-counter)) (target-exit) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.05)) @@ -1991,26 +1945,25 @@ (ja :num! (seek! max (-> self control unknown-surface01 align-speed))) ) (go target-stance) - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-running-attack (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (cond (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 224) ) (let ((gp-1 (target-send-attack proc (the-as uint (-> self control unknown-symbol30)) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control unknown-dword50) (-> self control unknown-dword51) ) @@ -2049,12 +2002,12 @@ ) ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -2078,7 +2031,6 @@ (if (or (< (fabs (-> self control unknown-float62)) 0.3) (< 0.3 (fabs (-> self control unknown-float61)))) (set! (-> self control unknown-float81) 1.0) ) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) @@ -2087,7 +2039,6 @@ (set! (-> *run-attack-mods* turnvv) 0.0) (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) (target-exit) - (none) ) :trans (behavior () (when (!= (-> self state-time) (-> *display* base-frame-counter)) @@ -2174,7 +2125,6 @@ ) ) ) - (none) ) :code (behavior () (if (logtest? (-> self water flags) (water-flags wt09)) @@ -2271,22 +2221,21 @@ (go target-falling #f) ) (go target-stance) - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-attack-air (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v0-0 (target-bonk-event-handler proc arg1 event-type event))) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v0-0 (target-bonk-event-handler proc argc message block))) (cond (v0-0 (empty) v0-0 ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -2356,13 +2305,11 @@ ) (set! (-> self control dynam gravity-length) 122880.0) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) ((-> target-attack exit)) - (none) ) :trans (behavior () (when (logtest? (-> self control status) (cshape-moving-flags onsurf)) @@ -2397,7 +2344,6 @@ (game-task none) ) ) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-push! 1 (seconds 0.075)) @@ -2459,7 +2405,6 @@ ) ) (go target-falling #f) - (none) ) :post target-post ) @@ -2472,7 +2417,6 @@ (target-start-attack) (target-danger-set! 'uppercut #f) (set! (-> self control unknown-surface00) *turn-around-mods*) - (none) ) :exit target-exit :code (behavior ((arg0 float) (arg1 float)) @@ -2491,7 +2435,6 @@ (ja :num! (seek! (ja-aframe (the-as float 7.0) 0))) ) (go target-attack-uppercut-jump arg0 arg1) - (none) ) :post target-post ) @@ -2511,7 +2454,6 @@ (set! (-> self control unknown-surface00) *uppercut-jump-mods*) (target-start-attack) (target-danger-set! 'uppercut #f) - (none) ) :exit target-exit :trans (behavior () @@ -2562,7 +2504,6 @@ (target-danger-set! 'harmless #f) ) (slide-down-test) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (compute-alignment! (-> self align)) @@ -2590,21 +2531,20 @@ ) ) (go target-falling #f) - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-flop (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v0-0 (target-bonk-event-handler proc arg1 event-type event))) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v0-0 (target-bonk-event-handler proc argc message block))) (cond (v0-0 (empty) v0-0 ) - ((let ((v1-0 event-type)) + ((let ((v1-0 message)) (= v1-0 'swim) ) (cond @@ -2626,7 +2566,7 @@ ) ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -2663,14 +2603,12 @@ ) ) ) - (none) ) :exit (behavior () (target-danger-set! 'harmless #f) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) - (none) ) :trans (behavior () (delete-back-vel) @@ -2733,7 +2671,6 @@ (target-start-attack) (target-danger-set! 'flop #f) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 float)) (ja-channel-set! 2) @@ -2833,20 +2770,19 @@ (suspend) ) ) - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-flop-hit-ground (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('swim) #f ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -2869,7 +2805,6 @@ (set! (-> self control unknown-surface00) *flop-land-mods*) (logclear! (-> *flop-land-mods* flags) (surface-flags allow-edge-grab)) (logior! (-> self state-flags) (state-flags flop-hit-ground)) - (none) ) :exit target-exit :trans (behavior () @@ -2902,23 +2837,21 @@ ) ) (slide-down-test) - (none) ) :code (behavior ((arg0 symbol)) (target-hit-ground-anim arg0) (go target-falling #f) - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-wheel (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (= event-type 'touched) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (= message 'touched) (send-event proc 'roll) ) - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -2935,7 +2868,6 @@ (set! (-> self control unknown-uint20) (the-as uint 0)) (set! (-> self control unknown-int21) 0) 0 - (none) ) :exit (behavior () (when (!= (-> self next-state name) 'target-wheel) @@ -2943,7 +2875,6 @@ (set! (-> self control unknown-dword30) (-> *display* base-frame-counter)) ) (target-exit) - (none) ) :code (behavior () (let ((gp-0 0)) @@ -3030,7 +2961,6 @@ ) ) (go target-duck-stance) - (none) ) :post target-post ) @@ -3040,7 +2970,6 @@ :event target-standard-event-handler :enter (behavior ((arg0 float) (arg1 float)) (set! (-> self control unknown-surface00) *wheel-flip-mods*) - (none) ) :exit target-exit :trans (behavior () @@ -3062,7 +2991,6 @@ ) (go target-attack-air #f) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (ja-channel-push! 1 (seconds 0.04)) @@ -3163,7 +3091,6 @@ (go target-hit-ground #f) (go target-stance) ) - (none) ) :post target-post ) diff --git a/test/decompiler/reference/jak1/engine/ui/hud_REF.gc b/test/decompiler/reference/jak1/engine/ui/hud_REF.gc index 5ff46d2150e..d08b005cdbf 100644 --- a/test/decompiler/reference/jak1/engine/ui/hud_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/hud_REF.gc @@ -219,9 +219,9 @@ ;; failed to figure out what this is: (defstate hud-hidden (hud) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('show) (if (and (not *progress-process*) (!= (-> self last-hide-time) (-> *display* base-frame-counter))) (go hud-arriving) @@ -272,33 +272,29 @@ (kill-and-free-particles (-> self particles gp-1 part)) (set! (-> self particles gp-1 part matrix) -1) ) - (none) ) :exit (behavior () (set! (-> self y-offset) (-> self next-y-offset)) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (loop (suspend) ) - (none) ) :post (behavior () (if (-> self deactivate-when-hidden) (deactivate self) ) (hud-update self) - (none) ) ) ;; failed to figure out what this is: (defstate hud-arriving (hud) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-3 object)) - (case event-type + (case message (('hide-quick) (set! (-> self last-hide-time) (-> *display* base-frame-counter)) (set! (-> self force-on-screen) #f) @@ -351,7 +347,6 @@ (set! (-> self particles gp-1 part matrix) (sprite-allocate-user-hvdf)) ) ) - (none) ) :code (behavior () (loop @@ -373,13 +368,11 @@ ) (suspend) ) - (none) ) :post (behavior () (hud-update self) (draw-particles self) (draw-hud self) - (none) ) ) @@ -403,7 +396,6 @@ (go hud-hidden) ) (go hud-leaving 5) - (none) ) :post (-> hud-arriving post) ) @@ -431,7 +423,6 @@ ) (suspend) ) - (none) ) :post (-> hud-arriving post) ) @@ -478,7 +469,6 @@ (fuel-cell-animate) ) ) - (none) ) :code (behavior ((arg0 handle)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -527,7 +517,6 @@ ) ) ) - (none) ) :post ja-post ) diff --git a/test/decompiler/reference/jak1/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak1/engine/ui/progress/progress_REF.gc index 70557fc853a..913926a40cc 100644 --- a/test/decompiler/reference/jak1/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/progress/progress_REF.gc @@ -1088,8 +1088,8 @@ ;; failed to figure out what this is: (defstate progress-waiting (progress) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('go-away) (go progress-gone) ) @@ -1109,7 +1109,6 @@ ) (suspend) ) - (none) ) ) @@ -1121,7 +1120,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -1935,162 +1933,161 @@ ;; failed to figure out what this is: (defstate progress-normal (progress) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (the-as object (case event-type - (('go-away) - (go progress-going-out) - ) - (('notify) - (cond - ((= (-> event param 0) 'done) - (case (-> self display-state) - (((progress-screen memcard-saving)) - (cond - ((= (-> self display-state-stack 0) (progress-screen title)) - (let ((gp-1 (-> *setting-control* default auto-save))) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "intro-start") - (set! (-> *setting-control* default auto-save) gp-1) - ) - (the-as object (set-master-mode 'game)) - ) - (else - (set! v0-0 -1) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - ) - ) - (((progress-screen memcard-formatting)) - (set! (-> self force-transition) #t) - (set! v0-0 15) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-creating)) - (cond - ((= (-> self display-state-stack 0) (progress-screen title)) - (set! v0-0 18) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - ) - (else - (set! v0-0 17) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - ) - ) - v0-0 - ) - ) - ) - ((= (-> event param 0) 'error) - (let ((t9-4 format) - (a0-17 #t) - (a1-2 "ERROR NOTIFY: ~S ~D~%") - (v1-13 (-> event param 1)) - ) - (t9-4 - a0-17 - a1-2 - (cond - ((= v1-13 17) - "no-auto-save" - ) - ((= v1-13 16) - "no-process" - ) - ((= v1-13 15) - "bad-version" - ) - ((= v1-13 14) - "no-space" - ) - ((= v1-13 13) - "no-save" - ) - ((= v1-13 12) - "no-file" - ) - ((= v1-13 11) - "no-format" - ) - ((= v1-13 10) - "no-last" - ) - ((= v1-13 9) - "no-card" - ) - ((= v1-13 8) - "no-memory" - ) - ((= v1-13 7) - "new-game" - ) - ((= v1-13 6) - "read-error" - ) - ((= v1-13 5) - "write-error" - ) - ((= v1-13 4) - "internal-error" - ) - ((= v1-13 3) - "format-failed" - ) - ((= v1-13 2) - "bad-handle" - ) - ((= v1-13 1) - "ok" - ) - ((zero? v1-13) - "busy" - ) - (else - "*unknown*" - ) - ) - (-> self display-state) - ) - ) - (case (-> event param 1) - ((14) - (set! v0-0 7) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (else - (case (-> self display-state) - (((progress-screen memcard-formatting)) - (set! v0-0 24) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-creating)) - (set! v0-0 25) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-saving)) - (set! v0-0 21) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-loading)) - (set! v0-0 20) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - ) - ) - ) - ) - ) - ) - ) + (case message + (('go-away) + (go progress-going-out) + ) + (('notify) + (cond + ((= (-> block param 0) 'done) + (case (-> self display-state) + (((progress-screen memcard-saving)) + (cond + ((= (-> self display-state-stack 0) (progress-screen title)) + (let ((gp-1 (-> *setting-control* default auto-save))) + (sound-volume-off) + (set! (-> *game-info* mode) 'play) + (initialize! *game-info* 'game (the-as game-save #f) "intro-start") + (set! (-> *setting-control* default auto-save) gp-1) + ) + (set-master-mode 'game) + ) + (else + (set! v0-0 -1) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + v0-0 + ) + ) + ) + (((progress-screen memcard-formatting)) + (set! (-> self force-transition) #t) + (set! v0-0 15) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + v0-0 + ) + (((progress-screen memcard-creating)) + (cond + ((= (-> self display-state-stack 0) (progress-screen title)) + (set! v0-0 18) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + ) + (else + (set! v0-0 17) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + ) + ) + v0-0 + ) ) + ) + ((= (-> block param 0) 'error) + (let ((t9-4 format) + (a0-17 #t) + (a1-2 "ERROR NOTIFY: ~S ~D~%") + (v1-13 (-> block param 1)) + ) + (t9-4 + a0-17 + a1-2 + (cond + ((= v1-13 17) + "no-auto-save" + ) + ((= v1-13 16) + "no-process" + ) + ((= v1-13 15) + "bad-version" + ) + ((= v1-13 14) + "no-space" + ) + ((= v1-13 13) + "no-save" + ) + ((= v1-13 12) + "no-file" + ) + ((= v1-13 11) + "no-format" + ) + ((= v1-13 10) + "no-last" + ) + ((= v1-13 9) + "no-card" + ) + ((= v1-13 8) + "no-memory" + ) + ((= v1-13 7) + "new-game" + ) + ((= v1-13 6) + "read-error" + ) + ((= v1-13 5) + "write-error" + ) + ((= v1-13 4) + "internal-error" + ) + ((= v1-13 3) + "format-failed" + ) + ((= v1-13 2) + "bad-handle" + ) + ((= v1-13 1) + "ok" + ) + ((zero? v1-13) + "busy" + ) + (else + "*unknown*" + ) + ) + (-> self display-state) + ) + ) + (case (-> block param 1) + ((14) + (set! v0-0 7) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + v0-0 + ) + (else + (case (-> self display-state) + (((progress-screen memcard-formatting)) + (set! v0-0 24) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + v0-0 + ) + (((progress-screen memcard-creating)) + (set! v0-0 25) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + v0-0 + ) + (((progress-screen memcard-saving)) + (set! v0-0 21) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + v0-0 + ) + (((progress-screen memcard-loading)) + (set! v0-0 20) + (set! (-> self next-display-state) (the-as progress-screen v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + ) + ) ) :code (behavior () (loop @@ -2233,7 +2230,6 @@ ) (suspend) ) - (none) ) :post (behavior () (let* ((a1-0 (-> self display-level-index)) @@ -2401,7 +2397,6 @@ ) (adjust-sprites self) (adjust-icons self) - (none) ) ) @@ -2416,7 +2411,6 @@ (sound-play "select-menu") (set-blackout-frames 0) (set! *pause-lock* #f) - (none) ) :code (behavior () (loop @@ -2434,7 +2428,6 @@ ) (suspend) ) - (none) ) :post (-> progress-normal post) ) @@ -2451,7 +2444,6 @@ (set! (-> self transition-speed) 30.0) ) ) - (none) ) :code (behavior () (loop @@ -2469,15 +2461,14 @@ ) (suspend) ) - (none) ) :post (-> progress-normal post) ) ;; failed to figure out what this is: (defstate progress-debug (progress) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('go-away) (go progress-going-out) ) @@ -2529,7 +2520,6 @@ (load-game-text-info (-> *text-group-names* (-> self current-debug-group)) '*common-text* *common-text-heap*) (suspend) ) - (none) ) :post (behavior () (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) @@ -2678,7 +2668,6 @@ (draw-debug-text-box gp-4) (print-game-text (-> *common-text* data (-> self current-debug-string) text) gp-4 #f 128 22) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/kernel/gkernel-h_REF.gc b/test/decompiler/reference/jak1/kernel/gkernel-h_REF.gc index 8ffeea6971c..1fc5e99dc6e 100644 --- a/test/decompiler/reference/jak1/kernel/gkernel-h_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gkernel-h_REF.gc @@ -242,13 +242,13 @@ ;; definition of type protect-frame (deftype protect-frame (stack-frame) - ((exit (function none) :offset-assert 12) + ((exit (function object) :offset-assert 12) ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 (:methods - (new (symbol type (function none)) protect-frame 0) + (new (symbol type (function object)) protect-frame 0) ) ) @@ -292,7 +292,7 @@ ;; definition of type state (deftype state (protect-frame) ((code function :offset-assert 16) - (trans (function none) :offset-assert 20) + (trans (function object) :offset-assert 20) (post function :offset-assert 24) (enter function :offset-assert 28) (event (function process int symbol event-message-block object) :offset-assert 32) @@ -301,7 +301,7 @@ :size-assert #x24 :flag-assert #x900000024 (:methods - (new (symbol type symbol function (function none) function (function none) (function process int symbol event-message-block object)) _type_ 0) + (new (symbol type symbol function (function object) function (function object) (function process int symbol event-message-block object)) _type_ 0) ) ) diff --git a/test/decompiler/reference/jak1/kernel/gkernel_REF.gc b/test/decompiler/reference/jak1/kernel/gkernel_REF.gc index 369c446da84..b6806621555 100644 --- a/test/decompiler/reference/jak1/kernel/gkernel_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gkernel_REF.gc @@ -1139,7 +1139,7 @@ ;; definition for method 0 of type protect-frame ;; INFO: Return type mismatch int vs protect-frame. -(defmethod new protect-frame ((allocation symbol) (type-to-make type) (arg0 (function none))) +(defmethod new protect-frame ((allocation symbol) (type-to-make type) (arg0 (function object))) (with-pp (let ((v0-0 (the-as object (+ (the-as int allocation) 4)))) (set! (-> (the-as protect-frame v0-0) type) type-to-make) diff --git a/test/decompiler/reference/jak1/kernel/gstate_REF.gc b/test/decompiler/reference/jak1/kernel/gstate_REF.gc index a225d9e3001..70fa3cfc4a6 100644 --- a/test/decompiler/reference/jak1/kernel/gstate_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gstate_REF.gc @@ -6,9 +6,9 @@ (type-to-make type) (name symbol) (code function) - (trans (function none)) + (trans (function object)) (enter function) - (exit (function none)) + (exit (function object)) (event (function process int symbol event-message-block object)) ) (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) diff --git a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc index 5227f29fd69..8395b5350b0 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc @@ -41,7 +41,6 @@ (defstate windmill-one-idle (windmill-one) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (rider-trans) @@ -50,7 +49,6 @@ (sound-play "gears-rumble" :id (-> self sound-id) :position (the-as symbol t2-0)) ) ) - (none) ) :code (behavior () (loop @@ -60,7 +58,6 @@ (ja :num! (seek! max 0.5)) ) ) - (none) ) :post (the-as (function none :behavior windmill-one) rider-post) ) @@ -232,19 +229,19 @@ ;; failed to figure out what this is: (defstate grottopole-idle (grottopole) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (when (= (-> proc type) target) - (case event-type + (case message (('attack) - (let ((v1-2 (-> event param 2))) + (let ((v1-2 (-> block param 2))) (when (!= v1-2 (-> self incomming-attack-id)) (set! (-> self incomming-attack-id) v1-2) - (case (-> event param 1) + (case (-> block param 1) (('uppercut) (when (and (< (-> *target* control trans y) (+ -40960.0 (-> self root-override trans y))) (< (-> self position) (-> self max-position)) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 2) ) @@ -259,7 +256,7 @@ (when (and (< (+ -40960.0 (-> self root-override trans y)) (-> *target* control trans y)) (> (-> self position) 0) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) @@ -285,7 +282,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) @@ -342,7 +338,6 @@ ) (move-grottopole self 1.0) (go grottopole-idle) - (none) ) :post (the-as (function none :behavior grottopole) transform-post) ) @@ -357,7 +352,6 @@ ) (move-grottopole self -1.0) (go grottopole-idle) - (none) ) :post (the-as (function none :behavior grottopole) transform-post) ) @@ -585,8 +579,8 @@ ;; failed to figure out what this is: (defstate ecoventrock-idle (ecoventrock) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (sound-play "cannon-shot") (increment-success-for-hint (text-id sidekick-hint-ecorocks)) @@ -600,7 +594,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) @@ -612,7 +605,6 @@ ) :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior ((arg0 symbol)) (local-vars (sv-128 symbol)) @@ -717,7 +709,6 @@ ) (process-entity-status! self (entity-perm-status dead) #t) (deactivate self) - (none) ) ) @@ -785,7 +776,6 @@ (defstate flying-rock-rolling (flying-rock) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior () (let ((gp-0 #f) @@ -859,14 +849,12 @@ (suspend) ) (go flying-rock-idle) - (none) ) :post (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) (go flying-rock-idle) ) (ja-post) - (none) ) ) @@ -882,7 +870,6 @@ (suspend) ) (deactivate self) - (none) ) :post (the-as (function none :behavior flying-rock) ja-post) ) @@ -978,7 +965,6 @@ (pusher-post) (suspend) ) - (none) ) ) @@ -988,7 +974,7 @@ (let ((v1-0 arg2)) (quaternion-axis-angle! (the-as quaternion (&-> arg0 link)) 0.0 0.0 1.0 (-> v1-0 angle)) ) - (the-as object 0) + 0 ) ;; definition for method 11 of type bladeassm @@ -1132,12 +1118,12 @@ ;; failed to figure out what this is: (defstate flutflutegg-idle (flutflutegg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (when (and (= event-type 'attack) - (or (= (-> event param 1) 'punch) (= (-> event param 1) 'spin) (= (-> event param 1) 'spin-air)) - (!= (-> self incomming-attack-id) (-> event param 2)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (= message 'attack) + (or (= (-> block param 1) 'punch) (= (-> block param 1) 'spin) (= (-> block param 1) 'spin-air)) + (!= (-> self incomming-attack-id) (-> block param 2)) ) - (set! (-> self incomming-attack-id) (-> event param 2)) + (set! (-> self incomming-attack-id) (-> block param 2)) (flutflutegg-hit-sounds) (let ((s5-1 (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans)) @@ -1213,43 +1199,38 @@ ) ) ) - (none) ) :code (behavior () (ja-post) (loop (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate flutflutegg-physics (flutflutegg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (= event-type 'attack) - (or (= (-> event param 1) 'punch) (= (-> event param 1) 'spin) (= (-> event param 1) 'spin-air)) - (!= (-> self incomming-attack-id) (-> event param 2)) - ) - (set! (-> self incomming-attack-id) (-> event param 2)) - (flutflutegg-hit-sounds) - (let ((s5-1 - (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans)) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (= message 'attack) + (or (= (-> block param 1) 'punch) (= (-> block param 1) 'spin) (= (-> block param 1) 'spin-air)) + (!= (-> self incomming-attack-id) (-> block param 2)) + ) + (set! (-> self incomming-attack-id) (-> block param 2)) + (flutflutegg-hit-sounds) + (let ((s5-1 + (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans)) ) - (set! (-> s5-1 y) 0.0) - (vector-normalize! s5-1 1.0) - (let ((f0-2 (vector-dot s5-1 (-> self dir))) - (f1-2 (- (* (-> s5-1 x) (-> self dir z)) (* (-> s5-1 z) (-> self dir x)))) - ) - (if (< f0-2 -0.7) - (the-as symbol (flutflutegg-method-20 self 24576.0 (* -8192.0 f1-2) (* -8192.0 f0-2))) - (the-as symbol (flutflutegg-method-20 self 0.0 (* -8192.0 f1-2) (* -8192.0 f0-2))) - ) ) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (let ((f0-2 (vector-dot s5-1 (-> self dir))) + (f1-2 (- (* (-> s5-1 x) (-> self dir z)) (* (-> s5-1 z) (-> self dir x)))) + ) + (if (< f0-2 -0.7) + (flutflutegg-method-20 self 24576.0 (* -8192.0 f1-2) (* -8192.0 f0-2)) + (flutflutegg-method-20 self 0.0 (* -8192.0 f1-2) (* -8192.0 f0-2)) + ) ) ) ) @@ -1279,7 +1260,6 @@ (go flutflutegg-physics-fall) ) ) - (none) ) :post (the-as (function none :behavior flutflutegg) ja-post) ) @@ -1345,7 +1325,6 @@ (sound-play "sack-land" :vol 200) (go flutflutegg-break #f) ) - (none) ) :post (the-as (function none :behavior flutflutegg) ja-post) ) @@ -1401,7 +1380,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) :post (the-as (function none :behavior flutflutegg) ja-post) ) @@ -1495,8 +1473,8 @@ ;; failed to figure out what this is: (defstate harvester-idle (harvester) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('update) (if (and (-> self alt-actor) (logtest? (-> self alt-actor extra perm status) (entity-perm-status complete))) (go harvester-inflate #f) @@ -1514,7 +1492,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) @@ -1535,7 +1512,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior harvester) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/beach/beach-part_REF.gc b/test/decompiler/reference/jak1/levels/beach/beach-part_REF.gc index 115bf59a75b..32fb0c684aa 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-part_REF.gc @@ -108,7 +108,6 @@ ) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc b/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc index ec77c31729f..416f550e258 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc @@ -293,8 +293,8 @@ ;; failed to figure out what this is: (defstate idle (beach-rock) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (set! (-> self trigger) #t) (go-virtual falling) @@ -314,7 +314,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) @@ -327,7 +326,6 @@ (spool-push *art-control* "lrocklrg-falling" 0 self -1.0) (suspend) ) - (none) ) ) @@ -363,7 +361,6 @@ ) (set! (-> self prev-frame) f30-0) ) - (none) ) :code (behavior () (local-vars (v1-3 symbol) (v1-49 symbol)) @@ -420,7 +417,6 @@ ) (set! (-> self draw bounds w) 20480.0) (go-virtual fallen) - (none) ) :post (the-as (function none :behavior beach-rock) transform-post) ) @@ -447,7 +443,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior beach-rock) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/beach/bird-lady-beach_REF.gc b/test/decompiler/reference/jak1/levels/beach/bird-lady-beach_REF.gc index 93ad1d167d3..e5841347804 100644 --- a/test/decompiler/reference/jak1/levels/beach/bird-lady-beach_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/bird-lady-beach_REF.gc @@ -47,7 +47,6 @@ (go-virtual hidden) ) ((-> (method-of-type process-taskable idle) enter)) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc b/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc index 40cd515669a..28fbcedbb63 100644 --- a/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc @@ -100,10 +100,9 @@ 6144.0 16384.0 ) - (the-as object (if (not (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8))) - (do-push-aways! (-> obj collide-info)) - ) - ) + (if (not (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8))) + (do-push-aways! (-> obj collide-info)) + ) ) ;; definition for method 43 of type lurkercrab @@ -218,7 +217,6 @@ nav-enemy-default-event-handler ) :exit (behavior () (set! (-> self draw force-lod) -1) - (none) ) :code (behavior () (set! (-> self target-speed) 0.0) @@ -248,7 +246,6 @@ nav-enemy-default-event-handler (ja :num! (seek! (ja-aframe 1.0 0))) ) ) - (none) ) ) @@ -289,7 +286,6 @@ nav-enemy-default-event-handler (lurkercrab-invulnerable) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) - (none) ) :code (behavior () (when (ja-group? lurkercrab-idle-ja) @@ -350,7 +346,6 @@ nav-enemy-default-event-handler (ja :num! (seek! (ja-aframe 90.0 0))) ) ) - (none) ) ) @@ -363,7 +358,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-chase) - (none) ) ) @@ -377,7 +371,6 @@ nav-enemy-default-event-handler :exit (behavior () (lurkercrab-invulnerable) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) - (none) ) :trans (behavior () (if (logtest? (-> *target* state-flags) @@ -388,7 +381,6 @@ nav-enemy-default-event-handler (if (< (ja-aframe-num 0) 2.0) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) ) - (none) ) :code (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) @@ -439,7 +431,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) ) - (none) ) ) @@ -452,7 +443,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-patrol) - (none) ) ) @@ -465,7 +455,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-patrol) - (none) ) ) @@ -485,7 +474,6 @@ nav-enemy-default-event-handler (suspend) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -497,7 +485,6 @@ nav-enemy-default-event-handler ) :exit (behavior () (set! (-> self orient) #t) - (none) ) :code (behavior () (set! (-> self momentum-speed) 57344.0) @@ -519,7 +506,6 @@ nav-enemy-default-event-handler ) ) (go-virtual nav-enemy-chase) - (none) ) :post (behavior () (let ((a0-0 (-> self part)) @@ -528,7 +514,6 @@ nav-enemy-default-event-handler (spawn a0-0 (the-as vector a1-0)) ) (nav-enemy-travel-post) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc b/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc index 33159ba5d01..3a0c8ef0fe6 100644 --- a/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc @@ -45,7 +45,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-chase) - (none) ) ) @@ -85,7 +84,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) ) @@ -131,7 +129,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) ) @@ -165,7 +162,6 @@ nav-enemy-default-event-handler (ja :num! (seek! max 1.4)) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -179,7 +175,6 @@ nav-enemy-default-event-handler :code (behavior () (sound-play "head-butt") (go-virtual nav-enemy-victory) - (none) ) ) @@ -192,7 +187,6 @@ nav-enemy-default-event-handler ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) - (none) ) :code (behavior () (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) @@ -211,7 +205,6 @@ nav-enemy-default-event-handler ) ) (go-virtual nav-enemy-chase) - (none) ) :post (the-as (function none :behavior lurkerpuppy) nav-enemy-face-player-post) ) diff --git a/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc b/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc index 9ab21a5f23a..4ef3f95021b 100644 --- a/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc @@ -323,7 +323,6 @@ lurkerworm-default-post-behavior :enter (behavior () (ja-channel-set! 0) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior () (loop @@ -335,7 +334,6 @@ lurkerworm-default-post-behavior ) (suspend) ) - (none) ) :post lurkerworm-default-post-behavior ) @@ -346,7 +344,6 @@ lurkerworm-default-post-behavior :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (sound-play "worm-rise1") - (none) ) :code (behavior () (set! (-> self part local-clock) 0) @@ -361,7 +358,6 @@ lurkerworm-default-post-behavior ) (suspend) ) - (none) ) :post lurkerworm-default-post-behavior ) @@ -371,7 +367,6 @@ lurkerworm-default-post-behavior :event lurkerworm-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior () (ja-channel-set! 1) @@ -384,7 +379,6 @@ lurkerworm-default-post-behavior ) (set! (-> self strike-count) 3) (go lurkerworm-rest) - (none) ) :post lurkerworm-default-post-behavior ) @@ -395,11 +389,9 @@ lurkerworm-default-post-behavior :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self vulnerable) #t) - (none) ) :exit (behavior () (set! (-> self vulnerable) #f) - (none) ) :code (behavior () (let* ((f30-0 10.0) @@ -449,7 +441,6 @@ lurkerworm-default-post-behavior (go lurkerworm-sink) ) ) - (none) ) :post lurkerworm-default-post-behavior ) @@ -470,7 +461,6 @@ lurkerworm-default-post-behavior (ja-no-eval :num! (seek!)) (ja-channel-push! 1 (seconds 0.135)) (go lurkerworm-rest) - (none) ) :post lurkerworm-default-post-behavior ) @@ -480,7 +470,6 @@ lurkerworm-default-post-behavior :event lurkerworm-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior () (ja-no-eval :group! lurkerworm-sink-ja :num! (seek!) :frame-num 0.0) @@ -491,7 +480,6 @@ lurkerworm-default-post-behavior (ja :num! (seek!)) ) (go lurkerworm-idle) - (none) ) :post lurkerworm-default-post-behavior ) @@ -515,7 +503,6 @@ lurkerworm-default-post-behavior (ja :num! (seek!)) ) (cleanup-for-death self) - (none) ) :post lurkerworm-default-post-behavior ) diff --git a/test/decompiler/reference/jak1/levels/beach/mayor_REF.gc b/test/decompiler/reference/jak1/levels/beach/mayor_REF.gc index 84bdf3f1e0d..88716556c2a 100644 --- a/test/decompiler/reference/jak1/levels/beach/mayor_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/mayor_REF.gc @@ -44,6 +44,7 @@ ) ;; definition for method 48 of type mayor +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow mayor ((obj mayor)) (-> obj draw shadow-ctrl) (cond @@ -709,7 +710,6 @@ (go-virtual hidden) ) ((-> (method-of-type process-taskable idle) trans)) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type process-taskable idle) post))) @@ -718,7 +718,6 @@ ) ) (do-push-aways! (-> self root-override)) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc b/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc index e356dacbda7..462c7ac976c 100644 --- a/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc @@ -229,26 +229,23 @@ ;; failed to figure out what this is: (defstate pelican-circle (pelican) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('dive) - (let ((v0-0 (the-as structure #t))) - (set! (-> self state-object) (the-as symbol v0-0)) - v0-0 - ) - ) - (('fuel-cell) - (handle->process (-> self fuel-cell)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('dive) + (let ((v0-0 (the-as structure #t))) + (set! (-> self state-object) (the-as symbol v0-0)) + v0-0 ) - (('position) - (set! (-> self path-pos) (the-as float (-> event param 0))) - (let ((a1-3 (path-control-method-12 (-> self path) (new 'stack-no-clear 'vector) (-> self path-pos)))) - (set-heading-vec! (-> self root-override) a1-3) - ) + ) + (('fuel-cell) + (handle->process (-> self fuel-cell)) + ) + (('position) + (set! (-> self path-pos) (the-as float (-> block param 0))) + (let ((a1-3 (path-control-method-12 (-> self path) (new 'stack-no-clear 'vector) (-> self path-pos)))) + (set-heading-vec! (-> self root-override) a1-3) ) - ) + ) ) ) :enter (behavior () @@ -281,7 +278,6 @@ (/ (* (-> *PELICAN-bank* circle-speed) (-> self path-max)) (path-distance (-> self path))) ) (set-roll-to-grav-2! (-> self root-override) -2730.6667) - (none) ) :trans (behavior () (pelican-path-update 728177.75 30 1.0 (/ (-> self path-max) (path-distance (-> self path))) #f) @@ -350,7 +346,6 @@ ) (go pelican-dive (-> self path-dive0) (-> self path-to-nest0) (-> *PELICAN-bank* to-nest0-time)) ) - (none) ) :code (behavior () (suspend) @@ -359,23 +354,21 @@ (the-as (function pelican int) (lambda () (rand-vu-int-range 2 4))) (the-as (function pelican int) (lambda () (rand-vu-int-range 3 5))) ) - (none) ) :post pelican-post ) ;; failed to figure out what this is: (defstate pelican-dive (pelican) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('got-cell?) - (-> self state-object) - ) - (('fuel-cell) - (handle->process (-> self fuel-cell)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('got-cell?) + (-> self state-object) + ) + (('fuel-cell) + (handle->process (-> self fuel-cell)) + ) + ) ) :enter (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame)) (init! (-> self query) (the-as string #f) 40 150 25 #t (the-as string #f)) @@ -403,11 +396,9 @@ ) (set! (-> self draw force-lod) 0) 0 - (none) ) :exit (behavior () (set! (-> self draw force-lod) -1) - (none) ) :trans (behavior () (if (not (handle->process (-> self fuel-cell))) @@ -418,7 +409,6 @@ (if (= (-> self path-pos) (-> self path-max)) (go pelican-to-nest (-> self path-cache) (the-as int (-> self time-cache))) ) - (none) ) :code (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame)) (ja-channel-push! 1 (seconds 0.2)) @@ -445,7 +435,6 @@ (ja :num! (seek!)) ) (anim-loop) - (none) ) :post pelican-post ) @@ -457,7 +446,6 @@ (set! (-> self path-pos) 0.0) (set! (-> self path-max) (the float (+ (-> self path curve num-cverts) -1))) (set! (-> self path-speed) (/ (* 300.0 (-> self path-max)) (the float arg1))) - (none) ) :trans (behavior () (pelican-path-update 546133.3 30 0.0 0.0 #f) @@ -465,7 +453,6 @@ (if (= (-> self path-pos) (-> self path-max)) (go pelican-wait-at-nest #f) ) - (none) ) :code (behavior ((arg0 path-control) (arg1 int)) (pelican-fly @@ -476,61 +463,56 @@ ) ) ) - (none) ) :post pelican-post ) ;; failed to figure out what this is: (defstate pelican-wait-at-nest (pelican) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (case (-> event param 1) - (('explode) - (let ((a0-2 (handle->process (-> self fuel-cell)))) - (if a0-2 - (send-event a0-2 'trans (-> self root-override trans)) - ) - ) - (go pelican-explode #f) - #f + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (case (-> block param 1) + (('explode) + (let ((a0-2 (handle->process (-> self fuel-cell)))) + (if a0-2 + (send-event a0-2 'trans (-> self root-override trans)) + ) ) - (else - (let* ((gp-0 proc) - (v1-13 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) - gp-0 - ) - ) - (f30-0 8192.0) - (gp-1 (-> self root-override)) - (s4-0 (-> (the-as process-drawable v1-13) root trans)) - ) - (if (< f30-0 - (fabs - (deg-diff (y-angle gp-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s4-0 (-> gp-1 trans)))) - ) + (go pelican-explode #f) + #f + ) + (else + (let* ((gp-0 proc) + (v1-13 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) + gp-0 + ) + ) + (f30-0 8192.0) + (gp-1 (-> self root-override)) + (s4-0 (-> (the-as process-drawable v1-13) root trans)) + ) + (if (< f30-0 + (fabs + (deg-diff (y-angle gp-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s4-0 (-> gp-1 trans)))) ) - (go pelican-spit) - ) - ) + ) + (go pelican-spit) + ) ) ) ) - (('touch) - (the-as object (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> event param 0)) - 0.7 - 6144.0 - 16384.0 - ) - ) + ) + (('touch) + (send-shove-back + (-> self root-override) + proc + (the-as touching-shapes-entry (-> block param 0)) + 0.7 + 6144.0 + 16384.0 ) - ) + ) ) ) :enter (behavior ((arg0 symbol)) @@ -563,13 +545,11 @@ (if (nonzero? (-> self neck)) (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) ) - (none) ) :exit (behavior () (if (nonzero? (-> self neck)) (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) ) - (none) ) :trans (behavior () (let ((a1-0 (-> self state-vector)) @@ -582,7 +562,6 @@ (do-push-aways! (-> self root-override)) (seek-toward-heading-vec! (-> self root-override) (-> self path-vector) 131072.0 (seconds 1)) (spool-push *art-control* "pelican-spit-ext" 0 self -99.0) - (none) ) :code (behavior ((arg0 symbol)) (cond @@ -622,7 +601,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (behavior () (when *target* @@ -634,7 +612,6 @@ ) ) (pelican-post) - (none) ) ) @@ -727,43 +704,37 @@ (send-event gp-3 'trans s5-3) ) (send-event gp-3 'draw #t) - (send-event - gp-3 - 'event-hook - (lambda :behavior pelican - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (when (or (= arg2 'touch) (= arg2 'attack)) - (let ((v1-7 (birth-pickup-at-point - (-> self root-override trans) - (pickup-type fuel-cell) - (the float (-> self entity extra perm task)) - #f - *entity-pool* - (the-as fact-info #f) + (send-event gp-3 'event-hook (lambda :behavior pelican + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (when (or (= arg2 'touch) (= arg2 'attack)) + (let ((v1-7 (birth-pickup-at-point + (-> self root-override trans) + (pickup-type fuel-cell) + (the float (-> self entity extra perm task)) + #f + *entity-pool* + (the-as fact-info #f) + ) + ) + ) + (when v1-7 + (set! (-> (the-as collectable (-> v1-7 0)) collect-timeout) 0) + 0 + ) ) + (deactivate self) ) - ) - (when v1-7 - (set! (-> (the-as collectable (-> v1-7 0)) collect-timeout) 0) - 0 - ) - ) - (deactivate self) - ) + ) ) - ) - ) ) ) (go pelican-from-nest) - (none) ) :post (behavior () (if (not (ja-group? pelican-sleep-ja)) (quaternion-identity! (-> self root-override quat)) ) (pelican-post) - (none) ) ) @@ -771,7 +742,6 @@ (defstate pelican-from-nest (pelican) :enter (behavior () (set! (-> self path-pos) 1.5) - (none) ) :trans (behavior () (pelican-path-update 131072.0 150 0.0 0.0 #f) @@ -779,14 +749,12 @@ (if (= (-> self path-pos) (-> self path-max)) (go pelican-dive (-> self path-dive1) (-> self path-to-nest1) (-> *PELICAN-bank* to-nest1-time)) ) - (none) ) :code (behavior () (pelican-fly (the-as (function pelican int) (lambda () (rand-vu-int-range 2 4))) (the-as (function pelican int) zero-func) ) - (none) ) :post pelican-post ) @@ -810,7 +778,6 @@ (eval-path-curve-div! (-> self path) gp-1 0.0 'interp) (set! (-> self state-float 1) (* 0.0073242188 (vector-vector-distance (-> self root-override trans) gp-1))) ) - (none) ) :trans (behavior () (pelican-path-update 546133.3 30 0.0 0.0 #f) @@ -829,7 +796,6 @@ (-> self state-float 0) ) ) - (none) ) :code (behavior ((arg0 path-control) (arg1 time-frame)) (pelican-fly @@ -840,7 +806,6 @@ ) ) ) - (none) ) :post pelican-post ) @@ -849,7 +814,6 @@ (defstate pelican-wait-at-end (pelican) :code (behavior ((arg0 symbol)) (cleanup-for-death self) - (none) ) ) @@ -901,7 +865,6 @@ (clear-collide-with-as (-> self root-override)) (ja-channel-set! 0) (anim-loop) - (none) ) :post (the-as (function none :behavior pelican) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/beach/sculptor_REF.gc b/test/decompiler/reference/jak1/levels/beach/sculptor_REF.gc index 79007c94a73..b60a95ca9bd 100644 --- a/test/decompiler/reference/jak1/levels/beach/sculptor_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/sculptor_REF.gc @@ -52,6 +52,7 @@ ) ;; definition for method 48 of type sculptor +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow sculptor ((obj sculptor)) (-> obj draw shadow-ctrl) (cond @@ -98,7 +99,6 @@ :virtual #t :enter (behavior () (muse-to-idle (the-as muse self)) - (none) ) ) @@ -354,7 +354,6 @@ ) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc b/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc index 5366b6504e1..593ef7ea033 100644 --- a/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc @@ -392,7 +392,6 @@ (the float (sar (shl (the int (+ f30-0 (* f28-0 (+ f26-0 (rand-float-gen))))) 48) 48)) ) ) - (none) ) :trans (behavior () (when (nonzero? (-> self scared)) @@ -416,7 +415,6 @@ ) ) ) - (none) ) :code (behavior () (+! (-> self root-override trans y) 20480.0) @@ -499,7 +497,6 @@ ) ) ) - (none) ) :post seagull-post ) @@ -626,7 +623,6 @@ (-> self part) (-> self root-override root-prim prim-core) ) - (none) ) :code (behavior () (set! (-> self part-time) (-> *display* base-frame-counter)) @@ -669,7 +665,6 @@ (ja-no-eval :num! (seek!)) (ja-channel-push! 1 (seconds 0.067)) (go seagull-flying) - (none) ) :post seagull-post ) @@ -681,7 +676,6 @@ (-> self part) (-> self root-override root-prim prim-core) ) - (none) ) :code (behavior () (set! (-> self max-tilt) 1820.4445) @@ -862,7 +856,6 @@ ) ) ) - (none) ) :post seagull-post ) @@ -874,7 +867,6 @@ (-> self part) (-> self root-override root-prim prim-core) ) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1024,7 +1016,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post seagull-post ) @@ -1178,7 +1169,6 @@ 0 ) (go seagull-idle) - (none) ) :post seagull-post ) @@ -1373,7 +1363,6 @@ ) ) (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) @@ -1389,7 +1378,6 @@ ) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/citadel/assistant-citadel_REF.gc b/test/decompiler/reference/jak1/levels/citadel/assistant-citadel_REF.gc index 62dd3d54da2..9ad5f43c345 100644 --- a/test/decompiler/reference/jak1/levels/citadel/assistant-citadel_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/assistant-citadel_REF.gc @@ -84,7 +84,6 @@ (not (closed? (-> self tasks) (game-task village4-button) (task-status need-reward-speech))) ) ) - (none) ) ) @@ -98,7 +97,6 @@ (send-event self 'play-anim) ) ) - (none) ) :code (behavior () (loop @@ -112,7 +110,6 @@ (ja :num! (seek!)) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc index ab5510224d9..a7bdf55b7ba 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc @@ -107,7 +107,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior citb-arm-section) ja-post) ) @@ -181,7 +180,6 @@ (restore-collide-with-as (-> self root-override)) ) (rider-post) - (none) ) ) @@ -470,14 +468,13 @@ ;; failed to figure out what this is: (defstate citb-disc-idle (citb-disc) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (send-event proc 'no-look-around (seconds 0.25)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (send-event proc 'no-look-around (seconds 0.25)) + #f + ) + ) ) :trans (the-as (function none :behavior citb-disc) rider-trans) :code (behavior () @@ -492,7 +489,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior citb-disc) rider-post) ) @@ -828,7 +824,6 @@ ) ) (send-event (ppointer->process (-> self launcher)) 'trans (-> self basetrans)) - (none) ) ) @@ -945,12 +940,12 @@ ;; failed to figure out what this is: (defstate citb-robotboss-idle (citb-robotboss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (sv-96 int) (sv-112 int)) (the-as - object + symbol (cond - ((= event-type 'shield-off) + ((= message 'shield-off) (stop! (-> self sound)) (if (-> self shield-on) (sound-play "robotcage-off") @@ -958,17 +953,17 @@ (set! (-> self shield-on) #f) #f ) - ((= event-type 'shield-on) + ((= message 'shield-on) (let ((v0-3 #t)) (set! (-> self shield-on) v0-3) v0-3 ) ) - ((= event-type 'die) + ((= message 'die) (cleanup-for-death self) (the-as symbol (deactivate self)) ) - ((or (= event-type 'touch) (= event-type 'attack)) + ((or (= message 'touch) (= message 'attack)) (let ((s4-0 sound-play-by-name) (s3-0 (make-u128 #x7061 (the-as uint #x7a2d646c65696873))) (s2-0 (new-sound-id)) @@ -984,7 +979,7 @@ (the-as symbol (send-event proc 'shove - (-> event param 0) + (-> block param 0) (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) ) ) @@ -1049,7 +1044,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior citb-robotboss) ja-post) ) @@ -1059,7 +1053,6 @@ :code (behavior () (cleanup-for-death self) (deactivate self) - (none) ) ) @@ -1145,8 +1138,8 @@ ;; failed to figure out what this is: (defstate citb-coil-idle (citb-coil) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go citb-coil-break) ) @@ -1160,12 +1153,10 @@ (ja :num! (seek!)) ) ) - (none) ) :post (behavior () (spawn (-> self part) (-> self root trans)) (ja-post) - (none) ) ) @@ -1180,7 +1171,6 @@ (ja :num! (seek!)) ) (go citb-coil-broken) - (none) ) :post (the-as (function none :behavior citb-coil) ja-post) ) @@ -1197,7 +1187,6 @@ (spawn (-> self part-off) (-> self root trans)) (suspend) ) - (none) ) :post (the-as (function none :behavior citb-coil) ja-post) ) @@ -1273,7 +1262,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior citb-hose) ja-post) ) @@ -1289,7 +1277,6 @@ (ja :num! (seek!)) ) (go citb-hose-idle) - (none) ) :post (the-as (function none :behavior citb-hose) ja-post) ) @@ -1306,7 +1293,6 @@ (ja :num! (seek!)) ) (anim-loop) - (none) ) :post (the-as (function none :behavior citb-hose) ja-post) ) @@ -1527,8 +1513,8 @@ ;; failed to figure out what this is: (defstate citb-generator-idle (citb-generator) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (if (-> self mushroom) (increment-success-for-hint (text-id citadel-generator)) @@ -1543,7 +1529,6 @@ ) :exit (behavior () (stop! (-> self sound)) - (none) ) :code (behavior () (lods-assign! (-> self draw) (-> self normal-look)) @@ -1571,7 +1556,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior citb-generator) ja-post) ) @@ -1624,7 +1608,6 @@ ) (sound-play "sagecage-open") (go citb-generator-broken) - (none) ) :post (the-as (function none :behavior citb-generator) ja-post) ) @@ -1649,12 +1632,10 @@ ) ) (anim-loop) - (none) ) :post (behavior () (spawn (-> self part-broken) (-> self root-override trans)) (ja-post) - (none) ) ) @@ -1773,8 +1754,8 @@ ;; failed to figure out what this is: (defstate citadelcam-idle (citadelcam) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (when (and (task-complete? *game-info* (game-task citadel-sage-blue)) (task-complete? *game-info* (game-task citadel-sage-red)) @@ -1789,7 +1770,6 @@ :code (behavior () (logior! (-> self mask) (process-mask actor-pause)) (anim-loop) - (none) ) ) @@ -1839,7 +1819,6 @@ ) (level-hint-spawn (text-id citadel-plat) "sksp0387" (the-as entity #f) *entity-pool* (game-task none)) (go citadelcam-idle) - (none) ) ) @@ -1896,7 +1875,6 @@ ) ) (go-virtual battlecontroller-active) - (none) ) ) @@ -1910,7 +1888,6 @@ ((the-as (function none :behavior battlecontroller) t9-2)) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/citadel/citadel-sages_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citadel-sages_REF.gc index 50dce25485a..922519378d9 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citadel-sages_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citadel-sages_REF.gc @@ -90,34 +90,33 @@ ;; failed to figure out what this is: (defstate citb-sagecage-idle (citb-sagecage) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (local-vars (v0-3 basic)) - (the-as object (case event-type - (('disable-bars) - (stop! (-> self sound)) - (sound-play "sagecage-off") - (set! (-> self bars-on) #f) - (the-as basic (citb-sagecage-update-collision)) - ) - (('enable-bars) - (set! (-> self bars-on) #t) - (the-as basic (citb-sagecage-update-collision)) - ) - (('start-cloning) - (set! v0-3 #t) - (set! (-> self cloning) (the-as symbol v0-3)) - v0-3 - ) - (('stop-cloning) - (set! (-> self cloning) #f) - (let ((v1-7 (-> self skel root-channel 0))) - (set! v0-3 (-> self draw art-group data 3)) - (set! (-> v1-7 frame-group) (the-as art-joint-anim v0-3)) - ) - v0-3 - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-3 object)) + (case message + (('disable-bars) + (stop! (-> self sound)) + (sound-play "sagecage-off") + (set! (-> self bars-on) #f) + (citb-sagecage-update-collision) + ) + (('enable-bars) + (set! (-> self bars-on) #t) + (citb-sagecage-update-collision) + ) + (('start-cloning) + (set! v0-3 #t) + (set! (-> self cloning) (the-as symbol v0-3)) + v0-3 + ) + (('stop-cloning) + (set! (-> self cloning) #f) + (let ((v1-7 (-> self skel root-channel 0))) + (set! v0-3 (-> self draw art-group data 3)) + (set! (-> v1-7 frame-group) (the-as art-joint-anim v0-3)) + ) + v0-3 + ) + ) ) :trans (the-as (function none :behavior citb-sagecage) rider-trans) :code (behavior () @@ -144,7 +143,6 @@ ) (suspend) ) - (none) ) :post (behavior () (rider-post) @@ -152,7 +150,6 @@ (update! (-> self sound)) (citb-sagecage-draw-bars) ) - (none) ) ) @@ -427,7 +424,6 @@ (send-event (handle->process (-> self cage)) 'disable-bars) (send-event (handle->process (-> self cage)) 'stop-cloning) ((-> (method-of-type process-taskable hidden) enter)) - (none) ) ) @@ -457,13 +453,13 @@ ;; failed to figure out what this is: (defstate play-anim (citb-sage) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('disable-bars) (send-event (handle->process (-> self cage)) 'disable-bars) ) (else - ((-> (method-of-type process-taskable play-anim) event) proc arg1 event-type event) + ((-> (method-of-type process-taskable play-anim) event) proc argc message block) ) ) ) @@ -472,13 +468,13 @@ ;; failed to figure out what this is: (defstate idle (citb-sage) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('open) (send-event (handle->process (-> self cage)) 'disable-bars) ) (else - ((-> (method-of-type process-taskable idle) event) proc arg1 event-type event) + ((-> (method-of-type process-taskable idle) event) proc argc message block) ) ) ) @@ -487,14 +483,12 @@ (go-virtual hidden) ) ((-> (method-of-type process-taskable idle) trans)) - (none) ) :post (behavior () ((the-as (function none :behavior citb-sage) (-> (method-of-type process-taskable idle) post))) (if (-> self beam-on) (citb-sage-draw-beam) ) - (none) ) ) @@ -535,6 +529,7 @@ ) ;; definition for method 48 of type red-sagecage +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow red-sagecage ((obj red-sagecage)) (-> obj draw shadow-ctrl) (cond @@ -665,6 +660,7 @@ ) ;; definition for method 48 of type blue-sagecage +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow blue-sagecage ((obj blue-sagecage)) (-> obj draw shadow-ctrl) (cond @@ -800,6 +796,7 @@ ) ;; definition for method 48 of type yellow-sagecage +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow yellow-sagecage ((obj yellow-sagecage)) (-> obj draw shadow-ctrl) (cond @@ -1115,8 +1112,8 @@ ;; failed to figure out what this is: (defstate play-anim (green-sagecage) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('spawn-robot) (let ((gp-0 (entity-by-name "robotboss-3"))) (format 0 "robotboss ent ~A~%" gp-0) @@ -1137,7 +1134,7 @@ ) ) (else - ((-> (method-of-type citb-sage play-anim) event) proc arg1 event-type event) + ((-> (method-of-type citb-sage play-anim) event) proc argc message block) ) ) ) @@ -1189,7 +1186,6 @@ ) (set! (-> self draw bounds w) 10240.0) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) :trans (behavior () (case (-> self which-movie) @@ -1218,7 +1214,6 @@ ) ) ((-> (method-of-type process-taskable play-anim) trans)) - (none) ) ) @@ -1242,7 +1237,6 @@ ) ) ((-> (method-of-type citb-sage idle) trans)) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/citadel/citb-drop-plat_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citb-drop-plat_REF.gc index a4c26483bb0..4fe51446340 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citb-drop-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citb-drop-plat_REF.gc @@ -76,8 +76,8 @@ ;; failed to figure out what this is: (defstate drop-plat-idle (drop-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('drop) (logclear! (-> self mask) (process-mask actor-pause)) (go drop-plat-drop) @@ -100,7 +100,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior drop-plat) ja-post) ) @@ -124,8 +123,8 @@ ;; failed to figure out what this is: (defstate drop-plat-spawn (drop-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('drop) (go drop-plat-die) ) @@ -149,14 +148,13 @@ ) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate drop-plat-rise (drop-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('drop) (go drop-plat-drop) ) @@ -195,7 +193,6 @@ (suspend) ) ) - (none) ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'quaternion))) @@ -204,7 +201,6 @@ ) (drop-plat-set-fade) (transform-post) - (none) ) ) @@ -238,7 +234,6 @@ (+! (-> self spin-angle) (* (-> self spin-speed) (-> *display* seconds-per-frame))) (suspend) ) - (none) ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'quaternion))) @@ -247,7 +242,6 @@ ) (drop-plat-set-fade) (transform-post) - (none) ) ) @@ -255,7 +249,6 @@ (defstate drop-plat-die (drop-plat) :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -525,8 +518,8 @@ ;; failed to figure out what this is: (defstate citb-drop-plat-idle (citb-drop-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go citb-drop-plat-active) ) @@ -537,25 +530,23 @@ (loop (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate citb-drop-plat-active (citb-drop-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('player-stepped) - (when (>= (- (-> *display* base-frame-counter) (-> self drop-time)) (seconds 0.2)) - (set! (-> self drop-time) (-> *display* base-frame-counter)) - (the-as object (citb-drop-plat-drop-children (the-as int (-> event param 0)))) - ) - ) - (('trigger) - (go citb-drop-plat-idle) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('player-stepped) + (when (>= (- (-> *display* base-frame-counter) (-> self drop-time)) (seconds 0.2)) + (set! (-> self drop-time) (-> *display* base-frame-counter)) + (citb-drop-plat-drop-children (the-as int (-> block param 0))) + ) + ) + (('trigger) + (go citb-drop-plat-idle) + ) + ) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -571,7 +562,6 @@ ) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc index 46c2c86e240..9781cfab044 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc @@ -68,7 +68,6 @@ ) (go-virtual citb-base-plat-active) ) - (none) ) :code (the-as (function none :behavior citb-base-plat) anim-loop) :post (the-as (function none :behavior citb-base-plat) ja-post) @@ -85,7 +84,6 @@ (go-virtual citb-base-plat-idle) ) (rider-trans) - (none) ) :code (the-as (function none :behavior citb-base-plat) anim-loop) :post (the-as (function none :behavior citb-base-plat) rider-post) @@ -241,7 +239,6 @@ (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) - (none) ) ) @@ -334,17 +331,16 @@ ;; failed to figure out what this is: (defstate citb-base-plat-idle (citb-stair-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('trigger) - (logclear! (-> self mask) (process-mask actor-pause)) - (let ((v0-0 #t)) - (set! (-> self rise) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((v0-0 #t)) + (set! (-> self rise) v0-0) + v0-0 + ) + ) + ) ) :trans (the-as (function none :behavior citb-stair-plat) #f) :code (behavior () @@ -376,7 +372,6 @@ (transform-post) (suspend) ) - (none) ) :post (the-as (function none :behavior citb-stair-plat) #f) ) @@ -391,7 +386,6 @@ (update-transforms! (-> self root-override)) (logior! (-> self mask) (process-mask actor-pause)) (anim-loop) - (none) ) :post (the-as (function none :behavior citb-stair-plat) ja-post) ) @@ -544,11 +538,9 @@ (go-virtual rigid-body-platform-float) ) ) - (none) ) :code (behavior () (anim-loop) - (none) ) :post (the-as (function none :behavior citb-chain-plat) ja-post) ) @@ -562,11 +554,9 @@ ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (behavior () (stop! (-> self sound)) - (none) ) :trans (behavior () (cond @@ -594,11 +584,9 @@ ) ) ) - (none) ) :code (behavior () (anim-loop) - (none) ) :post (the-as (function none :behavior citb-chain-plat) rigid-body-platform-post) ) @@ -632,7 +620,6 @@ ) (suspend) (go-virtual rigid-body-platform-idle) - (none) ) :post (the-as (function none :behavior citb-chain-plat) rider-post) ) @@ -737,7 +724,6 @@ (go-virtual citb-base-plat-idle) ) ) - (none) ) ) @@ -814,7 +800,6 @@ (* 65536.0 (get-current-phase (-> self sync))) ) (rider-post) - (none) ) ) @@ -891,7 +876,6 @@ (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) - (none) ) ) @@ -982,13 +966,11 @@ ) (go citb-firehose-active) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior citb-firehose) ja-post) ) @@ -1010,13 +992,11 @@ (go citb-firehose-blast) ) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior citb-firehose) ja-post) ) @@ -1037,13 +1017,13 @@ ;; failed to figure out what this is: (defstate citb-firehose-blast (citb-firehose) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (send-event proc 'attack - (-> event param 0) + (-> block param 0) (static-attack-info ((mode 'damage) (shove-back (meters 6)) (shove-up (meters 3)))) ) ) @@ -1075,7 +1055,6 @@ (ja :num! (seek!)) ) (go citb-firehose-active) - (none) ) :post (the-as (function none :behavior citb-firehose) transform-post) ) @@ -1161,8 +1140,8 @@ ;; failed to figure out what this is: (defstate citb-exit-plat-idle (citb-exit-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (let ((v1-3 (-> self entity extra perm))) (logior! (-> v1-3 status) (entity-perm-status user-set-from-cstage)) @@ -1178,7 +1157,6 @@ (loop (suspend) ) - (none) ) ) @@ -1199,7 +1177,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior citb-exit-plat) rider-post) ) @@ -1239,7 +1216,6 @@ ) (citb-exit-plat-move-player gp-0) ) - (none) ) :post (the-as (function none :behavior citb-exit-plat) transform-post) ) @@ -1257,7 +1233,6 @@ ) (citb-exit-plat-move-player gp-0) ) - (none) ) :post (the-as (function none :behavior citb-exit-plat) transform-post) ) diff --git a/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc b/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc index b2d46f51be5..2cf7f87f454 100644 --- a/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc @@ -186,7 +186,7 @@ battlecontroller-default-event-handler ) ) ) - (the-as object 0) + 0 ) ;; definition for function battlecontroller-camera-off @@ -456,7 +456,6 @@ battlecontroller-default-event-handler :event battlecontroller-default-event-handler :trans (behavior () 0 - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -481,7 +480,6 @@ battlecontroller-default-event-handler ) (suspend) ) - (none) ) :post (the-as (function none :behavior battlecontroller) #f) ) @@ -492,15 +490,12 @@ battlecontroller-default-event-handler :event battlecontroller-default-event-handler :enter (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) - (none) ) :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :code (behavior () (go-virtual battlecontroller-active) - (none) ) ) @@ -526,7 +521,6 @@ battlecontroller-default-event-handler ) (battlecontroller-disable-ocean) (battlecontroller-update-spawners) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -558,7 +552,6 @@ battlecontroller-default-event-handler ) (suspend) ) - (none) ) :post (the-as (function none :behavior battlecontroller) #f) ) @@ -669,7 +662,6 @@ battlecontroller-default-event-handler (suspend) ) (process-entity-status! self (entity-perm-status dead) #t) - (none) ) :post (the-as (function none :behavior battlecontroller) #f) ) diff --git a/test/decompiler/reference/jak1/levels/common/blocking-plane_REF.gc b/test/decompiler/reference/jak1/levels/common/blocking-plane_REF.gc index 5df19c8f464..58edc0f17de 100644 --- a/test/decompiler/reference/jak1/levels/common/blocking-plane_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/blocking-plane_REF.gc @@ -35,7 +35,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/common/launcherdoor_REF.gc b/test/decompiler/reference/jak1/levels/common/launcherdoor_REF.gc index 38fe77e63c4..65540cb6c5e 100644 --- a/test/decompiler/reference/jak1/levels/common/launcherdoor_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/launcherdoor_REF.gc @@ -103,7 +103,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior launcherdoor) ja-post) ) @@ -140,7 +139,6 @@ (ja :num! (seek! max (-> self open-speed))) (suspend) ) - (none) ) :post (the-as (function none :behavior launcherdoor) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/darkcave/darkcave-obs_REF.gc b/test/decompiler/reference/jak1/levels/darkcave/darkcave-obs_REF.gc index fc5b506ea7a..3f1559b3f0c 100644 --- a/test/decompiler/reference/jak1/levels/darkcave/darkcave-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/darkcave/darkcave-obs_REF.gc @@ -113,8 +113,8 @@ ;; failed to figure out what this is: (defstate cavecrystal-idle (cavecrystal) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (go cavecrystal-active) ) @@ -125,49 +125,44 @@ (level-hint-spawn (text-id darkcave-light-hint) "sksp0333" (the-as entity #f) *entity-pool* (game-task none)) ) (update-connected-crystals! self) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) ;; failed to figure out what this is: (defstate cavecrystal-active (cavecrystal) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('attack) - (let ((v1-1 (-> event param 2))) - (cond - ((!= v1-1 (-> self player-attack-id)) - (set! (-> self player-attack-id) v1-1) - (set! (-> self activated-time) (-> *display* game-frame-counter)) - #t - ) - (else - #f - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((v1-1 (-> block param 2))) + (cond + ((!= v1-1 (-> self player-attack-id)) + (set! (-> self player-attack-id) v1-1) + (set! (-> self activated-time) (-> *display* game-frame-counter)) + #t ) + (else + #f + ) + ) + ) + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self activated-time) (-> *display* game-frame-counter)) (set! (-> self prev-compute-glow-time) (-> *display* game-frame-counter)) - (none) ) :exit (behavior () (stop! (-> self sound)) (if (not (-> self is-master?)) (logior! (-> self mask) (process-mask actor-pause)) ) - (none) ) :trans (behavior () (let ((f30-0 (compute-glow self))) @@ -200,13 +195,11 @@ ) ) (update! (-> self sound)) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/demo/demo-obs_REF.gc b/test/decompiler/reference/jak1/levels/demo/demo-obs_REF.gc index 93bfa22b37e..3b306b3fa28 100644 --- a/test/decompiler/reference/jak1/levels/demo/demo-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/demo/demo-obs_REF.gc @@ -327,7 +327,6 @@ (loop (suspend) ) - (none) ) :post target-no-move-post ) diff --git a/test/decompiler/reference/jak1/levels/demo/static-screen_REF.gc b/test/decompiler/reference/jak1/levels/demo/static-screen_REF.gc index eec2751783f..ecfc253eff6 100644 --- a/test/decompiler/reference/jak1/levels/demo/static-screen_REF.gc +++ b/test/decompiler/reference/jak1/levels/demo/static-screen_REF.gc @@ -118,13 +118,11 @@ (set! (-> *setting-control* current bg-a) 1.0) (set! (-> *setting-control* default bg-a) 0.0) (add-setting! 'common-page 'set 0.0 (ash 1 (+ arg0 1))) - (none) ) :trans (behavior () (hide-hud-quick) (spawn (-> self part 0) *zero-vector*) 0 - (none) ) :code (behavior ((arg0 int) (arg1 time-frame) (arg2 symbol)) (local-vars (v1-6 symbol)) @@ -146,7 +144,6 @@ (remove-setting! 'common-page) (suspend) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc index 8d87cc959bc..38bcb004399 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc @@ -84,8 +84,8 @@ ;; failed to figure out what this is: (defstate idle (final-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('open) (go-virtual open #f) ) @@ -96,31 +96,29 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) ;; failed to figure out what this is: (defstate open (final-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('brightness) - (let ((f0-0 (the-as float (-> event param 0))) - (f1-0 (the-as float (-> event param 1))) - ) - (set-vector! (-> self draw color-mult) f0-0 f0-0 f0-0 f0-0) - (let ((v0-0 (-> self draw color-emissive))) - (set! (-> v0-0 x) f1-0) - (set! (-> v0-0 y) f1-0) - (set! (-> v0-0 z) f1-0) - (set! (-> v0-0 w) f1-0) - v0-0 - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('brightness) + (let ((f0-0 (the-as float (-> block param 0))) + (f1-0 (the-as float (-> block param 1))) + ) + (set-vector! (-> self draw color-mult) f0-0 f0-0 f0-0 f0-0) + (let ((v0-0 (-> self draw color-emissive))) + (set! (-> v0-0 x) f1-0) + (set! (-> v0-0 y) f1-0) + (set! (-> v0-0 z) f1-0) + (set! (-> v0-0 w) f1-0) + v0-0 + ) + ) + ) + ) ) :code (behavior ((arg0 symbol)) (case (-> self type) @@ -145,7 +143,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -236,7 +233,6 @@ ) (suspend) ) - (none) ) ) @@ -322,7 +318,6 @@ :to *entity-pool* ) (go-virtual idle) - (none) ) ) @@ -338,7 +333,6 @@ (transform-post) (suspend) ) - (none) ) ) @@ -378,26 +372,23 @@ ;; failed to figure out what this is: (defstate target-final-door (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - ((-> target-grab event) proc arg1 event-type event) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + ((-> target-grab event) proc argc message block) ) :enter (behavior ((arg0 basic) (arg1 handle)) (send-event *camera* 'change-to-entity-by-name "camera-403") (set! (-> self control unknown-surface00) *empty-mods*) (logior! (-> self state-flags) (state-flags invulnerable grabbed)) (set-setting! 'allow-progress #f 0.0 0) - (none) ) :exit (behavior () (send-event *camera* 'change-state *camera-base-mode* (seconds 0.2)) (logclear! (-> self state-flags) (state-flags invulnerable grabbed)) (target-exit) (remove-setting! 'allow-progress) - (none) ) :trans (behavior () (set-letterbox-frames (seconds 0.017)) - (none) ) :code (behavior ((arg0 basic) (arg1 handle)) (local-vars (sv-144 process) (sv-160 vector) (sv-176 process) (sv-192 vector)) @@ -485,7 +476,6 @@ ) ) (go target-stance) - (none) ) :post target-no-stick-post ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc index db2f77ab92b..2afa83d3646 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc @@ -423,11 +423,9 @@ (defstate green-eco-lurker-tune-spheres (green-eco-lurker) :trans (behavior () 0 - (none) ) :code (behavior () 0 - (none) ) :post (the-as (function none :behavior green-eco-lurker) transform-post) ) @@ -437,25 +435,21 @@ :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self collide-info)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self collide-info)) - (none) ) :trans (behavior () (if (nav-enemy-method-52 self (-> self appear-dest)) (go green-eco-lurker-appear) ) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -528,7 +522,6 @@ (vector-normalize! gp-1 1.0) (forward-up->quaternion (-> self collide-info quat) gp-1 *up-vector*) ) - (none) ) :trans (behavior () (let ((f30-0 (fmin (the float (- (-> *display* base-frame-counter) (-> self state-time))) (-> self traj time)))) @@ -547,7 +540,6 @@ ) (nav-enemy-method-53 self) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -572,7 +564,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior green-eco-lurker) transform-post) ) @@ -608,7 +599,6 @@ ) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-chase) - (none) ) :post (the-as (function none :behavior green-eco-lurker) transform-post) ) @@ -623,7 +613,6 @@ ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -657,7 +646,6 @@ (ja :num! (loop! f30-0)) ) ) - (none) ) ) @@ -677,7 +665,6 @@ (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) ) (go-virtual nav-enemy-chase) - (none) ) ) @@ -708,7 +695,6 @@ (t9-7) ) ) - (none) ) ) @@ -826,8 +812,8 @@ ;; failed to figure out what this is: (defstate spawn-minions (green-eco-lurker-gen) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('blob-died) (set! (-> self num-alive) (max 0 (+ (-> self num-alive) -1))) (send-event (ppointer->process (-> self parent)) 'blob-died) @@ -865,7 +851,6 @@ ) (suspend) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc index 576d2f22051..1e81f31a2b4 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc @@ -431,7 +431,6 @@ :event light-eco-child-default-event-handler :enter (behavior () (set! (-> self falling-start-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (let ((f30-0 @@ -444,14 +443,12 @@ ) ) (common-trans self) - (none) ) :code (behavior () (loop (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior light-eco-child) transform-post) ) @@ -461,7 +458,6 @@ :event light-eco-child-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (let ((f30-0 (+ (-> self root-override transv y) (* -544768.0 (-> *display* seconds-per-frame))))) @@ -494,14 +490,12 @@ ) ) (common-trans self) - (none) ) :code (behavior () (loop (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior light-eco-child) transform-post) ) @@ -511,21 +505,18 @@ :event light-eco-child-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) (go light-eco-child-die) ) (common-trans self) - (none) ) :code (behavior () (loop (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior light-eco-child) transform-post) ) @@ -540,7 +531,6 @@ (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (suspend) ) - (none) ) ) @@ -549,7 +539,6 @@ :code (behavior () (suspend) 0 - (none) ) ) @@ -711,7 +700,6 @@ :trans (behavior () (common-trans self) (spawn (-> self part2) (-> self root trans)) - (none) ) :code (behavior () (while (!= (-> self root scale x) 12.0) @@ -722,7 +710,6 @@ (ja :num! (loop!)) ) (go light-eco-mother-active) - (none) ) :post (the-as (function none :behavior light-eco-mother) ja-post) ) @@ -734,14 +721,12 @@ (common-trans self) (spawn (-> self part) (-> self root trans)) 0 - (none) ) :code (behavior () (loop (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior light-eco-mother) ja-post) ) @@ -751,7 +736,6 @@ :event light-eco-mother-default-event-handler :trans (behavior () (common-trans self) - (none) ) :code (behavior () (while (!= (-> self root scale x) 0.0) @@ -765,7 +749,6 @@ (until (not (-> self child)) (suspend) ) - (none) ) :post (the-as (function none :behavior light-eco-mother) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc index c2b39fe91e3..5fa83b529cc 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc @@ -10,11 +10,11 @@ ;; failed to figure out what this is: (defstate cam-robotboss (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('set-pivot) (let ((v0-0 (the-as object (-> self pivot-pt)))) - (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> event param 0)) quad)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> block param 0)) quad)) v0-0 ) ) @@ -22,7 +22,7 @@ #f ) (else - (cam-standard-event-handler proc arg1 event-type event) + (cam-standard-event-handler proc argc message block) ) ) ) @@ -38,14 +38,12 @@ (set! (-> self blend-to-type) (the-as uint 2)) ) ) - (none) ) :trans (behavior () (when (not (logtest? (-> *camera* master-options) 2)) (set! *camera-base-mode* cam-string) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -76,7 +74,6 @@ ) (suspend) ) - (none) ) ) @@ -170,63 +167,57 @@ ;; definition for function ecoclaw-handler ;; INFO: Used lq/sq -;; INFO: Return type mismatch none vs object. ;; ERROR: Failed load: (set! a0-3 (l.wu (+ gp-1 -4))) at op 13 -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 28] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 79] (defbehavior ecoclaw-handler ecoclaw ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (case arg2 - (('open) - (let ((gp-1 (-> arg3 param 0))) - (set! (-> self particles 0 kind) - (the-as basic (if (and (nonzero? gp-1) (type-type? (rtype-of gp-1) sparticle-launch-group)) - gp-1 - ) - ) - ) - ) - (set! (-> self particles 0 trans quad) (-> self root trans quad)) - (set! (-> self particles 0 trans y) (+ 12288.0 (-> self particles 0 trans y))) - ) - (('beam-on) - (let ((s5-0 (-> arg3 param 0))) - (set! (-> self particles 1 kind) - (the-as basic (if (and (nonzero? s5-0) (type-type? (rtype-of s5-0) sparticle-launch-group)) - s5-0 - ) - ) - ) - ) - (set! (-> self particles 1 trans quad) (-> self root trans quad)) - (+! (-> self particles 1 trans y) 24576.0) - (let ((s5-1 (-> arg3 param 1))) - (set! (-> self particles 2 kind) - (the-as basic (if (and (nonzero? s5-1) (type-type? (rtype-of s5-1) sparticle-launch-group)) - s5-1 - ) - ) - ) - ) - (set! (-> self particles 2 trans quad) (-> (the-as vector (-> arg3 param 2)) quad)) - (set! (-> self particles 2 trans y) (+ 81920.0 (-> self particles 2 trans y))) + (case arg2 + (('open) + (let ((gp-1 (-> arg3 param 0))) + (set! (-> self particles 0 kind) + (the-as basic (if (and (nonzero? gp-1) (type-type? (rtype-of gp-1) sparticle-launch-group)) + gp-1 + ) + ) + ) ) - (('beam-off) - (set! (-> self particles 1 kind) #f) - (set! (-> self particles 2 kind) #f) - (let ((a0-10 (handle->process (-> self particles 1 tracker)))) - (if a0-10 - (deactivate a0-10) + (set! (-> self particles 0 trans quad) (-> self root trans quad)) + (set! (-> self particles 0 trans y) (+ 12288.0 (-> self particles 0 trans y))) + ) + (('beam-on) + (let ((s5-0 (-> arg3 param 0))) + (set! (-> self particles 1 kind) + (the-as basic (if (and (nonzero? s5-0) (type-type? (rtype-of s5-0) sparticle-launch-group)) + s5-0 + ) + ) ) - ) - (let ((a0-14 (handle->process (-> self particles 2 tracker)))) - (if a0-14 - (deactivate a0-14) + ) + (set! (-> self particles 1 trans quad) (-> self root trans quad)) + (+! (-> self particles 1 trans y) 24576.0) + (let ((s5-1 (-> arg3 param 1))) + (set! (-> self particles 2 kind) + (the-as basic (if (and (nonzero? s5-1) (type-type? (rtype-of s5-1) sparticle-launch-group)) + s5-1 + ) + ) ) - ) ) - ) + (set! (-> self particles 2 trans quad) (-> (the-as vector (-> arg3 param 2)) quad)) + (set! (-> self particles 2 trans y) (+ 81920.0 (-> self particles 2 trans y))) + ) + (('beam-off) + (set! (-> self particles 1 kind) #f) + (set! (-> self particles 2 kind) #f) + (let ((a0-10 (handle->process (-> self particles 1 tracker)))) + (if a0-10 + (deactivate a0-10) + ) + ) + (let ((a0-14 (handle->process (-> self particles 2 tracker)))) + (if a0-14 + (deactivate a0-14) + ) + ) + ) ) ) @@ -261,7 +252,6 @@ ) ) ) - (none) ) :code (behavior () (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) @@ -272,7 +262,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior ecoclaw) ja-post) ) @@ -287,7 +276,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior ecoclaw) ja-post) ) @@ -339,10 +327,10 @@ ;; failed to figure out what this is: (defstate idle (silodoor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('open) - (set! (-> self part-opened) (the-as float (-> event param 0))) + (set! (-> self part-opened) (the-as float (-> block param 0))) ) (('hide) (go-virtual hidden) @@ -367,14 +355,12 @@ ) (suspend) ) - (none) ) :post (behavior () (if (and (< (vector-vector-xz-distance (target-pos 0) (-> self root trans)) 57344.0) (not (ja-min? 0))) (rider-post) (transform-post) ) - (none) ) ) @@ -394,7 +380,6 @@ (ja :num-func num-func-identity :frame-num 0.0) (set! (-> self part-opened) 0.0) (go-virtual idle) - (none) ) ) @@ -554,7 +539,6 @@ ) ) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc index b2f0d26115e..a3a575adbec 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc @@ -241,14 +241,12 @@ :trans (behavior () (arcing-shot-setup (camera-pos) (-> self entity extra trans) 40960.0) (arcing-shot-draw) - (none) ) :code (behavior () (loop (format *stdcon* "debug trajectory~%") (suspend) ) - (none) ) ) @@ -332,7 +330,6 @@ ) ) (deactivate self) - (none) ) :post (the-as (function none :behavior darkecobomb) ja-post) ) @@ -361,11 +358,9 @@ :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (set! (-> self next-tick) 0.9) - (none) ) :exit (behavior () (stop! (-> self sound)) - (none) ) :trans (behavior () (darkecobomb-explode-if-player-high-enough) @@ -406,7 +401,6 @@ (spawn (-> self part) gp-2) ) ) - (none) ) :code (behavior () (sound-play "bomb-open") @@ -423,7 +417,6 @@ (ja :num! (seek! max (-> self anim-speed))) ) ) - (none) ) :post (the-as (function none :behavior darkecobomb) transform-post) ) @@ -434,14 +427,12 @@ :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) 0 - (none) ) :trans (behavior () (darkecobomb-explode-if-player-high-enough) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 0.5)) (go darkecobomb-countdown) ) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -456,7 +447,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior darkecobomb) transform-post) ) @@ -465,7 +455,6 @@ (defstate darkecobomb-idle (darkecobomb) :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (none) ) :trans (behavior () (arcing-shot-calculate @@ -475,7 +464,6 @@ (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time)) (go darkecobomb-land) ) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) @@ -490,7 +478,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior darkecobomb) transform-post) ) @@ -562,7 +549,6 @@ (defstate greenshot-idle (greenshot) :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (none) ) :trans (behavior () (arcing-shot-calculate @@ -573,7 +559,6 @@ (deactivate self) ) (spawn (-> self part) (-> self root-override trans)) - (none) ) :code (behavior () (loop @@ -583,7 +568,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior greenshot) transform-post) ) @@ -740,7 +724,6 @@ ) ) ) - (none) ) :trans (behavior () (set! (-> self ring radius-primary) @@ -772,14 +755,12 @@ (send-event (ppointer->process (-> self parent)) 'missed-jak) (deactivate self) ) - (none) ) :code (behavior () (loop (ja :num-func num-func-identity :frame-num (* 0.000016276043 (-> self ring radius-primary))) (suspend) ) - (none) ) :post (the-as (function none :behavior redshot) transform-post) ) @@ -798,7 +779,6 @@ :event redshot-handler :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (none) ) :trans (behavior () (redshot-trans (- (-> self stall-time) (- (-> *display* game-frame-counter) (-> self state-time)))) @@ -806,13 +786,11 @@ (go redshot-explode) ) (spawn (-> self shot-particle) (-> self root-override trans)) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior redshot) transform-post) ) @@ -822,7 +800,6 @@ :event redshot-handler :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (none) ) :trans (behavior () (redshot-trans (seconds 5)) @@ -834,13 +811,11 @@ (go redshot-wait) ) (spawn (-> self shot-particle) (-> self root-override trans)) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior redshot) transform-post) ) @@ -910,11 +885,11 @@ ;; failed to figure out what this is: (defstate yellowshot-idle (yellowshot) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (when (= (-> proc type) target) - (send-event *target* 'attack (-> event param 0) (static-attack-info ((mode 'generic)))) + (send-event *target* 'attack (-> block param 0) (static-attack-info ((mode 'generic)))) (send-event (ppointer->process (-> self parent)) 'hit-jak) ) ) @@ -922,7 +897,6 @@ ) :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (none) ) :trans (behavior () (arcing-shot-calculate @@ -934,13 +908,11 @@ (send-event (ppointer->process (-> self parent)) 'missed-jak) (deactivate self) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior yellowshot) transform-post) ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc index ac04fbd26c5..484c7e6aed6 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc @@ -38,6 +38,7 @@ ;; definition for function robotboss-cut-cam ;; INFO: Used lq/sq +;; INFO: Return type mismatch object vs none. (defbehavior robotboss-cut-cam robotboss ((arg0 float) (arg1 float) (arg2 int)) (let ((f0-0 (ja-aframe-num 0))) (cond @@ -399,76 +400,71 @@ ;; definition for function robotboss-handler ;; INFO: Return type mismatch number vs object. (defbehavior robotboss-handler robotboss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('flash) - (set! (-> self palette-val) (* 0.0078125 (the-as float (-> arg3 param 0)))) - ) - (('attack) - (when (>= arg1 2) - (case (-> arg3 param 1) - (('eco-yellow) - (let ((a0-5 (-> arg3 param 0))) - (when (and a0-5 ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry a0-5) - (-> self root-override) - (the-as uint (-> self vulnerable)) - ) - ) - (when (> (-> self hits-to-go) 0) - (set! (-> self took-hit) #t) - (let ((v0-0 (the-as number (+ (-> self hits-to-go) -1)))) - (set! (-> self hits-to-go) (the-as int v0-0)) - v0-0 - ) - ) + (case arg2 + (('flash) + (set! (-> self palette-val) (* 0.0078125 (the-as float (-> arg3 param 0)))) + ) + (('attack) + (when (>= arg1 2) + (case (-> arg3 param 1) + (('eco-yellow) + (let ((a0-5 (-> arg3 param 0))) + (when (and a0-5 ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry a0-5) + (-> self root-override) + (the-as uint (-> self vulnerable)) ) - ) - ) - ) - ) - ) - ) + ) + (when (> (-> self hits-to-go) 0) + (set! (-> self took-hit) #t) + (let ((v0-0 (the-as number (+ (-> self hits-to-go) -1)))) + (set! (-> self hits-to-go) (the-as int v0-0)) + v0-0 + ) + ) + ) + ) ) + ) + ) + ) + ) ) ;; failed to figure out what this is: (defstate robotboss-yellow-dark-bomb-wait (robotboss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'white-eco-picked-up) - (close-specific-task! (game-task finalboss-movies) (task-status unknown)) - (entity-birth-no-kill (-> self alts 5)) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 0) - (set! (-> a1-2 message) 'play-anim) - (let ((t9-2 send-event-function) - (v1-2 (-> self alts 5)) - ) - (t9-2 - (if v1-2 - (-> v1-2 extra process) - ) - a1-2 - ) - ) - ) - (cleanup-for-death self) - (the-as object (deactivate self)) - ) - (else - (robotboss-bomb-handler proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('white-eco-picked-up) + (close-specific-task! (game-task finalboss-movies) (task-status unknown)) + (entity-birth-no-kill (-> self alts 5)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) self) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'play-anim) + (let ((t9-2 send-event-function) + (v1-2 (-> self alts 5)) + ) + (t9-2 + (if v1-2 + (-> v1-2 extra process) + ) + a1-2 + ) + ) + ) + (cleanup-for-death self) + (deactivate self) + ) + (else + (robotboss-bomb-handler proc argc message block) + ) ) ) :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (set! (-> self children-spawned) 0) 0 - (none) ) :exit (behavior () (set! (-> self des-cam-entity) #f) @@ -533,13 +529,11 @@ ) ) (send-event (handle->process (-> self white-eco)) 'beam-off) - (none) ) :trans (behavior () (robotboss-always-trans (the-as (state robotboss) #f)) (spool-push *art-control* "green-sagecage-outro-beat-boss-a" 0 self (the-as float -1.0)) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -601,7 +595,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -632,7 +625,6 @@ ) (set-blackout-frames 0) (go robotboss-yellow-dark-bomb-wait) - (none) ) ) @@ -643,11 +635,9 @@ (set! (-> self children-spawned) 0) (set! (-> self state-time) (-> *display* base-frame-counter)) (ja-post) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (spool-push *art-control* "green-sagecage-daxter-sacrifice" 0 self (the-as float -1.0)) @@ -661,7 +651,6 @@ (set! (-> self white-eco) (ppointer->handle (process-spawn light-eco-mother (-> self entity) gp-0 :to self))) ) ) - (none) ) :code (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -820,7 +809,6 @@ (go robotboss-yellow-dark-bomb-wait) ) ) - (none) ) ) @@ -834,7 +822,6 @@ (set! (-> self loc-t-duration) (seconds 4)) (set! (-> self desired-pool-y) -16384.0) (play-ambient (-> self ambient) "GOL-AM01" #t (the-as vector #f)) - (none) ) :trans (behavior () (robotboss-always-trans (the-as (state robotboss) #f)) @@ -843,7 +830,6 @@ (go robotboss-white-eco-movie) ) (robotboss-position) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -864,7 +850,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -917,8 +902,8 @@ ;; failed to figure out what this is: (defstate robotboss-yellow-wait (robotboss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hit-jak) (let ((f0-2 (rand-float-gen))) (cond @@ -946,7 +931,7 @@ ) ) (else - (robotboss-handler proc arg1 event-type event) + (robotboss-handler proc argc message block) ) ) ) @@ -956,7 +941,6 @@ (set! (-> self till-next-shot) 300) (set! (-> self use-interesting) #t) (set! (-> self keep-charging) #f) - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) @@ -1010,7 +994,6 @@ (robotboss-yellow-eco-off) (robotboss-cut-cam-exit) (stop! (-> self looping-sound 3)) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-yellow-dark-bomb) @@ -1066,7 +1049,6 @@ (spawn (-> self particle 6) gp-2) ) ) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -1175,7 +1157,6 @@ (go robotboss-yellow-dark-bomb) ) ) - (none) ) :post (behavior () (when *target* @@ -1184,7 +1165,6 @@ ) ) (transform-post) - (none) ) ) @@ -1198,7 +1178,6 @@ (set! (-> self loc-t-start) (-> *display* game-frame-counter)) (set! (-> self loc-t-duration) (seconds 3)) (set! (-> self desired-pool-y) -18432.0) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-yellow-wait) @@ -1206,7 +1185,6 @@ (go robotboss-yellow-wait) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -1240,7 +1218,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -1251,13 +1228,11 @@ :enter (behavior () (set! (-> self children-spawned) 0) (logior! (-> self alts 11 extra perm status) (entity-perm-status bit-3)) - (none) ) :exit (behavior () (set! (-> self ignore-camera) #f) (set! (-> self des-cam-entity) #f) (logclear! (-> self alts 11 extra perm status) (entity-perm-status bit-3)) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-yellow) @@ -1267,7 +1242,6 @@ (go robotboss-yellow) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -1297,7 +1271,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -1311,7 +1284,6 @@ (set! (-> self loc-t-start) (-> *display* game-frame-counter)) (set! (-> self loc-t-duration) (seconds 3)) (set! (-> self desired-pool-y) -20480.0) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-red-dark-bomb-wait) @@ -1319,7 +1291,6 @@ (if (>= (-> self loc-t) 1.0) (go robotboss-red-dark-bomb-wait) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1340,7 +1311,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -1517,8 +1487,8 @@ ;; failed to figure out what this is: (defstate robotboss-red-wait (robotboss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hit-jak) (let ((f0-2 (rand-float-gen))) (cond @@ -1546,7 +1516,7 @@ ) ) (else - (robotboss-handler proc arg1 event-type event) + (robotboss-handler proc argc message block) ) ) ) @@ -1557,7 +1527,6 @@ (set! (-> self state-time) (-> *display* game-frame-counter)) (set! (-> self till-next-shot) 0) 0 - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) @@ -1621,7 +1590,6 @@ ) ) ) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-red-dark-bomb) @@ -1680,7 +1648,6 @@ ) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -1786,7 +1753,6 @@ (go robotboss-red-dark-bomb) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -1802,7 +1768,6 @@ (set! (-> self loc-t-duration) (seconds 3)) (set! (-> self desired-pool-y) -22528.0) (set-setting! 'sound-flava #f 40.0 (music-flava finalboss-end)) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-red-wait) @@ -1810,7 +1775,6 @@ (go robotboss-red-wait) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -1836,7 +1800,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -1847,12 +1810,10 @@ :enter (behavior () (set! (-> self children-spawned) 0) 0 - (none) ) :exit (behavior () (set! (-> self ignore-camera) #f) (set! (-> self des-cam-entity) #f) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-red) @@ -1862,7 +1823,6 @@ (go robotboss-red) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -1893,7 +1853,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -1908,7 +1867,6 @@ (set! (-> self loc-t-duration) (seconds 3)) (set! (-> self desired-pool-y) -24576.0) (play-ambient (-> self ambient) "MAI-AM01" #t (the-as vector #f)) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-green-dark-bomb-wait) @@ -1916,7 +1874,6 @@ (if (>= (-> self loc-t) 1.0) (go robotboss-green-dark-bomb-wait) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1937,7 +1894,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -1975,8 +1931,8 @@ ;; failed to figure out what this is: (defstate robotboss-green-wait (robotboss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (ja-channel-push! 1 (seconds 0.2)) (ja :group! robotboss-green-roar-ja) @@ -2034,7 +1990,7 @@ ) ) (else - (robotboss-handler proc arg1 event-type event) + (robotboss-handler proc argc message block) ) ) ) @@ -2043,7 +1999,6 @@ (set! (-> self children-spawned) 0) (robotboss-setup-for-hits 2 5) (set! (-> self des-cam-entity) "camera-385") - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) @@ -2106,7 +2061,6 @@ ) ) ) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-green-dark-bomb) @@ -2176,7 +2130,6 @@ ) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -2200,7 +2153,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -2217,7 +2169,6 @@ (set! (-> self desired-pool-y) -26624.0) (play-ambient (-> self ambient) "GOL-AM01" #t (the-as vector #f)) (set-setting! 'sound-flava #f 40.0 (music-flava finalboss-middle)) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-green-wait) @@ -2225,7 +2176,6 @@ (go robotboss-green-wait) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -2251,7 +2201,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -2262,12 +2211,10 @@ :enter (behavior () (set! (-> self children-spawned) 0) 0 - (none) ) :exit (behavior () (set! (-> self ignore-camera) #f) (set! (-> self des-cam-entity) #f) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-green) @@ -2277,7 +2224,6 @@ (go robotboss-green) ) (robotboss-position) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -2316,7 +2262,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -2330,7 +2275,6 @@ (set! (-> self loc-t-start) (-> *display* game-frame-counter)) (set! (-> self loc-t-duration) (seconds 3)) (set! (-> self desired-pool-y) -28672.0) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-blue-dark-bomb-wait) @@ -2338,7 +2282,6 @@ (if (>= (-> self loc-t) 1.0) (go robotboss-blue-dark-bomb-wait) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2359,7 +2302,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) @@ -2567,7 +2509,6 @@ (process-entity-status! self (entity-perm-status bit-3) #t) (set! (-> self use-interesting) #t) (robotboss-yellow-eco-on) - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) @@ -2624,7 +2565,6 @@ ) (robotboss-set-dda) (robotboss-cut-cam-exit) - (none) ) :trans (behavior () (robotboss-always-trans robotboss-blue-dark-bomb) @@ -2702,7 +2642,6 @@ ) (robotboss-position) (robotboss-cut-cam (the-as float 5.0) (the-as float 50.0) (the-as int robotboss-blue-roar-ja)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.4)) @@ -2748,7 +2687,6 @@ (go robotboss-blue-dark-bomb) ) ) - (none) ) :post (the-as (function none :behavior robotboss) transform-post) ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss_REF.gc index 580281fc025..d367919d47f 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss_REF.gc @@ -83,11 +83,11 @@ ;; failed to figure out what this is: (defstate plat-path-active (plat-eco-finalboss) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('target) (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> self force-dest) (the-as float (-> event param 0))) + (set! (-> self force-dest) (the-as float (-> block param 0))) ) (('ridden 'edge-grabbed) (if (>= (- (-> *display* base-frame-counter) (-> self touch-time)) (seconds 2)) @@ -109,7 +109,7 @@ #f ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -126,7 +126,6 @@ ) ) ) - (none) ) :trans (behavior () (let ((s5-0 (eval-path-curve! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp)) @@ -165,7 +164,6 @@ (process-entity-status! self (entity-perm-status complete) #t) (set! (-> self force-dest) 0.0) ) - (none) ) ) @@ -624,8 +622,8 @@ ;; failed to figure out what this is: (defstate play-anim (sage-finalboss) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('fade) (set! (-> self credit-fade) 1.0) ) @@ -634,12 +632,12 @@ ) (('activate-particle) (let ((v0-0 (the-as object #t))) - (set! (-> self particle (-> event param 0) active) (the-as symbol v0-0)) + (set! (-> self particle (-> block param 0) active) (the-as symbol v0-0)) v0-0 ) ) (('deactivate-particle) - (set! (-> self particle (-> event param 0) active) #f) + (set! (-> self particle (-> block param 0) active) #f) #f ) ) @@ -647,7 +645,6 @@ :enter (behavior () (set! (-> self credit-fade) 0.0) ((-> (method-of-type process-taskable play-anim) enter)) - (none) ) :exit (behavior () (when (= (current-status (-> self tasks)) (task-status invalid)) @@ -758,7 +755,6 @@ (set! (-> self particle v1-84 active) #f) ) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) :trans (behavior () (local-vars (f28-0 float)) @@ -929,7 +925,6 @@ ) ) ((-> (method-of-type process-taskable play-anim) trans)) - (none) ) ) @@ -940,7 +935,6 @@ (set-blackout-frames 0) (initialize! *game-info* 'game (the-as game-save #f) "title-start") ) - (none) ) :code (behavior () (local-vars (s5-0 symbol)) @@ -1000,7 +994,6 @@ ) ) (go-virtual hidden) - (none) ) ) @@ -1051,12 +1044,10 @@ (sage-finalboss-extra-enter) ((-> (method-of-type process-taskable hidden) enter)) (remove-setting! 'allow-progress) - (none) ) :trans (behavior () (sage-finalboss-extra-trans) ((-> (method-of-type process-taskable hidden) trans)) - (none) ) ) @@ -1066,12 +1057,10 @@ :enter (behavior () (sage-finalboss-extra-enter) ((-> (method-of-type process-taskable idle) enter)) - (none) ) :trans (behavior () (sage-finalboss-extra-trans) ((-> (method-of-type process-taskable idle) trans)) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/firecanyon/assistant-firecanyon_REF.gc b/test/decompiler/reference/jak1/levels/firecanyon/assistant-firecanyon_REF.gc index e4fb4e2398b..8981cb01723 100644 --- a/test/decompiler/reference/jak1/levels/firecanyon/assistant-firecanyon_REF.gc +++ b/test/decompiler/reference/jak1/levels/firecanyon/assistant-firecanyon_REF.gc @@ -127,7 +127,6 @@ (game-task none) ) ) - (none) ) ) @@ -253,7 +252,6 @@ ) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc b/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc index 27e1a9b1516..6aae5108e27 100644 --- a/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc @@ -115,14 +115,13 @@ (suspend) (cleanup-for-death self) (deactivate self) - (none) ) ) ;; failed to figure out what this is: (defstate balloon-idle (balloon) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (send-event proc 'heat -10.0) (go balloon-popping) @@ -138,7 +137,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior balloon) ja-post) ) @@ -199,13 +197,12 @@ ;; failed to figure out what this is: (defstate spike-up (spike) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('go-spike-up) - #t - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('go-spike-up) + #t + ) + ) ) :trans (behavior () (when (nonzero? (-> self num-alts)) @@ -233,7 +230,6 @@ ) ) ) - (none) ) :code (behavior () (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) @@ -245,20 +241,18 @@ (loop (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate spike-down (spike) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('go-spike-up) - (go spike-up) - #t - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('go-spike-up) + (go spike-up) + #t + ) + ) ) :trans (behavior () (when (nonzero? (-> self num-alts)) @@ -286,14 +280,12 @@ ) ) ) - (none) ) :code (behavior () (transform-post) (loop (suspend) ) - (none) ) ) @@ -320,14 +312,12 @@ ) ) ) - (none) ) :code (behavior () (transform-post) (loop (suspend) ) - (none) ) ) @@ -637,17 +627,16 @@ (suspend) (cleanup-for-death self) (deactivate self) - (none) ) ) ;; failed to figure out what this is: (defstate idle (crate-darkeco-cluster) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'touch) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'darkeco)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'darkeco)))) (go-virtual die) ) ) @@ -657,7 +646,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/flut_common/flutflut_REF.gc b/test/decompiler/reference/jak1/levels/flut_common/flutflut_REF.gc index 408e7b6a9de..ffa7ef8725e 100644 --- a/test/decompiler/reference/jak1/levels/flut_common/flutflut_REF.gc +++ b/test/decompiler/reference/jak1/levels/flut_common/flutflut_REF.gc @@ -90,31 +90,27 @@ ;; failed to figure out what this is: (defstate wait-for-start (flutflut) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('trans) - (vector+! (the-as vector (-> event param 0)) (-> self root-override trans) (-> self extra-trans)) - ) - (('notify) - (let ((v0-1 (the-as structure #t))) - (set! (-> self auto-get-off) (the-as symbol v0-1)) - v0-1 - ) - ) - (('touch 'attack) - (set! (-> self touch-time) (-> *display* base-frame-counter)) - #f + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trans) + (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + ) + (('notify) + (let ((v0-1 (the-as structure #t))) + (set! (-> self auto-get-off) (the-as symbol v0-1)) + v0-1 ) - ) + ) + (('touch 'attack) + (set! (-> self touch-time) (-> *display* base-frame-counter)) + #f + ) ) ) :exit (behavior () (set! (-> self root-override root-prim prim-core action) (collide-action)) (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) 0 - (none) ) :code (behavior () (loop @@ -184,7 +180,6 @@ (go-virtual wait-for-return) (go-virtual idle) ) - (none) ) ) @@ -195,7 +190,6 @@ :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (the-as curve-control (-> self path-target))) - (none) ) :exit (-> (method-of-type flutflut wait-for-start) exit) :code (behavior () @@ -243,7 +237,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior flutflut) ja-post) ) @@ -251,8 +244,8 @@ ;; failed to figure out what this is: (defstate pickup (flutflut) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('draw) (ja-channel-set! 1) (ja :group! (-> self draw art-group data 3)) @@ -261,7 +254,7 @@ (transform-post) ) (('trans) - (vector+! (the-as vector (-> event param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) ) (('touch 'attack) #f @@ -270,7 +263,6 @@ ) :enter (behavior ((arg0 (state flutflut))) ((-> arg0 enter)) - (none) ) :code (behavior ((arg0 (state flutflut))) (ja-channel-set! 0) @@ -295,28 +287,23 @@ ) ) (go arg0) - (none) ) ) ;; failed to figure out what this is: (defstate wait-for-return (flutflut) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (or (= event-type 'touch) (= event-type 'attack)) (send-event *target* 'end-mode)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (or (= message 'touch) (= message 'attack)) (send-event *target* 'end-mode)) (go-virtual pickup (method-of-object self idle)) ) - (the-as - object - (if (= event-type 'trans) - (vector+! (the-as vector (-> event param 0)) (-> self root-override trans) (-> self extra-trans)) - ) - ) + (if (= message 'trans) + (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + ) ) :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (the-as curve-control (-> self path-flut))) - (none) ) :code (behavior () (ja-channel-set! 0) @@ -328,7 +315,6 @@ (flutflut-effect) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc b/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc index 3313e151ed1..ffc53152d71 100644 --- a/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc +++ b/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc @@ -457,7 +457,6 @@ (remove-setting! 'sound-flava) (target-exit) ) - (none) ) :code (behavior ((arg0 handle)) (target-exit) @@ -536,7 +535,6 @@ ) (remove-exit) (go target-flut-get-on arg0) - (none) ) :post target-post ) @@ -546,7 +544,6 @@ :event target-flut-standard-event-handler :enter (behavior () (set! (-> self control unknown-surface00) *flut-walk-mods*) - (none) ) :exit (-> target-flut-start exit) :trans (behavior () @@ -583,7 +580,6 @@ ) (go target-flut-falling #f) ) - (none) ) :code (behavior () (let ((gp-0 22)) @@ -624,7 +620,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) :post target-flut-post ) @@ -637,13 +632,11 @@ (set! (-> self control unknown-surface00) *flut-walk-mods*) (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-surface00 turnv))) (set! (-> self control unknown-int21) (the-as int (-> self control unknown-surface00 target-speed))) - (none) ) :exit (behavior () (set! (-> self control unknown-surface00 turnv) (the-as float (-> self control unknown-uint20))) (set! (-> self control unknown-surface00 target-speed) (the-as float (-> self control unknown-uint30))) ((-> target-flut-start exit)) - (none) ) :trans (behavior () (if (not (move-legs?)) @@ -701,7 +694,6 @@ ) ) ) - (none) ) :code (behavior () (let ((f28-0 0.0) @@ -785,17 +777,16 @@ ) ) ) - (none) ) :post target-flut-post ) ;; failed to figure out what this is: (defstate target-flut-jump (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (when (and (= event-type 'touched) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (= message 'touched) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 6) ) @@ -806,22 +797,22 @@ ) ) ) - (send-event proc 'bonk (-> event param 0) (-> self control ground-impact-vel)) + (send-event proc 'bonk (-> block param 0) (-> self control ground-impact-vel)) (when (target-send-attack proc (the-as uint 'flut-bonk) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control unknown-dword50) (-> self control unknown-dword51) ) ) ) - (case event-type + (case message (('jump) - (go target-flut-jump (the-as float (-> event param 0)) (the-as float (-> event param 0))) + (go target-flut-jump (the-as float (-> block param 0)) (the-as float (-> block param 0))) ) (else - (target-flut-standard-event-handler proc arg1 event-type event) + (target-flut-standard-event-handler proc argc message block) ) ) ) @@ -837,12 +828,10 @@ (set! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) ) - (none) ) :exit (behavior () (target-exit) ((-> target-flut-start exit)) - (none) ) :trans (behavior () (set! (-> self control unknown-float123) @@ -894,7 +883,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) (-> *display* seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (ja-channel-push! 2 (seconds 0.12)) @@ -949,7 +937,6 @@ :frame-interp (-> self control unknown-float122) ) ) - (none) ) :post target-flut-post ) @@ -964,14 +951,12 @@ (set! (-> self control dynam gravity-length) 245760.0) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flut-double-jump-mods*) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (target-exit) ((-> target-flut-start exit)) - (none) ) :trans (behavior () (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) @@ -1006,7 +991,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) (-> *display* seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (ja-channel-push! 1 (seconds 0.05)) @@ -1069,7 +1053,6 @@ (ja :num! (loop! max)) (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) ) - (none) ) :post target-flut-post ) @@ -1085,7 +1068,6 @@ (set! (-> self control unknown-dword31) 0) (set! (-> self control unknown-dword33) 0) (set! (-> self control unknown-surface00) *flut-walk-mods*) - (none) ) :exit (-> target-flut-start exit) :trans (behavior () @@ -1119,14 +1101,12 @@ ) (go target-flut-falling #f) ) - (none) ) :code (behavior () (let ((t9-0 target-flut-hit-ground-anim)) (t9-0) ) (go target-flut-stance) - (none) ) :post target-flut-post ) @@ -1137,7 +1117,6 @@ :enter (behavior ((arg0 symbol)) (set! (-> self control unknown-surface00) *flut-jump-mods*) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (-> target-flut-start exit) :trans (behavior () @@ -1160,7 +1139,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) (-> *display* seconds-per-frame) ) - (none) ) :code (behavior ((arg0 symbol)) (cond @@ -1184,26 +1162,25 @@ (ja :num! (loop! max)) (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) ) - (none) ) :post target-flut-post ) ;; failed to figure out what this is: (defstate target-flut-running-attack (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (cond (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 224) ) (let ((gp-1 (target-send-attack proc (the-as uint (-> self control unknown-symbol30)) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control unknown-dword50) (-> self control unknown-dword51) ) @@ -1243,12 +1220,12 @@ ) ) (else - (target-flut-dangerous-event-handler proc arg1 event-type event) + (target-flut-dangerous-event-handler proc argc message block) ) ) ) (else - (target-flut-dangerous-event-handler proc arg1 event-type event) + (target-flut-dangerous-event-handler proc argc message block) ) ) ) @@ -1289,7 +1266,6 @@ ) (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) ) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) @@ -1298,7 +1274,6 @@ (set! (-> *run-attack-mods* turnvv) 0.0) (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) (target-exit) - (none) ) :trans (behavior () (when (!= (-> self state-time) (-> *display* base-frame-counter)) @@ -1349,7 +1324,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.02)) @@ -1453,17 +1427,16 @@ ) ) (go target-flut-stance) - (none) ) :post target-flut-post ) ;; failed to figure out what this is: (defstate target-flut-air-attack (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'touched) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'touched) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 6) ) @@ -1474,14 +1447,14 @@ ) ) ) - (send-event proc 'bonk (-> event param 0) (-> self control ground-impact-vel)) + (send-event proc 'bonk (-> block param 0) (-> self control ground-impact-vel)) ) - (case event-type + (case message (('jump) - (go target-flut-jump (the-as float (-> event param 0)) (the-as float (-> event param 0))) + (go target-flut-jump (the-as float (-> block param 0)) (the-as float (-> block param 0))) ) (else - (target-flut-dangerous-event-handler proc arg1 event-type event) + (target-flut-dangerous-event-handler proc argc message block) ) ) ) @@ -1508,14 +1481,12 @@ ) ) ) - (none) ) :exit (behavior () (target-danger-set! 'harmless #f) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) - (none) ) :trans (behavior () (let ((s5-0 (new-stack-vector0))) @@ -1554,7 +1525,6 @@ (logior! (-> self control status) (cshape-moving-flags onsurf)) (go target-flut-hit-ground) ) - (none) ) :code (behavior ((arg0 float)) (sound-play "flut-hit" :pitch -0.5) @@ -1595,7 +1565,6 @@ (loop (suspend) ) - (none) ) :post target-flut-post ) @@ -1625,7 +1594,6 @@ ) ) ) - (none) ) :exit (-> target-flut-air-attack exit) :trans (-> target-flut-hit-ground trans) @@ -1653,7 +1621,6 @@ (ja :num! (seek!)) ) (go target-flut-stance) - (none) ) :post target-flut-post ) @@ -1667,7 +1634,6 @@ ) (target-exit) ((-> target-flut-start exit)) - (none) ) :trans (behavior () (when (= *cheat-mode* 'debug) @@ -1676,7 +1642,6 @@ (go target-flut-stance) ) ) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1811,7 +1776,6 @@ ) ) (go target-flut-hit-ground) - (none) ) :post target-flut-post ) @@ -1824,7 +1788,6 @@ (target-exit) (remove-setting! 'process-mask) (apply-settings *setting-control*) - (none) ) :trans (-> target-hit trans) :code (behavior ((arg0 symbol)) @@ -1919,7 +1882,6 @@ (set! v1-104 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (not (movie?)))) ) (go target-flut-stance) - (none) ) :post target-no-stick-post ) @@ -1982,7 +1944,6 @@ (quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00)) (rot->dir-targ! (-> self control)) (go target-flut-stance) - (none) ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -2011,7 +1972,6 @@ ) ) (target-no-move-post) - (none) ) ) @@ -2029,12 +1989,10 @@ ) ) (go target-flut-get-off-jump arg0) - (none) ) :post (behavior () (target-no-stick-post) (target-flut-post-post) - (none) ) ) @@ -2095,7 +2053,6 @@ (send-event *camera* 'ease-in) (ja-channel-set! 0) (go target-flut-get-off-hit-ground #f) - (none) ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -2130,7 +2087,6 @@ (quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> self control quat)) (set! (-> self flut flut-scale quad) (-> self control scale quad)) (target-no-move-post) - (none) ) ) @@ -2141,7 +2097,6 @@ :trans (behavior () (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) ((-> target-hit-ground trans)) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-set! 1) @@ -2154,28 +2109,27 @@ (ja :num! (seek!)) ) (go target-stance) - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-flut-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) (else - (case event-type + (case message (('end-mode) (go target-flut-stance) ) (('clone-anim) - (go target-flut-clone-anim (process->handle (the-as process (-> event param 0)))) + (go target-flut-clone-anim (process->handle (the-as process (-> block param 0)))) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -2185,46 +2139,40 @@ (set! (-> self control unknown-surface00) *grab-mods*) (set! (-> self neck flex-blend) 0.0) (logior! (-> self state-flags) (state-flags invulnerable grabbed)) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags invulnerable grabbed)) (target-exit) ((-> target-flut-start exit)) - (none) ) :code (-> target-flut-stance code) :post (behavior () (target-no-stick-post) (target-flut-post-post) - (none) ) ) ;; failed to figure out what this is: (defstate target-flut-clone-anim (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) - ((-> target-flut-grab event) proc arg1 event-type event) + ((-> target-flut-grab event) proc argc message block) ) :enter (-> target-clone-anim enter) :exit (behavior () (send-event (ppointer->process (-> self sidekick)) 'matrix #f) ((-> target-clone-anim exit)) ((-> target-flut-start exit)) - (none) ) :code (behavior ((arg0 handle)) (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (clone-anim arg0 33 #t "") (go target-flut-stance) - (none) ) :post (behavior () (target-no-ja-move-post) (target-flut-post-post) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/intro/evilbro_REF.gc b/test/decompiler/reference/jak1/levels/intro/evilbro_REF.gc index dc9031b89ea..6e89896a47b 100644 --- a/test/decompiler/reference/jak1/levels/intro/evilbro_REF.gc +++ b/test/decompiler/reference/jak1/levels/intro/evilbro_REF.gc @@ -53,7 +53,6 @@ :exit (behavior () (send-event (-> self evilsis extra process) 'end-mode) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) ) @@ -98,7 +97,6 @@ ) ) ) - (none) ) ) @@ -160,7 +158,6 @@ :trans (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/bouncer_REF.gc b/test/decompiler/reference/jak1/levels/jungle/bouncer_REF.gc index 2686d1ea6f8..42c727de5a8 100644 --- a/test/decompiler/reference/jak1/levels/jungle/bouncer_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/bouncer_REF.gc @@ -38,8 +38,8 @@ ;; failed to figure out what this is: (defstate bouncer-wait (springbox) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('bonk) (when (send-event proc 'jump (-> self spring-height) (-> self spring-height) #f) (sound-play "trampoline") @@ -52,7 +52,7 @@ ) ) (('attack) - (when (and (= (-> event param 1) 'flop) (send-event proc 'jump (-> self spring-height) (-> self spring-height) #f)) + (when (and (= (-> block param 1) 'flop) (send-event proc 'jump (-> self spring-height) (-> self spring-height) #f)) (go bouncer-fire) #f ) @@ -66,20 +66,19 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate bouncer-smush (springbox) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (set! (-> self state-time) (-> *display* base-frame-counter)) #f ) (else - ((-> bouncer-wait event) proc arg1 event-type event) + ((-> bouncer-wait event) proc argc message block) ) ) ) @@ -106,7 +105,6 @@ (go bouncer-wait) ) ) - (none) ) :post (the-as (function none :behavior springbox) transform-post) ) @@ -121,7 +119,6 @@ (ja :num! (seek!)) ) (go bouncer-wait) - (none) ) :post (the-as (function none :behavior springbox) transform-post) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc b/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc index 01439f379a5..1f74c4c0972 100644 --- a/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc @@ -136,37 +136,33 @@ ) ;; definition for function darkvine-event-handler -;; INFO: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 50] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 52] (defbehavior darkvine-event-handler darkvine ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('touch) - (do-push-aways! (-> self root-override)) - (when (-> self dangerous) - (if (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) - ) - ) - ) - (('attack) - (let ((v1-10 (-> arg3 param 2))) - (cond - ((!= v1-10 (-> self player-attack-id)) - (set! (-> self player-attack-id) (the-as int v1-10)) - (when (-> self vulnerable) - (do-push-aways! (-> self root-override)) - (go darkvine-retreat) - ) - ) - (else - 'push - ) - ) - ) - ) - ) + (case arg2 + (('touch) + (do-push-aways! (-> self root-override)) + (when (-> self dangerous) + (if (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) + ) + ) + ) + (('attack) + (let ((v1-10 (-> arg3 param 2))) + (cond + ((!= v1-10 (-> self player-attack-id)) + (set! (-> self player-attack-id) (the-as int v1-10)) + (when (-> self vulnerable) + (do-push-aways! (-> self root-override)) + (go darkvine-retreat) + ) ) + (else + 'push + ) + ) + ) + ) + ) ) ;; failed to figure out what this is: @@ -195,7 +191,6 @@ ) ) ) - (none) ) :post (behavior () (when (and (-> self hit-player) @@ -213,7 +208,6 @@ self ) ) - (none) ) ) @@ -263,7 +257,6 @@ (ja :num! (seek!)) ) (go darkvine-idle) - (none) ) :post (-> darkvine-idle post) ) @@ -283,7 +276,6 @@ ) (logior! (-> self mask) (process-mask sleep)) (anim-loop) - (none) ) :post (-> darkvine-idle post) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc b/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc index c1c514c9d7e..616257cf104 100644 --- a/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc @@ -897,6 +897,7 @@ ) ;; definition for method 48 of type fisher +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow fisher ((obj fisher)) (-> obj draw shadow-ctrl) (cond @@ -989,7 +990,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior fisher-fish) ja-post) ) @@ -1043,7 +1043,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) ) @@ -1101,7 +1100,6 @@ (send-event (ppointer->process (-> self parent)) 'fisher-fish-die 1) ) ) - (none) ) ) @@ -1267,6 +1265,7 @@ ) ;; definition for method 38 of type fisher +;; INFO: Return type mismatch object vs none. (defmethod process-taskable-method-38 fisher ((obj fisher)) (case (current-status (-> obj tasks)) (((task-status need-reminder-a) (task-status need-reminder)) @@ -1419,14 +1418,12 @@ (send-event *target* 'lose) ) ) - (none) ) :exit (behavior () (when (and *target* (the-as target #f)) (send-event *target* 'end-mode) (process-grab? *target*) ) - (none) ) :trans (behavior () (set! *camera-look-through-other* 2) @@ -1478,7 +1475,6 @@ ) ) (spool-push *art-control* "fisher-reject" 0 self -99.0) - (none) ) :code (the-as (function none :behavior fisher) process-taskable-anim-loop) :post (the-as (function none :behavior fisher) ja-post) @@ -1604,18 +1600,18 @@ ;; failed to figure out what this is: (defstate fisher-playing (fisher) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-2 object)) - (case event-type + (case message (('fisher-fish-die) (sound-play "fish-miss") - (set! v0-2 (+ (-> self missed) (-> event param 0))) + (set! v0-2 (+ (-> self missed) (-> block param 0))) (set! (-> self missed) (the-as int v0-2)) v0-2 ) (('fisher-fish-caught) (send-event *target* 'bounce) - (set! v0-2 (+ (-> self caught) (-> event param 0))) + (set! v0-2 (+ (-> self caught) (-> block param 0))) (set! (-> self caught) (the-as int v0-2)) v0-2 ) @@ -1649,7 +1645,6 @@ ) (send-event *camera* 'change-to-entity-by-name "camera-152") (init! (-> self query) (the-as string #f) 40 150 25 #t (lookup-text! *common-text* (text-id quit) #f)) - (none) ) :exit (behavior () (remove-setting! 'ambient-volume) @@ -1673,12 +1668,10 @@ (send-event *camera* 'change-state *camera-base-mode* 0) (send-event *camera* 'clear-entity) 0 - (none) ) :trans (behavior () (spool-push *art-control* "fisher-resolution" 0 self -99.0) (spool-push *art-control* "fisher-reject" 0 self -99.0) - (none) ) :code (behavior () (set! *display-profile* #f) @@ -1713,11 +1706,9 @@ ) (suspend) ) - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -1729,7 +1720,6 @@ (if (send-event *target* 'change-mode 'fishing self) (go fisher-playing) ) - (none) ) ) @@ -1746,7 +1736,6 @@ #f (lookup-text! *common-text* (text-id quit) #f) ) - (none) ) ) @@ -1801,29 +1790,28 @@ ;; failed to figure out what this is: (defstate play-accept (fisher) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 rgbaf)) - (the-as object (case event-type - (('emissive-on) - (set-vector! (-> self draw color-mult) 0.6 0.6 0.6 1.0) - (set! v0-0 (-> self draw color-emissive)) - (set! (-> v0-0 x) 0.6) - (set! (-> v0-0 y) 0.6) - (set! (-> v0-0 z) 0.6) - (set! (-> v0-0 w) 0.0) - v0-0 - ) - (('emissive-off) - (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) - (set! v0-0 (-> self draw color-emissive)) - (set! (-> v0-0 x) 0.0) - (set! (-> v0-0 y) 0.0) - (set! (-> v0-0 z) 0.0) - (set! (-> v0-0 w) 0.0) - v0-0 - ) - ) - ) + (case message + (('emissive-on) + (set-vector! (-> self draw color-mult) 0.6 0.6 0.6 1.0) + (set! v0-0 (-> self draw color-emissive)) + (set! (-> v0-0 x) 0.6) + (set! (-> v0-0 y) 0.6) + (set! (-> v0-0 z) 0.6) + (set! (-> v0-0 w) 0.0) + v0-0 + ) + (('emissive-off) + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + (set! v0-0 (-> self draw color-emissive)) + (set! (-> v0-0 x) 0.0) + (set! (-> v0-0 y) 0.0) + (set! (-> v0-0 z) 0.0) + (set! (-> v0-0 w) 0.0) + v0-0 + ) + ) ) :trans (behavior () (when (-> self training) @@ -1845,7 +1833,6 @@ (t9-14) ) ) - (none) ) ) @@ -1970,7 +1957,6 @@ ) ) ) - (none) ) :code (behavior () (if (!= (ja-group) (get-art-elem self)) @@ -2000,7 +1986,6 @@ ) ) ) - (none) ) ) @@ -2073,18 +2058,18 @@ ;; failed to figure out what this is: (defstate target-fishing (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((= event-type 'bounce) + ((= message 'bounce) (set-zero! (-> self control unknown-smush00)) (activate! (-> self control unknown-smush00) 1.0 120 210 0.3 1.0) ) - ((= event-type 'lose) - (set! (-> self control unknown-uint20) (the-as uint event-type)) - event-type + ((= message 'lose) + (set! (-> self control unknown-uint20) (the-as uint message)) + message ) (else - ((-> target-grab event) proc arg1 event-type event) + ((-> target-grab event) proc argc message block) ) ) ) @@ -2093,7 +2078,6 @@ (logior! (-> self state-flags) (state-flags invulnerable)) (set-zero! (-> self control unknown-smush00)) (set! (-> self control unknown-uint20) (the-as uint #f)) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags invulnerable)) @@ -2104,7 +2088,6 @@ ) ) (-> target-periscope exit) - (none) ) :code (behavior ((arg0 handle)) (let ((v1-1 (handle->process arg0))) @@ -2203,7 +2186,6 @@ (anim-loop) ) ) - (none) ) :post target-post ) diff --git a/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc b/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc index 322ea5e2327..672f51d8a13 100644 --- a/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc @@ -146,7 +146,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) ) - (none) ) ) @@ -161,7 +160,6 @@ nav-enemy-default-event-handler (if (not (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) ((-> (method-of-type nav-enemy nav-enemy-patrol) trans)) ) - (none) ) :code (behavior () (vector-reset! (-> self collide-info transv)) @@ -205,7 +203,6 @@ nav-enemy-default-event-handler ) (hopper-do-jump) ) - (none) ) :post (the-as (function none :behavior hopper) nav-enemy-jump-post) ) @@ -219,7 +216,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-chase) - (none) ) ) @@ -234,7 +230,6 @@ nav-enemy-default-event-handler (if (not (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) ) - (none) ) :code (behavior () (vector-reset! (-> self collide-info transv)) @@ -273,7 +268,6 @@ nav-enemy-default-event-handler (set! (-> self nav target-pos quad) (-> (target-pos 0) quad)) (hopper-do-jump) ) - (none) ) :post (the-as (function none :behavior hopper) nav-enemy-jump-post) ) @@ -287,7 +281,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-stare) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc b/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc index c3477be3b7d..312e9976c56 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc @@ -42,7 +42,6 @@ (set! (-> self bottom-height) (-> jungle bottom-height)) (set! (-> jungle bottom-height) (-> jungleb bottom-height)) (send-event *target* 'reset-pickup 'eco) - (none) ) :exit (behavior () (set! (-> jungle bottom-height) (-> self bottom-height)) @@ -51,7 +50,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((s5-0 (new 'stack-no-clear 'vector)) @@ -72,7 +70,6 @@ (if (and (>= (-> self path-pos) 0.2) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2))) (load-commands-set! *level* (load-command-get-index *level* 'jungle 0)) ) - (none) ) ) @@ -89,7 +86,6 @@ (set! (-> self bottom-height) (-> jungle bottom-height)) (set! (-> jungle bottom-height) (-> jungleb bottom-height)) (set! (-> self grab-player?) (process-grab? *target*)) - (none) ) :exit (behavior () (set! (-> jungle bottom-height) (-> self bottom-height)) @@ -98,7 +94,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) trans))) @@ -109,7 +104,6 @@ (if (and (< (-> self path-pos) 0.8) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2))) (load-commands-set! *level* (load-command-get-index *level* 'jungle 1)) ) - (none) ) ) @@ -138,7 +132,6 @@ ((the-as (function none :behavior plat-button) t9-4)) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc b/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc index 529ef546b15..c030e2c93e8 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc @@ -721,13 +721,11 @@ (set! (-> self blend-to-type) (the-as uint 0)) 0 ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (local-vars (sv-32 int) (sv-48 int)) @@ -806,7 +804,6 @@ (suspend) ) ) - (none) ) ) @@ -828,7 +825,6 @@ (suspend) ) ) - (none) ) ) @@ -1156,12 +1152,9 @@ (apply-all (-> self link) (lambda ((arg0 entity-actor) (arg1 (pointer symbol))) - (the-as - object - (when (and (= (-> arg0 etype) periscope) (not (logtest? (-> arg0 extra perm status) (entity-perm-status complete)))) - (set! (-> arg1 0) #f) - #t - ) + (when (and (= (-> arg0 etype) periscope) (not (logtest? (-> arg0 extra perm status) (entity-perm-status complete)))) + (set! (-> arg1 0) #f) + #t ) ) (& sv-16) @@ -1276,8 +1269,8 @@ ;; failed to figure out what this is: (defstate periscope-idle (periscope) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('activate) (logclear! (-> self mask) (process-mask actor-pause)) (go periscope-activate) @@ -1286,12 +1279,10 @@ ) :enter (behavior () (clear-collide-with-as (-> self root-override)) - (none) ) :exit (behavior () (restore-collide-with-as (-> self root-override)) (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans periscope-debug-trans :code (behavior () @@ -1309,7 +1300,6 @@ (loop (suspend) ) - (none) ) ) @@ -1318,7 +1308,6 @@ :exit (behavior () (sound-stop (-> self rise-sound-id)) (sound-play "eco-tower-stop" :position (the-as symbol (-> self base))) - (none) ) :trans periscope-debug-trans :code (behavior () @@ -1344,7 +1333,6 @@ ) (set! (-> self raised?) #t) (go periscope-wait-for-power-input) - (none) ) :post periscope-post ) @@ -1369,7 +1357,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior periscope) ja-post) ) @@ -1382,8 +1369,8 @@ ;; failed to figure out what this is: (defstate periscope-wait-for-player (periscope) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) @@ -1391,7 +1378,7 @@ ) ) (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) @@ -1416,7 +1403,6 @@ ) :exit (behavior () (sound-stop (-> self grips-sound-id)) - (none) ) :code (behavior () (hide-hud) @@ -1505,7 +1491,6 @@ (suspend) ) ) - (none) ) :post (behavior () (if (-> self grips-moving?) @@ -1514,7 +1499,6 @@ ) (periscope-draw-beam-impact) (ja-post) - (none) ) ) @@ -1525,11 +1509,9 @@ (periscope-find-reflection-angles) (set! (-> self turn) (-> self target-turn)) (set! (-> self tilt) (-> self target-tilt)) - (none) ) :trans (behavior () (hide-hud) - (none) ) :code (behavior () (set! (-> self lock-time) (-> *display* base-frame-counter)) @@ -1731,13 +1713,11 @@ ) (suspend) ) - (none) ) :post (behavior () (periscope-draw-beam) (periscope-update-joints) (ja-post) - (none) ) ) @@ -1764,7 +1744,6 @@ (loop (suspend) ) - (none) ) :post periscope-post ) @@ -1912,11 +1891,9 @@ (loop (suspend) ) - (none) ) :post (behavior () (draw-power-beam (-> self reflector-trans) (-> self next-reflector-trans)) - (none) ) ) @@ -1936,8 +1913,8 @@ ;; failed to figure out what this is: (defstate reflector-mirror-idle (reflector-mirror) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (sound-play "mirror-smash") (go reflector-mirror-broken #f) @@ -1946,7 +1923,6 @@ ) :exit (behavior () (stop! (-> self sound)) - (none) ) :code (behavior () (let ((gp-0 (new-stack-vector0))) @@ -1971,7 +1947,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior reflector-mirror) ja-post) ) @@ -2031,7 +2006,6 @@ (loop (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc b/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc index 69a783a5279..32387760b95 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc @@ -47,9 +47,9 @@ ;; failed to figure out what this is: (defstate idle (logtrap) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (or (= event-type 'touch) (= event-type 'attack)) - (send-event proc 'attack (-> event param 0) (new 'static 'attack-info)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (or (= message 'touch) (= message 'attack)) + (send-event proc 'attack (-> block param 0) (new 'static 'attack-info)) ) ) :code (behavior () @@ -74,7 +74,6 @@ (ja :num! (seek!)) ) ) - (none) ) ) @@ -145,7 +144,6 @@ (ja :num! (seek! max 0.4)) ) ) - (none) ) :post (the-as (function none :behavior towertop) ja-post) ) @@ -199,14 +197,13 @@ ;; failed to figure out what this is: (defstate lurkerm-tall-sail-idle (lurkerm-tall-sail) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('stop) - (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> self speed) 0.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('stop) + (process-entity-status! self (entity-perm-status complete) #t) + (set! (-> self speed) 0.0) + ) + ) ) :trans (the-as (function none :behavior lurkerm-tall-sail) rider-trans) :code (behavior () @@ -222,7 +219,6 @@ (ja :num! (seek! max (* 0.5 (-> self speed)))) ) ) - (none) ) :post (the-as (function none :behavior lurkerm-tall-sail) rider-post) ) @@ -305,14 +301,13 @@ ;; failed to figure out what this is: (defstate lurkerm-short-sail-idle (lurkerm-short-sail) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('stop) - (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> self speed) 0.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('stop) + (process-entity-status! self (entity-perm-status complete) #t) + (set! (-> self speed) 0.0) + ) + ) ) :trans (the-as (function none :behavior lurkerm-short-sail) rider-trans) :code (behavior () @@ -328,7 +323,6 @@ (ja :num! (seek! max (* 0.5 (-> self speed)))) ) ) - (none) ) :post (the-as (function none :behavior lurkerm-short-sail) rider-post) ) @@ -434,14 +428,13 @@ ;; failed to figure out what this is: (defstate lurkerm-piston-idle (lurkerm-piston) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('stop) - (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> self speed) 0.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('stop) + (process-entity-status! self (entity-perm-status complete) #t) + (set! (-> self speed) 0.0) + ) + ) ) :trans (the-as (function none :behavior lurkerm-piston) rider-trans) :code (behavior () @@ -457,7 +450,6 @@ (ja :num! (seek! max (-> self speed))) ) ) - (none) ) :post (the-as (function none :behavior lurkerm-piston) rider-post) ) @@ -561,14 +553,13 @@ ;; failed to figure out what this is: (defstate accordian-idle (accordian) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('stop) - (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> self speed) 0.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('stop) + (process-entity-status! self (entity-perm-status complete) #t) + (set! (-> self speed) 0.0) + ) + ) ) :code (behavior () (ja-no-eval :num! (loop!) :frame-num 0.0) @@ -580,7 +571,6 @@ (ja-post) ) ) - (none) ) ) @@ -681,7 +671,6 @@ (ja-eval) ) (go-virtual pov-camera-done-playing) - (none) ) ) @@ -739,8 +728,8 @@ ;; failed to figure out what this is: (defstate precurbridge-idle (precurbridge) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('go) (go precurbridge-activate) ) @@ -795,7 +784,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior precurbridge) ja-post) ) @@ -804,7 +792,6 @@ (defstate precurbridge-activate (precurbridge) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (the-as (function none :behavior precurbridge) rider-trans) :code (behavior () @@ -819,28 +806,24 @@ (ja :num! (seek! max 0.25)) ) (go precurbridge-active #f) - (none) ) :post (the-as (function none :behavior precurbridge) rider-post) ) ;; failed to figure out what this is: (defstate precurbridge-active (precurbridge) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('bonk) - (let* ((gp-0 (the-as object (-> event param 0))) - (a0-2 (-> (the-as touching-shapes-entry gp-0) head)) - (s5-0 (-> self root-override)) - ) - (get-touched-prim a0-2 s5-0 (the-as touching-shapes-entry gp-0)) - ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s5-0) - ) - (activate! (-> self smush) -1.0 150 600 1.0 1.0) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (let* ((gp-0 (the-as object (-> block param 0))) + (a0-2 (-> (the-as touching-shapes-entry gp-0) head)) + (s5-0 (-> self root-override)) + ) + (get-touched-prim a0-2 s5-0 (the-as touching-shapes-entry gp-0)) + ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s5-0) ) - ) + (activate! (-> self smush) -1.0 150 600 1.0 1.0) + ) ) ) :trans (the-as (function none :behavior precurbridge) rider-trans) @@ -875,7 +858,6 @@ (ja :num! (loop! 0.4)) (suspend) ) - (none) ) :post (the-as (function none :behavior precurbridge) rider-post) ) @@ -1139,7 +1121,6 @@ (ja-post) (suspend) ) - (none) ) ) @@ -1165,7 +1146,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior maindoor) ja-post) ) @@ -1321,7 +1301,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior jngpusher) rider-post) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/junglefish_REF.gc b/test/decompiler/reference/jak1/levels/jungle/junglefish_REF.gc index 5ce5f7c92fc..25e7074c7de 100644 --- a/test/decompiler/reference/jak1/levels/jungle/junglefish_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/junglefish_REF.gc @@ -45,7 +45,6 @@ nav-enemy-default-event-handler ) :exit (behavior () (set! (-> self target-speed) (-> self nav-info walk-travel-speed)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -97,7 +96,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) ) @@ -110,7 +108,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-chase) - (none) ) ) @@ -126,7 +123,6 @@ nav-enemy-default-event-handler (if (and *target* (>= 8192.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (go-virtual nav-enemy-attack) ) - (none) ) ) @@ -139,7 +135,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-patrol) - (none) ) ) @@ -152,7 +147,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-patrol) - (none) ) ) @@ -165,7 +159,6 @@ nav-enemy-default-event-handler ) :code (behavior () (go-virtual nav-enemy-patrol) - (none) ) ) @@ -184,7 +177,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-chase) - (none) ) :post (the-as (function none :behavior junglefish) nav-enemy-chase-post) ) @@ -209,7 +201,6 @@ nav-enemy-default-event-handler (ja :num! (seek! max 2.0)) ) (go-virtual nav-enemy-patrol) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc b/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc index b550591ea5b..86bd255b95f 100644 --- a/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc @@ -373,7 +373,6 @@ junglesnake-default-event-handler (set! (-> self des-ry) (-> self ry)) (set! (-> self des-tilt) (-> self tilt)) (logior! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (when *target* @@ -385,13 +384,11 @@ junglesnake-default-event-handler ) ) ) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -405,7 +402,6 @@ junglesnake-default-event-handler (set! (-> self skel postbind-function) junglesnake-joint-callback) (set! (-> self refractory-delay) 0) 0 - (none) ) :trans (behavior () (junglesnake-method-20 self) @@ -419,7 +415,6 @@ junglesnake-default-event-handler ) ) ) - (none) ) :code (behavior () (ja-no-eval :group! junglesnake-drop-down-ja :num! (seek! max 0.85) :frame-num 0.5) @@ -428,7 +423,6 @@ junglesnake-default-event-handler (ja :num! (seek! max 0.85)) ) (go junglesnake-tracking) - (none) ) :post (the-as (function none :behavior junglesnake) transform-post) ) @@ -440,7 +434,6 @@ junglesnake-default-event-handler (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self track-player-ry) #t) (set! (-> self track-player-tilt) #t) - (none) ) :trans (behavior () (if (and (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) @@ -472,7 +465,6 @@ junglesnake-default-event-handler ) ) ) - (none) ) :code (behavior () (cond @@ -493,7 +485,6 @@ junglesnake-default-event-handler (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior junglesnake) transform-post) ) @@ -503,11 +494,9 @@ junglesnake-default-event-handler :event junglesnake-default-event-handler :enter (behavior () (set! (-> self hit-player) #f) - (none) ) :exit (behavior () (junglesnake-method-24 self) - (none) ) :trans (behavior () (junglesnake-method-20 self) @@ -521,7 +510,6 @@ junglesnake-default-event-handler ) ) ) - (none) ) :code (behavior () (set! (-> self track-player-ry) #t) @@ -564,7 +552,6 @@ junglesnake-default-event-handler (set! (-> self refractory-delay) (rand-vu-int-range 150 300)) ) (go junglesnake-tracking) - (none) ) :post (the-as (function none :behavior junglesnake) transform-post) ) @@ -578,11 +565,9 @@ junglesnake-default-event-handler (set! (-> self track-player-tilt) #f) (set! (-> self des-ry) (-> self ry)) (set! (-> self des-tilt) (-> self tilt)) - (none) ) :trans (behavior () (junglesnake-method-20 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -610,7 +595,6 @@ junglesnake-default-event-handler ) (set-vector! (-> self root-override scale) 1.0 1.0 1.0 1.0) (go junglesnake-sleeping) - (none) ) :post (the-as (function none :behavior junglesnake) transform-post) ) @@ -631,7 +615,6 @@ junglesnake-default-event-handler (ja :num! (seek!)) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior junglesnake) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/jungleb/aphid_REF.gc b/test/decompiler/reference/jak1/levels/jungleb/aphid_REF.gc index 20d3c0096d9..1071ad3519e 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/aphid_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/aphid_REF.gc @@ -121,7 +121,6 @@ ) ) ) - (none) ) ) @@ -167,7 +166,6 @@ ) ) ) - (none) ) ) @@ -207,7 +205,6 @@ (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc b/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc index 34e596f38ab..48d4275f8c9 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc @@ -190,23 +190,21 @@ ;; failed to figure out what this is: (defstate eggtop-idle (eggtop) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (case (-> event param 0) - (('pickup) - (if (type-type? (-> proc type) fuel-cell) - (save-reminder (get-task-control (-> self entity extra perm task)) 1 0) - ) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (if (type-type? (-> proc type) fuel-cell) + (save-reminder (get-task-control (-> self entity extra perm task)) 1 0) + ) + ) + ) + ) + ) ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (if (and (not (-> self child)) (task-complete? *game-info* (-> self entity extra perm task))) @@ -214,13 +212,11 @@ ) (spawn (-> self part) (-> self root-override trans)) (sound-play "electric-loop" :id (-> self sound-id)) - (none) ) :code (behavior () (suspend) (update-transforms! (-> self root-override)) (anim-loop) - (none) ) :post (the-as (function none :behavior eggtop) ja-post) ) @@ -230,7 +226,6 @@ :trans (behavior () (rider-trans) (hide-hud-quick) - (none) ) :code (behavior ((arg0 symbol)) (when (not arg0) @@ -307,7 +302,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior eggtop) rider-post) ) diff --git a/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc b/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc index 9f0686b4be7..03a381025f1 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc @@ -287,13 +287,13 @@ ;; failed to figure out what this is: (defstate plant-boss-arm-idle (plant-boss-arm) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide 'die) - (go plant-boss-arm-die (the-as symbol (-> event param 0))) + (go plant-boss-arm-die (the-as symbol (-> block param 0))) ) (('hit) - (go plant-boss-arm-hit (the-as basic (-> event param 0))) + (go plant-boss-arm-hit (the-as basic (-> block param 0))) ) ) ) @@ -306,7 +306,6 @@ (ja :chan 1 :frame-interp (- 1.0 (-> self parent-override 0 energy))) (suspend) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -329,7 +328,6 @@ (ja :num! (seek!)) ) (go plant-boss-arm-idle) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -398,23 +396,22 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) ;; failed to figure out what this is: (defstate plant-boss-back-arms-idle (plant-boss-arm) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (or (= event-type 'touch) (= event-type 'attack)) - (send-event proc 'attack (-> event param 0) (new 'static 'attack-info)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (or (= message 'touch) (= message 'attack)) + (send-event proc 'attack (-> block param 0) (new 'static 'attack-info)) ) (cond - ((= event-type 'hit) - (go plant-boss-back-arms-hit (the-as symbol (-> event param 0))) + ((= message 'hit) + (go plant-boss-back-arms-hit (the-as symbol (-> block param 0))) ) - ((= event-type 'die) - (go plant-boss-back-arms-die (the-as symbol (-> event param 0))) + ((= message 'die) + (go plant-boss-back-arms-die (the-as symbol (-> block param 0))) ) ) ) @@ -426,7 +423,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -466,7 +462,6 @@ (ja :num! (seek!)) ) (go plant-boss-back-arms-idle) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -493,20 +488,19 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) ;; failed to figure out what this is: (defstate plant-boss-vine-idle (plant-boss-arm) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide 'die) - (go plant-boss-vine-die (the-as symbol (-> event param 0))) + (go plant-boss-vine-die (the-as symbol (-> block param 0))) ) (('hit) - (go plant-boss-vine-hit (the-as basic (-> event param 0))) + (go plant-boss-vine-hit (the-as basic (-> block param 0))) ) ) ) @@ -520,7 +514,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -543,7 +536,6 @@ (ja :num! (seek!)) ) (go plant-boss-vine-idle) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -568,17 +560,16 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) ;; failed to figure out what this is: (defstate plant-boss-root-idle (plant-boss-arm) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide 'die) - (go plant-boss-root-die (the-as symbol (-> event param 0))) + (go plant-boss-root-die (the-as symbol (-> block param 0))) ) ) ) @@ -592,7 +583,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -608,7 +598,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior plant-boss-arm) ja-post) ) @@ -740,13 +729,13 @@ ;; failed to figure out what this is: (defstate plant-boss-leaf-idle (plant-boss-leaf) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) - (go plant-boss-leaf-open (the-as symbol (-> event param 0))) + (go plant-boss-leaf-open (the-as symbol (-> block param 0))) ) (('die) - (go plant-boss-leaf-die (the-as basic (-> event param 0))) + (go plant-boss-leaf-die (the-as basic (-> block param 0))) ) ) ) @@ -773,20 +762,19 @@ ) ) ) - (none) ) :post (the-as (function none :behavior plant-boss-leaf) ja-post) ) ;; failed to figure out what this is: (defstate plant-boss-leaf-open (plant-boss-leaf) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('kill) (go plant-boss-leaf-close) ) (('die) - (go plant-boss-leaf-die (the-as basic (-> event param 0))) + (go plant-boss-leaf-die (the-as basic (-> block param 0))) ) ) ) @@ -831,18 +819,17 @@ ) ) (go plant-boss-leaf-open-idle #f) - (none) ) :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) ;; failed to figure out what this is: (defstate plant-boss-leaf-open-idle (plant-boss-leaf) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('kill) (set! (-> self state-object) #t) - (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> event param 0)))))) + (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> block param 0)))))) (set! (-> self state-time-frame) (the-as time-frame v0-0)) v0-0 ) @@ -853,7 +840,7 @@ ) ) (('die) - (go plant-boss-leaf-die (the-as basic (-> event param 0))) + (go plant-boss-leaf-die (the-as basic (-> block param 0))) ) ) ) @@ -880,24 +867,23 @@ (set! v1-19 (and (-> self state-object) (< (-> self state-time-frame) (-> *display* base-frame-counter)))) ) (go plant-boss-leaf-close) - (none) ) :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) ;; failed to figure out what this is: (defstate plant-boss-leaf-bounce (plant-boss-leaf) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('kill) (set! (-> self state-object) #t) - (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> event param 0)))))) + (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> block param 0)))))) (set! (-> self state-time-frame) (the-as time-frame v0-0)) v0-0 ) ) (('die) - (go plant-boss-leaf-die (the-as basic (-> event param 0))) + (go plant-boss-leaf-die (the-as basic (-> block param 0))) ) ) ) @@ -923,17 +909,16 @@ ) ) (go plant-boss-leaf-open-idle (-> self state-object)) - (none) ) :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) ;; failed to figure out what this is: (defstate plant-boss-leaf-close (plant-boss-leaf) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) - (go plant-boss-leaf-die (the-as basic (-> event param 0))) + (go plant-boss-leaf-die (the-as basic (-> block param 0))) ) ) ) @@ -958,7 +943,6 @@ ) ) (go plant-boss-leaf-idle #f) - (none) ) :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) @@ -970,7 +954,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) :post (the-as (function none :behavior plant-boss-leaf) ja-post) ) @@ -1049,7 +1032,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior plant-boss) ja-post) ) @@ -1140,7 +1122,6 @@ (set! (-> self cycle-count) 0) (set! (-> self snap-count) 0) (go plant-boss-reset 0) - (none) ) :post (the-as (function none :behavior plant-boss) ja-post) ) @@ -1153,7 +1134,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self body flex-blend) 0.0) (set! (-> self neck flex-blend) 1.0) - (none) ) :trans (behavior () (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) @@ -1185,7 +1165,6 @@ (go plant-boss-attack 1) ) ) - (none) ) :code (behavior () (cond @@ -1246,7 +1225,6 @@ ) ) ) - (none) ) :post plant-boss-post ) @@ -1281,7 +1259,6 @@ ) ) ) - (none) ) :trans (behavior () (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) @@ -1315,7 +1292,6 @@ ) ) ) - (none) ) :code (-> plant-boss-idle code) :post plant-boss-post @@ -1323,25 +1299,25 @@ ;; failed to figure out what this is: (defstate plant-boss-vulnerable (plant-boss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) (send-event proc 'shove - (-> event param 0) + (-> block param 0) (static-attack-info ((shove-up (meters 2)) (shove-back (meters 6)))) ) - (go plant-boss-hit (the-as symbol (-> event param 1))) + (go plant-boss-hit (the-as symbol (-> block param 1))) ) ) (else - (plant-boss-generic-event-handler proc arg1 event-type event) + (plant-boss-generic-event-handler proc argc message block) ) ) ) @@ -1352,7 +1328,6 @@ (set! (-> self attack-prim 0 local-sphere w) 12288.0) (set! (-> self attack-prim 0 prim-core offense) (collide-offense indestructible)) (logior! (-> self attack-prim 0 prim-core action) (collide-action solid)) - (none) ) :exit (behavior () (send-event (ppointer->process (-> self leaf 1)) 'kill 0) @@ -1360,7 +1335,6 @@ (set! (-> self attack-prim 0 local-sphere w) 16384.0) (set! (-> self attack-prim 0 prim-core offense) (collide-offense no-offense)) (logclear! (-> self attack-prim 0 prim-core action) (collide-action solid)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.25)) @@ -1416,24 +1390,23 @@ ) ) (go plant-boss-spawn) - (none) ) :post plant-boss-post ) ;; failed to figure out what this is: (defstate plant-boss-attack (plant-boss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (when (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) (not (ja-group? plant-boss-main-vulnerable2idle-ja)) ) - (when (send-event proc 'attack-or-shove (-> event param 0) (static-attack-info ((mode 'plant-boss)))) + (when (send-event proc 'attack-or-shove (-> block param 0) (static-attack-info ((mode 'plant-boss)))) (let ((v0-1 (the-as object #t))) (set! (-> self ate) (the-as symbol v0-1)) v0-1 @@ -1442,7 +1415,7 @@ ) ) (else - (plant-boss-default-event-handler proc arg1 event-type event) + (plant-boss-default-event-handler proc argc message block) ) ) ) @@ -1495,7 +1468,6 @@ ) ) (go plant-boss-reset arg0) - (none) ) :post plant-boss-post ) @@ -1510,7 +1482,6 @@ (deactivate a0-4) ) ) - (none) ) :code (behavior () (let ((f30-1 (the-as float (if (ja-group? plant-boss-main-attack-ja) @@ -1560,7 +1531,6 @@ (send-event *target* 'end-mode) (logclear! (-> self skel status) (janim-status inited)) (go plant-boss-idle) - (none) ) :post plant-boss-post ) @@ -1608,7 +1578,6 @@ (go plant-boss-idle) ) ) - (none) ) :post plant-boss-post ) @@ -1669,7 +1638,6 @@ (ja-eval) ) (go plant-boss-spawn) - (none) ) :post plant-boss-post ) @@ -1765,31 +1733,29 @@ (logior! (-> self mask) (process-mask actor-pause)) (remove-setting! 'music) (go plant-boss-dead-idle) - (none) ) :post (behavior () (plant-boss-post) (do-push-aways! (-> self root-override)) - (none) ) ) ;; failed to figure out what this is: (defstate plant-boss-dead-idle (plant-boss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('bonk) (go plant-boss-dead-bounce (lerp-scale (the-as float 0.1) (the-as float 1.0) - (the-as float (-> event param 1)) + (the-as float (-> block param 1)) (the-as float 40960.0) (the-as float 81920.0) ) ) ) (else - (plant-boss-generic-event-handler proc arg1 event-type event) + (plant-boss-generic-event-handler proc argc message block) ) ) ) @@ -1807,7 +1773,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) @@ -1839,7 +1804,6 @@ (ja :chan 1 :frame-interp (- 1.0 arg0) :num-func num-func-identity :frame-num max) ) (go plant-boss-dead-idle) - (none) ) :post (the-as (function none :behavior plant-boss) rider-post) ) diff --git a/test/decompiler/reference/jak1/levels/jungleb/plat-flip_REF.gc b/test/decompiler/reference/jak1/levels/jungleb/plat-flip_REF.gc index 6848be1ab2b..cd2274af79b 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/plat-flip_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/plat-flip_REF.gc @@ -48,17 +48,16 @@ ;; failed to figure out what this is: (defstate plat-flip-idle (plat-flip) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (activate! (-> self smush) -1.0 90 300 1.0 1.0) - ) - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - (the-as smush-control #f) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (activate! (-> self smush) -1.0 90 300 1.0 1.0) + ) + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + (the-as smush-control #f) + ) + ) ) :trans (the-as (function none :behavior plat-flip) rider-trans) :code (behavior () @@ -111,7 +110,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior plat-flip) rider-post) ) diff --git a/test/decompiler/reference/jak1/levels/lavatube/assistant-lavatube_REF.gc b/test/decompiler/reference/jak1/levels/lavatube/assistant-lavatube_REF.gc index 32466d7da86..8ed8ca97408 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/assistant-lavatube_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/assistant-lavatube_REF.gc @@ -111,7 +111,6 @@ (game-task none) ) ) - (none) ) ) @@ -143,7 +142,6 @@ (ja :num! (seek!)) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc b/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc index 5ad8511b957..c96bbc9950d 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc @@ -416,12 +416,11 @@ ;; definition for function energydoor-open-handler ;; INFO: Return type mismatch symbol vs object. (defbehavior energydoor-open-handler energydoor ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('open?) - #t - ) - ) - ) + (case arg2 + (('open?) + #t + ) + ) ) ;; definition for function energydoor-closed-handler @@ -451,7 +450,6 @@ (go energydoor-closed-till-near) (go energydoor-closed-till-task) ) - (none) ) :post (the-as (function none :behavior energydoor) transform-post) ) @@ -488,7 +486,6 @@ ) ) ) - (none) ) :code (behavior () (ja :num-func num-func-identity :frame-num max) @@ -496,7 +493,6 @@ (loop (suspend) ) - (none) ) ) @@ -510,7 +506,6 @@ (ja :num! (seek!)) ) (go energydoor-opened) - (none) ) :post (the-as (function none :behavior energydoor) transform-post) ) @@ -541,7 +536,6 @@ (go energydoor-opening) ) ) - (none) ) :code (behavior () (ja :num-func num-func-identity :frame-num 0.0) @@ -549,7 +543,6 @@ (loop (suspend) ) - (none) ) ) @@ -560,7 +553,6 @@ (if (< -409600.0 (energydoor-player-dist)) (go energydoor-opening) ) - (none) ) :code (behavior () (ja :num-func num-func-identity :frame-num 0.0) @@ -568,7 +560,6 @@ (loop (suspend) ) - (none) ) ) @@ -673,7 +664,6 @@ (loop (suspend) ) - (none) ) ) @@ -693,15 +683,14 @@ ) ) ) - (none) ) :post (the-as (function none :behavior energybase) ja-post) ) ;; failed to figure out what this is: (defstate energybase-idle (energybase) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('stop) (go energybase-stopping) ) @@ -718,7 +707,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior energybase) ja-post) ) @@ -851,29 +839,28 @@ ;; failed to figure out what this is: (defstate energyball-idle (energyball) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('attack) - (when (and (>= arg1 2) (= (-> event param 1) 'eco-yellow)) - (increment-success-for-hint (text-id lavatube-balls)) - (sound-play "dcrate-break") - (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 546) - 600 - #f - #f - #f - (-> self root-override trans) - :to *entity-pool* - ) - (cleanup-for-death self) - (the-as symbol (deactivate self)) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (and (>= argc 2) (= (-> block param 1) 'eco-yellow)) + (increment-success-for-hint (text-id lavatube-balls)) + (sound-play "dcrate-break") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 546) + 600 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* + ) + (cleanup-for-death self) + (deactivate self) + ) + ) + ) ) :trans (behavior () (rider-trans) @@ -901,7 +888,6 @@ (matrix->quaternion (-> self root-override quat) s5-1) ) ) - (none) ) :code (behavior () (loop @@ -911,7 +897,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior energyball) rider-post) ) @@ -1001,13 +986,11 @@ (defstate energyarm-stop (energyarm) :enter (behavior () '() - (none) ) :trans (behavior () (update! (-> self x-rotation) 0.0) (update! (-> self y-chatter-rotation) 0.0) (energyarm-trans) - (none) ) :code (behavior () (loop @@ -1017,15 +1000,14 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior energyarm) rider-post) ) ;; failed to figure out what this is: (defstate energyarm-no-ball (energyarm) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('stop) (go energyarm-stop) ) @@ -1033,7 +1015,6 @@ ) :enter (behavior () (set! (-> self y-chatter-rotation osc target) 1.0) - (none) ) :trans (behavior () (set! (-> self x-correction) (fmax -1.0 (+ -0.1 (-> self x-correction)))) @@ -1059,7 +1040,6 @@ ) ) (energyarm-trans) - (none) ) :code (behavior () (loop @@ -1069,7 +1049,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior energyarm) rider-post) ) @@ -1078,7 +1057,6 @@ (defstate energyarm-fall (energyarm) :enter (behavior () (set! (-> self x-fall-rotation osc target) 1.0) - (none) ) :trans (behavior () (update! (-> self x-fall-rotation) 0.0) @@ -1091,7 +1069,6 @@ ) ) (energyarm-trans) - (none) ) :code (behavior () (loop @@ -1101,15 +1078,14 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior energyarm) rider-post) ) ;; failed to figure out what this is: (defstate energyarm-idle (energyarm) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('stop) (go energyarm-stop) ) @@ -1151,7 +1127,6 @@ ) ) ) - (none) ) :code (behavior () (let ((gp-0 (-> self skel root-channel 0))) @@ -1169,7 +1144,6 @@ (ja :num! (loop! f0-9)) ) ) - (none) ) :post (the-as (function none :behavior energyarm) rider-post) ) @@ -1313,13 +1287,11 @@ (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (none) ) :trans (behavior () (update! (-> self rotation-speed) 0.0) (energyhub-trans) (energyhub-set-lava-height -122880.0) - (none) ) :code (behavior () (loop @@ -1333,20 +1305,18 @@ (ja :num! (loop! f0-4)) ) ) - (none) ) :post (the-as (function none :behavior energyhub) ja-post) ) ;; failed to figure out what this is: (defstate energyhub-stop (energyhub) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('flash) - (set! (-> self palette-val) 1.9921875) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('flash) + (set! (-> self palette-val) 1.9921875) + ) + ) ) :enter (behavior () (set! (-> self rotation-speed target) 0.0) @@ -1392,7 +1362,6 @@ (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (none) ) :trans (behavior () (update! (-> self rotation-speed) 0.0) @@ -1401,7 +1370,6 @@ (if (< (-> self rotation-speed value) 0.3) (go energyhub-stopped) ) - (none) ) :code (behavior () (loop @@ -1415,20 +1383,18 @@ (ja :num! (loop! f0-4)) ) ) - (none) ) :post (the-as (function none :behavior energyhub) ja-post) ) ;; failed to figure out what this is: (defstate energyhub-idle (energyhub) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('flash) - (set! (-> self palette-val) 1.9921875) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('flash) + (set! (-> self palette-val) 1.9921875) + ) + ) ) :trans (behavior () (if (nonzero? (-> self sound)) @@ -1477,7 +1443,6 @@ (update! (-> self rotation-speed-offset)) (update! (-> self rotation-speed) (-> self rotation-speed-offset value)) (energyhub-trans) - (none) ) :code (behavior () (loop @@ -1491,7 +1456,6 @@ (ja :num! (loop! f0-4)) ) ) - (none) ) :post (the-as (function none :behavior energyhub) ja-post) ) @@ -1572,7 +1536,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior energylava) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc b/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc index dc49e64960a..8cbf550402b 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc @@ -38,7 +38,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior lavabase) ja-post) ) @@ -90,7 +89,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior lavafall) ja-post) ) @@ -142,7 +140,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior lavashortcut) ja-post) ) @@ -606,18 +603,17 @@ ) (cleanup-for-death self) (deactivate self) - (none) ) ) ;; failed to figure out what this is: (defstate darkecobarrel-mover-move (darkecobarrel-mover) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (cond ((= proc *target*) - (let ((s5-0 (-> event param 0))) + (let ((s5-0 (-> block param 0))) (if (and s5-0 ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry s5-0) @@ -630,8 +626,8 @@ ) ) ) - ((>= arg1 2) - (case (-> event param 1) + ((>= argc 2) + (case (-> block param 1) (('eco-yellow) (+! (-> self hits) 1) (cond @@ -680,7 +676,6 @@ ) (update! (-> self down) (update-with-delay! (-> self down-tgt))) (darkecobarrel-mover-pos) - (none) ) :code (behavior () (let ((f30-0 0.9) @@ -696,7 +691,6 @@ (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) - (none) ) :post (the-as (function none :behavior darkecobarrel-mover) pusher-post) ) @@ -797,7 +791,6 @@ (if (nonzero? (-> self sound)) (update! (-> self sound)) ) - (none) ) :code (behavior () (loop @@ -807,7 +800,6 @@ (ja :num! (seek!)) ) ) - (none) ) ) @@ -915,7 +907,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior lavafallsewera) ja-post) ) @@ -966,7 +957,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior lavafallsewerb) ja-post) ) @@ -1177,17 +1167,16 @@ ) (cleanup-for-death self) (deactivate self) - (none) ) ) ;; failed to figure out what this is: (defstate idle (chainmine) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'touch) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'deadly)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'deadly)))) (go-virtual die) ) ) @@ -1203,7 +1192,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior chainmine) ja-post) ) @@ -1363,15 +1351,14 @@ (suspend) (cleanup-for-death self) (deactivate self) - (none) ) ) ;; failed to figure out what this is: (defstate idle (lavaballoon) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (send-event proc 'heat -10.0) (go-virtual die) @@ -1384,7 +1371,6 @@ (eval-path-curve! (-> self path) (-> self root-override trans) f0-4 'interp) ) ) - (none) ) :code (behavior () (loop @@ -1394,7 +1380,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior lavaballoon) transform-post) ) @@ -1469,7 +1454,6 @@ ) ) (ja-post) - (none) ) ) @@ -1526,7 +1510,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior lavayellowtarp) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc b/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc index 498d0a032d7..7183cf71df4 100644 --- a/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc @@ -246,15 +246,14 @@ ) ;; definition for function baby-spider-default-event-handler -;; INFO: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 7] (defbehavior baby-spider-default-event-handler baby-spider ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (if (= v1-0 'victory) - (go-virtual nav-enemy-victory) - (nav-enemy-default-event-handler arg0 arg1 arg2 arg3) - ) - ) + (case arg2 + (('victory) + (go-virtual nav-enemy-victory) + ) + (else + (nav-enemy-default-event-handler arg0 arg1 arg2 arg3) + ) ) ) @@ -361,7 +360,6 @@ baby-spider-default-event-handler (ja :num! (seek!)) ) (go baby-spider-resume) - (none) ) :post (the-as (function none :behavior baby-spider) nav-enemy-simple-post) ) @@ -389,7 +387,6 @@ baby-spider-default-event-handler ) ) (go-virtual nav-enemy-idle) - (none) ) ) @@ -409,7 +406,6 @@ baby-spider-default-event-handler (set! (-> self collide-info trans quad) (-> gp-0 quad)) ) ) - (none) ) :trans (behavior () (if (nav-enemy-method-53 self) @@ -420,11 +416,9 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -441,7 +435,6 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) @@ -456,7 +449,6 @@ baby-spider-default-event-handler ) ) ) - (none) ) ) @@ -473,7 +465,6 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :code (behavior () (ja-no-eval :num! (loop!)) @@ -486,7 +477,6 @@ baby-spider-default-event-handler ) (ja-no-eval :num! (seek!)) (go-virtual nav-enemy-chase) - (none) ) ) @@ -506,7 +496,6 @@ baby-spider-default-event-handler (t9-3) ) ) - (none) ) :code (behavior () (set! (-> self target-nav-time) (-> *display* base-frame-counter)) @@ -523,12 +512,10 @@ baby-spider-default-event-handler (suspend) (ja :num! (loop!)) ) - (none) ) :post (behavior () (nav-enemy-method-52 self (target-pos 0)) (nav-enemy-travel-post) - (none) ) ) @@ -545,7 +532,6 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :code (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) ) @@ -563,7 +549,6 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :code (behavior () (set! (-> self rotate-speed) 1456355.5) @@ -591,7 +576,6 @@ baby-spider-default-event-handler ) ) ) - (none) ) ) @@ -608,7 +592,6 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -631,7 +614,6 @@ baby-spider-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -648,7 +630,6 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -658,7 +639,6 @@ baby-spider-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-victory) - (none) ) ) @@ -675,7 +655,6 @@ baby-spider-default-event-handler (t9-2) ) ) - (none) ) :code (-> (method-of-type nav-enemy nav-enemy-victory) code) ) @@ -700,7 +679,6 @@ baby-spider-default-event-handler (t9-1) ) ) - (none) ) ) @@ -714,7 +692,6 @@ baby-spider-default-event-handler (send-event (ppointer->process (-> self parent)) v1-2) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc b/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc index ebafa1aa2a0..295d920eaa6 100644 --- a/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc @@ -442,8 +442,8 @@ ;; failed to figure out what this is: (defstate dark-crystal-idle (dark-crystal) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (if (= (-> proc type) target) (level-hint-spawn @@ -464,7 +464,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -490,7 +489,6 @@ ) ) (go dark-crystal-explode) - (none) ) ) @@ -548,7 +546,6 @@ (until (not (-> self child)) (suspend) ) - (none) ) ) @@ -587,7 +584,6 @@ ) (aybabtu 2) (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc b/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc index ede341705ea..a42a8daf440 100644 --- a/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc @@ -665,7 +665,6 @@ (defstate driller-lurker-debug-play-anims (driller-lurker) :code (behavior () 0 - (none) ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -678,18 +677,15 @@ (set! (-> self targ-path-speed) 0.0) (set! (-> self path-speed) 0.0) (shut-down! (-> self neck)) - (none) ) :exit (behavior () (stop! (-> self sound2)) - (none) ) :trans (behavior () (if (driller-lurker-method-25 self) (go driller-lurker-chase #t) ) (driller-lurker-method-20 self #t (the-as target #f)) - (none) ) :code (behavior () (update-trans! (-> self sound2) (-> self root-overeride trans)) @@ -721,7 +717,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -738,14 +733,12 @@ (set! (-> self targ-path-speed) 15360.0) ) (shut-down! (-> self neck)) - (none) ) :trans (behavior () (if (driller-lurker-method-25 self) (go driller-lurker-chase #t) ) (driller-lurker-method-20 self #t (the-as target #f)) - (none) ) :code (behavior () (ja-channel-push! 2 (seconds 0.2)) @@ -766,7 +759,6 @@ (ja :num-func num-func-identity :frame-num 0.0) ) ) - (none) ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -779,14 +771,12 @@ (set! (-> self path-speed) 0.0) (set! (-> self targ-path-speed) 0.0) (shut-down! (-> self neck)) - (none) ) :trans (behavior () (if (driller-lurker-method-25 self) (go driller-lurker-chase #t) ) (driller-lurker-method-20 self #t (the-as target #f)) - (none) ) :code (behavior () (set! (-> self timeout) (rand-vu-int-range 2 4)) @@ -826,7 +816,6 @@ ) ) (go driller-lurker-patrol) - (none) ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -841,7 +830,6 @@ (set! (-> self mode) (the-as uint 3)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self targ-path-speed) 23552.0) - (none) ) :trans (behavior () (if (driller-lurker-method-24 self) @@ -877,7 +865,6 @@ ) ) (driller-lurker-method-20 self #f (the-as target #t)) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-push! 2 (seconds 0.2)) @@ -893,7 +880,6 @@ (ja :num-func num-func-identity :frame-num 0.0) ) ) - (none) ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -906,7 +892,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self path-speed) 0.0) (set! (-> self targ-path-speed) 0.0) - (none) ) :trans (behavior () (cond @@ -923,7 +908,6 @@ (go driller-lurker-jammed-standing) ) (driller-lurker-method-20 self #f (the-as target #t)) - (none) ) :code (behavior () (ja-channel-push! 2 (seconds 0.2)) @@ -939,7 +923,6 @@ (ja :num-func num-func-identity :frame-num 0.0) ) ) - (none) ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -952,11 +935,9 @@ (set! (-> self path-speed) 0.0) (set! (-> self targ-path-speed) 0.0) (shut-down! (-> self neck)) - (none) ) :trans (behavior () (driller-lurker-method-20 self #f (the-as target #f)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -976,7 +957,6 @@ (go driller-lurker-patrol) ) ) - (none) ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -1002,7 +982,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior driller-lurker) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc b/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc index f60478a2706..50e296e8d41 100644 --- a/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc @@ -398,7 +398,6 @@ (seek! (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame))) (set! (-> self root scale y) (-> self root scale x)) (set! (-> self root scale z) (-> self root scale x)) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -414,7 +413,6 @@ (suspend) (ja :num! (seek!)) ) - (none) ) :post (the-as (function none :behavior gnawer-falling-segment) ja-post) ) @@ -896,14 +894,14 @@ ;; failed to figure out what this is: (defstate gnawer-chewing-on-post (gnawer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (if (= (-> proc type) target) (send-event proc 'shove - (-> event param 0) + (-> block param 0) (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) ) ) @@ -917,13 +915,11 @@ ) :exit (behavior () (stop! (-> self sound2)) - (none) ) :trans (behavior () (if (and *target* (>= 81920.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) (go gnawer-retreat-into-post) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1007,7 +1003,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior gnawer) transform-post) ) @@ -1016,7 +1011,6 @@ (defstate gnawer-retreat-into-post (gnawer) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) @@ -1028,7 +1022,6 @@ ) (quaternion-identity! (-> self root-override quat)) (go gnawer-wait-to-run) - (none) ) :post (the-as (function none :behavior gnawer) transform-post) ) @@ -1045,21 +1038,20 @@ ) ) (go gnawer-run) - (none) ) ) ;; failed to figure out what this is: (defstate gnawer-run (gnawer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('touch) (if (= (-> proc type) target) (send-event proc 'shove - (-> event param 0) + (-> block param 0) (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) ) ) @@ -1070,7 +1062,7 @@ (send-event proc 'attack - (-> event param 0) + (-> block param 0) (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) ) ) @@ -1078,7 +1070,7 @@ (if (< (- (-> *display* base-frame-counter) (-> self last-hit-time)) (seconds 0.5)) (return #f) ) - (let* ((a2-1 (the-as object (-> event param 0))) + (let* ((a2-1 (the-as object (-> block param 0))) (v1-19 (-> (get-touched-prim (-> (the-as touching-shapes-entry a2-1) head) (-> self root-override) @@ -1107,12 +1099,10 @@ (gnawer-method-24 self) (set! (-> self last-hit-time) (-> *display* base-frame-counter)) (gnawer-method-26 self) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (stop! (-> self sound)) - (none) ) :trans (behavior () (+! (-> self route-dist) (* (-> self speed) (-> *display* seconds-per-frame))) @@ -1120,7 +1110,6 @@ (go gnawer-wait-to-run) ) (update! (-> self sound)) - (none) ) :code (behavior () (local-vars (v1-19 symbol) (v1-35 symbol)) @@ -1148,7 +1137,6 @@ ) (ja :group! gnawer-run-ja :num! min) ) - (none) ) :post (the-as (function none :behavior gnawer) transform-post) ) @@ -1164,7 +1152,6 @@ (vector-normalize! (-> self root-override transv) 1.0) (set! (-> self root-override transv y) 0.3) (vector-normalize! (-> self root-override transv) 32768.0) - (none) ) :trans (behavior () (+! (-> self root-override transv y) (* -409600.0 (-> *display* seconds-per-frame))) @@ -1180,7 +1167,6 @@ (vector+! (-> self root-override trans) (-> self root-override trans) gp-0) ) (spool-push *art-control* "maincavecam-gnawer-fuel-cell" 0 self -1.0) - (none) ) :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) @@ -1193,26 +1179,23 @@ (ja :num! (seek!)) ) (go gnawer-dying-give-pickups) - (none) ) :post (the-as (function none :behavior gnawer) ja-post) ) ;; failed to figure out what this is: (defstate gnawer-dying-give-pickups (gnawer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (if (and (= (-> proc type) money) (= (-> event param 0) 'pickup)) - (gnawer-method-30 self (the-as process-drawable proc)) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (if (and (= (-> proc type) money) (= (-> block param 0) 'pickup)) + (gnawer-method-30 self (the-as process-drawable proc)) + ) + ) + ) ) :trans (behavior () (spool-push *art-control* "maincavecam-gnawer-fuel-cell" 0 self -1.0) - (none) ) :code (behavior () (local-vars (sv-128 symbol)) @@ -1266,30 +1249,28 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) ;; failed to figure out what this is: (defstate gnawer-give-fuel-cell (gnawer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (cond - ((and (= (-> proc type) maincavecam) (= (-> event param 0) 'die)) - (process-entity-status! self (entity-perm-status bit-3) #f) - (let ((v0-0 (the-as uint (logior (-> self mask) (process-mask actor-pause))))) - (set! (-> self mask) (the-as process-mask v0-0)) - v0-0 - ) - ) - ((and (= (-> proc type) money) (= (-> event param 0) 'pickup)) - (gnawer-method-30 self (the-as process-drawable proc)) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (cond + ((and (= (-> proc type) maincavecam) (= (-> block param 0) 'die)) + (process-entity-status! self (entity-perm-status bit-3) #f) + (let ((v0-0 (the-as uint (logior (-> self mask) (process-mask actor-pause))))) + (set! (-> self mask) (the-as process-mask v0-0)) + v0-0 ) + ) + ((and (= (-> proc type) money) (= (-> block param 0) 'pickup)) + (gnawer-method-30 self (the-as process-drawable proc)) + ) + ) + ) + ) ) :code (behavior () (when (not (task-complete? *game-info* (-> self entity extra perm task))) @@ -1335,21 +1316,19 @@ (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self mask) (process-mask actor-pause)) (cleanup-for-death self) - (none) ) ) ;; failed to figure out what this is: (defstate gnawer-put-items-at-dest (gnawer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (if (and (= (-> proc type) money) (= (-> event param 0) 'pickup)) - (gnawer-method-30 self (the-as process-drawable proc)) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (if (and (= (-> proc type) money) (= (-> block param 0) 'pickup)) + (gnawer-method-30 self (the-as process-drawable proc)) + ) + ) + ) ) :code (behavior () (set! (-> self draw origin-joint-index) (the-as uint 0)) @@ -1395,7 +1374,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc b/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc index dfcfb9cae19..282892d97d9 100644 --- a/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc @@ -69,7 +69,6 @@ ) ) (go-virtual pov-camera-done-playing) - (none) ) ) @@ -154,22 +153,21 @@ ;; failed to figure out what this is: (defstate cavecrusher-idle (cavecrusher) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch 'attack) - (when (= (-> proc type) target) - (if ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry (-> event param 0)) - (-> *target* control) - (collide-action solid) - (collide-action) - ) - (the-as symbol (target-attack-up *target* 'attack-or-shove 'deadlyup)) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (when (= (-> proc type) target) + (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry (-> block param 0)) + (-> *target* control) + (collide-action solid) + (collide-action) + ) + (target-attack-up *target* 'attack-or-shove 'deadlyup) + ) + ) + ) + ) ) :code (behavior () (loop @@ -180,7 +178,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior cavecrusher) ja-post) ) @@ -256,8 +253,8 @@ ;; failed to figure out what this is: (defstate idle (cavetrapdoor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (when (= (-> proc type) target) (when (>= (- (-> (target-pos 0) y) (-> self root-override trans y)) 409.6) @@ -276,7 +273,6 @@ (ja :num! (seek!)) ) (anim-loop) - (none) ) ) @@ -343,7 +339,6 @@ (ja :num! (seek!)) ) (go-virtual idle) - (none) ) :post (the-as (function none :behavior cavetrapdoor) pusher-post) ) @@ -488,12 +483,12 @@ ;; failed to figure out what this is: (defstate caveflamepots-active (caveflamepots) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (when (= (-> proc type) target) (when ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> *target* control) (collide-action solid) (collide-action) @@ -507,13 +502,13 @@ (send-event proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((mode 'burn) (vector (-> s4-0 vector)) (shove-up (-> s4-0 shove-up)))) ) (send-event proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((mode 'burn) (shove-up (meters 0)) (shove-back (meters 2)) @@ -572,14 +567,12 @@ ) ) ) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -757,14 +750,12 @@ (let ((f0-0 (get-current-phase (-> self sync)))) (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (* -65536.0 f0-0)) ) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior cavespatula) rider-post) ) @@ -882,14 +873,12 @@ (let ((f0-0 (get-current-phase (-> self sync)))) (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (* -65536.0 f0-0)) ) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior cavespatulatwo) rider-post) ) @@ -1044,26 +1033,22 @@ ;; failed to figure out what this is: (defstate caveelevator-cycle-active (caveelevator) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (activate! (-> self smush) -1.0 60 150 1.0 1.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (activate! (-> self smush) -1.0 60 150 1.0 1.0) + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (rider-trans) (caveelevator-method-20 self) - (none) ) :code (behavior () (loop @@ -1076,19 +1061,17 @@ ) (suspend) ) - (none) ) :post (behavior () (rider-post) (caveelevator-method-21 self) - (none) ) ) ;; failed to figure out what this is: (defstate caveelevator-one-way-idle-start (caveelevator) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('bonk) (activate! (-> self smush) -1.0 60 150 1.0 1.0) (go caveelevator-one-way-travel-to-end) @@ -1105,7 +1088,6 @@ :trans (behavior () (rider-trans) (caveelevator-method-20 self) - (none) ) :code (behavior () (ja :group! (-> (the-as art-joint-anim (+ (* (-> self anim 0) 4) (the-as int (-> self draw art-group)))) @@ -1116,37 +1098,31 @@ (loop (suspend) ) - (none) ) :post (behavior () (rider-post) (caveelevator-method-21 self) - (none) ) ) ;; failed to figure out what this is: (defstate caveelevator-one-way-travel-to-end (caveelevator) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (activate! (-> self smush) -1.0 60 150 1.0 1.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (activate! (-> self smush) -1.0 60 150 1.0 1.0) + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (rider-trans) (caveelevator-method-20 self) - (none) ) :code (behavior () (ja :group! (-> self draw art-group data (-> self anim 0)) :num! min) @@ -1156,28 +1132,24 @@ (ja :num! (seek!)) ) (go caveelevator-one-way-idle-end) - (none) ) :post (behavior () (rider-post) (caveelevator-method-21 self) - (none) ) ) ;; failed to figure out what this is: (defstate caveelevator-one-way-idle-end (caveelevator) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (activate! (-> self smush) -1.0 60 150 1.0 1.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (activate! (-> self smush) -1.0 60 150 1.0 1.0) + ) + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (cond @@ -1192,44 +1164,37 @@ ) (rider-trans) (caveelevator-method-20 self) - (none) ) :code (behavior () (ja :group! (-> self draw art-group data (-> self anim 0)) :num! max) (loop (suspend) ) - (none) ) :post (behavior () (rider-post) (caveelevator-method-21 self) - (none) ) ) ;; failed to figure out what this is: (defstate caveelevator-one-way-travel-to-start (caveelevator) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (activate! (-> self smush) -1.0 60 150 1.0 1.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (activate! (-> self smush) -1.0 60 150 1.0 1.0) + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (rider-trans) (caveelevator-method-20 self) - (none) ) :code (behavior () (ja :group! (-> self draw art-group data (-> self anim 1)) :num! min) @@ -1239,12 +1204,10 @@ (ja :num! (seek!)) ) (go caveelevator-one-way-idle-start) - (none) ) :post (behavior () (rider-post) (caveelevator-method-21 self) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc index bb654be0f02..85d0204e011 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc @@ -236,8 +236,8 @@ ;; failed to figure out what this is: (defstate mother-spider-egg-falling (mother-spider-egg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (go mother-spider-egg-die-while-falling) ) @@ -245,7 +245,6 @@ ) :enter (behavior () (set! (-> self falling-start-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (let ((f30-0 @@ -264,7 +263,6 @@ ) ) (draw-egg-shadow self (-> self shadow-pos) #t) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -275,45 +273,40 @@ (ja :num! (seek! max (-> self anim-speed))) ) ) - (none) ) :post (the-as (function none :behavior mother-spider-egg) transform-post) ) ;; failed to figure out what this is: (defstate mother-spider-egg-on-ground (mother-spider-egg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (the-as object (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> event param 0)) - 0.7 - 6144.0 - 16384.0 - ) - ) - ) - (('attack) - (go mother-spider-egg-die) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (send-shove-back + (-> self root-override) + proc + (the-as touching-shapes-entry (-> block param 0)) + 0.7 + 6144.0 + 16384.0 + ) + ) + (('attack) + (go mother-spider-egg-die) + ) + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (if (not (draw-egg-shadow self (-> self shadow-pos) #t)) (set! (-> self shadow-pos quad) (-> self fall-dest quad)) ) - (none) ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) (go mother-spider-egg-hatch) ) (draw-egg-shadow self (-> self shadow-pos) #f) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -349,7 +342,6 @@ (ja :num! (seek! max (-> self anim-speed))) ) ) - (none) ) :post (the-as (function none :behavior mother-spider-egg) transform-post) ) @@ -370,7 +362,6 @@ ) ) ) - (none) ) :code (behavior () (send-event (ppointer->process (-> self parent-override)) 'trigger) @@ -398,7 +389,6 @@ ) 0 (go mother-spider-egg-die-exit) - (none) ) :post (the-as (function none :behavior mother-spider-egg) transform-post) ) @@ -431,7 +421,6 @@ (ja :num! (seek!)) ) (go mother-spider-egg-die-exit) - (none) ) :post (the-as (function none :behavior mother-spider-egg) ja-post) ) @@ -445,7 +434,6 @@ ) (eval-position! (-> self traj) f0-2 (-> self root-override trans)) ) - (none) ) :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) @@ -473,7 +461,6 @@ (ja :num! (seek!)) ) (go mother-spider-egg-die-exit) - (none) ) :post (the-as (function none :behavior mother-spider-egg) ja-post) ) @@ -493,7 +480,6 @@ (until (not (-> self child)) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc index b1705eb1004..dbff3431739 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc @@ -409,7 +409,6 @@ (sound-play "mother-hit") (suspend) (go-virtual projectile-die) - (none) ) ) @@ -433,6 +432,5 @@ ) (suspend) (go-virtual projectile-die) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc index d0f22906e5b..d7136376d98 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc @@ -136,7 +136,6 @@ (seek! (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame))) (set! (-> self root scale y) (-> self root scale x)) (set! (-> self root scale z) (-> self root scale x)) - (none) ) ) :code (behavior () @@ -156,7 +155,6 @@ (ja :num! (seek! max f30-0)) ) ) - (none) ) :post (the-as (function none :behavior mother-spider-leg) ja-post) ) @@ -168,7 +166,6 @@ (until (not (-> self child)) (suspend) ) - (none) ) :post (the-as (function none :behavior mother-spider) ja-post) ) @@ -840,27 +837,23 @@ (shut-down! (-> self neck)) (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self draw status) (draw-status hidden)) - (none) ) :exit (behavior () (restore-collide-with-as (-> self root-override)) (set! (-> self skel postbind-function) mother-spider-full-joint-callback) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (if (grab-player? self) (go mother-spider-traveling (the-as uint 1)) ) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -902,7 +895,6 @@ (set! (-> self mode) arg0) (set! (-> self hit?) #f) (set! (-> self going-up?) (< (-> self targ-dist-from-anchor) (-> self dist-from-anchor))) - (none) ) :trans (behavior () (let ((gp-0 (is-player-stuck? self)) @@ -957,7 +949,6 @@ ) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior ((arg0 uint)) (local-vars (v1-12 symbol) (v1-28 symbol)) @@ -984,7 +975,6 @@ ) (ja :group! mother-spider-lowering-ja :num! min) ) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -994,14 +984,12 @@ :event mother-spider-default-event-handler :enter (behavior () (set! (-> self hit?) #f) - (none) ) :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-tracking) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1025,7 +1013,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -1037,7 +1024,6 @@ (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self last-player-in-air-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (-> self hit?) @@ -1102,7 +1088,6 @@ ) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior () (cond @@ -1124,7 +1109,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -1134,7 +1118,6 @@ :event mother-spider-default-event-handler :enter (behavior () (set! (-> self hit?) #f) - (none) ) :trans (behavior () (if (-> self hit?) @@ -1145,7 +1128,6 @@ (go mother-spider-tracking) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1162,7 +1144,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -1173,14 +1154,12 @@ :enter (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-tracking) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.25)) @@ -1240,7 +1219,6 @@ (go mother-spider-tracking) (go mother-spider-traveling (the-as uint 2)) ) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -1251,7 +1229,6 @@ :enter (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (-> self hit?) @@ -1281,7 +1258,6 @@ (go mother-spider-birth-baby) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior () (cond @@ -1303,7 +1279,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -1314,7 +1289,6 @@ :enter (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (-> self hit?) @@ -1327,7 +1301,6 @@ (go mother-spider-birthing) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.25)) @@ -1352,7 +1325,6 @@ ) ) (go mother-spider-birthing) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -1446,7 +1418,6 @@ :event mother-spider-default-event-handler :enter (behavior () (set! (-> self hit?) #f) - (none) ) :trans (behavior () (if (-> self hit?) @@ -1456,7 +1427,6 @@ (go mother-spider-birthing) ) (mother-spider-method-29 self #t #t) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1473,7 +1443,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior mother-spider) transform-post) ) @@ -1509,11 +1478,9 @@ ) ) ) - (none) ) :trans (behavior () (mother-spider-method-29 self #f #f) - (none) ) :code (behavior () (let ((v1-2 (-> self entity extra perm))) @@ -1529,7 +1496,6 @@ (ja :num! (seek!)) ) (go mother-spider-die-wait-for-children) - (none) ) :post (the-as (function none :behavior mother-spider) ja-post) ) @@ -1539,7 +1505,6 @@ :event mother-spider-death-event-handler :trans (behavior () (mother-spider-method-29 self #f #f) - (none) ) :code (behavior () (let ((v1-2 (-> self entity extra perm))) @@ -1556,7 +1521,6 @@ (ja :num! (seek!)) ) (go mother-spider-die-wait-for-children) - (none) ) :post (the-as (function none :behavior mother-spider) ja-post) ) @@ -1573,7 +1537,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/spiderwebs_REF.gc b/test/decompiler/reference/jak1/levels/maincave/spiderwebs_REF.gc index 0b96a594aa0..7e9b0d31a55 100644 --- a/test/decompiler/reference/jak1/levels/maincave/spiderwebs_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/spiderwebs_REF.gc @@ -105,7 +105,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -126,7 +125,6 @@ (ja :num! (seek!)) ) (go spiderwebs-idle) - (none) ) :post (the-as (function none :behavior spiderwebs) transform-post) ) diff --git a/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc b/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc index b036b9b4ff4..099527b331a 100644 --- a/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc @@ -46,7 +46,6 @@ nav-enemy-default-event-handler ) (go-virtual nav-enemy-patrol) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -57,7 +56,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) (anim-loop) - (none) ) :post (the-as (function none :behavior babak-with-cannon) #f) ) @@ -94,7 +92,6 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-notice) ) ) - (none) ) :code (-> (method-of-type babak nav-enemy-patrol) code) ) @@ -109,7 +106,6 @@ nav-enemy-default-event-handler (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self nav destination-pos quad) (-> self entity extra trans quad)) (set! (-> self nav target-pos quad) (-> self entity extra trans quad)) - (none) ) :trans (behavior () (if (nav-enemy-notice-player?) @@ -118,7 +114,6 @@ nav-enemy-default-event-handler (if (logtest? (nav-control-flags navcf19) (-> self nav flags)) (go babak-with-cannon-jump-onto-cannon) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -129,11 +124,9 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) ) - (none) ) :post (behavior () (nav-enemy-travel-post) - (none) ) ) @@ -198,7 +191,6 @@ nav-enemy-default-event-handler ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -260,7 +252,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) (go babak-with-cannon-shooting) - (none) ) :post (the-as (function none :behavior babak-with-cannon) nav-enemy-jump-post) ) @@ -273,7 +264,6 @@ nav-enemy-default-event-handler ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -295,7 +285,6 @@ nav-enemy-default-event-handler (set-current-poly! (-> self nav) a1-6) ) (go-virtual nav-enemy-jump-land) - (none) ) :post (the-as (function none :behavior babak-with-cannon) nav-enemy-jump-post) ) @@ -313,7 +302,6 @@ nav-enemy-default-event-handler (logior! (-> v1-2 extra perm status) (entity-perm-status complete)) ) ) - (none) ) :exit (behavior () (let ((v1-0 (entity-actor-lookup (-> self entity) 'alt-actor 0))) @@ -321,7 +309,6 @@ nav-enemy-default-event-handler (logclear! (-> v1-0 extra perm status) (entity-perm-status complete)) ) ) - (none) ) :trans (behavior () (let ((f0-1 (- (-> (target-pos 0) y) (-> self collide-info trans y)))) @@ -335,13 +322,11 @@ nav-enemy-default-event-handler (go babak-with-cannon-jump-off-cannon) ) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post babak-with-cannon-ride-cannon-post ) @@ -365,7 +350,6 @@ nav-enemy-default-event-handler (t9-3) ) ) - (none) ) ) @@ -405,7 +389,6 @@ nav-enemy-default-event-handler ) ) (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc index cc39ce6d8d7..824263a6c39 100644 --- a/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc @@ -690,6 +690,7 @@ ;; definition for function balloonlurker-post ;; INFO: Used lq/sq +;; INFO: Return type mismatch object vs none. (defbehavior balloonlurker-post balloonlurker () (set! (-> self anim-frame) (ja-frame-num 0)) (cond @@ -778,7 +779,6 @@ :trans (behavior () (ja :num! (loop!)) (set! (-> self anim-frame) (ja-frame-num 0)) - (none) ) :code (behavior () (when (not (ja-group? balloonlurker-idle-ja)) @@ -788,7 +788,6 @@ ) (ja-post) (anim-loop) - (none) ) :post balloonlurker-post ) @@ -827,7 +826,6 @@ (go balloonlurker-die) (go balloonlurker-patrol) ) - (none) ) :post balloonlurker-post ) @@ -839,7 +837,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self vulnerable) #f) (set! (-> self dead) #t) - (none) ) :code (behavior () (local-vars (v1-27 symbol) (sv-16 symbol) (sv-20 (pointer process-tree)) (sv-24 entity-actor)) @@ -892,7 +889,6 @@ (while (-> self child) (suspend) ) - (none) ) :post balloonlurker-post ) @@ -920,8 +916,8 @@ ;; failed to figure out what this is: (defstate balloonlurker-pilot-idle (balloonlurker-pilot) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (send-event (ppointer->process (-> self parent-override)) 'die) (go balloonlurker-pilot-die) @@ -936,14 +932,12 @@ (suspend) (ja :num-func num-func-identity :frame-num (-> self parent-override 0 anim-frame)) ) - (none) ) :post (behavior () (set! (-> self root-override trans quad) (-> self parent-override 0 root-overlay trans quad)) (quaternion-copy! (-> self root-override quat) (-> self parent-override 0 root-overlay quat)) (update-transforms! (-> self root-override)) (ja-post) - (none) ) ) @@ -978,7 +972,6 @@ (ja :num! (seek!)) ) (cleanup-for-death self) - (none) ) :post (behavior () (vector-v++! @@ -987,7 +980,6 @@ ) (integrate-no-collide! (-> self root-override) (-> self root-override transv)) (ja-post) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc index 93ea55d4ce8..2a07bde3469 100644 --- a/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc @@ -49,19 +49,18 @@ ;; definition for method 44 of type bonelurker ;; INFO: Return type mismatch symbol vs object. (defmethod touch-handler bonelurker ((obj bonelurker) (arg0 process) (arg1 event-message-block)) - (the-as object (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) - ) - (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (set! (-> obj speed-scale) 0.5) - #t - ) - ) - ) + (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) + ) + (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) + (set! (-> obj speed-scale) 0.5) + #t + ) + ) ) ;; definition for method 43 of type bonelurker @@ -75,45 +74,42 @@ (set! (-> a1-1 message) 'query) (set! (-> a1-1 param 0) (the-as uint 'powerup)) (set! (-> a1-1 param 1) (the-as uint 2)) - (the-as - object - (cond - ((or (send-event-function *target* a1-1) (= (-> arg1 param 1) 'explode)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj nav-enemy-die)) - 'die - ) - (else - (cond - (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 2) - ) - (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) - (go bonelurker-stun) - #t - ) - ((and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) - (= (-> obj skel root-channel 0) (-> obj skel channel)) - (let ((v1-30 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-30 (-> obj draw art-group data 9)) (= v1-30 (-> obj draw art-group data 10))) - ) - ) - (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) - (set! (-> obj bump-player-time) (-> *display* base-frame-counter)) - (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) - 'push - ) + (cond + ((or (send-event-function *target* a1-1) (= (-> arg1 param 1) 'explode)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (go (method-of-object obj nav-enemy-die)) + 'die + ) + (else + (cond + (((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 2) ) + (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) + (go bonelurker-stun) + #t + ) + ((and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) + (= (-> obj skel root-channel 0) (-> obj skel channel)) + (let ((v1-30 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (or (= v1-30 (-> obj draw art-group data 9)) (= v1-30 (-> obj draw art-group data 10))) + ) + ) + (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) + (set! (-> obj bump-player-time) (-> *display* base-frame-counter)) + (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + 'push + ) ) ) ) @@ -124,18 +120,17 @@ ;; definition for function bonelurker-stunned-event-handler ;; INFO: Return type mismatch symbol vs object. (defbehavior bonelurker-stunned-event-handler bonelurker ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('attack) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (nav-enemy-set-hit-from-direction arg0) - (send-event arg0 'get-attack-count 1) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual nav-enemy-die) - 'die - ) - ) - ) - ) + (case arg2 + (('attack) + (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (nav-enemy-set-hit-from-direction arg0) + (send-event arg0 'get-attack-count 1) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual nav-enemy-die) + 'die + ) + ) + ) ) ;; failed to figure out what this is: @@ -181,12 +176,10 @@ nav-enemy-default-event-handler ) :exit (behavior () (bonelurker-set-large-bounds-sphere) - (none) ) :code (behavior () (bonelurker-set-small-bounds-sphere) ((the-as (function none :behavior bonelurker) (-> (method-of-type nav-enemy nav-enemy-idle) code))) - (none) ) ) @@ -200,7 +193,6 @@ nav-enemy-default-event-handler :code (behavior () (ja-channel-push! 1 (seconds 0.2)) ((the-as (function none :behavior bonelurker) (-> (method-of-type nav-enemy nav-enemy-patrol) code))) - (none) ) ) @@ -228,7 +220,6 @@ nav-enemy-default-event-handler ) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) ) - (none) ) :code (behavior () (set! (-> self rotate-speed) 524288.0) @@ -293,7 +284,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) ) @@ -356,7 +346,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) ) @@ -410,7 +399,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -429,11 +417,9 @@ nav-enemy-default-event-handler :event bonelurker-stunned-event-handler :enter (behavior () (nav-enemy-neck-control-inactive) - (none) ) :exit (behavior () (nav-enemy-neck-control-look-at) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -448,7 +434,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-chase) - (none) ) :post bonelurker-push-post ) diff --git a/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc index 2921cd8a894..484b6cd9c1e 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc @@ -165,27 +165,26 @@ ;; definition for function keg-event-handler ;; INFO: Return type mismatch none vs object. (defbehavior keg-event-handler keg ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('touch 'attack) - (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) - (sound-play "icrate-break") - (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 71) - 20 - #f - #f - #f - (-> self root-override trans) - :to *entity-pool* - ) - (sound-stop (-> self sound-id)) - (deactivate self) - ) - ) - ) - ) + (case arg2 + (('touch 'attack) + (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + (sound-play "icrate-break") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 71) + 20 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* + ) + (sound-stop (-> self sound-id)) + (deactivate self) + ) + ) + ) ) ;; definition for function keg-post @@ -204,8 +203,8 @@ ;; failed to figure out what this is: (defstate keg-on-paddle (keg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('detach) (go keg-paddle-to-path) ) @@ -223,7 +222,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (suspend) ) - (none) ) :post (the-as (function none :behavior keg) keg-post) ) @@ -259,7 +257,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior keg) keg-post) ) @@ -376,7 +373,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior keg) keg-post) ) @@ -417,7 +413,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior keg) keg-post) ) @@ -428,7 +423,6 @@ :code (behavior () (sound-stop (-> self sound-id)) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior keg) transform-post) ) @@ -511,7 +505,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior keg-conveyor) ja-post) ) @@ -578,7 +571,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior keg-conveyor-paddle) transform-post) ) diff --git a/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc index a4addc44d56..74b64e0ee75 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc @@ -1093,7 +1093,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior boatpaddle) ja-post) ) @@ -1166,7 +1165,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior windturbine) ja-post) ) @@ -1278,7 +1276,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior mis-bone-bridge) transform-post) ) @@ -1294,7 +1291,6 @@ (ja :num! (seek!)) ) (go mis-bone-bridge-idle) - (none) ) :post (the-as (function none :behavior mis-bone-bridge) rider-post) ) @@ -1314,7 +1310,6 @@ (ja :num! (seek!)) ) (go mis-bone-bridge-idle) - (none) ) :post (the-as (function none :behavior mis-bone-bridge) rider-post) ) @@ -1348,7 +1343,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior mis-bone-bridge) rider-post) ) @@ -1458,8 +1452,8 @@ ;; failed to figure out what this is: (defstate breakaway-idle (breakaway) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (send-event proc 'no-look-around (seconds 1.5)) (go breakaway-about-to-fall) @@ -1503,7 +1497,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior breakaway) rider-post) ) @@ -1525,7 +1518,6 @@ ) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior breakaway) rider-post) ) @@ -1747,13 +1739,11 @@ :virtual #t :enter (behavior () (ja-channel-set! 0) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior bone-platform) ja-post) ) @@ -1783,7 +1773,6 @@ (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1792,7 +1781,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior bone-platform) rigid-body-platform-post) ) @@ -1969,7 +1957,6 @@ ) ) (go-virtual battlecontroller-active) - (none) ) ) @@ -2051,8 +2038,8 @@ ;; failed to figure out what this is: (defstate boat-fuelcell-idle (boat-fuelcell) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('task-complete) (set! (-> self play-cutscene?) #t) (process-entity-status! self (entity-perm-status complete) #t) @@ -2088,7 +2075,6 @@ (suspend) ) (go boat-fuelcell-die) - (none) ) ) @@ -2096,7 +2082,6 @@ (defstate boat-fuelcell-die (boat-fuelcell) :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/misty/misty-teetertotter_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-teetertotter_REF.gc index 9ad21a21292..180e73b4763 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-teetertotter_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-teetertotter_REF.gc @@ -47,10 +47,10 @@ ;; failed to figure out what this is: (defstate teetertotter-idle (teetertotter) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (case (-> event param 1) + (case (-> block param 1) (('flop) (when (target-on-end-of-teetertotter? self) (set! (-> self in-launch-window) #f) @@ -73,45 +73,41 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior teetertotter) transform-post) ) ;; failed to figure out what this is: (defstate teetertotter-launch (teetertotter) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (when (= event-type 'touch) - (if (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (= message 'touch) + (if (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape-moving (-> self root)) + (the-as uint 1) + ) + (-> self rock-is-dangerous) + ) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'deadly)))) + ) + (when (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape-moving (-> self root)) - (the-as uint 1) + (the-as uint 2) ) - (-> self rock-is-dangerous) + (target-on-end-of-teetertotter? self) + (not (-> self launched-player)) + (-> self in-launch-window) ) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'deadly)))) - ) - (when (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) - (the-as collide-shape-moving (-> self root)) - (the-as uint 2) - ) - (target-on-end-of-teetertotter? self) - (not (-> self launched-player)) - (-> self in-launch-window) - ) - (when (send-event - proc - 'shove - #f - (static-attack-info ((shove-back (meters 0)) (shove-up (meters 13)) (angle 'jump) (control 1.0))) - ) - (let ((v0-0 #t)) - (set! (-> self launched-player) v0-0) - v0-0 - ) + (when (send-event + proc + 'shove + #f + (static-attack-info ((shove-back (meters 0)) (shove-up (meters 13)) (angle 'jump) (control 1.0))) + ) + (let ((v0-0 #t)) + (set! (-> self launched-player) v0-0) + v0-0 ) ) ) @@ -131,7 +127,6 @@ (ja :num! (seek!)) ) (go teetertotter-idle) - (none) ) :post (the-as (function none :behavior teetertotter) rider-post) ) @@ -145,7 +140,6 @@ (ja :num! (seek!)) ) (go teetertotter-idle) - (none) ) :post (the-as (function none :behavior teetertotter) rider-post) ) diff --git a/test/decompiler/reference/jak1/levels/misty/misty-warehouse_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-warehouse_REF.gc index 993520fc15a..f151ff93ee7 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-warehouse_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-warehouse_REF.gc @@ -35,8 +35,8 @@ ;; failed to figure out what this is: (defstate silostep-idle (silostep) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go silostep-camera) ) @@ -51,7 +51,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior silostep) ja-post) ) @@ -105,7 +104,6 @@ (sound-play "arena-steps") (send-to-all-after (-> self link) 'trigger-rise) (go silostep-rise #f) - (none) ) :post (the-as (function none :behavior silostep) ja-post) ) @@ -129,7 +127,6 @@ (ja-post) (suspend) ) - (none) ) :post (the-as (function none :behavior silostep) #f) ) diff --git a/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc b/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc index 5882182ae99..9d10e105136 100644 --- a/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc @@ -713,8 +713,8 @@ ;; failed to figure out what this is: (defstate mistycannon-missile-idle (mistycannon-missile) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (go mistycannon-missile-explode) ) @@ -724,13 +724,11 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self sfx) (the-as uint 0)) 0 - (none) ) :trans (behavior () (if (< (-> self root-override trans y) (-> self water-height)) (go mistycannon-missile-in-water) ) - (none) ) :code (behavior () (clear-collide-with-as (-> self root-override)) @@ -805,7 +803,6 @@ (ja :num! (seek!)) ) (go mistycannon-missile-explode) - (none) ) :post (behavior () (vector-v++! @@ -842,7 +839,6 @@ ) ) (ja-post) - (none) ) ) @@ -881,15 +877,14 @@ (goto cfg-3) ) (ja-channel-set! 0) - (none) ) :post (the-as (function none :behavior mistycannon-missile) ja-post) ) ;; failed to figure out what this is: (defstate mistycannon-missile-explode (mistycannon-missile) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (let* ((s4-0 proc) (v1-2 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) process-drawable)) @@ -920,14 +915,14 @@ ) (cond ((= (-> proc type) target) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'explode)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'explode)))) ) (else (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) self) (set! (-> a1-4 num-params) 4) (set! (-> a1-4 message) 'attack) - (set! (-> a1-4 param 0) (-> event param 0)) + (set! (-> a1-4 param 0) (-> block param 0)) (set! (-> a1-4 param 1) (the-as uint 'explode)) (let ((v1-18 (+ *global-attack-id* 1))) (set! *global-attack-id* v1-18) @@ -974,7 +969,6 @@ ) (kill-and-free-particles (-> self part2)) (deactivate self) - (none) ) :post (the-as (function none :behavior mistycannon-missile) ja-post) ) @@ -1364,14 +1358,12 @@ (go mistycannon-aim-at-player) ) (rider-trans) - (none) ) :code (behavior () (loop (mistycannon-method-23 self) (suspend) ) - (none) ) :post (the-as (function none :behavior mistycannon) rider-post) ) @@ -1567,7 +1559,6 @@ (defstate mistycannon-aim-at-player (mistycannon) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) @@ -1581,7 +1572,6 @@ (go mistycannon-idle) ) (rider-trans) - (none) ) :code (behavior () (loop @@ -1592,18 +1582,17 @@ (mistycannon-method-23 self) (suspend) ) - (none) ) :post (the-as (function none :behavior mistycannon) rider-post) ) ;; failed to figure out what this is: (defstate mistycannon-waiting-for-player (mistycannon) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self root-override) (the-as uint 1) ) @@ -1623,7 +1612,6 @@ (go mistycannon-aim-at-player) ) (rider-trans) - (none) ) :code (behavior () (set! (-> self player-touching-grips?) #f) @@ -1666,7 +1654,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior mistycannon) rider-post) ) @@ -1679,13 +1666,11 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (loop @@ -1700,14 +1685,13 @@ ) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate mistycannon-player-control (mistycannon) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode) (send-event *camera* 'change-state cam-mistycannon 0) ) @@ -1716,12 +1700,10 @@ :exit (behavior () (sound-stop (-> self sound-id)) (sound-stop (-> self aim-sound-id)) - (none) ) :trans (behavior () (mistycannon-method-23 self) (rider-trans) - (none) ) :code (behavior () (send-event *camera* 'change-state cam-mistycannon 0) @@ -1793,33 +1775,30 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior mistycannon) rider-post) ) ;; failed to figure out what this is: (defstate mistycannon-waiting-for-player-to-fuck-off (mistycannon) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) - (-> self root-override) - (the-as uint 1) - ) - (let ((v0-0 (-> *display* base-frame-counter))) - (set! (-> self state-time) v0-0) - v0-0 - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self root-override) + (the-as uint 1) + ) + (let ((v0-0 (-> *display* base-frame-counter))) + (set! (-> self state-time) v0-0) + v0-0 + ) + ) + ) + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (the-as (function none :behavior mistycannon) rider-trans) :code (behavior () @@ -1830,7 +1809,6 @@ (go mistycannon-waiting-for-player) ) ) - (none) ) :post (the-as (function none :behavior mistycannon) rider-post) ) diff --git a/test/decompiler/reference/jak1/levels/misty/muse_REF.gc b/test/decompiler/reference/jak1/levels/misty/muse_REF.gc index fbe80e6113b..693bb6f52ba 100644 --- a/test/decompiler/reference/jak1/levels/misty/muse_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/muse_REF.gc @@ -228,7 +228,6 @@ nav-enemy-default-event-handler (if (and *target* (>= 81920.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (go-virtual nav-enemy-chase) ) - (none) ) :code (behavior () (when (ja-group? muse-run-ja) @@ -250,7 +249,6 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior muse) ja-post) ) @@ -264,7 +262,6 @@ nav-enemy-default-event-handler ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (cond @@ -288,7 +285,6 @@ nav-enemy-default-event-handler ) (seek! (-> self sprint-distance) 0.0 (* 4096.0 (-> *display* seconds-per-frame))) (muse-check-dest-point) - (none) ) :code (behavior () (cond @@ -311,7 +307,6 @@ nav-enemy-default-event-handler (suspend) (ja :num! (loop! (* 0.000016276043 (-> self momentum-speed)))) ) - (none) ) :post (behavior () (set! (-> self nav destination-pos quad) (-> self dest-point quad)) @@ -326,7 +321,6 @@ nav-enemy-default-event-handler (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (nav-enemy-travel-post) - (none) ) ) @@ -340,7 +334,6 @@ nav-enemy-default-event-handler :enter (behavior () ((-> (method-of-type nav-enemy nav-enemy-jump) enter)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) - (none) ) :code (-> (method-of-type nav-enemy nav-enemy-jump) code) ) @@ -362,7 +355,6 @@ nav-enemy-default-event-handler (ja :num! (seek! max 0.8)) ) (go-virtual nav-enemy-chase) - (none) ) ) @@ -371,7 +363,6 @@ nav-enemy-default-event-handler :event (the-as (function process int symbol event-message-block object :behavior muse) #f) :trans (behavior () (spool-push *art-control* (-> self anim name) 0 self -1.0) - (none) ) :code (behavior () (sound-play "money-pickup") @@ -448,14 +439,12 @@ nav-enemy-default-event-handler ) ) ) - (none) ) :post (behavior () (nav-enemy-method-51 self) (level-hint-surpress!) (kill-current-level-hint '() '() 'exit) (ja-post) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc index e2af67e2f0f..2244491563b 100644 --- a/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc @@ -317,19 +317,19 @@ ;; failed to figure out what this is: (defstate quicksandlurker-missile-idle (quicksandlurker-missile) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (when (cond ((= (-> proc type) target) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'explode)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'explode)))) ) (else (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) self) (set! (-> a1-4 num-params) 4) (set! (-> a1-4 message) 'attack) - (set! (-> a1-4 param 0) (-> event param 0)) + (set! (-> a1-4 param 0) (-> block param 0)) (set! (-> a1-4 param 1) (the-as uint 'explode)) (let ((v1-12 (+ *global-attack-id* 1))) (set! *global-attack-id* v1-12) @@ -348,7 +348,6 @@ ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior () (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) @@ -377,11 +376,9 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (behavior () (update-transforms! (-> self root-override)) - (none) ) ) @@ -405,7 +402,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -622,11 +618,9 @@ :event (the-as (function process int symbol event-message-block object :behavior quicksandlurker) #f) :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (if (and *target* @@ -634,13 +628,11 @@ ) (go quicksandlurker-wait) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior quicksandlurker) ja-post) ) @@ -666,7 +658,6 @@ (seek! (-> self y-offset) 1228.8 (* 20480.0 (-> *display* seconds-per-frame))) ) ) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -699,7 +690,6 @@ (suspend) ) ) - (none) ) :post quicksandlurker-post ) @@ -714,7 +704,6 @@ (ja :num! (seek!)) ) (go quicksandlurker-wait) - (none) ) :post quicksandlurker-post ) @@ -729,7 +718,6 @@ (go quicksandlurker-wait) ) (quicksandlurker-check-hide-transition) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -758,7 +746,6 @@ (suspend) ) ) - (none) ) :post quicksandlurker-post ) @@ -811,7 +798,6 @@ ) ) (go quicksandlurker-track) - (none) ) :post quicksandlurker-post ) @@ -839,7 +825,6 @@ ) ) (go quicksandlurker-track) - (none) ) :post quicksandlurker-post ) @@ -849,11 +834,9 @@ :event quicksandlurker-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (behavior () (restore-collide-with-as (-> self root-override)) - (none) ) :trans (behavior () (if (not *target*) @@ -877,7 +860,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -902,7 +884,6 @@ (orient-to-face-target) (suspend) ) - (none) ) :post quicksandlurker-post ) @@ -929,7 +910,6 @@ (ja :num! (seek!)) ) (go quicksandlurker-track) - (none) ) :post quicksandlurker-post ) @@ -949,7 +929,6 @@ (ja :num! (seek!)) ) (cleanup-for-death self) - (none) ) :post quicksandlurker-post ) diff --git a/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc b/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc index 553564fbf37..91ac10ebf6d 100644 --- a/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc @@ -1492,8 +1492,8 @@ ;; failed to figure out what this is: (defstate play-anim (sequenceB) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('offset-army) (dotimes (gp-0 9) (let ((v1-3 (-> *lurker-army* gp-0))) @@ -1598,12 +1598,10 @@ 'play-anim ) ) - (none) ) :trans (behavior () (spool-push *art-control* "sidekick-human-intro-sequence-c" 0 self (the-as float -1.0)) ((-> (method-of-type process-taskable play-anim) trans)) - (none) ) ) @@ -1779,12 +1777,10 @@ ) ((-> (method-of-type process-taskable play-anim) exit)) (start 'play (get-continue-by-name *game-info* "village1-intro")) - (none) ) :trans (behavior () (spool-push *art-control* "sage-intro-sequence-d1" 0 self (the-as float -1.0)) ((-> (method-of-type process-taskable play-anim) trans)) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc b/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc index 34bc78ddfec..efc64fdfeea 100644 --- a/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc @@ -161,23 +161,21 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior plunger-lurker) ja-post) ) ;; failed to figure out what this is: (defstate plunger-lurker-flee (plunger-lurker) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('attack) - (let ((v0-0 #t)) - (set! (-> self got-hit) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((v0-0 #t)) + (set! (-> self got-hit) v0-0) + v0-0 + ) + ) + ) ) :trans (behavior () (when (-> self got-hit) @@ -204,7 +202,6 @@ (cleanup-for-death self) (deactivate self) ) - (none) ) :code (behavior () (ja-no-eval :group! plunger-lurker-notice-ja :num! (seek!) :frame-num 0.0) @@ -220,15 +217,14 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior plunger-lurker) ja-post) ) ;; failed to figure out what this is: (defstate plunger-lurker-idle (plunger-lurker) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('plunge) (logclear! (-> self mask) (process-mask actor-pause)) (go plunger-lurker-plunge) @@ -241,7 +237,6 @@ (logclear! (-> self mask) (process-mask actor-pause)) (go plunger-lurker-flee) ) - (none) ) :code (behavior () (loop @@ -251,7 +246,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior plunger-lurker) ja-post) ) @@ -263,7 +257,6 @@ (deactivate self) (suspend) 0 - (none) ) ) @@ -484,7 +477,6 @@ :code (behavior () (cleanup-for-death self) (deactivate self) - (none) ) ) @@ -496,7 +488,6 @@ (loop (suspend) ) - (none) ) ) @@ -637,109 +628,107 @@ ;; failed to figure out what this is: (defstate flying-lurker-fly (flying-lurker) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('clone-and-kill-links) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'sleep) - (let ((t9-0 send-event-function) - (v1-3 (-> self link next)) - ) - (t9-0 - (if v1-3 - (-> v1-3 extra process) - ) - a1-1 - ) - ) - ) - (go flying-lurker-clone (the-as handle (-> event param 0)) "") - ) - (('die) - (let ((v1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-7 from) proc) - (set! (-> v1-7 num-params) arg1) - (set! (-> v1-7 message) event-type) - (set! (-> v1-7 param 0) (-> event param 0)) - (set! (-> v1-7 param 1) (-> event param 1)) - (set! (-> v1-7 param 2) (-> event param 2)) - (set! (-> v1-7 param 3) (-> event param 3)) - (set! (-> v1-7 param 4) (-> event param 4)) - (set! (-> v1-7 param 5) (-> event param 5)) - (set! (-> v1-7 param 6) (-> event param 6)) - (let ((t9-2 send-event-function) - (a1-3 (-> self link next)) - ) - (t9-2 - (if a1-3 - (-> a1-3 extra process) - ) - v1-7 - ) - ) - ) - (cleanup-for-death self) - (the-as object (deactivate self)) - ) - (('sleep) - (let ((v1-12 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-12 from) proc) - (set! (-> v1-12 num-params) arg1) - (set! (-> v1-12 message) event-type) - (set! (-> v1-12 param 0) (-> event param 0)) - (set! (-> v1-12 param 1) (-> event param 1)) - (set! (-> v1-12 param 2) (-> event param 2)) - (set! (-> v1-12 param 3) (-> event param 3)) - (set! (-> v1-12 param 4) (-> event param 4)) - (set! (-> v1-12 param 5) (-> event param 5)) - (set! (-> v1-12 param 6) (-> event param 6)) - (let ((t9-5 send-event-function) - (a1-5 (-> self link next)) - ) - (t9-5 - (if a1-5 - (-> a1-5 extra process) - ) - v1-12 - ) - ) - ) - (go flying-lurker-sleep) - ) - (('reset) - (let ((v1-15 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-15 from) proc) - (set! (-> v1-15 num-params) arg1) - (set! (-> v1-15 message) event-type) - (set! (-> v1-15 param 0) (-> event param 0)) - (set! (-> v1-15 param 1) (-> event param 1)) - (set! (-> v1-15 param 2) (-> event param 2)) - (set! (-> v1-15 param 3) (-> event param 3)) - (set! (-> v1-15 param 4) (-> event param 4)) - (set! (-> v1-15 param 5) (-> event param 5)) - (set! (-> v1-15 param 6) (-> event param 6)) - (let ((t9-7 send-event-function) - (a1-7 (-> self link next)) - ) - (t9-7 - (if a1-7 - (-> a1-7 extra process) - ) - v1-15 - ) - ) - ) - (the-as object (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('clone-and-kill-links) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'sleep) + (let ((t9-0 send-event-function) + (v1-3 (-> self link next)) + ) + (t9-0 + (if v1-3 + (-> v1-3 extra process) + ) + a1-1 + ) + ) + ) + (go flying-lurker-clone (the-as handle (-> block param 0)) "") + ) + (('die) + (let ((v1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-7 from) proc) + (set! (-> v1-7 num-params) argc) + (set! (-> v1-7 message) message) + (set! (-> v1-7 param 0) (-> block param 0)) + (set! (-> v1-7 param 1) (-> block param 1)) + (set! (-> v1-7 param 2) (-> block param 2)) + (set! (-> v1-7 param 3) (-> block param 3)) + (set! (-> v1-7 param 4) (-> block param 4)) + (set! (-> v1-7 param 5) (-> block param 5)) + (set! (-> v1-7 param 6) (-> block param 6)) + (let ((t9-2 send-event-function) + (a1-3 (-> self link next)) + ) + (t9-2 + (if a1-3 + (-> a1-3 extra process) + ) + v1-7 + ) + ) + ) + (cleanup-for-death self) + (deactivate self) + ) + (('sleep) + (let ((v1-12 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-12 from) proc) + (set! (-> v1-12 num-params) argc) + (set! (-> v1-12 message) message) + (set! (-> v1-12 param 0) (-> block param 0)) + (set! (-> v1-12 param 1) (-> block param 1)) + (set! (-> v1-12 param 2) (-> block param 2)) + (set! (-> v1-12 param 3) (-> block param 3)) + (set! (-> v1-12 param 4) (-> block param 4)) + (set! (-> v1-12 param 5) (-> block param 5)) + (set! (-> v1-12 param 6) (-> block param 6)) + (let ((t9-5 send-event-function) + (a1-5 (-> self link next)) + ) + (t9-5 + (if a1-5 + (-> a1-5 extra process) + ) + v1-12 + ) + ) + ) + (go flying-lurker-sleep) + ) + (('reset) + (let ((v1-15 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-15 from) proc) + (set! (-> v1-15 num-params) argc) + (set! (-> v1-15 message) message) + (set! (-> v1-15 param 0) (-> block param 0)) + (set! (-> v1-15 param 1) (-> block param 1)) + (set! (-> v1-15 param 2) (-> block param 2)) + (set! (-> v1-15 param 3) (-> block param 3)) + (set! (-> v1-15 param 4) (-> block param 4)) + (set! (-> v1-15 param 5) (-> block param 5)) + (set! (-> v1-15 param 6) (-> block param 6)) + (let ((t9-7 send-event-function) + (a1-7 (-> self link next)) + ) + (t9-7 + (if a1-7 + (-> a1-7 extra process) + ) + v1-15 + ) + ) + ) + (deactivate self) + ) + ) ) :enter (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (flying-lurker-method-20 self) @@ -771,7 +760,6 @@ ) ) ) - (none) ) :code (behavior () (loop @@ -799,7 +787,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior flying-lurker) ja-post) ) @@ -991,7 +978,6 @@ :event flying-lurker-handler :exit (behavior () (remove-setting! 'allow-progress) - (none) ) :code (behavior () (when (play-movie?) @@ -1026,128 +1012,122 @@ ) ) ) - (none) ) :post (the-as (function none :behavior flying-lurker) ja-post) ) ;; failed to figure out what this is: (defstate flying-lurker-clone (flying-lurker) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'die) - (let ((v1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-1 from) proc) - (set! (-> v1-1 num-params) arg1) - (set! (-> v1-1 message) event-type) - (set! (-> v1-1 param 0) (-> event param 0)) - (set! (-> v1-1 param 1) (-> event param 1)) - (set! (-> v1-1 param 2) (-> event param 2)) - (set! (-> v1-1 param 3) (-> event param 3)) - (set! (-> v1-1 param 4) (-> event param 4)) - (set! (-> v1-1 param 5) (-> event param 5)) - (set! (-> v1-1 param 6) (-> event param 6)) - (let ((t9-0 send-event-function) - (a1-1 (-> self link next)) - ) - (t9-0 - (if a1-1 - (-> a1-1 extra process) - ) - v1-1 - ) - ) - ) - (cleanup-for-death self) - (the-as object (deactivate self)) - ) - ((= v1-0 'sleep) - (let ((v1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-6 from) proc) - (set! (-> v1-6 num-params) arg1) - (set! (-> v1-6 message) event-type) - (set! (-> v1-6 param 0) (-> event param 0)) - (set! (-> v1-6 param 1) (-> event param 1)) - (set! (-> v1-6 param 2) (-> event param 2)) - (set! (-> v1-6 param 3) (-> event param 3)) - (set! (-> v1-6 param 4) (-> event param 4)) - (set! (-> v1-6 param 5) (-> event param 5)) - (set! (-> v1-6 param 6) (-> event param 6)) - (let ((t9-3 send-event-function) - (a1-3 (-> self link next)) - ) - (t9-3 - (if a1-3 - (-> a1-3 extra process) - ) - v1-6 - ) - ) - ) - (go flying-lurker-sleep) - ) - ((= v1-0 'reset) - (let ((v1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-9 from) proc) - (set! (-> v1-9 num-params) arg1) - (set! (-> v1-9 message) event-type) - (set! (-> v1-9 param 0) (-> event param 0)) - (set! (-> v1-9 param 1) (-> event param 1)) - (set! (-> v1-9 param 2) (-> event param 2)) - (set! (-> v1-9 param 3) (-> event param 3)) - (set! (-> v1-9 param 4) (-> event param 4)) - (set! (-> v1-9 param 5) (-> event param 5)) - (set! (-> v1-9 param 6) (-> event param 6)) - (let ((t9-5 send-event-function) - (a1-5 (-> self link next)) - ) - (t9-5 - (if a1-5 - (-> a1-5 extra process) - ) - v1-9 - ) - ) - ) - (the-as object (deactivate self)) - ) - (else - (flying-lurker-handler proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (let ((v1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-1 from) proc) + (set! (-> v1-1 num-params) argc) + (set! (-> v1-1 message) message) + (set! (-> v1-1 param 0) (-> block param 0)) + (set! (-> v1-1 param 1) (-> block param 1)) + (set! (-> v1-1 param 2) (-> block param 2)) + (set! (-> v1-1 param 3) (-> block param 3)) + (set! (-> v1-1 param 4) (-> block param 4)) + (set! (-> v1-1 param 5) (-> block param 5)) + (set! (-> v1-1 param 6) (-> block param 6)) + (let ((t9-0 send-event-function) + (a1-1 (-> self link next)) + ) + (t9-0 + (if a1-1 + (-> a1-1 extra process) + ) + v1-1 + ) + ) + ) + (cleanup-for-death self) + (deactivate self) + ) + (('sleep) + (let ((v1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-6 from) proc) + (set! (-> v1-6 num-params) argc) + (set! (-> v1-6 message) message) + (set! (-> v1-6 param 0) (-> block param 0)) + (set! (-> v1-6 param 1) (-> block param 1)) + (set! (-> v1-6 param 2) (-> block param 2)) + (set! (-> v1-6 param 3) (-> block param 3)) + (set! (-> v1-6 param 4) (-> block param 4)) + (set! (-> v1-6 param 5) (-> block param 5)) + (set! (-> v1-6 param 6) (-> block param 6)) + (let ((t9-3 send-event-function) + (a1-3 (-> self link next)) + ) + (t9-3 + (if a1-3 + (-> a1-3 extra process) + ) + v1-6 + ) + ) + ) + (go flying-lurker-sleep) + ) + (('reset) + (let ((v1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-9 from) proc) + (set! (-> v1-9 num-params) argc) + (set! (-> v1-9 message) message) + (set! (-> v1-9 param 0) (-> block param 0)) + (set! (-> v1-9 param 1) (-> block param 1)) + (set! (-> v1-9 param 2) (-> block param 2)) + (set! (-> v1-9 param 3) (-> block param 3)) + (set! (-> v1-9 param 4) (-> block param 4)) + (set! (-> v1-9 param 5) (-> block param 5)) + (set! (-> v1-9 param 6) (-> block param 6)) + (let ((t9-5 send-event-function) + (a1-5 (-> self link next)) + ) + (t9-5 + (if a1-5 + (-> a1-5 extra process) + ) + v1-9 + ) + ) + ) + (deactivate self) + ) + (else + (flying-lurker-handler proc argc message block) + ) ) ) :exit (behavior () (ja-channel-set! 0) - (none) ) :code (behavior ((arg0 handle) (arg1 string)) (clone-anim arg0 3 #t arg1) - (none) ) ) ;; failed to figure out what this is: (defstate flying-lurker-idle (flying-lurker) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('saw-player) (set! (-> self take-off) #t) (when (-> self link prev) (entity-birth-no-kill (-> self link prev)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) proc) - (set! (-> a1-1 num-params) arg1) - (set! (-> a1-1 message) event-type) - (set! (-> a1-1 param 0) (-> event param 0)) - (set! (-> a1-1 param 1) (-> event param 1)) - (set! (-> a1-1 param 2) (-> event param 2)) - (set! (-> a1-1 param 3) (-> event param 3)) - (set! (-> a1-1 param 4) (-> event param 4)) - (set! (-> a1-1 param 5) (-> event param 5)) - (set! (-> a1-1 param 6) (-> event param 6)) + (set! (-> a1-1 num-params) argc) + (set! (-> a1-1 message) message) + (set! (-> a1-1 param 0) (-> block param 0)) + (set! (-> a1-1 param 1) (-> block param 1)) + (set! (-> a1-1 param 2) (-> block param 2)) + (set! (-> a1-1 param 3) (-> block param 3)) + (set! (-> a1-1 param 4) (-> block param 4)) + (set! (-> a1-1 param 5) (-> block param 5)) + (set! (-> a1-1 param 6) (-> block param 6)) (let ((t9-1 send-event-function) (v1-13 (-> self link prev)) ) @@ -1168,8 +1148,8 @@ (set! (-> a1-2 from) self) (set! (-> a1-2 num-params) 2) (set! (-> a1-2 message) 'clone) - (set! (-> a1-2 param 0) (-> event param 0)) - (set! (-> a1-2 param 1) (+ (-> event param 1) -1)) + (set! (-> a1-2 param 0) (-> block param 0)) + (set! (-> a1-2 param 1) (+ (-> block param 1) -1)) (let ((t9-3 send-event-function) (v1-25 (-> self link next)) ) @@ -1182,30 +1162,28 @@ ) ) ) - (case (-> event param 1) + (case (-> block param 1) ((2) - (go flying-lurker-clone (the-as handle (-> event param 0)) "flying-lurker-b-") + (go flying-lurker-clone (the-as handle (-> block param 0)) "flying-lurker-b-") ) ((1) - (go flying-lurker-clone (the-as handle (-> event param 0)) "flying-lurker-c-") + (go flying-lurker-clone (the-as handle (-> block param 0)) "flying-lurker-c-") ) ) ) (else - (flying-lurker-handler proc arg1 event-type event) + (flying-lurker-handler proc argc message block) ) ) ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (spool-push *art-control* "flying-lurker-intro" 0 self -99.0) (if (and (-> self take-off) (first?)) (go flying-lurker-start) ) - (none) ) :code (behavior () (local-vars (gp-0 int) (f30-0 float)) @@ -1259,7 +1237,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior flying-lurker) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc b/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc index 908f9015e25..4c7efefb9b3 100644 --- a/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc @@ -363,15 +363,14 @@ (suspend) (cleanup-for-death self) (deactivate self) - (none) ) ) ;; failed to figure out what this is: (defstate idle (tntbarrel) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die-big) (go-virtual die #t) ) @@ -379,7 +378,7 @@ (go-virtual die #f) ) (('attack 'touch) - (send-event proc 'attack-invinc (-> event param 0) (static-attack-info ((mode 'death)))) + (send-event proc 'attack-invinc (-> block param 0) (static-attack-info ((mode 'death)))) (go-virtual die #f) ) ) @@ -389,7 +388,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -500,18 +498,17 @@ ;; failed to figure out what this is: (defstate rigid-body-platform-idle (ogre-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('trigger) - (set! (-> self triggered) (the-as entity-actor #t)) - (set! (-> self delay) (the-as time-frame (-> event param 0))) - (let ((v0-0 (-> *display* base-frame-counter))) - (set! (-> self state-time) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (set! (-> self triggered) (the-as entity-actor #t)) + (set! (-> self delay) (the-as time-frame (-> block param 0))) + (let ((v0-0 (-> *display* base-frame-counter))) + (set! (-> self state-time) v0-0) + v0-0 + ) + ) + ) ) :trans (behavior () (cond @@ -532,14 +529,12 @@ ) ) ) - (none) ) :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (loop (suspend) ) - (none) ) :post (the-as (function none :behavior ogre-plat) ja-post) ) @@ -568,14 +563,12 @@ (seek! (-> self float-height-offset) (-> self float-y-offset) (* 32768.0 (-> *display* seconds-per-frame))) ) ) - (none) ) :code (behavior () (logclear! (-> self draw status) (draw-status hidden)) (loop (suspend) ) - (none) ) :post (the-as (function none :behavior ogre-plat) rigid-body-platform-post) ) @@ -1024,7 +1017,6 @@ (defstate ogre-bridge-idle (ogre-bridge) :exit (behavior () (ogre-bridge-update-joints) - (none) ) :trans (behavior () (if (and (and *target* @@ -1035,14 +1027,12 @@ (go ogre-bridge-activate) ) 0 - (none) ) :code (behavior () (ja-post) (loop (suspend) ) - (none) ) ) @@ -1072,15 +1062,14 @@ (ja :num! (seek!)) ) (go ogre-bridge-activated) - (none) ) :post (the-as (function none :behavior ogre-bridge) rider-post) ) ;; failed to figure out what this is: (defstate ogre-bridge-activated (ogre-bridge) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('break) (+! (-> self dead-joint-count) 4) (go ogre-bridge-break) @@ -1100,38 +1089,36 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior ogre-bridge) ja-post) ) ;; failed to figure out what this is: (defstate ogre-bridge-break (ogre-bridge) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('effect) - (when (= (-> event param 0) 'splash) - (let ((gp-0 (new 'stack-no-clear 'vector))) - (let ((a1-1 (-> event param 2))) - (set! (-> gp-0 quad) (-> self node-list data a1-1 bone transform vector 3 quad)) - ) - (set! (-> gp-0 y) 118784.0) - (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 466) - -1 - #f - #f - #f - gp-0 - :to *entity-pool* - ) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('effect) + (when (= (-> block param 0) 'splash) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((a1-1 (-> block param 2))) + (set! (-> gp-0 quad) (-> self node-list data a1-1 bone transform vector 3 quad)) + ) + (set! (-> gp-0 y) 118784.0) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 466) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* + ) + ) + ) + ) + ) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) @@ -1140,7 +1127,6 @@ (ja :num! (seek!)) ) (go ogre-bridge-idle) - (none) ) :post (the-as (function none :behavior ogre-bridge) rider-post) ) @@ -1380,7 +1366,6 @@ :code (behavior () (transform-post) (anim-loop) - (none) ) ) @@ -1431,8 +1416,8 @@ ;; failed to figure out what this is: (defstate water-vol-idle (ogre-lava) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('submerge1) (set! (-> self anim) 3) (go-virtual water-vol-idle) @@ -1454,7 +1439,7 @@ (go-virtual water-vol-idle) ) (else - ((-> (method-of-type water-anim water-vol-idle) event) proc arg1 event-type event) + ((-> (method-of-type water-anim water-vol-idle) event) proc argc message block) ) ) ) @@ -1473,7 +1458,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior ogre-lava) #f) ) @@ -1485,7 +1469,6 @@ (set! (-> self idle-anim) 2) (set! (-> self anim) (-> self idle-anim)) (go-virtual water-vol-idle) - (none) ) ) @@ -1660,17 +1643,16 @@ ) (cleanup-for-death self) (deactivate self) - (none) ) :post (the-as (function none :behavior shortcut-boulder) ja-post) ) ;; failed to figure out what this is: (defstate shortcut-boulder-idle (shortcut-boulder) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (if (and (>= arg1 2) (= (-> event param 1) 'eco-yellow)) + (if (and (>= argc 2) (= (-> block param 1) 'eco-yellow)) (go shortcut-boulder-break) ) ) @@ -1682,7 +1664,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc b/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc index ed853a38234..34be2e759b9 100644 --- a/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc @@ -109,7 +109,6 @@ (defstate ogreboss-missile-idle (ogreboss-missile) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -150,7 +149,6 @@ ) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior ogreboss-missile) transform-post) ) @@ -160,7 +158,6 @@ :post (behavior () (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) (transform-post) - (none) ) ) @@ -210,21 +207,21 @@ ;; failed to figure out what this is: (defstate ogreboss-missile-impact (ogreboss-missile) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (cond (#f (cond ((= (-> proc type) target) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'explode)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'explode)))) ) (else (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) self) (set! (-> a1-2 num-params) 4) (set! (-> a1-2 message) 'attack) - (set! (-> a1-2 param 0) (-> event param 0)) + (set! (-> a1-2 param 0) (-> block param 0)) (set! (-> a1-2 param 1) (the-as uint 'explode)) (let ((v1-12 (+ *global-attack-id* 1))) (set! *global-attack-id* v1-12) @@ -278,7 +275,7 @@ (the-as rgba (new 'static 'rgba :g #xff :a #x80)) ) (when (>= f30-0 0.0) - (send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'damage)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'damage)))) (send-event (ppointer->process (-> self parent-override)) 'victory) ) ) @@ -331,7 +328,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior ogreboss-missile) ja-post) ) @@ -522,8 +518,8 @@ ;; failed to figure out what this is: (defstate ogreboss-super-boulder-idle (ogreboss-super-boulder) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('speedup) (set! (-> self speed) (* 1.3 (-> self speed))) ) @@ -543,7 +539,6 @@ ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :code (behavior () (ja :group! ogreboss-super-boulder-idle-ja :num! min) @@ -575,7 +570,6 @@ (sound-play "ogre-rock" :id (-> self sound-id) :position (the-as symbol (-> self joint transform))) (suspend) ) - (none) ) :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) @@ -619,7 +613,7 @@ (suspend) (ja :num! (seek!)) ) - (the-as object 0) + 0 ) ;; failed to figure out what this is: @@ -644,7 +638,6 @@ (ja :num! (seek!)) ) (go ogreboss-super-boulder-land) - (none) ) :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) @@ -656,7 +649,6 @@ (set! (-> self hit-boss) #t) (ogreboss-super-boulder-play-hit-anim) (go ogreboss-super-boulder-land) - (none) ) :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) @@ -673,7 +665,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) @@ -700,12 +691,10 @@ (ja :num! (seek! (ja-aframe (the-as float 100.0) 0))) ) (go ogreboss-super-boulder-roll) - (none) ) :post (behavior () (transform-post) 0 - (none) ) ) @@ -774,12 +763,10 @@ (ja :num! (seek!)) ) (cleanup-for-death self) - (none) ) :post (behavior () (transform-post) 0 - (none) ) ) @@ -806,7 +793,6 @@ (loop (suspend) ) - (none) ) ) @@ -941,7 +927,6 @@ ) ) (cleanup-for-death self) - (none) ) :post (behavior () (vector+*! (-> self root-override trans) (-> self src-pos) (-> self side-dir) (-> self side-pos)) @@ -955,7 +940,6 @@ (the-as float 0.0) (the-as float 409600.0) ) - (none) ) ) @@ -1209,7 +1193,6 @@ (send-event (ppointer->process gp-0) 'draw #t) ) ) - (none) ) :trans (behavior () (try-preload-stream *art-control* "$GAMCAM23" 0 self (the-as float -99.0)) @@ -1223,12 +1206,10 @@ ) ) ) - (none) ) :code (behavior () (ogreboss-reset-camera) (ogreboss-idle-loop) - (none) ) :post (the-as (function none :behavior ogreboss) ja-post) ) @@ -1271,7 +1252,6 @@ ) (set-setting! 'music 'ogreboss 0.0 0) (go ogreboss-wait-for-player) - (none) ) :post (the-as (function none :behavior ogreboss) ja-post) ) @@ -1287,11 +1267,9 @@ (go ogreboss-idle) ) ) - (none) ) :code (behavior () (ogreboss-idle-loop) - (none) ) :post (the-as (function none :behavior ogreboss) ja-post) ) @@ -1556,8 +1534,8 @@ ;; failed to figure out what this is: (defstate ogreboss-stage1 (ogreboss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('next-stage) (set! (-> self bridge-assembled) #t) (go ogreboss-stage2) @@ -1566,7 +1544,6 @@ ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (and (-> self bridge-assembled) @@ -1575,7 +1552,6 @@ ) (go ogreboss-stage2) ) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask enemy)) @@ -1663,7 +1639,6 @@ (ja :num! (seek!)) ) (go ogreboss-stage1) - (none) ) :post ogreboss-post ) @@ -1750,41 +1725,40 @@ ;; definition for function ogreboss-attack-event-handler ;; INFO: Return type mismatch symbol vs object. (defbehavior ogreboss-attack-event-handler ogreboss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('attack) - (when (-> self vulnerable) - (if ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 128) - ) - (ja :chan 1 :group! ogreboss-hit-crotch-ja :num! min :frame-interp 0.0) - (ja :chan 1 :group! ogreboss-hit-chest-ja :num! min :frame-interp 0.0) - ) - (set! (-> self hit-time) (-> *display* base-frame-counter)) - (let ((v1-17 (rand-vu-int-range 0 2))) - (cond - ((zero? v1-17) - (sound-play "ogre-grunt1" :position (the-as symbol (-> self root-override trans))) - ) - ((= v1-17 1) - (sound-play "ogre-grunt2" :position (the-as symbol (-> self root-override trans))) - ) - (else - (sound-play "ogre-grunt3" :position (the-as symbol (-> self root-override trans))) - ) - ) - ) - (+! (-> self hit-count) 1) - (if (>= (-> self hit-count) (-> self max-hit-count)) - (go ogreboss-stage3-hit) - ) - (send-event (handle->process (-> self boulder)) 'speedup) - ) - #t - ) - ) - ) + (case arg2 + (('attack) + (when (-> self vulnerable) + (if ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 128) + ) + (ja :chan 1 :group! ogreboss-hit-crotch-ja :num! min :frame-interp 0.0) + (ja :chan 1 :group! ogreboss-hit-chest-ja :num! min :frame-interp 0.0) + ) + (set! (-> self hit-time) (-> *display* base-frame-counter)) + (let ((v1-17 (rand-vu-int-range 0 2))) + (cond + ((zero? v1-17) + (sound-play "ogre-grunt1" :position (the-as symbol (-> self root-override trans))) + ) + ((= v1-17 1) + (sound-play "ogre-grunt2" :position (the-as symbol (-> self root-override trans))) + ) + (else + (sound-play "ogre-grunt3" :position (the-as symbol (-> self root-override trans))) + ) + ) + ) + (+! (-> self hit-count) 1) + (if (>= (-> self hit-count) (-> self max-hit-count)) + (go ogreboss-stage3-hit) + ) + (send-event (handle->process (-> self boulder)) 'speedup) + ) + #t + ) + ) ) ;; failed to figure out what this is: @@ -1792,11 +1766,9 @@ :event ogreboss-attack-event-handler :enter (behavior () (set! (-> self boulder) (the-as handle #f)) - (none) ) :trans (behavior () 0 - (none) ) :code (behavior () (ogreboss-set-stage2-camera) @@ -1836,7 +1808,6 @@ ) ) (go ogreboss-stage3-shuffle) - (none) ) :post ogreboss-post ) @@ -1862,12 +1833,10 @@ (set! (-> self max-hit-count) (the int (* 6.0 (-> self difficulty)))) (set! (-> self grow-time) (* 300.0 (+ (/ 10.0 (-> self difficulty)) (* -1.0 (-> self level))))) (set! (-> self boulder) (the-as handle #f)) - (none) ) :exit (behavior () (send-event *camera* 'point-of-interest #f) (set! (-> self vulnerable) #f) - (none) ) :trans (behavior () (let ((v1-1 (handle->process (-> self boulder)))) @@ -1882,7 +1851,6 @@ (send-event (handle->process (-> self boulder)) 'grow-faster) ) 0 - (none) ) :code (behavior () (set! (-> self shuffle-pos) 0.0) @@ -1969,12 +1937,10 @@ ) ) ) - (none) ) :post (behavior () (vector+*! (-> self root-override trans) (-> self far-pos) (-> self side-dir) (-> self shuffle-pos)) (ogreboss-post) - (none) ) ) @@ -2000,7 +1966,6 @@ ) (set! (-> self bridge-assembled) #f) (go ogreboss-stage1) - (none) ) :post (the-as (function none :behavior ogreboss) transform-post) ) @@ -2025,7 +1990,6 @@ (suspend) ) (go ogreboss-stage1) - (none) ) :post (the-as (function none :behavior ogreboss) transform-post) ) @@ -2071,7 +2035,6 @@ ) (ogreboss-trigger-steps) (go ogreboss-dead) - (none) ) ) @@ -2131,7 +2094,6 @@ ) ) (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc index b77ae1ad33b..92868792a5b 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc @@ -3,23 +3,23 @@ ;; failed to figure out what this is: (defstate target-racing-start (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) 'racer ) - ((and (= event-type 'get-pickup) (= (-> event param 0) 3)) + ((and (= message 'get-pickup) (= (-> block param 0) 3)) (if (>= (- (-> *display* base-frame-counter) (-> self racer boost-time)) (seconds 1)) - (send-event self 'boost (fmax 1.0 (fmin 2.0 (the-as float (-> event param 1))))) + (send-event self 'boost (fmax 1.0 (fmin 2.0 (the-as float (-> block param 1))))) ) ) (else - (case event-type + (case message (('end-mode) (go target-racing-get-off (process->handle proc)) ) (('touched) - (send-event proc 'attack (-> event param 0) 'racer 0 0) + (send-event proc 'attack (-> block param 0) 'racer 0 0) (when (and (type-type? (-> proc type) babak) (< 40960.0 (-> self control unknown-float01))) (let ((f0-5 (lerp-scale 16384.0 32768.0 (-> self control unknown-float01) 40960.0 (-> self racer transv-max)))) (go target-racing-jump f0-5 f0-5 #f) @@ -27,14 +27,14 @@ ) ) (('attack 'attack-or-shove 'attack-invinc) - (let ((v1-27 (the-as attack-info (-> event param 1)))) + (let ((v1-27 (the-as attack-info (-> block param 1)))) (if (not (and (logtest? (-> v1-27 mask) (attack-mask mode)) (or (= (-> v1-27 mode) 'burn) (= (-> v1-27 mode) 'burnup))) ) (target-attacked - event-type - (the-as attack-info (-> event param 1)) + message + (the-as attack-info (-> block param 1)) proc - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as (state symbol attack-info target) target-racing-hit) ) ) @@ -42,7 +42,7 @@ ) (('heat) (set! (-> self racer heat) - (fmax 0.0 (fmin (+ (-> self racer heat) (the-as float (-> event param 0))) (-> *RACER-bank* heat-max))) + (fmax 0.0 (fmin (+ (-> self racer heat) (the-as float (-> block param 0))) (-> *RACER-bank* heat-max))) ) ) (('boost) @@ -52,7 +52,7 @@ (set! (-> self racer boost-level) (seek (-> self racer boost-level) (-> *RACER-bank* boost-level-max) - (* (-> *RACER-bank* boost-level-inc) (the-as float (-> event param 0))) + (* (-> *RACER-bank* boost-level-inc) (the-as float (-> block param 0))) ) ) ) @@ -60,20 +60,20 @@ (go target-racing-smack (-> self control unknown-float01) #t) ) (('jump) - (go target-racing-jump (the-as float (-> event param 0)) (the-as float (-> event param 1)) #f) + (go target-racing-jump (the-as float (-> block param 0)) (the-as float (-> block param 1)) #f) ) (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('grab) (go target-racing-grab) ) ) ) (('clone-anim) - (go target-racing-clone-anim (process->handle (the-as process (-> event param 0)))) + (go target-racing-clone-anim (process->handle (the-as process (-> block param 0)))) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -135,7 +135,6 @@ (remove-setting! 'sound-flava) (target-exit) ) - (none) ) :code (behavior ((arg0 handle)) (target-exit) @@ -286,7 +285,6 @@ (set-twist! (-> self racer bottom-blade) (the-as float #f) (the-as float #f) (- (-> self racer bottom-rot))) (remove-exit) (go target-racing-get-on arg0) - (none) ) :post target-post ) @@ -320,12 +318,10 @@ :event (-> target-racing-start event) :enter (behavior () (set! (-> self control unknown-surface00) *racer-mods*) - (none) ) :exit (behavior () (target-racing-center-anim) ((-> target-racing-start exit)) - (none) ) :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) @@ -369,7 +365,6 @@ ) (set! (-> self racer turn-anim-targ) (* 20.0 (-> self racer mod-x))) (racer-buzz (+ 0.45 (* 1.7 (fabs (-> self racer slide-shift-x))))) - (none) ) :code (behavior () (cond @@ -483,14 +478,12 @@ (ja :num! (loop!)) ) ) - (none) ) :post (behavior () (if (= (-> self next-state name) 'target-racing) (set! (-> self racer racing-time) (-> *display* base-frame-counter)) ) (target-racing-post) - (none) ) ) @@ -528,13 +521,11 @@ ) ) ) - (none) ) :exit (behavior () (logclear! (-> self control root-prim prim-core action) (collide-action racer-grounded)) (set! (-> self racer hop?) #f) ((-> target-racing-start exit)) - (none) ) :trans (behavior () (set! (-> self control unknown-float123) @@ -602,7 +593,6 @@ (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1) (-> self control transv)) (set! (-> self racer shock-offset) (* 0.8 (-> self racer shock-offset))) (racer-buzz 0.4) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((a0-1 (if (< 0.1 (-> self racer hill-value)) @@ -612,7 +602,6 @@ ) (target-racing-jump-anim a0-1 (seconds 0.2)) ) - (none) ) :post (-> target-racing post) ) @@ -630,12 +619,10 @@ (set! (-> self control unknown-float123) (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float01))))) ) - (none) ) :exit (behavior () (logclear! (-> self control root-prim prim-core action) (collide-action racer-grounded)) ((-> target-racing-start exit)) - (none) ) :trans (behavior () (set! (-> self control unknown-float123) @@ -670,7 +657,6 @@ (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1) (-> self control transv)) (target-racing-smack-check) (racer-buzz 0.4) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (target-racing-land-anim arg2) @@ -685,7 +671,6 @@ (target-racing-turn-anim) (suspend) ) - (none) ) :post (-> target-racing post) ) @@ -710,16 +695,13 @@ (set! (-> self racer boost-output) 0.0) (set! (-> self racer boost-time) 0) 0 - (none) ) :exit (behavior () (set! (-> self racer heavy) #f) ((-> target-racing-start exit)) - (none) ) :trans (behavior () (set! (-> self racer turn-anim-targ) 0.0) - (none) ) :code (behavior ((arg0 float) (arg1 symbol)) (sound-play "zoomer-crash-2") @@ -735,7 +717,6 @@ (ja :num! (seek! max (lerp-scale 2.0 1.0 arg0 0.0 163840.0))) ) (go target-racing) - (none) ) :post (-> target-racing post) ) @@ -746,12 +727,10 @@ :enter (behavior () (set! (-> self control unknown-surface00) *racer-air-mods*) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (behavior () (logclear! (-> self control root-prim prim-core action) (collide-action racer-grounded)) ((-> target-racing-start exit)) - (none) ) :trans (behavior () (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) @@ -762,11 +741,9 @@ (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (logior! (-> self control root-prim prim-core action) (collide-action racer-grounded)) ) - (none) ) :code (behavior () (target-racing-jump-anim #f (seconds 0.1)) - (none) ) :post (-> target-racing post) ) @@ -797,14 +774,12 @@ ) ) ) - (none) ) :exit (behavior () (if (!= (-> self next-state name) 'target-racing-death) (logclear! (-> self state-flags) (state-flags being-attacked dying)) ) ((-> target-racing-start exit)) - (none) ) :code (behavior ((arg0 handle) (arg1 attack-info)) (target-timed-invulnerable (-> *TARGET-bank* hit-invulnerable-timeout) self) @@ -863,7 +838,6 @@ ) ) (go target-racing) - (none) ) :post target-no-stick-post ) @@ -881,7 +855,6 @@ ((-> target-racing-start exit)) (target-exit) (set! (-> self racer stick-off) #f) - (none) ) :code (behavior ((arg0 symbol)) (local-vars (v1-154 symbol)) @@ -1071,7 +1044,6 @@ ) ) (go target-stance) - (none) ) :post target-racing-post ) @@ -1169,7 +1141,6 @@ 0 ) (go target-racing) - (none) ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -1216,7 +1187,6 @@ ) (hide-hud-quick) (target-no-move-post) - (none) ) ) @@ -1256,7 +1226,6 @@ ) ) (go target-racing-get-off-jump arg0) - (none) ) :post target-racing-post ) @@ -1315,7 +1284,6 @@ (send-event *camera* 'ease-in) (ja-channel-set! 0) (go target-racing-get-off-hit-ground #f) - (none) ) :post (behavior () (let* ((f0-2 (deg-diff (-> self racer front-rot) (-> *RACER-bank* default-front-blade))) @@ -1389,7 +1357,6 @@ (set! (-> self racer bike-scale quad) (-> self control scale quad)) (hide-hud) (target-no-move-post) - (none) ) ) @@ -1400,7 +1367,6 @@ :trans (behavior () (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) ((-> target-hit-ground trans)) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-set! 1) @@ -1410,32 +1376,30 @@ (ja :num! (seek!)) ) (go target-stance) - (none) ) :post (behavior () (hide-hud) (target-post) - (none) ) ) ;; failed to figure out what this is: (defstate target-racing-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) (else - (case event-type + (case message (('end-mode) (go target-racing) ) (('clone-anim) - (go target-racing-clone-anim (process->handle (the-as process (-> event param 0)))) + (go target-racing-clone-anim (process->handle (the-as process (-> block param 0)))) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -1446,14 +1410,12 @@ (set! (-> self neck flex-blend) 0.0) (logior! (-> self state-flags) (state-flags invulnerable grabbed)) (set! (-> self racer stick-off) #t) - (none) ) :exit (behavior () (set! (-> self racer stick-off) #f) (logclear! (-> self state-flags) (state-flags invulnerable grabbed)) (logclear! (-> self water flags) (water-flags wt16)) ((-> target-racing-start exit)) - (none) ) :code (behavior () (when (not (ja-group? (-> self draw art-group data 123))) @@ -1468,18 +1430,17 @@ (set-forward-vel 0.0) (suspend) ) - (none) ) :post target-racing-post ) ;; failed to figure out what this is: (defstate target-racing-clone-anim (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) - ((-> target-racing-grab event) proc arg1 event-type event) + ((-> target-racing-grab event) proc argc message block) ) :enter (-> target-clone-anim enter) :exit (behavior () @@ -1489,7 +1450,6 @@ ((-> target-clone-anim exit)) ((-> target-racing-start exit)) (vector-reset! (-> self control transv)) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-vector11 y))) @@ -1497,7 +1457,6 @@ (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (clone-anim arg0 33 #t "") (go target-racing) - (none) ) :post (behavior () (racer-sounds) @@ -1506,6 +1465,5 @@ (quaternion-copy! (the-as quaternion (-> self racer bike-quat)) (-> self control quat)) (set! (-> self racer bike-scale quad) (-> self control scale quad)) (target-no-ja-move-post) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc index c6f83a215fd..8d83c7646b8 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc @@ -97,40 +97,36 @@ ;; failed to figure out what this is: (defstate wait-for-start (racer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-1 structure)) - (the-as - object - (case event-type - (('trans) - (vector+! (the-as vector (-> event param 0)) (-> self root-override trans) (-> self extra-trans)) - ) - (('notify) - (set! v0-1 #t) - (set! (-> self auto-get-off) (the-as symbol v0-1)) - v0-1 - ) - (('shadow) - (cond - ((-> event param 0) - (set! v0-1 (-> self shadow-backup)) - (set! (-> self draw shadow) (the-as shadow-geo v0-1)) - v0-1 - ) - (else - (set! (-> self draw shadow) #f) - #f - ) + (case message + (('trans) + (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + ) + (('notify) + (set! v0-1 #t) + (set! (-> self auto-get-off) (the-as symbol v0-1)) + v0-1 + ) + (('shadow) + (cond + ((-> block param 0) + (set! v0-1 (-> self shadow-backup)) + (set! (-> self draw shadow) (the-as shadow-geo v0-1)) + v0-1 + ) + (else + (set! (-> self draw shadow) #f) + #f ) ) - ) + ) ) ) :exit (behavior () (set! (-> self root-override root-prim prim-core action) (collide-action)) (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) 0 - (none) ) :code (behavior () (label cfg-0) @@ -216,7 +212,6 @@ (go-virtual wait-for-return) (go-virtual idle) ) - (none) ) ) @@ -227,7 +222,6 @@ :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (-> self path-target)) - (none) ) :exit (-> (method-of-type racer wait-for-start) exit) :code (behavior () @@ -275,7 +269,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior racer) ja-post) ) @@ -283,8 +276,8 @@ ;; failed to figure out what this is: (defstate pickup (racer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('draw) (ja-channel-set! 1) (ja :group! (-> self draw art-group data 3)) @@ -293,14 +286,14 @@ (transform-post) ) (('trans) - (vector+! (the-as vector (-> event param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) ) (('touch 'attack) #f ) (('shadow) (cond - ((-> event param 0) + ((-> block param 0) (let ((v0-1 (the-as object (-> self shadow-backup)))) (set! (-> self draw shadow) (the-as shadow-geo v0-1)) v0-1 @@ -316,7 +309,6 @@ ) :enter (behavior ((arg0 (state collectable))) ((the-as (function none :behavior racer) (-> arg0 enter))) - (none) ) :code (behavior ((arg0 (state collectable))) (ja-channel-set! 0) @@ -349,46 +341,41 @@ ) ) (go arg0) - (none) ) ) ;; failed to figure out what this is: (defstate wait-for-return (racer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (or (= event-type 'touch) (= event-type 'attack)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (or (= message 'touch) (= message 'attack)) (and (!= (-> self condition) 4) (send-event *target* 'end-mode)) ) (go-virtual pickup (the-as (state collectable) (method-of-object self idle))) ) - (the-as - object - (cond - ((= event-type 'trans) - (vector+! (the-as vector (-> event param 0)) (-> self root-override trans) (-> self extra-trans)) - ) - ((= event-type 'shadow) - (cond - ((-> event param 0) - (let ((v0-3 (the-as structure (-> self shadow-backup)))) - (set! (-> self draw shadow) (the-as shadow-geo v0-3)) - v0-3 - ) + (cond + ((= message 'trans) + (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + ) + ((= message 'shadow) + (cond + ((-> block param 0) + (let ((v0-3 (the-as structure (-> self shadow-backup)))) + (set! (-> self draw shadow) (the-as shadow-geo v0-3)) + v0-3 ) - (else - (set! (-> self draw shadow) #f) - #f - ) + ) + (else + (set! (-> self draw shadow) #f) + #f ) ) - ) + ) ) ) :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (the-as curve-control (-> self path-racer))) - (none) ) :code (behavior () (ja-channel-set! 0) @@ -400,7 +387,6 @@ (racer-effect) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/robocave/cave-trap_REF.gc b/test/decompiler/reference/jak1/levels/robocave/cave-trap_REF.gc index 5f099efadf5..211975a7bea 100644 --- a/test/decompiler/reference/jak1/levels/robocave/cave-trap_REF.gc +++ b/test/decompiler/reference/jak1/levels/robocave/cave-trap_REF.gc @@ -61,9 +61,9 @@ ;; failed to figure out what this is: (defstate spider-vent-idle (spider-vent) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('can-spawn?) (return (>= (- (-> *display* base-frame-counter) (-> self last-spawn-time)) (seconds 1))) v0-0 @@ -79,7 +79,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -269,13 +268,11 @@ ) ) ) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -284,7 +281,6 @@ :event cave-trap-default-event-handler :enter (behavior () (set! (-> self spawn-delay) (seconds 0.5)) - (none) ) :trans (behavior () (cond @@ -308,13 +304,11 @@ ) ) 0 - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -324,7 +318,6 @@ :code (behavior () (suspend) (go cave-trap-idle) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/robocave/spider-egg_REF.gc b/test/decompiler/reference/jak1/levels/robocave/spider-egg_REF.gc index eba0335d5d7..72d356ef237 100644 --- a/test/decompiler/reference/jak1/levels/robocave/spider-egg_REF.gc +++ b/test/decompiler/reference/jak1/levels/robocave/spider-egg_REF.gc @@ -48,36 +48,33 @@ ;; failed to figure out what this is: (defstate spider-egg-idle (spider-egg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (the-as object (case event-type - (('touch) - (the-as object (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> event param 0)) - 0.7 - 6144.0 - 16384.0 - ) - ) - ) - (('can-spawn?) - (return #t) - v0-0 - ) - (('notify-spawned) - (go spider-egg-hatch) - ) - (('attack) - (go spider-egg-die) - ) - ) - ) + (case message + (('touch) + (send-shove-back + (-> self root-override) + proc + (the-as touching-shapes-entry (-> block param 0)) + 0.7 + 6144.0 + 16384.0 + ) + ) + (('can-spawn?) + (return #t) + v0-0 + ) + (('notify-spawned) + (go spider-egg-hatch) + ) + (('attack) + (go spider-egg-die) + ) + ) ) :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :code (behavior ((arg0 symbol)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) @@ -116,16 +113,15 @@ (ja-channel-push! 1 (seconds 0.1)) ) ) - (none) ) :post (the-as (function none :behavior spider-egg) ja-post) ) ;; failed to figure out what this is: (defstate spider-egg-hatch (spider-egg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 symbol)) - (case event-type + (case message (('can-spawn?) (return (the-as object #f)) v0-0 @@ -158,16 +154,15 @@ (until (not (-> self child)) (suspend) ) - (none) ) :post (the-as (function none :behavior spider-egg) ja-post) ) ;; failed to figure out what this is: (defstate spider-egg-die (spider-egg) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 symbol)) - (case event-type + (case message (('can-spawn?) (return (the-as object #f)) v0-0 @@ -218,7 +213,6 @@ (until (not (-> self child)) (suspend) ) - (none) ) :post (the-as (function none :behavior spider-egg) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc index 2390cb87c49..e2ef3c6b872 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc @@ -421,7 +421,6 @@ :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-patrol) trans)) (fleeing-nav-enemy-adjust-nav-info) - (none) ) :code (-> (method-of-type nav-enemy nav-enemy-patrol) code) :post (-> (method-of-type nav-enemy nav-enemy-patrol) post) @@ -433,7 +432,6 @@ :enter (-> (method-of-type nav-enemy nav-enemy-notice) enter) :trans (behavior () (fleeing-nav-enemy-adjust-nav-info) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -460,7 +458,6 @@ ) ) (go-virtual nav-enemy-chase) - (none) ) :post (-> (method-of-type nav-enemy nav-enemy-notice) post) ) @@ -471,16 +468,13 @@ :enter (behavior () (logior! (-> self nav flags) (nav-control-flags navcf12)) ((-> (method-of-type nav-enemy nav-enemy-chase) enter)) - (none) ) :exit (behavior () (logclear! (-> self nav flags) (nav-control-flags navcf12)) - (none) ) :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) (fleeing-nav-enemy-adjust-nav-info) - (none) ) :code (-> (method-of-type nav-enemy nav-enemy-chase) code) :post (-> (method-of-type nav-enemy nav-enemy-chase) post) @@ -493,7 +487,6 @@ :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-stop-chase) trans)) (fleeing-nav-enemy-adjust-nav-info) - (none) ) :code (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) :post (-> (method-of-type nav-enemy nav-enemy-stop-chase) post) @@ -541,7 +534,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior fleeing-nav-enemy) nav-enemy-travel-post) ) @@ -662,7 +654,6 @@ (set! (-> self run-blend-interp) (-> gp-0 y)) ) (set! (-> self speed-adjust) 1.0) - (none) ) :code lightning-mole-run-code :post (the-as (function none :behavior lightning-mole) ja-post) @@ -675,7 +666,6 @@ (set-vector! (-> self debug-vector) 0.0 0.0 1.0 1.0) (set! (-> self saved-travel quad) (-> self debug-vector quad)) ((-> (method-of-type nav-enemy nav-enemy-chase) enter)) - (none) ) :trans (behavior () (when (cpad-pressed? 1 r3) @@ -683,7 +673,6 @@ (logclear! (-> *cpad-list* cpads 1 button0-rel 0) (pad-buttons r3)) (go lightning-mole-debug-run) ) - (none) ) :code lightning-mole-run-code :post (behavior () @@ -723,7 +712,6 @@ ) (camera-line-rel (-> self collide-info trans) (-> self nav travel) (new 'static 'vector4w :z #x80 :w #x80)) (camera-line (-> self collide-info trans) (-> self nav target-pos) (new 'static 'vector4w :z #x80 :w #x80)) - (none) ) ) @@ -737,7 +725,6 @@ (suspend) ) (deactivate self) - (none) ) ) @@ -746,7 +733,6 @@ :enter (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self collide-info)) - (none) ) :trans (behavior () (when (task-closed? (-> self entity extra perm task) (task-status need-introduction)) @@ -755,13 +741,11 @@ (restore-collide-with-as (-> self collide-info)) (go-virtual nav-enemy-idle) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) ) @@ -785,7 +769,6 @@ ) ) ) - (none) ) :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1)) @@ -818,7 +801,6 @@ (logclear! (-> *target* mask) (process-mask sleep)) ) (go lightning-mole-gone) - (none) ) :post lightning-mole-hole-post ) @@ -827,7 +809,6 @@ (defstate lightning-mole-head-for-hole (lightning-mole) :enter (behavior () (clear-collide-with-as (-> self collide-info)) - (none) ) :trans (behavior () (when (< (vector-vector-xz-distance *lightning-mole-hole* (-> self collide-info trans)) 61440.0) @@ -850,7 +831,6 @@ (if (< (vector-vector-distance (-> self collide-info trans) *lightning-mole-hole*) 40960.0) (go lightning-mole-dive) ) - (none) ) :code (-> (method-of-type fleeing-nav-enemy nav-enemy-chase) code) :post lightning-mole-hole-post @@ -861,11 +841,9 @@ :enter (behavior () (clear-collide-with-as (-> self collide-info)) ((-> (method-of-type fleeing-nav-enemy nav-enemy-chase) enter)) - (none) ) :exit (behavior () (restore-collide-with-as (-> self collide-info)) - (none) ) :trans (-> (method-of-type fleeing-nav-enemy nav-enemy-chase) trans) :code (behavior () @@ -878,7 +856,6 @@ ) ) (go-virtual nav-enemy-chase) - (none) ) :post (the-as (function none :behavior lightning-mole) nav-enemy-simple-post) ) @@ -898,7 +875,6 @@ (set! (-> self run-blend-interp) 0.0) (vector-! (-> self saved-travel) (-> self collide-info trans) (target-pos 0)) ((-> (method-of-type fleeing-nav-enemy nav-enemy-chase) enter)) - (none) ) :trans (behavior () (let ((s3-0 (new 'stack-no-clear 'vector)) @@ -954,7 +930,6 @@ ) ) ((-> (method-of-type fleeing-nav-enemy nav-enemy-chase) trans)) - (none) ) :code lightning-mole-run-code :post (the-as (function none :behavior lightning-mole) fleeing-nav-enemy-chase-post) @@ -968,7 +943,7 @@ (send-event arg0 'jump 32768.0 32768.0) (go lightning-mole-yelp) ) - (the-as object #t) + #t ) ;; definition for method 44 of type lightning-mole @@ -978,7 +953,7 @@ (send-event arg0 'jump 32768.0 32768.0) (go lightning-mole-yelp) ) - (the-as object #t) + #t ) ;; definition for symbol *lightning-mole-nav-enemy-info*, type nav-enemy-info @@ -1286,23 +1261,21 @@ ;; failed to figure out what this is: (defstate peeper-wait (peeper) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('hide) - (let ((v0-0 (-> *display* base-frame-counter))) - (set! (-> self state-time) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('hide) + (let ((v0-0 (-> *display* base-frame-counter))) + (set! (-> self state-time) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -1310,14 +1283,12 @@ ) (go peeper-up) ) - (none) ) :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (loop (suspend) ) - (none) ) :post (the-as (function none :behavior peeper) ja-post) ) @@ -1335,15 +1306,14 @@ ) (logior! (-> self draw status) (draw-status hidden)) (go peeper-wait) - (none) ) :post (the-as (function none :behavior peeper) ja-post) ) ;; failed to figure out what this is: (defstate peeper-down (peeper) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide) (go peeper-wait) ) @@ -1353,7 +1323,6 @@ (if (and *target* (>= 61440.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go peeper-wait) ) - (none) ) :code (behavior () (logior! (-> self draw status) (draw-status hidden)) @@ -1384,15 +1353,14 @@ ) ) (go peeper-up) - (none) ) :post (the-as (function none :behavior peeper) ja-post) ) ;; failed to figure out what this is: (defstate peeper-up (peeper) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide) (go peeper-hide) ) @@ -1403,13 +1371,11 @@ (stop! (-> self sound)) ) (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (if (and *target* (>= 61440.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go peeper-hide) ) - (none) ) :code (behavior () (loop @@ -1420,7 +1386,6 @@ ) (go peeper-down) ) - (none) ) :post (the-as (function none :behavior peeper) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc index 367d284d97c..580ae6606a4 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc @@ -189,7 +189,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior pusher) rider-post) ) @@ -223,7 +222,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior gorge-pusher) rider-post) ) @@ -365,7 +363,6 @@ (ja :num! (seek!)) ) (go dark-plant-idle) - (none) ) :post (the-as (function none :behavior dark-plant) ja-post) ) @@ -401,7 +398,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior dark-plant) ja-post) ) @@ -418,7 +414,6 @@ (ja :num! (seek!)) ) (go dark-plant-gone) - (none) ) :post (the-as (function none :behavior dark-plant) ja-post) ) @@ -474,7 +469,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior dark-plant) ja-post) ) @@ -497,7 +491,6 @@ (ja :num! (seek!)) ) (go dark-plant-idle) - (none) ) :post (the-as (function none :behavior dark-plant) ja-post) ) @@ -622,7 +615,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior happy-plant) ja-post) ) @@ -635,7 +627,6 @@ (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self mask) (process-mask actor-pause)) ) - (none) ) :code (behavior () (close-specific-task! (game-task rolling-plants) (task-status need-reminder)) @@ -695,7 +686,6 @@ ) (restore-collide-with-as (-> self root-override)) (go happy-plant-opened) - (none) ) :post (the-as (function none :behavior happy-plant) transform-post) ) @@ -718,7 +708,6 @@ ) ) ) - (none) ) :code (behavior () (clear-collide-with-as (-> self root-override)) @@ -729,7 +718,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior happy-plant) ja-post) ) @@ -933,8 +921,8 @@ ;; failed to figure out what this is: (defstate rolling-start-break (rolling-start) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('unbreak) (go rolling-start-whole) ) @@ -962,15 +950,14 @@ (deactivate self) ) ) - (none) ) :post (the-as (function none :behavior rolling-start) ja-post) ) ;; failed to figure out what this is: (defstate rolling-start-whole (rolling-start) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('break) (sound-play "cool-rolling-st") (go rolling-start-break #f) @@ -989,7 +976,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior rolling-start) ja-post) ) @@ -1177,7 +1163,6 @@ (send-event (ppointer->process (-> self parent)) 'aborted) ) ) - (none) ) ) @@ -1202,7 +1187,6 @@ (send-event (ppointer->process (-> self parent)) 'finished) ) ) - (none) ) ) @@ -1362,7 +1346,6 @@ (defstate gorge-start-race-finished (gorge-start) :trans (behavior () (gorge-trans) - (none) ) :code (behavior () (gorge-start-draw-time #t #t) @@ -1381,7 +1364,6 @@ ) ) (go gorge-start-idle) - (none) ) ) @@ -1389,7 +1371,6 @@ (defstate gorge-start-race-aborted (gorge-start) :trans (behavior () (gorge-trans) - (none) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1422,14 +1403,13 @@ (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) (send-event (ppointer->process (-> *hud-parts* money)) 'enable) (go gorge-start-idle) - (none) ) ) ;; failed to figure out what this is: (defstate gorge-start-racing (gorge-start) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('finished) (go gorge-start-race-finished) ) @@ -1494,7 +1474,6 @@ ) (sleep (-> self ticker) (seconds 6000)) (set-setting! 'sound-flava #f 40.0 (music-flava rolling-gorge)) - (none) ) :exit (behavior () (let* ((v1-0 (-> self child)) @@ -1511,7 +1490,6 @@ (send-event (handle->process (-> self end-banner)) 'break-and-die) (send-event (handle->process (-> self start-banner)) 'unbreak) (remove-setting! 'sound-flava) - (none) ) :trans (the-as (function none :behavior gorge-start) gorge-trans) :code (behavior () @@ -1526,7 +1504,6 @@ (go gorge-start-ready) ) ) - (none) ) ) @@ -1553,7 +1530,6 @@ ) ) ) - (none) ) ) @@ -1562,17 +1538,14 @@ :enter (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :exit (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) - (none) ) :trans (behavior () (gorge-start-launch-start-banner) (gorge-trans) - (none) ) :code (behavior () (loop @@ -1586,7 +1559,6 @@ (go gorge-start-ready) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc index 0afbc28c548..811ee2c80b2 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc @@ -607,53 +607,50 @@ ;; failed to figure out what this is: (defstate race-ring-active (race-ring) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 symbol)) - (the-as - object - (case event-type - (('notify) - (when (and (= (-> event param 0) 'die) (= proc (-> self part-track process 0))) - (cond - ((= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) - (set! (-> self part-track) (ppointer->handle (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 460) - -1 - race-ring-blue-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - :to self - ) + (case message + (('notify) + (when (and (= (-> block param 0) 'die) (= proc (-> self part-track process 0))) + (cond + ((= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 460) + -1 + race-ring-blue-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self ) - ) - (set! v0-0 #t) - (set! (-> self keep-part-track-alive) v0-0) - ) - (else - (set! (-> self part-track) (ppointer->handle (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 457) - -1 - race-ring-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - :to self - ) + ) + ) + (set! v0-0 #t) + (set! (-> self keep-part-track-alive) v0-0) + ) + (else + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 457) + -1 + race-ring-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self ) - ) - (set! v0-0 #t) - (set! (-> self keep-part-track-alive) v0-0) - ) + ) + ) + (set! v0-0 #t) + (set! (-> self keep-part-track-alive) v0-0) ) - v0-0 ) + v0-0 ) - ) + ) ) ) :enter (behavior () @@ -699,7 +696,6 @@ (set! (-> self old-hips quad) (-> (target-pos 26) quad)) (+! (-> self old-hips x) 1.0) (set! (-> self state-time) (-> *display* game-frame-counter)) - (none) ) :exit (behavior () (sound-play "close-racering") @@ -746,7 +742,6 @@ (process-entity-status! self (entity-perm-status bit-3) #f) ) ) - (none) ) :trans (behavior () (if (nonzero? (-> self sound)) @@ -801,7 +796,6 @@ (spool-push *art-control* "race-ring-anim" 0 self -99.0) ) ) - (none) ) :code (behavior () (loop @@ -953,7 +947,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior race-ring) ja-post) ) @@ -972,14 +965,13 @@ (go race-ring-active) ) ) - (none) ) ) ;; failed to figure out what this is: (defstate race-ring-idle (race-ring) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('activate) (logclear! (-> self mask) (process-mask actor-pause)) (go race-ring-active) @@ -993,7 +985,6 @@ (loop (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc index d033f312e6f..4e99746e42a 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc @@ -51,7 +51,6 @@ (suspend) (ja :num! (loop! 0.5)) ) - (none) ) ) @@ -344,7 +343,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robber) ja-post) ) @@ -354,7 +352,6 @@ :code (behavior () (cleanup-for-death self) (deactivate self) - (none) ) ) @@ -424,7 +421,6 @@ (suspend) ) (go robber-dead) - (none) ) :post (the-as (function none :behavior robber) transform-post) ) @@ -446,7 +442,6 @@ ) (go robber-flee) ) - (none) ) :code (behavior () (when (not (ja-group? (-> self draw art-group data 7))) @@ -462,7 +457,6 @@ (robber-rotate (the-as target #f) 1820.4445) (suspend) ) - (none) ) :post (the-as (function none :behavior robber) transform-post) ) @@ -472,11 +466,9 @@ :event robber-event-handler :enter (behavior () (set! (-> self y-offset-desired) -12288.0) - (none) ) :exit (behavior () (set! (-> self y-offset-desired) 0.0) - (none) ) :trans (behavior () (if (not (and *target* @@ -485,7 +477,6 @@ ) (go robber-got-away) ) - (none) ) :code (behavior () (loop @@ -521,7 +512,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior robber) transform-post) ) @@ -533,7 +523,6 @@ (set! (-> self near-timer) 3000) (set! (-> self far-time) (-> *display* base-frame-counter)) (set! (-> self y-offset-desired) 0.0) - (none) ) :trans (behavior () (if (not (and *target* @@ -557,7 +546,6 @@ (if (>= (- (-> *display* base-frame-counter) (-> self far-time)) (seconds 3)) (set! (-> self near-timer) (the-as int (-> self timeout))) ) - (none) ) :code (behavior () (loop @@ -593,7 +581,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior robber) transform-post) ) @@ -603,7 +590,6 @@ :event robber-event-handler :enter (behavior () (set! (-> self speed) 0.0) - (none) ) :trans (behavior () (if (and *target* @@ -613,7 +599,6 @@ ) (robber-rotate (the-as target #t) 182.04445) (robber-move) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -624,7 +609,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robber) transform-post) ) @@ -645,7 +629,6 @@ ) (go robber-flee) ) - (none) ) :code (behavior () (path-control-method-14 (-> self path) (-> self tangent) (-> self curve-position)) @@ -669,7 +652,6 @@ ) (go robber-flee) ) - (none) ) :post (the-as (function none :behavior robber) transform-post) ) @@ -679,7 +661,6 @@ :event robber-event-handler :enter (behavior () (set! (-> self speed) 0.0) - (none) ) :trans (behavior () (if (and *target* @@ -688,7 +669,6 @@ (go robber-initial-notice) ) (robber-move) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -699,7 +679,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior robber) transform-post) ) diff --git a/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc b/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc index ed399dd7357..af0dca86cf4 100644 --- a/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc @@ -399,108 +399,101 @@ ) ;; definition for function ice-cube-default-event-handler -;; INFO: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 98] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 176] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 194] (defbehavior ice-cube-default-event-handler ice-cube ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (case arg2 - (('attack) - (cond - ((and (= (-> arg0 type) target) - (= (-> self cprims-type) 2) - (not (send-event *target* 'query 'powerup (pickup-type eco-red))) - ) - (when (and (cond - ((= (-> arg0 type) target) - (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) - ) - (else - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 4) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (set! (-> a1-3 param 1) (the-as uint #f)) - (let ((v1-20 (+ *global-attack-id* 1))) - (set! *global-attack-id* v1-20) - (set! (-> a1-3 param 2) (the-as uint v1-20)) - ) - (set! (-> a1-3 param 3) (the-as uint 0)) - (send-event-function arg0 a1-3) + (case arg2 + (('attack) + (cond + ((and (= (-> arg0 type) target) + (= (-> self cprims-type) 2) + (not (send-event *target* 'query 'powerup (pickup-type eco-red))) + ) + (when (and (cond + ((= (-> arg0 type) target) + (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + ) + (else + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) self) + (set! (-> a1-3 num-params) 4) + (set! (-> a1-3 message) 'attack) + (set! (-> a1-3 param 0) (-> arg3 param 0)) + (set! (-> a1-3 param 1) (the-as uint #f)) + (let ((v1-20 (+ *global-attack-id* 1))) + (set! *global-attack-id* v1-20) + (set! (-> a1-3 param 2) (the-as uint v1-20)) ) + (set! (-> a1-3 param 3) (the-as uint 0)) + (send-event-function arg0 a1-3) ) ) - (= (-> arg0 type) target) ) - (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) - (level-hint-spawn (text-id snow-ice-cube-hint) "sksp0350" (the-as entity #f) *entity-pool* (game-task none)) - ) + (= (-> arg0 type) target) + ) + (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) + (level-hint-spawn (text-id snow-ice-cube-hint) "sksp0350" (the-as entity #f) *entity-pool* (game-task none)) ) - (else - (nav-enemy-set-hit-from-direction arg0) - (go ice-cube-shatter) - ) + ) + (else + (nav-enemy-set-hit-from-direction arg0) + (go ice-cube-shatter) ) ) - (('touch) - (when (and (cond - ((= (-> arg0 type) target) - (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) - ) - (else - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 4) - (set! (-> a1-7 message) 'attack) - (set! (-> a1-7 param 0) (-> arg3 param 0)) - (set! (-> a1-7 param 1) (the-as uint #f)) - (let ((v1-38 (+ *global-attack-id* 1))) - (set! *global-attack-id* v1-38) - (set! (-> a1-7 param 2) (the-as uint v1-38)) - ) - (set! (-> a1-7 param 3) (the-as uint 0)) - (send-event-function arg0 a1-7) + ) + (('touch) + (when (and (cond + ((= (-> arg0 type) target) + (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + ) + (else + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) self) + (set! (-> a1-7 num-params) 4) + (set! (-> a1-7 message) 'attack) + (set! (-> a1-7 param 0) (-> arg3 param 0)) + (set! (-> a1-7 param 1) (the-as uint #f)) + (let ((v1-38 (+ *global-attack-id* 1))) + (set! *global-attack-id* v1-38) + (set! (-> a1-7 param 2) (the-as uint v1-38)) ) + (set! (-> a1-7 param 3) (the-as uint 0)) + (send-event-function arg0 a1-7) ) ) - (= (-> arg0 type) target) ) - (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (let ((v0-3 (the-as none (logior (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))))) - (set! (-> self nav-enemy-flags) (the-as nav-enemy-flags v0-3)) - v0-3 - ) + (= (-> arg0 type) target) + ) + (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) + (let ((v0-3 (the-as object (logior (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))))) + (set! (-> self nav-enemy-flags) (the-as nav-enemy-flags v0-3)) + v0-3 ) ) - (('touched) - (when (!= (-> arg0 type) target) - (cond - ((= (-> arg0 type) target) - (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode #f)))) - ) - (else - (let ((a1-10 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-10 from) self) - (set! (-> a1-10 num-params) 4) - (set! (-> a1-10 message) 'attack) - (set! (-> a1-10 param 0) (-> arg3 param 0)) - (set! (-> a1-10 param 1) (the-as uint #f)) - (let ((v1-54 (+ *global-attack-id* 1))) - (set! *global-attack-id* v1-54) - (set! (-> a1-10 param 2) (the-as uint v1-54)) - ) - (set! (-> a1-10 param 3) (the-as uint 0)) - (send-event-function arg0 a1-10) + ) + (('touched) + (when (!= (-> arg0 type) target) + (cond + ((= (-> arg0 type) target) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode #f)))) + ) + (else + (let ((a1-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-10 from) self) + (set! (-> a1-10 num-params) 4) + (set! (-> a1-10 message) 'attack) + (set! (-> a1-10 param 0) (-> arg3 param 0)) + (set! (-> a1-10 param 1) (the-as uint #f)) + (let ((v1-54 (+ *global-attack-id* 1))) + (set! *global-attack-id* v1-54) + (set! (-> a1-10 param 2) (the-as uint v1-54)) ) + (set! (-> a1-10 param 3) (the-as uint 0)) + (send-event-function arg0 a1-10) ) ) ) ) - ) + ) ) ) @@ -808,12 +801,10 @@ (ja-post) (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self collide-info)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self collide-info)) - (none) ) :trans (behavior () (when (and *target* (>= 163840.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) @@ -828,13 +819,11 @@ ) ) ) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -849,7 +838,6 @@ (+! (-> self collide-info trans y) -12288.0) (set! (-> self collide-info transv quad) (-> *null-vector* quad)) (set! (-> self collide-info transv y) (rand-vu-float-range 102400.0 114688.0)) - (none) ) :trans (behavior () (when (and (< (-> self collide-info trans y) (-> self ground-y)) (< (-> self collide-info transv y) 0.0)) @@ -864,7 +852,6 @@ (vector<-cspace! gp-0 (-> s5-0 data (nav-enemy-rnd-int-count a0-2))) (spawn (-> self part2) gp-0) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -876,7 +863,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior ice-cube) nav-enemy-falling-post) ) @@ -901,7 +887,6 @@ (go ice-cube-become-mean) (go-virtual nav-enemy-idle) ) - (none) ) :post (the-as (function none :behavior ice-cube) ja-post) ) @@ -918,7 +903,6 @@ ) (set! (-> self draw force-lod) -1) (logior! (-> self mask) (process-mask actor-pause)) - (none) ) ) @@ -934,7 +918,6 @@ ) (set! (-> self draw force-lod) -1) (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -943,7 +926,6 @@ ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -958,7 +940,6 @@ (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (logclear! (-> self mask) (process-mask actor-pause)) (go ice-cube-face-player) - (none) ) :post (the-as (function none :behavior ice-cube) #f) ) @@ -983,7 +964,6 @@ (set! (-> self target-pt quad) (-> (target-pos 0) quad)) (nav-enemy-neck-control-look-at) (set-vector! (-> self collide-info transv) 0.0 114688.0 0.0 1.0) - (none) ) :code (behavior () (local-vars (gp-0 symbol)) @@ -1051,7 +1031,6 @@ (ja :num! (seek!)) ) (go ice-cube-become-mean) - (none) ) :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) @@ -1063,7 +1042,6 @@ (set! (-> self draw force-lod) 0) (logclear! (-> self mask) (process-mask actor-pause)) (nav-enemy-method-57 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1079,7 +1057,6 @@ ) ) (go ice-cube-mean-turn-to-charge) - (none) ) :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) @@ -1124,7 +1101,6 @@ (set! (-> self target-pt quad) (-> (target-pos 0) quad)) (nav-enemy-neck-control-look-at) (set-vector! (-> self collide-info transv) 0.0 114688.0 0.0 1.0) - (none) ) :code (behavior () (local-vars (gp-0 symbol)) @@ -1192,7 +1168,6 @@ (ja :num! (seek!)) ) (go ice-cube-mean-charge) - (none) ) :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) @@ -1227,12 +1202,10 @@ (set! (-> self starting-pos quad) (-> a0-6 quad)) ) (set! (-> self charge-angle) (quaternion-y-angle (-> self collide-info quat))) - (none) ) :exit (behavior () (logior! (-> self nav flags) (nav-control-flags navcf8)) (set-root-prim-collide-with! (-> self collide-info) (collide-kind target)) - (none) ) :trans (behavior () (when (or (not *target*) (logtest? (-> *target* state-flags) (state-flags do-not-notice))) @@ -1337,7 +1310,6 @@ #f #f ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1354,7 +1326,6 @@ (ja :num! (loop!)) (ja :chan 1 :num! (chan 0) :frame-interp (-> self anim-blend)) ) - (none) ) :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) @@ -1366,7 +1337,6 @@ (nav-enemy-method-58 self) (nav-enemy-neck-control-inactive) (go ice-cube-retract-spikes) - (none) ) ) @@ -1389,7 +1359,6 @@ ) ) (go ice-cube-tired) - (none) ) :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) @@ -1399,7 +1368,6 @@ :event ice-cube-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) @@ -1418,7 +1386,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1435,7 +1402,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) @@ -1496,6 +1462,5 @@ (until (not (-> self child)) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc index c89999c4c8b..e240670d7f2 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc @@ -177,14 +177,12 @@ (set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) (update-direction-from-time-of-day (-> self draw shadow-ctrl)) 0 - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior snow-ball-shadow) ja-post) ) @@ -436,24 +434,22 @@ ;; failed to figure out what this is: (defstate snow-ball-roller-idle (snow-ball-roller) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch 'attack) - (when (= (-> proc type) target) - (do-push-aways! (-> self root-override)) - (when (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.5)) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) - (the-as symbol (snow-ball-roller-method-22 self *target*)) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (when (= (-> proc type) target) + (do-push-aways! (-> self root-override)) + (when (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.5)) + (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (snow-ball-roller-method-22 self *target*) + ) + ) + ) + ) ) :enter (behavior () (set! (-> self last-bounce-time) (-> *display* base-frame-counter)) (snow-ball-roller-path-init) - (none) ) :exit (behavior () (set! (-> self rolling-sound-enabled?) #f) @@ -462,18 +458,15 @@ (set! (-> self rolling-sound-id) (new 'static 'sound-id)) 0 ) - (none) ) :trans (behavior () (snow-ball-roller-path-update) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior snow-ball-roller) transform-post) ) @@ -636,7 +629,6 @@ (label cfg-22) (suspend) (b! #t cfg-1 :delay (nop!)) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-bumper_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-bumper_REF.gc index 0bad9a07fe9..38452811e11 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-bumper_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-bumper_REF.gc @@ -160,7 +160,6 @@ (go snow-bumper-active-close-idle) ) 0 - (none) ) :code (behavior () (transform-post) @@ -169,17 +168,16 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate snow-bumper-active-close-idle (snow-bumper) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack 'bonk) (when (= (-> proc type) target) - (let ((gp-0 (-> event param 0))) + (let ((gp-0 (-> block param 0))) (when (and (>= 6144.0 (vector-vector-xz-distance (-> self root trans) (target-pos 0))) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry gp-0) @@ -220,7 +218,6 @@ ) (spawn (-> self part) (-> self root trans)) (update! (-> self sound)) - (none) ) :code (behavior () (transform-post) @@ -229,7 +226,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -238,7 +234,6 @@ :exit (behavior () (stop! (-> self sound)) (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (the-as (function none :behavior snow-bumper) rider-trans) :code (behavior () @@ -270,7 +265,6 @@ (go snow-bumper-spawn-fuel-cell) ) (go snow-bumper-inactive-idle) - (none) ) :post (the-as (function none :behavior snow-bumper) rider-post) ) @@ -295,7 +289,6 @@ (suspend) ) (go snow-bumper-inactive-idle) - (none) ) ) @@ -310,7 +303,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc index 8464cd8b77a..ca99af058d8 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc @@ -358,7 +358,6 @@ :virtual override :code (behavior () 0 - (none) ) :post (the-as (function none :behavior snow-bunny) transform-post) ) @@ -373,7 +372,6 @@ (t9-1) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -386,7 +384,6 @@ (ja :num! (loop! f30-0)) ) ) - (none) ) ) @@ -397,7 +394,6 @@ :trans (the-as (function none :behavior snow-bunny) #f) :code (behavior () (go-virtual snow-bunny-nav-resume) - (none) ) ) @@ -428,7 +424,6 @@ (go-virtual nav-enemy-idle) ) ) - (none) ) ) @@ -443,7 +438,6 @@ (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (set! (-> self state-timeout) (seconds 0.1)) - (none) ) :trans (behavior () (if (snow-bunny-method-57 self) @@ -463,7 +457,6 @@ ) ) (nav-enemy-method-58 self) - (none) ) :code (behavior () (let ((gp-0 (nav-enemy-rnd-int-count 3))) @@ -498,7 +491,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) @@ -650,16 +642,13 @@ (snow-bunny-method-76 self #t) (set! (-> self rotate-speed) 728177.75) (set! (-> self turn-time) (seconds 0.1)) - (none) ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) - (none) ) :trans (behavior () (nav-enemy-method-58 self) - (none) ) :code (behavior () (snow-bunny-execute-jump) @@ -672,7 +661,6 @@ (go-virtual snow-bunny-patrol-idle) (go-virtual snow-bunny-patrol-hop) ) - (none) ) :post (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) ) @@ -690,12 +678,10 @@ (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (snow-bunny-method-76 self #t) (set-vector! (-> self collide-info transv) 0.0 (nav-enemy-rnd-float-range 102400.0 131072.0) 0.0 1.0) - (none) ) :exit (the-as (function none :behavior snow-bunny) #f) :trans (behavior () (nav-enemy-method-58 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -739,7 +725,6 @@ ) ) (go-virtual nav-enemy-chase) - (none) ) :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) @@ -752,7 +737,6 @@ :trans (the-as (function none :behavior snow-bunny) #f) :code (behavior () (go-virtual snow-bunny-chase-hop) - (none) ) :post (the-as (function none :behavior snow-bunny) #f) ) @@ -852,19 +836,16 @@ (snow-bunny-method-76 self #t) (set! (-> self rotate-speed) 728177.75) (set! (-> self turn-time) (seconds 0.1)) - (none) ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) - (none) ) :trans (behavior () (if (snow-bunny-method-57 self) (set! (-> self should-retreat?) #t) ) (nav-enemy-method-58 self) - (none) ) :code (behavior () (snow-bunny-execute-jump) @@ -875,7 +856,6 @@ (go-virtual snow-bunny-defend) ) (go-virtual snow-bunny-chase-hop) - (none) ) :post (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) ) @@ -888,7 +868,6 @@ (go-virtual snow-bunny-retreat-hop) (go-virtual snow-bunny-lunge) ) - (none) ) ) @@ -1077,16 +1056,13 @@ (snow-bunny-method-76 self #t) (set! (-> self rotate-speed) 728177.75) (set! (-> self turn-time) (seconds 0.1)) - (none) ) :exit (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) - (none) ) :trans (behavior () (nav-enemy-method-58 self) - (none) ) :code (behavior () (snow-bunny-execute-jump) @@ -1094,7 +1070,6 @@ (set-current-poly! (-> self nav) (nav-control-method-16 (-> self nav) (-> self collide-info trans))) ) (go-virtual snow-bunny-retreat-hop) - (none) ) :post (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) ) @@ -1106,7 +1081,6 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (snow-bunny-method-76 self #f) - (none) ) :trans (behavior () (if (not *target*) @@ -1126,7 +1100,6 @@ ) (go-virtual snow-bunny-retreat-hop) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1137,7 +1110,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) @@ -1150,7 +1122,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set-vector! (-> self collide-info transv) 0.0 0.0 0.0 1.0) (snow-bunny-method-76 self #t) - (none) ) :trans (behavior () (when *target* @@ -1169,7 +1140,6 @@ #f #f ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1182,7 +1152,6 @@ (suspend) ) (go-virtual snow-bunny-retreat-hop) - (none) ) :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc index cedc2b65176..23142ad0442 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc @@ -264,9 +264,9 @@ ;; failed to figure out what this is: (defstate snow-button-up-idle (snow-button) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-2 object)) - (case event-type + (case message (('touch 'attack 'bonk) (when (and (= (-> proc type) target) (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)) @@ -290,15 +290,14 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) ;; failed to figure out what this is: (defstate snow-button-activate (snow-button) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('untrigger) (go snow-button-deactivate) ) @@ -325,7 +324,6 @@ ) ) (send-to-all-after (-> self link) 'trigger) - (none) ) :trans (behavior () (if (completed? (-> self ticker)) @@ -338,7 +336,6 @@ ) ) (rider-trans) - (none) ) :code (behavior () (sound-play "prec-button1" :pitch -1) @@ -350,16 +347,15 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) :post (the-as (function none :behavior snow-button) rider-post) ) ;; failed to figure out what this is: (defstate snow-button-deactivate (snow-button) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 symbol)) - (case event-type + (case message (('query) (return (the-as object #f)) v0-0 @@ -369,7 +365,6 @@ :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :trans (the-as (function none :behavior snow-button) rider-trans) :code (behavior () @@ -384,7 +379,6 @@ (ja :num! (seek!)) ) (go snow-button-up-idle) - (none) ) :post (the-as (function none :behavior snow-button) rider-post) ) @@ -527,8 +521,8 @@ ;; failed to figure out what this is: (defstate plat-startup (flutflut-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (when (or (!= (-> self plat-type) 1) (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) @@ -569,14 +563,13 @@ ) ) ) - (none) ) ) ;; failed to figure out what this is: (defstate flutflut-plat-hidden-idle (flutflut-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (logclear! (-> self mask) (process-mask actor-pause)) (go flutflut-plat-appear) @@ -587,7 +580,6 @@ (if (and (= (-> self plat-type) 1) (get-lit-skel self)) (go flutflut-plat-appear) ) - (none) ) :code (behavior () (logior! (-> self draw status) (draw-status hidden)) @@ -597,19 +589,17 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) ;; failed to figure out what this is: (defstate flutflut-plat-appear (flutflut-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as symbol (baseplat-method-22 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -627,11 +617,9 @@ (quaternion-axis-angle! gp-0 0.0 1.0 0.0 (rand-vu-float-range -32768.0 32768.0)) (quaternion*! (-> self appear-quat-bottom) (-> self appear-quat-bottom) gp-0) ) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (plat-trans) @@ -671,7 +659,6 @@ ) ) (baseplat-method-20 self) - (none) ) :code (the-as (function none :behavior flutflut-plat) anim-loop) :post (the-as (function none :behavior flutflut-plat) rider-post) @@ -680,16 +667,15 @@ ;; failed to figure out what this is: (defstate plat-idle (flutflut-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as object (baseplat-method-22 self)) - ) - (('untrigger) - (go flutflut-plat-hide) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + (('untrigger) + (go flutflut-plat-hide) + ) + ) ) :enter (behavior () (let ((t9-0 (-> (method-of-type plat plat-idle) enter))) @@ -698,7 +684,6 @@ ) ) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) @@ -707,7 +692,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type plat plat-idle) trans))) @@ -718,23 +702,21 @@ (if (and (= (-> self plat-type) 1) (get-lit-skel self)) (go elevator-idle-at-cave) ) - (none) ) ) ;; failed to figure out what this is: (defstate plat-path-active (flutflut-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as object (baseplat-method-22 self)) - ) - (('untrigger) - (go flutflut-plat-hide) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + (('untrigger) + (go flutflut-plat-hide) + ) + ) ) :enter (behavior ((arg0 plat)) (let ((t9-0 (-> (method-of-type plat plat-path-active) enter))) @@ -747,7 +729,6 @@ ) (logclear! (-> self mask) (process-mask actor-pause)) ) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) @@ -756,19 +737,17 @@ (t9-0) ) ) - (none) ) ) ;; failed to figure out what this is: (defstate flutflut-plat-hide (flutflut-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as symbol (baseplat-method-22 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -785,12 +764,10 @@ (quaternion-axis-angle! gp-0 0.0 1.0 0.0 (rand-vu-float-range -32768.0 32768.0)) (quaternion*! (-> self appear-quat-bottom) (-> self appear-quat-bottom) gp-0) ) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self root-override root-prim prim-core action) (collide-action rider-plat-sticky)) - (none) ) :trans (behavior () (plat-trans) @@ -813,7 +790,6 @@ ) ) (baseplat-method-20 self) - (none) ) :code (the-as (function none :behavior flutflut-plat) anim-loop) :post (the-as (function none :behavior flutflut-plat) rider-post) @@ -821,35 +797,30 @@ ;; failed to figure out what this is: (defstate elevator-idle-at-cave (flutflut-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('bonk) - (the-as object (baseplat-method-22 self)) - ) - (('bounce) - (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) - (the-as object (baseplat-method-22 self)) - ) - ) - (('ridden) - (if (or (not *target*) (not (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)))) - (go elevator-travel-to-fort) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + (('bounce) + (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) + (baseplat-method-22 self) + ) + ) + (('ridden) + (if (or (not *target*) (not (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)))) + (go elevator-travel-to-fort) + ) + ) ) ) :enter (behavior () (set! (-> self path-pos) 0.0) (eval-path-curve! (-> self path) (-> self basetrans) 0.0 'interp) - (none) ) :trans (behavior () (plat-trans) (baseplat-method-20 self) - (none) ) :code (the-as (function none :behavior flutflut-plat) anim-loop) :post (the-as (function none :behavior flutflut-plat) plat-post) @@ -857,13 +828,12 @@ ;; failed to figure out what this is: (defstate elevator-travel-to-fort (flutflut-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as symbol (baseplat-method-22 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + ) ) :trans (behavior () (when (= (-> self path-pos) 1.0) @@ -874,7 +844,6 @@ (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (plat-trans) (baseplat-method-20 self) - (none) ) :code (the-as (function none :behavior flutflut-plat) anim-loop) :post (the-as (function none :behavior flutflut-plat) plat-post) @@ -882,18 +851,16 @@ ;; failed to figure out what this is: (defstate elevator-idle-at-fort (flutflut-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as symbol (baseplat-method-22 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + ) ) :enter (behavior () (set! (-> self path-pos) 1.0) (eval-path-curve! (-> self path) (-> self basetrans) 1.0 'interp) - (none) ) :trans (behavior () (when *target* @@ -908,7 +875,6 @@ ) (plat-trans) (baseplat-method-20 self) - (none) ) :code (the-as (function none :behavior flutflut-plat) anim-loop) :post (the-as (function none :behavior flutflut-plat) plat-post) @@ -916,13 +882,12 @@ ;; failed to figure out what this is: (defstate elevator-travel-to-cave (flutflut-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as symbol (baseplat-method-22 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + ) ) :trans (behavior () (when (= (-> self path-pos) 0.0) @@ -933,7 +898,6 @@ (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (plat-trans) (baseplat-method-20 self) - (none) ) :code (the-as (function none :behavior flutflut-plat) anim-loop) :post (the-as (function none :behavior flutflut-plat) plat-post) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc index 0337127e314..e2b97f6fc0c 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc @@ -110,7 +110,6 @@ ) ) (go-virtual pov-camera-done-playing) - (none) ) ) @@ -304,19 +303,18 @@ ;; failed to figure out what this is: (defstate snow-eggtop-idle-up (snow-eggtop) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (case (-> event param 0) - (('pickup) - (if (type-type? (-> proc type) fuel-cell) - (save-reminder (get-task-control (-> self entity extra perm task)) 1 4) - ) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (if (type-type? (-> proc type) fuel-cell) + (save-reminder (get-task-control (-> self entity extra perm task)) 1 4) + ) + ) + ) + ) + ) ) :trans (behavior () (if (and (not (-> self child)) (task-complete? *game-info* (-> self entity extra perm task))) @@ -324,7 +322,6 @@ ) (spawn (-> self part) (-> self root-override trans)) (update! (-> self sound)) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -334,24 +331,23 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate snow-eggtop-activate (snow-eggtop) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notify) (when (= (-> proc type) snowcam) (cond - ((= (-> event param 0) 'die) + ((= (-> block param 0) 'die) (if *target* (+! (-> *target* control trans y) 1024.0) ) (go snow-eggtop-idle-down) ) - ((= (-> event param 0) 'cut) + ((= (-> block param 0) 'cut) (stop! (-> self sound)) (set! (-> self play-sound?) #f) #f @@ -365,13 +361,11 @@ (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) (set! (-> self play-sound?) #t) - (none) ) :exit (behavior () (stop! (-> self sound)) (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :trans (the-as (function none :behavior snow-eggtop) rider-trans) :code (behavior () @@ -439,7 +433,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior snow-eggtop) rider-post) ) @@ -459,7 +452,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -558,14 +550,13 @@ ;; failed to figure out what this is: (defstate snowpusher-idle (snowpusher) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) ) :code (behavior () (let ((gp-0 #f)) @@ -590,7 +581,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior snowpusher) pusher-post) ) @@ -695,14 +685,13 @@ ;; failed to figure out what this is: (defstate snow-spatula-idle (snow-spatula) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (baseplat-method-22 self) - (sound-play "snow-spat-short" :vol 75 :pitch 0.75) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + (sound-play "snow-spat-short" :vol 75 :pitch 0.75) + ) + ) ) :trans (the-as (function none :behavior snow-spatula) plat-trans) :code (behavior () @@ -739,7 +728,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior snow-spatula) plat-post) ) @@ -994,8 +982,8 @@ ;; failed to figure out what this is: (defstate snow-fort-gate-idle-closed (snow-fort-gate) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notice) (go snow-fort-gate-activate) ) @@ -1006,7 +994,6 @@ (level-hint-spawn (text-id snow-fort-hint) "sksp0345" (the-as entity #f) *entity-pool* (game-task none)) (close-specific-task! (game-task snow-fort) (task-status need-hint)) ) - (none) ) :code (behavior () (ja :group! (-> self draw art-group data 2) :num! min) @@ -1017,7 +1004,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -1025,12 +1011,10 @@ (defstate snow-fort-gate-activate (snow-fort-gate) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (stop! (-> self sound)) (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :code (behavior () (let ((gp-0 #f)) @@ -1073,7 +1057,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior snow-fort-gate) transform-post) ) @@ -1090,7 +1073,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -1290,8 +1272,8 @@ ;; failed to figure out what this is: (defstate snow-gears-idle (snow-gears) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notice) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) @@ -1306,7 +1288,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -1314,7 +1295,6 @@ (defstate snow-gears-activate (snow-gears) :trans (behavior () (snow-gears-method-20 self) - (none) ) :code (behavior () (sound-play "eng-start-up") @@ -1336,7 +1316,6 @@ (suspend) ) (go snow-gears-halt) - (none) ) :post (the-as (function none :behavior snow-gears) ja-post) ) @@ -1345,11 +1324,9 @@ (defstate snow-gears-halt (snow-gears) :exit (behavior () (stop! (-> self sound)) - (none) ) :trans (behavior () (snow-gears-method-20 self) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max 0.35) :frame-num 0.0) @@ -1366,7 +1343,6 @@ (ja :num! (seek! max 0.85)) ) (go snow-gears-stopped) - (none) ) :post (the-as (function none :behavior snow-gears) ja-post) ) @@ -1380,7 +1356,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -1469,7 +1444,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -1479,7 +1453,6 @@ :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (the-as (function none :behavior snow-switch) rider-trans) :code (behavior () @@ -1539,7 +1512,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior snow-switch) rider-post) ) @@ -1556,7 +1528,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -1661,8 +1632,8 @@ ;; failed to figure out what this is: (defstate snow-log-wait-for-master (snow-log) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go snow-log-activate) ) @@ -1699,14 +1670,13 @@ ) ) ) - (none) ) ) ;; failed to figure out what this is: (defstate snow-log-hidden (snow-log) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) @@ -1721,7 +1691,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -1731,12 +1700,10 @@ (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :trans (the-as (function none :behavior snow-log) rider-trans) :code (behavior () @@ -1755,7 +1722,6 @@ ) ) (go snow-log-active) - (none) ) :post (the-as (function none :behavior snow-log) rider-post) ) @@ -1793,7 +1759,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior snow-log) rider-post) ) @@ -1901,7 +1866,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -1911,7 +1875,6 @@ :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :trans (the-as (function none :behavior snow-log-button) rider-trans) :code (behavior () @@ -1947,7 +1910,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior snow-log-button) rider-post) ) @@ -1963,7 +1925,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc index 6b1fd021d66..b68d7a16fe3 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc @@ -691,8 +691,8 @@ ;; failed to figure out what this is: (defstate ram-boss-proj-growing (ram-boss-proj) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('launch) (let ((v1-1 (-> self parent-override))) (set! (-> v1-1 0 proj-stoked) #f) @@ -741,7 +741,6 @@ (spawn (-> self part) (-> self root-override trans)) (suspend) ) - (none) ) ) @@ -758,7 +757,6 @@ (+! (-> self target y) 4915.2) (set! (-> self target-base quad) (-> self target quad)) (go-virtual projectile-moving) - (none) ) ) @@ -783,7 +781,6 @@ (sound-play "ramboss-hit") (suspend) (go-virtual projectile-die) - (none) ) ) @@ -807,7 +804,6 @@ ) (suspend) (go-virtual projectile-die) - (none) ) ) @@ -1340,24 +1336,22 @@ (defstate ram-boss-show-anims (ram-boss) :trans (behavior () 0 - (none) ) :code (behavior () 0 - (none) ) :post (the-as (function none :behavior ram-boss) transform-post) ) ;; failed to figure out what this is: (defstate ram-boss-idle (ram-boss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('jump) (go ram-boss-jump-down proc) ) (('touch 'attack) - (nav-enemy-send-attack proc (the-as touching-shapes-entry (-> event param 0)) 'generic) + (nav-enemy-send-attack proc (the-as touching-shapes-entry (-> block param 0)) 'generic) ) ) ) @@ -1365,7 +1359,6 @@ ((-> (method-of-type nav-enemy nav-enemy-idle) enter)) (set! (-> self frustration) 0) 0 - (none) ) :code (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) @@ -1392,16 +1385,15 @@ ) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate ram-boss-jump-down (ram-boss) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) - (nav-enemy-send-attack proc (the-as touching-shapes-entry (-> event param 0)) 'generic) + (nav-enemy-send-attack proc (the-as touching-shapes-entry (-> block param 0)) 'generic) ) ) ) @@ -1431,7 +1423,6 @@ ) ) (set! (-> self collide-info transv y) 102400.0) - (none) ) :trans (behavior () (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) @@ -1447,7 +1438,6 @@ (if (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)) (go ram-boss-jump-down-hit-ground) ) - (none) ) :code (behavior ((arg0 basic)) (ja-channel-push! 1 (seconds 0.8)) @@ -1464,7 +1454,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) @@ -1482,7 +1471,6 @@ ) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go ram-boss-nav-start) - (none) ) :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) @@ -1505,7 +1493,6 @@ (set-heading-vec! (-> self collide-info) gp-0) ) (go ram-boss-nav-start) - (none) ) ) @@ -1520,7 +1507,6 @@ (set-current-poly! (-> self nav) a1-1) ) (go ram-boss-nav-resume) - (none) ) ) @@ -1550,7 +1536,6 @@ ) ) (go-virtual nav-enemy-idle) - (none) ) ) @@ -1563,7 +1548,6 @@ (set! (-> self state-timeout) (-> self nav-enemy-patrol-timeout)) (set! (-> self nav-enemy-patrol-timeout) (seconds 1)) (ja-channel-push! 1 (seconds 0.3)) - (none) ) :trans (behavior () (when *target* @@ -1574,7 +1558,6 @@ ) ) ((-> (method-of-type nav-enemy nav-enemy-patrol) trans)) - (none) ) ) @@ -1588,7 +1571,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans)))) @@ -1615,7 +1597,6 @@ ) ) 0 - (none) ) ) @@ -1626,7 +1607,6 @@ :trans (the-as (function none :behavior ram-boss) #f) :code (behavior () (go ram-boss-tracking) - (none) ) ) @@ -1663,7 +1643,6 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self facing-y) (quaternion-y-angle (-> self collide-info quat))) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) - (none) ) :trans (behavior () (set-jump-height-factor! @@ -1738,7 +1717,6 @@ ) ) 0 - (none) ) :code (behavior () (let ((f30-0 -1.0)) @@ -1783,7 +1761,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) @@ -1793,12 +1770,10 @@ :enter (behavior () (set! (-> self frustration) 0) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) - (none) ) :trans (behavior () (set-jump-height-factor! self (the-as int #t)) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1808,7 +1783,6 @@ (ja :num! (seek!)) ) (go ram-boss-tracking) - (none) ) :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) @@ -1818,12 +1792,10 @@ :enter (behavior () (set! (-> self frustration) 0) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) - (none) ) :trans (behavior () (set-jump-height-factor! self (the-as int #t)) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1833,7 +1805,6 @@ (ja :num! (seek!)) ) (go ram-boss-tracking) - (none) ) :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) @@ -1852,7 +1823,6 @@ ) ) ) - (none) ) :code (behavior () (set! (-> self frustration) 0) @@ -1868,7 +1838,6 @@ ) ) (go-virtual nav-enemy-attack) - (none) ) :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) @@ -1879,7 +1848,6 @@ :event ram-boss-on-ground-event-handler :enter (behavior () (go ram-boss-nav-resume) - (none) ) ) @@ -1895,12 +1863,10 @@ ) ) (set! (-> self proj-last-thrown-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (set-jump-height-factor! self (the-as int #t)) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1921,7 +1887,6 @@ ) ) (go ram-boss-tracking) - (none) ) :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) @@ -1933,7 +1898,6 @@ (nav-enemy-neck-control-inactive) (nav-enemy-method-53 self) (init-jm! self *ram-boss-nav-enemy-info-no-shield*) - (none) ) :exit (behavior () (nav-enemy-neck-control-look-at) @@ -1946,7 +1910,6 @@ (set! (-> v1-3 enable) #t) (set! (-> v1-3 transform scale quad) (the-as uint128 0)) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -1965,7 +1928,6 @@ (ja :num! (seek!)) ) (go ram-boss-tracking) - (none) ) :post (behavior () (compute-alignment! (-> self align)) @@ -1993,7 +1955,6 @@ #f ) (nav-enemy-common-post) - (none) ) ) @@ -2014,6 +1975,5 @@ (send-event (ppointer->process (-> self parent-override)) 'notify) (suspend) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-ram_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-ram_REF.gc index 6ef8288cc4e..5ad8785d51a 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ram_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ram_REF.gc @@ -183,18 +183,18 @@ ;; failed to figure out what this is: (defstate ram-idle (ram) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (if ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self root-override) (the-as uint 1) ) (send-event proc 'attack - (-> event param 0) + (-> block param 0) (static-attack-info ((shove-up (meters 0.5)) (shove-back (meters 2)))) ) ) @@ -203,14 +203,12 @@ ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (rider-trans) (if (-> self give-fuel-cell-anim) (spool-push *art-control* (-> self give-fuel-cell-anim name) 0 self -99.0) ) - (none) ) :code (behavior () (local-vars (sv-16 symbol)) @@ -252,15 +250,14 @@ (go ram-fun-idle) ) ) - (none) ) :post (the-as (function none :behavior ram) rider-post) ) ;; failed to figure out what this is: (defstate ram-fun-idle (ram) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notify) (when (= (-> proc type) ram-boss) (if (ram-method-22 self) @@ -274,7 +271,6 @@ (if (-> self give-fuel-cell-anim) (spool-push *art-control* (-> self give-fuel-cell-anim name) 0 self -99.0) ) - (none) ) :code (behavior () (if (-> self give-fuel-cell?) @@ -286,16 +282,15 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) ;; failed to figure out what this is: (defstate ram-give-fuel-cell (ram) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notify) - (if (and (= (-> proc type) snowcam) (= (-> event param 0) 'die)) + (if (and (= (-> proc type) snowcam) (= (-> block param 0) 'die)) (go ram-fun-idle) ) ) @@ -304,7 +299,6 @@ :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :code (behavior () (set! (-> self give-fuel-cell?) #f) @@ -335,7 +329,6 @@ 0 ) (go ram-fun-idle) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/snow/target-ice_REF.gc b/test/decompiler/reference/jak1/levels/snow/target-ice_REF.gc index 956bc6e364f..e59935bc3a5 100644 --- a/test/decompiler/reference/jak1/levels/snow/target-ice_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/target-ice_REF.gc @@ -6,7 +6,6 @@ :event target-standard-event-handler :enter (behavior () (set! (-> self control unknown-surface00) *walk-mods*) - (none) ) :exit target-state-hook-exit :trans (behavior () @@ -49,7 +48,6 @@ ) (slide-down-test) (fall-test) - (none) ) :code (behavior () (let ((gp-0 60)) @@ -152,7 +150,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) :post target-post ) @@ -163,12 +160,10 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *walk-mods*) - (none) ) :exit (behavior () (target-effect-exit) (target-state-hook-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -233,7 +228,6 @@ ) (slide-down-test) (fall-test) - (none) ) :code (behavior () (cond @@ -313,7 +307,6 @@ ) ) ) - (none) ) :post target-post ) diff --git a/test/decompiler/reference/jak1/levels/snow/target-snowball_REF.gc b/test/decompiler/reference/jak1/levels/snow/target-snowball_REF.gc index 194eed20308..868306e2658 100644 --- a/test/decompiler/reference/jak1/levels/snow/target-snowball_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/target-snowball_REF.gc @@ -59,12 +59,12 @@ ;; failed to figure out what this is: (defstate target-snowball-start (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) 'snowball ) - ((let ((v1-3 event-type)) + ((let ((v1-3 message)) (= v1-3 'end-mode) ) (go @@ -75,7 +75,7 @@ ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -95,7 +95,6 @@ (set! (-> self control reaction) target-collision-reaction) (target-exit) ) - (none) ) :code (behavior ((arg0 handle)) (target-exit) @@ -119,7 +118,6 @@ (ja :group! (-> self draw art-group data 5) :num! min) (remove-exit) (go target-snowball) - (none) ) :post target-post ) @@ -132,10 +130,8 @@ (loop (suspend) ) - (none) ) :post (behavior () (target-snowball-post) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc b/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc index 4907aa30efa..e2e87a0a285 100644 --- a/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc @@ -249,7 +249,6 @@ (+! (-> self collide-info trans y) -12288.0) (set! (-> self collide-info transv quad) (-> *null-vector* quad)) (set! (-> self collide-info transv y) (rand-vu-float-range 102400.0 114688.0)) - (none) ) :trans (behavior () (when (and (< (-> self collide-info trans y) (-> self ground-y)) (< (-> self collide-info transv y) 0.0)) @@ -264,7 +263,6 @@ (vector<-cspace! gp-0 (-> s5-0 data (nav-enemy-rnd-int-count a0-2))) (spawn (-> self part2) gp-0) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -276,7 +274,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior yeti-slave) nav-enemy-falling-post) ) @@ -295,7 +292,6 @@ (go-virtual nav-enemy-chase) (go-virtual nav-enemy-idle) ) - (none) ) :post (the-as (function none :behavior yeti-slave) ja-post) ) @@ -304,11 +300,9 @@ (defstate yeti-slave-show-anims (yeti-slave) :trans (behavior () 0 - (none) ) :code (behavior () 0 - (none) ) :post (the-as (function none :behavior yeti-slave) transform-post) ) @@ -361,7 +355,6 @@ ) ) ) - (none) ) ) @@ -395,7 +388,6 @@ (ja :num! (loop! f30-0)) ) ) - (none) ) ) @@ -447,7 +439,6 @@ ) ) ) - (none) ) ) @@ -487,7 +478,6 @@ (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -507,7 +497,6 @@ (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) ) (go-virtual nav-enemy-chase) - (none) ) ) @@ -675,7 +664,6 @@ ) (suspend) ) - (none) ) ) @@ -704,7 +692,6 @@ ) ) (go yeti-idle) - (none) ) ) @@ -745,7 +732,6 @@ ) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc b/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc index 0d70f4cd332..a91a96544f2 100644 --- a/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc @@ -258,7 +258,6 @@ (suspend) (ja :num! (seek!)) ) - (none) ) :post (the-as (function none :behavior bully-broken-cage) ja-post) ) @@ -279,127 +278,120 @@ ;; definition for function bully-default-event-handler ;; INFO: Used lq/sq -;; INFO: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 48] ;; WARN: disable def twice: 148. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 229] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 248] (defbehavior bully-default-event-handler bully ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (local-vars (v0-0 none)) - (the-as - object - (case arg2 - (('touch 'touched 'attack) - (cond - ((= (-> arg0 type) bully) - (let ((v1-3 (new 'stack-no-clear 'vector))) - (vector-! v1-3 (-> self root-override trans) (-> (the-as process-drawable arg0) root trans)) - (set! (-> self travel-ry) (atan (-> v1-3 x) (-> v1-3 z))) - ) - (set! (-> self bounced?) #t) - (set! v0-0 (the-as none 100)) - (set! (-> self bounce-volume) (the-as int v0-0)) - v0-0 + (local-vars (v0-0 object)) + (case arg2 + (('touch 'touched 'attack) + (cond + ((= (-> arg0 type) bully) + (let ((v1-3 (new 'stack-no-clear 'vector))) + (vector-! v1-3 (-> self root-override trans) (-> (the-as process-drawable arg0) root trans)) + (set! (-> self travel-ry) (atan (-> v1-3 x) (-> v1-3 z))) ) - ((= (-> arg0 type) target) - (cond - ((= (-> arg3 param 1) 'flop) - (go bully-die) - (return (the-as object #t)) - v0-0 - ) - ((or (= arg2 'touch) (= arg2 'attack)) - (cond - ((>= (- (-> (target-pos 0) y) (-> self root-override trans y)) 6144.0) - (let* ((f0-6 (fmax 0.6 (* 0.000023935356 (-> self travel-speed)))) - (f28-0 (* 8192.0 f0-6)) - (f30-0 (* 8192.0 f0-6)) - (s4-0 (new 'stack-no-clear 'vector)) - ) - (vector-! s4-0 (target-pos 0) (-> self root-override trans)) - (let ((f26-0 (atan (-> s4-0 x) (-> s4-0 z)))) - (when (< 0.0 (-> self travel-speed)) - (let ((f0-11 (deg- f26-0 (-> self travel-ry)))) - (if (< (fabs f0-11) 8192.0) - (set! f26-0 (if (>= f0-11 0.0) - (+ 8192.0 f26-0) - (+ -8192.0 f26-0) - ) - ) - ) - ) + (set! (-> self bounced?) #t) + (set! v0-0 100) + (set! (-> self bounce-volume) (the-as int v0-0)) + v0-0 + ) + ((= (-> arg0 type) target) + (cond + ((= (-> arg3 param 1) 'flop) + (go bully-die) + (return #t) + v0-0 + ) + ((or (= arg2 'touch) (= arg2 'attack)) + (cond + ((>= (- (-> (target-pos 0) y) (-> self root-override trans y)) 6144.0) + (let* ((f0-6 (fmax 0.6 (* 0.000023935356 (-> self travel-speed)))) + (f28-0 (* 8192.0 f0-6)) + (f30-0 (* 8192.0 f0-6)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector-! s4-0 (target-pos 0) (-> self root-override trans)) + (let ((f26-0 (atan (-> s4-0 x) (-> s4-0 z)))) + (when (< 0.0 (-> self travel-speed)) + (let ((f0-11 (deg- f26-0 (-> self travel-ry)))) + (if (< (fabs f0-11) 8192.0) + (set! f26-0 (if (>= f0-11 0.0) + (+ 8192.0 f26-0) + (+ -8192.0 f26-0) + ) + ) + ) ) - (set-vector! s4-0 (* (sin f26-0) f28-0) 0.0 (* (cos f26-0) f28-0) 1.0) ) - (when (send-event arg0 'shove (-> arg3 param 0) (static-attack-info ((shove-up f30-0) (vector s4-0)))) - (level-hint-spawn - (text-id sunken-bully-dive-hint) - "sksp0131" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (set! (-> self bounced?) #t) - (set! v0-0 (the-as none 100)) - (set! (-> self bounce-volume) (the-as int v0-0)) - v0-0 + (set-vector! s4-0 (* (sin f26-0) f28-0) 0.0 (* (cos f26-0) f28-0) 1.0) + ) + (when (send-event arg0 'shove (-> arg3 param 0) (static-attack-info ((shove-up f30-0) (vector s4-0)))) + (level-hint-spawn + (text-id sunken-bully-dive-hint) + "sksp0131" + (the-as entity #f) + *entity-pool* + (game-task none) ) + (set! (-> self bounced?) #t) + (set! v0-0 100) + (set! (-> self bounce-volume) (the-as int v0-0)) + v0-0 ) ) - (else - (let ((f0-21 (fmax 0.6 (* 0.000023935356 (-> self travel-speed))))) - (when (send-event - arg0 - 'attack - (-> arg3 param 0) - (static-attack-info ((shove-up (* 12288.0 f0-21)) (shove-back (* 16384.0 f0-21)))) - ) - (level-hint-spawn - (text-id sunken-bully-dive-hint) - "sksp0131" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (set! (-> self hit-player?) #t) - (set! (-> self bounced?) #t) - (set! (-> self bounce-volume) 100) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) + ) + (else + (let ((f0-21 (fmax 0.6 (* 0.000023935356 (-> self travel-speed))))) + (when (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (* 12288.0 f0-21)) (shove-back (* 16384.0 f0-21)))) + ) + (level-hint-spawn + (text-id sunken-bully-dive-hint) + "sksp0131" + (the-as entity #f) + *entity-pool* + (game-task none) ) + (set! (-> self hit-player?) #t) + (set! (-> self bounced?) #t) + (set! (-> self bounce-volume) 100) + (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) ) ) ) ) - ) + ) ) - (else - (when (= arg2 'touched) - (cond - ((= (-> arg0 type) target) - (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'explode)))) - ) - (else - (let ((a1-14 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-14 from) self) - (set! (-> a1-14 num-params) 4) - (set! (-> a1-14 message) 'attack) - (set! (-> a1-14 param 0) (-> arg3 param 0)) - (set! (-> a1-14 param 1) (the-as uint 'explode)) - (let ((v1-48 (+ *global-attack-id* 1))) - (set! *global-attack-id* v1-48) - (set! (-> a1-14 param 2) (the-as uint v1-48)) - ) - (set! (-> a1-14 param 3) (the-as uint 0)) - (send-event-function arg0 a1-14) + ) + (else + (when (= arg2 'touched) + (cond + ((= (-> arg0 type) target) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'explode)))) + ) + (else + (let ((a1-14 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-14 from) self) + (set! (-> a1-14 num-params) 4) + (set! (-> a1-14 message) 'attack) + (set! (-> a1-14 param 0) (-> arg3 param 0)) + (set! (-> a1-14 param 1) (the-as uint 'explode)) + (let ((v1-48 (+ *global-attack-id* 1))) + (set! *global-attack-id* v1-48) + (set! (-> a1-14 param 2) (the-as uint v1-48)) ) + (set! (-> a1-14 param 3) (the-as uint 0)) + (send-event-function arg0 a1-14) ) ) ) ) ) ) - ) + ) ) ) @@ -508,14 +500,12 @@ (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) 0 - (none) ) :exit (behavior () (let ((v1-1 (-> self draw shadow-ctrl))) (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) 0 - (none) ) :trans (behavior () (when (and (and *target* (>= (-> self fact-override idle-distance) @@ -527,7 +517,6 @@ (start-hint-timer (text-id sunken-bully-dive-hint)) (go bully-notice) ) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-push! 1 (seconds 0.075)) @@ -541,7 +530,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) :post bully-post ) @@ -561,7 +549,6 @@ ) (set-target! (-> self neck) (target-pos 5)) ) - (none) ) :code (behavior () (set! (-> self travel-speed) 0.0) @@ -599,7 +586,6 @@ (ja :num! (seek!)) ) (go bully-start-spinning) - (none) ) :post bully-post ) @@ -621,7 +607,6 @@ (set! (-> self travel-ry) (atan (-> gp-0 x) (-> gp-0 z))) ) (+! (-> self travel-ry) (rand-vu-float-range -910.2222 910.2222)) - (none) ) :trans (behavior () (when *target* @@ -661,7 +646,6 @@ #f ) (nav-control-method-27 (-> self nav)) - (none) ) :code (behavior () (local-vars (v1-34 symbol) (v1-52 symbol)) @@ -696,7 +680,6 @@ ) (ja :group! bully-spin-ja :num! min) ) - (none) ) :post bully-post ) @@ -709,7 +692,6 @@ (set! (-> self reaction-delay) (rand-vu-int-range (seconds 2) (seconds 3))) (set! (-> self travel-speed) 0.0) (set! (-> self bounced?) #f) - (none) ) :trans (behavior () (when *target* @@ -723,7 +705,6 @@ ) (set-target! (-> self neck) (target-pos 5)) ) - (none) ) :code (behavior () (local-vars (v1-17 symbol) (v1-35 symbol)) @@ -768,7 +749,6 @@ (go bully-idle #f) ) (go bully-start-spinning) - (none) ) :post bully-post ) @@ -794,7 +774,6 @@ (while (-> self child) (suspend) ) - (none) ) :post (the-as (function none :behavior bully) transform-post) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/double-lurker_REF.gc b/test/decompiler/reference/jak1/levels/sunken/double-lurker_REF.gc index e957a0bf2d4..59d2a9d25ae 100644 --- a/test/decompiler/reference/jak1/levels/sunken/double-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/double-lurker_REF.gc @@ -256,18 +256,18 @@ ;; failed to figure out what this is: (defstate double-lurker-top-on-shoulders (double-lurker-top) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (let ((v1-1 (-> self fall-dest)) - (a0-4 (-> (the-as vector (-> event param 0)) quad)) + (a0-4 (-> (the-as vector (-> block param 0)) quad)) ) (set! (-> v1-1 quad) a0-4) - (go double-lurker-top-knocked-down a0-4 (the-as vector arg1) (the-as vector event-type)) + (go double-lurker-top-knocked-down a0-4 (the-as vector argc) (the-as vector message)) ) ) (('instant-death) - (let ((v1-3 (the-as object (-> event param 0)))) + (let ((v1-3 (the-as object (-> block param 0)))) (quaternion-axis-angle! (-> self collide-info quat) 0.0 @@ -291,7 +291,6 @@ (update-transforms! (-> self collide-info)) (suspend) ) - (none) ) ) @@ -305,20 +304,19 @@ (suspend) (ja :num! (seek!)) ) - (none) ) :post (the-as (function none :behavior double-lurker-top) ja-post) ) ;; failed to figure out what this is: (defstate double-lurker-top-knocked-down (double-lurker-top) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (send-event proc 'shove - (-> event param 0) + (-> block param 0) (static-attack-info ((shove-up (meters 3)) (shove-back (meters 2)))) ) ) @@ -353,7 +351,6 @@ (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (nav-control-method-27 (-> self nav)) (go double-lurker-top-resume) - (none) ) :post (the-as (function none :behavior double-lurker-top) transform-post) ) @@ -380,7 +377,6 @@ ) ) (go-virtual nav-enemy-idle) - (none) ) ) @@ -396,7 +392,6 @@ ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -414,7 +409,6 @@ (t9-0) ) ) - (none) ) ) @@ -620,11 +614,9 @@ (defstate double-lurker-show-anims (double-lurker) :trans (behavior () 0 - (none) ) :code (behavior () 0 - (none) ) :post (the-as (function none :behavior double-lurker) transform-post) ) @@ -651,7 +643,6 @@ ) ) (go-virtual nav-enemy-idle) - (none) ) ) @@ -674,7 +665,6 @@ ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -689,7 +679,6 @@ (t9-1) ) ) - (none) ) ) @@ -731,7 +720,6 @@ (t9-0) ) ) - (none) ) ) @@ -739,7 +727,6 @@ (defstate double-lurker-both-knocked-back (double-lurker) :enter (behavior () (set! (-> self knocked-back-speed) 40960.0) - (none) ) :trans (behavior () (local-vars (at-0 int)) @@ -799,7 +786,6 @@ #f ) (nav-control-method-27 (-> self nav)) - (none) ) ) :code (behavior () @@ -810,7 +796,6 @@ (ja :num! (seek!)) ) (go double-lurker-resume) - (none) ) :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post) ) @@ -868,7 +853,6 @@ (nav-enemy-method-51 self) (init-jm! self *double-lurker-nav-enemy-info*) (go double-lurker-break-apart) - (none) ) ) @@ -882,7 +866,6 @@ (ja :num! (seek!)) ) (go double-lurker-resume) - (none) ) :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post) ) @@ -891,7 +874,6 @@ (defstate double-lurker-knocked-back (double-lurker) :enter (behavior () (set! (-> self knocked-back-speed) 40960.0) - (none) ) :trans (behavior () (local-vars (at-0 int)) @@ -951,7 +933,6 @@ #f ) (nav-control-method-27 (-> self nav)) - (none) ) ) :code (behavior () @@ -962,7 +943,6 @@ (ja :num! (seek!)) ) (go double-lurker-resume) - (none) ) :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post) ) @@ -975,7 +955,6 @@ (until (not (-> self child)) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/floating-launcher_REF.gc b/test/decompiler/reference/jak1/levels/sunken/floating-launcher_REF.gc index 1797371a434..6b17fc21f98 100644 --- a/test/decompiler/reference/jak1/levels/sunken/floating-launcher_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/floating-launcher_REF.gc @@ -47,7 +47,6 @@ (go floating-launcher-lowering) ) ) - (none) ) :code (behavior () (transform-post) @@ -57,7 +56,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior floating-launcher) plat-post) ) @@ -85,7 +83,6 @@ (set! (-> self launcher 0 root-override trans quad) (-> self basetrans quad)) (update-transforms! (-> self launcher 0 root-override)) (go floating-launcher-ready) - (none) ) :post (the-as (function none :behavior floating-launcher) plat-post) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc b/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc index 93646167660..bc62d4b6916 100644 --- a/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc @@ -128,8 +128,8 @@ ;; failed to figure out what this is: (defstate water-vol-idle (helix-dark-eco) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (let ((a0-1 (-> self sound))) (set! (-> a0-1 spec pitch-mod) 2057) @@ -137,7 +137,7 @@ ) ) (else - ((-> (method-of-type water-anim water-vol-idle) event) proc arg1 event-type event) + ((-> (method-of-type water-anim water-vol-idle) event) proc argc message block) ) ) ) @@ -151,7 +151,6 @@ (set! (-> a0-0 spec pitch-mod) 1524) (update-vol! a0-0 58) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type dark-eco-pool water-vol-idle) trans))) @@ -160,7 +159,6 @@ ) ) (update! (-> self sound)) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type dark-eco-pool water-vol-idle) post))) @@ -169,14 +167,13 @@ ) ) (ja-post) - (none) ) ) ;; failed to figure out what this is: (defstate helix-slide-door-idle-open (helix-slide-door) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go helix-slide-door-close) ) @@ -186,7 +183,6 @@ (loop (suspend) ) - (none) ) ) @@ -200,7 +196,6 @@ ) (transform-post) (go helix-slide-door-idle-closed) - (none) ) :post (the-as (function none :behavior helix-slide-door) transform-post) ) @@ -212,7 +207,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -277,14 +271,13 @@ ) ) (go helix-button-idle-up) - (none) ) ) ;; failed to figure out what this is: (defstate helix-button-idle-up (helix-button) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (when *target* (when (logtest? (-> *target* control status) (cshape-moving-flags onsurf)) @@ -309,7 +302,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -458,7 +450,6 @@ (suspend) ) (go helix-button-idle-down) - (none) ) :post (the-as (function none :behavior helix-button) rider-post) ) @@ -539,7 +530,6 @@ ) ) (go helix-button-idle-down) - (none) ) :post (the-as (function none :behavior helix-button) rider-post) ) @@ -550,7 +540,6 @@ (loop (suspend) ) - (none) ) ) @@ -650,16 +639,15 @@ ;; failed to figure out what this is: (defstate helix-water-idle (helix-water) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('trigger) - (go helix-water-activated) - ) - (('music) - (the-as object (set-setting! 'music 'danger 0.0 0)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go helix-water-activated) + ) + (('music) + (set-setting! 'music 'danger 0.0 0) + ) + ) ) :code (behavior () (set! (-> self root trans y) (-> self start-y)) @@ -671,15 +659,14 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior helix-water) ja-post) ) ;; failed to figure out what this is: (defstate helix-water-activated (helix-water) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notify) (when (= (-> proc type) launcherdoor) (remove-setting! 'music) @@ -716,7 +703,6 @@ ) (send-event (ppointer->process (-> self dark-eco)) 'move-to (-> self root trans)) (helix-water-method-21 self) - (none) ) :code (behavior () (send-event (ppointer->process (-> self dark-eco)) 'trigger) @@ -724,7 +710,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior helix-water) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc b/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc index a124841b605..d57403ec331 100644 --- a/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc @@ -249,7 +249,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior orbit-plat-bottom) ja-post) ) @@ -294,39 +293,38 @@ ;; failed to figure out what this is: (defstate orbit-plat-idle (orbit-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (baseplat-method-22 self)) - ) - (('go) - (go orbit-plat-rotating) - ) - (('query-reset) - (if (not (-> self is-reset?)) - (go orbit-plat-reset) - ) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'reset) - (let ((t9-3 send-event-function) - (v1-8 (-> self other)) - ) - (t9-3 - (if v1-8 - (-> v1-8 extra process) - ) - a1-1 - ) - ) - ) - ) - (('reset) - (go orbit-plat-reset) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + (('go) + (go orbit-plat-rotating) + ) + (('query-reset) + (if (not (-> self is-reset?)) + (go orbit-plat-reset) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'reset) + (let ((t9-3 send-event-function) + (v1-8 (-> self other)) + ) + (t9-3 + (if v1-8 + (-> v1-8 extra process) + ) + a1-1 + ) + ) + ) + ) + (('reset) + (go orbit-plat-reset) + ) + ) ) :trans (the-as (function none :behavior orbit-plat) plat-trans) :code (behavior () @@ -380,7 +378,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior orbit-plat) plat-post) ) @@ -408,16 +405,15 @@ ;; failed to figure out what this is: (defstate orbit-plat-still (orbit-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (baseplat-method-22 self)) - ) - (('go) - (go orbit-plat-rotating) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + (('go) + (go orbit-plat-rotating) + ) + ) ) :trans (the-as (function none :behavior orbit-plat) plat-trans) :code (behavior () @@ -449,7 +445,6 @@ ) ) (go orbit-plat-idle) - (none) ) :post (the-as (function none :behavior orbit-plat) plat-post) ) @@ -485,7 +480,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior orbit-plat) plat-post) ) @@ -530,16 +524,15 @@ ;; failed to figure out what this is: (defstate orbit-plat-rotating (orbit-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (baseplat-method-22 self)) - ) - (('stop) - (go orbit-plat-still) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + (('stop) + (go orbit-plat-still) + ) + ) ) :trans (the-as (function none :behavior orbit-plat) plat-trans) :code (behavior () @@ -585,7 +578,6 @@ (ja :num! (seek! 0.0)) ) (b! #t cfg-3 :delay (nop!)) - (none) ) :post (the-as (function none :behavior orbit-plat) plat-post) ) @@ -742,16 +734,15 @@ ;; failed to figure out what this is: (defstate orbit-plat-reset (orbit-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (baseplat-method-22 self)) - ) - (('go) - (go orbit-plat-rotating) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + (('go) + (go orbit-plat-rotating) + ) + ) ) :trans (the-as (function none :behavior orbit-plat) plat-trans) :code (behavior () @@ -785,7 +776,6 @@ ) (set! (-> self is-reset?) #t) (go orbit-plat-idle) - (none) ) :post (the-as (function none :behavior orbit-plat) plat-post) ) @@ -809,7 +799,6 @@ (ja :num! (seek! 0.0)) ) ) - (none) ) :post (the-as (function none :behavior orbit-plat) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc b/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc index 8f85f6739ce..d029ff1060b 100644 --- a/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc @@ -111,48 +111,43 @@ ) ;; definition for function puffer-default-event-handler -;; INFO: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 56] (defbehavior puffer-default-event-handler puffer ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (case arg2 - (('touch 'attack) - (when (and (= arg2 'attack) (!= (-> self cprims-type) 2)) - (let* ((gp-0 arg0) - (v1-7 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) - gp-0 - ) - ) - ) - (when v1-7 - (let ((f0-4 (atan - (- (-> (the-as process-drawable v1-7) root trans x) (-> self root-override trans x)) - (- (-> (the-as process-drawable v1-7) root trans z) (-> self root-override trans z)) - ) + (case arg2 + (('touch 'attack) + (when (and (= arg2 'attack) (!= (-> self cprims-type) 2)) + (let* ((gp-0 arg0) + (v1-7 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) + gp-0 + ) + ) + ) + (when v1-7 + (let ((f0-4 (atan + (- (-> (the-as process-drawable v1-7) root trans x) (-> self root-override trans x)) + (- (-> (the-as process-drawable v1-7) root trans z) (-> self root-override trans z)) ) - ) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 f0-4) - ) + ) + ) + (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 f0-4) ) ) - (go puffer-die) - (return (the-as object #t)) ) - (when (= (-> arg0 type) target) - (when (send-event - arg0 - 'attack - (-> arg3 param 0) - (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) - ) - (set! (-> self hit-player?) #t) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) - ) + (go puffer-die) + (return #t) + ) + (when (= (-> arg0 type) target) + (when (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) + ) + (set! (-> self hit-player?) #t) + (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) ) ) - ) + ) ) ) @@ -563,7 +558,6 @@ (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) 0 - (none) ) :code (behavior () (loop @@ -579,7 +573,6 @@ (puffer-method-26 self) (suspend) ) - (none) ) :post puffer-post ) @@ -597,7 +590,6 @@ (set! (-> self picked-point-time) (-> *display* base-frame-counter)) (set! (-> self pick-new-point-delay) (rand-vu-int-range (seconds 3) (seconds 10))) (set! (-> self last-on-screen-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (and (not (and *target* (>= (-> self fact-info-override idle-distance) @@ -645,14 +637,12 @@ ) (vector-v+! (-> self root-override trans) (-> self root-override trans) (-> self root-override transv)) (puffer-method-28 self) - (none) ) :code (behavior () (loop (puffer-method-26 self) (suspend) ) - (none) ) :post puffer-post ) @@ -664,13 +654,11 @@ (set! (-> self attacking?) #t) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self travel-turn-speed) 21845.334) - (none) ) :exit (behavior () (shut-down! (-> self neck)) (set! (-> self attacking?) #f) (set! (-> self travel-turn-speed) 16384.0) - (none) ) :trans (behavior () (if (not (puffer-method-25 self (-> self give-up-dist))) @@ -694,24 +682,22 @@ ) (vector-v+! (-> self root-override trans) (-> self root-override trans) (-> self root-override transv)) (puffer-method-28 self) - (none) ) :code (behavior () (loop (puffer-method-26 self) (suspend) ) - (none) ) :post puffer-post ) ;; failed to figure out what this is: (defstate puffer-die (puffer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (the-as uint - (case event-type + (case message (('death-start) (the-as uint (drop-pickup (-> self fact-info-override) #t *entity-pool* (-> self fact-info-override) 0)) ) @@ -735,7 +721,6 @@ (suspend) (ja :num! (seek!)) ) - (none) ) :post (the-as (function none :behavior puffer) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc b/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc index 1a20a3f7f2d..b8525dfe5bf 100644 --- a/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc @@ -138,8 +138,8 @@ ;; failed to figure out what this is: (defstate qbert-plat-on-mimic (qbert-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go qbert-plat-on-die) ) @@ -162,7 +162,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior qbert-plat) ja-post) ) @@ -171,7 +170,6 @@ (defstate qbert-plat-on-die (qbert-plat) :code (behavior () '() - (none) ) ) @@ -268,7 +266,6 @@ (suspend) 0 ) - (none) ) :post (the-as (function none :behavior qbert-plat) ja-post) ) @@ -281,7 +278,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior qbert-plat) ja-post) ) @@ -294,7 +290,6 @@ (if (-> self on?) (logior! (-> self draw status) (draw-status hidden)) ) - (none) ) :trans (behavior () (logclear! (-> self draw status) (draw-status hidden)) @@ -309,7 +304,6 @@ ) (set! (-> self player-is-riding?) gp-1) ) - (none) ) :post (behavior () ((the-as @@ -320,7 +314,6 @@ (if (-> self on?) (logior! (-> self draw status) (draw-status hidden)) ) - (none) ) ) @@ -429,13 +422,13 @@ ;; failed to figure out what this is: (defstate qbert-plat-master-idle (qbert-plat-master) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (start-hint-timer (text-id sunken-qbert-plat-hint)) (close-specific-task! (game-task sunken-platforms) (task-status need-hint)) (when (not (-> self puzzle-beaten?)) - (let ((v1-2 (-> event param 0))) + (let ((v1-2 (-> block param 0))) (when (!= v1-2 (-> self last-plat-triggered)) (set! (-> self last-plat-triggered) (the-as int v1-2)) (let ((s5-1 (= (-> self plat-states-needed-to-open-door) (-> self plat-states)))) @@ -585,7 +578,6 @@ ) (suspend) ) - (none) ) ) @@ -746,7 +738,6 @@ ) ) (go qbert-plat-master-idle) - (none) ) ) @@ -777,7 +768,6 @@ ) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/shover_REF.gc b/test/decompiler/reference/jak1/levels/sunken/shover_REF.gc index d556947235e..b0f493d9186 100644 --- a/test/decompiler/reference/jak1/levels/sunken/shover_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/shover_REF.gc @@ -32,12 +32,12 @@ ;; failed to figure out what this is: (defstate shover-idle (shover) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (when (= (-> proc type) target) (when ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> *target* control) (collide-action solid) (collide-action) @@ -52,13 +52,13 @@ (send-event proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((mode 'burn) (vector (-> s4-0 vector)) (shove-up (-> s4-0 shove-up)))) ) (send-event proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((mode 'burn) (shove-up (meters 0)) (shove-back (meters 2)) diff --git a/test/decompiler/reference/jak1/levels/sunken/square-platform_REF.gc b/test/decompiler/reference/jak1/levels/sunken/square-platform_REF.gc index 135808d8ac4..2da6e755f86 100644 --- a/test/decompiler/reference/jak1/levels/sunken/square-platform_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/square-platform_REF.gc @@ -307,8 +307,8 @@ ;; failed to figure out what this is: (defstate square-platform-lowered (square-platform) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (if (and (= (-> proc type) square-platform-master) (= (-> (the-as square-platform-master proc) plat-id) (-> self plat-id)) @@ -324,28 +324,25 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate square-platform-rising (square-platform) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as object (baseplat-method-22 self)) - ) - (('untrigger) - (go square-platform-lowering) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + (('untrigger) + (go square-platform-lowering) + ) + ) ) :enter (behavior () (set! (-> self start-splash-time) 0) (set! (-> self splash-counter) 0) 0 - (none) ) :trans (behavior () (set! (-> self pos-u) @@ -358,30 +355,27 @@ (go square-platform-raised) ) (square-platform-method-27 self #t) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior square-platform) plat-post) ) ;; failed to figure out what this is: (defstate square-platform-raised (square-platform) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as object (baseplat-method-22 self)) - ) - (('untrigger) - (go square-platform-lowering) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + (('untrigger) + (go square-platform-lowering) + ) + ) ) :trans (the-as (function none :behavior square-platform) plat-trans) :code (behavior () @@ -390,33 +384,30 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior square-platform) plat-post) ) ;; failed to figure out what this is: (defstate square-platform-lowering (square-platform) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk 'bounce) - (the-as object (baseplat-method-22 self)) - ) - (('trigger) - (go square-platform-rising) - ) - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk 'bounce) + (baseplat-method-22 self) + ) + (('trigger) + (go square-platform-rising) + ) + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) ) :enter (behavior () (set! (-> self start-splash-time) 0) (set! (-> self splash-counter) 0) 0 - (none) ) :trans (behavior () (set! (-> self pos-u) @@ -429,14 +420,12 @@ (go square-platform-lowered) ) (square-platform-method-27 self #f) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (the-as (function none :behavior square-platform) plat-post) ) @@ -550,8 +539,8 @@ ;; failed to figure out what this is: (defstate square-platform-master-idle (square-platform-master) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (when (= (-> proc type) square-platform-button) (set! (-> self button-id) (-> (the-as square-platform-button proc) button-id)) @@ -566,7 +555,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -659,12 +647,10 @@ ) (set! (-> self plat-id-dir) gp-0) ) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :trans (behavior () (when (completed? (-> self ticker)) @@ -705,13 +691,11 @@ ) ) ) - (none) ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc b/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc index ac5fbe10e8a..0c0ed2f7b48 100644 --- a/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc @@ -685,7 +685,6 @@ (steam-cap-method-21 self) (suspend) ) - (none) ) :post (the-as (function none :behavior steam-cap) rider-post) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc index e3026af99db..528d4b68b3d 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc @@ -255,7 +255,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior blue-eco-charger-orb) ja-post) ) @@ -337,7 +336,6 @@ ) (suspend) ) - (none) ) ) :post (the-as (function none :behavior blue-eco-charger-orb) ja-post) @@ -429,7 +427,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior blue-eco-charger) ja-post) ) @@ -442,14 +439,12 @@ (sound-play "blue-eco-start") ) (blue-eco-charger-method-21 self #t) - (none) ) :trans (behavior () (if (blue-eco-charger-method-20 self) (set! (-> self state-time) (-> *display* base-frame-counter)) ) (update! (-> self sound)) - (none) ) :code (behavior ((arg0 symbol)) (ja-no-eval :num! (seek!)) @@ -478,7 +473,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior blue-eco-charger) ja-post) ) @@ -487,14 +481,12 @@ (defstate blue-eco-charger-stuck-open (blue-eco-charger) :trans (behavior () (update! (-> self sound)) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) @@ -502,7 +494,6 @@ (defstate blue-eco-charger-close (blue-eco-charger) :exit (behavior () (stop! (-> self sound)) - (none) ) :code (behavior () (ja-no-eval :num! (seek! 0.0)) @@ -521,7 +512,6 @@ ) (blue-eco-charger-method-21 self #f) (go blue-eco-charger-idle) - (none) ) :post (the-as (function none :behavior blue-eco-charger) ja-post) ) @@ -710,14 +700,14 @@ ;; failed to figure out what this is: (defstate exit-chamber-charger-puzzle (exit-chamber) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('notify) - (case (-> event param 0) + (case (-> block param 0) ((1) (when (zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) - (let* ((a1-2 (-> event param 1)) + (let* ((a1-2 (-> block param 1)) (v1-5 (logior (-> self chargers-active) (ash 1 a1-2))) ) (set! (-> self chargers-active) v1-5) @@ -732,7 +722,7 @@ ) ((2) (when (zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) - (let ((a1-6 (-> event param 1))) + (let ((a1-6 (-> block param 1))) (set! v0-0 (logclear (-> self chargers-active) (ash 1 a1-6))) ) (set! (-> self chargers-active) (the-as uint v0-0)) @@ -745,7 +735,6 @@ ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :code (behavior () (loop @@ -755,7 +744,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior exit-chamber) ja-post) ) @@ -779,22 +767,21 @@ ) (send-event (ppointer->process (-> self door)) 'trigger) (go exit-chamber-idle-in-sunken) - (none) ) ) ;; failed to figure out what this is: (defstate exit-chamber-idle-in-sunken (exit-chamber) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-1 object)) - (case event-type + (case message (('trigger) (go exit-chamber-rise) (return #t) v0-1 ) (('notify) - (when (and (= (-> proc type) fuel-cell) (= (-> event param 0) 'pickup)) + (when (and (= (-> proc type) fuel-cell) (= (-> block param 0) 'pickup)) (let ((a0-5 (handle->process (-> self fcell-handle)))) (when a0-5 (let ((v1-10 (new 'stack-no-clear 'vector))) @@ -810,7 +797,6 @@ ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :code (behavior () (save-reminder (get-task-control (game-task sunken-room)) 1 0) @@ -828,7 +814,6 @@ ) (suspend) ) - (none) ) ) @@ -836,13 +821,11 @@ (defstate exit-chamber-rise (exit-chamber) :enter (behavior () (set! (-> self move-player?) #f) - (none) ) :trans (behavior () (if (not (-> self move-player?)) (rider-trans) ) - (none) ) :code (behavior () (aybabtu 2) @@ -958,7 +941,6 @@ (suspend) ) (go exit-chamber-idle-in-village #f) - (none) ) :post (behavior () (if (-> self move-player?) @@ -966,19 +948,18 @@ (rider-post) ) (exit-chamber-method-23 self #t) - (none) ) ) ;; failed to figure out what this is: (defstate exit-chamber-idle-in-village (exit-chamber) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go exit-chamber-lower) ) (('notify) - (when (and (= (-> proc type) fuel-cell) (= (-> event param 0) 'pickup)) + (when (and (= (-> proc type) fuel-cell) (= (-> block param 0) 'pickup)) (let ((a0-5 (handle->process (-> self fcell-handle)))) (when a0-5 (let ((v1-8 (new 'stack-no-clear 'vector))) @@ -995,11 +976,9 @@ :enter (behavior ((arg0 symbol)) (logior! (-> self mask) (process-mask platform)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (behavior () (logclear! (-> self mask) (process-mask platform)) - (none) ) :trans (behavior () (rider-trans) @@ -1023,7 +1002,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol)) (set! (-> self move-player?) #f) @@ -1042,7 +1020,6 @@ (exit-chamber-method-20 self 1.0) (suspend) ) - (none) ) :post (behavior () (rider-post) @@ -1050,7 +1027,6 @@ (if (and *target* (>= (vector-vector-xz-distance (target-pos 0) (-> self last-pos)) 40960.0)) (spawn (-> self part) (-> self last-pos)) ) - (none) ) ) @@ -1063,7 +1039,6 @@ (clear-collide-with-as (-> (the-as fuel-cell v1-2) root-override)) ) ) - (none) ) :trans (behavior () (if (not (-> self move-player?)) @@ -1071,7 +1046,6 @@ ) (seek! (-> self wave-scale) 0.0 0.0016666667) (exit-chamber-method-20 self (-> self wave-scale)) - (none) ) :code (behavior () (let ((v1-1 (process-spawn @@ -1150,7 +1124,6 @@ ) (set-continue! *game-info* "sunkenb-start") (go exit-chamber-idle-in-sunken) - (none) ) :post (behavior () (if (-> self move-player?) @@ -1158,7 +1131,6 @@ (rider-post) ) (exit-chamber-method-23 self #t) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/sun-iris-door_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sun-iris-door_REF.gc index b9fc4606511..6e80d5ac6e0 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sun-iris-door_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sun-iris-door_REF.gc @@ -93,15 +93,15 @@ ;; failed to figure out what this is: (defstate sun-iris-door-closed (sun-iris-door) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go sun-iris-door-opening) ) (('move-to) (set! (-> self move-to?) #t) - (set! (-> self move-to-pos quad) (-> (the-as vector (-> event param 0)) quad)) - (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> event param 1))) + (set! (-> self move-to-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> block param 1))) ) ) ) @@ -111,14 +111,12 @@ (go sun-iris-door-opening) ) ) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (behavior () (when (-> self move-to?) @@ -127,21 +125,20 @@ (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) (ja-post) ) - (none) ) ) ;; failed to figure out what this is: (defstate sun-iris-door-opening (sun-iris-door) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go sun-iris-door-closing) ) (('move-to) (set! (-> self move-to?) #t) - (set! (-> self move-to-pos quad) (-> (the-as vector (-> event param 0)) quad)) - (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> event param 1))) + (set! (-> self move-to-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> block param 1))) ) ) ) @@ -154,7 +151,6 @@ ) (ja-post) (go sun-iris-door-open) - (none) ) :post (behavior () (cond @@ -168,7 +164,6 @@ (transform-post) ) ) - (none) ) ) @@ -227,8 +222,8 @@ ;; failed to figure out what this is: (defstate sun-iris-door-open (sun-iris-door) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (let ((v0-0 (the-as object (-> *display* base-frame-counter)))) (set! (-> self state-time) (the-as time-frame v0-0)) @@ -240,8 +235,8 @@ ) (('move-to) (set! (-> self move-to?) #t) - (set! (-> self move-to-pos quad) (-> (the-as vector (-> event param 0)) quad)) - (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> event param 1))) + (set! (-> self move-to-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> block param 1))) ) ) ) @@ -249,12 +244,10 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (clear-collide-with-as (-> self root-override)) (logior! (-> self draw status) (draw-status hidden)) - (none) ) :exit (behavior () (restore-collide-with-as (-> self root-override)) (logclear! (-> self draw status) (draw-status hidden)) - (none) ) :trans (behavior () (when (-> self proximity?) @@ -267,14 +260,12 @@ ) (go sun-iris-door-closing) ) - (none) ) :code (behavior () (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) :post (behavior () (when (-> self move-to?) @@ -283,21 +274,20 @@ (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) (ja-post) ) - (none) ) ) ;; failed to figure out what this is: (defstate sun-iris-door-closing (sun-iris-door) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go sun-iris-door-opening) ) (('move-to) (set! (-> self move-to?) #t) - (set! (-> self move-to-pos quad) (-> (the-as vector (-> event param 0)) quad)) - (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> event param 1))) + (set! (-> self move-to-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (quaternion-copy! (-> self move-to-quat) (the-as quaternion (-> block param 1))) ) ) ) @@ -310,7 +300,6 @@ ) (ja-post) (go sun-iris-door-closed) - (none) ) :post (behavior () (cond @@ -324,7 +313,6 @@ (transform-post) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-fish_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-fish_REF.gc index 29d63d7a7f4..49387c150d6 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-fish_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-fish_REF.gc @@ -227,7 +227,6 @@ (.svf (&-> v1-16 quad) vf1) ) (sunkenfisha-method-23 self) - (none) ) ) :code (behavior () @@ -238,7 +237,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior sunkenfisha) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-obs_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-obs_REF.gc index fd60581d276..62430c3889f 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-obs_REF.gc @@ -217,7 +217,6 @@ :virtual #t :exit (behavior () (set! (-> *screen-filter* draw?) #f) - (none) ) :code (behavior () (let ((v1-0 (-> self seq))) @@ -355,7 +354,6 @@ ) ) (go-virtual pov-camera-done-playing) - (none) ) ) @@ -402,7 +400,6 @@ (ja :num! (seek! max (-> self anim-speed))) ) ) - (none) ) :post (the-as (function none :behavior seaweed) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc index 259ba77235c..c6d6c81b3fe 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc @@ -575,14 +575,13 @@ (suspend) (send-event (handle->process (-> self prize 0 actor-handle)) 'anim #f) (go sunken-pipegame-idle) - (none) ) ) ;; failed to figure out what this is: (defstate sunken-pipegame-idle (sunken-pipegame) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (when (= (-> proc type) sunken-pipegame-button) (set! (-> self challenge) (-> (the-as sunken-pipegame-button proc) button-id)) @@ -595,14 +594,13 @@ (loop (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate sunken-pipegame-begin-play (sunken-pipegame) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notify) (case (-> proc type) ((fuel-cell buzzer) @@ -622,7 +620,6 @@ ) ) ) - (none) ) :code (behavior () (local-vars (v1-112 symbol)) @@ -870,7 +867,6 @@ ) (ambient-hint-spawn "st-lose" (the-as vector #f) *entity-pool* 'stinger) (go sunken-pipegame-end-play) - (none) ) ) @@ -882,7 +878,6 @@ (kill-current-level-hint '(camera) '() 'exit) ) (go sunken-pipegame-end-play) - (none) ) ) @@ -908,7 +903,6 @@ ) ) (go sunken-pipegame-idle) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-water_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-water_REF.gc index 0778bfdbb02..14812bae9f4 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-water_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-water_REF.gc @@ -105,15 +105,15 @@ ;; failed to figure out what this is: (defstate water-vol-idle (sunken-water) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('notify) - (if (= (-> event param 0) 'attack) + (if (= (-> block param 0) 'attack) (sound-play "get-shocked") ) ) (else - ((-> (method-of-type water-anim water-vol-idle) event) proc arg1 event-type event) + ((-> (method-of-type water-anim water-vol-idle) event) proc argc message block) ) ) ) @@ -191,7 +191,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior sunken-water) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc b/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc index 6de1157a143..b0c8ecfbc9b 100644 --- a/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc @@ -456,13 +456,13 @@ ;; failed to figure out what this is: (defstate target-tube-start (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) 'tube ) (else - (case event-type + (case message (('end-mode) (go target-jump @@ -472,20 +472,20 @@ ) ) (('touched) - (send-event proc 'attack (-> event param 0) 'tube 0 0) + (send-event proc 'attack (-> block param 0) 'tube 0 0) #f ) (('attack 'attack-or-shove 'attack-invinc) (target-attacked 'attack-or-shove - (the-as attack-info (-> event param 1)) + (the-as attack-info (-> block param 1)) proc - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) target-tube-hit ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -515,7 +515,6 @@ (send-event (handle->process (-> self tube tube)) 'end-mode) (target-exit) ) - (none) ) :code (behavior ((arg0 handle)) (send-event *camera* 'set-slave-option #x6000) @@ -567,7 +566,6 @@ (go target-tube) ) ) - (none) ) :post target-post ) @@ -631,7 +629,6 @@ :enter (behavior () (set! (-> self control unknown-surface00) *tube-mods*) (set! (-> self control surf) *tube-surface*) - (none) ) :exit (-> target-tube-start exit) :trans (behavior () @@ -646,7 +643,6 @@ ) (go target-tube-jump (-> *TARGET-bank* tube-jump-height-min) (-> *TARGET-bank* tube-jump-height-max)) ) - (none) ) :code (behavior () (case (ja-group) @@ -668,11 +664,9 @@ (target-tube-turn-anim) (suspend) ) - (none) ) :post (behavior () (target-tube-post) - (none) ) ) @@ -684,7 +678,6 @@ (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *tube-jump-mods*) - (none) ) :exit (-> target-tube-start exit) :trans (behavior () @@ -697,7 +690,6 @@ (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01))))) (-> *display* seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (ja-channel-push! 1 (seconds 0.05)) @@ -729,7 +721,6 @@ (suspend) (ja :group! (-> self draw art-group data 38) :num! (loop!)) ) - (none) ) :post (-> target-tube post) ) @@ -746,7 +737,6 @@ (-> self tube sidetube) (-> self tube foretube) ) - (none) ) :exit (behavior () (if (!= (-> self next-state name) 'target-tube-death) @@ -754,7 +744,6 @@ ) (logclear! (-> self state-flags) (state-flags sf02 do-not-notice grabbed first-person-mode)) ((-> target-tube-start exit)) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (let ((gp-0 (-> self attack-info))) @@ -846,7 +835,6 @@ ) ) (go target-tube) - (none) ) :post target-post ) @@ -860,7 +848,6 @@ (remove-setting! 'process-mask) (apply-settings *setting-control*) ((-> target-tube-start exit)) - (none) ) :code (behavior ((arg0 symbol)) (local-vars (v1-40 symbol)) @@ -891,7 +878,6 @@ (set! v1-40 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (not (movie?)))) ) (go target-tube) - (none) ) :post target-no-stick-post ) @@ -985,7 +971,6 @@ (eval-path-curve-div! (-> self path) (-> self root trans) 0.2 'interp) (path-control-method-12 (-> self path) (-> self rot) 0.2) (set! (-> self pos) 0.2) - (none) ) :trans (behavior () (if (and (and *target* (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) @@ -999,7 +984,6 @@ ) (go-virtual slide-control-ride) ) - (none) ) :code (the-as (function none :behavior slide-control) anim-loop) ) @@ -1007,8 +991,8 @@ ;; failed to figure out what this is: (defstate slide-control-ride (slide-control) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (go-virtual slide-control-watch) ) @@ -1022,10 +1006,10 @@ (if gp-0 (find-target-point (-> (the-as process-drawable gp-0) root trans)) ) - (set! (-> (the-as vector (-> event param 0)) quad) (-> self trans quad)) - (set! (-> (the-as vector (-> event param 1)) quad) (-> self rot quad)) - (set! (-> (the-as vector (-> event param 2)) quad) (-> self side quad)) - (eval-path-curve-div! (-> self path) (the-as vector (-> event param 3)) (+ 0.2 (-> self pos)) 'interp) + (set! (-> (the-as vector (-> block param 0)) quad) (-> self trans quad)) + (set! (-> (the-as vector (-> block param 1)) quad) (-> self rot quad)) + (set! (-> (the-as vector (-> block param 2)) quad) (-> self side quad)) + (eval-path-curve-div! (-> self path) (the-as vector (-> block param 3)) (+ 0.2 (-> self pos)) 'interp) (if (>= (-> self pos) (+ -0.2 (the float (+ (-> self path curve num-cverts) -1)))) (send-event gp-0 'end-mode) ) @@ -1038,12 +1022,10 @@ (set! (-> self pos) 0.0) (set! (-> self target) (process->handle *target*)) (process-entity-status! self (entity-perm-status bit-3) #t) - (none) ) :exit (behavior () (set! (-> self target) (the-as handle #f)) (process-entity-status! self (entity-perm-status bit-3) #f) - (none) ) :trans (behavior () (let ((gp-0 (handle->process (-> self target)))) @@ -1057,7 +1039,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior slide-control) anim-loop) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/wall-plat_REF.gc b/test/decompiler/reference/jak1/levels/sunken/wall-plat_REF.gc index e7a952f69c3..ae8501298b2 100644 --- a/test/decompiler/reference/jak1/levels/sunken/wall-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/wall-plat_REF.gc @@ -44,8 +44,8 @@ ;; failed to figure out what this is: (defstate wall-plat-retracted (wall-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go wall-plat-extending) ) @@ -60,24 +60,21 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate wall-plat-extending (wall-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) ) :enter (behavior () (sound-play "wall-plat") - (none) ) :trans (the-as (function none :behavior wall-plat) rider-trans) :code (behavior () @@ -94,15 +91,14 @@ (go wall-plat-extended) ) ) - (none) ) :post (the-as (function none :behavior wall-plat) rider-post) ) ;; failed to figure out what this is: (defstate wall-plat-extended (wall-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go wall-plat-retracting) ) @@ -116,24 +112,21 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate wall-plat-retracting (wall-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) ) :enter (behavior () (sound-play "wall-plat") - (none) ) :trans (the-as (function none :behavior wall-plat) rider-trans) :code (behavior () @@ -149,29 +142,25 @@ (go wall-plat-retracted) ) ) - (none) ) :post (the-as (function none :behavior wall-plat) rider-post) ) ;; failed to figure out what this is: (defstate wall-plat-sync-idle (wall-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (the-as (function none :behavior wall-plat) rider-trans) :code (behavior () @@ -203,7 +192,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior wall-plat) rider-post) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/wedge-plats_REF.gc b/test/decompiler/reference/jak1/levels/sunken/wedge-plats_REF.gc index a1d1b7442e6..e33703404f5 100644 --- a/test/decompiler/reference/jak1/levels/sunken/wedge-plats_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/wedge-plats_REF.gc @@ -45,7 +45,6 @@ ) (suspend) ) - (none) ) ) @@ -137,13 +136,12 @@ ;; failed to figure out what this is: (defstate wedge-plat-idle (wedge-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as symbol (baseplat-method-22 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + ) ) :trans (the-as (function none :behavior wedge-plat) plat-trans) :code (behavior () @@ -154,24 +152,22 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior wedge-plat) plat-post) ) ;; failed to figure out what this is: (defstate wedge-plat-tip (wedge-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as symbol (baseplat-method-22 self)) - ) - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) ) :trans (the-as (function none :behavior wedge-plat) plat-trans) :code (behavior () @@ -209,7 +205,6 @@ (ja :num! (seek! (ja-aframe 153.0 0))) ) (go wedge-plat-idle) - (none) ) :post (the-as (function none :behavior wedge-plat) plat-post) ) @@ -315,13 +310,12 @@ ;; failed to figure out what this is: (defstate wedge-plat-outer-idle (wedge-plat-outer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as symbol (baseplat-method-22 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + ) ) :trans (the-as (function none :behavior wedge-plat-outer) plat-trans) :code (behavior () @@ -332,23 +326,21 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior wedge-plat-outer) plat-post) ) ;; failed to figure out what this is: (defstate wedge-plat-outer-tip (wedge-plat-outer) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (baseplat-method-22 self)) - ) - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (baseplat-method-22 self) + ) + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + ) + ) ) :trans (the-as (function none :behavior wedge-plat-outer) plat-trans) :code (behavior () @@ -386,7 +378,6 @@ (ja :num! (seek! (ja-aframe 153.0 0))) ) (go wedge-plat-outer-idle) - (none) ) :post (the-as (function none :behavior wedge-plat-outer) plat-post) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc b/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc index a12e3aa8f23..541e705ed82 100644 --- a/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc @@ -353,7 +353,6 @@ (update-vol! (-> self sound) (the int (* 100.0 f0-9))) ) ) - (none) ) :code (the-as (function none :behavior whirlpool) anim-loop) :post (the-as (function none :behavior whirlpool) ja-post) diff --git a/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc b/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc index 61fee01b4cc..64be4bbda5a 100644 --- a/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc @@ -107,15 +107,14 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior billy-snack) ja-post) ) ;; failed to figure out what this is: (defstate billy-snack-idle (billy-snack) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('eat) (go billy-snack-eat) ) @@ -129,7 +128,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior billy-snack) ja-post) ) @@ -186,7 +184,6 @@ :virtual #t :enter (behavior () (go-virtual nav-enemy-chase) - (none) ) :post (the-as (function none :behavior billy-rat) nav-enemy-common-post) ) @@ -204,7 +201,6 @@ ) (send-event (ppointer->process (-> self billy)) 'billy-rat-die) (cleanup-for-death self) - (none) ) ) @@ -212,7 +208,6 @@ (defstate billy-rat-eat (billy-rat) :trans (behavior () (seek-to-point-toward-point! (-> self collide-info) (-> self destination) 131072.0 (seconds 0.01)) - (none) ) :code (behavior () (send-event (handle->process (-> self snack)) 'eat) @@ -227,7 +222,6 @@ (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) (logclear! (-> self nav flags) (nav-control-flags navcf19)) (go-virtual nav-enemy-chase) - (none) ) :post (the-as (function none :behavior billy-rat) nav-enemy-simple-post) ) @@ -258,7 +252,6 @@ (go billy-rat-eat) (go-virtual nav-enemy-chase) ) - (none) ) :post (the-as (function none :behavior billy-rat) nav-enemy-simple-post) ) @@ -279,7 +272,6 @@ (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) ) ) - (none) ) ) @@ -288,7 +280,6 @@ :virtual #t :enter (behavior () (go-virtual nav-enemy-chase) - (none) ) ) @@ -302,12 +293,10 @@ ) (go-virtual nav-enemy-victory) ) - (none) ) :post (behavior () (swamp-rat-update-wiggle-target (-> self destination)) (nav-enemy-travel-post) - (none) ) ) @@ -503,6 +492,7 @@ ) ;; definition for method 38 of type billy +;; INFO: Return type mismatch object vs none. (defmethod process-taskable-method-38 billy ((obj billy)) (case (current-status (-> obj tasks)) (((task-status need-reminder-a) (task-status need-reminder)) @@ -533,23 +523,22 @@ ;; failed to figure out what this is: (defstate billy-done (billy) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('billy-rat-needs-destination) - (let* ((gp-0 proc) - (v1-2 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) billy-rat)) - gp-0 - ) - ) - ) - (when v1-2 - (set! (-> (the-as billy-rat v1-2) dest-type) (the-as uint 1)) - (get-random-point (-> self path-waypts) (-> (the-as billy-rat v1-2) destination)) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('billy-rat-needs-destination) + (let* ((gp-0 proc) + (v1-2 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) billy-rat)) + gp-0 ) - ) - ) - ) + ) + ) + (when v1-2 + (set! (-> (the-as billy-rat v1-2) dest-type) (the-as uint 1)) + (get-random-point (-> self path-waypts) (-> (the-as billy-rat v1-2) destination)) + ) + ) + ) + ) ) :enter (behavior () (init! @@ -592,13 +581,11 @@ ) ) ) - (none) ) :exit (behavior () (billy-kill-all-but-farthy) (send-event *camera* 'change-target *target*) (send-event *camera* 'change-state *camera-base-mode* 0) - (none) ) :trans (behavior () (cond @@ -628,12 +615,10 @@ ) ) (spool-push *art-control* "billy-reject" 0 self -99.0) - (none) ) :code (the-as (function none :behavior billy) process-taskable-anim-loop) :post (behavior () (ja-post) - (none) ) ) @@ -825,8 +810,8 @@ ;; failed to figure out what this is: (defstate billy-playing (billy) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('billy-rat-die) (+! (-> self num-rats) -1) (let* ((f0-2 (rand-float-gen)) @@ -995,19 +980,16 @@ (set! a1-8 (car gp-2)) ) ) - (none) ) :exit (behavior () (restore-collide-with-as (-> self root-override)) (restore-load-state-and-cleanup *load-state*) (set! (-> *ACTOR-bank* birth-max) 1000) (remove-setting! 'music) - (none) ) :trans (behavior () (spool-push *art-control* "billy-resolution" 0 self -99.0) (spool-push *art-control* "billy-reject" 0 self -99.0) - (none) ) :code (behavior () (loop @@ -1020,11 +1002,9 @@ ) (suspend) ) - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -1045,7 +1025,6 @@ ) ) ) - (none) ) ) @@ -1119,7 +1098,6 @@ :exit (behavior () (billy-kill-all-but-farthy) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) ) @@ -1153,7 +1131,6 @@ ) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc b/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc index d61d537110f..503a5330fa0 100644 --- a/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc @@ -466,6 +466,7 @@ ;; definition for function joint-mod-tracker-callback ;; INFO: Used lq/sq +;; INFO: Return type mismatch object vs none. (defun joint-mod-tracker-callback ((arg0 cspace) (arg1 transformq)) (let ((s4-0 (the-as joint-mod-tracker (-> arg0 param1)))) (cond @@ -559,21 +560,19 @@ ;; failed to figure out what this is: (defstate kermit-pulse-idle (kermit-pulse) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) - (send-event proc 'attack (-> event param 0) (new 'static 'attack-info)) + (send-event proc 'attack (-> block param 0) (new 'static 'attack-info)) (go kermit-pulse-impact) ) ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :code (behavior () (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) @@ -591,11 +590,9 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (behavior () (update-transforms! (-> self root-override)) - (none) ) ) @@ -615,7 +612,6 @@ :to *entity-pool* ) (cleanup-for-death self) - (none) ) ) @@ -1004,7 +1000,6 @@ nav-enemy-default-event-handler :enter (behavior () (set! (-> self notice-time) 0) 0 - (none) ) :trans (behavior () (if (and *target* (>= (-> self enemy-info idle-distance) @@ -1013,7 +1008,6 @@ nav-enemy-default-event-handler ) (go kermit-patrol) ) - (none) ) :code (behavior () (kermit-disable-tongue) @@ -1022,7 +1016,6 @@ nav-enemy-default-event-handler (ja :num! (loop!)) (suspend) ) - (none) ) :post (the-as (function none :behavior kermit) ja-post) ) @@ -1038,7 +1031,6 @@ nav-enemy-default-event-handler (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) (kermit-get-new-patrol-point) (nav-control-method-11 (-> self nav) (-> self nav target-pos)) - (none) ) :trans (behavior () (if (and (or (not *target*) (< (-> self enemy-info idle-distance) @@ -1056,7 +1048,6 @@ nav-enemy-default-event-handler (if (logtest? (nav-control-flags navcf19) (-> self nav flags)) (kermit-get-new-patrol-point) ) - (none) ) :code (behavior () (loop @@ -1067,7 +1058,6 @@ nav-enemy-default-event-handler ) (kermit-hop 20480.0) ) - (none) ) :post kermit-post ) @@ -1080,18 +1070,15 @@ nav-enemy-default-event-handler ) :enter (behavior () (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) - (none) ) :trans (behavior () (kermit-set-rotate-dir-to-player) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) (kermit-hop 0.0) (go kermit-chase) - (none) ) :post kermit-post ) @@ -1104,11 +1091,9 @@ nav-enemy-default-event-handler ) :enter (behavior () (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) - (none) ) :code (behavior () (go kermit-patrol) - (none) ) :post kermit-simple-post ) @@ -1142,7 +1127,6 @@ nav-enemy-default-event-handler ) ) (nav-control-method-11 (-> self nav) (-> self nav target-pos)) - (none) ) :trans (behavior () (when (not (-> self airborne)) @@ -1154,7 +1138,6 @@ nav-enemy-default-event-handler (go kermit-chase) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.17)) @@ -1169,7 +1152,6 @@ nav-enemy-default-event-handler (kermit-hop 81920.0) (nop!) ) - (none) ) :post kermit-post ) @@ -1185,7 +1167,6 @@ nav-enemy-default-event-handler (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) (kermit-set-nav-mesh-target (-> self collide-info trans)) (nav-control-method-11 (-> self nav) (-> self nav target-pos)) - (none) ) :trans (behavior () (kermit-set-nav-mesh-target (-> self collide-info trans)) @@ -1218,7 +1199,6 @@ nav-enemy-default-event-handler (go kermit-give-up) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.17)) @@ -1232,7 +1212,6 @@ nav-enemy-default-event-handler (kermit-hop 81920.0) ) ) - (none) ) :post kermit-post ) @@ -1288,7 +1267,6 @@ nav-enemy-default-event-handler ) ) ) - (none) ) :post kermit-simple-post ) @@ -1305,7 +1283,6 @@ nav-enemy-default-event-handler (kermit-enable-tongue) (set! (-> self tongue-pulse-pos) 0.0) (spawn-kermit-pulse self (kermit-tongue-pos self) (-> self entity)) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) @@ -1314,7 +1291,6 @@ nav-enemy-default-event-handler (deactivate (-> v1-0 0)) ) ) - (none) ) :trans (behavior () (let ((s5-0 (kermit-player-target-pos)) @@ -1348,7 +1324,6 @@ nav-enemy-default-event-handler ) (send-event *target* 'tongue gp-0) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1360,12 +1335,10 @@ nav-enemy-default-event-handler (ja :num! (seek!)) ) ) - (none) ) :post (behavior () (seek-to-point-toward-point! (-> self collide-info) (target-pos 0) (-> self rotate-speed) (seconds 0.05)) (kermit-simple-post) - (none) ) ) @@ -1379,12 +1352,10 @@ nav-enemy-default-event-handler (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self charged-up) #f) (+! (-> self miss-count) 1) - (none) ) :exit (behavior () (set! (-> self tongue-control forward-scale-control) 0.0) (kermit-disable-tongue) - (none) ) :trans (behavior () (kermit-set-nav-mesh-target (-> self collide-info trans)) @@ -1396,7 +1367,6 @@ nav-enemy-default-event-handler (go kermit-chase) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1419,7 +1389,6 @@ nav-enemy-default-event-handler ) (kermit-hop 0.0) ) - (none) ) :post kermit-post ) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-bat_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-bat_REF.gc index 2f2c07332af..5ba154d374c 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-bat_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-bat_REF.gc @@ -299,7 +299,6 @@ swamp-bat-slave-event-handler (+! f30-2 (* 32768.0 (-> *display* seconds-per-frame) (-> self idle-anim-speed))) ) ) - (none) ) :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) ) @@ -331,7 +330,6 @@ swamp-bat-slave-event-handler ) ) ) - (none) ) :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) ) @@ -360,7 +358,6 @@ swamp-bat-slave-event-handler (ja :num! (loop!)) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) ) @@ -379,7 +376,6 @@ swamp-bat-slave-event-handler (ja :num! (loop!)) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) ) @@ -411,7 +407,6 @@ swamp-bat-slave-event-handler (suspend) ) ) - (none) ) :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) ) @@ -440,7 +435,6 @@ swamp-bat-slave-event-handler ) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) ) @@ -604,7 +598,6 @@ swamp-bat-slave-event-handler ) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-bat) #f) ) @@ -642,7 +635,6 @@ swamp-bat-slave-event-handler ) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-bat) #f) ) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc index 0edf511ce91..8b0d8365801 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc @@ -276,23 +276,21 @@ ) ) ) - (none) ) :post swamp-spike-post ) ;; failed to figure out what this is: (defstate swamp-spike-gate-up (swampgate) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('trigger) - (let ((v0-0 #t)) - (set! (-> self open-gate) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (let ((v0-0 #t)) + (set! (-> self open-gate) v0-0) + v0-0 + ) + ) + ) ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -318,7 +316,6 @@ (ja :num! (seek!)) ) (go swamp-spike-gate-down) - (none) ) :post (the-as (function none :behavior swampgate) swamp-spike-post) ) @@ -328,7 +325,6 @@ :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior swampgate) swamp-spike-post) ) @@ -455,16 +451,15 @@ ;; failed to figure out what this is: (defstate balance-plat-idle (balance-plat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('grow) - (let ((v0-0 #t)) - (set! (-> self got-grow) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('grow) + (let ((v0-0 #t)) + (set! (-> self got-grow) v0-0) + v0-0 + ) + ) + ) ) :trans (the-as (function none :behavior balance-plat) rider-trans) :code (behavior () @@ -505,7 +500,6 @@ (set! (-> self root-override trans y) (+ (-> self y-init) (-> self y-offset))) (suspend) ) - (none) ) :post (the-as (function none :behavior balance-plat) rider-post) ) @@ -675,17 +669,16 @@ ) (cleanup-for-death self) (deactivate self) - (none) ) :post (the-as (function none :behavior swamp-rock) ja-post) ) ;; failed to figure out what this is: (defstate swamp-rock-idle (swamp-rock) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (if (and (>= arg1 2) (= (-> event param 1) 'eco-yellow)) + (if (and (>= argc 2) (= (-> block param 1) 'eco-yellow)) (go swamp-rock-break) ) ) @@ -697,7 +690,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) @@ -840,13 +832,11 @@ :virtual #t :enter (behavior () (ja-channel-set! 0) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior tar-plat) ja-post) ) @@ -875,7 +865,6 @@ (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -884,7 +873,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior tar-plat) rigid-body-platform-post) ) @@ -1041,7 +1029,6 @@ ) ) (go-virtual battlecontroller-active) - (none) ) ) @@ -1055,6 +1042,5 @@ (-> (method-of-type battlecontroller battlecontroller-die) code) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc index d5c27c9069e..891f7de7cbd 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc @@ -792,7 +792,6 @@ (ja :num-func num-func-identity :frame-num max) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) ) @@ -805,7 +804,6 @@ (if (<= (-> self parent-process 0 hit-points) 0) (go swamp-rat-nest-dummy-die) ) - (none) ) :code (behavior () (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) @@ -817,7 +815,6 @@ (ja :num! (seek!)) ) (go swamp-rat-nest-dummy-idle) - (none) ) :post (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) ) @@ -832,7 +829,6 @@ (ja :num! (seek!)) ) (go swamp-rat-nest-dummy-idle) - (none) ) :post (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) ) @@ -862,7 +858,6 @@ (suspend) ) (deactivate self) - (none) ) ) @@ -994,8 +989,8 @@ swamp-rat-nest-default-event-handler ;; failed to figure out what this is: (defstate swamp-rat-nest-idle (swamp-rat-nest) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hit) (go swamp-rat-nest-active) ) @@ -1003,7 +998,6 @@ swamp-rat-nest-default-event-handler ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (and *target* (>= (-> self fact-override idle-distance) @@ -1012,14 +1006,12 @@ swamp-rat-nest-default-event-handler ) (go swamp-rat-nest-active) ) - (none) ) :code (behavior () (swamp-rat-nest-check-dummy) (loop (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-rat-nest) #f) ) @@ -1029,7 +1021,6 @@ swamp-rat-nest-default-event-handler :event swamp-rat-nest-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (swamp-rat-nest-check-dummy) @@ -1050,13 +1041,11 @@ swamp-rat-nest-default-event-handler ) ) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-rat-nest) #f) ) @@ -1066,7 +1055,6 @@ swamp-rat-nest-default-event-handler :event swamp-rat-nest-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (swamp-rat-nest-check-dummy) @@ -1077,13 +1065,11 @@ swamp-rat-nest-default-event-handler (swamp-rat-nest-spawn-rat) (go swamp-rat-nest-active) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-rat-nest) #f) ) @@ -1108,7 +1094,6 @@ swamp-rat-nest-default-event-handler ) ) (go swamp-rat-nest-active) - (none) ) :post (the-as (function none :behavior swamp-rat-nest) #f) ) @@ -1123,7 +1108,6 @@ swamp-rat-nest-default-event-handler (while (-> self child-process) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-rat-nest) #f) ) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc index 9221ee8fa14..fa2196a7486 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc @@ -74,15 +74,14 @@ ) ;; definition for function swamp-rat-default-event-handler -;; INFO: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 7] (defbehavior swamp-rat-default-event-handler swamp-rat ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (if (= v1-0 'victory) - (go-virtual nav-enemy-victory) - (nav-enemy-default-event-handler arg0 arg1 arg2 arg3) - ) - ) + (case arg2 + (('victory) + (go-virtual nav-enemy-victory) + ) + (else + (nav-enemy-default-event-handler arg0 arg1 arg2 arg3) + ) ) ) @@ -135,7 +134,6 @@ swamp-rat-default-event-handler :event swamp-rat-default-event-handler :post (behavior () (ja-post) - (none) ) ) @@ -156,7 +154,6 @@ swamp-rat-default-event-handler ) ) ) - (none) ) ) @@ -175,7 +172,6 @@ swamp-rat-default-event-handler ) (ja-no-eval :num! (seek!)) (go-virtual nav-enemy-chase) - (none) ) ) @@ -222,7 +218,6 @@ swamp-rat-default-event-handler (go-virtual nav-enemy-victory) ) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) - (none) ) :code (behavior () (set! (-> self target-nav-time) (-> *display* base-frame-counter)) @@ -239,12 +234,10 @@ swamp-rat-default-event-handler (suspend) (ja :num! (loop!)) ) - (none) ) :post (behavior () (swamp-rat-update-wiggle-target (target-pos 0)) (nav-enemy-travel-post) - (none) ) ) @@ -285,7 +278,6 @@ swamp-rat-default-event-handler ) ) ) - (none) ) ) @@ -314,7 +306,6 @@ swamp-rat-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) - (none) ) ) @@ -330,7 +321,6 @@ swamp-rat-default-event-handler (ja :num! (seek!)) ) (go-virtual nav-enemy-victory) - (none) ) ) @@ -394,7 +384,6 @@ swamp-rat-default-event-handler (go-virtual nav-enemy-chase) (go-virtual nav-enemy-idle) ) - (none) ) :post (the-as (function none :behavior swamp-rat) nav-enemy-simple-post) ) diff --git a/test/decompiler/reference/jak1/levels/title/title-obs_REF.gc b/test/decompiler/reference/jak1/levels/title/title-obs_REF.gc index 99ef3e942bb..5db52dceb94 100644 --- a/test/decompiler/reference/jak1/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/title/title-obs_REF.gc @@ -142,29 +142,28 @@ ;; failed to figure out what this is: (defstate idle (logo-slave) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 uint)) - (the-as object (case event-type - (('blend-shape) - (cond - ((-> event param 0) - (set! v0-0 (the-as uint (logior (-> self skel status) (janim-status blerc eye)))) - (set! (-> self skel status) (the-as janim-status v0-0)) - ) - (else - (set! v0-0 (the-as uint (logclear (-> self skel status) (janim-status blerc eye)))) - (set! (-> self skel status) (the-as janim-status v0-0)) - ) - ) - v0-0 - ) - (('origin-joint-index) - (set! v0-0 (-> event param 0)) - (set! (-> self draw origin-joint-index) v0-0) - v0-0 - ) - ) - ) + (case message + (('blend-shape) + (cond + ((-> block param 0) + (set! v0-0 (the-as uint (logior (-> self skel status) (janim-status blerc eye)))) + (set! (-> self skel status) (the-as janim-status v0-0)) + ) + (else + (set! v0-0 (the-as uint (logclear (-> self skel status) (janim-status blerc eye)))) + (set! (-> self skel status) (the-as janim-status v0-0)) + ) + ) + v0-0 + ) + (('origin-joint-index) + (set! v0-0 (-> block param 0)) + (set! (-> self draw origin-joint-index) v0-0) + v0-0 + ) + ) ) :code (behavior () (ja-post) @@ -185,7 +184,6 @@ ) (suspend) ) - (none) ) ) @@ -214,13 +212,12 @@ ;; failed to figure out what this is: (defstate startup (logo) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('update) - (the-as symbol (remove-setting! 'process-mask)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('update) + (remove-setting! 'process-mask) + ) + ) ) :exit (behavior () (let ((a0-0 (-> self anim))) @@ -235,7 +232,6 @@ ) ) ) - (none) ) :trans (behavior () (if (not (none-reserved? *art-control*)) @@ -244,7 +240,6 @@ (if (nonzero? (-> self next-anim)) (spool-push *art-control* (-> self next-anim name) 0 self -1.0) ) - (none) ) :code (behavior () (while (!= (file-status *art-control* (-> self next-anim name) 0) 'active) @@ -365,7 +360,6 @@ ) (remove-exit) (go-virtual idle) - (none) ) :post (behavior () (if *progress-process* @@ -399,7 +393,6 @@ (set-trs! (-> self main-joint) a1-0 (the-as quaternion #f) a3-0) ) (ja-post) - (none) ) ) @@ -441,7 +434,6 @@ (the-as (function process-drawable symbol) false-func) ) ) - (none) ) :post (-> (method-of-type logo startup) post) ) @@ -453,7 +445,6 @@ (if (nonzero? (-> self next-anim)) (spool-push *art-control* (-> self next-anim name) 0 self -1.0) ) - (none) ) :code (behavior () (ja-channel-set! 0) @@ -476,20 +467,18 @@ (set! *camera-look-through-other* 2) (suspend) ) - (none) ) ) ;; failed to figure out what this is: (defstate ndi (logo) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('blackout) - (the-as symbol (set-setting! 'bg-a 'abs 1.0 0)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('blackout) + (set-setting! 'bg-a 'abs 1.0 0) + ) + ) ) :enter (behavior () (set-setting! 'bg-a 'abs 0.0 0) @@ -499,12 +488,10 @@ (set! (-> *time-of-day-proc* 0 hour) 12) ) (set! (-> self done?) #f) - (none) ) :exit (behavior () ((-> (method-of-type logo startup) exit)) (set-blackout-frames (seconds 0.035)) - (none) ) :trans (behavior () ((-> (method-of-type logo startup) trans)) @@ -538,7 +525,6 @@ (if *time-of-day-proc* (set! (-> *time-of-day-proc* 0 hour) 12) ) - (none) ) :code (behavior () (while (!= (file-status *art-control* (-> self next-anim name) 0) 'active) @@ -583,11 +569,9 @@ (set! (-> self done?) #t) (set-setting! 'bg-a 'abs 1.0 0) (anim-loop) - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -693,7 +677,6 @@ (ja-channel-set! 0) (ja-post) (send-event *camera* 'change-state cam-fixed 0) - (none) ) :exit (behavior () (when (not (or (= (-> self next-state name) 'target-title-play) (= (-> self next-state name) 'target-title-wait))) @@ -701,13 +684,11 @@ (deactivate (-> self manipy 0)) ) ) - (none) ) :trans (behavior () (hide-hud-quick) (spool-push *art-control* "ndi-intro" 0 self -1.0) (sound-group-pause (sound-group music)) - (none) ) :code (behavior () (let ((gp-0 (the-as handle #f))) @@ -795,33 +776,28 @@ ) ) (go target-title-play) - (none) ) :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-title-play (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'wait) - (go target-title-wait) - ) - ((= v1-0 'reset) - (the-as object (deactivate (-> self manipy 0))) - ) - (else - (target-generic-event-handler proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('wait) + (go target-title-wait) + ) + (('reset) + (deactivate (-> self manipy 0)) + ) + (else + (target-generic-event-handler proc argc message block) + ) ) ) :enter (behavior () (set-setting! 'allow-pause #f 0.0 0) (set-setting! 'allow-progress #f 0.0 0) - (none) ) :exit (-> target-title exit) :trans (the-as (function none :behavior target) hide-hud-quick) @@ -831,20 +807,17 @@ ;; failed to figure out what this is: (defstate target-title-wait (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'play) - (go target-title-play) - ) - ((= v1-0 'reset) - (the-as object (deactivate (-> self manipy 0))) - ) - (else - (target-generic-event-handler proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('play) + (go target-title-play) + ) + (('reset) + (deactivate (-> self manipy 0)) + ) + (else + (target-generic-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -857,7 +830,6 @@ (set! (-> *time-of-day-proc* 0 time-ratio) 18000.0) (set! *time-of-day-fast* #t) ) - (none) ) :exit (behavior () (when *time-of-day-proc* @@ -866,7 +838,6 @@ ) (remove-setting! 'allow-pause) ((-> target-title exit)) - (none) ) :trans (behavior () (hide-hud-quick) @@ -888,7 +859,6 @@ (print-game-text (lookup-text! *common-text* (text-id press-start) #f) gp-0 #f 128 22) ) ) - (none) ) :code (the-as (function none :behavior target) anim-loop) :post target-no-move-post diff --git a/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc b/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc index fce5db3bfa1..e405759b3bf 100644 --- a/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc @@ -226,7 +226,6 @@ ) (suspend) ) - (none) ) ) @@ -677,105 +676,100 @@ ;; failed to figure out what this is: (defstate idle (scarecrow-a) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (let* ((s3-0 (-> event param 2)) - (s4-0 (get-task-control (game-task training-gimmie))) - (v1-2 (get-reminder s4-0 0)) - ) - (when (!= s3-0 (-> self incomming-attack-id)) - (set! (-> self incomming-attack-id) s3-0) - (cond - ((= (-> self type) scarecrow-b) - ) - ((and (= (-> event param 1) 'spin) (zero? v1-2)) - (save-reminder s4-0 1 0) - 1 - ) - ((and (= (-> event param 1) 'punch) (= v1-2 1)) - (save-reminder s4-0 2 0) - 2 - ) - ((zero? v1-2) - ) - ((= v1-2 1) - ) - ) - (let* ((s4-1 proc) - (v1-14 (if (and (nonzero? s4-1) (type-type? (-> s4-1 type) process-drawable)) - s4-1 - ) - ) - (f30-0 - (cond - (v1-14 - (let ((s4-2 (-> self root-override)) - (s2-0 (-> (the-as process-drawable v1-14) root trans)) - ) - (deg-diff (y-angle s4-2) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-2 trans)))) - ) - ) - (else - 0.0 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let* ((s3-0 (-> block param 2)) + (s4-0 (get-task-control (game-task training-gimmie))) + (v1-2 (get-reminder s4-0 0)) + ) + (when (!= s3-0 (-> self incomming-attack-id)) + (set! (-> self incomming-attack-id) s3-0) + (cond + ((= (-> self type) scarecrow-b) + ) + ((and (= (-> block param 1) 'spin) (zero? v1-2)) + (save-reminder s4-0 1 0) + 1 + ) + ((and (= (-> block param 1) 'punch) (= v1-2 1)) + (save-reminder s4-0 2 0) + 2 + ) + ((zero? v1-2) + ) + ((= v1-2 1) + ) + ) + (let* ((s4-1 proc) + (v1-14 (if (and (nonzero? s4-1) (type-type? (-> s4-1 type) process-drawable)) + s4-1 + ) + ) + (f30-0 + (cond + (v1-14 + (let ((s4-2 (-> self root-override)) + (s2-0 (-> (the-as process-drawable v1-14) root trans)) + ) + (deg-diff (y-angle s4-2) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-2 trans)))) ) ) + (else + 0.0 + ) ) - (a0-24 ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint -1) - ) - ) ) - (go-virtual - hit - f30-0 - (if a0-24 - (get-middle-of-bsphere-overlap a0-24 (-> self intersection)) - (target-pos 0) - ) - (the-as - symbol - (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 2) + (a0-24 ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint -1) + ) ) - (or (= (-> self type) scarecrow-a) - (and (= (-> proc type) target) - (logtest? (-> (the-as target proc) control unknown-surface00 flags) (surface-flags jump)) - (not (logtest? (-> (the-as target proc) control status) (cshape-moving-flags onsurf))) - ) - ) - ) + ) + (go-virtual + hit + f30-0 + (if a0-24 + (get-middle-of-bsphere-overlap a0-24 (-> self intersection)) + (target-pos 0) ) + (the-as + symbol + (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 2) + ) + (or (= (-> self type) scarecrow-a) + (and (= (-> proc type) target) + (logtest? (-> (the-as target proc) control unknown-surface00 flags) (surface-flags jump)) + (not (logtest? (-> (the-as target proc) control status) (cshape-moving-flags onsurf))) + ) + ) + ) ) ) ) ) ) - (('touch) - (the-as object (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> event param 0)) - 0.7 - 6144.0 - 16384.0 - ) - ) + ) + (('touch) + (send-shove-back + (-> self root-override) + proc + (the-as touching-shapes-entry (-> block param 0)) + 0.7 + 6144.0 + 16384.0 ) - ) + ) ) ) :trans (behavior () (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (get-reminder (get-task-control (game-task training-gimmie)) 0) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.12)) @@ -786,7 +780,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior scarecrow-a) ja-post) ) @@ -863,7 +856,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior scarecrow-a) ja-post) ) @@ -930,7 +922,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior scarecrow-b) ja-post) ) @@ -1010,7 +1001,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior scarecrow-b) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/village1/assistant_REF.gc b/test/decompiler/reference/jak1/levels/village1/assistant_REF.gc index baf9ceb703c..56b2aae350f 100644 --- a/test/decompiler/reference/jak1/levels/village1/assistant_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/assistant_REF.gc @@ -49,6 +49,7 @@ ) ;; definition for method 48 of type assistant +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow assistant ((obj assistant)) (-> obj draw shadow-ctrl) (cond @@ -289,7 +290,6 @@ ) ) ) - (none) ) ) @@ -380,6 +380,7 @@ ) ;; definition for method 11 of type assistant +;; INFO: Return type mismatch object vs none. (defmethod init-from-entity! assistant ((obj assistant) (arg0 entity-actor)) (process-taskable-method-40 obj arg0 *assistant-sg* 3 31 (new 'static 'vector :w 4096.0) 5) (set! (-> obj bounce-away) #f) diff --git a/test/decompiler/reference/jak1/levels/village1/explorer_REF.gc b/test/decompiler/reference/jak1/levels/village1/explorer_REF.gc index 636b7abe2be..f8be8a9e5cc 100644 --- a/test/decompiler/reference/jak1/levels/village1/explorer_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/explorer_REF.gc @@ -47,6 +47,7 @@ ) ;; definition for method 48 of type explorer +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow explorer ((obj explorer)) (-> obj draw shadow-ctrl) (cond @@ -341,7 +342,6 @@ ) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc b/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc index 9ab91be84fb..23a550d4246 100644 --- a/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc @@ -1013,7 +1013,6 @@ ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (fishermans-boat-leave-dock?) @@ -1023,7 +1022,6 @@ (if (nonzero? (-> self anim)) (spool-push *art-control* (-> self anim name) 0 self -99.0) ) - (none) ) :code (behavior () (set! (-> self anim) (new 'static 'spool-anim @@ -1047,7 +1045,6 @@ (fishermans-boat-set-dock-point 0) (fishermans-boat-set-path-point 0) (anim-loop) - (none) ) :post fishermans-boat-post ) @@ -1063,7 +1060,6 @@ (go fishermans-boat-player-control) ) (rider-trans) - (none) ) :code (behavior () (load-state-want-levels 'village1 'misty) @@ -1092,7 +1088,6 @@ (loop (suspend) ) - (none) ) :post fishermans-boat-post ) @@ -1112,7 +1107,6 @@ ) ) (rider-trans) - (none) ) :code (behavior () (load-state-want-levels 'village1 'beach) @@ -1120,7 +1114,6 @@ (fishermans-boat-set-dock-point 0) (fishermans-boat-set-path-point 5) (anim-loop) - (none) ) :post fishermans-boat-post ) @@ -1133,7 +1126,6 @@ ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (if (fishermans-boat-leave-dock?) @@ -1143,7 +1135,6 @@ (if (nonzero? (-> self anim)) (spool-push *art-control* (-> self anim name) 0 self -99.0) ) - (none) ) :code (behavior () (if #t @@ -1193,7 +1184,6 @@ (fishermans-boat-set-dock-point 4) (fishermans-boat-set-path-point 4) (anim-loop) - (none) ) :post fishermans-boat-post ) @@ -1209,7 +1199,6 @@ (go fishermans-boat-player-control) ) (rider-trans) - (none) ) :code (behavior () (set! (-> self cam-tracker) @@ -1237,7 +1226,6 @@ (loop (suspend) ) - (none) ) :post fishermans-boat-post ) @@ -1255,7 +1243,6 @@ ) ) (rider-trans) - (none) ) :code (behavior () (set-continue! *game-info* "misty-start") @@ -1264,7 +1251,6 @@ (loop (suspend) ) - (none) ) :post fishermans-boat-post ) @@ -1274,7 +1260,6 @@ :exit (behavior () (send-event *camera* 'change-state *camera-base-mode* 0) (set! (-> self auto-pilot) #t) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -1288,7 +1273,6 @@ ) ) 0 - (none) ) :code (behavior () (send-event (handle->process (-> self cam-tracker)) 'message 'release) @@ -1300,7 +1284,6 @@ ) (suspend) ) - (none) ) :post fishermans-boat-post ) @@ -1323,13 +1306,11 @@ (defstate fishermans-boat-measurements (fishermans-boat) :exit (behavior () (set! (-> self measure-parameters) #f) - (none) ) :trans (behavior () (if (cpad-pressed? 1 square) (go fishermans-boat-player-control) ) - (none) ) :code (behavior () (set! (-> self auto-pilot) #f) @@ -1367,7 +1348,6 @@ ) ) (go fishermans-boat-player-control) - (none) ) :post fishermans-boat-post ) @@ -1636,59 +1616,54 @@ :to self ) (go fishermans-boat-docked-misty) - (none) ) :post (behavior () (ja-post) (fishermans-boat-spawn-particles 81920.0) (fishermans-boat-play-sounds) - (none) ) ) ;; failed to figure out what this is: (defstate fishermans-boat-ride-to-village1 (fishermans-boat) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('evilbro) - (when (= (level-status *level* 'intro) 'active) - (let ((gp-1 (entity-by-name "evilbro-2"))) - (when gp-1 - (set! (-> self evilbro) - (ppointer->handle (manipy-spawn (-> self root-overlay trans) gp-1 *fb-evilbro-sg* #f :to self)) - ) - (send-event (handle->process (-> self evilbro)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> self evilbro)) 'blend-shape #t) - (send-event (handle->process (-> self evilbro)) 'center-joint 3) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('evilbro) + (when (= (level-status *level* 'intro) 'active) + (let ((gp-1 (entity-by-name "evilbro-2"))) + (when gp-1 + (set! (-> self evilbro) + (ppointer->handle (manipy-spawn (-> self root-overlay trans) gp-1 *fb-evilbro-sg* #f :to self)) + ) + (send-event (handle->process (-> self evilbro)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> self evilbro)) 'blend-shape #t) + (send-event (handle->process (-> self evilbro)) 'center-joint 3) ) - (let ((gp-2 (entity-by-name "evilsis-2"))) - (when gp-2 - (set! (-> self evilsis) - (ppointer->handle (manipy-spawn (-> self root-overlay trans) gp-2 *fb-evilsis-sg* #f :to self)) - ) - (send-event (handle->process (-> self evilsis)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> self evilsis)) 'blend-shape #t) - (send-event (handle->process (-> self evilsis)) 'center-joint 3) - ) + ) + (let ((gp-2 (entity-by-name "evilsis-2"))) + (when gp-2 + (set! (-> self evilsis) + (ppointer->handle (manipy-spawn (-> self root-overlay trans) gp-2 *fb-evilsis-sg* #f :to self)) + ) + (send-event (handle->process (-> self evilsis)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> self evilsis)) 'blend-shape #t) + (send-event (handle->process (-> self evilsis)) 'center-joint 3) ) ) ) - (('evilsis) - (let ((a0-44 (handle->process (-> self evilbro)))) - (if a0-44 - (deactivate a0-44) - ) - ) - (let ((a0-48 (handle->process (-> self evilsis)))) - (if a0-48 - (the-as object (deactivate a0-48)) - ) - ) + ) + (('evilsis) + (let ((a0-44 (handle->process (-> self evilbro)))) + (if a0-44 + (deactivate a0-44) + ) ) - ) + (let ((a0-48 (handle->process (-> self evilsis)))) + (if a0-48 + (deactivate a0-48) + ) + ) + ) ) ) :code (behavior () @@ -1739,12 +1714,10 @@ (fishermans-boat-play-sounds) (process-entity-status! self (entity-perm-status complete) #t) (go fishermans-boat-docked-village) - (none) ) :post (behavior () (ja-post) (fishermans-boat-spawn-particles 81920.0) (fishermans-boat-play-sounds) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/village1/sage_REF.gc b/test/decompiler/reference/jak1/levels/village1/sage_REF.gc index f859d353d30..aa867a91767 100644 --- a/test/decompiler/reference/jak1/levels/village1/sage_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/sage_REF.gc @@ -466,7 +466,6 @@ ) ) ((-> (method-of-type process-taskable idle) trans)) - (none) ) :code (behavior () (if (!= (ja-group) (get-art-elem self)) @@ -500,7 +499,6 @@ ) ) ) - (none) ) ) @@ -522,7 +520,6 @@ (start 'play (get-continue-by-name *game-info* "game-start")) ) ) - (none) ) :trans (behavior () (case (get-task-status (game-task intro)) @@ -531,7 +528,6 @@ ) ) ((-> (method-of-type process-taskable play-anim) trans)) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc b/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc index fc441bacda1..f9fe30ec52d 100644 --- a/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc @@ -273,8 +273,8 @@ ;; failed to figure out what this is: (defstate play-anim (sequenceA-village1) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('sidekick-human) (format 0 "got sidekick-human~%") (when (= (level-status *level* 'misty) 'active) @@ -317,12 +317,10 @@ 'play-anim ) ) - (none) ) :trans (behavior () (spool-push *art-control* "sage-intro-sequence-b" 0 self -1.0) ((-> (method-of-type process-taskable play-anim) trans)) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc b/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc index f85eb9738c9..5cc36e8e781 100644 --- a/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc @@ -316,7 +316,6 @@ (logior! (-> self draw status) (draw-status do-not-check-distance)) (logclear! (-> self draw status) (draw-status do-not-check-distance)) ) - (none) ) :code (the-as (function none :behavior windmill-sail) anim-loop) :post (the-as (function none :behavior windmill-sail) ja-post) @@ -389,7 +388,6 @@ ) (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self orig-quat)) (quaternion-normalize! (-> self root-override quat)) - (none) ) :code (the-as (function none :behavior sagesail) anim-loop) :post (the-as (function none :behavior sagesail) ja-post) @@ -496,7 +494,6 @@ ) (quaternion*! (-> self root quat) (-> self root quat) (-> self orig-quat)) (quaternion-normalize! (-> self root quat)) - (none) ) :code (the-as (function none :behavior windspinner) anim-loop) :post (the-as (function none :behavior windspinner) ja-post) @@ -557,7 +554,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior mayorgears) ja-post) ) @@ -611,7 +607,6 @@ (process-entity-status! self (entity-perm-status complete) #t) (draw-eco-beam (-> self reflector-trans) (-> self next-reflector-trans)) ) - (none) ) :code (the-as (function none :behavior reflector-middle) anim-loop) :post (the-as (function none :behavior reflector-middle) ja-post) @@ -728,23 +723,19 @@ (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background)) (set! (-> self state-time) (-> *display* base-frame-counter)) (ja-channel-set! 0) - (none) ) :exit (behavior () (ja-channel-set! 1) - (none) ) :trans (behavior () (if (and *target* (>= 163840.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (go starfish-patrol) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) :post (the-as (function none :behavior starfish) ja-post) ) @@ -754,7 +745,6 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logior! (-> self nav flags) (nav-control-flags navcf19)) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -764,7 +754,6 @@ (go starfish-idle) ) ) - (none) ) :code (behavior () (set! (-> self target-speed) 4096.0) @@ -777,7 +766,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior starfish) nav-enemy-patrol-post) ) @@ -922,7 +910,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior villa-starfish) #f) ) @@ -969,7 +956,6 @@ (loop (suspend) ) - (none) ) :post (the-as (function none :behavior village-fish) #f) ) @@ -1101,7 +1087,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior hutlamp) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/village1/yakow_REF.gc b/test/decompiler/reference/jak1/levels/village1/yakow_REF.gc index afe1b6f10ce..443b7e7e13e 100644 --- a/test/decompiler/reference/jak1/levels/village1/yakow_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/yakow_REF.gc @@ -186,48 +186,44 @@ ) ;; definition for function yakow-default-event-handler -;; INFO: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 52] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 54] (defbehavior yakow-default-event-handler yakow ((arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('touch) - (let* ((s4-0 arg0) - (v1-2 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) process-drawable)) - s4-0 - ) - ) - ) - (when (and v1-2 (< 8192.0 (- (-> v1-2 root trans y) (-> self root-override trans y)))) - (do-push-aways! (-> self root-override)) - (send-shove-back - (-> self root-override) - arg0 - (the-as touching-shapes-entry (-> arg3 param 0)) - 0.7 - 6144.0 - 16384.0 - ) - ) + (case arg2 + (('touch) + (let* ((s4-0 arg0) + (v1-2 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) process-drawable)) + s4-0 ) - ) - (('attack) - (let ((v1-9 (-> arg3 param 2))) - (cond - ((!= v1-9 (-> self player-attack-id)) - (set! (-> self player-attack-id) (the-as int v1-9)) - (if (-> self vulnerable) - (go yakow-kicked) - ) - ) - (else - 'push - ) - ) - ) - ) - ) + ) + ) + (when (and v1-2 (< 8192.0 (- (-> v1-2 root trans y) (-> self root-override trans y)))) + (do-push-aways! (-> self root-override)) + (send-shove-back + (-> self root-override) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + 0.7 + 6144.0 + 16384.0 + ) + ) + ) + ) + (('attack) + (let ((v1-9 (-> arg3 param 2))) + (cond + ((!= v1-9 (-> self player-attack-id)) + (set! (-> self player-attack-id) (the-as int v1-9)) + (if (-> self vulnerable) + (go yakow-kicked) + ) ) + (else + 'push + ) + ) + ) + ) + ) ) ;; failed to figure out what this is: @@ -511,7 +507,6 @@ yakow-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self travel-speed) 0.0) - (none) ) :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> *YAKOW-bank* default-patrol-time)) @@ -523,7 +518,6 @@ yakow-default-event-handler ) (go yakow-notice) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.15)) @@ -553,7 +547,6 @@ yakow-default-event-handler (ja-channel-push! 1 (seconds 0.1)) ) ) - (none) ) :post (the-as (function none :behavior yakow) ja-post) ) @@ -564,11 +557,9 @@ yakow-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self travel-speed) 0.0) - (none) ) :code (behavior () (go yakow-run-away) - (none) ) :post yakow-simple-post ) @@ -582,7 +573,6 @@ yakow-default-event-handler (set! (-> self nav destination-pos quad) (-> arg0 quad)) (set! (-> self rotate-speed) (-> *YAKOW-bank* walk-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* walk-turn-time)) - (none) ) :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> *YAKOW-bank* default-patrol-time)) @@ -611,7 +601,6 @@ yakow-default-event-handler (-> *YAKOW-bank* walk-speed) (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame)) ) - (none) ) :code (the-as (function vector none :behavior yakow) yakow-blend-walk-run) :post (behavior () @@ -626,7 +615,6 @@ yakow-default-event-handler (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (yakow-post) - (none) ) ) @@ -645,7 +633,6 @@ yakow-default-event-handler 'update ) ) - (none) ) :code (behavior () (while (< 546.13336 (fabs (deg-diff (-> self dest-rot) (y-angle (-> self root-override))))) @@ -673,7 +660,6 @@ yakow-default-event-handler (ja-channel-push! 1 (seconds 0.1)) ) ) - (none) ) :post yakow-simple-post ) @@ -688,7 +674,6 @@ yakow-default-event-handler (ja :num! (seek!)) ) (go yakow-graze) - (none) ) :post yakow-simple-post ) @@ -701,7 +686,6 @@ yakow-default-event-handler (logior! (-> self nav flags) (nav-control-flags navcf10)) (set! (-> self rotate-speed) (-> *YAKOW-bank* run-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* run-turn-time)) - (none) ) :trans (behavior () (when (or (not *target*) (< (-> *YAKOW-bank* safe-distance) @@ -735,7 +719,6 @@ yakow-default-event-handler (set! (-> self enable-turn-around) (< (-> *YAKOW-bank* run-speed) f30-2)) (seek! (-> self travel-speed) f30-2 (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame))) ) - (none) ) :code yakow-blend-walk-run :post yakow-run-post @@ -755,11 +738,9 @@ yakow-default-event-handler (-> *YAKOW-bank* run-speed) ) ) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) @@ -770,7 +751,6 @@ yakow-default-event-handler ) ) 0 - (none) ) :code (behavior () (set! (-> self enable-turn-around) #t) @@ -809,7 +789,6 @@ yakow-default-event-handler ) ) (go yakow-run-away) - (none) ) :post yakow-run-post ) @@ -825,7 +804,6 @@ yakow-default-event-handler 0 (drop-pickup (-> self fact-override) #t *entity-pool* (-> self fact-override) 0) (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc b/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc index 0e524e58206..f70bd5e74dc 100644 --- a/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc @@ -87,6 +87,7 @@ ) ;; definition for method 48 of type assistant-levitator +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow assistant-levitator ((obj assistant-levitator)) (-> obj draw shadow-ctrl) (cond @@ -507,7 +508,6 @@ ) ) ((-> (method-of-type process-taskable idle) trans)) - (none) ) :code (behavior () (if (!= (ja-group) (get-art-elem self)) @@ -588,7 +588,6 @@ ) ) ) - (none) ) ) @@ -605,11 +604,9 @@ (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'end-mode) ((-> (method-of-type process-taskable play-anim) exit)) (close-specific-task! (game-task village2-levitator) (task-status need-reminder-a)) - (none) ) :trans (behavior () '() - (none) ) ) @@ -1350,7 +1347,6 @@ ) ) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) :trans (behavior () (assistant-levitator-blue-glow) @@ -1358,7 +1354,6 @@ (assistant-levitator-blue-beam) ) ((-> (method-of-type process-taskable play-anim) trans)) - (none) ) ) @@ -1416,7 +1411,6 @@ (game-task none) ) ) - (none) ) ) @@ -1431,13 +1425,11 @@ :exit (behavior () (stop! (-> self sound)) ((-> (method-of-type process-taskable idle) exit)) - (none) ) :trans (behavior () (assistant-levitator-blue-glow) (update! (-> self sound)) ((-> (method-of-type process-taskable idle) trans)) - (none) ) :code (behavior () (if (!= (ja-group) (get-art-elem self)) @@ -1493,7 +1485,6 @@ ) ) ) - (none) ) ) @@ -1514,11 +1505,11 @@ (update! (-> self sound)) (suspend) ) - (none) ) ) ;; definition for method 11 of type assistant-levitator +;; INFO: Return type mismatch object vs none. (defmethod init-from-entity! assistant-levitator ((obj assistant-levitator) (arg0 entity-actor)) (process-taskable-method-40 obj arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5) (set! (-> obj tasks) (get-task-control (game-task village2-levitator))) diff --git a/test/decompiler/reference/jak1/levels/village2/flutflut-bluehut_REF.gc b/test/decompiler/reference/jak1/levels/village2/flutflut-bluehut_REF.gc index 8323ef8338b..53f59852d09 100644 --- a/test/decompiler/reference/jak1/levels/village2/flutflut-bluehut_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/flutflut-bluehut_REF.gc @@ -57,7 +57,6 @@ :trans (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) - (none) ) :code (behavior () (if (!= (ja-group) (get-art-elem self)) @@ -116,7 +115,6 @@ (ja :num! (seek! 0.0)) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/village2/gambler_REF.gc b/test/decompiler/reference/jak1/levels/village2/gambler_REF.gc index 82b484e3149..f7991fcfd28 100644 --- a/test/decompiler/reference/jak1/levels/village2/gambler_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/gambler_REF.gc @@ -216,7 +216,6 @@ ) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/village2/sage-bluehut_REF.gc b/test/decompiler/reference/jak1/levels/village2/sage-bluehut_REF.gc index 19b7721b8d4..86475c44750 100644 --- a/test/decompiler/reference/jak1/levels/village2/sage-bluehut_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/sage-bluehut_REF.gc @@ -222,7 +222,6 @@ (send-event (-> self assistant extra process) 'end-mode) (set! (-> self draw bounds w) 10240.0) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) ) @@ -337,7 +336,6 @@ ) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc b/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc index a28b2e1cd6b..b243d0d1ca1 100644 --- a/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc @@ -106,7 +106,6 @@ ) ) ) - (none) ) ) @@ -120,7 +119,6 @@ ) ) (set! (-> self play-at-top-going-up-camera?) #t) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) trans))) @@ -148,7 +146,6 @@ (set! (-> (the-as village2cam (-> v1-8 0)) seq) (the-as uint 2)) ) ) - (none) ) ) @@ -172,7 +169,6 @@ (send-event *target* 'reset-height) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc b/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc index 7db9e4daabf..3e55cbf06bb 100644 --- a/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc @@ -768,7 +768,6 @@ (deactivate self) (suspend) 0 - (none) ) ) @@ -785,7 +784,6 @@ ) (suspend) ) - (none) ) ) @@ -795,7 +793,6 @@ (remove-setting! 'movie) (remove-setting! 'process-mask) (apply-settings *setting-control*) - (none) ) :code (behavior () (let ((gp-0 (tetherrock-get-info (-> self entity)))) @@ -972,17 +969,16 @@ ) ) (go swamp-tetherrock-hide) - (none) ) :post (the-as (function none :behavior swamp-tetherrock) ja-post) ) ;; failed to figure out what this is: (defstate swamp-tetherrock-idle (swamp-tetherrock) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (when (and (>= arg1 2) (= (-> event param 1) 'eco-yellow)) + (when (and (>= argc 2) (= (-> block param 1) 'eco-yellow)) (+! (-> self hits) 1) (cond ((>= (-> self hits) 1) @@ -1044,7 +1040,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-tetherrock) transform-post) ) @@ -1114,7 +1109,6 @@ (loop (suspend) ) - (none) ) ) @@ -1143,7 +1137,6 @@ (set! (-> self root-override trans y) (+ (-> self y-offset) (-> self y-init))) (suspend) ) - (none) ) :post (the-as (function none :behavior precursor-arm) transform-post) ) @@ -1169,8 +1162,8 @@ ;; failed to figure out what this is: (defstate precursor-arm-idle (precursor-arm) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('arm-sink-evt) (go precursor-arm-sink) ) @@ -1201,7 +1194,6 @@ (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2017) a2-1) ) ) - (none) ) :code (behavior () (loop @@ -1260,7 +1252,6 @@ ) (suspend) ) - (none) ) :post (the-as (function none :behavior precursor-arm) transform-post) ) @@ -1379,11 +1370,9 @@ (defstate swamp-rope-break (swamp-rope) :enter (behavior () (set! (-> self scale-base) (-> self root scale y)) - (none) ) :trans (behavior () (vector<-cspace! (-> self root trans) (-> self parent-override 0 node-list data (-> self parent-rp))) - (none) ) :code (behavior () (let ((f30-0 18.204445) @@ -1413,13 +1402,11 @@ ) ) ) - (none) ) :post (behavior () (set! (-> self other-pos quad) (-> self root trans quad)) (+! (-> self other-pos y) -245760.0) (swamp-rope-post) - (none) ) ) @@ -1492,7 +1479,6 @@ (ja :num-func num-func-identity :frame-num (* (-> self frame value) (the float (ja-num-frames 0)))) (suspend) ) - (none) ) :post swamp-rope-post ) @@ -1517,7 +1503,6 @@ (ja :num-func num-func-identity :frame-num (* (-> self frame value) (the float (ja-num-frames 0)))) (suspend) ) - (none) ) :post swamp-rope-post ) @@ -1621,7 +1606,6 @@ ) (set! (-> self draw force-lod) 0) 0 - (none) ) :trans (the-as (function none :behavior swamp-blimp) blimp-trans) :code (behavior () @@ -1647,7 +1631,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior swamp-blimp) transform-post) ) @@ -1739,14 +1722,13 @@ ;; failed to figure out what this is: (defstate swamp-blimp-idle (swamp-blimp) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('tetherrock-break-evt) - (increment-success-for-hint (text-id swamp-tetherrock-eco-yellow-hint)) - (swamp-blimp-setup) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('tetherrock-break-evt) + (increment-success-for-hint (text-id swamp-tetherrock-eco-yellow-hint)) + (swamp-blimp-setup) + ) + ) ) :trans (the-as (function none :behavior swamp-blimp) blimp-trans) :code (behavior () @@ -1783,7 +1765,6 @@ (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) - (none) ) :post (the-as (function none :behavior swamp-blimp) transform-post) ) diff --git a/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc b/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc index 4b2118d92fe..202717ca85d 100644 --- a/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc @@ -66,7 +66,6 @@ ) ) (go-virtual pov-camera-done-playing) - (none) ) ) @@ -123,24 +122,20 @@ :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self root-overlay)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self root-overlay)) - (none) ) :trans (behavior () (if (task-closed? (the-as game-task (-> self task)) (task-status need-resolution)) (go-virtual rigid-body-platform-idle) ) - (none) ) :code (behavior () (loop (suspend) ) - (none) ) ) @@ -149,25 +144,21 @@ :code (behavior () (cleanup-for-death self) (deactivate self) - (none) ) ) ;; failed to figure out what this is: (defstate rigid-body-platform-float (pontoon) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'die) - (cleanup-for-death self) - (the-as vector (deactivate self)) - ) - (else - (rigid-body-platform-event-handler proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (cleanup-for-death self) + (deactivate self) + ) + (else + (rigid-body-platform-event-handler proc argc message block) + ) ) ) ) @@ -175,14 +166,13 @@ ;; failed to figure out what this is: (defstate rigid-body-platform-idle (pontoon) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('die) - (cleanup-for-death self) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (cleanup-for-death self) + (deactivate self) + ) + ) ) ) @@ -556,23 +546,20 @@ ;; failed to figure out what this is: (defstate allpontoons-be-clone (allpontoons) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('end-mode) - (cleanup-for-death self) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('end-mode) + (cleanup-for-death self) + (deactivate self) + ) + ) ) :enter (behavior ((arg0 handle)) (logclear! (-> self draw status) (draw-status hidden)) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (when (>= (ja-aframe-num 0) 500.0) @@ -583,28 +570,25 @@ (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 7))) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 9))) ) - (none) ) :code (behavior ((arg0 handle)) (clone-anim arg0 3 #t "") (cleanup-for-death self) (deactivate self) - (none) ) ) ;; failed to figure out what this is: (defstate allpontoons-idle (allpontoons) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('clone) - (go allpontoons-be-clone (the-as handle (-> event param 0))) + (go allpontoons-be-clone (the-as handle (-> block param 0))) ) ) ) :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) - (none) ) :code (behavior () (loop @@ -615,7 +599,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) ) - (none) ) ) @@ -745,16 +728,13 @@ (vector-! (-> self draw bounds) gp-0 (-> self root-override trans)) ) (set! (-> self draw bounds w) 24576.0) - (none) ) :exit (behavior () (stop! (-> self sound)) - (none) ) :trans (behavior () (fireboulder-hover-stuff) (update! (-> self sound)) - (none) ) :code (behavior () (loop @@ -769,15 +749,14 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior fireboulder) transform-post) ) ;; failed to figure out what this is: (defstate fireboulder-be-clone (fireboulder) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('stop-cloning) (go fireboulder-hover) ) @@ -785,12 +764,10 @@ ) :enter (behavior ((arg0 handle)) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logclear! (-> self skel status) (janim-status spool)) - (none) ) :trans (the-as (function none :behavior fireboulder) fireboulder-hover-stuff) :code (behavior ((arg0 handle)) @@ -798,16 +775,15 @@ (format 0 "ERROR: fireboulder-be-clone ended~%") (cleanup-for-death self) (deactivate self) - (none) ) ) ;; failed to figure out what this is: (defstate fireboulder-idle (fireboulder) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('clone) - (go fireboulder-be-clone (the-as handle (-> event param 0))) + (go fireboulder-be-clone (the-as handle (-> block param 0))) ) ) ) @@ -817,7 +793,6 @@ (deactivate a0-1) ) ) - (none) ) :code (behavior () (transform-post) @@ -852,7 +827,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior fireboulder) ja-post) ) @@ -957,7 +931,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior ceilingflag) ja-post) ) @@ -1038,7 +1011,6 @@ ) ) (go exit-chamber-dummy-idle) - (none) ) ) @@ -1075,7 +1047,6 @@ ) ) (go exit-chamber-dummy-wait-to-appear) - (none) ) :post (the-as (function none :behavior exit-chamber-dummy) ja-post) ) @@ -1610,7 +1581,6 @@ (ja :num! (seek!)) ) (go ogreboss-village2-idle) - (none) ) :post (the-as (function none :behavior ogreboss-village2) ja-post) ) @@ -1687,7 +1657,6 @@ ) ) ) - (none) ) :post (the-as (function none :behavior ogreboss-village2) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/village2/warrior_REF.gc b/test/decompiler/reference/jak1/levels/village2/warrior_REF.gc index 588a152a825..6e67c7442e2 100644 --- a/test/decompiler/reference/jak1/levels/village2/warrior_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/warrior_REF.gc @@ -44,6 +44,7 @@ ) ;; definition for method 48 of type warrior +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow warrior ((obj warrior)) (-> obj draw shadow-ctrl) (cond @@ -162,7 +163,6 @@ :exit (behavior () (send-event (-> (entity-by-type allpontoons) extra process) 'end-mode) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/village3/assistant-village3_REF.gc b/test/decompiler/reference/jak1/levels/village3/assistant-village3_REF.gc index ba2801c6119..fda9587c59c 100644 --- a/test/decompiler/reference/jak1/levels/village3/assistant-village3_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/assistant-village3_REF.gc @@ -44,6 +44,7 @@ ) ;; definition for method 48 of type assistant-villagec +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow assistant-villagec ((obj assistant-villagec)) (-> obj draw shadow-ctrl) (cond @@ -189,7 +190,6 @@ ) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/village3/minecart_REF.gc b/test/decompiler/reference/jak1/levels/village3/minecart_REF.gc index db103255c4e..288837e7b4a 100644 --- a/test/decompiler/reference/jak1/levels/village3/minecart_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/minecart_REF.gc @@ -40,20 +40,19 @@ ;; failed to figure out what this is: (defstate idle (minecartsteel) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch 'attack) - (when (= (-> proc type) target) - (let ((a2-1 (new 'stack 'collide-overlap-result))) - (if (not (on-platform (-> self root-override) (-> *target* control) a2-1)) - (send-event proc 'no-look-around (seconds 1.5)) - ) - ) - ) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (when (= (-> proc type) target) + (let ((a2-1 (new 'stack 'collide-overlap-result))) + (if (not (on-platform (-> self root-override) (-> *target* control) a2-1)) + (send-event proc 'no-look-around (seconds 1.5)) + ) + ) + ) + #f + ) + ) ) :trans (the-as (function none :behavior minecartsteel) rider-trans) :code (behavior () @@ -69,7 +68,6 @@ (update! (-> self sound)) (suspend) ) - (none) ) :post (the-as (function none :behavior minecartsteel) rider-post) ) diff --git a/test/decompiler/reference/jak1/levels/village3/miners_REF.gc b/test/decompiler/reference/jak1/levels/village3/miners_REF.gc index 3ff2809e6a9..2cdf7ef6e6f 100644 --- a/test/decompiler/reference/jak1/levels/village3/miners_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/miners_REF.gc @@ -64,6 +64,7 @@ ) ;; definition for method 48 of type minertall +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow minertall ((obj minertall)) (-> obj draw shadow-ctrl) (cond @@ -114,7 +115,6 @@ :trans (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) - (none) ) :code (the-as (function none :behavior minertall) miners-anim-loop) ) @@ -261,6 +261,7 @@ ) ;; definition for method 48 of type minershort +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow minershort ((obj minershort)) (-> obj draw shadow-ctrl) (cond @@ -490,7 +491,6 @@ :exit (behavior () (send-event (-> self other-miner ppointer 3) 'end-mode) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) ) @@ -652,7 +652,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior cavegem) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/village3/sage-village3_REF.gc b/test/decompiler/reference/jak1/levels/village3/sage-village3_REF.gc index a3c6658aef5..4fa614c4c42 100644 --- a/test/decompiler/reference/jak1/levels/village3/sage-village3_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/sage-village3_REF.gc @@ -249,7 +249,6 @@ ) ) ((-> (method-of-type process-taskable idle) trans)) - (none) ) ) @@ -270,7 +269,6 @@ ) ) ((-> (method-of-type process-taskable play-anim) exit)) - (none) ) ) @@ -292,6 +290,7 @@ ) ;; definition for method 48 of type sage-villagec +;; INFO: Return type mismatch object vs none. (defmethod draw-npc-shadow sage-villagec ((obj sage-villagec)) (let ((v1-1 (-> obj draw shadow-ctrl))) (cond diff --git a/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc b/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc index 30b32cf7f83..c6da23cb610 100644 --- a/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc @@ -253,7 +253,6 @@ (spool-push *art-control* (-> self anim name) 0 self -99.0) (suspend) ) - (none) ) ) @@ -291,12 +290,10 @@ ) (process-entity-status! self (entity-perm-status bit-3) #f) (go-virtual idle #t) - (none) ) :post (behavior () (ja-post) (update-direction-from-time-of-day (-> self draw shadow-ctrl)) - (none) ) ) @@ -335,7 +332,6 @@ ) (process-entity-status! self (entity-perm-status bit-3) #f) (go-virtual idle #f) - (none) ) :post (-> (method-of-type gondola ride-up) post) ) @@ -426,8 +422,8 @@ ;; failed to figure out what this is: (defstate idle (pistons) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('update) (go-virtual active (process->handle proc) #f) ) @@ -438,7 +434,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -492,17 +487,16 @@ ;; failed to figure out what this is: (defstate idle (gondolacables) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('update) - (process-entity-status! self (entity-perm-status complete) #t) - (let ((v0-0 1)) - (set! (-> self draw mgeo effect 0 effect-bits) (the-as uint v0-0)) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('update) + (process-entity-status! self (entity-perm-status complete) #t) + (let ((v0-0 1)) + (set! (-> self draw mgeo effect 0 effect-bits) (the-as uint v0-0)) + v0-0 + ) + ) + ) ) :code (behavior () (loop @@ -512,7 +506,6 @@ (ja :num! (seek!)) ) ) - (none) ) :post (the-as (function none :behavior gondolacables) ja-post) ) diff --git a/test/decompiler/reference/jak1/levels/village_common/oracle_REF.gc b/test/decompiler/reference/jak1/levels/village_common/oracle_REF.gc index f24d9d534c3..2640587a4b5 100644 --- a/test/decompiler/reference/jak1/levels/village_common/oracle_REF.gc +++ b/test/decompiler/reference/jak1/levels/village_common/oracle_REF.gc @@ -236,12 +236,10 @@ :exit (behavior () (stop! (-> self sound)) ((-> (method-of-type process-taskable idle) exit)) - (none) ) :trans (behavior () (update! (-> self sound)) ((-> (method-of-type process-taskable idle) trans)) - (none) ) ) diff --git a/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc b/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc index 2e61521f762..a10bdf0a9a7 100644 --- a/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc @@ -57,7 +57,6 @@ (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-hit-ground #f) ) - (none) ) :code (behavior ((arg0 vector) (arg1 vector)) (clear-collide-with-as (-> self control)) @@ -111,7 +110,6 @@ (ja :num! (seek!)) ) (target-falling-anim -1 (seconds 0.33)) - (none) ) :post target-no-move-post ) @@ -119,8 +117,8 @@ ;; failed to figure out what this is: (defstate idle (warp-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide) (go-virtual hidden) ) @@ -188,7 +186,6 @@ ) (suspend) ) - (none) ) ) @@ -255,7 +252,6 @@ (apply-settings *setting-control*) (sound-play "start-options") (set! (-> self state-time) (-> *display* base-frame-counter)) - (none) ) :trans (behavior () (when (or (and (cpad-pressed? 0 triangle) @@ -285,7 +281,6 @@ ) ) ) - (none) ) :code (behavior () (local-vars (sv-112 int) (sv-128 int) (sv-144 int)) @@ -422,7 +417,6 @@ ) ) ) - (none) ) ) @@ -681,8 +675,8 @@ ;; failed to figure out what this is: (defstate basebutton-up-idle (warp-gate-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (when (pressable? self) (basebutton-method-29 self (-> self event-going-down) (-> self notify-actor)) @@ -690,10 +684,10 @@ ) ) (('hide) - (send-event (handle->process (-> self warp)) event-type) + (send-event (handle->process (-> self warp)) message) ) (else - ((-> (method-of-type basebutton basebutton-up-idle) event) proc arg1 event-type event) + ((-> (method-of-type basebutton basebutton-up-idle) event) proc argc message block) ) ) ) @@ -704,7 +698,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -794,20 +787,19 @@ (t9-13) ) ) - (none) ) ) ;; failed to figure out what this is: (defstate basebutton-down-idle (warp-gate-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide) - (send-event (handle->process (-> self warp)) event-type) + (send-event (handle->process (-> self warp)) message) ) (else - ((-> (method-of-type basebutton basebutton-down-idle) event) proc arg1 event-type event) + ((-> (method-of-type basebutton basebutton-down-idle) event) proc argc message block) ) ) ) @@ -820,7 +812,6 @@ (t9-4) ) ) - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self warp)))) @@ -833,7 +824,6 @@ (t9-1) ) ) - (none) ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 60)) @@ -858,7 +848,6 @@ (t9-3) ) ) - (none) ) ) @@ -904,7 +893,6 @@ ((the-as (function none :behavior basebutton) t9-10)) ) ) - (none) ) ) @@ -1197,7 +1185,6 @@ ) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc b/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc index 32d8a82cc29..b4c170ff014 100644 --- a/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc @@ -446,13 +446,13 @@ (enemy-method-63 (_type_ process-focusable enemy-aware) symbol 63) (enemy-method-64 (_type_) none 64) (enemy-method-65 (_type_) none 65) - (go-ambush (_type_) none 66) - (go-stare (_type_) none 67) - (go-stare2 (_type_) none 68) - (go-directed (_type_) none 69) - (go-hostile (_type_) none 70) - (go-flee (_type_) none 71) - (react-to-focus (_type_) none 72) + (go-ambush (_type_) object 66) + (go-stare (_type_) object 67) + (go-stare2 (_type_) object 68) + (go-directed (_type_) object 69) + (go-hostile (_type_) object 70) + (go-flee (_type_) object 71) + (react-to-focus (_type_) object 72) (kill-prefer-falling (_type_) object 73) (general-event-handler (_type_ process int symbol event-message-block) object 74) (enemy-method-75 (_type_ process event-message-block) object 75) diff --git a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc index 837c2e76aea..df4fb08c58c 100644 --- a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc @@ -521,45 +521,33 @@ ) ;; definition for method 67 of type enemy -;; WARN: Return type mismatch object vs none. (defmethod go-stare enemy ((obj enemy)) (go (method-of-object obj stare)) - (none) ) ;; definition for method 68 of type enemy -;; WARN: Return type mismatch object vs none. (defmethod go-stare2 enemy ((obj enemy)) (go (method-of-object obj stare)) - (none) ) ;; definition for method 70 of type enemy -;; WARN: Return type mismatch object vs none. (defmethod go-hostile enemy ((obj enemy)) (go (method-of-object obj hostile)) - (none) ) ;; definition for method 66 of type enemy -;; WARN: Return type mismatch object vs none. (defmethod go-ambush enemy ((obj enemy)) (go (method-of-object obj ambush)) - (none) ) ;; definition for method 71 of type enemy -;; WARN: Return type mismatch object vs none. (defmethod go-flee enemy ((obj enemy)) (go (method-of-object obj flee)) - (none) ) ;; definition for method 69 of type enemy -;; WARN: Return type mismatch object vs none. (defmethod go-directed enemy ((obj enemy)) (go (method-of-object obj directed)) - (none) ) ;; definition for method 72 of type enemy @@ -584,10 +572,10 @@ ) ) ) - (none) ) ;; definition for method 93 of type enemy +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-93 enemy ((obj enemy)) (if (logtest? (enemy-flag alert) (-> obj enemy-flags)) (go-directed obj) @@ -1307,6 +1295,7 @@ ) ;; definition for method 11 of type enemy +;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! enemy ((obj enemy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: @@ -1688,168 +1677,124 @@ This commonly includes things such as: ;; definition for method 74 of type enemy ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 17] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 28] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 37] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 89] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 105] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 202] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 211] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 274] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 346] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 407] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 413] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 490] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 493] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 530] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 560] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 610] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 641] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 720] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 774] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 807] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 814] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 850] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 933] (defmethod general-event-handler enemy ((obj enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (s5-5 rgbaf) (sv-432 process) (sv-448 event-message-block)) - (the-as - object - (cond - ((= arg2 'track) - (and (nonzero? (-> obj hit-points)) - (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) - (logtest? (enemy-flag check-water-backup) (-> obj enemy-flags)) - ) - ) - ((= arg2 'combo) - (and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points))) - ) - ((= arg2 'touch) - (enemy-method-75 obj arg0 arg3) - ) - ((= arg2 'touched) - (when (logtest? (-> obj enemy-flags) (enemy-flag attackable-backup)) - (let* ((s3-1 arg0) - (v1-20 (if (type? s3-1 process-drawable) - (the-as process-drawable s3-1) - ) - ) - ) - (when v1-20 - (let* ((s3-2 (-> v1-20 root)) - (a1-4 (if (type? s3-2 collide-shape) - s3-2 - ) - ) - (s3-3 (-> arg3 param 0)) - ) - (if (and a1-4 - s3-3 - ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry s3-3) - (the-as collide-shape a1-4) - (collide-action solid) - (collide-action) - ) - ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry s3-3) - (-> obj root) - (collide-action solid) - (collide-action) + (cond + ((= arg2 'track) + (and (nonzero? (-> obj hit-points)) + (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) + (logtest? (enemy-flag check-water-backup) (-> obj enemy-flags)) + ) + ) + ((= arg2 'combo) + (and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points))) + ) + ((= arg2 'touch) + (enemy-method-75 obj arg0 arg3) + ) + ((= arg2 'touched) + (when (logtest? (-> obj enemy-flags) (enemy-flag attackable-backup)) + (let* ((s3-1 arg0) + (v1-20 (if (type? s3-1 process-drawable) + (the-as process-drawable s3-1) ) + ) + ) + (when v1-20 + (let* ((s3-2 (-> v1-20 root)) + (a1-4 (if (type? s3-2 collide-shape) + s3-2 + ) ) - (set! (-> obj auto-reset-penetrate-time) (current-time)) - ) - ) + (s3-3 (-> arg3 param 0)) + ) + (if (and a1-4 + s3-3 + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-3) + (the-as collide-shape a1-4) + (collide-action solid) + (collide-action) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-3) + (-> obj root) + (collide-action solid) + (collide-action) + ) + ) + (set! (-> obj auto-reset-penetrate-time) (current-time)) + ) ) ) ) - (enemy-method-76 obj arg0 arg3) ) - ((= arg2 'attack-invinc) - (case (-> (the-as attack-info (-> arg3 param 1)) mode) - (('endlessfall) - (let ((v1-31 (-> obj root root-prim))) - (set! (-> v1-31 prim-core collide-as) (collide-spec)) - (set! (-> v1-31 prim-core collide-with) (collide-spec)) - ) - 0 - (kill-prefer-falling obj) + (enemy-method-76 obj arg0 arg3) + ) + ((= arg2 'attack-invinc) + (case (-> (the-as attack-info (-> arg3 param 1)) mode) + (('endlessfall) + (let ((v1-31 (-> obj root root-prim))) + (set! (-> v1-31 prim-core collide-as) (collide-spec)) + (set! (-> v1-31 prim-core collide-with) (collide-spec)) ) - ) + 0 + (kill-prefer-falling obj) + ) ) - ((= arg2 'attack) - (let ((s2-0 (the-as object (-> arg3 param 1)))) - (when (!= (-> (the-as attack-info s2-0) id) (-> obj incoming attack-id)) - (cond - ((and (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + ) + ((= arg2 'attack) + (let ((s2-0 (the-as object (-> arg3 param 1)))) + (when (!= (-> (the-as attack-info s2-0) id) (-> obj incoming attack-id)) + (cond + ((and (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) + ) + (let* ((s1-0 obj) + (s0-0 (method-of-object s1-0 enemy-method-106)) ) - (let* ((s1-0 obj) - (s0-0 (method-of-object s1-0 enemy-method-106)) - ) - (set! sv-432 arg0) - (set! sv-448 arg3) - (let ((a3-3 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg3))) - (s0-0 s1-0 sv-432 sv-448 (the-as int a3-3) (the-as attack-info s2-0)) - ) + (set! sv-432 arg0) + (set! sv-448 arg3) + (let ((a3-3 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg3))) + (s0-0 s1-0 sv-432 sv-448 (the-as int a3-3) (the-as attack-info s2-0)) ) - (send-event (ppointer->process (-> obj parent)) 'child-hit) - 0 - (if (not *debug-unkillable*) - (take-damage-from-attack obj arg0 arg3) - ) - (let ((s2-1 (the-as attack-info (enemy-method-58 obj arg0 arg3)))) - (when s2-1 - (logclear! (-> obj enemy-flags) (enemy-flag called-dying)) - (enemy-method-108 obj (the-as enemy arg0) arg3) - (let ((a1-13 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-13 from) (process->ppointer arg0)) - (set! (-> a1-13 num-params) arg1) - (set! (-> a1-13 message) (the-as symbol s2-1)) - (set! (-> a1-13 param 0) (-> arg3 param 0)) - (set! (-> a1-13 param 1) (-> arg3 param 1)) - (set! (-> a1-13 param 2) (-> arg3 param 2)) - (set! (-> a1-13 param 3) (-> arg3 param 3)) - (set! (-> a1-13 param 4) (-> arg3 param 4)) - (set! (-> a1-13 param 5) (-> arg3 param 5)) - (send-event-function obj a1-13) - ) + ) + (send-event (ppointer->process (-> obj parent)) 'child-hit) + 0 + (if (not *debug-unkillable*) + (take-damage-from-attack obj arg0 arg3) + ) + (let ((s2-1 (the-as attack-info (enemy-method-58 obj arg0 arg3)))) + (when s2-1 + (logclear! (-> obj enemy-flags) (enemy-flag called-dying)) + (enemy-method-108 obj (the-as enemy arg0) arg3) + (let ((a1-13 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-13 from) (process->ppointer arg0)) + (set! (-> a1-13 num-params) arg1) + (set! (-> a1-13 message) (the-as symbol s2-1)) + (set! (-> a1-13 param 0) (-> arg3 param 0)) + (set! (-> a1-13 param 1) (-> arg3 param 1)) + (set! (-> a1-13 param 2) (-> arg3 param 2)) + (set! (-> a1-13 param 3) (-> arg3 param 3)) + (set! (-> a1-13 param 4) (-> arg3 param 4)) + (set! (-> a1-13 param 5) (-> arg3 param 5)) + (send-event-function obj a1-13) ) ) ) - (else - (set! (-> obj incoming attack-id) (-> (the-as attack-info s2-0) id)) - (enemy-method-75 obj arg0 arg3) - ) + ) + (else + (set! (-> obj incoming attack-id) (-> (the-as attack-info s2-0) id)) + (enemy-method-75 obj arg0 arg3) ) ) ) ) - ((= arg2 'hit-flinch) - (when (zero? (-> obj hit-points)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) - ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (process-contact-action arg0) - (send-event arg0 'get-attack-count 1) - (kill-prefer-falling obj) - ) - #t - ) - ((= arg2 'hit-knocked) + ) + ((= arg2 'hit-flinch) + (when (zero? (-> obj hit-points)) (logclear! (-> obj mask) (process-mask actor-pause)) (logclear! (-> obj focus-status) (focus-status dangerous)) (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) @@ -1863,17 +1808,135 @@ This commonly includes things such as: (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (when (zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) - (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) - 0 + (kill-prefer-falling obj) + ) + #t + ) + ((= arg2 'hit-knocked) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) + (logior! (-> obj focus-status) (focus-status hit)) + (if (zero? (-> obj hit-points)) + (logior! (-> obj focus-status) (focus-status dead)) + ) + (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 obj) + (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (when (zero? (-> obj hit-points)) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) + (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + 0 + ) + ) + ) + (go (method-of-object obj knocked)) + ) + ((= arg2 'hit) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) + (logior! (-> obj focus-status) (focus-status hit)) + (if (zero? (-> obj hit-points)) + (logior! (-> obj focus-status) (focus-status dead)) + ) + (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 obj) + (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (if (zero? (-> obj hit-points)) + (kill-prefer-falling obj) + (go (method-of-object obj hit)) + ) + ) + ((= arg2 'cue-chase) + (when (and (> (-> obj hit-points) 0) + (zero? (-> obj fated-time)) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) + ) + (let ((v1-162 (logtest? (enemy-flag alert) (-> obj enemy-flags)))) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (logior! (-> obj enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (cond + (v1-162 + (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) + (go-ambush obj) + (go-hostile obj) + ) + ) + ((and (-> obj next-state) (let ((v1-173 (-> obj next-state name))) + (or (= v1-173 'dormant) (= v1-173 'dormant-aware)) + ) + ) + (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) + (go-ambush obj) + (go (method-of-object obj notice)) + ) ) ) ) - (go (method-of-object obj knocked)) + #t + ) + ) + ((= arg2 'cue-wake) + (when (and (> (-> obj hit-points) 0) + (zero? (-> obj fated-time)) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) + ) + (logclear! (-> obj enemy-flags) (enemy-flag alert victory called-dying)) + (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) + (go-ambush obj) + (react-to-focus obj) + ) + #t ) - ((= arg2 'hit) + ) + ((= arg2 'jump) + (when (and (> (-> obj hit-points) 0) + (zero? (-> obj fated-time)) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) + ) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj jump-why) (-> arg3 param 0)) + (set! (-> obj event-param-point quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (go (method-of-object obj jump)) + ) + ) + ((= arg2 'death-start) + (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag recover) (-> obj enemy-flags)))) + (send-event (ppointer->process (-> obj parent)) 'child-die) + (drop-pickup (-> obj fact) #t *entity-pool* (-> obj fact) 0) + (let ((s5-1 (-> obj on-death))) + (if s5-1 + (script-eval (the-as pair s5-1) :vector (-> obj root trans)) + ) + ) + ) + ((= arg2 'death-end) + (if (-> obj skel effect) + (logior! (-> obj skel effect flags) (effect-control-flag ecf2)) + ) + (logior! (-> obj draw status) (draw-control-status no-draw)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + (set! (-> obj enemy-flags) (logclear (-> obj enemy-flags) (enemy-flag check-water))) + ) + ((= arg2 'instant-death) + (when (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time))) + (set! (-> obj hit-points) 0) + (set! (-> obj root penetrated-by) (get-penetrate-info obj)) + (let ((s5-2 (enemy-method-50 obj (new 'stack-no-clear 'vector)))) + (vector-z-quaternion! s5-2 (-> obj root quat)) + (vector-float*! s5-2 s5-2 -1.0) + (vector-normalize! s5-2 1.0) + ) (logclear! (-> obj mask) (process-mask actor-pause)) (logclear! (-> obj focus-status) (focus-status dangerous)) (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) @@ -1885,180 +1948,79 @@ This commonly includes things such as: (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) (enemy-method-62 obj) (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (process-contact-action arg0) - (send-event arg0 'get-attack-count 1) - (if (zero? (-> obj hit-points)) - (kill-prefer-falling obj) - (go (method-of-object obj hit)) - ) - ) - ((= arg2 'cue-chase) - (when (and (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) - ) - (let ((v1-162 (logtest? (enemy-flag alert) (-> obj enemy-flags)))) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) - (logior! (-> obj enemy-flags) (enemy-flag dangerous-backup)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (cond - (v1-162 - (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (go-ambush obj) - (go-hostile obj) - ) - ) - ((and (-> obj next-state) (let ((v1-173 (-> obj next-state name))) - (or (= v1-173 'dormant) (= v1-173 'dormant-aware)) - ) - ) - (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (go-ambush obj) - (go (method-of-object obj notice)) - ) - ) - ) - ) - #t - ) - ) - ((= arg2 'cue-wake) - (when (and (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) - ) - (logclear! (-> obj enemy-flags) (enemy-flag alert victory called-dying)) - (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (go-ambush obj) - (react-to-focus obj) - ) - #t - ) - ) - ((= arg2 'jump) - (when (and (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) - ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj jump-why) (-> arg3 param 0)) - (set! (-> obj event-param-point quad) (-> (the-as vector (-> arg3 param 1)) quad)) - (go (method-of-object obj jump)) - ) + (kill-prefer-falling obj) ) - ((= arg2 'death-start) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag recover) (-> obj enemy-flags)))) - (send-event (ppointer->process (-> obj parent)) 'child-die) - (drop-pickup (-> obj fact) #t *entity-pool* (-> obj fact) 0) - (let ((s5-1 (-> obj on-death))) - (if s5-1 - (script-eval (the-as pair s5-1) :vector (-> obj root trans)) - ) - ) - ) - ((= arg2 'death-end) - (if (-> obj skel effect) - (logior! (-> obj skel effect flags) (effect-control-flag ecf2)) + ) + ((= arg2 'die-fast) + (logior! (-> obj draw status) (draw-control-status no-draw)) + (dispose! obj) + (send-event (ppointer->process (-> obj parent)) 'child-die) + (let ((s5-3 (-> obj on-death))) + (if s5-3 + (script-eval (the-as pair s5-3) :vector (-> obj root trans)) ) - (logior! (-> obj draw status) (draw-control-status no-draw)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (set! (-> obj enemy-flags) (logclear (-> obj enemy-flags) (enemy-flag check-water))) ) - ((= arg2 'instant-death) - (when (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time))) - (set! (-> obj hit-points) 0) - (set! (-> obj root penetrated-by) (get-penetrate-info obj)) - (let ((s5-2 (enemy-method-50 obj (new 'stack-no-clear 'vector)))) - (vector-z-quaternion! s5-2 (-> obj root quat)) - (vector-float*! s5-2 s5-2 -1.0) - (vector-normalize! s5-2 1.0) - ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) - ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (kill-prefer-falling obj) + (cleanup-for-death obj) + (go (method-of-object obj die-fast)) + ) + ((= arg2 'victory) + (if (and (-> obj enemy-info use-victory) + (not (and (-> obj next-state) (= (-> obj next-state name) 'victory))) + (> (-> obj hit-points) 0) + (zero? (-> obj fated-time)) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) + ) + (go (method-of-object obj victory)) ) - ) - ((= arg2 'die-fast) - (logior! (-> obj draw status) (draw-control-status no-draw)) - (dispose! obj) - (send-event (ppointer->process (-> obj parent)) 'child-die) - (let ((s5-3 (-> obj on-death))) - (if s5-3 - (script-eval (the-as pair s5-3) :vector (-> obj root trans)) - ) + ) + ((= arg2 'nav-control) + (if (nonzero? (-> obj nav)) + (-> obj nav) ) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) - ) - ((= arg2 'victory) - (if (and (-> obj enemy-info use-victory) - (not (and (-> obj next-state) (= (-> obj next-state name) 'victory))) - (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) - ) - (go (method-of-object obj victory)) - ) - ) - ((= arg2 'nav-control) - (if (nonzero? (-> obj nav)) - (-> obj nav) - ) - ) - ((= arg2 'push-trans) - (move-by-vector! (-> obj root) (the-as vector (-> arg3 param 0))) - ) - ((= arg2 'move-trans) - (move-to-point! (-> obj root) (the-as vector (-> arg3 param 0))) - ) - ((= arg2 'shadow) - (cond - ((-> arg3 param 0) - (let ((v1-320 (-> obj draw shadow-ctrl))) - (logclear! (-> v1-320 settings flags) (shadow-flags disable-draw)) - ) - 0 + ) + ((= arg2 'push-trans) + (move-by-vector! (-> obj root) (the-as vector (-> arg3 param 0))) + ) + ((= arg2 'move-trans) + (move-to-point! (-> obj root) (the-as vector (-> arg3 param 0))) + ) + ((= arg2 'shadow) + (cond + ((-> arg3 param 0) + (let ((v1-320 (-> obj draw shadow-ctrl))) + (logclear! (-> v1-320 settings flags) (shadow-flags disable-draw)) ) - (else - (let ((v1-323 (-> obj draw shadow-ctrl))) - (logior! (-> v1-323 settings flags) (shadow-flags disable-draw)) - ) - 0 + 0 + ) + (else + (let ((v1-323 (-> obj draw shadow-ctrl))) + (logior! (-> v1-323 settings flags) (shadow-flags disable-draw)) ) + 0 ) ) - ((= arg2 'color-effect) - (case (-> arg3 param 0) - (('dark) - (let ((f30-0 (rand-vu-float-range 0.2 1.0))) - (set-vector! (-> obj draw color-mult) (lerp 1.0 1.0 f30-0) (lerp 1.0 0.0 f30-0) (lerp 1.0 1.0 f30-0) 1.0) - (set! s5-5 (-> obj draw color-emissive)) - (set! (-> s5-5 x) (lerp 0.0 0.3 f30-0)) - (set! (-> s5-5 y) (lerp 0.0 0.0 f30-0)) - (set! (-> s5-5 z) (lerp 0.0 0.3 f30-0)) - ) - (set! (-> s5-5 w) 1.0) - s5-5 - ) - ((#f) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) + ) + ((= arg2 'color-effect) + (case (-> arg3 param 0) + (('dark) + (let ((f30-0 (rand-vu-float-range 0.2 1.0))) + (set-vector! (-> obj draw color-mult) (lerp 1.0 1.0 f30-0) (lerp 1.0 0.0 f30-0) (lerp 1.0 1.0 f30-0) 1.0) (set! s5-5 (-> obj draw color-emissive)) - (set! (-> s5-5 quad) (the-as uint128 0)) - s5-5 + (set! (-> s5-5 x) (lerp 0.0 0.3 f30-0)) + (set! (-> s5-5 y) (lerp 0.0 0.0 f30-0)) + (set! (-> s5-5 z) (lerp 0.0 0.3 f30-0)) ) - ) + (set! (-> s5-5 w) 1.0) + s5-5 + ) + ((#f) + (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) + (set! s5-5 (-> obj draw color-emissive)) + (set! (-> s5-5 quad) (the-as uint128 0)) + s5-5 + ) ) - ) + ) ) ) @@ -2316,7 +2278,6 @@ This commonly includes things such as: (logclear! (-> self mask) (process-mask actor-pause)) ) ) - (none) ) :trans (behavior () (if (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) @@ -2324,12 +2285,10 @@ This commonly includes things such as: ) (go-virtual active) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) (sleep-code) - (none) ) :post (behavior () (idle-control-method-10 (-> self idle-anim-player) self) @@ -2338,7 +2297,6 @@ This commonly includes things such as: ) (enemy-method-129 self) (ja-post) - (none) ) ) @@ -2360,7 +2318,6 @@ This commonly includes things such as: (logior! (-> self enemy-flags) (enemy-flag victory)) ) (logior! (-> self focus-status) (focus-status disable)) - (none) ) :exit (behavior () (logclear! (-> self focus-status) (focus-status disable)) @@ -2371,7 +2328,6 @@ This commonly includes things such as: (logclear! (-> self draw status) (draw-control-status no-draw)) (logclear! (-> self enemy-flags) (enemy-flag victory)) (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :code (the-as (function none :behavior enemy) sleep-code) ) @@ -2391,7 +2347,6 @@ This commonly includes things such as: (go-virtual active) ) ) - (none) ) :code (the-as (function none :behavior enemy) sleep-code) :post (behavior () @@ -2399,7 +2354,6 @@ This commonly includes things such as: (set! (-> self last-draw-time) (current-time)) ) (enemy-method-129 self) - (none) ) ) @@ -2409,11 +2363,9 @@ This commonly includes things such as: :event enemy-event-handler :enter (behavior () (logior! (-> self enemy-flags) (enemy-flag chase-startup)) - (none) ) :code (behavior () (go-virtual notice) - (none) ) ) @@ -2438,7 +2390,6 @@ This commonly includes things such as: (logclear! (-> self mask) (process-mask actor-pause)) ) ) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) @@ -2453,17 +2404,14 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) (sleep-code) - (none) ) :post (behavior () (idle-control-method-10 (-> self idle-anim-player) self) (enemy-simple-post) - (none) ) ) @@ -2502,7 +2450,6 @@ This commonly includes things such as: ) ) (logior! (-> self enemy-flags) (enemy-flag chase-startup)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -2528,7 +2475,6 @@ This commonly includes things such as: ) ) (react-to-focus self) - (none) ) :post enemy-simple-post ) @@ -2551,7 +2497,6 @@ This commonly includes things such as: ) ) ) - (none) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) @@ -2569,7 +2514,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2582,7 +2526,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post enemy-simple-post ) @@ -2595,7 +2538,6 @@ This commonly includes things such as: (set! (-> self state-time) (current-time)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self enemy-flags) (enemy-flag dangerous-backup)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) @@ -2613,7 +2555,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -2632,7 +2573,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post enemy-simple-post ) @@ -2644,7 +2584,6 @@ This commonly includes things such as: :enter (behavior () (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -2666,7 +2605,6 @@ This commonly includes things such as: ) ) (react-to-focus self) - (none) ) :post enemy-simple-post ) @@ -2680,7 +2618,6 @@ This commonly includes things such as: (look-at-target! self (enemy-flag lock-focus)) (logclear! (-> self enemy-flags) (enemy-flag dangerous-backup)) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) @@ -2688,7 +2625,6 @@ This commonly includes things such as: (go-stare self) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2701,7 +2637,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post enemy-simple-post ) @@ -2938,14 +2873,12 @@ This commonly includes things such as: (set! (-> self attack-id) a0-2) ) (logclear! (-> self focus-status) (focus-status in-air)) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'enemy-jump-info))) @@ -3009,7 +2942,6 @@ This commonly includes things such as: ) ) (enemy-method-93 self) - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) @@ -3019,7 +2951,6 @@ This commonly includes things such as: (find-overlapping-shapes (-> self root) a1-0) ) (enemy-simple-post) - (none) ) ) @@ -3030,7 +2961,6 @@ This commonly includes things such as: :enter (behavior () (set! (-> self state-time) (current-time)) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.5)) @@ -3039,7 +2969,6 @@ This commonly includes things such as: (enemy-method-93 self) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -3057,7 +2986,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post enemy-simple-post ) @@ -3070,7 +2998,6 @@ This commonly includes things such as: (stop-looking-at-target! self) (logclear! (-> self mask) (process-mask actor-pause)) (enemy-method-135 self 0) - (none) ) :code (behavior () (local-vars (v1-37 enemy-flag) (v1-45 enemy-flag)) @@ -3117,7 +3044,6 @@ This commonly includes things such as: (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (go-hostile self) - (none) ) :post enemy-simple-post ) @@ -3517,7 +3443,6 @@ This commonly includes things such as: (set! (-> self root penetrate-using) (penetrate lunge vehicle knocked)) (enemy-method-49 self) (enemy-method-46 self 1) - (none) ) :exit (behavior () (local-vars (v1-1 enemy-flag) (v1-15 enemy-flag) (v1-23 enemy-flag)) @@ -3558,13 +3483,11 @@ This commonly includes things such as: (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) ) - (none) ) :trans (behavior () (if (>= (-> self enemy-info knocked-seek-ry-clamp) 0.0) (seek-toward-yaw-angle! (-> self root) (-> self desired-angle) 138353.78 (seconds 0.1)) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'enemy-knocked-info))) @@ -3643,7 +3566,6 @@ This commonly includes things such as: (go-hostile self) ) ) - (none) ) :post enemy-falling-post ) @@ -3707,7 +3629,6 @@ This commonly includes things such as: (set! (-> self state-time) (current-time)) (set! (-> self hit-points) 0) (enemy-method-103 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -3733,7 +3654,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post enemy-simple-post ) @@ -3769,7 +3689,6 @@ This commonly includes things such as: (logior! (-> self enemy-flags) (enemy-flag trackable-backup)) ) (enemy-method-103 self) - (none) ) :exit (behavior () (local-vars (v0-0 enemy-flag)) @@ -3780,7 +3699,6 @@ This commonly includes things such as: ) ) (set! (-> self enemy-flags) v0-0) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -3806,7 +3724,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post enemy-die-falling-post ) @@ -3818,11 +3735,9 @@ This commonly includes things such as: :enter (behavior () (logior! (-> self enemy-flags) (enemy-flag victory)) ((-> (method-of-type enemy idle) enter)) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag victory)) - (none) ) :code (-> (method-of-type enemy idle) code) :post (-> (method-of-type enemy idle) post) @@ -3839,11 +3754,9 @@ This commonly includes things such as: :virtual #t :enter (behavior () '() - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (let ((gp-0 (-> self draw art-group))) @@ -3866,7 +3779,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior enemy) transform-post) ) diff --git a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc index e25f5a780f4..f9880369989 100644 --- a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc @@ -383,7 +383,6 @@ (suspend) ) (go-virtual exit) - (none) ) ) @@ -418,7 +417,6 @@ (auto-save-user) ) (apply-settings *setting-control*) - (none) ) :exit (behavior () (let ((gp-0 (-> self message on-close))) @@ -470,7 +468,6 @@ (remove-setting! 'hint) (remove-setting! 'speech-control) (apply-settings *setting-control*) - (none) ) :code (behavior () (local-vars (v1-43 symbol)) @@ -541,7 +538,6 @@ (auto-save-user) ) (go-virtual exit) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc b/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc index d0e913bf3a6..37d96e37876 100644 --- a/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc @@ -57,10 +57,10 @@ ;; failed to figure out what this is: (defstate idle (fma-sphere) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) - (let ((v1-1 (-> event param 0))) + (let ((v1-1 (-> block param 0))) (if v1-1 (send-event proc 'attack v1-1 (static-attack-info ((id (-> self attack-id)) (mode 'eco-red) @@ -81,7 +81,6 @@ (if (logtest? (-> self mode) (fma-sphere-mode kill-once)) (send-event *traffic-manager* 'kill-traffic-sphere (-> self sphere)) ) - (none) ) :trans (behavior () (local-vars (at-0 int)) @@ -147,7 +146,6 @@ (new 'static 'rgba :r #x80 :g #x40 :a #x80) ) ) - (none) ) ) :code (the-as (function none :behavior fma-sphere) sleep-code) diff --git a/test/decompiler/reference/jak2/engine/anim/joint-exploder_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-exploder_REF.gc index 31cc2195e3e..ca59425d17c 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint-exploder_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint-exploder_REF.gc @@ -678,7 +678,6 @@ (defstate joint-exploder-shatter (joint-exploder) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (let* ((f0-1 (the float (- (current-time) (-> self state-time)))) @@ -726,7 +725,6 @@ ) ) 0 - (none) ) :code (behavior () (set! (-> self state-time) (current-time)) @@ -734,7 +732,6 @@ (suspend) (ja :num! (loop!)) ) - (none) ) :post (the-as (function none :behavior joint-exploder) ja-post) ) diff --git a/test/decompiler/reference/jak2/engine/anim/joint_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint_REF.gc index f20bd0f470b..43a5f573c45 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint_REF.gc @@ -803,7 +803,7 @@ ) ) ) - (the-as object sv-24) + sv-24 ) ;; definition for function flatten-joint-control-to-spr diff --git a/test/decompiler/reference/jak2/engine/camera/cam-combiner_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-combiner_REF.gc index c81335c2c32..ff3aa91128e 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-combiner_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-combiner_REF.gc @@ -135,148 +135,143 @@ ;; failed to figure out what this is: (defstate cam-combiner-active (camera-combiner) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (the-as - object - (case event-type - (('fast-rot) - (set! v0-0 #t) - (set! (-> self fast-rot) (the-as basic v0-0)) - v0-0 - ) - (('set-interpolation) - (let ((f0-1 (the float (-> event param 0)))) - (cond - ((>= 0.0 f0-1) - (set! (-> self interp-val) 1.0) - ) - (else - (set! (-> self interp-val) 0.0) - (set! (-> self interp-step) (/ 5.0 f0-1)) - ) + (case message + (('fast-rot) + (set! v0-0 #t) + (set! (-> self fast-rot) (the-as basic v0-0)) + v0-0 + ) + (('set-interpolation) + (let ((f0-1 (the float (-> block param 0)))) + (cond + ((>= 0.0 f0-1) + (set! (-> self interp-val) 1.0) + ) + (else + (set! (-> self interp-val) 0.0) + (set! (-> self interp-step) (/ 5.0 f0-1)) ) ) ) - (('teleport) - (when (nonzero? (-> self tracking-status)) - (jump-to-target! (-> self tracking point-of-interest-blend) 0.0) - (cam-calc-follow! (-> self tracking) (-> self trans) #f) - (the-as object (slave-set-rotation! - (-> self tracking) - (-> self trans) - (the-as cam-slave-options-u32 (-> self tracking-options)) - (-> self fov) - #f - ) - ) + ) + (('teleport) + (when (nonzero? (-> self tracking-status)) + (jump-to-target! (-> self tracking point-of-interest-blend) 0.0) + (cam-calc-follow! (-> self tracking) (-> self trans) #f) + (slave-set-rotation! + (-> self tracking) + (-> self trans) + (the-as cam-slave-options-u32 (-> self tracking-options)) + (-> self fov) + #f ) ) - (('stop-tracking) - (set! (-> self tracking-status) (the-as uint 0)) - 0 - ) - (('start-tracking) - (cond - ((< arg1 1) - (let ((t9-3 format) - (a0-14 0) - (a1-4 "ERROR : missing camera-slave parameter to *camera-combiner* start-tracking~%") - ) - (let ((v1-8 (-> event param 0))) - (rtype-of v1-8) + ) + (('stop-tracking) + (set! (-> self tracking-status) (the-as uint 0)) + 0 + ) + (('start-tracking) + (cond + ((< argc 1) + (let ((t9-3 format) + (a0-14 0) + (a1-4 "ERROR : missing camera-slave parameter to *camera-combiner* start-tracking~%") ) - (t9-3 a0-14 a1-4) + (let ((v1-8 (-> block param 0))) + (rtype-of v1-8) ) + (t9-3 a0-14 a1-4) ) - ((not (type? (-> event param 0) camera-slave)) - (let ((t9-5 format) - (a0-16 0) - (a1-6 "ERROR : invalid type '~A' to *camera-combiner* start-tracking~%") - (v1-11 (-> event param 0)) - ) - (t9-5 a0-16 a1-6 (rtype-of v1-11)) - ) + ) + ((not (type? (-> block param 0) camera-slave)) + (let ((t9-5 format) + (a0-16 0) + (a1-6 "ERROR : invalid type '~A' to *camera-combiner* start-tracking~%") + (v1-11 (-> block param 0)) + ) + (t9-5 a0-16 a1-6 (rtype-of v1-11)) ) - ((zero? (-> self tracking-status)) - (set! (-> self tracking-status) (the-as uint 1)) - (let ((gp-1 (the-as camera-slave (-> event param 0)))) - (set! (-> self tracking-options) (the-as int (-> gp-1 options))) - (set! (-> self tracking no-follow) (-> gp-1 tracking no-follow)) - (copy-to (-> self tracking tilt-adjust) (-> gp-1 tracking tilt-adjust)) - (copy-to (-> self tracking underwater-blend) (-> gp-1 tracking underwater-blend)) - (copy-to (-> self tracking point-of-interest-blend) (-> gp-1 tracking point-of-interest-blend)) - (let ((gp-2 (-> gp-1 trans))) - (cam-calc-follow! (-> self tracking) gp-2 #f) - (the-as object (slave-set-rotation! - (-> self tracking) - gp-2 - (the-as cam-slave-options-u32 (-> self tracking-options)) - (-> self fov) - #f - ) - ) + ) + ((zero? (-> self tracking-status)) + (set! (-> self tracking-status) (the-as uint 1)) + (let ((gp-1 (the-as camera-slave (-> block param 0)))) + (set! (-> self tracking-options) (the-as int (-> gp-1 options))) + (set! (-> self tracking no-follow) (-> gp-1 tracking no-follow)) + (copy-to (-> self tracking tilt-adjust) (-> gp-1 tracking tilt-adjust)) + (copy-to (-> self tracking underwater-blend) (-> gp-1 tracking underwater-blend)) + (copy-to (-> self tracking point-of-interest-blend) (-> gp-1 tracking point-of-interest-blend)) + (let ((gp-2 (-> gp-1 trans))) + (cam-calc-follow! (-> self tracking) gp-2 #f) + (slave-set-rotation! + (-> self tracking) + gp-2 + (the-as cam-slave-options-u32 (-> self tracking-options)) + (-> self fov) + #f ) ) ) - ) + ) ) - (('copy-tracking) - (cond - ((< arg1 1) - (let ((t9-11 format) - (a0-23 0) - (a1-12 "ERROR : missing camera-slave parameter to *camera-combiner* copy-tracking~%") - ) - (let ((v1-23 (-> event param 0))) - (rtype-of v1-23) + ) + (('copy-tracking) + (cond + ((< argc 1) + (let ((t9-11 format) + (a0-23 0) + (a1-12 "ERROR : missing camera-slave parameter to *camera-combiner* copy-tracking~%") ) - (t9-11 a0-23 a1-12) + (let ((v1-23 (-> block param 0))) + (rtype-of v1-23) ) + (t9-11 a0-23 a1-12) ) - ((not (type? (-> event param 0) camera-slave)) - (let ((t9-13 format) - (a0-25 0) - (a1-14 "ERROR : invalid type '~A' to *camera-combiner* copy-tracking~%") - (v1-25 (-> event param 0)) - ) - (t9-13 a0-25 a1-14 (rtype-of v1-25)) - ) - ) - ((nonzero? (-> self tracking-status)) - #f + ) + ((not (type? (-> block param 0) camera-slave)) + (let ((t9-13 format) + (a0-25 0) + (a1-14 "ERROR : invalid type '~A' to *camera-combiner* copy-tracking~%") + (v1-25 (-> block param 0)) + ) + (t9-13 a0-25 a1-14 (rtype-of v1-25)) ) - (else - (set! (-> self tracking-status) (the-as uint 1)) - (let ((gp-3 (the-as camera-slave (-> event param 0)))) - (set! (-> self tracking-options) (the-as int (-> gp-3 options))) - (set! (-> self tracking no-follow) (-> gp-3 tracking no-follow)) - (copy-to (-> self tracking tilt-adjust) (-> gp-3 tracking tilt-adjust)) - (copy-to (-> self tracking underwater-blend) (-> gp-3 tracking underwater-blend)) - (set! (-> self tracking follow-off quad) (-> gp-3 tracking follow-off quad)) - (set! (-> self tracking follow-pt quad) (-> gp-3 tracking follow-pt quad)) - (let* ((a2-23 (-> self tracking)) - (a3-7 (-> gp-3 tracking)) - (v1-37 (-> a3-7 inv-mat quad 0)) - (a0-32 (-> a3-7 inv-mat quad 1)) - (a1-17 (-> a3-7 inv-mat quad 2)) - (a3-8 (-> a3-7 inv-mat trans quad)) - ) - (set! (-> a2-23 inv-mat quad 0) v1-37) - (set! (-> a2-23 inv-mat quad 1) a0-32) - (set! (-> a2-23 inv-mat quad 2) a1-17) - (set! (-> a2-23 inv-mat trans quad) a3-8) - ) - (copy-to (-> self tracking point-of-interest-blend) (-> gp-3 tracking point-of-interest-blend)) - (set! (-> self tracking looking-at quad) (-> gp-3 tracking looking-at quad)) - (set! v0-0 (-> self tracking looking-interesting)) - (set! (-> (the-as vector v0-0) quad) (-> gp-3 tracking looking-interesting quad)) + ) + ((nonzero? (-> self tracking-status)) + #f + ) + (else + (set! (-> self tracking-status) (the-as uint 1)) + (let ((gp-3 (the-as camera-slave (-> block param 0)))) + (set! (-> self tracking-options) (the-as int (-> gp-3 options))) + (set! (-> self tracking no-follow) (-> gp-3 tracking no-follow)) + (copy-to (-> self tracking tilt-adjust) (-> gp-3 tracking tilt-adjust)) + (copy-to (-> self tracking underwater-blend) (-> gp-3 tracking underwater-blend)) + (set! (-> self tracking follow-off quad) (-> gp-3 tracking follow-off quad)) + (set! (-> self tracking follow-pt quad) (-> gp-3 tracking follow-pt quad)) + (let* ((a2-23 (-> self tracking)) + (a3-7 (-> gp-3 tracking)) + (v1-37 (-> a3-7 inv-mat quad 0)) + (a0-32 (-> a3-7 inv-mat quad 1)) + (a1-17 (-> a3-7 inv-mat quad 2)) + (a3-8 (-> a3-7 inv-mat trans quad)) + ) + (set! (-> a2-23 inv-mat quad 0) v1-37) + (set! (-> a2-23 inv-mat quad 1) a0-32) + (set! (-> a2-23 inv-mat quad 2) a1-17) + (set! (-> a2-23 inv-mat trans quad) a3-8) ) - v0-0 + (copy-to (-> self tracking point-of-interest-blend) (-> gp-3 tracking point-of-interest-blend)) + (set! (-> self tracking looking-at quad) (-> gp-3 tracking looking-at quad)) + (set! v0-0 (-> self tracking looking-interesting)) + (set! (-> (the-as vector v0-0) quad) (-> gp-3 tracking looking-interesting quad)) ) + v0-0 ) ) - ) + ) ) ) :code (behavior () @@ -440,7 +435,6 @@ (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc index 43b76434d54..33f53bbc8dc 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc @@ -3576,7 +3576,6 @@ (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc index e6acd246fa8..1199aedf9fb 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc @@ -601,357 +601,352 @@ ;; failed to figure out what this is: (defstate cam-master-active (camera-master) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object) (v1-125 uint)) (rlet ((vf0 :class vf)) (init-vf0-vector) - (let ((v1-0 event-type)) - (the-as - object - (cond - ((= v1-0 'dist-from-interp-src) - (cond - ((not *camera-combiner*) - #x48c80000 - ) - ((= (-> *camera-combiner* interp-val) 0.0) - 0 - ) - (else - (-> *camera-combiner* dist-from-src) - ) - ) - ) - ((= v1-0 'dist-from-interp-dest) - (cond - ((not *camera-combiner*) - 0 - ) - ((= (-> *camera-combiner* interp-val) 0.0) - #x48c80000 - ) - (else - (-> *camera-combiner* dist-from-dest) - ) - ) - ) - ((= v1-0 'level-deactivate) - (format 0 "ERROR : *camera* level-deactivate event not supported anymore~%") - ) - ((= v1-0 'clear-entity) - (format 0 "ERROR : *camera* clear-entity event not supported anymore~%") - ) - ((= v1-0 'no-intro) - (format 0 "ERROR : *camera* no-intro event not supported anymore '~S'~%" (-> event param 0)) + (case message + (('dist-from-interp-src) + (cond + ((not *camera-combiner*) + #x48c80000 + ) + ((= (-> *camera-combiner* interp-val) 0.0) + 0 + ) + (else + (-> *camera-combiner* dist-from-src) ) - ((= v1-0 'force-blend) - (format 0 "ERROR : *camera* force-blend event not supported anymore '~S'~%" (-> event param 0)) + ) + ) + (('dist-from-interp-dest) + (cond + ((not *camera-combiner*) + 0 + ) + ((= (-> *camera-combiner* interp-val) 0.0) + #x48c80000 + ) + (else + (-> *camera-combiner* dist-from-dest) ) - ((= v1-0 'teleport-to-transformq) - (when (> arg1 0) - (let ((gp-1 (the-as object (-> event param 0)))) - (when (-> self slave) - (deactivate (-> self slave 0)) - (set! (-> self slave) (the-as (pointer camera-slave) #f)) - ) - (set! (-> *camera-combiner* trans quad) (-> (the-as matrix gp-1) vector 0 quad)) - (quaternion->matrix (-> *camera-combiner* inv-camera-rot) (the-as quaternion (+ (the-as uint gp-1) 16))) - ) - (send-event self 'teleport) - (cam-master-activate-slave #f) - #t + ) + ) + (('level-deactivate) + (format 0 "ERROR : *camera* level-deactivate event not supported anymore~%") + ) + (('clear-entity) + (format 0 "ERROR : *camera* clear-entity event not supported anymore~%") + ) + (('no-intro) + (format 0 "ERROR : *camera* no-intro event not supported anymore '~S'~%" (-> block param 0)) + ) + (('force-blend) + (format 0 "ERROR : *camera* force-blend event not supported anymore '~S'~%" (-> block param 0)) + ) + (('teleport-to-transformq) + (when (> argc 0) + (let ((gp-1 (the-as object (-> block param 0)))) + (when (-> self slave) + (deactivate (-> self slave 0)) + (set! (-> self slave) (the-as (pointer camera-slave) #f)) ) + (set! (-> *camera-combiner* trans quad) (-> (the-as matrix gp-1) vector 0 quad)) + (quaternion->matrix (-> *camera-combiner* inv-camera-rot) (the-as quaternion (+ (the-as uint gp-1) 16))) ) - ((= v1-0 'teleport-to-other-start-string) - (let ((gp-2 (new 'stack-no-clear 'vector))) - (when (-> self slave) - (deactivate (-> self slave 0)) - (set! (-> self slave) (the-as (pointer camera-slave) #f)) - ) - (set! (-> *camera-combiner* trans quad) (-> *camera-other-trans* quad)) - (vector-! gp-2 (-> self tpos-curr-adj) *camera-other-trans*) - (vector-normalize! gp-2 1.0) - (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-2 (new 'static 'vector :y -1.0)) - ) - (send-event self 'teleport) - (the-as object (cam-master-activate-slave #f)) + (send-event self 'teleport) + (cam-master-activate-slave #f) + #t + ) + ) + (('teleport-to-other-start-string) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (when (-> self slave) + (deactivate (-> self slave 0)) + (set! (-> self slave) (the-as (pointer camera-slave) #f)) ) - ((= v1-0 'teleport-to-vector-start-string) - (when (> arg1 0) - (let ((s5-0 (the-as object (-> event param 0))) - (gp-3 (new 'stack-no-clear 'vector)) - ) - (when (-> self slave) - (deactivate (-> self slave 0)) - (set! (-> self slave) (the-as (pointer camera-slave) #f)) - ) - (set! (-> *camera-combiner* trans quad) (-> (the-as vector s5-0) quad)) - (vector-! gp-3 (-> self tpos-curr-adj) (the-as vector s5-0)) - (vector-normalize! gp-3 1.0) - (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-3 (new 'static 'vector :y -1.0)) + (set! (-> *camera-combiner* trans quad) (-> *camera-other-trans* quad)) + (vector-! gp-2 (-> self tpos-curr-adj) *camera-other-trans*) + (vector-normalize! gp-2 1.0) + (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-2 (new 'static 'vector :y -1.0)) + ) + (send-event self 'teleport) + (cam-master-activate-slave #f) + ) + (('teleport-to-vector-start-string) + (when (> argc 0) + (let ((s5-0 (the-as object (-> block param 0))) + (gp-3 (new 'stack-no-clear 'vector)) ) - (send-event self 'teleport) - (the-as object (cam-master-activate-slave #f)) + (when (-> self slave) + (deactivate (-> self slave 0)) + (set! (-> self slave) (the-as (pointer camera-slave) #f)) ) + (set! (-> *camera-combiner* trans quad) (-> (the-as vector s5-0) quad)) + (vector-! gp-3 (-> self tpos-curr-adj) (the-as vector s5-0)) + (vector-normalize! gp-3 1.0) + (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-3 (new 'static 'vector :y -1.0)) ) - ((= v1-0 'change-target) - (let ((a1-15 (-> event param 0))) - (cond - ((not a1-15) - (clear-focused (-> self focus)) - (logclear! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) - ) - (else - (try-update-focus (-> self focus) (the-as process-focusable a1-15)) - (logior! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) - (reset-target-tracking) - ) - ) + (send-event self 'teleport) + (cam-master-activate-slave #f) + ) + ) + (('change-target) + (let ((a1-15 (-> block param 0))) + (cond + ((not a1-15) + (clear-focused (-> self focus)) + (logclear! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) + ) + (else + (try-update-focus (-> self focus) (the-as process-focusable a1-15)) + (logior! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) + (reset-target-tracking) ) - (set! (-> *camera-combiner* tracking no-follow) #f) - #f - ) - ((= v1-0 'intro-done?) - (or (not (-> self slave)) (>= (-> self slave 0 intro-t) 1.0)) ) - ((= v1-0 'query-state) - (and (-> self slave) (= (-> self slave 0 next-state) (-> event param 0))) - ) - ((= v1-0 'change-to-entity-by-name) - (format - 0 - "ERROR : *camera* change-to-entity-by-name event not supported anymore '~S'~%" - (-> event param 0) + ) + (set! (-> *camera-combiner* tracking no-follow) #f) + #f + ) + (('intro-done?) + (or (not (-> self slave)) (>= (-> self slave 0 intro-t) 1.0)) + ) + (('query-state) + (and (-> self slave) (= (-> self slave 0 next-state) (-> block param 0))) + ) + (('change-to-entity-by-name) + (format + 0 + "ERROR : *camera* change-to-entity-by-name event not supported anymore '~S'~%" + (-> block param 0) + ) + ) + (('change-state) + (format 0 "ERROR : *camera* change-state event not supported anymore ~A~%" (-> block param 0)) + ) + (('set-slave) + (let ((s5-1 (process->ppointer (the-as process (-> block param 0)))) + (s4-0 (-> self settings interp-time)) + (gp-4 (-> self slave)) ) - ) - ((= v1-0 'change-state) - (format 0 "ERROR : *camera* change-state event not supported anymore ~A~%" (-> event param 0)) - ) - ((= v1-0 'set-slave) - (let ((s5-1 (process->ppointer (the-as process (-> event param 0)))) - (s4-0 (-> self settings interp-time)) - (gp-4 (-> self slave)) - ) - (when (and s5-1 (!= s5-1 gp-4)) - (set! (-> self slave) (the-as (pointer camera-slave) s5-1)) - (logior! (-> self master-options) (cam-master-options-u32 SET_COMBINER_AXIS)) - (set! (-> *camera-combiner* tracking tilt-adjust target) (-> self slave 0 tracking tilt-adjust target)) - (cond - ((or (zero? s4-0) (not gp-4)) - (if *math-camera* - (set! (-> *math-camera* reset) 1) - ) - (send-event *camera-combiner* 'set-interpolation 0) - (send-event *camera-combiner* 'stop-tracking) - (if (= (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) (camera-blend-to-type unknown-2)) - (send-event *camera-combiner* 'start-tracking (ppointer->process s5-1)) - ) + (when (and s5-1 (!= s5-1 gp-4)) + (set! (-> self slave) (the-as (pointer camera-slave) s5-1)) + (logior! (-> self master-options) (cam-master-options-u32 SET_COMBINER_AXIS)) + (set! (-> *camera-combiner* tracking tilt-adjust target) (-> self slave 0 tracking tilt-adjust target)) + (cond + ((or (zero? s4-0) (not gp-4)) + (if *math-camera* + (set! (-> *math-camera* reset) 1) ) - ((begin - (when (< 0.0 (-> gp-4 0 intro-t-step)) - (set! (-> self outro-t) (-> gp-4 0 intro-t)) - (set! (-> self outro-t-step) (/ -5.0 (the float s4-0))) - (set! (-> self outro-exit-value) (-> gp-4 0 outro-exit-value)) - (curve-copy! (-> self outro-curve) (-> gp-4 0 intro-curve)) - ) - (if (-> self settings no-intro) - (set! (-> self outro-t) 0.0) - ) - (send-event *camera-combiner* 'set-interpolation s4-0) - (cond - ((zero? (-> gp-4 0 blend-from-type)) - (send-event (ppointer->process (-> self decel)) 'change-state cam-fixed) - (send-event *camera-combiner* 'stop-tracking) - ) - (else - (send-event (ppointer->process (-> self decel)) 'change-state cam-decel) - ) - ) - (set! v1-125 (-> *camera-combiner* tracking-status)) - (zero? v1-125) - ) - (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) - (((camera-blend-to-type unknown-0)) - ) - (((camera-blend-to-type unknown-1)) - ) - (((camera-blend-to-type unknown-2)) - (if (= (-> gp-4 0 blend-from-type) 1) - (send-event *camera-combiner* 'copy-tracking (ppointer->process gp-4)) - (send-event *camera-combiner* 'start-tracking (ppointer->process s5-1)) - ) - (set! (-> *camera-combiner* tracking-status) (the-as uint 2)) - ) - (else - (format 0 "unknown blend-to type~%") - ) - ) + (send-event *camera-combiner* 'set-interpolation 0) + (send-event *camera-combiner* 'stop-tracking) + (if (= (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) (camera-blend-to-type unknown-2)) + (send-event *camera-combiner* 'start-tracking (ppointer->process s5-1)) ) - ((= v1-125 1) - (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) - (((camera-blend-to-type unknown-0)) - (set! (-> *camera-combiner* tracking-status) (the-as uint 3)) - ) - (((camera-blend-to-type unknown-1)) - (set! (-> *camera-combiner* tracking-status) (the-as uint 3)) - ) - (((camera-blend-to-type unknown-2)) - ) - (else - (format 0 "unknown blend-to type~%") - ) + ) + ((begin + (when (< 0.0 (-> gp-4 0 intro-t-step)) + (set! (-> self outro-t) (-> gp-4 0 intro-t)) + (set! (-> self outro-t-step) (/ -5.0 (the float s4-0))) + (set! (-> self outro-exit-value) (-> gp-4 0 outro-exit-value)) + (curve-copy! (-> self outro-curve) (-> gp-4 0 intro-curve)) + ) + (if (-> self settings no-intro) + (set! (-> self outro-t) 0.0) + ) + (send-event *camera-combiner* 'set-interpolation s4-0) + (cond + ((zero? (-> gp-4 0 blend-from-type)) + (send-event (ppointer->process (-> self decel)) 'change-state cam-fixed) + (send-event *camera-combiner* 'stop-tracking) + ) + (else + (send-event (ppointer->process (-> self decel)) 'change-state cam-decel) ) ) - ((or (= v1-125 2) (= v1-125 3)) - (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) - (((camera-blend-to-type unknown-0)) - (set! (-> *camera-combiner* tracking-status) (the-as uint 0)) - 0 - ) - (((camera-blend-to-type unknown-1)) - (set! (-> *camera-combiner* tracking-status) (the-as uint 0)) - 0 - ) - (((camera-blend-to-type unknown-2)) - (set! (-> *camera-combiner* tracking-status) (the-as uint 2)) + (set! v1-125 (-> *camera-combiner* tracking-status)) + (zero? v1-125) + ) + (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) + (((camera-blend-to-type unknown-0)) + ) + (((camera-blend-to-type unknown-1)) + ) + (((camera-blend-to-type unknown-2)) + (if (= (-> gp-4 0 blend-from-type) 1) + (send-event *camera-combiner* 'copy-tracking (ppointer->process gp-4)) + (send-event *camera-combiner* 'start-tracking (ppointer->process s5-1)) ) - (else - (format 0 "unknown blend-to type~%") - ) - ) + (set! (-> *camera-combiner* tracking-status) (the-as uint 2)) + ) + (else + (format 0 "unknown blend-to type~%") ) - (else - (format 0 "unknown combiner status~%") - ) + ) + ) + ((= v1-125 1) + (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) + (((camera-blend-to-type unknown-0)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 3)) ) - (if gp-4 - (the-as object (deactivate (-> gp-4 0))) - ) - ) - ) - ) - ((= v1-0 'ease-in) - (cond - ((< arg1 1) - (set! (-> self ease-t) 0.0) - (logclear! (-> self master-options) (cam-master-options-u32 HAVE_EASE_TO_POS)) + (((camera-blend-to-type unknown-1)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 3)) + ) + (((camera-blend-to-type unknown-2)) + ) + (else + (format 0 "unknown blend-to type~%") + ) + ) ) - ((< arg1 2) - (if (< (the-as float (-> event param 0)) (-> self ease-t)) - (set! (-> self ease-t) (the-as float (-> event param 0))) + ((or (= v1-125 2) (= v1-125 3)) + (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) + (((camera-blend-to-type unknown-0)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 0)) + 0 + ) + (((camera-blend-to-type unknown-1)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 0)) + 0 + ) + (((camera-blend-to-type unknown-2)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 2)) + ) + (else + (format 0 "unknown blend-to type~%") ) - (logclear! (-> self master-options) (cam-master-options-u32 HAVE_EASE_TO_POS)) + ) ) (else - (if (< (the-as float (-> event param 0)) (-> self ease-t)) - (set! (-> self ease-t) (the-as float (-> event param 0))) - ) - (set! (-> self ease-to quad) (-> (the-as vector (-> event param 1)) quad)) - (logior! (-> self master-options) (cam-master-options-u32 HAVE_EASE_TO_POS)) + (format 0 "unknown combiner status~%") ) ) - (set! (-> self ease-step) 0.033333335) - (set! v0-0 (-> self ease-from)) - (set! (-> (the-as vector v0-0) quad) (-> self tpos-curr-adj quad)) - v0-0 - ) - ((= v1-0 'damp-up) - (set! (-> self upspeed) 0.0) - ) - ((= v1-0 'reset-follow) - (reset-follow) - ) - ((= v1-0 'teleport) - (reset-target-tracking) - (if (-> self slave) - (send-event (ppointer->process (-> self slave)) event-type) + (if gp-4 + (deactivate (-> gp-4 0)) ) - (send-event *camera-combiner* event-type) ) - ((= v1-0 'toggle-slave-option) - (logxor! (-> self slave-options) (-> event param 0)) - (if (-> self slave) - (logxor! (-> self slave 0 options) (the-as uint (-> event param 0))) + ) + ) + (('ease-in) + (cond + ((< argc 1) + (set! (-> self ease-t) 0.0) + (logclear! (-> self master-options) (cam-master-options-u32 HAVE_EASE_TO_POS)) + ) + ((< argc 2) + (if (< (the-as float (-> block param 0)) (-> self ease-t)) + (set! (-> self ease-t) (the-as float (-> block param 0))) + ) + (logclear! (-> self master-options) (cam-master-options-u32 HAVE_EASE_TO_POS)) + ) + (else + (if (< (the-as float (-> block param 0)) (-> self ease-t)) + (set! (-> self ease-t) (the-as float (-> block param 0))) ) - (when (-> self decel) - (set! v0-0 (logxor (-> self decel 0 options) (the-as uint (-> event param 0)))) - (set! (-> self decel 0 options) (the-as cam-slave-options-u32 v0-0)) - v0-0 - ) + (set! (-> self ease-to quad) (-> (the-as vector (-> block param 1)) quad)) + (logior! (-> self master-options) (cam-master-options-u32 HAVE_EASE_TO_POS)) ) - ((= v1-0 'slave-option?) - (and (-> self slave) (logtest? (-> self slave 0 options) (-> event param 0))) + ) + (set! (-> self ease-step) 0.033333335) + (set! v0-0 (-> self ease-from)) + (set! (-> (the-as vector v0-0) quad) (-> self tpos-curr-adj quad)) + v0-0 + ) + (('damp-up) + (set! (-> self upspeed) 0.0) + ) + (('reset-follow) + (reset-follow) + ) + (('teleport) + (reset-target-tracking) + (if (-> self slave) + (send-event (ppointer->process (-> self slave)) message) ) - ((= v1-0 'set-slave-option) - (when (-> self slave) - (set! v0-0 (logior (-> self slave 0 options) (-> event param 0))) - (set! (-> self slave 0 options) (the-as cam-slave-options-u32 v0-0)) - v0-0 - ) + (send-event *camera-combiner* message) + ) + (('toggle-slave-option) + (logxor! (-> self slave-options) (-> block param 0)) + (if (-> self slave) + (logxor! (-> self slave 0 options) (the-as uint (-> block param 0))) ) - ((= v1-0 'clear-slave-option) - (when (-> self slave) - (set! v0-0 (logclear (-> self slave 0 options) (-> event param 0))) - (set! (-> self slave 0 options) (the-as cam-slave-options-u32 v0-0)) - v0-0 - ) + (when (-> self decel) + (set! v0-0 (logxor (-> self decel 0 options) (the-as uint (-> block param 0)))) + (set! (-> self decel 0 options) (the-as cam-slave-options-u32 v0-0)) + v0-0 + ) + ) + (('slave-option?) + (and (-> self slave) (logtest? (-> self slave 0 options) (-> block param 0))) + ) + (('set-slave-option) + (when (-> self slave) + (set! v0-0 (logior (-> self slave 0 options) (-> block param 0))) + (set! (-> self slave 0 options) (the-as cam-slave-options-u32 v0-0)) + v0-0 + ) + ) + (('clear-slave-option) + (when (-> self slave) + (set! v0-0 (logclear (-> self slave 0 options) (-> block param 0))) + (set! (-> self slave 0 options) (the-as cam-slave-options-u32 v0-0)) + v0-0 + ) + ) + (('no-follow) + (when (-> self slave) + (set! (-> self slave 0 tracking no-follow) (the-as basic #t)) + (vector-reset! (-> self slave 0 tracking follow-off)) + ) + (set! (-> *camera-combiner* tracking no-follow) (the-as basic #t)) + (set! v0-0 (-> *camera-combiner* tracking follow-off)) + (.svf (&-> (the-as vector v0-0) quad) vf0) + v0-0 + ) + (('yes-follow) + (if (-> self slave) + (set! (-> self slave 0 tracking no-follow) #f) ) - ((= v1-0 'no-follow) - (when (-> self slave) - (set! (-> self slave 0 tracking no-follow) (the-as basic #t)) - (vector-reset! (-> self slave 0 tracking follow-off)) + (set! (-> *camera-combiner* tracking no-follow) #f) + #f + ) + (('blend-from-as-fixed) + (let ((t9-42 format) + (a0-101 0) + (a1-35 "ERROR : *camera* blend-from-as-fixed event not supported anymore~%") ) - (set! (-> *camera-combiner* tracking no-follow) (the-as basic #t)) - (set! v0-0 (-> *camera-combiner* tracking follow-off)) - (.svf (&-> (the-as vector v0-0) quad) vf0) - v0-0 - ) - ((= v1-0 'yes-follow) - (if (-> self slave) - (set! (-> self slave 0 tracking no-follow) #f) - ) - (set! (-> *camera-combiner* tracking no-follow) #f) - #f - ) - ((= v1-0 'blend-from-as-fixed) - (let ((t9-42 format) - (a0-101 0) - (a1-35 "ERROR : *camera* blend-from-as-fixed event not supported anymore~%") - ) - (-> event param 0) - (t9-42 a0-101 a1-35) + (-> block param 0) + (t9-42 a0-101 a1-35) + ) + ) + (('point-of-interest) + (let ((t9-43 format) + (a0-102 0) + (a1-36 "ERROR : *camera* point-of-interest event not supported anymore~%") ) - ) - ((= v1-0 'point-of-interest) - (let ((t9-43 format) - (a0-102 0) - (a1-36 "ERROR : *camera* point-of-interest event not supported anymore~%") - ) - (-> event param 0) - (t9-43 a0-102 a1-36) + (-> block param 0) + (t9-43 a0-102 a1-36) + ) + ) + (('part-water-drip) + (set! (-> self water-drip-time) (current-time)) + (set! (-> self water-drip-mult) (the-as float (-> block param 0))) + (set! (-> self water-drip-speed) (the-as float (-> block param 1))) + ) + (else + (and (-> self slave) (let ((v1-237 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-237 from) (process->ppointer proc)) + (set! (-> v1-237 num-params) argc) + (set! (-> v1-237 message) message) + (set! (-> v1-237 param 0) (-> block param 0)) + (set! (-> v1-237 param 1) (-> block param 1)) + (set! (-> v1-237 param 2) (-> block param 2)) + (set! (-> v1-237 param 3) (-> block param 3)) + (set! (-> v1-237 param 4) (-> block param 4)) + (set! (-> v1-237 param 5) (-> block param 5)) + (send-event-function (ppointer->process (-> self slave)) v1-237) + ) ) - ) - ((= v1-0 'part-water-drip) - (set! (-> self water-drip-time) (current-time)) - (set! (-> self water-drip-mult) (the-as float (-> event param 0))) - (set! (-> self water-drip-speed) (the-as float (-> event param 1))) - ) - (else - (and (-> self slave) (let ((v1-237 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-237 from) (process->ppointer proc)) - (set! (-> v1-237 num-params) arg1) - (set! (-> v1-237 message) event-type) - (set! (-> v1-237 param 0) (-> event param 0)) - (set! (-> v1-237 param 1) (-> event param 1)) - (set! (-> v1-237 param 2) (-> event param 2)) - (set! (-> v1-237 param 3) (-> event param 3)) - (set! (-> v1-237 param 4) (-> event param 4)) - (set! (-> v1-237 param 5) (-> event param 5)) - (send-event-function (ppointer->process (-> self slave)) v1-237) - ) - ) - ) - ) ) ) ) @@ -975,7 +970,6 @@ (if (and (nonzero? camera-master-debug) *debug-segment*) (add-connection *debug-engine* self camera-master-debug self #f #f) ) - (none) ) :trans (behavior () (when (not (paused?)) @@ -985,7 +979,6 @@ ) (cam-master-effect) ) - (none) ) :code (behavior () (until #f @@ -1057,7 +1050,6 @@ (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc index 1400f87fb40..c1565f38303 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc @@ -29,13 +29,14 @@ ;; failed to figure out what this is: (defstate cam-point-watch (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -44,7 +45,6 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) ) - (none) ) :code (behavior () (until #f @@ -93,7 +93,6 @@ 0 ) #f - (none) ) ) @@ -478,13 +477,14 @@ ;; failed to figure out what this is: (defstate cam-free-floating (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -493,7 +493,6 @@ (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) (send-event *camera-combiner* 'stop-tracking) ) - (none) ) :code (behavior () (until #f @@ -511,10 +510,5 @@ (suspend) ) #f - (none) ) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc index 71d538984f3..bb43f6156b3 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc @@ -3,13 +3,14 @@ ;; failed to figure out what this is: (defstate cam-really-fixed (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -19,26 +20,25 @@ (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 ) - (none) ) :code (behavior () (until #f (suspend) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate cam-fixed (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -48,7 +48,6 @@ (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 ) - (none) ) :code (behavior () (until #f @@ -65,19 +64,19 @@ (suspend) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate cam-fixed-read-entity (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -96,7 +95,6 @@ ) ) (go cam-fixed) - (none) ) :code (behavior () (until #f @@ -104,19 +102,19 @@ (suspend) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate cam-pov (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -124,14 +122,12 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) ) - (none) ) :trans (behavior () (when (not (handle->process (-> *camera* settings pov-handle))) (set! (-> self blend-from-type) (the-as uint 0)) (cam-slave-go cam-fixed) ) - (none) ) :code (behavior () (until #f @@ -170,19 +166,19 @@ (suspend) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate cam-pov180 (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -190,14 +186,12 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) ) - (none) ) :trans (behavior () (when (not (handle->process (-> *camera* settings pov-handle))) (set! (-> self blend-from-type) (the-as uint 0)) (cam-slave-go cam-fixed) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -280,22 +274,17 @@ ) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate cam-pov-track (camera-slave) - :event (the-as - (function process int symbol event-message-block object :behavior camera-slave) - cam-standard-event-handler - ) + :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) ) - (none) ) :trans (behavior () (if (or (not (handle->process (-> *camera* settings pov-handle))) @@ -303,7 +292,6 @@ ) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f @@ -345,7 +333,6 @@ (suspend) ) #f - (none) ) ) @@ -359,28 +346,25 @@ ;; failed to figure out what this is: (defstate cam-standoff (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'set-standoff-dist) - (vector-normalize! (-> self pivot-pt) (the-as float (-> event param 0))) - (cam-standoff-calc-trans) - ) - ((= v1-0 'set-standoff-height) - (vector-flatten! (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down)) - (vector--float*! - (-> self pivot-pt) - (-> self pivot-pt) - (-> *camera* local-down) - (the-as float (-> event param 0)) - ) - (cam-standoff-calc-trans) - ) - (else - (the-as vector (cam-standard-event-handler proc arg1 event-type event)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('set-standoff-dist) + (vector-normalize! (-> self pivot-pt) (the-as float (-> block param 0))) + (cam-standoff-calc-trans) + ) + (('set-standoff-height) + (vector-flatten! (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down)) + (vector--float*! + (-> self pivot-pt) + (-> self pivot-pt) + (-> *camera* local-down) + (the-as float (-> block param 0)) + ) + (cam-standoff-calc-trans) + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -399,13 +383,11 @@ ) ) (cam-calc-follow! (-> self tracking) (-> self trans) #f) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f @@ -416,16 +398,12 @@ (suspend) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate cam-standoff-read-entity (camera-slave) - :event (the-as - (function process int symbol event-message-block object :behavior camera-slave) - cam-standard-event-handler - ) + :event cam-standard-event-handler :enter (behavior () (cond ((-> self enter-has-run) @@ -454,7 +432,6 @@ ) ) (go cam-standoff) - (none) ) :code (behavior () (until #f @@ -462,7 +439,6 @@ (suspend) ) #f - (none) ) ) @@ -500,13 +476,14 @@ ;; failed to figure out what this is: (defstate cam-eye (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -522,7 +499,6 @@ 0 ) (set! (-> self fov) 11650.845) - (none) ) :exit (behavior () (if (and *target* @@ -531,13 +507,11 @@ ) (send-event *target* 'end-mode) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (go cam-free-floating) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -658,16 +632,12 @@ ) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate cam-spline (camera-slave) - :event (the-as - (function process int symbol event-message-block object :behavior camera-slave) - cam-standard-event-handler - ) + :event cam-standard-event-handler :enter (behavior () (cond ((-> self enter-has-run) @@ -738,13 +708,11 @@ (format #t "ERROR : cam-spline enter without entity~%") ) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f @@ -757,19 +725,19 @@ (suspend) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate cam-decel (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -778,7 +746,6 @@ (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) ) - (none) ) :code (behavior () (until #f @@ -812,19 +779,19 @@ (suspend) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate cam-endlessfall (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -832,7 +799,6 @@ (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'cam-vector-seeker)) @@ -868,7 +834,6 @@ ) ) #f - (none) ) ) @@ -1072,21 +1037,18 @@ ;; failed to figure out what this is: (defstate cam-circular (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'teleport) - (the-as vector #f) - ) - ((= v1-0 'outro-done) - (set! (-> self trans quad) (-> *camera-combiner* trans quad)) - (cam-circular-position #f) - ) - (else - (the-as vector (cam-standard-event-handler proc arg1 event-type event)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (('outro-done) + (set! (-> self trans quad) (-> *camera-combiner* trans quad)) + (cam-circular-position #f) + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -1189,13 +1151,11 @@ ) ) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f @@ -1205,35 +1165,28 @@ (suspend) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate cam-lookat (camera-slave) - :event (the-as - (function process int symbol event-message-block object :behavior camera-slave) - cam-standard-event-handler - ) + :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f (suspend) ) #f - (none) ) ) @@ -3079,120 +3032,115 @@ ;; failed to figure out what this is: (defstate cam-string (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (let ((v1-0 event-type)) - (the-as - object - (cond - ((= v1-0 'get-behind) - (set! (-> self butt-timer) (the-as uint (+ (current-time) (seconds 0.25)))) - (set! (-> self butt-seek) (the-as basic #t)) - (set! v0-0 (-> self butt-vector)) - (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> event param 0)) quad)) - v0-0 - ) - ((= v1-0 'teleport) - (let ((gp-0 (new-stack-vector0))) - (cam-string-find-position-rel! gp-0) - (cam-string-set-position-rel! gp-0) - ) - ) - ((= v1-0 'joystick) - (set! (-> self phony-joystick-x) (the-as float (-> event param 0))) - (set! (-> self phony-joystick-y) (the-as float (-> event param 1))) - (set! v0-0 #t) - (set! (-> self have-phony-joystick) (the-as basic v0-0)) - v0-0 - ) - ((= v1-0 'tween-dist) - (cond - ((-> event param 0) - (set! (-> self string-val-locked) (the-as basic #t)) - (let ((s5-0 (the-as object (-> event param 0))) - (gp-1 (the-as object (-> event param 1))) - ) - (if (!= (-> (the-as vector s5-0) y) 4095996000.0) - (seek! - (-> self string-min-val y) - (-> (the-as vector s5-0) y) - (* (-> (the-as vector s5-0) w) (seconds-per-frame)) - ) - ) - (if (!= (-> (the-as vector s5-0) z) 4095996000.0) - (seek! - (-> self string-min-val z) - (-> (the-as vector s5-0) z) - (* (-> (the-as vector s5-0) w) (seconds-per-frame)) - ) - ) - (if (!= (-> (the-as vector gp-1) y) 4095996000.0) - (seek! - (-> self string-max-val y) - (-> (the-as vector gp-1) y) - (* (-> (the-as vector gp-1) w) (seconds-per-frame)) - ) - ) - (if (!= (-> (the-as vector gp-1) z) 4095996000.0) - (seek! - (-> self string-max-val z) - (-> (the-as vector gp-1) z) - (* (-> (the-as vector gp-1) w) (seconds-per-frame)) - ) - ) + (case message + (('get-behind) + (set! (-> self butt-timer) (the-as uint (+ (current-time) (seconds 0.25)))) + (set! (-> self butt-seek) (the-as basic #t)) + (set! v0-0 (-> self butt-vector)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> block param 0)) quad)) + v0-0 + ) + (('teleport) + (let ((gp-0 (new-stack-vector0))) + (cam-string-find-position-rel! gp-0) + (cam-string-set-position-rel! gp-0) + ) + ) + (('joystick) + (set! (-> self phony-joystick-x) (the-as float (-> block param 0))) + (set! (-> self phony-joystick-y) (the-as float (-> block param 1))) + (set! v0-0 #t) + (set! (-> self have-phony-joystick) (the-as basic v0-0)) + v0-0 + ) + (('tween-dist) + (cond + ((-> block param 0) + (set! (-> self string-val-locked) (the-as basic #t)) + (let ((s5-0 (the-as object (-> block param 0))) + (gp-1 (the-as object (-> block param 1))) ) - (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) - (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) - (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) - ) - (else - (set! (-> self string-val-locked) #f) - #f - ) - ) - ) - ((= v1-0 'set-dist) - (cond - ((-> event param 0) - (set! (-> self string-val-locked) (the-as basic #t)) - (set! (-> self string-min-val quad) (-> (the-as vector (-> event param 0)) quad)) - (set! (-> self string-max-val quad) (-> (the-as vector (-> event param 1)) quad)) - (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) - (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) - (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) - ) - (else - (set! (-> self string-val-locked) #f) - #f - ) - ) - ) - ((= v1-0 'relative-position) - (cond - ((-> event param 0) - (set! (-> self string-val-locked) (the-as basic #t)) - (set! (-> self string-relative) (the-as basic #t)) - (set! v0-0 (-> self relative-position)) - (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> event param 0)) quad)) - v0-0 - ) - (else - (set! (-> self string-val-locked) #f) - (set! (-> self string-relative) #f) - #f - ) - ) - ) - ((= v1-0 'set-max-angle-offset) - (set! (-> self max-angle-offset) (the-as float (-> event param 0))) + (if (!= (-> (the-as vector s5-0) y) 4095996000.0) + (seek! + (-> self string-min-val y) + (-> (the-as vector s5-0) y) + (* (-> (the-as vector s5-0) w) (seconds-per-frame)) + ) + ) + (if (!= (-> (the-as vector s5-0) z) 4095996000.0) + (seek! + (-> self string-min-val z) + (-> (the-as vector s5-0) z) + (* (-> (the-as vector s5-0) w) (seconds-per-frame)) + ) + ) + (if (!= (-> (the-as vector gp-1) y) 4095996000.0) + (seek! + (-> self string-max-val y) + (-> (the-as vector gp-1) y) + (* (-> (the-as vector gp-1) w) (seconds-per-frame)) + ) + ) + (if (!= (-> (the-as vector gp-1) z) 4095996000.0) + (seek! + (-> self string-max-val z) + (-> (the-as vector gp-1) z) + (* (-> (the-as vector gp-1) w) (seconds-per-frame)) + ) + ) + ) + (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) + (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) + (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) + ) + (else + (set! (-> self string-val-locked) #f) + #f ) - ((= v1-0 'blocked-side?) - (-> self los-state) + ) + ) + (('set-dist) + (cond + ((-> block param 0) + (set! (-> self string-val-locked) (the-as basic #t)) + (set! (-> self string-min-val quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self string-max-val quad) (-> (the-as vector (-> block param 1)) quad)) + (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) + (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) + (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) + ) + (else + (set! (-> self string-val-locked) #f) + #f ) - (else - (the-as object (cam-standard-event-handler proc arg1 event-type event)) - ) + ) + ) + (('relative-position) + (cond + ((-> block param 0) + (set! (-> self string-val-locked) (the-as basic #t)) + (set! (-> self string-relative) (the-as basic #t)) + (set! v0-0 (-> self relative-position)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> block param 0)) quad)) + v0-0 ) + (else + (set! (-> self string-val-locked) #f) + (set! (-> self string-relative) #f) + #f + ) + ) + ) + (('set-max-angle-offset) + (set! (-> self max-angle-offset) (the-as float (-> block param 0))) + ) + (('blocked-side?) + (-> self los-state) + ) + (else + (cam-standard-event-handler proc argc message block) ) ) ) @@ -3350,13 +3298,11 @@ (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f @@ -3369,7 +3315,6 @@ (suspend) ) #f - (none) ) ) @@ -3512,10 +3457,7 @@ ;; failed to figure out what this is: (defstate cam-stick (camera-slave) - :event (the-as - (function process int symbol event-message-block object :behavior camera-slave) - cam-standard-event-handler - ) + :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self view-off-param) (-> *camera* view-off-param-save)) @@ -3538,7 +3480,6 @@ (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) (slave-set-rotation! (-> self tracking) (-> self trans) (-> self options) (-> self fov) #f) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) @@ -3595,7 +3536,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -3605,7 +3545,6 @@ (suspend) ) #f - (none) ) ) @@ -3759,10 +3698,7 @@ ;; failed to figure out what this is: (defstate cam-bike (camera-slave) - :event (the-as - (function process int symbol event-message-block object :behavior camera-slave) - cam-standard-event-handler - ) + :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) (set-setting! 'head-offset 'abs (meters 4) 0) @@ -3782,18 +3718,15 @@ (cam-calc-bike-follow! (-> self tracking) (-> self trans) #f) (slave-set-rotation! (-> self tracking) (-> self trans) (-> self options) (-> self fov) #f) ) - (none) ) :exit (behavior () (remove-setting! 'head-offset) (remove-setting! 'foot-offset) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f @@ -3803,6 +3736,5 @@ (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc index df94aa0c44d..d819870c6d0 100644 --- a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc @@ -1061,6 +1061,9 @@ ) ;; definition for function cam-standard-event-handler +;; WARN: Return type mismatch none vs object. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 6] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 23] (defbehavior cam-standard-event-handler camera-slave ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('go) @@ -1085,7 +1088,6 @@ (slave-set-rotation! (-> self tracking) (-> self trans) (-> self options) (-> self fov) #f) ) ) - (none) ) ;; definition for function cam-curve-pos diff --git a/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc index 5d8e640fdcf..c15c2d36ca6 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc @@ -165,12 +165,11 @@ If we aren't bouncing however, TODO - CSHAPE" (defbehavior plat-event base-plat ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) "Handles platform related events. Presently all this does is: - if `event-type` is [['bonk]], then call [[base-plat:29]]" - (the-as object (case event-type - (('bonk) - (start-bouncing! self) - ) - ) - ) + (case event-type + (('bonk) + (start-bouncing! self) + ) + ) ) ;; definition of type eco-door @@ -236,23 +235,22 @@ If we aren't bouncing however, TODO - CSHAPE" and play the respective sound @unused - likely a leftover from Jak 1" - (the-as object (case event-type - (('trigger) - (set! (-> self locked) (not (-> self locked))) - (cond - ((-> self locked) - (if (and (-> self next-state) (= (-> self next-state name) 'door-closed)) - (sound-play "door-lock") - ) - ) - (else - (sound-play "door-unlock") - ) - ) - #t - ) - ) - ) + (case event-type + (('trigger) + (set! (-> self locked) (not (-> self locked))) + (cond + ((-> self locked) + (if (and (-> self next-state) (= (-> self next-state name) 'door-closed)) + (sound-play "door-lock") + ) + ) + (else + (sound-play "door-unlock") + ) + ) + #t + ) + ) ) ;; failed to figure out what this is: @@ -286,7 +284,6 @@ eco-door-event-handler (suspend) ) #f - (none) ) ) @@ -312,7 +309,6 @@ eco-door-event-handler (suspend) ) (go-virtual door-open) - (none) ) :post (the-as (function none :behavior eco-door) transform-post) ) @@ -353,7 +349,6 @@ eco-door-event-handler (suspend) ) #f - (none) ) ) @@ -383,7 +378,6 @@ eco-door-event-handler (sound-play "door-lock") ) (go-virtual door-closed) - (none) ) :post (the-as (function none :behavior eco-door) transform-post) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc index 9bc9d9a9909..74c17e151f0 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc @@ -101,49 +101,44 @@ ;; failed to figure out what this is: (defstate up-idle (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (let ((attack (the-as attack-info (-> event param 1)))) - (case (-> attack mode) - (('flop 'spin 'punch 'eco-yellow 'eco-red 'eco-blue 'eco-dark) - (when (or (not (or (= (-> attack mode) 'spin) (= (-> attack mode) 'punch))) - (logtest? (-> self button-status) (button-status button-status-3)) - ) - (send-event! self (-> self event-going-down)) - (go-virtual going-down) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((attack (the-as attack-info (-> block param 1)))) + (case (-> attack mode) + (('flop 'spin 'punch 'eco-yellow 'eco-red 'eco-blue 'eco-dark) + (when (or (not (or (= (-> attack mode) 'spin) (= (-> attack mode) 'punch))) + (logtest? (-> self button-status) (button-status button-status-3)) + ) + (send-event! self (-> self event-going-down)) + (go-virtual going-down) ) - ) + ) ) ) - (('trigger) - (sound-play "silo-button") + ) + (('trigger) + (sound-play "silo-button") + (go-virtual going-down) + ) + (('touch) + (when (logtest? (-> self button-status) (button-status button-status-4)) + (send-event! self (-> self event-going-down)) (go-virtual going-down) ) - (('touch) - (when (logtest? (-> self button-status) (button-status button-status-4)) - (send-event! self (-> self event-going-down)) - (go-virtual going-down) - ) - ) - (('move-to) - (the-as object (move-to! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1)))) - ) - ) + ) + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) ) ) :enter (behavior () (press! self #f) - (none) ) :trans (behavior () (if (logtest? (-> self button-status) (button-status button-status-2)) (rider-trans) ) - (none) ) :code (the-as (function none :behavior basebutton) sleep-code) :post (behavior () @@ -153,29 +148,24 @@ (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (rider-post) ) - (none) ) ) ;; failed to figure out what this is: (defstate going-down (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('untrigger) - (go-virtual going-up) - ) - (('move-to) - (the-as object (move-to! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1)))) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('untrigger) + (go-virtual going-up) + ) + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) ) ) :enter (behavior () (press! self #t) - (none) ) :trans (the-as (function none :behavior basebutton) rider-trans) :code (behavior () @@ -191,7 +181,6 @@ ) ) (go-virtual down-idle) - (none) ) :post (behavior () (when (logtest? (-> self button-status) (button-status button-status-2)) @@ -200,36 +189,30 @@ (quaternion-copy! (-> self root quat) (-> self move-to-quat)) ) (rider-post) - (none) ) ) ;; failed to figure out what this is: (defstate down-idle (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('untrigger) - (go-virtual going-up) - ) - (('move-to) - (the-as object (move-to! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1)))) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('untrigger) + (go-virtual going-up) + ) + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) ) ) :enter (behavior () (press! self #t) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (logtest? (-> self button-status) (button-status button-status-2)) (rider-trans) ) - (none) ) :code (behavior () (cond @@ -245,7 +228,6 @@ (go-virtual going-up) ) ) - (none) ) :post (behavior () (when (logtest? (-> self button-status) (button-status button-status-2)) @@ -254,29 +236,24 @@ (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (rider-post) ) - (none) ) ) ;; failed to figure out what this is: (defstate going-up (basebutton) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('move-to) - (the-as object (move-to! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1)))) - ) - (('trigger) - (go-virtual going-down) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) + (('trigger) + (go-virtual going-down) + ) ) ) :enter (behavior () (press! self #f) - (none) ) :trans (the-as (function none :behavior basebutton) rider-trans) :code (behavior () @@ -287,7 +264,6 @@ ) (send-event! self (-> self event-up)) (go-virtual up-idle) - (none) ) :post (behavior () (when (logtest? (-> self button-status) (button-status button-status-2)) @@ -296,7 +272,6 @@ (quaternion-copy! (-> self root quat) (-> self move-to-quat)) ) (rider-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc index fba59ab1326..4f98b884f25 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc @@ -38,60 +38,59 @@ ;; failed to figure out what this is: (defstate idle (blocking-plane) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('on) - (cond - ((nonzero? (-> self root)) - (let ((prim (-> self root root-prim))) - (set! (-> prim prim-core collide-as) (-> self root backup-collide-as)) - (let ((v0-0 (the-as int (-> self root backup-collide-with)))) - (set! (-> prim prim-core collide-with) (the-as collide-spec v0-0)) - v0-0 - ) - ) - ) - (else - (let ((proc-child-ptr-0 (-> self child))) - (while proc-child-ptr-0 - (let ((proc-child-0 (ppointer->process proc-child-ptr-0))) - (set! proc-child-ptr-0 (-> proc-child-ptr-0 0 brother)) - (if (type? proc-child-0 blocking-plane) - (send-event proc-child-0 'on) - ) - ) - ) - ) - (the-as int #f) - ) - ) - ) - (('off) - (cond - ((nonzero? (-> self root)) - (let ((v1-13 (-> self root root-prim))) - (set! (-> v1-13 prim-core collide-as) (collide-spec)) - (set! (-> v1-13 prim-core collide-with) (collide-spec)) - ) - 0 - ) - (else - (let ((proc-child-ptr-1 (-> self child))) - (while proc-child-ptr-1 - (let ((proc-child-1 (ppointer->process proc-child-ptr-1))) - (set! proc-child-ptr-1 (-> proc-child-ptr-1 0 brother)) - (if (type? proc-child-1 blocking-plane) - (send-event proc-child-1 'off) - ) - ) - ) - ) - (the-as int #f) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('on) + (cond + ((nonzero? (-> self root)) + (let ((prim (-> self root root-prim))) + (set! (-> prim prim-core collide-as) (-> self root backup-collide-as)) + (let ((v0-0 (the-as int (-> self root backup-collide-with)))) + (set! (-> prim prim-core collide-with) (the-as collide-spec v0-0)) + v0-0 + ) + ) + ) + (else + (let ((proc-child-ptr-0 (-> self child))) + (while proc-child-ptr-0 + (let ((proc-child-0 (ppointer->process proc-child-ptr-0))) + (set! proc-child-ptr-0 (-> proc-child-ptr-0 0 brother)) + (if (type? proc-child-0 blocking-plane) + (send-event proc-child-0 'on) ) + ) + ) + ) + (the-as int #f) + ) + ) + ) + (('off) + (cond + ((nonzero? (-> self root)) + (let ((v1-13 (-> self root root-prim))) + (set! (-> v1-13 prim-core collide-as) (collide-spec)) + (set! (-> v1-13 prim-core collide-with) (collide-spec)) ) + 0 + ) + (else + (let ((proc-child-ptr-1 (-> self child))) + (while proc-child-ptr-1 + (let ((proc-child-1 (ppointer->process proc-child-ptr-1))) + (set! proc-child-ptr-1 (-> proc-child-ptr-1 0 brother)) + (if (type? proc-child-1 blocking-plane) + (send-event proc-child-1 'off) + ) + ) + ) + ) + (the-as int #f) + ) + ) + ) + ) ) :code (the-as (function none :behavior blocking-plane) sleep-code) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc index 4e61b6dd57f..ef1079acaef 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc @@ -716,18 +716,8 @@ ;; definition for function collectable-standard-event-handler ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 108] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 144] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 179] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 191] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 213] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 256] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 271] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 288] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 309] (defbehavior collectable-standard-event-handler collectable ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (local-vars (v0-4 none)) + (local-vars (v0-4 object)) (when (and (or (= arg2 'touch) (= arg2 'attack)) (and (logtest? (-> self flags) (collectable-flag pickup)) (>= (- (current-time) (the-as int (-> self birth-time))) (the-as time-frame (-> self collect-timeout))) @@ -739,137 +729,136 @@ (process-contact-action arg0) (go-virtual pickup #f (process->handle arg0)) ) - (the-as object (cond - ((= arg2 'trans) - (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (update-transforms (-> self root)) - (ja-post) - ) - ((= arg2 'jump) - (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self jump-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (go-virtual jump) - ) - ((= arg2 'pickup) - (when (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) - (if (and (> arg1 0) (-> arg3 param 0)) - (move-to-point! (-> self root) (the-as vector (-> arg3 param 0))) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (process-contact-action arg0) - (go-virtual pickup #f (the-as handle #f)) - ) - ) - ((= arg2 'suck) - (when (not (and (-> self next-state) (let ((v1-60 (-> self next-state name))) - (or (= v1-60 'suck) (= v1-60 'pickup)) - ) - ) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual suck (process->handle (the-as process (-> arg3 param 0)))) - ) - ) - ((= arg2 'die) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual die) - ) - ((= arg2 'movie-pos) - (set! v0-4 (the-as none (-> arg3 param 0))) - (set! (-> self movie-pos-index) (the-as int v0-4)) - v0-4 - ) - ((= arg2 'actor-pause) - (cond - ((-> arg3 param 0) - (logior! (-> self mask) (process-mask actor-pause)) - (set! v0-4 (the-as none #t)) - (set! (-> self actor-pause) (the-as symbol v0-4)) - v0-4 - ) - (else - (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self actor-pause) #f) - #f - ) - ) - ) - ((= arg2 'fade) - (logior! (-> self flags) (collectable-flag fadeout)) - (set! (-> self fadeout-timeout) (the-as seconds 30)) - (set! v0-4 (the-as none (current-time))) - (set! (-> self birth-time) (the-as time-frame v0-4)) - v0-4 - ) - ((= arg2 'anim) - (cond - ((-> arg3 param 0) - (set! v0-4 (the-as none (logclear (-> self flags) (collectable-flag no-bob)))) - (set! (-> self flags) (the-as collectable-flag v0-4)) - ) - (else - (set! v0-4 (the-as none (logior (-> self flags) (collectable-flag no-bob)))) - (set! (-> self flags) (the-as collectable-flag v0-4)) - ) - ) - v0-4 - ) - ((= arg2 'collide-shape) - (cond - ((-> arg3 param 0) - (let ((v1-97 (-> self root root-prim))) - (set! (-> v1-97 prim-core collide-as) (-> self root backup-collide-as)) - (set! v0-4 (the-as none (-> self root backup-collide-with))) - (set! (-> v1-97 prim-core collide-with) (the-as collide-spec v0-4)) - ) - v0-4 - ) - (else - (let ((v1-99 (-> self root root-prim))) - (set! (-> v1-99 prim-core collide-as) (collide-spec)) - (set! (-> v1-99 prim-core collide-with) (collide-spec)) - ) - 0 - ) - ) - ) - ((= arg2 'get-notify) - (cond - ((= (-> arg3 param 0) #t) - (let ((v1-103 (ppointer->process (-> self parent)))) - (cond - ((logtest? (-> v1-103 mask) (process-mask process-tree)) - (set! (-> self notify) (the-as handle #f)) - #f - ) - (else - (set! v0-4 (the-as none (process->handle v1-103))) - (set! (-> self notify) (the-as handle v0-4)) - v0-4 - ) - ) - ) - ) - ((= (-> arg3 param 0) #f) - (set! (-> self notify) (the-as handle #f)) - #f - ) - (else - (set! v0-4 (the-as none (process->handle (the-as process (-> arg3 param 0))))) - (set! (-> self notify) (the-as handle v0-4)) - v0-4 - ) - ) - ) - ((= arg2 'effect) - (when (not (-> arg3 param 0)) - (set! (-> self collect-effect) (the-as basic 0)) - (set! (-> self collect-effect2) (the-as basic 0)) - 0 - ) - ) - ) + (cond + ((= arg2 'trans) + (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (update-transforms (-> self root)) + (ja-post) + ) + ((= arg2 'jump) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self jump-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (go-virtual jump) + ) + ((= arg2 'pickup) + (when (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (if (and (> arg1 0) (-> arg3 param 0)) + (move-to-point! (-> self root) (the-as vector (-> arg3 param 0))) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-contact-action arg0) + (go-virtual pickup #f (the-as handle #f)) + ) + ) + ((= arg2 'suck) + (when (not (and (-> self next-state) (let ((v1-60 (-> self next-state name))) + (or (= v1-60 'suck) (= v1-60 'pickup)) + ) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual suck (process->handle (the-as process (-> arg3 param 0)))) + ) + ) + ((= arg2 'die) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual die) + ) + ((= arg2 'movie-pos) + (set! v0-4 (-> arg3 param 0)) + (set! (-> self movie-pos-index) (the-as int v0-4)) + v0-4 + ) + ((= arg2 'actor-pause) + (cond + ((-> arg3 param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (set! v0-4 #t) + (set! (-> self actor-pause) (the-as symbol v0-4)) + v0-4 + ) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + #f + ) + ) + ) + ((= arg2 'fade) + (logior! (-> self flags) (collectable-flag fadeout)) + (set! (-> self fadeout-timeout) (the-as seconds 30)) + (set! v0-4 (current-time)) + (set! (-> self birth-time) (the-as time-frame v0-4)) + v0-4 + ) + ((= arg2 'anim) + (cond + ((-> arg3 param 0) + (set! v0-4 (logclear (-> self flags) (collectable-flag no-bob))) + (set! (-> self flags) (the-as collectable-flag v0-4)) + ) + (else + (set! v0-4 (logior (-> self flags) (collectable-flag no-bob))) + (set! (-> self flags) (the-as collectable-flag v0-4)) + ) + ) + v0-4 + ) + ((= arg2 'collide-shape) + (cond + ((-> arg3 param 0) + (let ((v1-97 (-> self root root-prim))) + (set! (-> v1-97 prim-core collide-as) (-> self root backup-collide-as)) + (set! v0-4 (-> self root backup-collide-with)) + (set! (-> v1-97 prim-core collide-with) (the-as collide-spec v0-4)) + ) + v0-4 + ) + (else + (let ((v1-99 (-> self root root-prim))) + (set! (-> v1-99 prim-core collide-as) (collide-spec)) + (set! (-> v1-99 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + ) + ((= arg2 'get-notify) + (cond + ((= (-> arg3 param 0) #t) + (let ((v1-103 (ppointer->process (-> self parent)))) + (cond + ((logtest? (-> v1-103 mask) (process-mask process-tree)) + (set! (-> self notify) (the-as handle #f)) + #f + ) + (else + (set! v0-4 (process->handle v1-103)) + (set! (-> self notify) (the-as handle v0-4)) + v0-4 + ) + ) ) + ) + ((= (-> arg3 param 0) #f) + (set! (-> self notify) (the-as handle #f)) + #f + ) + (else + (set! v0-4 (process->handle (the-as process (-> arg3 param 0)))) + (set! (-> self notify) (the-as handle v0-4)) + v0-4 + ) + ) + ) + ((= arg2 'effect) + (when (not (-> arg3 param 0)) + (set! (-> self collect-effect) (the-as basic 0)) + (set! (-> self collect-effect2) (the-as basic 0)) + 0 + ) + ) + ) ) ;; failed to figure out what this is: @@ -879,7 +868,6 @@ (if (task-complete? *game-info* (-> self entity extra perm task)) (go-virtual wait) ) - (none) ) :code (the-as (function none :behavior collectable) sleep-code) ) @@ -915,7 +903,6 @@ (logior! (-> self mask) (process-mask actor-pause)) ) (go-virtual wait) - (none) ) ) @@ -940,7 +927,6 @@ ) (go-virtual suck (process->handle *target*)) ) - (none) ) :exit (behavior () (vector-reset! (-> self root transv)) @@ -953,7 +939,6 @@ (logclear! (-> self root root-prim prim-core action) (collide-action solid)) (set! (-> self root root-prim prim-core collide-with) (collide-spec jak player-list tobot)) (set! (-> self root root-prim prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) - (none) ) :trans (behavior () (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) @@ -981,7 +966,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -989,7 +973,6 @@ (suspend) ) #f - (none) ) ) @@ -1009,7 +992,6 @@ (set! (-> self suck-y-offset) 0.0) (logclear! (-> self mask) (process-mask actor-pause)) (logior! (-> self flags) (collectable-flag pickup suck-in)) - (none) ) :code (behavior ((arg0 handle)) (until #f @@ -1020,15 +1002,14 @@ (suspend) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate wait (collectable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('eco-blue) (when (and (not (logtest? (-> self flags) (collectable-flag do-fadeout no-eco-blue))) (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) @@ -1044,7 +1025,7 @@ ) ) (else - (collectable-standard-event-handler proc arg1 event-type event) + (collectable-standard-event-handler proc argc message block) ) ) ) @@ -1057,7 +1038,6 @@ (process-contact-action *target*) (go-virtual pickup #f (process->handle *target*)) ) - (none) ) :code (behavior () (until #f @@ -1081,7 +1061,6 @@ (suspend) ) #f - (none) ) ) @@ -1119,15 +1098,14 @@ ) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate notice-blue (collectable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (when (and (or (= event-type 'touch) (= event-type 'attack)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flag pickup)) (>= (- (current-time) (the-as int (-> self birth-time))) (the-as time-frame (-> self collect-timeout))) (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) @@ -1148,13 +1126,11 @@ ) (set! (-> self suck-y-offset) 0.0) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) - (none) ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -1167,7 +1143,6 @@ (go-virtual wait) ) ) - (none) ) :code (behavior ((arg0 handle)) (until #f @@ -1178,64 +1153,60 @@ (suspend) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate pickup (collectable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('set-movie-pos) - (let ((v1-2 (res-lump-struct (-> self entity) 'movie-pos structure))) - (when v1-2 - (set! (-> (the-as vector v1-2) quad) (-> (the-as vector (-> event param 0)) quad)) - v1-2 - ) - ) - ) - (('actor-pause) - (cond - ((-> event param 0) - (logior! (-> self mask) (process-mask actor-pause)) - (let ((v0-1 (the-as object #t))) - (set! (-> self actor-pause) (the-as symbol v0-1)) - v0-1 - ) - ) - (else - (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self actor-pause) #f) - #f - ) - ) - ) - (('fade) - (process-entity-status! self (entity-perm-status dead) #t) - (send-event (handle->process (-> self notify)) 'notify 'die) - (the-as object (deactivate self)) - ) - (('effect) - (when (not (-> event param 0)) - (set! (-> self collect-effect) (the-as basic 0)) - (set! (-> self collect-effect2) (the-as basic 0)) - 0 - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('set-movie-pos) + (let ((v1-2 (res-lump-struct (-> self entity) 'movie-pos structure))) + (when v1-2 + (set! (-> (the-as vector v1-2) quad) (-> (the-as vector (-> block param 0)) quad)) + v1-2 + ) + ) + ) + (('actor-pause) + (cond + ((-> block param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (let ((v0-1 (the-as object #t))) + (set! (-> self actor-pause) (the-as symbol v0-1)) + v0-1 ) + ) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + #f + ) + ) + ) + (('fade) + (process-entity-status! self (entity-perm-status dead) #t) + (send-event (handle->process (-> self notify)) 'notify 'die) + (deactivate self) + ) + (('effect) + (when (not (-> block param 0)) + (set! (-> self collect-effect) (the-as basic 0)) + (set! (-> self collect-effect2) (the-as basic 0)) + 0 + ) + ) + ) ) :enter (behavior ((arg0 symbol) (arg1 handle)) (do-pickup self arg1) - (none) ) :code (behavior ((arg0 symbol) (arg1 handle)) (while (-> self child) (suspend) ) (go-virtual die) - (none) ) ) @@ -1244,7 +1215,6 @@ :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) @@ -1288,25 +1258,23 @@ ;; failed to figure out what this is: (defstate die (eco) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('fade) - (process-entity-status! self (entity-perm-status dead) #t) - (send-event (handle->process (-> self notify)) 'notify 'die) - (the-as object (deactivate self)) - ) - (('die) - (go-virtual die) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fade) + (process-entity-status! self (entity-perm-status dead) #t) + (send-event (handle->process (-> self notify)) 'notify 'die) + (deactivate self) + ) + (('die) + (go-virtual die) + ) + ) ) :exit (behavior () (process-entity-status! self (entity-perm-status no-kill) #f) (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) - (none) ) :code (behavior () (process-entity-status! self (entity-perm-status no-kill) #t) @@ -1342,7 +1310,6 @@ (logclear! (-> self draw status) (draw-control-status no-draw)) ) (go-virtual wait) - (none) ) ) @@ -1358,7 +1325,6 @@ ((the-as (function none) t9-2)) ) ) - (none) ) ) @@ -1576,7 +1542,6 @@ This commonly includes things such as: ) (send-event self 'suck *target*) ) - (none) ) ) @@ -1746,7 +1711,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -1755,7 +1719,6 @@ This commonly includes things such as: :virtual #t :code (behavior ((arg0 symbol) (arg1 handle)) (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) @@ -1972,7 +1935,6 @@ This commonly includes things such as: (logior! (-> self root root-prim prim-core action) (collide-action solid)) (set! (-> self root reaction) projectile-bounce-reaction) (set! (-> self root penetrated-by) (the-as penetrate -1)) - (none) ) :exit (behavior () (set! (-> self roty-speed) (fmin 262144.0 (-> self roty-speed))) @@ -1984,7 +1946,6 @@ This commonly includes things such as: (t9-2) ) ) - (none) ) :trans (the-as (function none :behavior gem) #f) :code (the-as (function none :behavior gem) sleep-code) @@ -2074,7 +2035,6 @@ This commonly includes things such as: ) (seek! (-> self roty-speed) 0.0 (* 16384.0 (seconds-per-frame))) (common-post self) - (none) ) ) @@ -2187,7 +2147,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -2711,7 +2670,6 @@ This commonly includes things such as: :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/conveyor_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/conveyor_REF.gc index 3e73bddf1c1..9c4033b1296 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/conveyor_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/conveyor_REF.gc @@ -434,7 +434,6 @@ and return it as well. Otherwise, set it to `0`" (if (nonzero? (-> self sound)) (update! (-> self sound)) ) - (none) ) ) @@ -558,7 +557,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type conveyor idle) post))) @@ -567,6 +565,5 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc index cebf47098ff..3541b96a779 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc @@ -669,7 +669,6 @@ (set! (-> v1-29 prim-core collide-with) (-> (the-as collide-shape-moving (-> self root)) backup-collide-with)) ) (go-virtual idle) - (none) ) ) @@ -686,7 +685,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior crate) ja-post) ) @@ -694,13 +692,13 @@ ;; failed to figure out what this is: (defstate carry (crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('carry? 'carry-info) (-> self carry) ) (('drop) - (set! (-> self root transv quad) (-> (the-as vector (-> event param 1)) quad)) + (set! (-> self root transv quad) (-> (the-as vector (-> block param 1)) quad)) (go-virtual fall) ) ) @@ -711,23 +709,21 @@ (carry-info-method-9 (-> self carry)) (carry-info-method-13 (-> self carry)) (update-transforms (the-as collide-shape-moving (-> self root))) - (none) ) ) ;; failed to figure out what this is: (defstate fall (crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('carry-info) - (-> self carry) - ) - (('carry? 'pickup) - (the-as carry-info #f) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('carry-info) + (-> self carry) + ) + (('carry? 'pickup) + (the-as carry-info #f) + ) + ) ) :enter (behavior () (if (handle->process (-> self carry other)) @@ -742,7 +738,6 @@ (-> self root root-prim prim-core collide-with) (collide-spec backgnd crate obstacle hit-by-others-list pusher) ) - (none) ) :trans (behavior () (when (and (logtest? (-> (the-as collide-shape-moving (-> self root)) status) (collide-status on-surface)) @@ -761,7 +756,6 @@ (go-virtual idle) ) ) - (none) ) :code (the-as (function none :behavior crate) sleep-code) :post (behavior () @@ -785,7 +779,6 @@ (set! (-> gp-1 root-prim type) collide-shape-prim-mesh) ) (crate-post) - (none) ) ) @@ -798,7 +791,6 @@ (suspend) ) (go-virtual idle) - (none) ) :post crate-post ) @@ -819,7 +811,6 @@ (logclear! (-> self mask) (process-mask sleep-code)) ) ) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self target) arg0) @@ -879,7 +870,6 @@ (suspend) ) #f - (none) ) :post crate-post ) @@ -887,12 +877,12 @@ ;; failed to figure out what this is: (defstate die (crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (case (-> self defense) (('darkeco) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (new-attack-id)) (mode 'darkeco)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (new-attack-id)) (mode 'darkeco)))) ) ) ) @@ -1084,40 +1074,38 @@ ) (go-virtual hide) ) - (none) ) ) ;; failed to figure out what this is: (defstate special-contents-die (crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('notify) - (case (-> event param 0) - (('pickup) - (let ((gp-0 (-> self entity extra perm))) - (logior! (-> gp-0 status) (entity-perm-status bit-5)) - (set! (-> gp-0 user-int8 1) (min 127 (+ (-> gp-0 user-int8 1) 1))) - (+! (-> self child-count) -1) - (when (<= (-> self child-count) 0) - (if (or (= (-> self defense) 'iron) (= (-> self defense) 'steel)) - (process-entity-status! self (entity-perm-status bit-4) #f) - ) - (process-entity-status! self (entity-perm-status dead) #t) - (process-entity-status! self (entity-perm-status subtask-complete) #t) - (set! (-> gp-0 user-int8 0) 2) - (let ((v0-0 (logclear (-> self mask) (process-mask sleep)))) - (set! (-> self mask) v0-0) - v0-0 - ) - ) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (let ((gp-0 (-> self entity extra perm))) + (logior! (-> gp-0 status) (entity-perm-status bit-5)) + (set! (-> gp-0 user-int8 1) (min 127 (+ (-> gp-0 user-int8 1) 1))) + (+! (-> self child-count) -1) + (when (<= (-> self child-count) 0) + (if (or (= (-> self defense) 'iron) (= (-> self defense) 'steel)) + (process-entity-status! self (entity-perm-status bit-4) #f) + ) + (process-entity-status! self (entity-perm-status dead) #t) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (set! (-> gp-0 user-int8 0) 2) + (let ((v0-0 (logclear (-> self mask) (process-mask sleep)))) + (set! (-> self mask) v0-0) + v0-0 + ) + ) ) + ) + ) + ) + ) ) :trans (-> (method-of-type crate die) trans) :code (behavior () @@ -1162,7 +1150,6 @@ (suspend) ) ) - (none) ) ) @@ -1491,6 +1478,5 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc index de0ba6efc71..bf73d3fa774 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc @@ -330,6 +330,5 @@ (set! (-> gp-0 global-scale) (* 4096.0 (* 3.0 (+ 1.0 f0-9)))) (set! (-> gp-0 individual-normal-scale) (+ 0.5 (* 0.5 f0-9))) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc index a00a79c1104..625b69c4c26 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc @@ -291,160 +291,139 @@ which is obviously useful for an elevator." ) ;; definition for function elevator-event -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 18] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 119] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 209] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 222] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 236] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 246] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 257] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 264] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 276] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 301] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 326] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 334] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 337] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 174] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 40] ;; WARN: disable def twice: 11. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defbehavior elevator-event elevator ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((evt-type event-type)) - (the-as - object - (cond - ((= evt-type 'status?) - (and (= (the float (/ (the-as int (-> event param 0)) 8)) (-> self move-pos 0)) - (= (the float (/ (the-as int (-> event param 1)) 8)) (-> self move-pos 1)) - ) - ) - ((= evt-type 'ridden) - (let ((proc-focus (handle->process (-> (the-as focus (-> event param 0)) handle)))) - (if (= (-> proc-focus type) target) - (set! (-> self sticky-player-last-ride-time) (current-time)) - ) + (case event-type + (('status?) + (and (= (the float (/ (the-as int (-> event param 0)) 8)) (-> self move-pos 0)) + (= (the float (/ (the-as int (-> event param 1)) 8)) (-> self move-pos 1)) + ) + ) + (('ridden) + (let ((proc-focus (handle->process (-> (the-as focus (-> event param 0)) handle)))) + (if (= (-> proc-focus type) target) + (set! (-> self sticky-player-last-ride-time) (current-time)) ) - #t - ) - ((= evt-type 'use-camera) - (if (-> event param 0) - (set-setting! 'entity-name (-> event param 0) 0.0 0) - (remove-setting! 'entity-name) - ) + ) + #t + ) + (('use-camera) + (if (-> event param 0) + (set-setting! 'entity-name (-> event param 0) 0.0 0) + (remove-setting! 'entity-name) ) - ((= evt-type 'move-to) - (when (and (-> self next-state) (let ((next-state-0 (-> self next-state name))) - (or (= next-state-0 'waiting) (= next-state-0 'arrived)) - ) - ) - (set! (-> self move-pos 0) (-> self move-pos 1)) - (cond - ((not (logtest? (-> event param 0) 7)) - (let ((gp-0 (the-as number (-> event param 0)))) - (set! (-> self move-pos 1) (if (type? (the-as uint gp-0) float) - (the-as float gp-0) - ) - ) + ) + (('move-to) + (when (and (-> self next-state) (let ((next-state-0 (-> self next-state name))) + (or (= next-state-0 'waiting) (= next-state-0 'arrived)) + ) ) - ) - (else - (case (-> event param 0) - (('quote 'bottom) - (set! (-> self move-pos 1) (-> self bottom-top 0)) - ) - (('quote 'top) - (set! (-> self move-pos 1) (-> self bottom-top 1)) + (set! (-> self move-pos 0) (-> self move-pos 1)) + (cond + ((not (logtest? (-> event param 0) 7)) + (let ((gp-0 (the-as number (-> event param 0)))) + (set! (-> self move-pos 1) (if (type? (the-as uint gp-0) float) + (the-as float gp-0) + ) ) - ) - ) - ) - (go-virtual running) - ) - ) - ((= evt-type 'jump-to) - (cond - ((not (logtest? (-> event param 0) 7)) - (let ((gp-1 (the-as number (-> event param 0)))) - (set! (-> self move-pos 1) (if (type? (the-as uint gp-1) float) - (the-as float gp-1) - ) - ) - ) ) - (else - (case (-> event param 0) - (('quote 'bottom) - (set! (-> self move-pos 1) (-> self bottom-top 0)) - ) - (('quote 'top) - (set! (-> self move-pos 1) (-> self bottom-top 1)) - ) - ) - ) - ) - (set! (-> self move-pos 0) (-> self move-pos 1)) - (get-point-in-path! (-> self path) (-> self basetrans) (-> self move-pos 0) 'interp) - (go-virtual waiting) - ) - ((= evt-type 'trigger) - (when (and (-> self next-state) (let ((next-state-1 (-> self next-state name))) - (or (= next-state-1 'waiting) (= next-state-1 'arrived)) - ) - ) - (set! (-> self move-pos 0) (-> self move-pos 1)) - (cond - ((= (-> self move-pos 0) (-> self bottom-top 0)) - (set! (-> self move-pos 1) (-> self bottom-top 1)) - ) - ((= (-> self move-pos 0) (-> self bottom-top 1)) + ) + (else + (case (-> event param 0) + (('quote 'bottom) (set! (-> self move-pos 1) (-> self bottom-top 0)) ) + (('quote 'top) + (set! (-> self move-pos 1) (-> self bottom-top 1)) + ) ) - (go-virtual running) ) ) - ((= evt-type 'query) + (go-virtual running) + ) + ) + (('jump-to) + (cond + ((not (logtest? (-> event param 0) 7)) + (let ((gp-1 (the-as number (-> event param 0)))) + (set! (-> self move-pos 1) (if (type? (the-as uint gp-1) float) + (the-as float gp-1) + ) + ) + ) + ) + (else (case (-> event param 0) - (('waiting?) - (and (-> self next-state) (= (-> self next-state name) 'waiting)) - ) - (('arrived?) - (and (-> self next-state) (let ((v1-61 (-> self next-state name))) - (or (= v1-61 'arrived) (= v1-61 'waiting)) - ) - ) + (('quote 'bottom) + (set! (-> self move-pos 1) (-> self bottom-top 0)) ) - (('running?) - (and (-> self next-state) (= (-> self next-state name) 'running)) - ) - (('path-pos?) - (+ (-> self move-pos 0) (* (-> self path-pos) (- (-> self move-pos 1) (-> self move-pos 0)))) - ) - (('player-standing-on?) - (= (-> self sticky-player-last-ride-time) (current-time)) - ) - (('point-inside-shaft?) - (move-between-points self (the-as vector (-> event param 1)) (-> self bottom-top 1) (-> self bottom-top 0)) - ) - (('going-down?) - (< (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 1) 'interp) y) - (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 0) 'interp) y) - ) - ) - (('going-up?) - (< (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 0) 'interp) y) - (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 1) 'interp) y) - ) + (('quote 'top) + (set! (-> self move-pos 1) (-> self bottom-top 1)) ) ) ) - ((= evt-type 'go-dormant) - (go-virtual dormant) - ) - (else - (plat-event proc arg1 event-type event) + ) + (set! (-> self move-pos 0) (-> self move-pos 1)) + (get-point-in-path! (-> self path) (-> self basetrans) (-> self move-pos 0) 'interp) + (go-virtual waiting) + ) + (('trigger) + (when (and (-> self next-state) (let ((next-state-1 (-> self next-state name))) + (or (= next-state-1 'waiting) (= next-state-1 'arrived)) + ) + ) + (set! (-> self move-pos 0) (-> self move-pos 1)) + (cond + ((= (-> self move-pos 0) (-> self bottom-top 0)) + (set! (-> self move-pos 1) (-> self bottom-top 1)) ) + ((= (-> self move-pos 0) (-> self bottom-top 1)) + (set! (-> self move-pos 1) (-> self bottom-top 0)) + ) + ) + (go-virtual running) + ) + ) + (('query) + (case (-> event param 0) + (('waiting?) + (and (-> self next-state) (= (-> self next-state name) 'waiting)) + ) + (('arrived?) + (and (-> self next-state) (let ((v1-61 (-> self next-state name))) + (or (= v1-61 'arrived) (= v1-61 'waiting)) + ) + ) + ) + (('running?) + (and (-> self next-state) (= (-> self next-state name) 'running)) ) + (('path-pos?) + (+ (-> self move-pos 0) (* (-> self path-pos) (- (-> self move-pos 1) (-> self move-pos 0)))) + ) + (('player-standing-on?) + (= (-> self sticky-player-last-ride-time) (current-time)) + ) + (('point-inside-shaft?) + (move-between-points self (the-as vector (-> event param 1)) (-> self bottom-top 1) (-> self bottom-top 0)) + ) + (('going-down?) + (< (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 1) 'interp) y) + (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 0) 'interp) y) + ) + ) + (('going-up?) + (< (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 0) 'interp) y) + (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self move-pos 1) 'interp) y) + ) + ) + ) + ) + (('go-dormant) + (go-virtual dormant) + ) + (else + (plat-event proc arg1 event-type event) ) ) ) @@ -565,8 +544,8 @@ do so. ;; failed to figure out what this is: (defstate dormant (elevator) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual waiting) ) @@ -574,7 +553,7 @@ do so. #f ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -586,16 +565,16 @@ do so. ;; failed to figure out what this is: (defstate waiting (elevator) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (if (commited-to-ride? self) (logior! (-> self elevator-status) (elevator-status waiting-to-descend)) ) - (elevator-event proc arg1 event-type event) + (elevator-event proc argc message block) ) (else - (elevator-event proc arg1 event-type event) + (elevator-event proc argc message block) ) ) ) @@ -606,7 +585,6 @@ do so. (if (nonzero? (-> self sound)) (update-vol! (-> self sound) 0.0) ) - (none) ) :trans (behavior () (plat-trans) @@ -626,22 +604,20 @@ do so. (set! (-> self move-pos 1) (-> self path-seq data (the int (-> self move-pos 1)) next-pos)) (go-virtual running) ) - (none) ) :code (the-as (function none :behavior elevator) sleep-code) :post (behavior () (logclear! (-> self elevator-status) (elevator-status waiting-to-descend)) (debug-draw (-> self path)) (plat-post) - (none) ) ) ;; failed to figure out what this is: (defstate running (elevator) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('running?) #t ) @@ -649,7 +625,7 @@ do so. (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) ) (else - (elevator-event proc arg1 event-type event) + (elevator-event proc argc message block) ) ) ) @@ -689,7 +665,6 @@ do so. (set-setting! 'jump #f 0.0 0) (apply-settings *setting-control*) ) - (none) ) :exit (behavior () (if (not (logtest? (-> self params flags) (elevator-flags elevator-flags-7))) @@ -699,7 +674,6 @@ do so. (if (logtest? (-> self params flags) (elevator-flags prevent-jump)) (remove-setting! 'jump) ) - (none) ) :trans (behavior () (if (and (not (logtest? (-> self elevator-status) (elevator-status waiting-to-ascend))) @@ -715,7 +689,6 @@ do so. (elevator-method-48 self) ) (plat-trans) - (none) ) :code (behavior () (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) @@ -726,7 +699,6 @@ do so. ) ) #f - (none) ) :post (behavior () (when (logtest? (-> self elevator-status) (elevator-status waiting-to-ascend)) @@ -743,21 +715,20 @@ do so. ) ) (move-post) - (none) ) ) ;; failed to figure out what this is: (defstate arrived (elevator) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (set! (-> self ride-timer) (current-time)) - (elevator-event proc arg1 event-type event) + (elevator-event proc argc message block) ) (else - (elevator-event proc arg1 event-type event) + (elevator-event proc argc message block) ) ) ) @@ -771,7 +742,6 @@ do so. (script-eval gp-0 :key (* (the int (-> self move-pos 1)) 8) :vector (-> self root trans)) ) ) - (none) ) :trans (behavior () (if (and (< (- (-> self ride-timer) (-> self sticky-player-last-ride-time)) (seconds 2)) @@ -797,7 +767,6 @@ do so. ) ) (plat-trans) - (none) ) :code (the-as (function none :behavior elevator) sleep-code) :post (the-as (function none :behavior elevator) plat-post) diff --git a/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc index 9df5321ffcc..bbed3651b9b 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc @@ -178,16 +178,15 @@ ;; failed to figure out what this is: (defstate idle (swingpole) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch 'attack) - (if (send-event proc 'pole-grab (-> event param 0)) - (go-virtual active (process->handle proc)) - ) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (if (send-event proc 'pole-grab (-> block param 0)) + (go-virtual active (process->handle proc)) + ) + #f + ) + ) ) :code (behavior () (if (nonzero? (-> self draw)) @@ -208,7 +207,6 @@ 0 ) ) - (none) ) ) @@ -236,7 +234,6 @@ ) ) (go-virtual idle) - (none) ) ) @@ -667,416 +664,407 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (manipy) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (s4-0 object)) - (let ((v1-0 event-type)) - (the-as - object - (cond - ((= v1-0 'attackable) - (cond - ((-> event param 0) - (set! s4-0 (logior (process-mask collectable) (-> self mask))) - (set! (-> self mask) (the-as process-mask s4-0)) - ) - (else - (set! s4-0 (logclear (-> self mask) (process-mask collectable))) - (set! (-> self mask) (the-as process-mask s4-0)) - ) - ) - s4-0 - ) - ((= v1-0 'blend-shape) - (when (nonzero? (-> self skel)) - (cond - ((-> event param 0) - (set! s4-0 (logior (-> self skel status) (joint-control-status blend-shape eye-anim))) - (set! (-> self skel status) (the-as joint-control-status s4-0)) - ) - (else - (set! s4-0 (logclear (-> self skel status) (joint-control-status blend-shape eye-anim))) - (set! (-> self skel status) (the-as joint-control-status s4-0)) - ) - ) - s4-0 - ) - ) - ((= v1-0 'shadow) - (when (nonzero? (-> self draw)) - (cond - ((-> event param 0) - (set! s4-0 (-> self shadow-backup)) - (set! (-> self draw shadow) (the-as shadow-geo s4-0)) - s4-0 - ) - (else - (set! (-> self draw shadow) #f) - #f - ) - ) - ) - ) - ((= v1-0 'shadow-volume) - (let ((v1-17 (get-art-by-name-method (-> self draw jgeo) (the-as string (-> event param 0)) (the-as type #f)))) - (if v1-17 - (set! (-> self shadow-volume-joint) (+ (-> (the-as joint v1-17) number) 1)) - ) - ) - (when (and (-> self draw shadow-ctrl) (< 1 arg1) (>= (the-as int (-> event param 1)) 0)) - (let ((v0-1 (command-get-int (-> event param 1) 0))) - (set! (-> self draw shadow-ctrl settings flags) (the-as shadow-flags v0-1)) - v0-1 - ) - ) - ) - ((= v1-0 'shadow-type) - (if (and (-> self draw shadow-ctrl) (> arg1 0)) - (set! (-> self draw shadow-ctrl settings shadow-type) (command-get-int (-> event param 0) 0)) - ) + (case message + (('attackable) + (cond + ((-> block param 0) + (set! s4-0 (logior (process-mask collectable) (-> self mask))) + (set! (-> self mask) (the-as process-mask s4-0)) + ) + (else + (set! s4-0 (logclear (-> self mask) (process-mask collectable))) + (set! (-> self mask) (the-as process-mask s4-0)) ) - ((= v1-0 'shadow-dir) - (when (and (-> self draw shadow-ctrl) (> arg1 0)) - (set! s4-0 (-> self draw shadow-ctrl settings shadow-dir)) - (set! (-> (the-as vector s4-0) x) (command-get-float (-> event param 0) 0.0)) - (set! (-> (the-as vector s4-0) y) (command-get-float (-> event param 1) 0.0)) - (set! (-> (the-as vector s4-0) z) (command-get-float (-> event param 2) 0.0)) - (set! (-> (the-as vector s4-0) w) (if (< 3 arg1) - (command-get-float (-> event param 3) 0.0) - 409600.0 - ) - ) - s4-0 + ) + s4-0 + ) + (('blend-shape) + (when (nonzero? (-> self skel)) + (cond + ((-> block param 0) + (set! s4-0 (logior (-> self skel status) (joint-control-status blend-shape eye-anim))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) + ) + (else + (set! s4-0 (logclear (-> self skel status) (joint-control-status blend-shape eye-anim))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) ) ) - ((= v1-0 'shadow-top-plane) - (when (and (-> self draw shadow-ctrl) (>= arg1 4)) - (set! s4-0 (-> self draw shadow-ctrl settings top-plane)) - (set! (-> (the-as plane s4-0) x) (command-get-float (-> event param 0) 0.0)) - (set! (-> (the-as plane s4-0) y) (command-get-float (-> event param 1) 0.0)) - (set! (-> (the-as plane s4-0) z) (command-get-float (-> event param 2) 0.0)) - (set! (-> (the-as plane s4-0) w) (command-get-float (-> event param 3) 0.0)) - s4-0 + s4-0 + ) + ) + (('shadow) + (when (nonzero? (-> self draw)) + (cond + ((-> block param 0) + (set! s4-0 (-> self shadow-backup)) + (set! (-> self draw shadow) (the-as shadow-geo s4-0)) + s4-0 + ) + (else + (set! (-> self draw shadow) #f) + #f ) ) - ((= v1-0 'shadow-bot-plane) - (when (and (-> self draw shadow-ctrl) (>= arg1 4)) - (set! s4-0 (-> self draw shadow-ctrl settings bot-plane)) - (set! (-> (the-as plane s4-0) x) (command-get-float (-> event param 0) 0.0)) - (set! (-> (the-as plane s4-0) y) (command-get-float (-> event param 1) 0.0)) - (set! (-> (the-as plane s4-0) z) (command-get-float (-> event param 2) 0.0)) - (set! (-> (the-as plane s4-0) w) (command-get-float (-> event param 3) 0.0)) - s4-0 + ) + ) + (('shadow-volume) + (let ((v1-17 (get-art-by-name-method (-> self draw jgeo) (the-as string (-> block param 0)) (the-as type #f)))) + (if v1-17 + (set! (-> self shadow-volume-joint) (+ (-> (the-as joint v1-17) number) 1)) ) + ) + (when (and (-> self draw shadow-ctrl) (< 1 argc) (>= (the-as int (-> block param 1)) 0)) + (let ((v0-1 (command-get-int (-> block param 1) 0))) + (set! (-> self draw shadow-ctrl settings flags) (the-as shadow-flags v0-1)) + v0-1 ) - ((= v1-0 'no-fog) - (set! s4-0 (logior (-> self draw status) (draw-control-status disable-fog))) - (set! (-> self draw status) (the-as draw-control-status s4-0)) - s4-0 + ) + ) + (('shadow-type) + (if (and (-> self draw shadow-ctrl) (> argc 0)) + (set! (-> self draw shadow-ctrl settings shadow-type) (command-get-int (-> block param 0) 0)) ) - ((= v1-0 'setup-spotlight-shadow) - (when (-> self draw shadow-ctrl) - (let ((v1-53 (command-get-process "spotlight" *target*))) - (when v1-53 - (let ((s5-1 (-> (the-as process-drawable v1-53) node-list data 3))) - (vector<-cspace! (new 'stack-no-clear 'vector) s5-1) - (let ((s5-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-1 bone transform vector 2) -1.0)) - (s4-1 - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self draw shadow-joint-index))) - ) - (f30-0 1638400.0) - (s3-0 (new 'stack-no-clear 'collide-query)) - (f28-0 122880.0) - ) - (set! (-> s3-0 start-pos quad) (-> s4-1 quad)) - (vector-normalize-copy! (-> s3-0 move-dist) s5-2 f28-0) - (let ((v1-64 s3-0)) - (set! (-> v1-64 radius) 1638.4) - (set! (-> v1-64 collide-with) (collide-spec obstacle hit-by-others-list)) - (set! (-> v1-64 ignore-process0) self) - (set! (-> v1-64 ignore-process1) #f) - (set! (-> v1-64 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) - (set! (-> v1-64 action-mask) (collide-action solid)) + ) + (('shadow-dir) + (when (and (-> self draw shadow-ctrl) (> argc 0)) + (set! s4-0 (-> self draw shadow-ctrl settings shadow-dir)) + (set! (-> (the-as vector s4-0) x) (command-get-float (-> block param 0) 0.0)) + (set! (-> (the-as vector s4-0) y) (command-get-float (-> block param 1) 0.0)) + (set! (-> (the-as vector s4-0) z) (command-get-float (-> block param 2) 0.0)) + (set! (-> (the-as vector s4-0) w) (if (< 3 argc) + (command-get-float (-> block param 3) 0.0) + 409600.0 + ) + ) + s4-0 + ) + ) + (('shadow-top-plane) + (when (and (-> self draw shadow-ctrl) (>= argc 4)) + (set! s4-0 (-> self draw shadow-ctrl settings top-plane)) + (set! (-> (the-as plane s4-0) x) (command-get-float (-> block param 0) 0.0)) + (set! (-> (the-as plane s4-0) y) (command-get-float (-> block param 1) 0.0)) + (set! (-> (the-as plane s4-0) z) (command-get-float (-> block param 2) 0.0)) + (set! (-> (the-as plane s4-0) w) (command-get-float (-> block param 3) 0.0)) + s4-0 + ) + ) + (('shadow-bot-plane) + (when (and (-> self draw shadow-ctrl) (>= argc 4)) + (set! s4-0 (-> self draw shadow-ctrl settings bot-plane)) + (set! (-> (the-as plane s4-0) x) (command-get-float (-> block param 0) 0.0)) + (set! (-> (the-as plane s4-0) y) (command-get-float (-> block param 1) 0.0)) + (set! (-> (the-as plane s4-0) z) (command-get-float (-> block param 2) 0.0)) + (set! (-> (the-as plane s4-0) w) (command-get-float (-> block param 3) 0.0)) + s4-0 + ) + ) + (('no-fog) + (set! s4-0 (logior (-> self draw status) (draw-control-status disable-fog))) + (set! (-> self draw status) (the-as draw-control-status s4-0)) + s4-0 + ) + (('setup-spotlight-shadow) + (when (-> self draw shadow-ctrl) + (let ((v1-53 (command-get-process "spotlight" *target*))) + (when v1-53 + (let ((s5-1 (-> (the-as process-drawable v1-53) node-list data 3))) + (vector<-cspace! (new 'stack-no-clear 'vector) s5-1) + (let ((s5-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-1 bone transform vector 2) -1.0)) + (s4-1 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self draw shadow-joint-index))) ) - (let* ((f0-13 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) - (f28-1 (if (< 0.0 f0-13) - (* f0-13 f28-0) - 122880.0 - ) + (f30-0 1638400.0) + (s3-0 (new 'stack-no-clear 'collide-query)) + (f28-0 122880.0) + ) + (set! (-> s3-0 start-pos quad) (-> s4-1 quad)) + (vector-normalize-copy! (-> s3-0 move-dist) s5-2 f28-0) + (let ((v1-64 s3-0)) + (set! (-> v1-64 radius) 1638.4) + (set! (-> v1-64 collide-with) (collide-spec obstacle hit-by-others-list)) + (set! (-> v1-64 ignore-process0) self) + (set! (-> v1-64 ignore-process1) #f) + (set! (-> v1-64 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-64 action-mask) (collide-action solid)) + ) + (let* ((f0-13 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) + (f28-1 (if (< 0.0 f0-13) + (* f0-13 f28-0) + 122880.0 ) - ) - (the-as object (shadow-control-method-14 - (-> self draw shadow-ctrl) - s4-1 - s5-2 - f30-0 - (- f28-1 (command-get-float (-> event param 0) 0.0)) - (+ f28-1 (command-get-float (-> event param 1) 0.0)) - ) ) - ) + ) + (shadow-control-method-14 + (-> self draw shadow-ctrl) + s4-1 + s5-2 + f30-0 + (- f28-1 (command-get-float (-> block param 0) 0.0)) + (+ f28-1 (command-get-float (-> block param 1) 0.0)) ) ) ) ) ) ) - ((= v1-0 'color-mult) - (when (>= arg1 4) - (set! s4-0 (-> self draw color-mult)) - (set! (-> (the-as rgbaf s4-0) x) (command-get-float (-> event param 0) 0.0)) - (set! (-> (the-as rgbaf s4-0) y) (command-get-float (-> event param 1) 0.0)) - (set! (-> (the-as rgbaf s4-0) z) (command-get-float (-> event param 2) 0.0)) - (set! (-> (the-as rgbaf s4-0) w) (command-get-float (-> event param 3) 0.0)) - s4-0 - ) - ) - ((= v1-0 'color-mult-vector) - (set! s4-0 (-> self draw color-mult)) - (set! (-> (the-as rgbaf s4-0) quad) (-> (the-as vector (-> event param 0)) quad)) - s4-0 - ) - ((= v1-0 'color-emissive-vector) - (set! s4-0 (-> self draw color-emissive)) - (set! (-> (the-as rgbaf s4-0) quad) (-> (the-as vector (-> event param 0)) quad)) - s4-0 - ) - ((= v1-0 'segment) - (let ((a1-44 (/ (the-as int (-> event param 0)) 8)) - (a2-5 (/ (the-as int (-> event param 1)) 8)) - ) - (the-as object (setup-masks (-> self draw) (the-as int a1-44) (the-as int a2-5))) + ) + ) + (('color-mult) + (when (>= argc 4) + (set! s4-0 (-> self draw color-mult)) + (set! (-> (the-as rgbaf s4-0) x) (command-get-float (-> block param 0) 0.0)) + (set! (-> (the-as rgbaf s4-0) y) (command-get-float (-> block param 1) 0.0)) + (set! (-> (the-as rgbaf s4-0) z) (command-get-float (-> block param 2) 0.0)) + (set! (-> (the-as rgbaf s4-0) w) (command-get-float (-> block param 3) 0.0)) + s4-0 + ) + ) + (('color-mult-vector) + (set! s4-0 (-> self draw color-mult)) + (set! (-> (the-as rgbaf s4-0) quad) (-> (the-as vector (-> block param 0)) quad)) + s4-0 + ) + (('color-emissive-vector) + (set! s4-0 (-> self draw color-emissive)) + (set! (-> (the-as rgbaf s4-0) quad) (-> (the-as vector (-> block param 0)) quad)) + s4-0 + ) + (('segment) + (let ((a1-44 (/ (the-as int (-> block param 0)) 8)) + (a2-5 (/ (the-as int (-> block param 1)) 8)) ) - ) - ((= v1-0 'trans-hook) - (set! s4-0 (-> event param 0)) - (set! (-> self new-trans-hook) (the-as (function none) s4-0)) - s4-0 - ) - ((= v1-0 'post-hook) - (set! s4-0 (-> event param 0)) - (set! (-> self new-post-hook) (the-as (function none) s4-0)) - s4-0 - ) - ((= v1-0 'user-data) - (set! s4-0 (-> event param 0)) - (set! (-> self userdata) (the-as uint s4-0)) - s4-0 - ) - ((= v1-0 'eval) - ((the-as (function manipy object) (-> event param 0)) self) - ) - ((= v1-0 'speed) - (set! (-> self speed) (the-as float (-> event param 0))) - ) - ((= v1-0 'event-hook) - (set! s4-0 (-> event param 0)) - (set! (-> self cur-event-hook) (the-as (function none) s4-0)) - s4-0 - ) - ((= v1-0 'art-joint-anim) - (set! (-> self new-joint-anim) - (get-art-by-name (-> self draw art-group) (the-as string (-> event param 0)) art-joint-anim) - ) - (set! s4-0 (-> event param 1)) - (set! (-> self new-joint-anim-blend) (the-as uint s4-0)) - s4-0 - ) - ((= v1-0 'anim-mode) - (when (nonzero? (-> self skel)) - (set! (-> self anim-mode) (the-as symbol (-> event param 0))) - (if (= (-> self anim-mode) 'clone-anim) - (ja-post) - ) - (-> self anim-mode) + (setup-masks (-> self draw) (the-as int a1-44) (the-as int a2-5)) + ) + ) + (('trans-hook) + (set! s4-0 (-> block param 0)) + (set! (-> self new-trans-hook) (the-as (function none) s4-0)) + s4-0 + ) + (('post-hook) + (set! s4-0 (-> block param 0)) + (set! (-> self new-post-hook) (the-as (function none) s4-0)) + s4-0 + ) + (('user-data) + (set! s4-0 (-> block param 0)) + (set! (-> self userdata) (the-as uint s4-0)) + s4-0 + ) + (('eval) + ((the-as (function manipy object) (-> block param 0)) self) + ) + (('speed) + (set! (-> self speed) (the-as float (-> block param 0))) + ) + (('event-hook) + (set! s4-0 (-> block param 0)) + (set! (-> self cur-event-hook) (the-as (function none) s4-0)) + s4-0 + ) + (('art-joint-anim) + (set! (-> self new-joint-anim) + (get-art-by-name (-> self draw art-group) (the-as string (-> block param 0)) art-joint-anim) ) - ) - ((or (= v1-0 'origin-joint-index) (= v1-0 'center-joint)) - (set! (-> self draw origin-joint-index) (-> event param 0)) - (set! s4-0 (-> event param 0)) - (set! (-> self draw shadow-joint-index) (the-as uint s4-0)) - s4-0 - ) - ((= v1-0 'max-vis-dist) - (set! (-> self draw lod-set lod (-> self draw lod-set max-lod) dist) (the-as float (-> event param 0))) - ) - ((= v1-0 'grab) - (set! (-> self cur-grab-handle) (process->handle (the-as process (-> event param 0)))) - (let ((v1-98 (handle->process (-> self cur-grab-handle)))) - (when v1-98 - (set! s4-0 (-> self old-grab-pos)) - (set! (-> (the-as vector s4-0) quad) (-> (the-as process-drawable v1-98) root trans quad)) - s4-0 - ) + (set! s4-0 (-> block param 1)) + (set! (-> self new-joint-anim-blend) (the-as uint s4-0)) + s4-0 + ) + (('anim-mode) + (when (nonzero? (-> self skel)) + (set! (-> self anim-mode) (the-as symbol (-> block param 0))) + (if (= (-> self anim-mode) 'clone-anim) + (ja-post) ) - ) - ((= v1-0 'target) - (set! s4-0 (process->handle (the-as process (-> event param 0)))) - (set! (-> self cur-target-handle) (the-as handle s4-0)) + (-> self anim-mode) + ) + ) + (('origin-joint-index 'center-joint) + (set! (-> self draw origin-joint-index) (-> block param 0)) + (set! s4-0 (-> block param 0)) + (set! (-> self draw shadow-joint-index) (the-as uint s4-0)) + s4-0 + ) + (('max-vis-dist) + (set! (-> self draw lod-set lod (-> self draw lod-set max-lod) dist) (the-as float (-> block param 0))) + ) + (('grab) + (set! (-> self cur-grab-handle) (process->handle (the-as process (-> block param 0)))) + (let ((v1-98 (handle->process (-> self cur-grab-handle)))) + (when v1-98 + (set! s4-0 (-> self old-grab-pos)) + (set! (-> (the-as vector s4-0) quad) (-> (the-as process-drawable v1-98) root trans quad)) s4-0 ) - ((= v1-0 'trans) - (cond - ((type? (-> self root) collide-shape) - (the-as object (move-to-point! (-> self root) (the-as vector (-> event param 0)))) - ) - (else - (set! s4-0 (-> self root trans)) - (set! (-> (the-as vector s4-0) quad) (-> (the-as vector (-> event param 0)) quad)) - s4-0 - ) - ) - ) - ((= v1-0 'rot) - (let ((s5-3 (new 'stack-no-clear 'matrix))) - (matrix-rotate-y! s5-3 (the-as float (-> event param 0))) - (matrix->quaternion (-> self root quat) s5-3) - ) - ) - ((= v1-0 'rot-quat) - (quaternion-copy! (-> self root quat) (the-as quaternion (-> event param 0))) - ) - ((= v1-0 'clone-copy-trans) - (set! s4-0 (-> event param 0)) - (set! (-> self clone-copy-trans) (the-as symbol s4-0)) + ) + ) + (('target) + (set! s4-0 (process->handle (the-as process (-> block param 0)))) + (set! (-> self cur-target-handle) (the-as handle s4-0)) + s4-0 + ) + (('trans) + (cond + ((type? (-> self root) collide-shape) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) + ) + (else + (set! s4-0 (-> self root trans)) + (set! (-> (the-as vector s4-0) quad) (-> (the-as vector (-> block param 0)) quad)) s4-0 ) - ((= v1-0 'release) - (set! (-> self cur-grab-handle) (the-as handle #f)) - #f - ) - ((= v1-0 'draw) - (set! (-> self draw?) (the-as symbol (-> event param 0))) - (cond - ((-> event param 0) - (let ((v1-114 (logtest? (-> self draw status) (draw-control-status no-draw)))) - (logclear! (-> self draw status) (draw-control-status no-draw)) - (when v1-114 - (cond - ((nonzero? (-> self skel)) - (let ((gp-1 (-> self skel status))) - (logior! (-> self skel status) (joint-control-status sync-math)) - (set! s4-0 (the-as object (ja-post))) - (set! (-> self skel status) gp-1) - ) - s4-0 - ) - (else - (the-as object (ja-post)) - ) - ) - ) - ) - ) - (else - (set! s4-0 (logior (-> self draw status) (draw-control-status no-draw))) - (set! (-> self draw status) (the-as draw-control-status s4-0)) - s4-0 - ) - ) - ) - ((= v1-0 'sync) - (when (nonzero? (-> self skel)) - (cond - ((-> event param 0) - (set! s4-0 (logior (-> self skel status) (joint-control-status sync-math))) - (set! (-> self skel status) (the-as joint-control-status s4-0)) - ) - (else - (set! s4-0 (logclear (-> self skel status) (joint-control-status sync-math))) - (set! (-> self skel status) (the-as joint-control-status s4-0)) - ) - ) - s4-0 - ) - ) - ((= v1-0 'query) - (case (-> event param 0) - (('grab) - (handle->process (-> self cur-grab-handle)) - ) - (('done) - (case (-> self anim-mode) - (('play1 'play) - (>= (ja-frame-num 0) (the float (+ (-> (ja-group) frames num-frames) -2))) + ) + ) + (('rot) + (let ((s5-3 (new 'stack-no-clear 'matrix))) + (matrix-rotate-y! s5-3 (the-as float (-> block param 0))) + (matrix->quaternion (-> self root quat) s5-3) + ) + ) + (('rot-quat) + (quaternion-copy! (-> self root quat) (the-as quaternion (-> block param 0))) + ) + (('clone-copy-trans) + (set! s4-0 (-> block param 0)) + (set! (-> self clone-copy-trans) (the-as symbol s4-0)) + s4-0 + ) + (('release) + (set! (-> self cur-grab-handle) (the-as handle #f)) + #f + ) + (('draw) + (set! (-> self draw?) (the-as symbol (-> block param 0))) + (cond + ((-> block param 0) + (let ((v1-114 (logtest? (-> self draw status) (draw-control-status no-draw)))) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (when v1-114 + (cond + ((nonzero? (-> self skel)) + (let ((gp-1 (-> self skel status))) + (logior! (-> self skel status) (joint-control-status sync-math)) + (set! s4-0 (ja-post)) + (set! (-> self skel status) gp-1) + ) + s4-0 ) + (else + (ja-post) + ) ) ) - ) - ) - ((= v1-0 'set-frame-num) - (let ((v1-147 (-> self skel root-channel 0))) - (set! (-> v1-147 num-func) num-func-identity) - (set! (-> v1-147 frame-num) (the-as float (-> event param 0))) - ) - ) - ((= v1-0 'prefix) - (set! s4-0 (-> event param 0)) - (set! (-> self prefix) (the-as basic s4-0)) + ) + ) + (else + (set! s4-0 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status s4-0)) s4-0 ) - ((= v1-0 'light-index) - (let ((v0-40 (command-get-int (-> event param 0) 0))) - (set! (-> self draw light-index) (the-as uint v0-40)) - v0-40 - ) - ) - ((= v1-0 'eye-slot) - (set! (-> self draw mgeo header eye-ctrl eye-slot) (command-get-int (-> event param 0) 0)) - ) - ((= v1-0 'shadow-mask) - (let ((v0-42 (command-get-int (-> event param 0) 0))) - (set! (-> self draw shadow-mask) (the-as uint v0-42)) - v0-42 - ) - ) - ((= v1-0 'shadow-values) - (let ((v0-43 (command-get-int (-> event param 0) 0))) - (set! (-> self draw shadow-values) (the-as uint v0-43)) - v0-43 + ) + ) + (('sync) + (when (nonzero? (-> self skel)) + (cond + ((-> block param 0) + (set! s4-0 (logior (-> self skel status) (joint-control-status sync-math))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) + ) + (else + (set! s4-0 (logclear (-> self skel status) (joint-control-status sync-math))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) ) ) - ((= v1-0 'mirror) - (cond - ((-> event param 0) - (set! s4-0 (-> self node-list data 2)) - (set! (-> (the-as cspace s4-0) param0) - (the-as (function cspace transformq none) cspace<-parented-matrix-mirror!) - ) - (set! (-> (the-as cspace s4-0) param1) (the-as basic (-> *math-camera* mirror-trans))) - (set! (-> (the-as cspace s4-0) param2) (the-as basic (-> *math-camera* mirror-normal))) - ) - (else - (set! s4-0 (-> self node-list data 2)) - (set! (-> (the-as cspace s4-0) param0) #f) - ) + s4-0 + ) + ) + (('query) + (case (-> block param 0) + (('grab) + (handle->process (-> self cur-grab-handle)) + ) + (('done) + (case (-> self anim-mode) + (('play1 'play) + (>= (ja-frame-num 0) (the float (+ (-> (ja-group) frames num-frames) -2))) ) - s4-0 - ) - ((= v1-0 'draw-mirror) - (send-event (ppointer->process (-> self child)) 'draw (-> event param 0)) - ) - ((= v1-0 'user) - (set! s4-0 (-> event param 1)) - (set! (-> self user-uint64 (/ (the-as int (-> event param 0)) 8)) (the-as uint s4-0)) - s4-0 - ) - ((= v1-0 'die) - (the-as object (deactivate self)) + ) + ) + ) + ) + (('set-frame-num) + (let ((v1-147 (-> self skel root-channel 0))) + (set! (-> v1-147 num-func) num-func-identity) + (set! (-> v1-147 frame-num) (the-as float (-> block param 0))) + ) + ) + (('prefix) + (set! s4-0 (-> block param 0)) + (set! (-> self prefix) (the-as basic s4-0)) + s4-0 + ) + (('light-index) + (let ((v0-40 (command-get-int (-> block param 0) 0))) + (set! (-> self draw light-index) (the-as uint v0-40)) + v0-40 + ) + ) + (('eye-slot) + (set! (-> self draw mgeo header eye-ctrl eye-slot) (command-get-int (-> block param 0) 0)) + ) + (('shadow-mask) + (let ((v0-42 (command-get-int (-> block param 0) 0))) + (set! (-> self draw shadow-mask) (the-as uint v0-42)) + v0-42 + ) + ) + (('shadow-values) + (let ((v0-43 (command-get-int (-> block param 0) 0))) + (set! (-> self draw shadow-values) (the-as uint v0-43)) + v0-43 + ) + ) + (('mirror) + (cond + ((-> block param 0) + (set! s4-0 (-> self node-list data 2)) + (set! (-> (the-as cspace s4-0) param0) + (the-as (function cspace transformq none) cspace<-parented-matrix-mirror!) + ) + (set! (-> (the-as cspace s4-0) param1) (the-as basic (-> *math-camera* mirror-trans))) + (set! (-> (the-as cspace s4-0) param2) (the-as basic (-> *math-camera* mirror-normal))) + ) + (else + (set! s4-0 (-> self node-list data 2)) + (set! (-> (the-as cspace s4-0) param0) #f) ) - ((= v1-0 'do-effect) - (if (and (nonzero? (-> self skel)) (-> self skel effect)) - (the-as - object - (do-effect (-> self skel effect) (the-as symbol (-> event param 0)) (the-as float (-> event param 1)) -1) - ) - ) + ) + s4-0 + ) + (('draw-mirror) + (send-event (ppointer->process (-> self child)) 'draw (-> block param 0)) + ) + (('user) + (set! s4-0 (-> block param 1)) + (set! (-> self user-uint64 (/ (the-as int (-> block param 0)) 8)) (the-as uint s4-0)) + s4-0 + ) + (('die) + (deactivate self) + ) + (('do-effect) + (if (and (nonzero? (-> self skel)) (-> self skel effect)) + (do-effect (-> self skel effect) (the-as symbol (-> block param 0)) (the-as float (-> block param 1)) -1) ) - (else - (if (-> self cur-event-hook) - (the-as object ((-> self cur-event-hook))) - ) + ) + (else + (if (-> self cur-event-hook) + ((-> self cur-event-hook)) ) - ) ) ) ) @@ -1113,7 +1101,6 @@ This commonly includes things such as: ) ) ((-> self cur-trans-hook)) - (none) ) :code (behavior () (logclear! (-> self mask) (process-mask heap-shrunk)) @@ -1222,7 +1209,6 @@ This commonly includes things such as: ) ) #f - (none) ) ) @@ -1360,13 +1346,12 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate active (part-tracker) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('die) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (deactivate self) + ) + ) ) :code (behavior () (set! (-> self start-time) (current-time)) @@ -1430,7 +1415,6 @@ This commonly includes things such as: (notify-parent-of-death self) (suspend) 0 - (none) ) ) @@ -1692,13 +1676,12 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate active (lightning-tracker) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('die) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (deactivate self) + ) + ) ) :exit (behavior () (when (nonzero? (-> self sound)) @@ -1712,7 +1695,6 @@ This commonly includes things such as: (-> v1-1 id) ) ) - (none) ) :code (behavior () (set! (-> self sound) (new 'static 'sound-id)) @@ -1828,7 +1810,6 @@ This commonly includes things such as: (notify-parent-of-death self) (suspend) 0 - (none) ) ) @@ -2070,7 +2051,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior med-res-level) ja-post) ) @@ -2126,8 +2106,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate active (part-spawner) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('stop) (process-entity-status! self (entity-perm-status subtask-complete) #t) (set! (-> self enable) #f) @@ -2139,7 +2119,7 @@ This commonly includes things such as: #t ) (('trans) - (let ((v0-1 (the-as object (-> (the-as vector (-> event param 0)) quad)))) + (let ((v0-1 (the-as object (-> (the-as vector (-> block param 0)) quad)))) (set! (-> self root trans quad) (the-as uint128 v0-1)) v0-1 ) @@ -2157,7 +2137,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -2539,13 +2518,14 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate cam-launcher-shortfall (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -2567,13 +2547,11 @@ This commonly includes things such as: (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -2589,7 +2567,6 @@ This commonly includes things such as: ) ) #f - (none) ) ) @@ -2612,13 +2589,14 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate cam-launcher-longfall (camera-slave) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'teleport) - #f - (the-as symbol (cam-standard-event-handler proc arg1 event-type event)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -2633,14 +2611,12 @@ This commonly includes things such as: (cam-calc-follow! (-> self tracking) (-> self trans) #f) (slave-set-rotation! (-> self tracking) (-> self trans) (-> self options) (-> self fov) #f) ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) (cam-launcher-long-joystick) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -2702,24 +2678,22 @@ This commonly includes things such as: ) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate idle (launcher) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('instant-death) - (go-virtual deactivated) - ) - (('trans) - (move-to-point! (-> self root) (the-as vector (-> event param 0))) - (the-as object (update-transforms (-> self root))) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('instant-death) + (go-virtual deactivated) + ) + (('trans) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) + (update-transforms (-> self root)) + ) + ) ) :trans (behavior () (when (and *target* @@ -2748,7 +2722,6 @@ This commonly includes things such as: (talker-spawn-func (-> *talker-speech* 322) *entity-pool* (target-pos 0) (the-as region #f)) ) ) - (none) ) :code (the-as (function none :behavior launcher) sleep-code) ) @@ -2756,21 +2729,20 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate active (launcher) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (when (or (= event-type 'touch) (= event-type 'attack)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (or (= message 'touch) (= message 'attack)) (set! (-> self state-time) (current-time)) (send-event proc 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) - (the-as object (cond - ((= event-type 'instant-death) - (go-virtual deactivated) - ) - ((= event-type 'trans) - (move-to-point! (-> self root) (the-as vector (-> event param 0))) - (the-as object (update-transforms (-> self root))) - ) - ) - ) + (cond + ((= message 'instant-death) + (go-virtual deactivated) + ) + ((= message 'trans) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) + (update-transforms (-> self root)) + ) + ) ) :exit (behavior () (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) @@ -2782,7 +2754,6 @@ This commonly includes things such as: (set! (-> v1-0 params mask) (the-as uint 17)) (-> v1-0 id) ) - (none) ) :trans (behavior () (if (or (or (not *target*) @@ -2806,12 +2777,10 @@ This commonly includes things such as: ) (send-event *target* 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) - (none) ) :code (behavior () (sound-play "launch-start") (sleep-code) - (none) ) ) @@ -2962,9 +2931,9 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate active (touch-tracker) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('touched) (let ((v1-1 (ppointer->process (-> self parent)))) (when (!= v1-1 proc) @@ -2984,14 +2953,14 @@ This commonly includes things such as: (else (let ((t0-5 (new 'stack-no-clear 'event-message-block))) (set! (-> t0-5 from) (process->ppointer proc)) - (set! (-> t0-5 num-params) arg1) - (set! (-> t0-5 message) event-type) - (set! (-> t0-5 param 0) (-> event param 0)) - (set! (-> t0-5 param 1) (-> event param 1)) - (set! (-> t0-5 param 2) (-> event param 2)) - (set! (-> t0-5 param 3) (-> event param 3)) - (set! (-> t0-5 param 4) (-> event param 4)) - (set! (-> t0-5 param 5) (-> event param 5)) + (set! (-> t0-5 num-params) argc) + (set! (-> t0-5 message) message) + (set! (-> t0-5 param 0) (-> block param 0)) + (set! (-> t0-5 param 1) (-> block param 1)) + (set! (-> t0-5 param 2) (-> block param 2)) + (set! (-> t0-5 param 3) (-> block param 3)) + (set! (-> t0-5 param 4) (-> block param 4)) + (set! (-> t0-5 param 5) (-> block param 5)) (send-event-function v1-1 t0-5) ) ) @@ -3000,26 +2969,26 @@ This commonly includes things such as: ) ) (('target) - (set! v0-0 (process->handle (the-as process (-> event param 0)))) + (set! v0-0 (process->handle (the-as process (-> block param 0)))) (set! (-> self target) (the-as handle v0-0)) v0-0 ) (('event) - (set! (-> self event) (the-as symbol (-> event param 0))) - (set! v0-0 (-> event param 1)) + (set! (-> self event) (the-as symbol (-> block param 0))) + (set! v0-0 (-> block param 1)) (set! (-> self event-mode) (the-as basic v0-0)) v0-0 ) (('exit) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self run-function) (the-as (function object) v0-0)) v0-0 ) (('eval) - ((the-as (function touch-tracker object) (-> event param 0)) self) + ((the-as (function touch-tracker object) (-> block param 0)) self) ) (('function) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self callback) (the-as (function touch-tracker none) v0-0)) v0-0 ) @@ -3066,7 +3035,6 @@ This commonly includes things such as: 0 (suspend) 0 - (none) ) ) @@ -3209,8 +3177,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate explode (explosion) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (let* ((s4-0 proc) (v1-1 (if (type? s4-0 process-drawable) @@ -3238,7 +3206,7 @@ This commonly includes things such as: (set! (-> v1-5 action-mask) (collide-action solid)) ) (if (< (fill-and-probe-using-line-sphere *collide-cache* a1-2) 0.0) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) ) ) ) @@ -3270,7 +3238,6 @@ This commonly includes things such as: (while (< (- (current-time) (-> self start-time)) (the-as time-frame (-> self linger-duration))) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc index e655766d33d..e3d726a97f4 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc @@ -113,7 +113,6 @@ otherwise, [[plat::34]] :event (the-as (function process int symbol event-message-block object :behavior plat) plat-event) :trans (behavior () (execute-effects self) - (none) ) :code (behavior () (plat-trans) @@ -134,7 +133,6 @@ otherwise, [[plat::34]] ) ) #f - (none) ) ) @@ -144,7 +142,6 @@ otherwise, [[plat::34]] :event (the-as (function process int symbol event-message-block object :behavior plat) plat-event) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (set! (-> self path-pos) (get-norm! (-> self sync) 0)) @@ -153,7 +150,6 @@ otherwise, [[plat::34]] (sound-play "eco-plat-hover" :id (-> self sound-id) :position (-> self root trans)) ) (plat-trans) - (none) ) :code (behavior () (until #f @@ -167,7 +163,6 @@ otherwise, [[plat::34]] ) ) #f - (none) ) :post (the-as (function none :behavior plat) plat-post) ) @@ -288,8 +283,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (drop-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack 'bonk) (let* ((proc-temp proc) (proc-focus (if (type? proc-temp process-focusable) @@ -335,7 +330,6 @@ This commonly includes things such as: (go-virtual fall #f) ) #f - (none) ) :post (the-as (function none :behavior drop-plat) plat-post) ) @@ -343,8 +337,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate fall (drop-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('edge-grabbed) (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (send-event proc 'end-mode) @@ -357,11 +351,9 @@ This commonly includes things such as: ) :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (ja-abort-spooled-anim (-> self anim) (the-as art-joint-anim #f) -1) - (none) ) :trans (the-as (function none :behavior drop-plat) rider-trans) :code (behavior ((arg0 symbol)) @@ -384,7 +376,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior drop-plat) rider-post) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/projectile_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/projectile_REF.gc index 41fa28c678c..42902dce705 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/projectile_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/projectile_REF.gc @@ -307,7 +307,6 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p :event projectile-event-handler :exit (behavior () (stop-sound! self) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self spawn-time)) (-> self timeout)) @@ -358,7 +357,6 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (go-sitting! self) ) ) - (none) ) :code (behavior () (until #f @@ -367,7 +365,6 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (suspend) ) #f - (none) ) ) @@ -378,12 +375,10 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p :enter (behavior () (spawn-shell-particles self) (play-impact-sound self (projectile-options lose-altitude)) - (none) ) :code (behavior () (suspend) (go-virtual die) - (none) ) ) @@ -394,12 +389,10 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p :enter (behavior () (unknown-particles self) (play-impact-sound self (projectile-options proj-options-2)) - (none) ) :code (behavior () (suspend) (go-virtual die) - (none) ) ) @@ -411,7 +404,6 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (send-event (handle->process v1-0) 'notify 'die) ) (cleanup-for-death self) - (none) ) ) @@ -591,7 +583,6 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (if (>= (- (current-time) (-> self spawn-time)) (-> self timeout)) (go-virtual impact) ) - (none) ) :code (the-as (function none :behavior projectile-bounce) sleep-code) :post (the-as (function none :behavior projectile-bounce) projectile-bounce-falling-post) @@ -610,7 +601,6 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p :virtual #t :enter (behavior () (go-virtual impact) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc index b4e5352032f..4d489fc9db5 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc @@ -251,13 +251,13 @@ ;; failed to figure out what this is: (defstate enter (remote) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go-virtual exit) ) (('speak-effect) - (let ((v0-0 (the-as object (-> event param 0)))) + (let ((v0-0 (the-as object (-> block param 0)))) (set! (-> self speak-effect?) (the-as basic v0-0)) v0-0 ) @@ -276,7 +276,6 @@ (try-update-focus (-> self focus) (the-as process-focusable a1-1)) ) ) - (none) ) :trans (behavior () (remote-track) @@ -285,7 +284,6 @@ (point-toward-point-clear-roll-pitch! (-> self root) (get-trans (the-as process-focusable a0-1) 0)) ) ) - (none) ) :code (behavior () (let* ((gp-0 (ppointer->process (-> self parent 0 parent))) @@ -318,11 +316,9 @@ ) (set! (-> self blend) 0.0) (go-virtual idle) - (none) ) :post (behavior () (post-common self) - (none) ) ) @@ -337,7 +333,6 @@ (ja :num! (loop!)) ) (go-virtual exit) - (none) ) :post (-> (method-of-type remote enter) post) ) @@ -351,7 +346,6 @@ (send-event (ppointer->process (-> self parent)) 'change-state empty-state) (suspend) 0 - (none) ) :post (-> (method-of-type remote enter) post) ) @@ -383,7 +377,6 @@ ) (deactivate self) ) - (none) ) :code (-> cam-string code) ) @@ -433,7 +426,6 @@ (send-event (ppointer->process (-> self parent)) 'change-state empty-state) (suspend) (cleanup-for-death self) - (none) ) ) @@ -533,8 +525,8 @@ ;; failed to figure out what this is: (defstate wait (judge) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (sound-play "judge-stop") (go-virtual exit) @@ -563,7 +555,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -575,15 +566,14 @@ (send-event *target* 'get-pickup (pickup-type trick-judge) (the float (-> self total-time))) (sound-play "judge-start") (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to self))) - (none) ) ) ;; failed to figure out what this is: (defstate idle (judge) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (sound-play "judge-stop") (go-virtual exit) @@ -599,7 +589,6 @@ ) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (go-virtual exit) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc index cd225d80515..b2081447c2c 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc @@ -383,95 +383,94 @@ ;; WARN: Return type mismatch none vs object. (defbehavior water-anim-event-handler water-anim ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-1 object)) - (the-as object (case arg2 - (('move-to) - (move-to-point! self (the-as vector (-> arg3 param 0))) - (set! v0-1 (logclear (-> self mask) (process-mask sleep-code))) - (set! (-> self mask) (the-as process-mask v0-1)) - v0-1 - ) - (('move-to-y) - (let ((a1-2 (new 'stack-no-clear 'vector))) - (set! (-> a1-2 quad) (-> self root trans quad)) - (set! (-> a1-2 y) (the-as float (-> arg3 param 0))) - (move-to-point! self a1-2) - ) - (set! v0-1 (logclear (-> self mask) (process-mask sleep-code))) - (set! (-> self mask) (the-as process-mask v0-1)) - v0-1 - ) - (('water) - (let* ((s5-0 (the-as object (-> arg3 param 0))) - (s4-0 (the-as object (-> arg3 param 1))) - (gp-0 (if (type? (the-as process s4-0) process-focusable) - (the-as uint s4-0) - ) - ) - ) - (when (and (logtest? (-> self flags) (water-flags deadly)) - (logtest? (water-flags touch-water) (-> (the-as water-info s5-0) flags)) - (the-as uint gp-0) - ) - (let ((v1-15 (-> self attack-event))) - (case v1-15 - ((#f) - ) - (('heat) - (send-event (the-as process-tree gp-0) 'heat (* 10.0 (seconds-per-frame))) - ) - (('drown-death 'lava 'dark-eco-pool) - (if (and (not (focus-test? (the-as process-focusable gp-0) board)) - (send-event - (the-as process-focusable gp-0) - 'attack-invinc - #f - (static-attack-info ((id (-> self attack-id)) (mode v1-15))) - ) - ) - (send-event self 'notify 'attack) - ) - ) - (else - (if (and (not (focus-test? (the-as process-focusable gp-0) board)) - (send-event - (the-as process-tree gp-0) - 'attack - #f - (static-attack-info ((id (-> self attack-id)) (mode v1-15))) - ) - ) - (send-event self 'notify 'attack) - ) - ) - ) - ) - ) - (when (and (logtest? (-> self flags) (water-flags flow)) - (logtest? (water-flags touch-water) (-> (the-as water-info s5-0) flags)) - ) - (let ((a0-40 (-> self flow))) - (if (nonzero? a0-40) - (the-as object (push-process a0-40 (the-as process-focusable gp-0))) - ) - ) - ) + (case arg2 + (('move-to) + (move-to-point! self (the-as vector (-> arg3 param 0))) + (set! v0-1 (logclear (-> self mask) (process-mask sleep-code))) + (set! (-> self mask) (the-as process-mask v0-1)) + v0-1 + ) + (('move-to-y) + (let ((a1-2 (new 'stack-no-clear 'vector))) + (set! (-> a1-2 quad) (-> self root trans quad)) + (set! (-> a1-2 y) (the-as float (-> arg3 param 0))) + (move-to-point! self a1-2) + ) + (set! v0-1 (logclear (-> self mask) (process-mask sleep-code))) + (set! (-> self mask) (the-as process-mask v0-1)) + v0-1 + ) + (('water) + (let* ((s5-0 (the-as object (-> arg3 param 0))) + (s4-0 (the-as object (-> arg3 param 1))) + (gp-0 (if (type? (the-as process s4-0) process-focusable) + (the-as uint s4-0) ) - ) - (('visible) - (cond - ((-> arg3 param 0) - (set! (-> self visible) #t) + ) + ) + (when (and (logtest? (-> self flags) (water-flags deadly)) + (logtest? (water-flags touch-water) (-> (the-as water-info s5-0) flags)) + (the-as uint gp-0) + ) + (let ((v1-15 (-> self attack-event))) + (case v1-15 + ((#f) + ) + (('heat) + (send-event (the-as process-tree gp-0) 'heat (* 10.0 (seconds-per-frame))) + ) + (('drown-death 'lava 'dark-eco-pool) + (if (and (not (focus-test? (the-as process-focusable gp-0) board)) + (send-event + (the-as process-focusable gp-0) + 'attack-invinc + #f + (static-attack-info ((id (-> self attack-id)) (mode v1-15))) + ) ) - (else - (set! (-> self visible) #f) - (logior! (-> self draw status) (draw-control-status no-draw)) + (send-event self 'notify 'attack) + ) + ) + (else + (if (and (not (focus-test? (the-as process-focusable gp-0) board)) + (send-event + (the-as process-tree gp-0) + 'attack + #f + (static-attack-info ((id (-> self attack-id)) (mode v1-15))) + ) ) - ) - (logclear! (-> self mask) (process-mask sleep-code)) - #t - ) + (send-event self 'notify 'attack) ) - ) + ) + ) + ) + ) + (when (and (logtest? (-> self flags) (water-flags flow)) + (logtest? (water-flags touch-water) (-> (the-as water-info s5-0) flags)) + ) + (let ((a0-40 (-> self flow))) + (if (nonzero? a0-40) + (push-process a0-40 (the-as process-focusable gp-0)) + ) + ) + ) + ) + ) + (('visible) + (cond + ((-> arg3 param 0) + (set! (-> self visible) #t) + ) + (else + (set! (-> self visible) #f) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + ) + (logclear! (-> self mask) (process-mask sleep-code)) + #t + ) + ) ) ;; failed to figure out what this is: @@ -497,7 +496,6 @@ (if (and (-> self visible) (and (-> self play-ambient-sound?) (nonzero? (-> self sound)))) (update! (-> self sound)) ) - (none) ) :code (behavior () (until #f @@ -506,7 +504,6 @@ (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc index 7307d655057..49d52ca3b07 100644 --- a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc @@ -2591,10 +2591,7 @@ (debug-menu-append-item gp-0 a1-7) ) ) - (let ((a1-9 - (new 'debug 'debug-menu-item-function "Refresh" #f (the-as (function object object) build-instance-list)) - ) - ) + (let ((a1-9 (new 'debug 'debug-menu-item-function "Refresh" #f build-instance-list))) (debug-menu-append-item gp-0 a1-9) ) (let ((a1-11 diff --git a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc index 4f338567402..f59fae1b42b 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc @@ -1604,275 +1604,269 @@ ;; failed to figure out what this is: (defstate idle (editable-player) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (the-as - object - (case event-type - (('execute) - (let ((a2-1 (-> event param 0))) - (case a2-1 - ((28 27 35 29 31 32) - (the-as object (editable-array-method-13 - (-> self current) - (editable-command pick-loc) - (the-as editable-command a2-1) - "click on the point to insert at (up target, down camera)" - ) - ) + (case message + (('execute) + (let ((a2-1 (-> block param 0))) + (case a2-1 + ((28 27 35 29 31 32) + (editable-array-method-13 + (-> self current) + (editable-command pick-loc) + (the-as editable-command a2-1) + "click on the point to insert at (up target, down camera)" ) - ((51 1 47 36 55 56) - (if (not (-> self left-handed)) - (the-as object (editable-array-method-13 - (-> self current) - (editable-command pick-yes-no) - (the-as editable-command a2-1) - "press x to confirm, square to cancel" - ) - ) - (the-as object (editable-array-method-13 - (-> self current) - (editable-command pick-yes-no) - (the-as editable-command a2-1) - "press down to confirm, left to cancel" - ) - ) + ) + ((51 1 47 36 55 56) + (if (not (-> self left-handed)) + (editable-array-method-13 + (-> self current) + (editable-command pick-yes-no) + (the-as editable-command a2-1) + "press x to confirm, square to cancel" ) - ) - (else - (editable-array-method-9 (-> self current) (the-as editable-command a2-1) *mouse*) - ) + (editable-array-method-13 + (-> self current) + (editable-command pick-yes-no) + (the-as editable-command a2-1) + "press down to confirm, left to cancel" + ) + ) + ) + (else + (editable-array-method-9 (-> self current) (the-as editable-command a2-1) *mouse*) ) ) ) - (('exit) - (the-as object (deactivate self)) - ) - (('menu) - (set! v0-0 (+ (current-time) (the-as time-frame (-> event param 0)))) - (set! (-> self close-menu-time) (the-as time-frame v0-0)) - v0-0 - ) - (('on-enter 'on-exit 'on-inside) - (let ((s4-0 (-> self current region))) - (when s4-0 - (let ((gp-1 (-> event param 0))) - (set! (-> *syntax-context* got-error?) #f) - (eval! *syntax-context* (the-as pair gp-1)) - (when (not (-> *syntax-context* got-error?)) - (set! (-> s4-0 changed) #t) - (cond - ((= event-type 'on-enter) - (set! (-> s4-0 on-enter) (the-as string gp-1)) - ) - ((= event-type 'on-inside) - (set! (-> s4-0 on-inside) (the-as string gp-1)) - ) - ((= event-type 'on-exit) - (set! (-> s4-0 on-exit) (the-as string gp-1)) - ) - ) + ) + (('exit) + (deactivate self) + ) + (('menu) + (set! v0-0 (+ (current-time) (the-as time-frame (-> block param 0)))) + (set! (-> self close-menu-time) (the-as time-frame v0-0)) + v0-0 + ) + (('on-enter 'on-exit 'on-inside) + (let ((s4-0 (-> self current region))) + (when s4-0 + (let ((gp-1 (-> block param 0))) + (set! (-> *syntax-context* got-error?) #f) + (eval! *syntax-context* (the-as pair gp-1)) + (when (not (-> *syntax-context* got-error?)) + (set! (-> s4-0 changed) #t) + (cond + ((= message 'on-enter) + (set! (-> s4-0 on-enter) (the-as string gp-1)) + ) + ((= message 'on-inside) + (set! (-> s4-0 on-inside) (the-as string gp-1)) + ) + ((= message 'on-exit) + (set! (-> s4-0 on-exit) (the-as string gp-1)) + ) ) ) - (set! v0-0 (editable-region-method-12 s4-0)) - (set! (-> s4-0 filter) (the-as editable-filter v0-0)) - v0-0 ) + (set! v0-0 (editable-region-method-12 s4-0)) + (set! (-> s4-0 filter) (the-as editable-filter v0-0)) + v0-0 ) ) - (('select) - (let ((gp-2 (-> event param 0))) - (editable-array-method-9 (-> self current) (editable-command select-none) (the-as mouse-info #f)) - (let* ((s5-1 (-> self current length)) - (s4-1 0) - (a0-36 (-> self current data s4-1)) - ) - (while (< s4-1 s5-1) - (when (and a0-36 (or (and (logtest? (-> a0-36 region filter) (-> self current filter 0)) - (logtest? (-> a0-36 region filter) (-> self current filter 1)) - ) - (logtest? (-> a0-36 flags) (editable-flag selected)) - ) - ) - (when (and (-> a0-36 region) (= gp-2 (-> a0-36 region id))) - (set! (-> self current region) (-> a0-36 region)) - (select-editable! a0-36 #t) - ) + ) + (('select) + (let ((gp-2 (-> block param 0))) + (editable-array-method-9 (-> self current) (editable-command select-none) (the-as mouse-info #f)) + (let* ((s5-1 (-> self current length)) + (s4-1 0) + (a0-36 (-> self current data s4-1)) + ) + (while (< s4-1 s5-1) + (when (and a0-36 (or (and (logtest? (-> a0-36 region filter) (-> self current filter 0)) + (logtest? (-> a0-36 region filter) (-> self current filter 1)) + ) + (logtest? (-> a0-36 flags) (editable-flag selected)) + ) + ) + (when (and (-> a0-36 region) (= gp-2 (-> a0-36 region id))) + (set! (-> self current region) (-> a0-36 region)) + (select-editable! a0-36 #t) ) - (+! s4-1 1) - (set! a0-36 (-> self current data s4-1)) ) + (+! s4-1 1) + (set! a0-36 (-> self current data s4-1)) ) ) - #f ) - (('name) - (let* ((s5-2 (-> self current length)) - (s4-2 0) - (s3-0 (-> self current data s4-2)) - ) - (while (< s4-2 s5-2) - (when (and s3-0 (logtest? (-> s3-0 flags) (editable-flag selected))) - (let ((v1-60 (if (type? s3-0 editable) - s3-0 - ) - ) - ) - (when v1-60 - (set! (-> v1-60 name) (the-as string (-> event param 0))) - (logior! (-> v1-60 flags) (editable-flag changed)) - (let ((v1-61 (-> v1-60 region))) - (if v1-61 - (set! (-> v1-61 changed) #t) - ) - ) + #f + ) + (('name) + (let* ((s5-2 (-> self current length)) + (s4-2 0) + (s3-0 (-> self current data s4-2)) + ) + (while (< s4-2 s5-2) + (when (and s3-0 (logtest? (-> s3-0 flags) (editable-flag selected))) + (let ((v1-60 (if (type? s3-0 editable) + s3-0 + ) + ) + ) + (when v1-60 + (set! (-> v1-60 name) (the-as string (-> block param 0))) + (logior! (-> v1-60 flags) (editable-flag changed)) + (let ((v1-61 (-> v1-60 region))) + (if v1-61 + (set! (-> v1-61 changed) #t) + ) ) ) ) - (+! s4-2 1) - (set! s3-0 (-> self current data s4-2)) ) + (+! s4-2 1) + (set! s3-0 (-> self current data s4-2)) ) - #f ) - (('level) - (let ((gp-3 (lookup-level-info (the-as symbol (-> event param 0))))) - (when (-> gp-3 dbname) - (let* ((s5-3 (-> self current length)) - (s4-3 0) - (s3-1 (-> self current data s4-3)) - ) - (while (< s4-3 s5-3) - (when (and s3-1 (logtest? (-> s3-1 flags) (editable-flag selected))) - (let ((v1-73 (if (type? s3-1 editable) - s3-1 - ) - ) - ) - (when (and v1-73 (-> v1-73 region)) - (set! (-> v1-73 region level) (the-as string (-> gp-3 dbname))) - (set! (-> v1-73 region changed) #t) + #f + ) + (('level) + (let ((gp-3 (lookup-level-info (the-as symbol (-> block param 0))))) + (when (-> gp-3 dbname) + (let* ((s5-3 (-> self current length)) + (s4-3 0) + (s3-1 (-> self current data s4-3)) + ) + (while (< s4-3 s5-3) + (when (and s3-1 (logtest? (-> s3-1 flags) (editable-flag selected))) + (let ((v1-73 (if (type? s3-1 editable) + s3-1 + ) + ) ) + (when (and v1-73 (-> v1-73 region)) + (set! (-> v1-73 region level) (the-as string (-> gp-3 dbname))) + (set! (-> v1-73 region changed) #t) ) ) - (+! s4-3 1) - (set! s3-1 (-> self current data s4-3)) ) + (+! s4-3 1) + (set! s3-1 (-> self current data s4-3)) ) - #f ) + #f ) ) - (('get-level) - (-> self current level) - ) - (('direction) - (let* ((f30-0 (the-as float (-> event param 0))) - (f28-0 (the-as float (-> event param 1))) - (f26-0 (the-as float (-> event param 2))) - (f24-0 (if (and (zero? (-> event param 0)) (zero? (-> event param 1)) (zero? (-> event param 2))) - 0.0 - 1.0 - ) - ) - (gp-4 (-> self current length)) - (s5-4 0) - (s4-4 (-> self current data s5-4)) - ) - (while (< s5-4 gp-4) - (when (and s4-4 (logtest? (-> s4-4 flags) (editable-flag selected))) - (let ((s3-2 (if (type? s4-4 editable-light) - (the-as editable-light s4-4) - ) - ) - ) - (when s3-2 - (set-vector! (-> s3-2 direction) f30-0 f28-0 f26-0 f24-0) - (vector-normalize! (-> s3-2 direction) 1.0) - (logior! (-> s3-2 flags) (editable-flag changed)) - (let ((a0-73 (-> s3-2 region))) - (if a0-73 - (set! (-> a0-73 changed) #t) + ) + (('get-level) + (-> self current level) + ) + (('direction) + (let* ((f30-0 (the-as float (-> block param 0))) + (f28-0 (the-as float (-> block param 1))) + (f26-0 (the-as float (-> block param 2))) + (f24-0 (if (and (zero? (-> block param 0)) (zero? (-> block param 1)) (zero? (-> block param 2))) + 0.0 + 1.0 ) ) + (gp-4 (-> self current length)) + (s5-4 0) + (s4-4 (-> self current data s5-4)) + ) + (while (< s5-4 gp-4) + (when (and s4-4 (logtest? (-> s4-4 flags) (editable-flag selected))) + (let ((s3-2 (if (type? s4-4 editable-light) + (the-as editable-light s4-4) + ) + ) + ) + (when s3-2 + (set-vector! (-> s3-2 direction) f30-0 f28-0 f26-0 f24-0) + (vector-normalize! (-> s3-2 direction) 1.0) + (logior! (-> s3-2 flags) (editable-flag changed)) + (let ((a0-73 (-> s3-2 region))) + (if a0-73 + (set! (-> a0-73 changed) #t) + ) ) ) ) - (+! s5-4 1) - (set! s4-4 (-> self current data s5-4)) ) + (+! s5-4 1) + (set! s4-4 (-> self current data s5-4)) ) - #f ) - (('color) - (let* ((f30-1 (the-as float (-> event param 0))) - (f28-1 (the-as float (-> event param 1))) - (f26-1 (the-as float (-> event param 2))) - (f24-1 (the-as float (-> event param 3))) - (gp-5 (-> self current length)) - (s5-5 0) - (s4-5 (-> self current data s5-5)) - ) - (while (< s5-5 gp-5) - (when (and s4-5 (logtest? (-> s4-5 flags) (editable-flag selected))) - (let ((v1-114 (if (type? s4-5 editable-light) - (the-as editable-light s4-5) - ) - ) - ) - (when v1-114 - (set-vector! (-> v1-114 color) f30-1 f28-1 f26-1 f24-1) - (logior! (-> v1-114 flags) (editable-flag changed)) - (let ((v1-115 (-> v1-114 region))) - (if v1-115 - (set! (-> v1-115 changed) #t) - ) - ) + #f + ) + (('color) + (let* ((f30-1 (the-as float (-> block param 0))) + (f28-1 (the-as float (-> block param 1))) + (f26-1 (the-as float (-> block param 2))) + (f24-1 (the-as float (-> block param 3))) + (gp-5 (-> self current length)) + (s5-5 0) + (s4-5 (-> self current data s5-5)) + ) + (while (< s5-5 gp-5) + (when (and s4-5 (logtest? (-> s4-5 flags) (editable-flag selected))) + (let ((v1-114 (if (type? s4-5 editable-light) + (the-as editable-light s4-5) + ) + ) + ) + (when v1-114 + (set-vector! (-> v1-114 color) f30-1 f28-1 f26-1 f24-1) + (logior! (-> v1-114 flags) (editable-flag changed)) + (let ((v1-115 (-> v1-114 region))) + (if v1-115 + (set! (-> v1-115 changed) #t) + ) ) ) ) - (+! s5-5 1) - (set! s4-5 (-> self current data s5-5)) ) + (+! s5-5 1) + (set! s4-5 (-> self current data s5-5)) ) - #f ) - (('param) - (let ((s5-6 (-> event param 0)) - (f30-2 (the-as float (-> event param 1))) - ) - (when (and (>= (the-as int s5-6) 0) (>= 2 (the-as int s5-6))) - (let* ((gp-6 (-> self current length)) - (s4-6 0) - (s3-3 (-> self current data s4-6)) - ) - (while (< s4-6 gp-6) - (when (and s3-3 (logtest? (-> s3-3 flags) (editable-flag selected))) - (let ((v1-129 (if (type? s3-3 editable-light) - s3-3 - ) - ) - ) - (when v1-129 - (set! (-> (the-as editable-light (+ (* s5-6 4) (the-as uint v1-129))) decay-start) f30-2) - (logior! (-> v1-129 flags) (editable-flag changed)) - (let ((v1-130 (-> v1-129 region))) - (if v1-130 - (set! (-> v1-130 changed) #t) - ) - ) + #f + ) + (('param) + (let ((s5-6 (-> block param 0)) + (f30-2 (the-as float (-> block param 1))) + ) + (when (and (>= (the-as int s5-6) 0) (>= 2 (the-as int s5-6))) + (let* ((gp-6 (-> self current length)) + (s4-6 0) + (s3-3 (-> self current data s4-6)) + ) + (while (< s4-6 gp-6) + (when (and s3-3 (logtest? (-> s3-3 flags) (editable-flag selected))) + (let ((v1-129 (if (type? s3-3 editable-light) + s3-3 + ) + ) + ) + (when v1-129 + (set! (-> (the-as editable-light (+ (* s5-6 4) (the-as uint v1-129))) decay-start) f30-2) + (logior! (-> v1-129 flags) (editable-flag changed)) + (let ((v1-130 (-> v1-129 region))) + (if v1-130 + (set! (-> v1-130 changed) #t) + ) ) ) ) - (+! s4-6 1) - (set! s3-3 (-> self current data s4-6)) ) + (+! s4-6 1) + (set! s3-3 (-> self current data s4-6)) ) - #f ) + #f ) ) - ) + ) ) ) :trans (behavior () @@ -2077,18 +2071,15 @@ ) ) ) - (none) ) :code (behavior () (until #f (suspend) ) #f - (none) ) :post (behavior () (editable-player-method-21 self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc b/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc index 7716a923519..5257570068c 100644 --- a/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc @@ -1173,6 +1173,7 @@ ) ;; definition for method 32 of type nav-graph-editor +;; WARN: Return type mismatch object vs none. (defmethod nav-graph-editor-method-32 nav-graph-editor ((obj nav-graph-editor) (arg0 symbol) (arg1 int)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1535,6 +1536,7 @@ ;; definition for method 35 of type nav-graph-editor ;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. (defmethod nav-graph-editor-method-35 nav-graph-editor ((obj nav-graph-editor)) (nav-graph-editor-method-34 obj) (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) @@ -1575,14 +1577,12 @@ ) ) ) - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () (nav-graph-editor-method-29 self "Move node" "" "") (nav-graph-editor-method-28 self) (nav-graph-editor-method-35 self) - (none) ) ) @@ -1599,7 +1599,6 @@ (set! (-> self plane-height) (-> self nav-graph node-array data (-> self selected-index) position y)) ) (nav-graph-editor-method-41 self) - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1609,7 +1608,6 @@ (nav-graph-editor-method-46 self) (nav-graph-editor-method-42 self) (nav-graph-editor-method-32 self (-> self selected-node-edge?) (-> self selected-index)) - (none) ) ) @@ -1619,13 +1617,11 @@ :enter (behavior () (set-vector! (-> self mouse-spos-hold) (-> *mouse* posx) (-> *mouse* posy) 0.0 1.0) (set! (-> self plane-height-hold) (-> self plane-height)) - (none) ) :trans (behavior () (if (not (mouse-hold? left)) (go-virtual adjust-plane) ) - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1641,7 +1637,6 @@ (nav-graph-editor-method-28 self) (nav-graph-editor-method-34 self) (nav-graph-editor-method-46 self) - (none) ) ) @@ -1723,14 +1718,12 @@ ) ) ) - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () (nav-graph-editor-method-29 self "Dest node/pos" "" "Cancel") (nav-graph-editor-method-28 self) (nav-graph-editor-method-38 self) - (none) ) ) @@ -1764,14 +1757,12 @@ :enter (behavior () (set! (-> self edge-src) -1) (set! (-> self edge-dst) -1) - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () (nav-graph-editor-method-29 self "Create edge" "" "Delete edge") (nav-graph-editor-method-28 self) (nav-graph-editor-method-37 self) - (none) ) ) @@ -1780,11 +1771,9 @@ :virtual #t :enter (behavior () (set! (-> self edge-visibility) (-> self selected-index)) - (none) ) :exit (behavior () (set! (-> self edge-visibility) -1) - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1812,7 +1801,6 @@ (go-virtual adjust-minimap) ) ) - (none) ) ) @@ -1821,7 +1809,6 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1839,7 +1826,6 @@ ) ) ) - (none) ) ) @@ -1848,7 +1834,6 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1869,7 +1854,6 @@ (nav-graph-editor-method-31 self (-> self selected-index)) ) ) - (none) ) ) @@ -1878,7 +1862,6 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1899,7 +1882,6 @@ (nav-graph-editor-method-33 self (-> self selected-index)) ) ) - (none) ) ) @@ -1908,7 +1890,6 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1933,7 +1914,6 @@ ) ) ) - (none) ) ) @@ -1979,7 +1959,6 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -1996,7 +1975,6 @@ ) (nav-graph-editor-method-28 self) (nav-graph-editor-method-39 self) - (none) ) ) @@ -2034,14 +2012,12 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () (nav-graph-editor-method-29 self "Edge visibility" "" "Closest Node/Edge") (nav-graph-editor-method-28 self) (nav-graph-editor-method-40 self) - (none) ) ) @@ -2050,7 +2026,6 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () @@ -2101,11 +2076,11 @@ (nav-graph-editor-method-46 self) ) ) - (none) ) ) ;; definition for method 36 of type nav-graph-editor +;; WARN: Return type mismatch object vs none. (defmethod nav-graph-editor-method-36 nav-graph-editor ((obj nav-graph-editor)) (nav-graph-editor-method-41 obj) (nav-graph-editor-method-34 obj) @@ -2144,14 +2119,12 @@ :virtual #t :enter (behavior () '() - (none) ) :code (the-as (function none :behavior nav-graph-editor) sleep-code) :post (behavior () (nav-graph-editor-method-29 self "Move node" "Delete node/edge" "Create edge(s)") (nav-graph-editor-method-28 self) (nav-graph-editor-method-36 self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc b/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc index f32859f3627..db44f8da93c 100644 --- a/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc @@ -103,7 +103,6 @@ (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/debug/viewer_REF.gc b/test/decompiler/reference/jak2/engine/debug/viewer_REF.gc index e25b2c7ec4a..c15e9c3a3e3 100644 --- a/test/decompiler/reference/jak2/engine/debug/viewer_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/viewer_REF.gc @@ -57,7 +57,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior viewer) ja-post) ) @@ -220,6 +219,7 @@ ) ;; definition for method 11 of type viewer +;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! viewer ((obj viewer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: @@ -290,5 +290,5 @@ This commonly includes things such as: (defun birth-viewer ((arg0 process) (arg1 entity-actor)) (set! (-> arg0 type) viewer) (init-entity arg0 arg1 viewer) - (the-as object #t) + #t ) diff --git a/test/decompiler/reference/jak2/engine/entity/entity_REF.gc b/test/decompiler/reference/jak2/engine/entity/entity_REF.gc index 2524914b38c..045bbb1f1db 100644 --- a/test/decompiler/reference/jak2/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/entity_REF.gc @@ -71,6 +71,7 @@ ) ;; definition for method 3 of type actor-group +;; INFO: this function exists in multiple non-identical object files (defmethod inspect actor-group ((obj actor-group)) (format #t "[~8x] ~A~%" obj (-> obj type)) (format #t "~Tlength: ~D~%" (-> obj length)) @@ -530,6 +531,7 @@ ) ;; definition for method 2 of type process +;; INFO: this function exists in multiple non-identical object files (defmethod print process ((obj process)) (cond ((and (-> obj top-thread) (!= (-> obj status) 'dead)) @@ -1235,18 +1237,19 @@ (set! (-> gp-0 pid) (string->int *pid-string*)) ) ) - (let ((gp-1 (lambda ((arg0 process)) - (let ((v1-0 *debug-actor-info*)) - (if (= (-> arg0 pid) (-> v1-0 pid)) - (set! (-> v1-0 handle) (process->handle arg0)) + (let ((gp-1 (lambda ((arg0 process)) (let ((v1-0 *debug-actor-info*)) + (when (= (-> arg0 pid) (-> v1-0 pid)) + (let ((v0-0 (process->handle arg0))) + (set! (-> v1-0 handle) (the-as handle v0-0)) + v0-0 + ) + ) + ) ) - ) - (none) - ) ) ) - (iterate-process-tree *pusher-pool* (the-as (function object object) gp-1) *null-kernel-context*) - (iterate-process-tree *entity-pool* (the-as (function object object) gp-1) *null-kernel-context*) + (iterate-process-tree *pusher-pool* gp-1 *null-kernel-context*) + (iterate-process-tree *entity-pool* gp-1 *null-kernel-context*) ) ) (else @@ -1430,8 +1433,8 @@ (cond ((= sv-16 'process) (let ((s5-1 draw-actor-marks)) - (iterate-process-tree *pusher-pool* (the-as (function object object) s5-1) *null-kernel-context*) - (iterate-process-tree *entity-pool* (the-as (function object object) s5-1) *null-kernel-context*) + (iterate-process-tree *pusher-pool* s5-1 *null-kernel-context*) + (iterate-process-tree *entity-pool* s5-1 *null-kernel-context*) ) ) (else @@ -1647,17 +1650,14 @@ (if (or *display-path-marks* *display-vol-marks*) (iterate-process-tree *active-pool* - (the-as (function object object) (lambda ((arg0 process-drawable)) - (when (type? arg0 process-drawable) - (if (nonzero? (-> arg0 path)) - (debug-draw (-> arg0 path)) - ) - (if (nonzero? (-> arg0 vol)) - (debug-draw (-> arg0 vol)) - ) - ) - (none) - ) + (lambda ((arg0 process-drawable)) (when (type? arg0 process-drawable) + (if (nonzero? (-> arg0 path)) + (debug-draw (-> arg0 path)) + ) + (if (nonzero? (-> arg0 vol)) + (debug-draw (-> arg0 vol)) + ) + ) ) *null-kernel-context* ) @@ -2093,23 +2093,21 @@ ) (let ((v1-23 (-> obj level heap base)) (a0-7 (-> obj level heap top-base)) - (s5-2 (lambda ((arg0 process)) - (check-for-rougue-process - arg0 - (-> *kernel-context* relocating-min) - (-> *kernel-context* relocating-max) - (-> *kernel-context* relocating-level) - ) - (none) - ) + (s5-2 (lambda ((arg0 process)) (check-for-rougue-process + arg0 + (-> *kernel-context* relocating-min) + (-> *kernel-context* relocating-max) + (-> *kernel-context* relocating-level) + ) + ) ) ) (set! (-> *kernel-context* relocating-min) (the-as int v1-23)) (set! (-> *kernel-context* relocating-max) (the-as int a0-7)) (set! (-> *kernel-context* relocating-level) (-> obj level)) - (iterate-process-tree *pusher-pool* (the-as (function object object) s5-2) *null-kernel-context*) - (iterate-process-tree *entity-pool* (the-as (function object object) s5-2) *null-kernel-context*) - (iterate-process-tree *default-pool* (the-as (function object object) s5-2) *null-kernel-context*) + (iterate-process-tree *pusher-pool* s5-2 *null-kernel-context*) + (iterate-process-tree *entity-pool* s5-2 *null-kernel-context*) + (iterate-process-tree *default-pool* s5-2 *null-kernel-context*) ) (let ((s5-3 (-> obj nav-meshes))) (when (nonzero? s5-3) @@ -2230,16 +2228,14 @@ ) ) ) - (let ((s5-1 (lambda ((arg0 process)) - (if (not (logtest? (-> arg0 mask) (process-mask no-kill))) - (deactivate arg0) - ) - (none) - ) + (let ((s5-1 (lambda ((arg0 process)) (if (not (logtest? (-> arg0 mask) (process-mask no-kill))) + (deactivate arg0) + ) + ) ) ) - (iterate-process-tree *pusher-pool* (the-as (function object object) s5-1) *null-kernel-context*) - (iterate-process-tree *entity-pool* (the-as (function object object) s5-1) *null-kernel-context*) + (iterate-process-tree *pusher-pool* s5-1 *null-kernel-context*) + (iterate-process-tree *entity-pool* s5-1 *null-kernel-context*) ) (if #t (task-node-reset arg0) diff --git a/test/decompiler/reference/jak2/engine/game/game-info_REF.gc b/test/decompiler/reference/jak2/engine/game/game-info_REF.gc index d5a53f117bb..e5d80795ab1 100644 --- a/test/decompiler/reference/jak2/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-info_REF.gc @@ -299,12 +299,10 @@ ;; definition for method 9 of type game-info ;; INFO: Used lq/sq -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 512] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 526] ;; ERROR: Expression building failed: In (method 9 game-info): Expression pass could not find the set-to-run function. Found t9-31 instead. Make sure there are no casts on this function. (defmethod initialize! game-info ((obj game-info) (arg0 symbol) (arg1 game-save) (arg2 string)) (local-vars - (v0-17 none) + (v0-17 object) (v0-29 process-tree) (v0-30 continue-point) (v0-31 none) diff --git a/test/decompiler/reference/jak2/engine/game/game-save_REF.gc b/test/decompiler/reference/jak2/engine/game/game-save_REF.gc index 83eec675439..748d4644660 100644 --- a/test/decompiler/reference/jak2/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-save_REF.gc @@ -2043,7 +2043,6 @@ auto-save-post ) (format #t "got buffer #x~X~%" (-> self buffer base)) (go-virtual get-card) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) @@ -2099,7 +2098,6 @@ auto-save-post (go-virtual done) ) ) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) @@ -2145,7 +2143,6 @@ auto-save-post ) ) (go-virtual done) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) @@ -2179,7 +2176,6 @@ auto-save-post ) (label cfg-10) (go-virtual done) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) @@ -2238,7 +2234,6 @@ auto-save-post ) ) (go-virtual done) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) @@ -2304,7 +2299,6 @@ auto-save-post #f (label cfg-18) (go-virtual done) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) @@ -2312,8 +2306,8 @@ auto-save-post ;; failed to figure out what this is: (defstate restore (auto-save) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('progress-allowed?) #t ) @@ -2388,7 +2382,6 @@ auto-save-post (apply-settings *setting-control*) (sleep-code) (go-virtual done) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) @@ -2396,16 +2389,15 @@ auto-save-post ;; failed to figure out what this is: (defstate error (auto-save) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('progress-allowed?) - #t - ) - (('die) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('progress-allowed?) + #t + ) + (('die) + (deactivate self) + ) + ) ) :code (behavior ((arg0 mc-status-code)) (if (-> self buffer) @@ -2501,7 +2493,6 @@ auto-save-post ) ) ) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) @@ -2534,7 +2525,6 @@ auto-save-post (mem-copy! (the-as pointer gp-0) (the-as pointer (-> self info)) 300) (send-event (handle->process (-> self notify)) 'notify 'done (mc-status-code ok) gp-0) ) - (none) ) :post (the-as (function none :behavior auto-save) auto-save-post) ) diff --git a/test/decompiler/reference/jak2/engine/game/task/task-arrow_REF.gc b/test/decompiler/reference/jak2/engine/game/task/task-arrow_REF.gc index a3394be416b..fe8ae8e5e48 100644 --- a/test/decompiler/reference/jak2/engine/game/task/task-arrow_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/task-arrow_REF.gc @@ -221,11 +221,11 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" ;; failed to figure out what this is: (defstate idle (task-arrow) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-2 object)) - (case event-type + (case message (('set-position) - (let ((a0-3 (the-as object (-> event param 0)))) + (let ((a0-3 (the-as object (-> block param 0)))) (set! (-> self pos quad) (-> (the-as vector a0-3) quad)) ) (if (logtest? (-> self flags) (task-arrow-flags task-arrow-flag-03)) @@ -246,8 +246,8 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" ) ) (('modify-flags) - (let ((v1-16 (-> event param 0)) - (a1-3 (-> event param 1)) + (let ((v1-16 (-> block param 0)) + (a1-3 (-> block param 1)) ) (set! v0-2 (logior (logclear (-> self flags) a1-3) v1-16)) ) @@ -256,7 +256,7 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" ) (('map-icon) (kill-callback (-> *minimap* engine) (-> self minimap)) - (let ((a2-1 (-> event param 0))) + (let ((a2-1 (-> block param 0))) (set! (-> self map-icon) a2-1) (set! v0-2 (add-icon! *minimap* self a2-1 (the-as int #f) (the-as vector #t) 0)) ) @@ -271,7 +271,6 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" :code (the-as (function none :behavior task-arrow) sleep-code) :post (behavior () (draw-arrow self) - (none) ) ) @@ -284,11 +283,9 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" (suspend) ) (cleanup-for-death self) - (none) ) :post (behavior () (draw-arrow self) - (none) ) ) @@ -297,7 +294,6 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc b/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc index bf8f618d9ce..881ae613e11 100644 --- a/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc @@ -1509,8 +1509,8 @@ ;; failed to figure out what this is: (defstate idle (fail-mission) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('reset) (cond ((logtest? (-> self flags) (fail-mission-flags famflags-1)) @@ -1525,7 +1525,7 @@ ) ) (('query) - (case (-> event param 0) + (case (-> block param 0) (('reset) (logtest? (-> self flags) (fail-mission-flags famflags-1)) ) @@ -1538,7 +1538,6 @@ (update-rates! (-> *display* entity-clock) 1.0) (update-rates! (-> *display* target-clock) 1.0) (update-rates! (-> *display* camera-clock) 1.0) - (none) ) :code (behavior () (when (and *target* (focus-test? *target* dead)) @@ -1644,7 +1643,6 @@ #f ) ) - (none) ) ) @@ -1664,31 +1662,28 @@ ;; failed to figure out what this is: (defstate resetting (fail-mission) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('reset) - #t - ) - (('query) - (case (-> event param 0) - (('reset) - #t - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('reset) + #t + ) + (('query) + (case (-> block param 0) + (('reset) + #t + ) + ) + ) + ) ) :enter (behavior () '() - (none) ) :exit (behavior () (if (= *master-mode* 'freeze) (set-master-mode 'game) ) (process-release? *target*) - (none) ) :code (behavior () (local-vars (a1-10 string)) @@ -1754,7 +1749,6 @@ (persist-with-delay *setting-control* 'speech-control (seconds 3) 'speech-control #f 0.0 0) (persist-with-delay *setting-control* 'music-volume (seconds 3) 'music-volume 'abs 0.0 0) (persist-with-delay *setting-control* 'sfx-volume (seconds 3) 'music-volume 'abs 0.0 0) - (none) ) ) @@ -2114,7 +2108,6 @@ ) (deactivate self) ) - (none) ) :code (behavior () (while (or (not *target*) (not *spawn-actors*)) @@ -2141,7 +2134,6 @@ ) ) (go-virtual active) - (none) ) ) @@ -2156,7 +2148,6 @@ (t9-1) ) ) - (none) ) :code (behavior () (let ((t9-0 (-> self info code-hook))) @@ -2171,7 +2162,6 @@ (suspend) ) #f - (none) ) ) @@ -2218,7 +2208,6 @@ (while (-> self child) (suspend) ) - (none) ) ) @@ -2228,7 +2217,6 @@ :event task-manager-event-handler :exit (behavior () (disable *screen-filter*) - (none) ) :code (behavior () (while (not (-> self allow-fail)) @@ -2317,7 +2305,6 @@ ) ) ) - (none) ) ) @@ -2363,6 +2350,5 @@ ) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/bones_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/bones_REF.gc index cb7f1b35595..8a19a10b922 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/bones_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/bones_REF.gc @@ -188,13 +188,7 @@ (.lvf vf27 (&-> v1-29 quad 2)) ) (.mov v1-30 vf27) - (bones-mtx-calc - (-> s4-1 matrix-area) - (-> s4-1 joints) - (-> s4-1 bones) - (-> s4-1 num-bones) - (the-as object t0-0) - ) + (bones-mtx-calc (-> s4-1 matrix-area) (-> s4-1 joints) (-> s4-1 bones) (-> s4-1 num-bones) t0-0) (when (logtest? (-> s4-1 flags) (bone-calc-flags write-ripple-data)) (let* ((a2-1 s4-1) (v1-34 (-> a2-1 num-bones)) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc index 42b6de4eb60..1d65cfd17e6 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc @@ -143,84 +143,81 @@ ;; failed to figure out what this is: (defstate time-of-day-tick (time-of-day-proc) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('change) - (case (-> event param 0) - (('ratio) - (let ((a0-5 (-> *display* bg-clock)) - (f0-0 (the-as float (-> event param 1))) - ) - (set! (-> self time-ratio) f0-0) - (set! (-> self dest-time-ratio) f0-0) - (update-rates! a0-5 f0-0) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('change) + (case (-> block param 0) + (('ratio) + (let ((a0-5 (-> *display* bg-clock)) + (f0-0 (the-as float (-> block param 1))) + ) + (set! (-> self time-ratio) f0-0) + (set! (-> self dest-time-ratio) f0-0) + (update-rates! a0-5 f0-0) ) - (('hour) - (update-counters) - (let ((v1-7 (-> *display* bg-clock frame-counter)) - (a0-7 #x69780) - (a1-5 (/ (the int (* 1080000.0 (the float (-> event param 1)))) 60)) - ) - (set! (-> *display* bg-clock frame-counter) (+ (- v1-7 (the-as time-frame (mod v1-7 a0-7))) a0-7 a1-5)) - ) - (update-counters) - (-> self hours) - (kill-and-free-particles (-> self sun)) - (spawn (-> self sun) (math-camera-pos)) - (set! (-> self sun-count) 1) - (kill-and-free-particles (-> self green-sun)) - (spawn (-> self green-sun) (math-camera-pos)) - (set! (-> self green-sun-count) 1) - (kill-and-free-particles (-> self moon)) - (spawn (-> self moon) (math-camera-pos)) - (let ((v0-0 (the-as number 1))) - (set! (-> self moon-count) (the-as int v0-0)) - v0-0 - ) + ) + (('hour) + (update-counters) + (let ((v1-7 (-> *display* bg-clock frame-counter)) + (a0-7 #x69780) + (a1-5 (/ (the int (* 1080000.0 (the float (-> block param 1)))) 60)) + ) + (set! (-> *display* bg-clock frame-counter) (+ (- v1-7 (the-as time-frame (mod v1-7 a0-7))) a0-7 a1-5)) ) - ) - ) - (('ratio) - (-> self time-ratio) - ) - (('day-length) - (if (= (-> self time-ratio) 0.0) - 0 - (/ 25920000.0 (-> self time-ratio)) - ) - ) - (('time-frame) - (-> self frames) - ) - (('time-of-day) - (-> self time-of-day) - ) - (('time-of-day-norm) - (* 0.041666668 (-> self time-of-day)) - ) - (('hour) - (-> self hours) - ) - (('minute) - (-> self minutes) - ) - (('second) - (-> self seconds) + (update-counters) + (-> self hours) + (kill-and-free-particles (-> self sun)) + (spawn (-> self sun) (math-camera-pos)) + (set! (-> self sun-count) 1) + (kill-and-free-particles (-> self green-sun)) + (spawn (-> self green-sun) (math-camera-pos)) + (set! (-> self green-sun-count) 1) + (kill-and-free-particles (-> self moon)) + (spawn (-> self moon) (math-camera-pos)) + (let ((v0-0 (the-as number 1))) + (set! (-> self moon-count) (the-as int v0-0)) + v0-0 + ) + ) ) - (('dest-clock-ratio-set) - (set! (-> self dest-time-ratio) (the-as float (-> event param 0))) - (let ((f0-12 (-> self time-ratio)) - (f1-5 (-> self dest-time-ratio)) - (f2-1 (/ 300.0 (the float (-> event param 1)))) - ) - (set! (-> self dest-time-delta) (* (fabs (- f0-12 f1-5)) f2-1 (-> *display* real-clock seconds-per-frame))) + ) + (('ratio) + (-> self time-ratio) + ) + (('day-length) + (if (= (-> self time-ratio) 0.0) + 0 + (/ 25920000.0 (-> self time-ratio)) ) - (-> self dest-time-ratio) + ) + (('time-frame) + (-> self frames) + ) + (('time-of-day) + (-> self time-of-day) + ) + (('time-of-day-norm) + (* 0.041666668 (-> self time-of-day)) + ) + (('hour) + (-> self hours) + ) + (('minute) + (-> self minutes) + ) + (('second) + (-> self seconds) + ) + (('dest-clock-ratio-set) + (set! (-> self dest-time-ratio) (the-as float (-> block param 0))) + (let ((f0-12 (-> self time-ratio)) + (f1-5 (-> self dest-time-ratio)) + (f2-1 (/ 300.0 (the float (-> block param 1)))) + ) + (set! (-> self dest-time-delta) (* (fabs (- f0-12 f1-5)) f2-1 (-> *display* real-clock seconds-per-frame))) ) - ) + (-> self dest-time-ratio) + ) ) ) :code (behavior () @@ -236,7 +233,6 @@ (suspend) ) #f - (none) ) :post time-of-day-update ) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc index 0a923ba1974..4bf64692c16 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc @@ -23,35 +23,27 @@ ) ;; definition for method 74 of type nav-enemy -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 7] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 15] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 23] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 33] (defmethod general-event-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'nav-mesh-kill) - (deactivate obj) - #t - ) - ((= v1-0 'nav-mesh-new) - (set! (-> obj water-max-height) (-> obj nav state mesh water-max-height)) - #t - ) - ((= v1-0 'debug-control-on) - (go (method-of-object obj debug-control)) - ) - ((= v1-0 'debug-control-off) - (react-to-focus obj) - ) - (else - ((method-of-type enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) - ) + (case arg2 + (('nav-mesh-kill) + (deactivate obj) + #t + ) + (('nav-mesh-new) + (set! (-> obj water-max-height) (-> obj nav state mesh water-max-height)) + #t + ) + (('debug-control-on) + (go (method-of-object obj debug-control)) + ) + (('debug-control-off) + (react-to-focus obj) + ) + (else + ((method-of-type enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) ) ) @@ -1016,6 +1008,7 @@ ) ;; definition for method 160 of type nav-enemy +;; WARN: Return type mismatch object vs none. (defmethod nav-enemy-method-160 nav-enemy ((obj nav-enemy)) (let ((s5-0 (handle->process (-> obj focus handle)))) (cond @@ -1589,13 +1582,11 @@ This commonly includes things such as: ) ;; definition for method 68 of type nav-enemy -;; WARN: Return type mismatch object vs none. (defmethod go-stare2 nav-enemy ((obj nav-enemy)) (if (!= (-> obj enemy-info taunt-anim) -1) (go (method-of-object obj taunt)) ) (go (method-of-object obj stare)) - (none) ) ;; definition for method 67 of type nav-enemy @@ -1618,7 +1609,6 @@ This commonly includes things such as: ) ) ) - (none) ) ;; definition for method 70 of type nav-enemy @@ -1629,14 +1619,11 @@ This commonly includes things such as: (go-stare2 obj) (go (method-of-object obj hostile)) ) - (none) ) ;; definition for method 71 of type nav-enemy -;; WARN: Return type mismatch object vs none. (defmethod go-flee nav-enemy ((obj nav-enemy)) (go (method-of-object obj flee)) - (none) ) ;; definition for symbol *nav-enemy-debug-control-info*, type nav-enemy-debug-control-info @@ -1701,7 +1688,6 @@ This commonly includes things such as: ) 0 (nav-enemy-method-167 self) - (none) ) ) @@ -1725,7 +1711,6 @@ This commonly includes things such as: ) 0 (nav-enemy-method-167 self) - (none) ) ) @@ -1761,7 +1746,6 @@ This commonly includes things such as: ) 0 (nav-enemy-method-165 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1855,7 +1839,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post nav-enemy-patrol-post ) @@ -1898,7 +1881,6 @@ This commonly includes things such as: (set! (-> v1-19 target-speed) 0.0) ) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1926,7 +1908,6 @@ This commonly includes things such as: ) ) (react-to-focus self) - (none) ) :post nav-enemy-simple-post ) @@ -1954,7 +1935,6 @@ This commonly includes things such as: (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-9 enemy-flags)))) ) 0 - (none) ) :trans (behavior () (nav-enemy-method-160 self) @@ -1988,7 +1968,6 @@ This commonly includes things such as: ) ) ) - (none) ) :post nav-enemy-chase-post ) @@ -2026,7 +2005,6 @@ This commonly includes things such as: ) 0 (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (nav-enemy-method-160 self) @@ -2058,7 +2036,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -2071,7 +2048,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post nav-enemy-chase-post ) @@ -2103,7 +2079,6 @@ This commonly includes things such as: (nav-enemy-method-167 self) (vector-reset! (-> self root transv)) (set! (-> self starting-time) (current-time)) - (none) ) :exit (behavior () (rlet ((acc :class vf) @@ -2153,7 +2128,6 @@ This commonly includes things such as: ) 0 ) - (none) ) ) :trans (behavior () @@ -2193,7 +2167,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2212,7 +2185,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post nav-enemy-stare-post ) @@ -2232,7 +2204,6 @@ This commonly includes things such as: ) (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) ) - (none) ) :exit (-> (method-of-type nav-enemy stare) exit) :trans (behavior () @@ -2248,7 +2219,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2284,7 +2254,6 @@ This commonly includes things such as: ) ) (go-virtual stare) - (none) ) :post nav-enemy-stare-post ) @@ -2324,7 +2293,6 @@ This commonly includes things such as: ) (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) ) - (none) ) :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -2390,7 +2358,6 @@ This commonly includes things such as: ) (go-stare2 self) ) - (none) ) :code (behavior () (let ((f30-0 (get-rand-float-range self 0.9 1.1)) @@ -2413,7 +2380,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -2425,7 +2391,6 @@ This commonly includes things such as: ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -2470,7 +2435,6 @@ This commonly includes things such as: (set! (-> self enemy-flags) (the-as enemy-flag (logxor (shl 256 32) (the-as int (-> self enemy-flags))))) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag enemy-flag41)))) (set! (-> self starting-time) (current-time)) - (none) ) :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -2505,7 +2469,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (let ((f30-0 (get-rand-float-range self 0.9 1.1)) @@ -2528,7 +2491,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((a0-0 self)) @@ -2567,7 +2529,6 @@ This commonly includes things such as: ) ) (nav-enemy-travel-post) - (none) ) ) @@ -2594,7 +2555,6 @@ This commonly includes things such as: (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-9 enemy-flags)))) ) 0 - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) @@ -2607,7 +2567,6 @@ This commonly includes things such as: (go-stare2 self) ) ) - (none) ) :post nav-enemy-flee-post ) @@ -2633,7 +2592,6 @@ This commonly includes things such as: ) 0 (vector-reset! (-> self root transv)) - (none) ) :post nav-enemy-simple-post ) @@ -2658,7 +2616,6 @@ This commonly includes things such as: (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-9 enemy-flags)))) ) 0 - (none) ) :code (behavior () (local-vars (v1-37 enemy-flag) (v1-45 enemy-flag)) @@ -2705,7 +2662,6 @@ This commonly includes things such as: (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (go-hostile self) - (none) ) :post nav-enemy-simple-post ) @@ -2729,7 +2685,6 @@ This commonly includes things such as: (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-9 enemy-flags)))) ) 0 - (none) ) :post nav-enemy-falling-post ) @@ -2754,7 +2709,6 @@ This commonly includes things such as: ) 0 (nav-enemy-method-167 self) - (none) ) :post nav-enemy-simple-post ) @@ -2779,7 +2733,6 @@ This commonly includes things such as: ) 0 (nav-enemy-method-167 self) - (none) ) :post nav-enemy-die-falling-post ) @@ -2831,7 +2784,6 @@ This commonly includes things such as: ) 0 (logclear! (-> self nav state flags) (nav-state-flag at-gap)) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type enemy jump) exit))) @@ -2843,7 +2795,6 @@ This commonly includes things such as: (logclear! (-> v1-4 shape nav-flags) (nav-flags has-extra-sphere)) ) 0 - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'enemy-jump-info))) @@ -2932,7 +2883,6 @@ This commonly includes things such as: ) ) (enemy-method-93 self) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -2951,7 +2901,6 @@ This commonly includes things such as: ) ) ) - (none) ) ) @@ -2974,7 +2923,6 @@ This commonly includes things such as: ) 0 (nav-enemy-method-167 self) - (none) ) :post nav-enemy-simple-post ) @@ -2986,7 +2934,6 @@ This commonly includes things such as: :enter (behavior () (logior! (-> self enemy-flags) (enemy-flag victory)) ((-> (method-of-type nav-enemy idle) enter)) - (none) ) :code (-> (method-of-type nav-enemy idle) code) :post (-> (method-of-type nav-enemy idle) post) @@ -3007,7 +2954,6 @@ This commonly includes things such as: ) 0 ) - (none) ) ) @@ -3038,7 +2984,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post nav-enemy-debug-control-post ) diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc index f51dcc483e2..2abd33fcffb 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc @@ -353,7 +353,7 @@ ;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch none vs object. (defmethod rigid-body-control-method-10 rigid-body-control ((obj rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) - (the-as object (rigid-body-method-10 (-> obj state))) + (rigid-body-method-10 (-> obj state)) ) ;; definition for method 11 of type rigid-body-control diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc index 85436dbd9d1..9feeda724f8 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc @@ -259,7 +259,6 @@ :exit (behavior () (set! (-> self queue count) 0) 0 - (none) ) :code (the-as (function none :behavior rigid-body-queue-manager) sleep-code) :post (behavior () @@ -295,7 +294,6 @@ ) (label cfg-4) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc index af747931916..58f7a3d1e7a 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc @@ -900,7 +900,7 @@ ) ) ) - (the-as object 0) + 0 ) ;; definition for method 11 of type rigid-body @@ -1393,133 +1393,124 @@ This commonly includes things such as: ;; definition for method 46 of type rigid-body-object ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 74] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 95] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 140] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 202] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 243] (defmethod rigid-body-object-method-46 rigid-body-object ((obj rigid-body-object) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (case arg2 - (('impact-impulse) - (let ((s5-1 (-> arg3 param 0))) - (if (!= obj arg0) - (rigid-body-object-method-42 obj) - ) - (rigid-body-object-method-45 obj (the-as rigid-body-impact s5-1)) - ) - (if (and (-> obj next-state) (= (-> obj next-state name) 'idle)) - (rigid-body-object-method-43 obj) + (case arg2 + (('impact-impulse) + (let ((s5-1 (-> arg3 param 0))) + (if (!= obj arg0) + (rigid-body-object-method-42 obj) ) + (rigid-body-object-method-45 obj (the-as rigid-body-impact s5-1)) ) - (('touched) - (if (= obj *debug-actor*) - (format *stdcon* "rigid-body-object got touched~%") - ) - (when (zero? (-> arg0 rbody)) - (let ((s3-0 (if (type? arg0 process-focusable) - (the-as process-focusable arg0) - ) - ) - ) - (when s3-0 - (when (logtest? (-> s3-0 mask) (process-mask target)) - (logior! (-> obj flags) (rigid-body-object-flag player-touching)) - (set! (-> obj player-touch-time) (current-time)) - (rigid-body-object-method-42 obj) - ) - (if (not (logtest? (-> s3-0 mask) (process-mask target))) - (rigid-body-object-method-48 obj s3-0 (the-as touching-shapes-entry (-> arg3 param 0))) - ) + (if (and (-> obj next-state) (= (-> obj next-state name) 'idle)) + (rigid-body-object-method-43 obj) + ) + ) + (('touched) + (if (= obj *debug-actor*) + (format *stdcon* "rigid-body-object got touched~%") + ) + (when (zero? (-> arg0 rbody)) + (let ((s3-0 (if (type? arg0 process-focusable) + (the-as process-focusable arg0) + ) + ) + ) + (when s3-0 + (when (logtest? (-> s3-0 mask) (process-mask target)) + (logior! (-> obj flags) (rigid-body-object-flag player-touching)) + (set! (-> obj player-touch-time) (current-time)) + (rigid-body-object-method-42 obj) ) + (if (not (logtest? (-> s3-0 mask) (process-mask target))) + (rigid-body-object-method-48 obj s3-0 (the-as touching-shapes-entry (-> arg3 param 0))) + ) ) ) ) - (('attack) - (let ((s3-1 (the-as attack-info (-> arg3 param 1))) - (t0-1 (get-penetrate-using-from-attack-event arg0 arg3)) - ) - (when (!= (-> s3-1 id) (-> obj incoming-attack-id)) - (set! (-> obj incoming-attack-id) (-> s3-1 id)) - (rigid-body-object-method-47 obj arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) t0-1) + ) + (('attack) + (let ((s3-1 (the-as attack-info (-> arg3 param 1))) + (t0-1 (get-penetrate-using-from-attack-event arg0 arg3)) ) + (when (!= (-> s3-1 id) (-> obj incoming-attack-id)) + (set! (-> obj incoming-attack-id) (-> s3-1 id)) + (rigid-body-object-method-47 obj arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) t0-1) ) ) - (('edge-grabbed 'pilot-edge-grab) - (let ((s5-2 (the-as object (-> arg3 param 0)))) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) - (let ((a0-25 (if (type? arg0 process-focusable) - (the-as process-focusable arg0) - ) - ) - ) - (when a0-25 - (let ((f0-1 (/ 163840.0 (get-inv-mass a0-25)))) - (logior! (-> obj flags) (rigid-body-object-flag player-touching player-edge-grabbing player-contact-force)) - (set! (-> obj player-force-position quad) (-> (the-as attack-info s5-2) attacker-velocity quad)) - (vector-reset! (-> obj player-force)) - (set! (-> obj player-force y) (* -1.0 f0-1)) - ) + ) + (('edge-grabbed 'pilot-edge-grab) + (let ((s5-2 (the-as object (-> arg3 param 0)))) + (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) + (let ((a0-25 (if (type? arg0 process-focusable) + (the-as process-focusable arg0) + ) + ) + ) + (when a0-25 + (let ((f0-1 (/ 163840.0 (get-inv-mass a0-25)))) + (logior! (-> obj flags) (rigid-body-object-flag player-touching player-edge-grabbing player-contact-force)) + (set! (-> obj player-force-position quad) (-> (the-as attack-info s5-2) attacker-velocity quad)) + (vector-reset! (-> obj player-force)) + (set! (-> obj player-force y) (* -1.0 f0-1)) ) ) ) ) - (not (logtest? (-> obj focus-status) (focus-status dead inactive))) ) - (('ridden) - (let ((v1-45 (the-as object (-> arg3 param 0)))) - (when (the-as uint v1-45) - (let* ((s5-3 (handle->process (-> (the-as focus v1-45) handle))) - (a0-34 (if (type? s5-3 process-focusable) - (the-as process-focusable s5-3) - ) - ) - ) - (when (and a0-34 - (logtest? (-> a0-34 mask) (process-mask target)) - (not (logtest? (-> a0-34 focus-status) (focus-status on-water under-water))) - ) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) - (logior! (-> obj flags) (rigid-body-object-flag player-touching player-standing-on player-contact-force)) - (set! (-> obj player-force-position quad) (-> a0-34 root trans quad)) - (vector-reset! (-> obj player-force)) - (let ((f0-4 (/ 163840.0 (get-inv-mass a0-34))) - (f1-1 1.0) + (not (logtest? (-> obj focus-status) (focus-status dead inactive))) + ) + (('ridden) + (let ((v1-45 (the-as object (-> arg3 param 0)))) + (when (the-as uint v1-45) + (let* ((s5-3 (handle->process (-> (the-as focus v1-45) handle))) + (a0-34 (if (type? s5-3 process-focusable) + (the-as process-focusable s5-3) + ) ) - (set! (-> obj player-force y) (* -1.0 f0-4 f1-1)) - ) + ) + (when (and a0-34 + (logtest? (-> a0-34 mask) (process-mask target)) + (not (logtest? (-> a0-34 focus-status) (focus-status on-water under-water))) + ) + (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) + (logior! (-> obj flags) (rigid-body-object-flag player-touching player-standing-on player-contact-force)) + (set! (-> obj player-force-position quad) (-> a0-34 root trans quad)) + (vector-reset! (-> obj player-force)) + (let ((f0-4 (/ 163840.0 (get-inv-mass a0-34))) + (f1-1 1.0) + ) + (set! (-> obj player-force y) (* -1.0 f0-4 f1-1)) ) ) ) ) ) ) - (('bonk) - (when #t - (let ((a0-38 (if (type? arg0 process-focusable) - (the-as process-focusable arg0) - ) - ) - ) - (when a0-38 - (logior! (-> obj flags) (rigid-body-object-flag player-touching player-impulse-force)) - (set! (-> obj player-force-position quad) (-> a0-38 root trans quad)) - (let ((f30-2 (* 0.00012207031 (the-as float (-> arg3 param 1)))) - (f0-9 (/ 163840.0 (get-inv-mass a0-38))) - ) - (vector-reset! (-> obj player-force)) - (set! (-> obj player-force y) (* -0.1 f0-9 f30-2)) - ) + ) + (('bonk) + (when #t + (let ((a0-38 (if (type? arg0 process-focusable) + (the-as process-focusable arg0) + ) + ) + ) + (when a0-38 + (logior! (-> obj flags) (rigid-body-object-flag player-touching player-impulse-force)) + (set! (-> obj player-force-position quad) (-> a0-38 root trans quad)) + (let ((f30-2 (* 0.00012207031 (the-as float (-> arg3 param 1)))) + (f0-9 (/ 163840.0 (get-inv-mass a0-38))) + ) + (vector-reset! (-> obj player-force)) + (set! (-> obj player-force y) (* -0.1 f0-9 f30-2)) ) ) ) ) - (('enable-physics) - (rigid-body-object-method-42 obj) - ) - ) + ) + (('enable-physics) + (rigid-body-object-method-42 obj) + ) ) ) @@ -1540,7 +1531,6 @@ This commonly includes things such as: ) (go-virtual active) ) - (none) ) :code (the-as (function none :behavior rigid-body-object) sleep-code) :post (the-as (function none :behavior rigid-body-object) ja-post) @@ -1559,11 +1549,9 @@ This commonly includes things such as: ) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior rigid-body-object) sleep-code) :post (behavior () (rigid-body-object-method-37 self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc index c33cb7c079e..2a16bcdcb00 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc @@ -565,14 +565,13 @@ ;; failed to figure out what this is: (defstate process-drawable-art-error (process-drawable) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('nav-mesh-kill) - (deactivate self) - #t - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('nav-mesh-kill) + (deactivate self) + #t + ) + ) ) :code (behavior ((arg0 string)) (if (-> self entity) @@ -623,7 +622,6 @@ (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc index c855304873f..274e983c969 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc @@ -57,6 +57,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ;; definition for method 37 of type process-taskable +;; WARN: Return type mismatch object vs none. (defmethod process-taskable-method-37 process-taskable ((obj process-taskable)) (let ((v1-1 (-> obj draw shadow-ctrl))) (cond @@ -78,16 +79,15 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ;; failed to figure out what this is: (defstate hide (process-taskable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('say) - (let ((v0-0 (current-time))) - (set! (-> self want-to-say) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('say) + (let ((v0-0 (current-time))) + (set! (-> self want-to-say) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior () (set! (-> self state-time) (current-time)) @@ -97,7 +97,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (set! (-> v1-6 prim-core collide-with) (collide-spec)) ) 0 - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) @@ -105,7 +104,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :trans (behavior () (let ((v1-1 (get-current-task-event (-> self task)))) @@ -117,7 +115,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (go-virtual idle) ) ) - (none) ) :code (the-as (function none :behavior process-taskable) sleep-code) ) @@ -125,8 +122,8 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ;; failed to figure out what this is: (defstate idle (process-taskable) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (if (-> self bounce-away) (send-event @@ -138,7 +135,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ) (('touch) - (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> event param 0)) 0.7 6144.0 16384.0) + (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) ) (('say) (let ((v0-0 (the-as object (current-time)))) @@ -150,11 +147,9 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :trans (behavior () (let ((gp-0 (get-current-task-event (-> self task)))) @@ -271,11 +266,9 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ) (process-taskable-method-37 self) - (none) ) :code (behavior () (process-taskable-anim-loop (the-as (function process-taskable object) true-func)) - (none) ) :post (behavior () (if (and (-> self hide-during-movie) (movie?)) @@ -288,7 +281,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ) (transform-post) - (none) ) ) @@ -300,7 +292,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (set! (-> self want-to-say) 0) (process-entity-status! self (entity-perm-status no-kill) #t) (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (set! (-> self last-talk) (-> *display* game-clock frame-counter)) @@ -315,7 +306,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (set! (-> v1-13 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-13 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :code (behavior ((arg0 game-task-event)) (when (-> arg0 scene) @@ -335,7 +325,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ) (go-virtual hide) - (none) ) ) @@ -351,7 +340,6 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ) (go-virtual hide) - (none) ) :post (-> (method-of-type process-taskable idle) post) ) @@ -474,7 +462,3 @@ This commonly includes things such as: (go (method-of-object obj hide)) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/process-drawable/simple-focus_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/simple-focus_REF.gc index 91100119ce7..92df758b68e 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/simple-focus_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/simple-focus_REF.gc @@ -45,16 +45,15 @@ ;; failed to figure out what this is: (defstate idle (simple-focus) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('move-trans) - (let ((v0-0 (-> self root trans))) - (set! (-> v0-0 quad) (-> (the-as vector (-> event param 0)) quad)) - v0-0 - ) - ) - ) - ) + :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 (the-as (function none :behavior simple-focus) sleep-code) ) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc index 70697c31f7e..a19618be2f8 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc @@ -33,7 +33,6 @@ ) ;; definition for function simple-nav-sphere-event-handler -;; WARN: Return type mismatch object vs none. (defbehavior simple-nav-sphere-event-handler simple-nav-sphere ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (case event-type (('die-fast) @@ -54,7 +53,6 @@ #t ) ) - (none) ) ;; definition for method 12 of type simple-nav-sphere @@ -76,10 +74,7 @@ ;; failed to figure out what this is: (defstate idle (simple-nav-sphere) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior simple-nav-sphere) - simple-nav-sphere-event-handler - ) + :event simple-nav-sphere-event-handler :trans (behavior () (if *display-nav-marks* (add-debug-sphere @@ -90,7 +85,6 @@ (new 'static 'rgba :r #x80 :g #x40 :a #x80) ) ) - (none) ) :code (the-as (function none :behavior simple-nav-sphere) sleep-code) ) @@ -98,10 +92,7 @@ ;; failed to figure out what this is: (defstate active (simple-nav-sphere) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior simple-nav-sphere) - simple-nav-sphere-event-handler - ) + :event simple-nav-sphere-event-handler :trans (behavior () (let ((v1-0 (ppointer->process (-> self parent))) (gp-0 (new 'stack-no-clear 'vector)) @@ -109,7 +100,6 @@ (vector<-cspace! gp-0 (-> (the-as process-drawable v1-0) node-list data (-> self track-joint))) (move-to-point! (-> self root) gp-0) ) - (none) ) :code (the-as (function none :behavior simple-nav-sphere) sleep-code) ) @@ -148,9 +138,7 @@ (set! (-> self root) s5-0) ) (logclear! (-> self mask) (process-mask actor-pause enemy)) - (set! (-> self event-hook) - (the-as (function process int symbol event-message-block object) simple-nav-sphere-event-handler) - ) + (set! (-> self event-hook) simple-nav-sphere-event-handler) (if arg2 (add-process-drawable-to-navmesh arg2 self #f) (nav-mesh-connect-from-ent self) diff --git a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc index 79cfc107461..8e2590cc73a 100644 --- a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc +++ b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc @@ -962,7 +962,6 @@ ) ) ) - (none) ) :trans (behavior () (if (and (-> self scene) (nonzero? (-> self anim anim-name)) (not (load-in-progress? *level*))) @@ -978,7 +977,6 @@ ) ) (set! (-> *ACTOR-bank* birth-max) 1000) - (none) ) :code (behavior ((arg0 symbol)) (local-vars (v1-18 symbol) (v1-118 symbol)) @@ -1129,7 +1127,6 @@ ) ) (go-virtual play-anim) - (none) ) ) @@ -1230,15 +1227,14 @@ (if (and (-> self scene) (-> self scene save)) (auto-save-user) ) - (none) ) ) ;; failed to figure out what this is: (defstate play-anim (scene-player) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('abort) (set! (-> self aborted?) #t) (set-blackout-frames (seconds 0.2)) @@ -1263,7 +1259,6 @@ (remove-setting! 'borrow) (remove-setting! 'gem) (apply-settings *setting-control*) - (none) ) :trans (behavior () (cond @@ -1296,7 +1291,6 @@ ) ) ) - (none) ) :code (behavior () (local-vars (a0-24 symbol)) @@ -1358,7 +1352,6 @@ (if (and (-> self wait) *target* (focus-test? *target* grabbed)) (go-virtual release) ) - (none) ) :post (behavior () (when (-> self scene) @@ -1640,7 +1633,6 @@ ) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc index 4d70a5388b9..cc99c9304df 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc @@ -489,15 +489,14 @@ (target-board-init) (remove-exit) (go target-board-get-on) - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-board-stance (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('lip) (when (and (= (-> self control ground-pat mode) (pat-mode halfpipe)) (< (-> self control poly-angle) 0.5) @@ -514,7 +513,7 @@ ) (set! (-> self board halfpipe-lip-time) (current-time)) (set! (-> self board halfpipe-side-time) (current-time)) - (set! (-> self board halfpipe-lip-event) (the-as symbol (-> event param 0))) + (set! (-> self board halfpipe-lip-event) (the-as symbol (-> block param 0))) (let ((v0-2 (the-as object (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset)))) ) (set! (-> self control root-prim prim-core action) (the-as collide-action v0-2)) @@ -525,20 +524,19 @@ (('jump) (go target-board-jump - (the-as meters (-> event param 0)) - (the-as meters (-> event param 1)) - (the-as symbol (-> event param 2)) + (the-as meters (-> block param 0)) + (the-as meters (-> block param 1)) + (the-as symbol (-> block param 2)) ) ) (else - (target-board-handler proc arg1 event-type event) + (target-board-handler proc argc message block) ) ) ) :enter (behavior () (set! (-> self control mod-surface) *board-walk-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) - (none) ) :exit (behavior () (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -563,7 +561,6 @@ (set! (-> self board turn-anim-duck) 0.0) ) (target-board-exit) - (none) ) :trans (behavior () (if (and (cpad-hold? (-> self control cpad number) l1) @@ -643,7 +640,6 @@ (set! (-> self board mods-backup) (-> self control mod-surface)) ) ) - (none) ) :code (behavior () (let ((gp-0 (-> self board stance-info))) @@ -742,7 +738,6 @@ ) ) #f - (none) ) :post target-board-post ) @@ -753,12 +748,10 @@ :enter (behavior () (set! (-> self control mod-surface) *board-duck-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) - (none) ) :exit (behavior () (set! (-> self board turn-anim-duck-vel) -8.0) ((-> target-board-stance exit)) - (none) ) :trans (behavior () (if (and (or (not (cpad-hold? (-> self control cpad number) l1)) @@ -850,7 +843,6 @@ (set! (-> self board mods-backup) (-> self control mod-surface)) ) ) - (none) ) :code (-> target-board-stance code) :post target-board-post @@ -858,11 +850,11 @@ ;; failed to figure out what this is: (defstate target-board-jump (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'edge-grab) (< (- (current-time) (-> self state-time)) (seconds 0.1))) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'edge-grab) (< (- (current-time) (-> self state-time)) (seconds 0.1))) (return #f) ) - (target-board-handler proc arg1 event-type event) + (target-board-handler proc argc message block) ) :enter (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) (local-vars @@ -1009,7 +1001,6 @@ (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) ) (set! (-> self board slow-transv quad) (-> self control transv quad)) - (none) ) :exit target-board-exit :trans (behavior () @@ -1023,7 +1014,6 @@ (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) (set! (-> self board slow-transv quad) (-> self control transv quad)) (set! (-> self board shock-offset) (* 0.8 (-> self board shock-offset))) - (none) ) :code (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) (case arg2 @@ -1077,15 +1067,14 @@ (ja :num! (loop!)) ) #f - (none) ) :post target-board-post ) ;; failed to figure out what this is: (defstate target-board-halfpipe (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('edge-grab) (format #t @@ -1138,14 +1127,14 @@ ) ) (('grenade) - (if (< (the-as float (-> event param 0)) + (if (< (the-as float (-> block param 0)) (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) ) (go target-board-grenade (process->handle proc)) ) ) (else - (target-board-handler proc arg1 event-type event) + (target-board-handler proc argc message block) ) ) ) @@ -1203,7 +1192,6 @@ ) (go target-board-turn-to (-> self control transv) (seconds 0.5)) ) - (none) ) :exit (behavior () (if (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -1223,7 +1211,6 @@ (remove-setting! 'matrix-blend-max-partial) (logclear! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) (target-board-exit) - (none) ) :trans (behavior () (when (and (or (= (the-as int (-> self control did-move-to-pole-or-max-jump-height)) #t) @@ -1305,7 +1292,6 @@ (go target-board-stance) ) (target-board-halfpipe-trans) - (none) ) :code (behavior () (cond @@ -1338,7 +1324,6 @@ ((the-as (function none :behavior target) (-> target-board-stance code))) ) ) - (none) ) :post target-board-post ) @@ -1352,7 +1337,6 @@ (set! (-> self control mod-surface) *board-jump-mods*) ) (set! (-> self board mods-backup) (-> self control mod-surface)) - (none) ) :exit (-> target-board-halfpipe exit) :trans (behavior () @@ -1364,7 +1348,6 @@ (set! (-> self control mod-surface) *board-air-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -1420,7 +1403,6 @@ ) ) ) - (none) ) :post target-board-post ) @@ -1433,7 +1415,6 @@ (set! (-> self control mod-surface) *board-jump-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) (sound-play "board-k-jump") - (none) ) :exit target-board-exit :trans (behavior () @@ -1453,7 +1434,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1472,7 +1452,6 @@ (ja :num! (loop!)) ) #f - (none) ) :post target-board-post ) @@ -1497,7 +1476,6 @@ (set! (-> self board mods-backup) (-> self control mod-surface)) (set! (-> self board smack-surface-time) 0) 0 - (none) ) :exit target-board-exit :trans target-board-jump-trans @@ -1522,7 +1500,6 @@ ) enter-state (go target-board-falling) - (none) ) :post target-board-post ) @@ -1566,7 +1543,6 @@ (set! (-> self control unknown-sound-id00) (sound-play "board-flip")) (target-start-attack) (target-danger-set! 'board-spin #f) - (none) ) :exit (behavior () (target-danger-set! 'harmless #f) @@ -1590,7 +1566,6 @@ (-> v1-9 id) ) ((-> target-board-halfpipe exit)) - (none) ) :trans (behavior () (cond @@ -1608,7 +1583,6 @@ ) ) (set! (-> self board slow-transv quad) (-> self control transv quad)) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((gp-0 (>= (-> self board flip-control) 0.0))) @@ -1704,7 +1678,6 @@ ) ) (go target-board-falling) - (none) ) :post target-board-post ) @@ -1738,7 +1711,6 @@ (set! (-> self control mod-surface) *board-flip-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) (set! (-> self control dynam gravity-length) 147456.0) - (none) ) :exit (behavior () (set! (-> self board unknown-float01) 0.0) @@ -1758,7 +1730,6 @@ ) ) ((-> target-board-halfpipe exit)) - (none) ) :trans (behavior () (target-board-spin-check) @@ -1777,7 +1748,6 @@ ) ) (set! (-> self board slow-transv quad) (-> self control transv quad)) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((v1-0 (new 'stack-no-clear 'vector))) @@ -1908,7 +1878,6 @@ ) ) (go target-board-falling) - (none) ) :post target-board-post ) @@ -1921,7 +1890,6 @@ (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) (sound-play "board-boots") ((-> target-board-hold exit)) - (none) ) :trans (behavior () (target-board-spin-check) @@ -1939,7 +1907,6 @@ (go target-board-hit-ground) ) (set! (-> self board slow-transv quad) (-> self control transv quad)) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((gp-0 (>= (-> self board unknown-float00) 0.0)) @@ -2017,7 +1984,6 @@ ) ) (go target-board-falling) - (none) ) :post target-board-post ) @@ -2030,7 +1996,6 @@ (if (= (-> self control ground-pat mode) (pat-mode halfpipe)) (go target-board-turn-to (-> self control transv) (seconds 0.5)) ) - (none) ) :exit target-board-exit :trans (behavior () @@ -2054,7 +2019,6 @@ (if (target-board-smack-surface?) 0 ) - (none) ) :code (behavior () (set! (-> self control mod-surface) *board-walk-mods*) @@ -2102,7 +2066,6 @@ ) ) (go target-board-stance) - (none) ) :post target-board-post ) @@ -2143,7 +2106,6 @@ (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) ) (set! (-> self control turn-lockout-end-time) (+ (current-time) arg1)) - (none) ) :exit target-board-exit :trans (behavior () @@ -2170,7 +2132,6 @@ ) ) (set! (-> self board turn-anim-targ) (* 10.0 (-> self board turn-anim-targ))) - (none) ) :code (-> target-board-stance code) :post target-board-post @@ -2178,13 +2139,13 @@ ;; failed to figure out what this is: (defstate target-board-ride-edge (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('edge-grab 'push-transv 'push-trans) #f ) (('end-mode) - (when (-> event param 0) + (when (-> block param 0) (let ((v1-6 (/ (- (current-time) (-> self board ride-start-time)) 300))) (if (> v1-6 0) (add-to-trick-list (-> self board) (board-tricks board-rail) (* 100.0 (the float v1-6))) @@ -2194,11 +2155,11 @@ (go target-board-turn-to (-> self control transv) (seconds 0.2)) ) (else - (target-board-handler proc arg1 event-type event) + (target-board-handler proc argc message block) ) ) ) - :enter (behavior ((arg0 symbol) (arg1 object) (arg2 object) (arg3 float)) + :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (current-time)) (logior! (-> self focus-status) (focus-status rail)) (logior! (-> self control root-prim prim-core action) (collide-action can-ride)) @@ -2256,7 +2217,6 @@ ) (add-to-trick-list (-> self board) (board-tricks board-rail-jump) f0-24) ) - (none) ) :exit (behavior () (logclear! (-> self control status) (collide-status probe-hit)) @@ -2296,7 +2256,6 @@ (vector+! (new 'stack-no-clear 'vector) gp-0 (new 'static 'vector :y 204.8 :w 1.0)) ) ) - (none) ) :trans (behavior () (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) @@ -2373,9 +2332,8 @@ (launch-particles (-> *part-id-table* 431) gp-1) ) ) - (none) ) - :code (behavior ((arg0 symbol) (arg1 object) (arg2 object) (arg3 float)) + :code (behavior ((arg0 symbol)) (let* ((v1-1 (-> self board ride-mode)) (gp-0 (cond ((zero? v1-1) @@ -2415,23 +2373,21 @@ (suspend) ) #f - (none) ) :post (behavior () (target-board-ride-post) - (none) ) ) ;; failed to figure out what this is: (defstate target-board-grenade (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('target) (handle->process (-> self control unknown-handle02)) ) (else - (target-board-handler proc arg1 event-type event) + (target-board-handler proc argc message block) ) ) ) @@ -2460,12 +2416,10 @@ ) ) ) - (none) ) :exit (behavior () (send-event (handle->process (-> self control unknown-handle02)) 'exit) ((-> target-board-halfpipe exit)) - (none) ) :trans (behavior () (set! (-> self board halfpipe-time) (current-time)) @@ -2489,7 +2443,6 @@ (+! (-> self control transv z) (* 20480.0 (-> self control edge-grab-across-edge-dir z))) (go target-board-stance) ) - (none) ) :code (behavior ((arg0 handle)) (ja-channel-push! 1 (seconds 0.05)) @@ -2529,26 +2482,25 @@ (ja-eval) ) (sleep-code) - (none) ) :post target-board-post ) ;; failed to figure out what this is: (defstate target-board-get-on (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'attack-or-shove 'attack-invinc) (target-attacked - event-type - (the-as attack-info (-> event param 1)) + message + (the-as attack-info (-> block param 1)) proc - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) target-hit ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -2646,7 +2598,6 @@ ) ) (set! (-> self board slow-transv quad) (-> self control transv quad)) - (none) ) :exit target-board-exit :code (behavior () @@ -2687,20 +2638,19 @@ (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) (logior! (-> self control status) (collide-status on-surface)) (go target-board-hit-ground) - (none) ) :post target-board-post ) ;; failed to figure out what this is: (defstate target-board-pegasus (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (go target-jump 16384.0 16384.0 (the-as surface #f)) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -2709,7 +2659,6 @@ (set! (-> self board shock-offsetv) 0.0) (set! (-> self state-time) (current-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) - (none) ) :exit target-board-exit :code (behavior ((arg0 handle)) @@ -2778,7 +2727,6 @@ ) ) #f - (none) ) :post (behavior () (set! (-> self control bend-speed) 0.0) @@ -2786,7 +2734,6 @@ (vector-seek! (-> self control draw-offset) *null-vector* (* 16384.0 (seconds-per-frame))) (target-no-move-post) (target-board-effect) - (none) ) ) @@ -2883,7 +2830,6 @@ ) ) (set! (-> self board slow-transv quad) (-> self control transv quad)) - (none) ) :exit target-board-exit :code (behavior ((arg0 object) (arg1 symbol)) @@ -2977,7 +2923,6 @@ ) ) ) - (none) ) :post (behavior () (set! (-> self control bend-speed) 0.0) @@ -2985,34 +2930,33 @@ (vector-seek! (-> self control draw-offset) *null-vector* (* 16384.0 (seconds-per-frame))) (target-post) (target-board-effect) - (none) ) ) ;; failed to figure out what this is: (defstate target-board-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) (else - (case event-type + (case message (('end-mode) (go target-board-stance) ) (('clone-anim) - (go target-board-clone-anim (process->handle (the-as process (-> event param 0)))) + (go target-board-clone-anim (process->handle (the-as process (-> block param 0)))) ) (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('normal) (go target-grab 'stance) ) ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -3025,7 +2969,6 @@ (logior! (-> self focus-status) (focus-status grabbed)) (logclear! (-> self focus-status) (focus-status halfpipe)) (set! (-> self board stick-off) #t) - (none) ) :exit (behavior () (set! (-> self board stick-off) #f) @@ -3033,7 +2976,6 @@ (logclear! (-> self focus-status) (focus-status grabbed)) (logclear! (-> self water flags) (water-flags jump-out)) (target-board-exit) - (none) ) :code (behavior ((arg0 symbol)) (let ((v1-2 (ja-group))) @@ -3047,18 +2989,17 @@ (suspend) ) #f - (none) ) :post target-board-post ) ;; failed to figure out what this is: (defstate target-board-clone-anim (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) (set! (-> self control unknown-word04) (the-as uint #f)) ) - ((-> target-board-grab event) proc arg1 event-type event) + ((-> target-board-grab event) proc argc message block) ) :enter (-> target-clone-anim enter) :exit (behavior () @@ -3068,7 +3009,6 @@ ((-> target-clone-anim exit)) ((-> target-board-start exit)) (vector-reset! (-> self control transv)) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self control unknown-word04) (the-as uint (-> self control draw-offset y))) @@ -3076,7 +3016,6 @@ (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (clone-anim arg0 #t "") (go target-board-stance) - (none) ) :post target-no-ja-move-post ) @@ -3101,7 +3040,6 @@ ) (logior! (-> self state-flags) (state-flags lleg-no-ik rleg-no-ik)) (target-board-exit) - (none) ) :trans (behavior () (when (= *cheat-mode* 'debug) @@ -3111,7 +3049,6 @@ (go target-board-stance) ) ) - (none) ) :code (behavior ((arg0 vector) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags jump-out)) @@ -3246,7 +3183,6 @@ ) enter-state (go target-board-hit-ground) - (none) ) :post (behavior () (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) @@ -3276,6 +3212,5 @@ ) ) (target-board-joint-points) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc index 21a6ca9dad6..ee2b3fd1f2e 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc @@ -73,7 +73,6 @@ (go-virtual idle #f) ) ) - (none) ) :code (behavior () (ja-channel-set! 0) @@ -81,15 +80,14 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) ;; failed to figure out what this is: (defstate idle (board) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('open) (go-virtual use) ) @@ -107,7 +105,6 @@ (go-virtual hidden) ) ) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-push! 1 (seconds 0.1)) @@ -130,7 +127,6 @@ ) (set! (-> self draw shadow) #f) (sleep-code) - (none) ) :post board-post ) @@ -138,8 +134,8 @@ ;; failed to figure out what this is: (defstate use (board) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('close) (go-virtual idle #f) ) @@ -178,7 +174,6 @@ ) ) ) - (none) ) :code (behavior () (set! (-> self draw shadow) (-> self shadow-backup)) @@ -192,7 +187,6 @@ (ja :num! (seek!)) ) (sleep-code) - (none) ) :post board-post ) diff --git a/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc b/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc index 02b65fafee8..a8e8ecc8d4f 100644 --- a/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc @@ -454,167 +454,146 @@ ;; WARN: Return type mismatch none vs object. (defbehavior target-board-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object) (a0-10 uint)) - (the-as - object - (cond - ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) - 'board - ) - (else - (let ((v1-3 arg2)) - (cond - ((= v1-3 'end-mode) - (go target-board-get-off (process->handle arg0) #f) - ) - ((= v1-3 'change-mode) - (let ((v1-7 (-> arg3 param 0))) - (b! (!= v1-7 'grab) cfg-19 :delay (set! a0-10 (the-as uint #f))) - (b! (focus-test? self dead) cfg-18 :delay (set! v0-0 #f)) - (set! v0-0 (if (not (-> arg3 param 1)) - #t - (go target-board-grab (the-as symbol a0-10)) - ) - ) - (label cfg-18) - (b! #t cfg-37 :delay (nop!)) - (label cfg-19) - (set! v0-0 (cond - ((= v1-7 'normal) - (go target-board-get-off (process->handle arg0) #f) - ) - ((= v1-7 'falling) - enter-state - (go target-board-falling) - ) - ((= v1-7 'pegasus) - (go target-board-get-off (process->handle arg0) 'pegasus) - ) - ((= v1-7 'pilot) - (target-standard-event-handler arg0 arg1 arg2 arg3) - ) - ) - ) - ) - (label cfg-37) - v0-0 - ) - (else - (let ((a3-2 (= v1-3 'swim))) - (cond - ((or a3-2 (begin (set! a3-2 (= v1-3 'wade)) a3-2) (begin (set! a3-2 (= v1-3 'slide)) a3-2) (= v1-3 'pole-grab)) - #f - ) - ((= v1-3 'clone-anim) - (go target-board-clone-anim (process->handle (the-as process (-> arg3 param 0)))) - ) - ((= v1-3 'edge-grab) - (let ((gp-1 *edge-grab-info*) - (s5-1 (new 'stack-no-clear 'vector)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + 'board + ) + (else + (case arg2 + (('end-mode) + (go target-board-get-off (process->handle arg0) #f) + ) + (('change-mode) + (let ((v1-7 (-> arg3 param 0))) + (b! (!= v1-7 'grab) cfg-19 :delay (set! a0-10 (the-as uint #f))) + (b! (focus-test? self dead) cfg-18 :delay (set! v0-0 #f)) + (set! v0-0 (if (not (-> arg3 param 1)) + #t + (go target-board-grab (the-as symbol a0-10)) + ) + ) + (label cfg-18) + (b! #t cfg-37 :delay (nop!)) + (label cfg-19) + (set! v0-0 (cond + ((= v1-7 'normal) + (go target-board-get-off (process->handle arg0) #f) ) - (vector-normalize! - (vector-! - (-> self control edge-grab-edge-dir) - (-> gp-1 world-vertex 1) - (the-as vector (-> gp-1 world-vertex)) + ((= v1-7 'falling) + enter-state + (go target-board-falling) ) - 1.0 - ) - (vector+float*! s5-1 (-> self control trans) (-> self control c-R-w vector 2) (* 40960.0 (seconds-per-frame))) - (let* ((t9-8 vector-segment-overlap) - (a1-8 (-> gp-1 world-vertex)) - (a2-3 (-> gp-1 world-vertex 1)) - (f0-2 (t9-8 s5-1 (the-as vector a1-8) a2-3)) - ) - (if (and (>= (- (current-time) (-> self board ride-time)) (seconds 0.4)) - (>= f0-2 0.0) - (>= 1.0 f0-2) - (not (and (-> self next-state) (= (-> self next-state name) 'target-board-duck-stance))) - ) - (go - target-board-ride-edge - (logtest? (-> self control mod-surface flags) (surface-flag air)) - (the-as object a1-8) - (the-as object a2-3) - (the-as float a3-2) - ) - ) - ) - ) - ) - ((= v1-3 'touched) - (cond - ((and (-> self control danger-mode) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self control) - (the-as uint 1920) - ) - ) - (when (target-send-attack - arg0 - (-> self control danger-mode) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as int (-> self control target-attack-id)) - (the-as int (-> self control attack-count)) - (-> self control penetrate-using) - ) - (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 117) 0 #f #f self 25 :to self) - (the-as object (target-timed-invulnerable (seconds 0.5) self 2)) - ) - ) - (else - (let ((a1-15 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-15 from) (process->ppointer self)) - (set! (-> a1-15 num-params) 2) - (set! (-> a1-15 message) 'attack) - (set! (-> a1-15 param 0) (-> arg3 param 0)) - (set! (-> a1-15 param 1) - (the-as - uint - (static-attack-info - ((id (-> self board attack-id)) (mode 'board) (penetrate-using (-> self control penetrate-using))) - ) - ) - ) - (set! v0-0 (send-event-function arg0 a1-15)) + ((= v1-7 'pegasus) + (go target-board-get-off (process->handle arg0) 'pegasus) ) - (when v0-0 - (let* ((v1-63 (-> self game)) - (a0-68 (+ (-> v1-63 attack-id) 1)) - ) - (set! (-> v1-63 attack-id) a0-68) - (set! (-> self board attack-id) a0-68) - ) + ((= v1-7 'pilot) + (target-standard-event-handler arg0 arg1 arg2 arg3) ) - v0-0 - ) - ) - ) - ((or (= v1-3 'attack) (= v1-3 'attack-or-shove) (= v1-3 'attack-invinc)) - (target-attacked - arg2 - (the-as attack-info (-> arg3 param 1)) - arg0 - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as (state symbol attack-info target) target-board-hit) - ) - ) - ((= v1-3 'shove) - (when (not (focus-test? self hit)) - (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 160) - (when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker))) - (set! (-> self attack-info-rec attacker) (process->handle arg0)) - (logior! (-> self attack-info-rec mask) (attack-mask attacker)) - ) - (go target-board-hit (the-as vector 'shove) (-> self attack-info-rec)) - ) - ) - (else - (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + (label cfg-37) + v0-0 + ) + (('swim 'wade 'slide 'pole-grab) + #f + ) + (('clone-anim) + (go target-board-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (('edge-grab) + (let ((gp-1 *edge-grab-info*) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (-> gp-1 world-vertex 1) + (the-as vector (-> gp-1 world-vertex)) + ) + 1.0 + ) + (vector+float*! s5-1 (-> self control trans) (-> self control c-R-w vector 2) (* 40960.0 (seconds-per-frame))) + (let ((f0-2 (vector-segment-overlap s5-1 (the-as vector (-> gp-1 world-vertex)) (-> gp-1 world-vertex 1)))) + (if (and (>= (- (current-time) (-> self board ride-time)) (seconds 0.4)) + (>= f0-2 0.0) + (>= 1.0 f0-2) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-duck-stance))) + ) + (go target-board-ride-edge (logtest? (-> self control mod-surface flags) (surface-flag air))) + ) + ) + ) + ) + (('touched) + (cond + ((and (-> self control danger-mode) ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 1920) + ) + ) + (when (target-send-attack + arg0 + (-> self control danger-mode) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) ) - ) - ) + (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 117) 0 #f #f self 25 :to self) + (target-timed-invulnerable (seconds 0.5) self 2) ) ) + (else + (let ((a1-15 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-15 from) (process->ppointer self)) + (set! (-> a1-15 num-params) 2) + (set! (-> a1-15 message) 'attack) + (set! (-> a1-15 param 0) (-> arg3 param 0)) + (set! (-> a1-15 param 1) + (the-as + uint + (static-attack-info + ((id (-> self board attack-id)) (mode 'board) (penetrate-using (-> self control penetrate-using))) + ) + ) + ) + (set! v0-0 (send-event-function arg0 a1-15)) + ) + (when v0-0 + (let* ((v1-63 (-> self game)) + (a0-68 (+ (-> v1-63 attack-id) 1)) + ) + (set! (-> v1-63 attack-id) a0-68) + (set! (-> self board attack-id) a0-68) + ) + ) + v0-0 + ) + ) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as (state symbol attack-info target) target-board-hit) + ) + ) + (('shove) + (when (not (focus-test? self hit)) + (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 160) + (when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker))) + (set! (-> self attack-info-rec attacker) (process->handle arg0)) + (logior! (-> self attack-info-rec mask) (attack-mask attacker)) + ) + (go target-board-hit (the-as vector 'shove) (-> self attack-info-rec)) + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc index d7fb4c5bf0a..b4570f99ba5 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc @@ -232,7 +232,6 @@ (set! (-> v1-6 params mask) (the-as uint 17)) (-> v1-6 id) ) - (none) ) :code (behavior () (set! (-> self state-time) (current-time)) @@ -273,12 +272,10 @@ (suspend) ) #f - (none) ) :post (behavior () (sound-play "pmkr-charge" :id (-> self charge-sound) :position (-> self root trans)) (spawn-impact-particles self) - (none) ) ) @@ -358,7 +355,6 @@ ) ) (draw-beam (-> *part-id-table* 210) (-> self root trans) (-> self core-velocity) #f #t) - (none) ) :trans (behavior () (local-vars (at-0 int)) @@ -437,7 +433,6 @@ ) (sound-play "pmkr-fire" :id (-> self fire-sound) :position (-> self root trans)) (sound-play "pmkr-trail" :id (-> self trail-sound) :position (-> self root trans)) - (none) ) ) ) @@ -549,7 +544,6 @@ :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 1)) @@ -582,7 +576,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior gun-dark-shot) sleep-code) ) @@ -884,6 +877,5 @@ ) ) (deactivate self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-red-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-red-shot_REF.gc index dd58237928a..210e21e6740 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-red-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-red-shot_REF.gc @@ -485,7 +485,6 @@ ) (suspend) ) - (none) ) ) @@ -496,7 +495,6 @@ :code (behavior () (suspend) 0 - (none) ) ) @@ -516,7 +514,6 @@ (suspend) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-states_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-states_REF.gc index 8eea41963a2..f7aee0cff71 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-states_REF.gc @@ -3,11 +3,11 @@ ;; failed to figure out what this is: (defstate target-gun-stance (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('gun) - (let ((gp-0 (-> event param 0)) - (v0-0 (target-standard-event-handler proc arg1 event-type event)) + (let ((gp-0 (-> block param 0)) + (v0-0 (target-standard-event-handler proc argc message block)) ) (when v0-0 (cond @@ -35,7 +35,7 @@ #f ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -44,14 +44,12 @@ (set! (-> self control mod-surface) *gun-walk-mods*) (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (set! (-> self control bend-target) 0.0) (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) (target-state-hook-exit) (target-gun-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -111,7 +109,6 @@ ) (slide-down-test) (fall-test target-falling -4096000.0) - (none) ) :post target-gun-post ) @@ -131,13 +128,11 @@ (set! (-> self control unknown-word04) (the-as uint 1)) ) ) - (none) ) :exit (behavior () (target-effect-exit) (target-state-hook-exit) (target-gun-exit) - (none) ) :trans (behavior () (cond @@ -232,11 +227,9 @@ ) (slide-down-test) (fall-test target-falling -4096000.0) - (none) ) :code (behavior () (target-walk-anim -300) - (none) ) :post target-gun-post ) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc index eb0af44fd5e..23346c49eaf 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc @@ -520,7 +520,6 @@ (go-virtual idle) ) ) - (none) ) :code (behavior () (ja-channel-set! 0) @@ -528,7 +527,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -547,7 +545,6 @@ ) ) ) - (none) ) :code (behavior () (set! (-> self draw shadow) #f) @@ -564,7 +561,6 @@ ) ) #f - (none) ) :post gun-post ) @@ -572,8 +568,8 @@ ;; failed to figure out what this is: (defstate use (gun) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go-virtual die) ) @@ -586,11 +582,9 @@ (set! (-> self state-time) (current-time)) (set! (-> self draw shadow) (-> self shadow-backup)) (logior! (-> self skel status) (joint-control-status sync-math)) - (none) ) :exit (behavior () (logclear! (-> self skel status) (joint-control-status sync-math)) - (none) ) :trans (behavior () (local-vars (a0-14 object)) @@ -626,7 +620,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-push! 1 (seconds 0.05)) @@ -882,7 +875,6 @@ ) ) #f - (none) ) :post (behavior () (gun-post) @@ -946,15 +938,14 @@ (set! self s5-1) ) ) - (none) ) ) ;; failed to figure out what this is: (defstate die (gun) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('reset) (go-virtual idle) ) @@ -996,7 +987,6 @@ (suspend) ) (go-virtual idle) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc index 0eb22283967..0594f530c04 100644 --- a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc @@ -3135,9 +3135,7 @@ (let ((s0-0 (new 'process 'control-info obj (collide-list-enum hit-by-others)))) (set! (-> s0-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s0-0 reaction) target-collision-reaction) - (set! (-> s0-0 no-reaction) - (the-as (function collide-shape-moving collide-query vector vector object) target-collision-no-reaction) - ) + (set! (-> s0-0 no-reaction) target-collision-no-reaction) (set! sv-16 (new 'process 'collide-shape-prim-group s0-0 (the-as uint 9) 1)) (set! (-> s0-0 total-prims) (the-as uint 10)) (set! (-> sv-16 prim-core action) (collide-action solid can-ride)) diff --git a/test/decompiler/reference/jak2/engine/target/mech/grunt-mech_REF.gc b/test/decompiler/reference/jak2/engine/target/mech/grunt-mech_REF.gc index 37fa31cd624..d7b4046978a 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/grunt-mech_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/grunt-mech_REF.gc @@ -404,16 +404,13 @@ (nav-enemy-method-167 self) (set! (-> self dismount-dest quad) (-> self root trans quad)) (logclear! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :trans (behavior () (grunt-mech-info-method-9 *grunt-mech-info* (-> self hold-id) self #f) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.07)) @@ -448,7 +445,6 @@ ) ) (go-virtual mech-hold) - (none) ) :post (the-as (function none :behavior grunt-mech) nav-enemy-simple-post) ) @@ -614,7 +610,6 @@ (stop-looking-at-target! self) (set! (-> self state-timeout) (+ (current-time) (get-rand-int-range self 450 900))) (logclear! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -623,13 +618,11 @@ (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) ) (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :trans (behavior () (if (or (not (grunt-mech-info-method-9 *grunt-mech-info* (-> self hold-id) self #f)) (grunt-mech-method-192 self)) (go-virtual mech-dismount) ) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 49) @@ -742,7 +735,6 @@ ) ) #f - (none) ) :post grunt-mech-hold-post ) @@ -771,7 +763,6 @@ ) 0 (logclear! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) @@ -783,7 +774,6 @@ ) 0 (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.07)) @@ -835,7 +825,6 @@ ) (ja-channel-push! 1 (seconds 0.13)) (go-virtual mech-post-circling) - (none) ) :post (the-as (function none :behavior grunt-mech) nav-enemy-simple-post) ) @@ -847,7 +836,6 @@ :enter (behavior () ((-> (method-of-type grunt circling) enter)) (set! (-> self state-timeout) (+ (current-time) (get-rand-int-range self 750 1200))) - (none) ) :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -895,7 +883,6 @@ ) ) ) - (none) ) :code (-> (method-of-type grunt circling) code) :post (-> (method-of-type grunt circling) post) @@ -908,7 +895,6 @@ :enter (behavior () ((-> (method-of-type grunt-mech mech-post-circling) enter)) (set! (-> self state-timeout) (+ (current-time) (get-rand-int-range self 900 1800))) - (none) ) :trans (-> (method-of-type grunt-mech mech-post-circling) trans) :code (-> (method-of-type grunt-mech mech-post-circling) code) diff --git a/test/decompiler/reference/jak2/engine/target/mech/mech-states_REF.gc b/test/decompiler/reference/jak2/engine/target/mech/mech-states_REF.gc index 957ea5ac709..5f6490fca82 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/mech-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/mech-states_REF.gc @@ -44,13 +44,11 @@ (set! (-> self control did-move-to-pole-or-max-jump-height) 0.0) (rot->dir-targ! (-> self control)) (set! (-> self mech jump-thrust-fuel) (-> *TARGET-bank* mech-jump-thrust-fuel)) - (none) ) :exit (behavior () (target-effect-exit) (target-mech-exit) (rot->dir-targ! (-> self control)) - (none) ) :trans (behavior () (if (and (move-legs?) @@ -98,7 +96,6 @@ (go target-mech-get-off) ) (fall-test target-mech-falling (-> *TARGET-bank* fall-height)) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -174,7 +171,6 @@ ) ) #f - (none) ) :post target-mech-post ) @@ -187,12 +183,10 @@ (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self control unknown-word04) (the-as uint 0.0)) (set! (-> self mech jump-thrust-fuel) (-> *TARGET-bank* mech-jump-thrust-fuel)) - (none) ) :exit (behavior () (target-effect-exit) (target-mech-exit) - (none) ) :trans (behavior () (if (and (cpad-pressed? (-> self control cpad number) circle square) (can-hands? #t)) @@ -261,7 +255,6 @@ (go target-mech-carry-pickup) ) (fall-test target-mech-falling (-> *TARGET-bank* fall-height)) - (none) ) :code (behavior () (let ((f30-0 0.0) @@ -332,7 +325,6 @@ ) ) #f - (none) ) :post target-mech-post ) @@ -459,31 +451,31 @@ ;; failed to figure out what this is: (defstate target-mech-punch (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond ((focus-test? self dangerous) - (case event-type + (case message (('touched) (if ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 1920) ) (target-send-attack proc (-> self control danger-mode) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as int (-> self control target-attack-id)) (the-as int (-> self control attack-count)) (-> self control penetrate-using) ) - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) (('impact-control) (when (-> self control danger-mode) - (-> event param 1) - (let* ((gp-1 (the-as object (-> event param 3))) + (-> block param 1) + (let* ((gp-1 (the-as object (-> block param 3))) (s5-1 (-> (the-as collide-query gp-1) best-other-tri collide-ptr)) (s4-1 (if (type? s5-1 collide-shape-prim) (the-as collide-shape-prim s5-1) @@ -563,12 +555,12 @@ ) ) (else - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) ) (else - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) ) @@ -577,7 +569,6 @@ (set! (-> self control mod-surface) *mech-punch-mods*) (set! (-> self mech state-impact? 0) #f) (rot->dir-targ! (-> self control)) - (none) ) :exit (behavior () (set! (-> *mech-punch-mods* turnvv) 0.0) @@ -585,7 +576,6 @@ (set! (-> self control last-running-attack-end-time) (current-time)) (target-exit) (target-mech-exit) - (none) ) :code (behavior () (set! (-> self mech forward-vel) (-> self control ctrl-xz-vel)) @@ -751,22 +741,21 @@ ) ) (go target-mech-stance) - (none) ) :post target-mech-post ) ;; failed to figure out what this is: (defstate target-mech-falling (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v0-0 (target-mech-bonk-event-handler proc arg1 event-type event))) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v0-0 (target-mech-bonk-event-handler proc argc message block))) (cond (v0-0 (empty) v0-0 ) (else - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) ) @@ -781,7 +770,6 @@ (set! (-> v1-4 attack-id) v0-0) (set! (-> self control target-attack-id) v0-0) ) - (none) ) :exit (behavior () (set! (-> self mech jump-thrust) 0.0) @@ -789,7 +777,6 @@ (set! (-> self mech thruster-flame-length) 0.0) (target-exit) (target-mech-exit) - (none) ) :trans (behavior () (local-vars (a0-0 none)) @@ -868,7 +855,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol)) (until #f @@ -896,7 +882,6 @@ ) ) #f - (none) ) :post target-mech-post ) @@ -917,7 +902,6 @@ (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) (set! (-> self control unknown-symbol03) (the-as float arg2)) (set! (-> self control mod-surface) *mech-jump-mods*) - (none) ) :exit (-> target-mech-falling exit) :trans (-> target-mech-falling trans) @@ -929,7 +913,6 @@ ) ) ((the-as (function none) (-> target-mech-falling code))) - (none) ) :post target-mech-post ) @@ -969,12 +952,10 @@ 1500 ) (activate! *camera-smush-control* 1638.4 15 75 1.0 0.9 (-> *display* camera-clock)) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) (target-mech-exit) - (none) ) :trans (behavior () (if (and (cpad-pressed? (-> self control cpad number) circle square) (can-hands? #t)) @@ -1011,12 +992,10 @@ ) ) (set-forward-vel 0.0) - (none) ) :code (behavior ((arg0 symbol)) (target-hit-ground-anim #f (are-still?)) (go target-mech-stance) - (none) ) :post target-mech-post ) @@ -1027,7 +1006,6 @@ :exit (behavior () ((-> target-hit exit)) (target-mech-exit) - (none) ) :trans (behavior () (when (= *cheat-mode* 'debug) @@ -1037,7 +1015,6 @@ (go target-mech-stance) ) ) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags jump-out)) @@ -1136,7 +1113,6 @@ (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-mech-falling-anim-trans 1.0) ) (go target-mech-hit-ground #f) - (none) ) :post (behavior () (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) @@ -1147,7 +1123,6 @@ (the-as float (-> self control dynam gravity-length)) ) (target-mech-post) - (none) ) ) @@ -1158,7 +1133,6 @@ (set! (-> self mech stick-off) #f) (target-mech-exit) ((-> target-death exit)) - (none) ) :trans (-> target-mech-hit trans) :code (behavior ((arg0 symbol)) @@ -1384,7 +1358,6 @@ ) (set! (-> self state-time) (current-time)) (sleep-code) - (none) ) :post target-mech-post ) @@ -1436,12 +1409,12 @@ ;; failed to figure out what this is: (defstate target-mech-carry-pickup (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (cond (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 1920) ) @@ -1463,7 +1436,7 @@ #f ) (else - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) ) @@ -1471,7 +1444,7 @@ #f ) (else - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) ) @@ -1485,7 +1458,6 @@ (set! (-> self carry max-distance) 32768.0) (set! (-> self carry mode) (carry-mode carry mech-carry mech-drag)) (carry-info-method-9 (-> self carry)) - (none) ) :exit (behavior () (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -1509,7 +1481,6 @@ ) (set! (-> self mech stick-off) #f) (target-mech-exit) - (none) ) :code (behavior () (let ((f30-0 0.0) @@ -1702,25 +1673,23 @@ ) ) (go target-mech-stance) - (none) ) :post (behavior () (target-mech-post) (carry-info-method-9 (-> self carry)) (target-mech-carry-update) - (none) ) ) ;; failed to figure out what this is: (defstate target-mech-carry-drop (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode 'end-mode) #f ) (else - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) ) @@ -1729,7 +1698,6 @@ (set! (-> self state-time) (current-time)) (set-forward-vel 0.0) (set! (-> self mech stick-off) (the-as basic #t)) - (none) ) :exit (-> target-mech-carry-pickup exit) :code (behavior () @@ -1859,17 +1827,16 @@ (ja-eval) ) (go target-mech-stance) - (none) ) :post (-> target-mech-carry-pickup post) ) ;; failed to figure out what this is: (defstate target-mech-carry-stance (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('falling) (if (and (-> self next-state) (= (-> self next-state name) 'target-mech-carry-drag)) #f @@ -1877,7 +1844,7 @@ ) ) (('grab) - (if (not (-> event param 1)) + (if (not (-> block param 1)) #t (go target-mech-grab) ) @@ -1885,7 +1852,7 @@ ) ) (else - (target-mech-handler proc arg1 event-type event) + (target-mech-handler proc argc message block) ) ) ) @@ -1895,12 +1862,10 @@ (set! (-> self control did-move-to-pole-or-max-jump-height) 0.0) (rot->dir-targ! (-> self control)) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () ((-> target-mech-carry-pickup exit)) (rot->dir-targ! (-> self control)) - (none) ) :trans (behavior () (if (and (move-legs?) @@ -1939,7 +1904,6 @@ (go target-mech-carry-throw) ) (fall-test (the-as (state symbol target) target-mech-carry-falling) (-> *TARGET-bank* fall-height)) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -1981,7 +1945,6 @@ ) ) #f - (none) ) :post target-mech-carry-post ) @@ -1993,7 +1956,6 @@ (set! (-> self state-time) (current-time)) (set! (-> self control mod-surface) *mech-carry-walk-mods*) (set! (-> self control unknown-word04) (the-as uint 0.0)) - (none) ) :exit (-> target-mech-carry-pickup exit) :trans (behavior () @@ -2038,7 +2000,6 @@ (go target-mech-carry-throw) ) (fall-test (the-as (state symbol target) target-mech-carry-falling) (-> *TARGET-bank* fall-height)) - (none) ) :code (behavior () (let ((f30-0 0.0)) @@ -2089,18 +2050,17 @@ ) ) #f - (none) ) :post target-mech-carry-post ) ;; failed to figure out what this is: (defstate target-mech-carry-drag (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('push) (when (zero? (-> self control sliding-start-time)) - (set! (-> self control sliding-start-time) (+ (current-time) (the-as time-frame (-> event param 0)))) + (set! (-> self control sliding-start-time) (+ (current-time) (the-as time-frame (-> block param 0)))) (let ((v0-0 (the-as object #t))) (set! (-> self control unknown-word04) (the-as uint v0-0)) v0-0 @@ -2115,7 +2075,7 @@ (go target-mech-stance) ) (else - ((-> target-mech-carry-stance event) proc arg1 event-type event) + ((-> target-mech-carry-stance event) proc argc message block) ) ) ) @@ -2125,7 +2085,6 @@ (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self control mod-surface) *mech-carry-drag-mods*) (set-forward-vel 0.0) - (none) ) :exit (behavior () (set! (-> self mech jump-thrust) 0.0) @@ -2150,7 +2109,6 @@ (-> v1-5 id) ) ((-> target-mech-carry-pickup exit)) - (none) ) :trans (behavior () (when (and (not (cpad-hold? (-> self control cpad number) r1)) @@ -2193,7 +2151,6 @@ (send-event self 'drop) ) ) - (none) ) :code (behavior () (let ((f28-0 0.0) @@ -2313,22 +2270,21 @@ ) ) #f - (none) ) :post target-mech-carry-post ) ;; failed to figure out what this is: (defstate target-mech-carry-falling (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v0-0 (target-mech-bonk-event-handler proc arg1 event-type event))) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v0-0 (target-mech-bonk-event-handler proc argc message block))) (cond (v0-0 (empty) v0-0 ) (else - ((-> target-mech-carry-stance event) proc arg1 event-type event) + ((-> target-mech-carry-stance event) proc argc message block) ) ) ) @@ -2336,7 +2292,6 @@ :enter (behavior () (set! (-> self control mod-surface) *mech-carry-jump-mods*) (set! (-> self state-time) (current-time)) - (none) ) :exit (-> target-mech-carry-pickup exit) :trans (behavior () @@ -2352,7 +2307,6 @@ (logior! (-> self control status) (collide-status on-surface)) (go target-mech-carry-hit-ground 'stuck) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -2374,7 +2328,6 @@ (ja :group! (-> self draw art-group data 341) :num! (loop!)) ) #f - (none) ) :post target-mech-carry-post ) @@ -2414,12 +2367,10 @@ 600 1500 ) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) ((-> target-mech-carry-pickup exit)) - (none) ) :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) @@ -2446,12 +2397,10 @@ (go target-mech-carry-walk) ) (fall-test (the-as (state symbol target) target-mech-carry-falling) (-> *TARGET-bank* fall-height)) - (none) ) :code (behavior ((arg0 symbol)) (target-hit-ground-anim #f (are-still?)) (go target-mech-carry-stance) - (none) ) :post target-mech-carry-post ) @@ -2467,7 +2416,6 @@ (set! (-> self control unknown-float36) (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) ) - (none) ) :exit (behavior () (rot->dir-targ! (-> self control)) @@ -2476,7 +2424,6 @@ (set! (-> self mech thruster-flame-width) 0.0) (set! (-> self mech thruster-flame-length) 0.0) (target-exit) - (none) ) :trans (behavior () (set! (-> self control unknown-float36) @@ -2499,7 +2446,6 @@ (set! (-> self mech thruster-flame-length) 0.0) ) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (ja-channel-push! 1 (seconds 0.05)) @@ -2526,7 +2472,6 @@ (suspend) ) (go target-mech-carry-falling) - (none) ) :post target-mech-carry-post ) @@ -2539,7 +2484,6 @@ (set! (-> self state-time) (current-time)) (set-forward-vel 0.0) (set! (-> self mech stick-off) (the-as basic #t)) - (none) ) :exit (-> target-mech-carry-pickup exit) :code (behavior () @@ -2607,7 +2551,6 @@ (ja-eval) ) (go target-mech-stance) - (none) ) :post (-> target-mech-carry-pickup post) ) @@ -2620,7 +2563,6 @@ (set! (-> self mech stick-off) #f) (set! (-> self neck flex-blend) 1.0) (logclear! (-> self state-flags) (state-flags sf5)) - (none) ) :code (behavior ((arg0 handle)) (logior! (-> self state-flags) (state-flags sf5)) @@ -2680,12 +2622,10 @@ (ja :num! (seek!)) ) (go target-mech-stance) - (none) ) :post (behavior () (target-no-move-post) (target-mech-effect) - (none) ) ) @@ -2695,7 +2635,6 @@ :exit (behavior () ((-> target-mech-start exit)) (logclear! (-> self state-flags) (state-flags sf5)) - (none) ) :code (behavior () (logior! (-> self state-flags) (state-flags sf5)) @@ -2756,28 +2695,27 @@ (go target-falling (the-as symbol a0-36)) ) ) - (none) ) :post (-> target-mech-get-on post) ) ;; failed to figure out what this is: (defstate target-mech-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) (else - (case event-type + (case message (('end-mode) (go target-mech-stance) ) (('clone-anim) - (go target-mech-clone-anim (process->handle (the-as process (-> event param 0)))) + (go target-mech-clone-anim (process->handle (the-as process (-> block param 0)))) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -2793,7 +2731,6 @@ (sound-stop (-> self mech thrust-sound-id)) (sound-stop (-> self mech drag-sound-id)) (sound-stop (-> self mech whine-sound-id)) - (none) ) :exit (behavior () (set! (-> self mech stick-off) #f) @@ -2801,7 +2738,6 @@ (logclear! (-> self focus-status) (focus-status grabbed)) (logclear! (-> self water flags) (water-flags jump-out)) ((-> target-mech-start exit)) - (none) ) :code (-> target-mech-stance code) :post target-mech-post @@ -2809,11 +2745,11 @@ ;; failed to figure out what this is: (defstate target-mech-clone-anim (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) (set! (-> self control unknown-word04) (the-as uint #f)) ) - ((-> target-mech-grab event) proc arg1 event-type event) + ((-> target-mech-grab event) proc argc message block) ) :enter (-> target-clone-anim enter) :exit (behavior () @@ -2823,7 +2759,6 @@ ((-> target-clone-anim exit)) ((-> target-mech-start exit)) (vector-reset! (-> self control transv)) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self control unknown-word04) (the-as uint (-> self control draw-offset y))) @@ -2831,13 +2766,11 @@ (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (clone-anim arg0 #t "") (go target-mech-stance) - (none) ) :post (behavior () (vector+! (-> self mech mech-trans) (-> self control trans) (-> self control cspace-offset)) (quaternion-copy! (the-as quaternion (-> self mech mech-quat)) (-> self control quat)) (set! (-> self mech mech-scale quad) (-> self control scale quad)) (target-no-ja-move-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/mech/mech_REF.gc b/test/decompiler/reference/jak2/engine/target/mech/mech_REF.gc index 8b313a0d83e..7cae6461f96 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/mech_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/mech_REF.gc @@ -64,53 +64,48 @@ ;; failed to figure out what this is: (defstate wait-for-start (mech) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack 'bonk) - (send-event proc 'target-mech-get-off (seconds 0.3)) - (send-event - proc - 'shove - #f - (static-attack-info ((id (new-attack-id)) (shove-back (meters 3)) (shove-up (meters 1)))) - ) - (the-as structure #f) - ) - (('touch) - (send-event proc 'target-mech-get-off (seconds 0.3)) - (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> event param 0)) 0.7 6144.0 16384.0) - (the-as structure #f) - ) - (('trans) - (vector+! (the-as vector (-> event param 0)) (-> self root trans) (-> self extra-trans)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack 'bonk) + (send-event proc 'target-mech-get-off (seconds 0.3)) + (send-event + proc + 'shove + #f + (static-attack-info ((id (new-attack-id)) (shove-back (meters 3)) (shove-up (meters 1)))) ) - (('shadow) - (cond - ((-> event param 0) - (let ((v0-2 (the-as structure (-> self shadow-backup)))) - (set! (-> self draw shadow) (the-as shadow-geo v0-2)) - v0-2 - ) + (the-as structure #f) + ) + (('touch) + (send-event proc 'target-mech-get-off (seconds 0.3)) + (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) + (the-as structure #f) + ) + (('trans) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) + ) + (('shadow) + (cond + ((-> block param 0) + (let ((v0-2 (the-as structure (-> self shadow-backup)))) + (set! (-> self draw shadow) (the-as shadow-geo v0-2)) + v0-2 ) - (else - (set! (-> self draw shadow) #f) - (the-as structure #f) - ) + ) + (else + (set! (-> self draw shadow) #f) + (the-as structure #f) ) ) - ) + ) ) ) :exit (behavior () (set! (-> self root root-prim prim-core action) (collide-action)) (set! (-> self root penetrated-by) (the-as penetrate -1)) - (none) ) :code (behavior () (go-virtual idle) - (none) ) ) @@ -132,12 +127,10 @@ ) ) ) - (none) ) :exit (behavior () (send-event (handle->process (-> self nav-sphere-handle)) 'die-fast) ((-> (method-of-type mech wait-for-start) exit)) - (none) ) :code (behavior () (change-parent self *entity-pool*) @@ -211,7 +204,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior mech) ja-post) ) @@ -219,8 +211,8 @@ ;; failed to figure out what this is: (defstate pickup (mech) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('draw) (ja-channel-set! 1) (ja :group! mech-mech-idle-ja) @@ -229,14 +221,14 @@ (transform-post) ) (('trans) - (vector+! (the-as vector (-> event param 0)) (-> self root trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) ) (('touch 'attack 'bonk) #f ) (('shadow) (cond - ((-> event param 0) + ((-> block param 0) (let ((v0-1 (the-as object (-> self shadow-backup)))) (set! (-> self draw shadow) (the-as shadow-geo v0-1)) v0-1 @@ -256,7 +248,6 @@ (t9-0) ) ) - (none) ) :code (behavior ((arg0 (state mech))) (ja-channel-set! 0) @@ -282,40 +273,37 @@ ) ) (go arg0) - (none) ) ) ;; failed to figure out what this is: (defstate wait-for-return (mech) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('trans) - (vector+! (the-as vector (-> event param 0)) (-> self root trans) (-> self extra-trans)) - ) - (('shadow) - (cond - ((-> event param 0) - (let ((v0-1 (the-as structure (-> self shadow-backup)))) - (set! (-> self draw shadow) (the-as shadow-geo v0-1)) - v0-1 - ) - ) - (else - (set! (-> self draw shadow) #f) - (the-as structure #f) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trans) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) + ) + (('shadow) + (cond + ((-> block param 0) + (let ((v0-1 (the-as structure (-> self shadow-backup)))) + (set! (-> self draw shadow) (the-as shadow-geo v0-1)) + v0-1 ) + ) + (else + (set! (-> self draw shadow) #f) + (the-as structure #f) + ) + ) + ) + ) ) :code (behavior () (ja-channel-set! 0) (ja-post) (cleanup-for-death self) - (none) ) ) @@ -440,8 +428,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (mech-target) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('look-at-point) (set! (-> self state-time) (current-time)) (go-virtual active) @@ -457,7 +445,6 @@ This commonly includes things such as: ) (go-virtual active) ) - (none) ) :code (behavior () (while (< 0.0 (-> self root scale x)) @@ -469,7 +456,6 @@ This commonly includes things such as: (logior! (-> self draw status) (draw-control-status no-draw)) (ja-post) (sleep-code) - (none) ) ) @@ -479,7 +465,6 @@ This commonly includes things such as: :event (-> (method-of-type mech-target idle) event) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (and (or (or (not *target*) (or (< 106496.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) @@ -492,7 +477,6 @@ This commonly includes things such as: ) (go-virtual idle) ) - (none) ) :code (behavior () (sound-play "mech-target") @@ -514,7 +498,6 @@ This commonly includes things such as: ) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/sidekick_REF.gc b/test/decompiler/reference/jak2/engine/target/sidekick_REF.gc index 4dcb151edc7..ec233ae84b0 100644 --- a/test/decompiler/reference/jak2/engine/target/sidekick_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/sidekick_REF.gc @@ -167,11 +167,11 @@ ;; failed to figure out what this is: (defstate sidekick-clone (sidekick) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('matrix) - (case (-> event param 0) + (case (-> block param 0) (('play-anim) (set! v0-0 (-> self node-list data)) (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) @@ -228,13 +228,13 @@ v0-0 ) (('shadow) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self shadow-in-movie?) (the-as symbol v0-0)) v0-0 ) (('blend-shape) (cond - ((-> event param 0) + ((-> block param 0) (set! v0-0 (logior (-> self skel status) (joint-control-status blend-shape))) (set! (-> self skel status) (the-as joint-control-status v0-0)) ) @@ -458,7 +458,6 @@ ) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-carry_REF.gc b/test/decompiler/reference/jak2/engine/target/target-carry_REF.gc index 51b767e05d9..6015a7195ad 100644 --- a/test/decompiler/reference/jak2/engine/target/target-carry_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-carry_REF.gc @@ -114,12 +114,12 @@ ;; failed to figure out what this is: (defstate target-carry-pickup (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (cond (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 1920) ) @@ -141,12 +141,12 @@ #f ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -159,7 +159,6 @@ (set! (-> self carry max-distance) 12288.0) (set! (-> self carry mode) (carry-mode carry)) (carry-info-method-9 (-> self carry)) - (none) ) :exit (behavior () (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -180,7 +179,6 @@ (target-collide-set! 'normal 0.0) (target-exit) ) - (none) ) :code (behavior () (let ((f30-0 0.0)) @@ -281,13 +279,11 @@ ) ) (go target-stance) - (none) ) :post (behavior () (target-no-stick-post) (carry-info-method-9 (-> self carry)) (target-carry-update) - (none) ) ) @@ -298,7 +294,6 @@ (set! (-> self control mod-surface) *walk-mods*) (set! (-> self state-time) (current-time)) (set-forward-vel 0.0) - (none) ) :code (behavior () (let ((f30-0 1.0)) @@ -413,7 +408,6 @@ (ja-eval) ) (go target-stance) - (none) ) :post (-> target-carry-pickup post) ) @@ -424,13 +418,11 @@ :enter (behavior () (set! (-> self control mod-surface) *carry-walk-mods*) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () ((-> target-carry-pickup exit)) (set! (-> self control bend-target) 0.0) (target-state-hook-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -457,7 +449,6 @@ (go target-carry-throw) ) (fall-test (the-as (state symbol target) target-carry-falling) -4096000.0) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -471,7 +462,6 @@ (ja :num! (loop!)) ) #f - (none) ) :post target-carry-post ) @@ -482,13 +472,11 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self control mod-surface) *carry-walk-mods*) - (none) ) :exit (behavior () ((-> target-carry-pickup exit)) (target-effect-exit) (target-state-hook-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -515,7 +503,6 @@ (go target-carry-throw) ) (fall-test (the-as (state symbol target) target-carry-falling) -4096000.0) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -533,7 +520,6 @@ ) ) #f - (none) ) :post target-carry-post ) @@ -544,7 +530,6 @@ :enter (behavior () (set! (-> self control mod-surface) *carry-jump-mods*) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (logtest? (-> self control status) (collide-status on-surface)) @@ -570,7 +555,6 @@ (go target-carry-hit-ground 'stuck) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -592,7 +576,6 @@ (ja :group! (-> self draw art-group data 27) :num! (loop!)) ) #f - (none) ) :post target-carry-post ) @@ -623,11 +606,9 @@ 600 1500 ) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) - (none) ) :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) @@ -645,12 +626,10 @@ (go target-carry-walk) ) (fall-test (the-as (state symbol target) target-carry-falling) -4096000.0) - (none) ) :code (behavior ((arg0 symbol)) (target-hit-ground-anim #f (are-still?)) (go target-carry-stance) - (none) ) :post target-carry-post ) @@ -670,12 +649,10 @@ (set! (-> self control unknown-float35) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) ) - (none) ) :exit (behavior () ((-> target-carry-pickup exit)) (target-exit) - (none) ) :trans (behavior () (set! (-> self control unknown-float36) @@ -691,7 +668,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) (seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (ja-channel-push! 1 (seconds 0.05)) @@ -718,7 +694,6 @@ (suspend) ) (go target-carry-falling) - (none) ) :post target-carry-post ) @@ -730,7 +705,6 @@ (set! (-> self control mod-surface) *walk-mods*) (set! (-> self state-time) (current-time)) (set-forward-vel 0.0) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -807,7 +781,6 @@ (ja-eval) ) (go target-stance) - (none) ) :post (-> target-carry-pickup post) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc index ce5eac75496..9cc1eb93fbf 100644 --- a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc @@ -257,16 +257,16 @@ ;; failed to figure out what this is: (defstate target-darkjak-get-on (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('darkjak) (when (zero? (-> self darkjak want-stage)) - (set! (-> self darkjak want-stage) (the-as darkjak-stage (-> event param 0))) + (set! (-> self darkjak want-stage) (the-as darkjak-stage (-> block param 0))) #t ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -286,7 +286,6 @@ (the-as handle #f) ) ) - (none) ) :code (behavior ((arg0 darkjak-stage)) (send-event (handle->process (-> self notify)) 'notify 'attack 15) @@ -388,23 +387,22 @@ ) ) (go target-stance) - (none) ) :post (-> target-grab post) ) ;; failed to figure out what this is: (defstate target-darkjak-get-off (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('pole-grab 'darkjak 'slide 'wade 'launch 'edge-grab) #f ) (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('grab) (when (not (focus-test? self dead)) - (if (not (-> event param 1)) + (if (not (-> block param 1)) #t (go target-grab 'stance) ) @@ -413,7 +411,7 @@ ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -440,12 +438,10 @@ ) ) ) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) (target-darkjak-end-mode) - (none) ) :trans (-> target-darkjak-get-on trans) :code (behavior () @@ -592,7 +588,6 @@ (vector-reset! (-> self control transv)) ((-> target-darkjak-get-off exit)) (go target-stance) - (none) ) :post (-> target-grab post) ) @@ -604,7 +599,6 @@ :exit (behavior () (remove-setting! 'rapid-tracking) ((-> target-running-attack exit)) - (none) ) :trans (-> target-running-attack trans) :code (behavior () @@ -978,7 +972,6 @@ (go target-falling #f) ) (go target-stance) - (none) ) :post target-post ) @@ -1040,14 +1033,14 @@ ;; failed to figure out what this is: (defstate target-darkjak-bomb0 (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('pole-grab 'darkjak 'slide 'wade 'launch 'edge-grab 'jump 'shove 'attack 'attack-or-shove) #f ) (('hit) - (let ((v1-1 (the-as object (-> event param 1)))) - (when (and (= (-> event param 0) 'bomb) + (let ((v1-1 (the-as object (-> block param 1)))) + (when (and (= (-> block param 0) 'bomb) (logtest? (process-mask enemy) (-> (the-as process v1-1) mask)) (let ((v1-7 (ja-group))) (and v1-7 (= v1-7 (-> self draw art-group data 418))) @@ -1067,7 +1060,7 @@ #f ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -1079,7 +1072,6 @@ (set! (-> self control unknown-sound-id00) (add-process *gui-control* self (gui-channel jak) (gui-action queue) "darkbom0" -99.0 0) ) - (none) ) :exit (behavior () (set-action! @@ -1106,11 +1098,9 @@ (if (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) ((-> target-darkjak-get-off exit)) ) - (none) ) :trans (behavior () (update-clock! (-> self darkjak) 4) - (none) ) :code (behavior () (local-vars @@ -1444,7 +1434,6 @@ (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) (send-event (handle->process (-> self notify)) 'notify 'attack 16) (go target-darkjak-get-off) - (none) ) :post target-no-stick-post ) @@ -1588,7 +1577,6 @@ ) (slide-down-test) (update-clock! (-> self darkjak) 8) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (local-vars @@ -1901,7 +1889,6 @@ (set! (-> self gun surpress-time) (current-time)) (send-event (handle->process (-> self notify)) 'notify 'attack 17) (go target-darkjak-get-off) - (none) ) :post target-post ) @@ -1917,7 +1904,6 @@ (logclear! (-> self darkjak stage) (darkjak-stage giant)) (set! (-> self darkjak want-stage) (-> self darkjak stage)) ) - (none) ) :code (behavior () (send-event (handle->process (-> self notify)) 'notify 'attack 18) @@ -1987,7 +1973,6 @@ ) (send-event *traffic-manager* 'increase-alert-level 4) (go target-stance) - (none) ) :post (-> target-grab post) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-death_REF.gc b/test/decompiler/reference/jak2/engine/target/target-death_REF.gc index 0afe5a821ce..9ed96d59163 100644 --- a/test/decompiler/reference/jak2/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-death_REF.gc @@ -35,35 +35,35 @@ ;; failed to figure out what this is: (defstate target-continue (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('grab 'look-around) #f ) (else - (set! (-> self mode-cache) (the-as basic (-> event param 0))) - (set! (-> self mode-param1) (if (>= arg1 2) - (process->handle (the-as process (-> event param 1))) + (set! (-> self mode-cache) (the-as basic (-> block param 0))) + (set! (-> self mode-param1) (if (>= argc 2) + (process->handle (the-as process (-> block param 1))) (the-as handle #f) ) ) - (set! (-> self mode-param2) (-> event param 2)) - (set! v0-0 (-> event param 3)) + (set! (-> self mode-param2) (-> block param 2)) + (set! v0-0 (-> block param 3)) (set! (-> self mode-param3) (the-as uint v0-0)) v0-0 ) ) ) (('want-continue) - (set! v0-0 (-> event param 0)) + (set! v0-0 (-> block param 0)) (set! (-> self control unknown-word04) (the-as uint v0-0)) v0-0 ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -92,7 +92,6 @@ (set! (-> self teleport-time) (current-time)) (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) (set! (-> self game kiosk-timeout) (the-as uint (-> *display* game-clock frame-counter))) - (none) ) :code (behavior ((arg0 continue-point)) (local-vars (v1-96 symbol)) @@ -402,7 +401,6 @@ (set! (-> self mode-cache) #f) ) (go target-stance) - (none) ) :post target-no-move-post ) @@ -763,6 +761,7 @@ ) ;; definition for function target-hit-setup-anim +;; WARN: Return type mismatch object vs none. (defbehavior target-hit-setup-anim target ((arg0 attack-info)) (let ((v1-0 (-> arg0 angle))) (cond @@ -955,7 +954,6 @@ ) ((method-of-type focus clear-focused) (the-as focus (-> self gun track-target))) (target-exit) - (none) ) :trans (behavior () (when (= *cheat-mode* 'debug) @@ -965,7 +963,6 @@ (go target-stance) ) ) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (local-vars (sv-32 attack-info) (sv-36 vector)) @@ -1270,7 +1267,6 @@ (go target-death (-> sv-32 mode)) ) (go target-hit-ground #f) - (none) ) :post target-post ) @@ -1517,50 +1513,47 @@ ;; failed to figure out what this is: (defstate target-death (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'end-mode) - (let ((v0-0 (the-as object #t))) - (set! (-> self control unknown-word04) (the-as uint v0-0)) - v0-0 - ) - ) - ((= v1-0 'change-mode) - (case (-> event param 0) - (('grab) - (case (-> event param 1) - (('dead) - #t - ) - (else - #f - ) - ) - ) - ) - ) - ((= v1-0 'notify) - (when (type? proc pov-camera) - (case (-> event param 0) - (('die 'abort-request) - (set! (-> self control unknown-word04) (the-as uint #t)) - (the-as object (set-blackout-frames (seconds 0.2))) - ) - ) - ) - ) - ((= v1-0 'get-pickup) - #f - ) - ((= v1-0 'touched) - #f - ) - (else - (target-generic-event-handler proc arg1 event-type event) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('end-mode) + (let ((v0-0 (the-as object #t))) + (set! (-> self control unknown-word04) (the-as uint v0-0)) + v0-0 + ) + ) + (('change-mode) + (case (-> block param 0) + (('grab) + (case (-> block param 1) + (('dead) + #t + ) + (else + #f ) + ) + ) + ) + ) + (('notify) + (when (type? proc pov-camera) + (case (-> block param 0) + (('die 'abort-request) + (set! (-> self control unknown-word04) (the-as uint #t)) + (set-blackout-frames (seconds 0.2)) + ) + ) + ) + ) + (('get-pickup) + #f + ) + (('touched) + #f + ) + (else + (target-generic-event-handler proc argc message block) + ) ) ) :exit (behavior () @@ -1586,7 +1579,6 @@ (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) (send-event (ppointer->process (-> self gun gun)) 'reset) (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) - (none) ) :trans (-> target-hit trans) :code (behavior ((arg0 symbol)) @@ -2159,7 +2151,6 @@ ) (label cfg-167) (target-death-reset arg0 #f) - (none) ) :post target-no-stick-post ) diff --git a/test/decompiler/reference/jak2/engine/target/target-h_REF.gc b/test/decompiler/reference/jak2/engine/target/target-h_REF.gc index 6c0e80af50a..401283b75c2 100644 --- a/test/decompiler/reference/jak2/engine/target/target-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-h_REF.gc @@ -99,7 +99,7 @@ (target-board-jump meters meters symbol) target-board-jump-kick (target-board-pegasus handle) - (target-board-ride-edge symbol object object float) + (target-board-ride-edge symbol) target-board-stance (target-board-start object) (target-board-trickx float float symbol) diff --git a/test/decompiler/reference/jak2/engine/target/target-handler_REF.gc b/test/decompiler/reference/jak2/engine/target/target-handler_REF.gc index 09e47cbb0db..0c14d9fd807 100644 --- a/test/decompiler/reference/jak2/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-handler_REF.gc @@ -215,7 +215,6 @@ ;; WARN: Stack slot offset 96 signed mismatch ;; WARN: Stack slot offset 96 signed mismatch ;; WARN: Stack slot offset 96 signed mismatch -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 711] (defbehavior target-send-attack target ((arg0 process) (arg1 symbol) (arg2 touching-shapes-entry) (arg3 int) (arg4 int) (arg5 penetrate)) (local-vars (sv-96 symbol) @@ -663,405 +662,399 @@ ;; definition for function target-generic-event-handler ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. (defbehavior target-generic-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) - (the-as - object - (case arg2 - (('get-pickup) - (when (not (focus-test? self dead)) - (let ((s4-0 (-> arg3 param 0)) - (f28-0 (the-as float (-> arg3 param 1))) - ) - (if (!= (pickup-collectable! (-> self fact) (the-as pickup-type s4-0) 0.0 (the-as handle #f)) - (pickup-collectable! (-> self fact) (the-as pickup-type s4-0) f28-0 (process->handle arg0)) - ) - #t - 'full - ) - ) + (case arg2 + (('get-pickup) + (when (not (focus-test? self dead)) + (let ((s4-0 (-> arg3 param 0)) + (f28-0 (the-as float (-> arg3 param 1))) + ) + (if (!= (pickup-collectable! (-> self fact) (the-as pickup-type s4-0) 0.0 (the-as handle #f)) + (pickup-collectable! (-> self fact) (the-as pickup-type s4-0) f28-0 (process->handle arg0)) + ) + #t + 'full + ) ) ) - (('test-pickup) - (let ((a1-6 (-> arg3 param 0))) - (pickup-collectable! (-> self fact) (the-as pickup-type a1-6) 0.0 (the-as handle #f)) - ) + ) + (('test-pickup) + (let ((a1-6 (-> arg3 param 0))) + (pickup-collectable! (-> self fact) (the-as pickup-type a1-6) 0.0 (the-as handle #f)) ) - (('reset-pickup) - (the-as object (reset! (-> self fact) (the-as symbol (-> arg3 param 0)))) + ) + (('reset-pickup) + (reset! (-> self fact) (the-as symbol (-> arg3 param 0))) + ) + (('reset-collide) + (cond + ((-> self control collide-mode) + (target-collide-set! (-> self control collide-mode) (-> self control collide-mode-transition)) + ) + ((-> self control danger-mode) + (target-danger-set! (-> self control danger-mode) #f) + ) ) - (('reset-collide) - (cond - ((-> self control collide-mode) - (target-collide-set! (-> self control collide-mode) (-> self control collide-mode-transition)) - ) - ((-> self control danger-mode) - (the-as object (target-danger-set! (-> self control danger-mode) #f)) - ) + ) + (('level-deactivate) + (when (and (focus-test? self pilot) + (or (= (-> arg3 param 0) 'ctywide) (and (= (-> arg3 param 0) 'lracelit) (-> self pilot as-daxter?))) + ) + (ja-channel-set! 0) + (target-gun-end-mode #t) + (set! (-> self skel top-anim interp) 0.0) + (let ((v1-30 (get-channel (-> self skel top-anim) 0))) + (if v1-30 + (set! (-> v1-30 frame-interp 1) 0.0) + ) ) - ) - (('level-deactivate) - (when (and (focus-test? self pilot) - (or (= (-> arg3 param 0) 'ctywide) (and (= (-> arg3 param 0) 'lracelit) (-> self pilot as-daxter?))) - ) - (ja-channel-set! 0) - (target-gun-end-mode #t) - (set! (-> self skel top-anim interp) 0.0) - (let ((v1-30 (get-channel (-> self skel top-anim) 0))) - (if v1-30 - (set! (-> v1-30 frame-interp 1) 0.0) - ) - ) - (update (-> self skel top-anim)) - (when (not (focus-test? self grabbed)) - (set! (-> self event-hook) #f) - (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) - ) + (update (-> self skel top-anim)) + (when (not (focus-test? self grabbed)) + (set! (-> self event-hook) #f) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) ) - (('level-enter) - (let ((s5-1 (level-get *level* (the-as symbol (-> arg3 param 0))))) - (when s5-1 - (let ((s4-1 (-> s5-1 info))) - (let ((v1-40 (-> s4-1 buzzer))) - (if (nonzero? v1-40) - (set! (-> self fact buzzer) 0.0) - (set! (-> self fact buzzer) - (pickup-collectable! (-> self fact) (pickup-type buzzer) (the float (logior -65536 v1-40)) (the-as handle #f)) - ) - ) - ) - (if (zero? (-> self game task-enter-times (-> s4-1 task-level))) - (set! (-> self game task-enter-times (-> s4-1 task-level)) (-> *display* game-clock frame-counter)) + ) + (('level-enter) + (let ((s5-1 (level-get *level* (the-as symbol (-> arg3 param 0))))) + (when s5-1 + (let ((s4-1 (-> s5-1 info))) + (let ((v1-40 (-> s4-1 buzzer))) + (if (nonzero? v1-40) + (set! (-> self fact buzzer) 0.0) + (set! (-> self fact buzzer) + (pickup-collectable! (-> self fact) (pickup-type buzzer) (the float (logior -65536 v1-40)) (the-as handle #f)) + ) ) ) - (let ((s4-2 (-> *game-info* sub-task-list))) - (dotimes (s3-0 (-> s4-2 length)) - (when (nonzero? s3-0) - (let ((s2-0 (-> s4-2 s3-0))) - (when (and (= (-> s5-1 info taskname) (-> s2-0 level)) - (zero? (-> self game task-close-times (-> s2-0 task))) - (= s3-0 (-> *game-info* play-list (-> s2-0 task) play-node)) - (or (logtest? (-> s2-0 flags) (game-task-node-flag closed)) (open? s2-0)) - (not (task-complete? (-> self game) (-> s2-0 task))) - (not (logtest? (game-task-node-flag utility-node) (-> s2-0 flags))) - ) - (when (zero? (-> self game task-close-times (-> s2-0 task))) - (format #t "--------------> set task start time for ~A~%" (-> s2-0 name)) - (set! (-> self game task-close-times (-> s2-0 task)) (-> *display* game-clock frame-counter)) - ) + (if (zero? (-> self game task-enter-times (-> s4-1 task-level))) + (set! (-> self game task-enter-times (-> s4-1 task-level)) (-> *display* game-clock frame-counter)) + ) + ) + (let ((s4-2 (-> *game-info* sub-task-list))) + (dotimes (s3-0 (-> s4-2 length)) + (when (nonzero? s3-0) + (let ((s2-0 (-> s4-2 s3-0))) + (when (and (= (-> s5-1 info taskname) (-> s2-0 level)) + (zero? (-> self game task-close-times (-> s2-0 task))) + (= s3-0 (-> *game-info* play-list (-> s2-0 task) play-node)) + (or (logtest? (-> s2-0 flags) (game-task-node-flag closed)) (open? s2-0)) + (not (task-complete? (-> self game) (-> s2-0 task))) + (not (logtest? (game-task-node-flag utility-node) (-> s2-0 flags))) + ) + (when (zero? (-> self game task-close-times (-> s2-0 task))) + (format #t "--------------> set task start time for ~A~%" (-> s2-0 name)) + (set! (-> self game task-close-times (-> s2-0 task)) (-> *display* game-clock frame-counter)) ) ) ) ) ) - (update-task-masks 'level) - (format #t "GAMEPLAY: enter ~A~%" (-> arg3 param 0)) ) + (update-task-masks 'level) + (format #t "GAMEPLAY: enter ~A~%" (-> arg3 param 0)) ) ) - (('get-attack-count) - (set! v0-0 (+ (-> self control attack-count) (-> arg3 param 0))) - (set! (-> self control attack-count) (the-as uint v0-0)) - v0-0 + ) + (('get-attack-count) + (set! v0-0 (+ (-> self control attack-count) (-> arg3 param 0))) + (set! (-> self control attack-count) (the-as uint v0-0)) + v0-0 + ) + (('continue) + (logior! (-> self focus-status) (focus-status teleporting)) + (go target-continue (the-as continue-point (-> arg3 param 0))) + ) + (('query) + (case (-> arg3 param 0) + (('powerup) + (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) (-> arg3 param 1)) + (< 0.0 (-> (the-as fact-info-target (-> self fact)) eco-level)) + ) + ) + (('pickup) + (pickup-collectable! (-> self fact) (the-as pickup-type (-> arg3 param 1)) 0.0 (the-as handle #f)) + ) + (('ground-height) + (target-height-above-ground) + ) + (('gun-type) + (-> self gun gun-type) + ) ) - (('continue) - (logior! (-> self focus-status) (focus-status teleporting)) - (go target-continue (the-as continue-point (-> arg3 param 0))) + ) + (('release) + (when (and (nonzero? (-> self gun)) (handle->process (-> self gun charge-active?))) + (set! (-> self gun charge-active?) (the-as handle #f)) + (set! v0-0 (current-time)) + (set! (-> self gun fire-time) (the-as time-frame v0-0)) + v0-0 ) - (('query) - (case (-> arg3 param 0) - (('powerup) - (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) (-> arg3 param 1)) - (< 0.0 (-> (the-as fact-info-target (-> self fact)) eco-level)) - ) - ) - (('pickup) - (pickup-collectable! (-> self fact) (the-as pickup-type (-> arg3 param 1)) 0.0 (the-as handle #f)) - ) - (('ground-height) - (target-height-above-ground) - ) - (('gun-type) - (-> self gun gun-type) + ) + (('trans) + (case (-> arg3 param 0) + (('save) + (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (logior! (-> self state-flags) (state-flags sf12)) + (mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48) + ) + (('restore) + (logclear! (-> self state-flags) (state-flags sf12)) + (let ((gp-1 (-> arg3 param 1))) + (move-to-point! (-> self control) (the-as vector (+ gp-1 0))) + (quaternion-copy! (-> self control quat) (the-as quaternion (+ gp-1 16))) ) - ) + (rot->dir-targ! (-> self control)) + (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! v0-0 (current-time)) + (set! (-> self control last-time-on-surface) (the-as time-frame v0-0)) + v0-0 + ) + (('reset) + (set! v0-0 (logclear (-> self state-flags) (state-flags sf12))) + (set! (-> self state-flags) (the-as state-flags v0-0)) + v0-0 + ) ) - (('release) - (when (and (nonzero? (-> self gun)) (handle->process (-> self gun charge-active?))) - (set! (-> self gun charge-active?) (the-as handle #f)) - (set! v0-0 (current-time)) - (set! (-> self gun fire-time) (the-as time-frame v0-0)) - v0-0 + ) + (('effect) + (target-powerup-effect (the-as symbol (-> arg3 param 0))) + ) + (('color-effect) + (set! (-> self color-effect) (the-as basic (-> arg3 param 0))) + (set! (-> self color-effect-start-time) (current-time)) + (set! v0-0 (-> arg3 param 1)) + (set! (-> self color-effect-duration) (the-as uint v0-0)) + v0-0 + ) + (('do-effect) + (do-effect (-> self skel effect) (the-as symbol (-> arg3 param 0)) (the-as float (-> arg3 param 1)) -1) + (if (-> self sidekick) + (do-effect + (-> self sidekick 0 skel effect) + (the-as symbol (-> arg3 param 0)) + (the-as float (-> arg3 param 1)) + -1 + ) ) - ) - (('trans) + ) + (('effect-control) + (when (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (case (-> arg3 param 0) - (('save) - (set! (-> self alt-cam-pos quad) (-> self control trans quad)) - (logior! (-> self state-flags) (state-flags sf12)) - (mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48) - ) - (('restore) - (logclear! (-> self state-flags) (state-flags sf12)) - (let ((gp-1 (-> arg3 param 1))) - (move-to-point! (-> self control) (the-as vector (+ gp-1 0))) - (quaternion-copy! (-> self control quat) (the-as quaternion (+ gp-1 16))) - ) - (rot->dir-targ! (-> self control)) - (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) - (set! v0-0 (current-time)) - (set! (-> self control last-time-on-surface) (the-as time-frame v0-0)) - v0-0 - ) - (('reset) - (set! v0-0 (logclear (-> self state-flags) (state-flags sf12))) - (set! (-> self state-flags) (the-as state-flags v0-0)) - v0-0 + (('effect-walk-step-left 'effect-walk-step-right 'effect-run-step-left 'effect-run-step-right) + (activate! *camera-smush-control* 409.6 15 75 1.0 0.98 (-> *display* camera-clock)) ) ) ) - (('effect) - (the-as object (target-powerup-effect (the-as symbol (-> arg3 param 0)))) - ) - (('color-effect) - (set! (-> self color-effect) (the-as basic (-> arg3 param 0))) - (set! (-> self color-effect-start-time) (current-time)) - (set! v0-0 (-> arg3 param 1)) - (set! (-> self color-effect-duration) (the-as uint v0-0)) - v0-0 - ) - (('do-effect) - (do-effect (-> self skel effect) (the-as symbol (-> arg3 param 0)) (the-as float (-> arg3 param 1)) -1) - (if (-> self sidekick) - (the-as object (do-effect - (-> self sidekick 0 skel effect) - (the-as symbol (-> arg3 param 0)) - (the-as float (-> arg3 param 1)) - -1 - ) - ) - ) - ) - (('effect-control) - (when (and (focus-test? self dark) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) (darkjak-stage giant)) - ) - (case (-> arg3 param 0) - (('effect-walk-step-left 'effect-walk-step-right 'effect-run-step-left 'effect-run-step-right) - (activate! *camera-smush-control* 409.6 15 75 1.0 0.98 (-> *display* camera-clock)) - ) - ) - ) - ) - (('neck) - (set! (-> self neck flex-blend) (the-as float (-> arg3 param 0))) - (cond - ((-> arg3 param 1) - (logior! (-> self state-flags) (state-flags sf13)) - (set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) - (the-as object (look-at! (-> self neck) (-> self alt-neck-pos) 'force arg0)) - ) - (else - (set! v0-0 (logclear (-> self state-flags) (state-flags sf13))) - (set! (-> self state-flags) (the-as state-flags v0-0)) - v0-0 - ) + ) + (('neck) + (set! (-> self neck flex-blend) (the-as float (-> arg3 param 0))) + (cond + ((-> arg3 param 1) + (logior! (-> self state-flags) (state-flags sf13)) + (set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (look-at! (-> self neck) (-> self alt-neck-pos) 'force arg0) + ) + (else + (set! v0-0 (logclear (-> self state-flags) (state-flags sf13))) + (set! (-> self state-flags) (the-as state-flags v0-0)) + v0-0 ) ) - (('sidekick) - (cond - ((and (-> arg3 param 0) (not (-> self sidekick))) - (let ((gp-2 (get-process *default-dead-pool* sidekick #x4000))) - (set! v0-0 - (when gp-2 - (let ((t9-31 (method-of-type sidekick activate))) - (t9-31 (the-as sidekick gp-2) self (symbol->string (-> sidekick symbol)) (the-as pointer #x70004000)) - ) - (run-now-in-process gp-2 init-sidekick) - (-> gp-2 ppointer) + ) + (('sidekick) + (cond + ((and (-> arg3 param 0) (not (-> self sidekick))) + (let ((gp-2 (get-process *default-dead-pool* sidekick #x4000))) + (set! v0-0 + (when gp-2 + (let ((t9-31 (method-of-type sidekick activate))) + (t9-31 (the-as sidekick gp-2) self (symbol->string (-> sidekick symbol)) (the-as pointer #x70004000)) ) + (run-now-in-process gp-2 init-sidekick) + (-> gp-2 ppointer) ) - ) - (set! (-> self sidekick) (the-as (pointer sidekick) v0-0)) - v0-0 - ) - ((and (not (-> arg3 param 0)) (-> self sidekick)) - (deactivate (-> self sidekick 0)) - (set! (-> self sidekick) (the-as (pointer sidekick) #f)) - #f + ) ) - ) + (set! (-> self sidekick) (the-as (pointer sidekick) v0-0)) + v0-0 + ) + ((and (not (-> arg3 param 0)) (-> self sidekick)) + (deactivate (-> self sidekick 0)) + (set! (-> self sidekick) (the-as (pointer sidekick) #f)) + #f + ) ) - (('blend-shape) - (if (-> arg3 param 0) - (logior! (-> self skel status) (joint-control-status blend-shape)) - (logclear! (-> self skel status) (joint-control-status blend-shape)) - ) - (let ((v1-175 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-175 from) (process->ppointer arg0)) - (set! (-> v1-175 num-params) arg1) - (set! (-> v1-175 message) arg2) - (set! (-> v1-175 param 0) (-> arg3 param 0)) - (set! (-> v1-175 param 1) (-> arg3 param 1)) - (set! (-> v1-175 param 2) (-> arg3 param 2)) - (set! (-> v1-175 param 3) (-> arg3 param 3)) - (set! (-> v1-175 param 4) (-> arg3 param 4)) - (set! (-> v1-175 param 5) (-> arg3 param 5)) - (send-event-function (ppointer->process (-> self sidekick)) v1-175) + ) + (('blend-shape) + (if (-> arg3 param 0) + (logior! (-> self skel status) (joint-control-status blend-shape)) + (logclear! (-> self skel status) (joint-control-status blend-shape)) ) + (let ((v1-175 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-175 from) (process->ppointer arg0)) + (set! (-> v1-175 num-params) arg1) + (set! (-> v1-175 message) arg2) + (set! (-> v1-175 param 0) (-> arg3 param 0)) + (set! (-> v1-175 param 1) (-> arg3 param 1)) + (set! (-> v1-175 param 2) (-> arg3 param 2)) + (set! (-> v1-175 param 3) (-> arg3 param 3)) + (set! (-> v1-175 param 4) (-> arg3 param 4)) + (set! (-> v1-175 param 5) (-> arg3 param 5)) + (send-event-function (ppointer->process (-> self sidekick)) v1-175) ) - (('shadow) - (cond - ((-> arg3 param 0) - (let ((v1-178 (-> self draw shadow-ctrl))) - (logclear! (-> v1-178 settings flags) (shadow-flags disable-draw)) - ) - 0 + ) + (('shadow) + (cond + ((-> arg3 param 0) + (let ((v1-178 (-> self draw shadow-ctrl))) + (logclear! (-> v1-178 settings flags) (shadow-flags disable-draw)) ) - (else - (let ((v1-180 (-> self draw shadow-ctrl))) - (logior! (-> v1-180 settings flags) (shadow-flags disable-draw)) - ) - 0 + 0 + ) + (else + (let ((v1-180 (-> self draw shadow-ctrl))) + (logior! (-> v1-180 settings flags) (shadow-flags disable-draw)) ) + 0 ) ) - (('rotate-y-angle) - (quaternion-rotate-y! - (-> self control quat-for-control) - (-> self control quat-for-control) - (the-as float (-> arg3 param 0)) - ) - (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (rot->dir-targ! (-> self control)) - ) + ) + (('rotate-y-angle) + (quaternion-rotate-y! + (-> self control quat-for-control) + (-> self control quat-for-control) + (the-as float (-> arg3 param 0)) ) - (('touched) - (cond - ((< 0.0 (-> (the-as fact-info-target (-> self fact)) shield-level)) - (let ((s4-3 (-> self control penetrate-using))) - (set! (-> self control penetrate-using) (penetrate touch shield)) - (let* ((v1-193 (-> self game)) - (a0-161 (+ (-> v1-193 attack-id) 1)) - ) - (set! (-> v1-193 attack-id) a0-161) - (set! (-> self fact shield-attack-id) a0-161) - ) - (set! v0-0 (target-send-attack - arg0 - 'shield - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as int (-> (the-as fact-info-target (-> self fact)) shield-attack-id)) - 0 - (-> self control penetrate-using) - ) - ) - (set! (-> self control penetrate-using) s4-3) + (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (rot->dir-targ! (-> self control)) + ) + ) + (('touched) + (cond + ((< 0.0 (-> (the-as fact-info-target (-> self fact)) shield-level)) + (let ((s4-3 (-> self control penetrate-using))) + (set! (-> self control penetrate-using) (penetrate touch shield)) + (let* ((v1-193 (-> self game)) + (a0-161 (+ (-> v1-193 attack-id) 1)) + ) + (set! (-> v1-193 attack-id) a0-161) + (set! (-> self fact shield-attack-id) a0-161) ) - v0-0 + (set! v0-0 (target-send-attack + arg0 + 'shield + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> (the-as fact-info-target (-> self fact)) shield-attack-id)) + 0 + (-> self control penetrate-using) + ) + ) + (set! (-> self control penetrate-using) s4-3) ) - ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) - (or (and (focus-test? self dark) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) (darkjak-stage invinc)) - ) - (logtest? (process-mask crate) (-> arg0 mask)) - ) - ) - (target-send-attack - arg0 - 'darkjak - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as int (-> self darkjak attack-id)) - 0 - (penetrate touch dark-skin) - ) + v0-0 + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (or (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage invinc)) + ) + (logtest? (process-mask crate) (-> arg0 mask)) + ) + ) + (target-send-attack + arg0 + 'darkjak + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self darkjak attack-id)) + 0 + (penetrate touch dark-skin) ) - (else - (send-event arg0 'touch (-> arg3 param 0)) - ) + ) + (else + (send-event arg0 'touch (-> arg3 param 0)) ) ) - (('dry) - (set! (-> self water drip-wetness) 0.0) - ) - (('reset-height) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) - #f - ) - (('draw) - (if (-> arg3 param 0) - (logclear! (-> self draw status) (draw-control-status no-draw)) - (logior! (-> self draw status) (draw-control-status no-draw)) - ) - (let ((v1-223 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-223 from) (process->ppointer arg0)) - (set! (-> v1-223 num-params) arg1) - (set! (-> v1-223 message) arg2) - (set! (-> v1-223 param 0) (-> arg3 param 0)) - (set! (-> v1-223 param 1) (-> arg3 param 1)) - (set! (-> v1-223 param 2) (-> arg3 param 2)) - (set! (-> v1-223 param 3) (-> arg3 param 3)) - (set! (-> v1-223 param 4) (-> arg3 param 4)) - (set! (-> v1-223 param 5) (-> arg3 param 5)) - (send-event-function (ppointer->process (-> self manipy)) v1-223) + ) + (('dry) + (set! (-> self water drip-wetness) 0.0) + ) + (('reset-height) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + #f + ) + (('draw) + (if (-> arg3 param 0) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (logior! (-> self draw status) (draw-control-status no-draw)) ) + (let ((v1-223 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-223 from) (process->ppointer arg0)) + (set! (-> v1-223 num-params) arg1) + (set! (-> v1-223 message) arg2) + (set! (-> v1-223 param 0) (-> arg3 param 0)) + (set! (-> v1-223 param 1) (-> arg3 param 1)) + (set! (-> v1-223 param 2) (-> arg3 param 2)) + (set! (-> v1-223 param 3) (-> arg3 param 3)) + (set! (-> v1-223 param 4) (-> arg3 param 4)) + (set! (-> v1-223 param 5) (-> arg3 param 5)) + (send-event-function (ppointer->process (-> self manipy)) v1-223) ) - (('no-load-wait) - (set! v0-0 (+ (current-time) (the-as time-frame (-> arg3 param 0)))) - (set! (-> self no-load-wait) (the-as uint v0-0)) - v0-0 - ) - (('no-look-around) - (set! (-> self no-look-around-wait) (the-as uint (+ (current-time) (the-as time-frame (-> arg3 param 0))))) - (if (and (-> self next-state) (= (-> self next-state name) 'target-look-around)) - (send-event self 'end-mode) - ) - ) - (('change-state) - (go - (the-as (state object object object object target) (-> arg3 param 0)) - (-> arg3 param 1) - (-> arg3 param 2) - (-> arg3 param 3) - (-> arg3 param 4) + ) + (('no-load-wait) + (set! v0-0 (+ (current-time) (the-as time-frame (-> arg3 param 0)))) + (set! (-> self no-load-wait) (the-as uint v0-0)) + v0-0 + ) + (('no-look-around) + (set! (-> self no-look-around-wait) (the-as uint (+ (current-time) (the-as time-frame (-> arg3 param 0))))) + (if (and (-> self next-state) (= (-> self next-state name) 'target-look-around)) + (send-event self 'end-mode) ) + ) + (('change-state) + (go + (the-as (state object object object object target) (-> arg3 param 0)) + (-> arg3 param 1) + (-> arg3 param 2) + (-> arg3 param 3) + (-> arg3 param 4) ) - (('tobot) - (set! v0-0 (-> arg3 param 0)) - (set! (-> self tobot?) (the-as symbol v0-0)) - v0-0 - ) - (('carry-info) - (-> self carry) - ) - (('gun-type) - (cond - ((-> arg3 param 0) - (the-as object (target-gun-type-set! (the-as int (-> arg3 param 0)))) - ) - (else - (set! v0-0 #t) - (set! (-> self gun put-away?) (the-as symbol v0-0)) - v0-0 - ) + ) + (('tobot) + (set! v0-0 (-> arg3 param 0)) + (set! (-> self tobot?) (the-as symbol v0-0)) + v0-0 + ) + (('carry-info) + (-> self carry) + ) + (('gun-type) + (cond + ((-> arg3 param 0) + (target-gun-type-set! (the-as int (-> arg3 param 0))) + ) + (else + (set! v0-0 #t) + (set! (-> self gun put-away?) (the-as symbol v0-0)) + v0-0 ) ) - (('get-notify) - (set! v0-0 (process->handle (the-as process (-> arg3 param 0)))) - (set! (-> self notify) (the-as handle v0-0)) - v0-0 - ) - ) + ) + (('get-notify) + (set! v0-0 (process->handle (the-as process (-> arg3 param 0)))) + (set! (-> self notify) (the-as handle v0-0)) + v0-0 + ) ) ) ;; definition for function target-standard-event-handler ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. (defbehavior target-standard-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (at-0 int) (s3-0 type)) (rlet ((vf0 :class vf) @@ -1244,7 +1237,7 @@ ) ((= v1-45 'gun) (if (logtest? (-> self game features) (game-feature gun)) - (the-as object (target-gun-init (the-as int (-> arg3 param 2)))) + (target-gun-init (the-as int (-> arg3 param 2))) ) ) ((= v1-45 'tube) @@ -1310,7 +1303,7 @@ (b! #t cfg-291 :delay (nop!)) (label cfg-212) (b! (!= v1-0 'gun) cfg-214 :delay (nop!)) - (set! v0-0 (the-as object (target-gun-fire (the-as pickup-type (-> arg3 param 0))))) + (set! v0-0 (target-gun-fire (the-as pickup-type (-> arg3 param 0)))) (b! #t cfg-291 :delay (nop!)) (label cfg-214) (b! (!= v1-0 'darkjak) cfg-225 :delay (nop!)) @@ -1397,7 +1390,7 @@ (label cfg-290) (set! v0-0 (target-generic-event-handler arg0 arg1 arg2 arg3)) (label cfg-291) - (the-as object v0-0) + v0-0 ) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-part_REF.gc b/test/decompiler/reference/jak2/engine/target/target-part_REF.gc index 0dd55a9f7cd..5003f68597f 100644 --- a/test/decompiler/reference/jak2/engine/target/target-part_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-part_REF.gc @@ -2705,7 +2705,7 @@ ) ) ) - (the-as object 0) + 0 ) ;; definition for function process-drawable-shock-wall-effect diff --git a/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc b/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc index 89f457533f1..47291bf9d5a 100644 --- a/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc @@ -8,7 +8,6 @@ (set! (-> self state-time) (current-time)) (set! (-> self control mod-surface) *wade-mods*) (set-zero! (-> self water bob)) - (none) ) :exit (behavior () (target-state-hook-exit) @@ -17,7 +16,6 @@ (set! (-> v1-1 channel-offset) 0) ) 0 - (none) ) :trans (behavior () ((-> self state-hook)) @@ -60,7 +58,6 @@ ) (go target-gun-stance) ) - (none) ) :code (-> target-stance code) :post target-post @@ -71,7 +68,6 @@ :event target-standard-event-handler :enter (behavior () ((-> target-wade-stance enter)) - (none) ) :exit (-> target-wade-stance exit) :trans (behavior () @@ -109,7 +105,6 @@ (if (and (cpad-pressed? (-> self control cpad number) square) (can-hands? #t)) (go target-running-attack) ) - (none) ) :code (behavior () (let ((gp-0 105) @@ -332,7 +327,6 @@ ) ) #f - (none) ) :post target-post ) @@ -377,7 +371,6 @@ (set! (-> self control mod-surface) *swim-mods*) (logior! (-> self water flags) (water-flags swim-ground)) (logior! (-> self state-flags) (state-flags lleg-no-ik rleg-no-ik)) - (none) ) :exit (behavior () (target-state-hook-exit) @@ -410,7 +403,6 @@ (-> v1-15 id) ) ) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -465,7 +457,6 @@ ) (target-swim-tilt 0.0 2.0 0.0 1.0) (sound-play "swim-bubbles" :id (-> self control board-jump-and-swim-sound)) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -519,7 +510,6 @@ ) ) #f - (none) ) :post target-swim-post ) @@ -532,7 +522,6 @@ (die-on-next-update! (-> self water bob)) (set! (-> self control unknown-word04) (the-as uint (current-time))) (logior! (-> self state-flags) (state-flags lleg-no-ik rleg-no-ik)) - (none) ) :exit (-> target-swim-stance exit) :trans (behavior () @@ -587,7 +576,6 @@ ) (target-swim-tilt 0.0 2.0 0.0 1.0) (sound-play "swim-bubbles" :id (-> self control board-jump-and-swim-sound)) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -640,18 +628,17 @@ ) ) #f - (none) ) :post target-swim-post ) ;; failed to figure out what this is: (defstate target-swim-down (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (t0-7 symbol)) - (case event-type + (case message (('attack 'attack-invinc 'attack-or-shove) - (let ((v1-1 (the-as attack-info (-> event param 1)))) + (let ((v1-1 (the-as attack-info (-> block param 1)))) (set! t0-7 (or (not (logtest? (-> v1-1 mask) (attack-mask mode))) (case (-> v1-1 mode) (('bot 'lava 'melt 'dark-eco-pool) @@ -688,7 +675,7 @@ (('slide) ) ) - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) :enter (behavior () (set! (-> self state-time) (current-time)) @@ -700,7 +687,6 @@ (set! (-> self water swim-time) (current-time)) (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self neck flex-blend) 0.0) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) @@ -734,7 +720,6 @@ ) ) (set! (-> self neck flex-blend) 1.0) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self water swim-time)) (seconds 0.5)) @@ -757,7 +742,6 @@ ) ) ) - (none) ) :code (behavior () (let ((gp-0 60) @@ -867,7 +851,6 @@ ) ) #f - (none) ) :post target-swim-post ) @@ -877,7 +860,6 @@ :event (-> target-swim-down event) :enter (behavior () ((-> target-swim-down enter)) - (none) ) :exit (-> target-swim-down exit) :trans (behavior () @@ -909,7 +891,6 @@ ) (sound-play "water-bubbles" :id (-> self control bubbles-sound)) ((-> target-swim-down trans)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -993,7 +974,6 @@ (start-bobbing! (-> self water) -4096.0 600 1500) (set! (-> self water bob start-time) (+ (current-time) (seconds -0.05))) (go target-swim-stance) - (none) ) :post target-swim-post ) @@ -1014,7 +994,6 @@ ) ) ((-> target-jump trans)) - (none) ) :code (-> target-jump code) :post target-post @@ -1029,7 +1008,6 @@ (die-on-next-update! (-> self water bob)) (set! (-> self water align-offset) 0.0) (logior! (-> self water flags) (water-flags jump-out)) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (die-on-next-update! (-> self water bob)) @@ -1064,7 +1042,6 @@ ) (go target-swim-jump-jump (+ f0-7 arg0) (+ f0-7 arg1) (the-as surface #f)) ) - (none) ) :post target-swim-post ) diff --git a/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc b/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc index a855e3444b6..3e8c1227f2d 100644 --- a/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc @@ -528,18 +528,18 @@ ;; failed to figure out what this is: (defstate target-tube-start (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) 'tube ) (else - (case event-type + (case message (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('grab) (when (not (focus-test? self dead)) - (if (-> event param 1) + (if (-> block param 1) (logior! (-> self focus-status) (focus-status grabbed)) ) #t @@ -564,20 +564,20 @@ ) ) (('touched) - (send-event proc 'attack (-> event param 0) 'tube 0 0) + (send-event proc 'attack (-> block param 0) 'tube 0 0) #f ) (('attack 'attack-or-shove 'attack-invinc) (target-attacked 'attack-or-shove - (the-as attack-info (-> event param 1)) + (the-as attack-info (-> block param 1)) proc - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) target-tube-hit ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -607,7 +607,6 @@ (send-event (handle->process (-> self tube tube)) 'end-mode) (target-exit) ) - (none) ) :code (behavior ((arg0 handle)) (set-setting! 'slave-options 'set 0.0 (cam-slave-options BIKE_MODE)) @@ -658,7 +657,6 @@ (go target-tube) ) ) - (none) ) :post target-post ) @@ -729,7 +727,6 @@ :enter (behavior () (set! (-> self control mod-surface) *tube-mods*) (set! (-> self control surf) *tube-surface*) - (none) ) :exit (-> target-tube-start exit) :trans (behavior () @@ -744,7 +741,6 @@ ) (go target-tube-jump (-> *TARGET-bank* tube-jump-height-min) (-> *TARGET-bank* tube-jump-height-max)) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -772,11 +768,9 @@ (suspend) ) #f - (none) ) :post (behavior () (target-tube-post) - (none) ) ) @@ -788,7 +782,6 @@ (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *tube-jump-mods*) - (none) ) :exit (-> target-tube-start exit) :trans (behavior () @@ -801,7 +794,6 @@ (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control ctrl-xz-vel))))) (seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (ja-channel-push! 1 (seconds 0.05)) @@ -834,7 +826,6 @@ (ja :group! (-> self draw art-group data 27) :num! (loop!)) ) #f - (none) ) :post (-> target-tube post) ) @@ -851,7 +842,6 @@ (-> self tube sidetube) (-> self tube foretube) ) - (none) ) :exit (behavior () (if (not (and (-> self next-state) (= (-> self next-state name) 'target-tube-death))) @@ -860,7 +850,6 @@ (logclear! (-> self focus-status) (focus-status grabbed in-head)) (logclear! (-> self state-flags) (state-flags sf1 sf5)) ((-> target-tube-start exit)) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (let ((gp-0 (-> self attack-info))) @@ -961,7 +950,6 @@ ) ) (go target-tube) - (none) ) :post target-post ) @@ -975,7 +963,6 @@ (remove-setting! 'process-mask) (apply-settings *setting-control*) ((-> target-tube-start exit)) - (none) ) :code (behavior ((arg0 symbol)) (local-vars (v1-42 symbol)) @@ -1006,7 +993,6 @@ (set! v1-42 (and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (movie?)))) ) (go target-tube) - (none) ) :post target-no-stick-post ) @@ -1105,7 +1091,6 @@ (get-point-in-path! (-> self path) (-> self root trans) 0.2 'interp) (displacement-between-two-points-normalized! (-> self path) (-> self rot) 0.2) (set! (-> self pos) 0.2) - (none) ) :trans (behavior () (if (and (and *target* @@ -1126,7 +1111,6 @@ ) (go-virtual slide-control-ride) ) - (none) ) :code (the-as (function none :behavior slide-control) sleep-code) ) @@ -1134,8 +1118,8 @@ ;; failed to figure out what this is: (defstate slide-control-ride (slide-control) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (go-virtual slide-control-watch) ) @@ -1149,10 +1133,10 @@ (if gp-0 (find-target-point (-> (the-as process-drawable gp-0) root trans)) ) - (set! (-> (the-as vector (-> event param 0)) quad) (-> self trans quad)) - (set! (-> (the-as vector (-> event param 1)) quad) (-> self rot quad)) - (set! (-> (the-as vector (-> event param 2)) quad) (-> self side quad)) - (get-point-in-path! (-> self path) (the-as vector (-> event param 3)) (+ 0.2 (-> self pos)) 'interp) + (set! (-> (the-as vector (-> block param 0)) quad) (-> self trans quad)) + (set! (-> (the-as vector (-> block param 1)) quad) (-> self rot quad)) + (set! (-> (the-as vector (-> block param 2)) quad) (-> self side quad)) + (get-point-in-path! (-> self path) (the-as vector (-> block param 3)) (+ 0.2 (-> self pos)) 'interp) (if (>= (-> self pos) (+ -0.2 (get-num-segments (-> self path)))) (send-event gp-0 'end-mode) ) @@ -1165,12 +1149,10 @@ (set! (-> self pos) 0.0) (set! (-> self target) (process->handle *target*)) (process-entity-status! self (entity-perm-status no-kill) #t) - (none) ) :exit (behavior () (set! (-> self target) (the-as handle #f)) (process-entity-status! self (entity-perm-status no-kill) #f) - (none) ) :trans (behavior () (let ((gp-0 (handle->process (-> self target)))) @@ -1184,7 +1166,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior slide-control) sleep-code) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc index 2f778fb89b1..fcd1c7f396d 100644 --- a/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc @@ -215,8 +215,8 @@ ;; failed to figure out what this is: (defstate impact (turret-shot) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (let* ((toucher-proc proc) (toucher (if (type? toucher-proc process-drawable) @@ -229,14 +229,14 @@ (send-event proc 'attack - (-> event param 0) + (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode) (damage (-> self damage)))) ) ) ) ) (else - (projectile-event-handler proc arg1 event-type event) + (projectile-event-handler proc argc message block) ) ) ) @@ -252,7 +252,6 @@ ) (suspend) (go-virtual die) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc b/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc index 47e9395a0ba..de63738a4cc 100644 --- a/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc @@ -1073,8 +1073,8 @@ ;; failed to figure out what this is: (defstate idle (base-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'bonk) (send-event proc 'target-turret-get-off 90) (send-event @@ -1087,14 +1087,14 @@ ) (('touch) (send-event proc 'target-turret-get-off 90) - (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> event param 0)) 0.7 6144.0 16384.0) + (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) #f ) (('exit) #t ) (else - (turret-handler proc arg1 event-type event) + (turret-handler proc argc message block) ) ) ) @@ -1102,7 +1102,6 @@ (set-zero! (-> self smush-control)) (base-turret-method-43 self) (set! (-> self focus-status) (focus-status disable ignore inactive)) - (none) ) :code (behavior () (ja-channel-set! 1) @@ -1181,7 +1180,6 @@ ) ) #f - (none) ) :post (behavior () (cond @@ -1206,26 +1204,24 @@ ) ) (transform-post) - (none) ) ) ;; failed to figure out what this is: (defstate setup (base-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode) (go-virtual active) ) (else - (turret-handler proc arg1 event-type event) + (turret-handler proc argc message block) ) ) ) :enter (behavior () (set-setting! 'mode-name 'cam-turret 0.0 0) - (none) ) :code (the-as (function none :behavior base-turret) sleep-code) :post (the-as (function none :behavior base-turret) transform-post) @@ -1242,110 +1238,107 @@ ;; failed to figure out what this is: (defstate active (base-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'draw) - (cond - ((-> event param 0) - (ja-channel-set! 1) - (ja :group! (-> self draw art-group data 2)) - (transform-post) - ) - (else - (ja-channel-set! 0) - (transform-post) - ) - ) - ) - ((= v1-0 'fire-down) - (cond - ((>= (-> self heat) 1.0) - (let ((v1-8 (- (current-time) (-> self fire-time))) - (a0-7 6) - (a1-1 (-> self fire-time-interval)) - ) - (when (>= v1-8 (* a0-7 a1-1)) - (set! (-> self fire-time) (current-time)) - (the-as object (base-turret-method-45 self a1-1 event-type)) - ) - ) - ) - (else - (when (>= (- (current-time) (-> self fire-time)) (-> self fire-time-interval)) - (set! (-> self fire-time) (current-time)) - (the-as object (base-turret-method-45 self arg1 event-type)) - ) - ) - ) - ) - ((= v1-0 'fire-pressed) - (set! (-> self fire-time) (current-time)) - (the-as object (base-turret-method-45 self arg1 event-type)) - ) - ((= v1-0 'bonk) - #f - ) - ((or (= v1-0 'touch) (= v1-0 'attack)) - (let* ((gp-0 (-> event param 0)) - (s5-0 (the-as object (-> event param 1))) - (s4-0 proc) - (v1-21 (if (type? s4-0 projectile) - s4-0 - ) - ) - ) - (when (and gp-0 v1-21) - (case (-> (the-as attack-info s5-0) mode) - (('wasp-shot 'guard-shot) - (seek! (-> self health) 0.0 0.25) - (activate! (-> self smush-control) 0.2 15 75 1.0 0.9 (-> *display* entity-clock)) - (sound-play "turret-take-hit") - (let ((v0-1 (the-as object (+ (current-time) (seconds 0.08))))) - (set! (-> self red-filter-timer) (the-as time-frame v0-1)) - v0-1 - ) - ) - (('drill-ship-shot) - (seek! (-> self health) 0.0 0.5) - (activate! (-> self smush-control) 0.2 24 144 1.0 0.9 (-> *display* entity-clock)) - (sound-play "turret-take-hit") - ) - ) - ) - ) - ) - ((= v1-0 'test) - (set! (-> self health) (seek (-> self health) 0.0 (the-as float (-> event param 0)))) - ) - ((= v1-0 'exit-valid) - (let ((v1-33 (-> self path-mode))) - (cond - ((or (zero? v1-33) (= v1-33 5) (= v1-33 1)) - (base-turret-method-41 self (the-as vector (-> event param 0))) - #t - ) - (else - #f - ) - ) - ) - ) - ((= v1-0 'exit) - (let ((v1-37 (-> self path-mode))) - (when (if (or (zero? v1-37) (= v1-37 5) (= v1-37 1)) - #t - ) - (go-virtual shutdown) - #f - ) - ) - ) - (else - (turret-handler proc arg1 event-type event) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('draw) + (cond + ((-> block param 0) + (ja-channel-set! 1) + (ja :group! (-> self draw art-group data 2)) + (transform-post) + ) + (else + (ja-channel-set! 0) + (transform-post) + ) + ) + ) + (('fire-down) + (cond + ((>= (-> self heat) 1.0) + (let ((v1-8 (- (current-time) (-> self fire-time))) + (a0-7 6) + (a1-1 (-> self fire-time-interval)) + ) + (when (>= v1-8 (* a0-7 a1-1)) + (set! (-> self fire-time) (current-time)) + (base-turret-method-45 self a1-1 message) + ) + ) + ) + (else + (when (>= (- (current-time) (-> self fire-time)) (-> self fire-time-interval)) + (set! (-> self fire-time) (current-time)) + (base-turret-method-45 self argc message) + ) + ) + ) + ) + (('fire-pressed) + (set! (-> self fire-time) (current-time)) + (base-turret-method-45 self argc message) + ) + (('bonk) + #f + ) + (('touch 'attack) + (let* ((gp-0 (-> block param 0)) + (s5-0 (the-as object (-> block param 1))) + (s4-0 proc) + (v1-21 (if (type? s4-0 projectile) + s4-0 ) - ) + ) ) + (when (and gp-0 v1-21) + (case (-> (the-as attack-info s5-0) mode) + (('wasp-shot 'guard-shot) + (seek! (-> self health) 0.0 0.25) + (activate! (-> self smush-control) 0.2 15 75 1.0 0.9 (-> *display* entity-clock)) + (sound-play "turret-take-hit") + (let ((v0-1 (the-as object (+ (current-time) (seconds 0.08))))) + (set! (-> self red-filter-timer) (the-as time-frame v0-1)) + v0-1 + ) + ) + (('drill-ship-shot) + (seek! (-> self health) 0.0 0.5) + (activate! (-> self smush-control) 0.2 24 144 1.0 0.9 (-> *display* entity-clock)) + (sound-play "turret-take-hit") + ) + ) + ) + ) + ) + (('test) + (set! (-> self health) (seek (-> self health) 0.0 (the-as float (-> block param 0)))) + ) + (('exit-valid) + (let ((v1-33 (-> self path-mode))) + (cond + ((or (zero? v1-33) (= v1-33 5) (= v1-33 1)) + (base-turret-method-41 self (the-as vector (-> block param 0))) + #t + ) + (else + #f + ) + ) + ) + ) + (('exit) + (let ((v1-37 (-> self path-mode))) + (when (if (or (zero? v1-37) (= v1-37 5) (= v1-37 1)) + #t + ) + (go-virtual shutdown) + #f + ) + ) + ) + (else + (turret-handler proc argc message block) + ) ) ) :enter (behavior () @@ -1367,7 +1360,6 @@ (set! (-> v1-14 prim-core action) (collide-action solid)) (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle)) ) - (none) ) :exit (behavior () (set-filter-color! 1.0 1.0 1.0) @@ -1377,13 +1369,11 @@ ) 0 (send-event (handle->process (-> self hud)) 'hide-and-die) - (none) ) :trans (behavior () (if (<= (the int (-> self health)) 0) (go-virtual die) ) - (none) ) :code (behavior () (ja-channel-set! 1) @@ -1451,7 +1441,6 @@ (suspend) ) (go-virtual shutdown) - (none) ) :post (behavior () (when (nonzero? (-> self red-filter-timer)) @@ -1553,7 +1542,6 @@ ) (seek! (-> self heat-target) 0.0 (* 0.4 (seconds-per-frame))) (transform-post) - (none) ) ) @@ -1568,7 +1556,6 @@ (sound-stop (-> self sound-id 2)) (set-zero! (-> self smush-control)) (logclear! (-> self skel status) (joint-control-status sync-math)) - (none) ) :trans (behavior () (when (< 0.99 (vector-dot @@ -1587,7 +1574,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-set! 1) @@ -1609,7 +1595,6 @@ (suspend) ) #f - (none) ) :post (behavior () (when (= (-> self path-mode) 5) @@ -1660,15 +1645,14 @@ ) (base-turret-method-40 self) (transform-post) - (none) ) ) ;; failed to figure out what this is: (defstate dormant (base-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'bonk) (send-event proc 'target-turret-get-off 90) (send-event @@ -1681,14 +1665,14 @@ ) (('touch) (send-event proc 'target-turret-get-off 90) - (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> event param 0)) 0.7 6144.0 16384.0) + (send-shoves (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) #f ) (('exit) #t ) (else - (turret-handler proc arg1 event-type event) + (turret-handler proc argc message block) ) ) ) @@ -1696,7 +1680,6 @@ (set-zero! (-> self smush-control)) (base-turret-method-43 self) (set! (-> self focus-status) (focus-status disable ignore inactive)) - (none) ) :code (the-as (function none :behavior base-turret) sleep-code) ) @@ -1775,7 +1758,6 @@ (while (-> self child) (suspend) ) - (none) ) ) @@ -2279,10 +2261,7 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate cam-turret (camera-slave) - :event (the-as - (function process int symbol event-message-block object :behavior camera-slave) - cam-standard-event-handler - ) + :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self saved-pt quad) (-> self trans quad)) @@ -2290,13 +2269,11 @@ This commonly includes things such as: (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 ) - (none) ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (cam-slave-go cam-free-floating) ) - (none) ) :code (behavior () (until #f @@ -2315,7 +2292,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -2354,13 +2330,13 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate target-turret-stance (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('grab) (when (not (focus-test? self dead)) - (if (-> event param 1) + (if (-> block param 1) (set! (-> self turret grabbed?) #t) ) #t @@ -2384,17 +2360,17 @@ This commonly includes things such as: ) (('attack 'attack-invinc) (let ((gp-0 - (the-as object (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> event param 1)) 160)) + (the-as object (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> block param 1)) 160)) ) ) ((method-of-type attack-info compute-intersect-info) (the-as attack-info gp-0) - (-> event param 1) + (-> block param 1) self (if (type? proc process-drawable) proc ) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) ) (case (-> (the-as attack-info gp-0) mode) (('turret) @@ -2445,7 +2421,7 @@ This commonly includes things such as: ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -2458,7 +2434,6 @@ This commonly includes things such as: (logior! (-> self state-flags) (state-flags sf2 sf5)) (logior! (-> self focus-status) (focus-status disable grabbed)) (set! (-> self control mod-surface) *empty-mods*) - (none) ) :exit (behavior () (target-exit) @@ -2470,11 +2445,9 @@ This commonly includes things such as: (deactivate (-> v1-6 0)) ) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior ((arg0 handle)) (local-vars @@ -2517,11 +2490,9 @@ This commonly includes things such as: ) (send-event self 'end-mode) (go target-turret-get-off) - (none) ) :post (behavior () (target-turret-post) - (none) ) ) @@ -2536,7 +2507,6 @@ This commonly includes things such as: :event target-generic-event-handler :exit (behavior () (logclear! (-> self state-flags) (state-flags sf6)) - (none) ) :code (behavior ((arg0 handle)) (when (zero? (-> self turret)) @@ -2607,7 +2577,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (go target-turret-stance arg0) - (none) ) :post target-no-move-post ) @@ -2618,7 +2587,6 @@ This commonly includes things such as: :exit (behavior () (target-exit) (logclear! (-> self state-flags) (state-flags sf6)) - (none) ) :code (behavior () (set! (-> self control mod-surface) *empty-mods*) @@ -2715,10 +2683,8 @@ This commonly includes things such as: (go target-falling (the-as symbol a0-61)) ) ) - (none) ) :post (behavior () (target-no-move-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/target2_REF.gc b/test/decompiler/reference/jak2/engine/target/target2_REF.gc index efbae606fe0..8ab5599dd02 100644 --- a/test/decompiler/reference/jak2/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target2_REF.gc @@ -9,14 +9,14 @@ ;; failed to figure out what this is: (defstate target-load-wait (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('loading) (set! (-> self state-time) (current-time)) #f ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -72,20 +72,19 @@ ) ) (go target-stance) - (none) ) :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-stance-ambient (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('movie) (go target-stance) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -132,7 +131,6 @@ ) ) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (set! (-> self ambient-time) (current-time)) @@ -146,7 +144,6 @@ (set! (-> self spool-anim) #f) ((-> target-stance exit)) (target-exit) - (none) ) :trans (behavior () (gui-control-method-12 @@ -165,7 +162,6 @@ ) (go target-stance) ) - (none) ) :code (behavior () (while (let ((v1-15 (file-status *art-control* (-> self spool-anim name) 0))) @@ -184,7 +180,6 @@ (lambda ((arg0 process-drawable)) (!= (-> *cpad-list* cpads 0 stick0-speed) 0.0)) ) (go target-stance) - (none) ) :post target-post ) @@ -207,7 +202,6 @@ (suspend) ) (go target-stance) - (none) ) :post target-post ) @@ -220,46 +214,43 @@ ;; failed to figure out what this is: (defstate target-look-around (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) - (-> self state name) - ) - (else - (let ((v1-4 event-type)) - (cond - ((= v1-4 'end-mode) - (if (not (focus-test? self dead)) - (go target-stance-look-around) - ) - ) - ((= v1-4 'gun) - (the-as object (target-gun-fire (the-as pickup-type (-> event param 0)))) - ) - ((-> self control danger-mode) - (target-dangerous-event-handler proc arg1 event-type event) - ) - (else - (target-standard-event-handler proc arg1 event-type event) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (cond + ((and (= message 'query) (= (-> block param 0) 'mode)) + (-> self state name) + ) + (else + (let ((v1-4 message)) + (cond + ((= v1-4 'end-mode) + (if (not (focus-test? self dead)) + (go target-stance-look-around) + ) + ) + ((= v1-4 'gun) + (target-gun-fire (the-as pickup-type (-> block param 0))) + ) + ((-> self control danger-mode) + (target-dangerous-event-handler proc argc message block) + ) + (else + (target-standard-event-handler proc argc message block) + ) ) + ) + ) + ) ) :enter (behavior () (set! (-> self cam-user-mode) 'look-around) (set! (-> self control mod-surface) *look-around-mods*) (logior! (-> self focus-status) (focus-status in-head)) (set-setting! 'mode-name 'cam-eye 0.0 0) - (none) ) :exit (behavior () (set! (-> self cam-user-mode) 'normal) (target-exit) (remove-setting! 'mode-name) - (none) ) :trans (behavior () (when (or (cpad-pressed? (-> self control cpad number) r3) (< 2048.0 (target-height-above-ground))) @@ -267,7 +258,6 @@ (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (pad-buttons r3)) (set! (-> self cam-user-mode) 'normal) ) - (none) ) :code (behavior () (local-vars (a1-0 event-message-block) (f30-0 float)) @@ -293,7 +283,6 @@ (suspend) ) #f - (none) ) :post (behavior () (target-no-move-post) @@ -308,73 +297,71 @@ (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) (target-gun-check) ) - (none) ) ) ;; failed to figure out what this is: (defstate target-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) - (-> self state name) - ) - (else - (case event-type - (('end-mode) - (go target-stance) - ) - (('play-anim) - (go target-grab (the-as symbol (-> event param 0))) - ) - (('clone-anim) - (go target-clone-anim (process->handle (the-as process (-> event param 0)))) - ) - (('change-mode) - (case (-> event param 0) - (('normal) - (cond - ((and (focus-test? self dark) (nonzero? (-> self darkjak))) - (the-as object (target-darkjak-end-mode)) - ) - ((using-gun? self) - (target-gun-end-mode #t) - ) - ) - ) - (('gun) - (cond - ((using-gun? self) - (send-event self 'gun-type (-> event param 2)) - ) - ((want-to-gun? self #t) - (if (logtest? (-> self game features) (game-feature gun)) - (the-as object (target-gun-init (the-as int (-> event param 2)))) - ) - ) - ) - ) - (('demo) - (go target-demo #f) - ) - (('title) - (go target-title #f) - ) - ) - ) - (('anim) - (let ((v0-0 (the-as object (-> event param 0)))) - (set! (-> self control unknown-word04) (the-as uint v0-0)) - v0-0 - ) - ) - (else - (target-generic-event-handler proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (cond + ((and (= message 'query) (= (-> block param 0) 'mode)) + (-> self state name) + ) + (else + (case message + (('end-mode) + (go target-stance) + ) + (('play-anim) + (go target-grab (the-as symbol (-> block param 0))) + ) + (('clone-anim) + (go target-clone-anim (process->handle (the-as process (-> block param 0)))) + ) + (('change-mode) + (case (-> block param 0) + (('normal) + (cond + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) + (target-darkjak-end-mode) + ) + ((using-gun? self) + (target-gun-end-mode #t) + ) + ) + ) + (('gun) + (cond + ((using-gun? self) + (send-event self 'gun-type (-> block param 2)) + ) + ((want-to-gun? self #t) + (if (logtest? (-> self game features) (game-feature gun)) + (target-gun-init (the-as int (-> block param 2))) ) + ) + ) + ) + (('demo) + (go target-demo #f) + ) + (('title) + (go target-title #f) + ) + ) + ) + (('anim) + (let ((v0-0 (the-as object (-> block param 0)))) + (set! (-> self control unknown-word04) (the-as uint v0-0)) + v0-0 + ) + ) + (else + (target-generic-event-handler proc argc message block) ) + ) + ) + ) ) :enter (behavior ((arg0 symbol)) (set! (-> self control mod-surface) *grab-mods*) @@ -383,13 +370,11 @@ (logior! (-> self focus-status) (focus-status grabbed)) (set! (-> self control unknown-word04) (the-as uint arg0)) (logior! (-> self skel effect flags) (effect-control-flag ecf2)) - (none) ) :exit (behavior () (set! (-> self ambient-time) (current-time)) (logclear! (-> self state-flags) (state-flags sf2)) (target-exit) - (none) ) :code (behavior ((arg0 symbol)) (set-forward-vel 0.0) @@ -530,7 +515,6 @@ (label cfg-82) ) #f - (none) ) :post (behavior () (if (logtest? (-> self control status) (collide-status on-surface)) @@ -538,16 +522,15 @@ ) (set! (-> self game kiosk-timeout) (the-as uint (-> *display* game-clock frame-counter))) (target-no-stick-post) - (none) ) ) ;; failed to figure out what this is: (defstate target-pole-cycle (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'query) (= (-> event param 0) 'mode)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) :enter (behavior ((arg0 handle)) @@ -561,13 +544,11 @@ (send-event *camera* 'ease-in) (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float #f)) (set! (-> self control hand-to-edge-dist) 0.5) - (none) ) :exit (behavior () (target-collide-set! 'normal 0.0) (logclear! (-> self focus-status) (focus-status pole)) (set! (-> self control anim-handle) (the-as handle #f)) - (none) ) :trans (behavior () (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) @@ -613,7 +594,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 handle)) (sound-play "edge-grab") @@ -668,7 +648,6 @@ ) ) #f - (none) ) :post target-no-move-post ) @@ -690,7 +669,6 @@ ) (set-forward-vel arg2) (go target-pole-flip-up-jump (the-as float arg0) (the-as float arg1)) - (none) ) :post target-no-move-post ) @@ -701,13 +679,11 @@ :enter (behavior ((arg0 float) (arg1 float)) ((-> target-jump-forward enter) arg0 arg1) (set! (-> self control mod-surface) *forward-pole-jump-mods*) - (none) ) :exit target-exit :trans (behavior () ((-> target-jump-forward trans)) (vector-flatten! (-> self control transv) (-> self control transv) (-> self control edge-grab-edge-dir)) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (send-event *camera* 'damp-up) @@ -729,7 +705,6 @@ (ja :group! (-> self draw art-group data 27) :num! (loop!)) ) #f - (none) ) :post target-post ) @@ -751,7 +726,6 @@ ) (set-forward-vel arg2) (go target-pole-flip-forward-jump arg0 arg1) - (none) ) :post target-no-move-post ) @@ -762,13 +736,11 @@ :enter (behavior ((arg0 float) (arg1 float)) ((-> target-jump enter) arg0 arg1 (the-as surface #f)) (set! (-> self control mod-surface) *forward-pole-jump-mods*) - (none) ) :exit target-exit :trans (behavior () ((-> target-jump-forward trans)) (vector-flatten! (-> self control transv) (-> self control transv) (-> self control edge-grab-edge-dir)) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (until (ja-done? 0) @@ -776,20 +748,19 @@ (ja :num! (seek!)) ) ((the-as (function none :behavior target) (-> target-pole-flip-up-jump code))) - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-edge-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (go target-falling 'target-edge-grab) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -807,7 +778,6 @@ (if (!= (-> self skel top-anim interp) 0.0) (set! (-> self skel top-anim interp) 0.000000000000000000000000000000001) ) - (none) ) :exit (behavior () (let ((v1-2 (handle->process (-> self control unknown-handle000)))) @@ -830,7 +800,6 @@ (set! (-> self skel top-anim interp) 1.0) ) (set! (-> self control draw-offset y) 0.0) - (none) ) :trans (behavior () (when (and (>= (- (current-time) (-> self state-time)) (seconds 0.2)) @@ -899,7 +868,6 @@ (if (using-gun? self) (seek! (-> self control draw-offset y) 778.24 (* 4096.0 (seconds-per-frame))) ) - (none) ) :code (behavior () (target-compute-edge) @@ -961,20 +929,19 @@ ) ) (target-edge-grab-anim (the-as float (-> self control unknown-word04))) - (none) ) :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-edge-grab-jump (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (go target-falling 'target-edge-grab) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -1033,7 +1000,6 @@ (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) (send-event *camera* 'damp-up) (go target-jump-forward arg0 arg1) - (none) ) :post target-no-move-post ) @@ -1079,7 +1045,6 @@ (send-event self 'push-transv (-> self control rider-last-move) (seconds 100)) ) (go target-falling 'target-edge-grab) - (none) ) :post target-no-move-post ) @@ -1099,14 +1064,12 @@ (set-forward-vel 0.0) (set! (-> self control mod-surface) *hit-ground-hard-mods*) (logior! (-> self focus-status) (focus-status hit)) - (none) ) :exit (behavior () (if (not (and (-> self next-state) (= (-> self next-state name) 'target-death))) (logclear! (-> self focus-status) (focus-status dead hit)) ) (target-exit) - (none) ) :code (behavior ((arg0 float)) (when (!= arg0 0.0) @@ -1146,7 +1109,6 @@ (go target-stance) ) ) - (none) ) :post target-no-stick-post ) @@ -1192,7 +1154,6 @@ (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) ) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (if (using-gun? self) @@ -1200,7 +1161,6 @@ ) (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) (set! (-> self control bend-target) 0.0) - (none) ) :trans (behavior () (if (and (logtest? (water-flags wading) (-> self water flags)) (not (using-gun? self))) @@ -1279,7 +1239,6 @@ (slide-down-test) (fall-test target-falling -4096000.0) (set-forward-vel (* 0.7 (-> self control ctrl-xz-vel))) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1444,17 +1403,16 @@ ) ) #f - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-launch (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'query) (= (-> event param 0) 'mode)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'query) (= (-> block param 0) 'mode)) 'target-launch - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) :code (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) @@ -1542,7 +1500,6 @@ ) ) (go target-high-jump arg0 arg0 'launch) - (none) ) :post target-no-stick-post ) @@ -1555,12 +1512,10 @@ (move-to-ground (-> self control) 40960.0 40960.0 #f (-> self control root-prim prim-core collide-with)) (logior! (-> self focus-status) (focus-status grabbed)) (set! (-> self neck flex-blend) 0.0) - (none) ) :exit (behavior () (send-event (handle->process (-> self control anim-handle)) 'end-mode) (target-exit) - (none) ) :code (behavior ((arg0 string) (arg1 handle)) (let ((gp-0 (get-art-by-name (-> self draw art-group) arg0 art-joint-anim))) @@ -1576,18 +1531,17 @@ ) ) (go target-stance) - (none) ) :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-clone-anim (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) (set! (-> self control unknown-word04) (the-as uint #f)) ) - ((-> target-grab event) proc arg1 event-type event) + ((-> target-grab event) proc argc message block) ) :enter (behavior ((arg0 handle)) (set! (-> self control anim-handle) arg0) @@ -1598,7 +1552,6 @@ (vector-reset! (-> self control transv)) (set! (-> self neck flex-blend) 0.0) (send-event (ppointer->process (-> self sidekick)) 'shadow #t) - (none) ) :exit (behavior () (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) @@ -1637,12 +1590,10 @@ (ja-channel-set! 0) (ja-post) (target-exit) - (none) ) :code (behavior ((arg0 handle)) (clone-anim arg0 #t "") (go target-stance) - (none) ) :post target-no-ja-move-post ) @@ -1683,7 +1634,6 @@ (set! (-> self control dynam gravity-length) 0.0) (set! (-> self control mod-surface) *float-mods*) (target-darkjak-end-mode) - (none) ) :exit (behavior () (sound-play-by-spec (static-sound-spec "menu-back" :fo-curve 1) (new-sound-id) (the-as vector #t)) @@ -1699,7 +1649,6 @@ (if (nonzero? (-> self board)) (set! (-> self board latch?) #f) ) - (none) ) :trans (behavior () (set! (-> self control time-of-last-debug-float) (current-time)) @@ -1768,7 +1717,6 @@ ) ) ) - (none) ) :code target-stance-anim :post target-post diff --git a/test/decompiler/reference/jak2/engine/target/target_REF.gc b/test/decompiler/reference/jak2/engine/target/target_REF.gc index f0cee488be4..05864b591c1 100644 --- a/test/decompiler/reference/jak2/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target_REF.gc @@ -37,7 +37,6 @@ (suspend) (suspend) (go target-stance) - (none) ) :post target-no-move-post ) @@ -48,13 +47,11 @@ :enter (behavior () (set! (-> self control mod-surface) *walk-mods*) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) (set! (-> self control bend-target) 0.0) (target-state-hook-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -136,7 +133,6 @@ ) (slide-down-test) (fall-test target-falling -4096000.0) - (none) ) :code target-stance-anim :post target-post @@ -151,12 +147,10 @@ ) (set! (-> self state-time) (current-time)) (set! (-> self control mod-surface) *walk-mods*) - (none) ) :exit (behavior () (target-effect-exit) (target-state-hook-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -245,11 +239,9 @@ ) (slide-down-test) (fall-test target-falling -4096000.0) - (none) ) :code (behavior () (target-walk-anim -300) - (none) ) :post target-post ) @@ -261,7 +253,6 @@ (vector-turn-to (-> self control transv)) (set! (-> self control mod-surface) *turn-around-mods*) (set! (-> self control bend-target) 1.0) - (none) ) :exit (behavior () (target-state-hook-exit) @@ -269,7 +260,6 @@ (set! (-> self control ctrl-xz-vel) 0.0) (set-quaternion! (-> self control) (-> self control dir-targ)) (set! (-> self control bend-target) 0.0) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -296,7 +286,6 @@ (go target-falling #f) ) (slide-down-test) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.04)) @@ -315,7 +304,6 @@ (set-forward-vel (-> self control ctrl-xz-vel)) (target-state-hook-exit) (go target-walk) - (none) ) :post target-no-stick-post ) @@ -325,11 +313,9 @@ :event target-walk-event-handler :enter (behavior () (set! (-> self control mod-surface) *jump-mods*) - (none) ) :exit (behavior () (set! (-> self control unknown-time-frame13) (current-time)) - (none) ) :trans (behavior () (when (or (logtest? (-> self control status) (collide-status on-surface)) @@ -343,7 +329,6 @@ (go target-duck-stance #f) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -362,7 +347,6 @@ ) ) #f - (none) ) :post target-post ) @@ -436,13 +420,13 @@ ;; failed to figure out what this is: (defstate target-slide-down-to-ground (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('slide) #f ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -452,13 +436,11 @@ (set! (-> self control sliding-start-time) 0) (set! (-> self control force-turn-to-strength) 1.0) (set! (-> self control force-turn-to-speed) 1.0) - (none) ) :exit (behavior () (target-effect-exit) (target-exit) (set! (-> self control unknown-time-frame13) (current-time)) - (none) ) :trans (behavior () (if (and (or (and (logtest? (-> self control status) (collide-status on-surface)) @@ -530,7 +512,6 @@ ) ) (set! (-> self control ctrl-xz-vel) (* 40960.0 (-> self darkjak-giant-interp))) - (none) ) :code (-> target-walk code) :post (behavior () @@ -568,7 +549,6 @@ ) (set! (-> self control turn-lockout-end-time) (+ (current-time) (seconds 0.1))) (target-post) - (none) ) ) @@ -799,7 +779,6 @@ (set! (-> self control bend-target) 1.0) (set! (-> self control mod-surface) *duck-mods*) (target-collide-set! 'duck 1.0) - (none) ) :exit (behavior () (if (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -818,7 +797,6 @@ (if (= (-> self control collide-mode) 'duck) (target-collide-set! 'normal 0.0) ) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -873,7 +851,6 @@ ) (fall-test target-falling -4096000.0) (slide-down-test) - (none) ) :code (behavior ((arg0 symbol)) (let ((v1-2 (ja-group))) @@ -955,7 +932,6 @@ ) ) #f - (none) ) :post target-post ) @@ -974,7 +950,6 @@ (set! (-> self control mod-surface) *duck-mods*) ) ) - (none) ) :exit (-> target-duck-stance exit) :trans (behavior () @@ -1030,7 +1005,6 @@ ) (fall-test target-falling -4096000.0) (slide-down-test) - (none) ) :code (behavior ((arg0 symbol)) (let ((gp-0 (if (using-gun? self) @@ -1075,7 +1049,6 @@ (suspend) ) #f - (none) ) :post target-post ) @@ -1140,7 +1113,6 @@ (set! (-> self control unknown-float35) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) ) - (none) ) :exit target-exit :trans (behavior () @@ -1204,7 +1176,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) (seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) (let ((f28-0 20.0) @@ -1328,7 +1299,6 @@ ) (target-falling-anim -1 (seconds 0.2)) (go target-falling #f) - (none) ) :post target-post ) @@ -1339,7 +1309,6 @@ :enter (behavior ((arg0 float) (arg1 float)) ((-> target-jump enter) arg0 arg1 (the-as surface #f)) (set! (-> self control mod-surface) *forward-jump-mods*) - (none) ) :exit target-exit :trans (-> target-jump trans) @@ -1390,7 +1359,6 @@ (ja :group! (-> self draw art-group data 27) :num! (loop!)) ) #f - (none) ) :post target-post ) @@ -1415,7 +1383,6 @@ (if (!= (-> self control mod-surface) *slide-jump-mods*) (set! (-> self control mod-surface) *double-jump-mods*) ) - (none) ) :exit target-exit :trans (behavior () @@ -1460,7 +1427,6 @@ (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) (seconds-per-frame) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (sound-play "jump-double") @@ -1527,7 +1493,6 @@ ) (target-falling-anim -1 (seconds 0.2)) (go target-falling #f) - (none) ) :post target-post ) @@ -1569,7 +1534,6 @@ (set! (-> self control unknown-float35) (fmax 0.0 (fmin 0.5 (* 0.00008138021 (+ -409.6 (-> self control ctrl-xz-vel))))) ) - (none) ) :exit target-exit :trans (behavior () @@ -1618,7 +1582,6 @@ (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control ctrl-xz-vel))))) (seconds-per-frame) ) - (none) ) :code (-> target-jump code) :post target-post @@ -1637,7 +1600,6 @@ (else ) ) - (none) ) :exit target-exit :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) @@ -1671,7 +1633,6 @@ ) ) (go target-duck-high-jump-jump arg0 arg1 arg2) - (none) ) :post target-post ) @@ -1694,7 +1655,6 @@ (set! (-> self control mod-surface) *high-jump-mods*) ) ) - (none) ) :exit target-exit :trans (behavior () @@ -1722,7 +1682,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (when (using-gun? self) @@ -1819,7 +1778,6 @@ #f ) ) - (none) ) :post target-post ) @@ -1838,7 +1796,6 @@ ) (set! (-> self control unknown-word04) (the-as uint arg0)) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (target-falling-trans @@ -1849,7 +1806,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol)) (case arg0 @@ -1877,7 +1833,6 @@ ) ) (target-falling-anim -1 (seconds 0.33)) - (none) ) :post target-post ) @@ -1980,11 +1935,9 @@ ) ) ) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) - (none) ) :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) @@ -2031,12 +1984,10 @@ ) (fall-test target-falling -4096000.0) (slide-down-test) - (none) ) :code (behavior ((arg0 symbol)) (target-hit-ground-anim #f (are-still?)) (go target-stance) - (none) ) :post target-post ) @@ -2105,19 +2056,19 @@ ;; failed to figure out what this is: (defstate target-attack (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (cond (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 1920) ) (when (target-send-attack proc (-> self control danger-mode) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as int (-> self control target-attack-id)) (the-as int (-> self control attack-count)) (-> self control penetrate-using) @@ -2130,12 +2081,12 @@ ) ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) (('gun-combo) - (when (-> event param 0) + (when (-> block param 0) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) @@ -2150,7 +2101,7 @@ #f ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -2173,7 +2124,6 @@ (quaternion-copy! (-> self control unknown-quaternion04) (-> self control dir-targ)) (set! (-> self control unknown-float41) 0.0) (set! (-> self control unknown-float42) 0.0) - (none) ) :exit (behavior () (if (zero? (-> self gun track-target-hold-time)) @@ -2181,7 +2131,6 @@ ) (set! (-> self control last-attack-end-time) (current-time)) (target-exit) - (none) ) :code (behavior () (let ((gp-0 (-> self draw art-group data 40))) @@ -2327,7 +2276,6 @@ ) ) (go target-stance) - (none) ) :post target-post ) @@ -2361,19 +2309,19 @@ ;; failed to figure out what this is: (defstate target-running-attack (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (cond (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (-> self control) (the-as uint 1920) ) (let ((gp-1 (target-send-attack proc (-> self control danger-mode) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as int (-> self control target-attack-id)) (the-as int (-> self control attack-count)) (-> self control penetrate-using) @@ -2423,12 +2371,12 @@ ) ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) (('gun-combo) - (if (-> event param 0) + (if (-> block param 0) (go target-stance) ) #t @@ -2437,7 +2385,7 @@ #f ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -2478,7 +2426,6 @@ (set! (-> self control bend-target) 1.0) ) (set! (-> self upper-body twist z) 0.0) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) @@ -2487,7 +2434,6 @@ (set! (-> *run-attack-mods* turnvv) 0.0) (set! (-> self control last-running-attack-end-time) (current-time)) (target-exit) - (none) ) :trans (behavior () (when (!= (-> self state-time) (current-time)) @@ -2562,7 +2508,6 @@ (talker-spawn-func (-> *talker-speech* 328) *entity-pool* (target-pos 0) (the-as region #f)) ) ) - (none) ) :code (behavior () (if (logtest? (water-flags touch-water) (-> self water flags)) @@ -2825,7 +2770,6 @@ ) ) (go target-stance) - (none) ) :post target-post ) @@ -2883,15 +2827,15 @@ ;; failed to figure out what this is: (defstate target-attack-air (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v0-0 (target-bonk-event-handler proc arg1 event-type event))) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v0-0 (target-bonk-event-handler proc argc message block))) (cond (v0-0 (empty) v0-0 ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -2969,14 +2913,12 @@ ) (set! (-> self control dynam gravity-length) 122880.0) (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) - (none) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) (set! (-> self control last-attack-end-time) (current-time)) (target-exit) - (none) ) :trans (behavior () (when (logtest? (-> self control status) (collide-status on-surface)) @@ -3017,12 +2959,10 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol)) (target-attack-air-anim) (go target-falling #f) - (none) ) :post target-post ) @@ -3090,7 +3030,6 @@ ) (set! (-> self control unknown-sound-id00) (new 'static 'sound-id)) 0 - (none) ) :exit (behavior () (if (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-bomb1))) @@ -3106,7 +3045,6 @@ ) ) (target-exit) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (let* ((v1-2 (ja-group)) @@ -3192,17 +3130,16 @@ ) ) (go target-attack-uppercut-jump arg0 arg1) - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-attack-uppercut-jump (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('gun-combo) - (when (-> event param 0) + (when (-> block param 0) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) @@ -3234,7 +3171,7 @@ #t ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -3253,7 +3190,6 @@ (set! (-> self gun combo-window-state) (-> self state name)) (set! (-> self gun track-target-hold-time) 0) 0 - (none) ) :exit target-exit :trans (behavior () @@ -3305,7 +3241,6 @@ (target-danger-set! 'harmless #f) ) (slide-down-test) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (when (or (= (-> self skel top-anim frame-group) (-> self draw art-group data 267)) @@ -3376,22 +3311,21 @@ ) (set! (-> self gun surpress-time) (current-time)) (go target-falling #f) - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-flop (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v1-0 symbol)) - (let ((v0-0 (target-bonk-event-handler proc arg1 event-type event))) + (let ((v0-0 (target-bonk-event-handler proc argc message block))) (cond (v0-0 (empty) v0-0 ) - ((begin (set! v1-0 event-type) (= v1-0 'slide)) + ((begin (set! v1-0 message) (= v1-0 'slide)) #f ) ((= v1-0 'swim) @@ -3407,7 +3341,7 @@ ) ) (else - (target-dangerous-event-handler proc arg1 event-type event) + (target-dangerous-event-handler proc argc message block) ) ) ) @@ -3451,7 +3385,6 @@ ) ) ) - (none) ) :exit (behavior () (let ((v1-2 (get-channel (-> self skel top-anim) 0))) @@ -3468,7 +3401,6 @@ (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) (set! (-> self control dynam gravity quad) (-> self control standard-dynamics gravity quad)) (set! (-> self neck flex-blend) 1.0) - (none) ) :trans (behavior () (delete-back-vel) @@ -3534,7 +3466,6 @@ (target-start-attack) (target-danger-set! 'flop #f) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 float)) (if (using-gun? self) @@ -3660,27 +3591,26 @@ ) ) #f - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-flop-hit-ground (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond ((and (-> self next-state) (= (-> self next-state name) 'target-flop-hit-ground)) - (case event-type + (case message (('swim 'slide) #f ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) (else - (target-jump-event-handler proc arg1 event-type event) + (target-jump-event-handler proc argc message block) ) ) ) @@ -3710,7 +3640,6 @@ (else ) ) - (none) ) :exit target-exit :trans (behavior () @@ -3743,25 +3672,23 @@ ) ) (slide-down-test) - (none) ) :code (behavior ((arg0 symbol)) (target-hit-ground-anim arg0 (are-still?)) (go target-falling #f) - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-roll (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (= event-type 'touched) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (= message 'touched) (send-event proc 'roll) ) - (case event-type + (case message (('gun-combo) - (when (-> event param 0) + (when (-> block param 0) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) @@ -3775,7 +3702,7 @@ #t ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -3797,7 +3724,6 @@ (set! (-> self control unknown-word04) (the-as uint 0)) (set! (-> self control did-move-to-pole-or-max-jump-height) 0.0) (set! (-> self gun track-target-hold-time) 0) - (none) ) :exit (behavior () (when (not (and (-> self next-state) (= (-> self next-state name) 'target-roll))) @@ -3806,7 +3732,6 @@ ) (target-exit) (target-collide-set! 'normal 0.0) - (none) ) :code (behavior () (let ((gp-0 0)) @@ -3919,17 +3844,16 @@ ) (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) (go target-duck-stance 'roll) - (none) ) :post target-post ) ;; failed to figure out what this is: (defstate target-roll-flip (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('gun-combo) - (when (-> event param 0) + (when (-> block param 0) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) @@ -3941,7 +3865,7 @@ #t ) (else - (target-jump-event-handler proc arg1 event-type event) + (target-jump-event-handler proc argc message block) ) ) ) @@ -3953,12 +3877,10 @@ (set! (-> self gun combo-window-start) (current-time)) (set! (-> self gun combo-window-state) (-> self state name)) (target-collide-set! 'duck 1.0) - (none) ) :exit (behavior () (target-exit) (target-collide-set! 'normal 0.0) - (none) ) :trans (behavior () (if (and (or (smack-surface? #f) @@ -3983,7 +3905,6 @@ ) (go target-attack-air #f) ) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (local-vars (v1-37 symbol)) @@ -4111,7 +4032,6 @@ ) ) ) - (none) ) :post target-post ) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc index 137f624a49b..e413e08a19c 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc @@ -224,7 +224,7 @@ (&-> *setting-control* user-default dialog-volume) ) (set! (-> (the-as menu-missions-option (-> *missions-options* options 0)) task-line-index) 0) - (the-as object (set-setting-by-param *setting-control* 'extra-bank '((force2 menu1)) 0 0)) + (set-setting-by-param *setting-control* 'extra-bank '((force2 menu1)) 0 0) ) ;; definition of type hud-ring-cell @@ -338,7 +338,6 @@ (suspend) ) #f - (none) ) :post (behavior () (vector<-cspace! @@ -419,7 +418,6 @@ ) (quaternion-normalize! (-> self root quat)) (ja-post) - (none) ) ) @@ -1509,7 +1507,6 @@ :enter (behavior () (sound-play "ring-appear") (set! (-> self pos-transition) 1.0) - (none) ) :trans (behavior () (let ((f30-0 (if (= (-> *progress-state* starting-state) 'main) @@ -1534,7 +1531,6 @@ (go-virtual idle) ) ) - (none) ) :code (behavior () (until #f @@ -1543,7 +1539,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior progress) ja-post) ) @@ -1551,213 +1546,209 @@ ;; failed to figure out what this is: (defstate idle (progress) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('notify) - (cond - ((= (-> event param 0) 'done) - (let ((t9-0 format) - (a0-3 #t) - (a1-1 "DONE NOTIFY: ~S ~S~%") - (v1-3 (the-as mc-status-code (-> event param 1))) - ) - (t9-0 - a0-3 - a1-1 - (cond - ((= v1-3 (mc-status-code bad-version)) - "bad-version" - ) - ((= v1-3 (mc-status-code no-save)) - "no-save" - ) - ((= v1-3 (mc-status-code no-last)) - "no-last" - ) - ((= v1-3 (mc-status-code no-space)) - "no-space" - ) - ((= v1-3 (mc-status-code internal-error)) - "internal-error" - ) - ((= v1-3 (mc-status-code no-memory)) - "no-memory" - ) - ((= v1-3 (mc-status-code bad-handle)) - "bad-handle" - ) - ((= v1-3 (mc-status-code busy)) - "busy" - ) - ((= v1-3 (mc-status-code write-error)) - "write-error" - ) - ((= v1-3 (mc-status-code read-error)) - "read-error" - ) - ((= v1-3 (mc-status-code no-card)) - "no-card" - ) - ((= v1-3 (mc-status-code no-format)) - "no-format" - ) - ((= v1-3 (mc-status-code ok)) - "ok" - ) - ((= v1-3 (mc-status-code no-process)) - "no-process" - ) - ((= v1-3 (mc-status-code no-auto-save)) - "no-auto-save" - ) - ((= v1-3 (mc-status-code no-file)) - "no-file" - ) - ((= v1-3 (mc-status-code format-failed)) - "format-failed" - ) - ((= v1-3 (mc-status-code new-game)) - "new-game" - ) - (else - "*unknown*" - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (cond + ((= (-> block param 0) 'done) + (let ((t9-0 format) + (a0-3 #t) + (a1-1 "DONE NOTIFY: ~S ~S~%") + (v1-3 (the-as mc-status-code (-> block param 1))) + ) + (t9-0 + a0-3 + a1-1 + (cond + ((= v1-3 (mc-status-code bad-version)) + "bad-version" + ) + ((= v1-3 (mc-status-code no-save)) + "no-save" + ) + ((= v1-3 (mc-status-code no-last)) + "no-last" + ) + ((= v1-3 (mc-status-code no-space)) + "no-space" + ) + ((= v1-3 (mc-status-code internal-error)) + "internal-error" + ) + ((= v1-3 (mc-status-code no-memory)) + "no-memory" + ) + ((= v1-3 (mc-status-code bad-handle)) + "bad-handle" + ) + ((= v1-3 (mc-status-code busy)) + "busy" + ) + ((= v1-3 (mc-status-code write-error)) + "write-error" + ) + ((= v1-3 (mc-status-code read-error)) + "read-error" + ) + ((= v1-3 (mc-status-code no-card)) + "no-card" + ) + ((= v1-3 (mc-status-code no-format)) + "no-format" + ) + ((= v1-3 (mc-status-code ok)) + "ok" + ) + ((= v1-3 (mc-status-code no-process)) + "no-process" + ) + ((= v1-3 (mc-status-code no-auto-save)) + "no-auto-save" + ) + ((= v1-3 (mc-status-code no-file)) + "no-file" + ) + ((= v1-3 (mc-status-code format-failed)) + "format-failed" + ) + ((= v1-3 (mc-status-code new-game)) + "new-game" + ) + (else + "*unknown*" ) - (symbol->string (-> self current)) ) + (symbol->string (-> self current)) ) - (case (-> self current) - (('saving) - (cond - ((= (-> self state-stack 0) 'title) - (let ((gp-1 (-> *setting-control* user-default auto-save))) - (sound-volume-off) - (let ((v0-0 (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))))) - (set! (-> *setting-control* user-default auto-save) gp-1) - v0-0 - ) + ) + (case (-> self current) + (('saving) + (cond + ((= (-> self state-stack 0) 'title) + (let ((gp-1 (-> *setting-control* user-default auto-save))) + (sound-volume-off) + (let ((v0-0 (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))))) + (set! (-> *setting-control* user-default auto-save) gp-1) + v0-0 ) ) - (else - (pop-state self) - ) + ) + (else + (pop-state self) ) ) - (('formatting) - (set-next-state self 'creating 0) - ) - (('creating) - (if (= (-> self state-stack 0) 'title) - (set-next-state self 'select-save-title 0) - (set-next-state self 'select-save 0) - ) - ) - ) + ) + (('formatting) + (set-next-state self 'creating 0) + ) + (('creating) + (if (= (-> self state-stack 0) 'title) + (set-next-state self 'select-save-title 0) + (set-next-state self 'select-save 0) + ) + ) ) - ((= (-> event param 0) 'error) - (let ((t9-7 format) - (a0-18 #t) - (a1-5 "ERROR NOTIFY: ~S ~S ~S~%") - (v1-19 (the-as mc-status-code (-> event param 1))) - ) - (t9-7 - a0-18 - a1-5 - (cond - ((= v1-19 (mc-status-code bad-version)) - "bad-version" - ) - ((= v1-19 (mc-status-code no-save)) - "no-save" - ) - ((= v1-19 (mc-status-code no-last)) - "no-last" - ) - ((= v1-19 (mc-status-code no-space)) - "no-space" - ) - ((= v1-19 (mc-status-code internal-error)) - "internal-error" - ) - ((= v1-19 (mc-status-code no-memory)) - "no-memory" - ) - ((= v1-19 (mc-status-code bad-handle)) - "bad-handle" - ) - ((= v1-19 (mc-status-code busy)) - "busy" - ) - ((= v1-19 (mc-status-code write-error)) - "write-error" - ) - ((= v1-19 (mc-status-code read-error)) - "read-error" - ) - ((= v1-19 (mc-status-code no-card)) - "no-card" - ) - ((= v1-19 (mc-status-code no-format)) - "no-format" - ) - ((= v1-19 (mc-status-code ok)) - "ok" - ) - ((= v1-19 (mc-status-code no-process)) - "no-process" - ) - ((= v1-19 (mc-status-code no-auto-save)) - "no-auto-save" - ) - ((= v1-19 (mc-status-code no-file)) - "no-file" - ) - ((= v1-19 (mc-status-code format-failed)) - "format-failed" - ) - ((= v1-19 (mc-status-code new-game)) - "new-game" - ) - (else - "*unknown*" - ) + ) + ((= (-> block param 0) 'error) + (let ((t9-7 format) + (a0-18 #t) + (a1-5 "ERROR NOTIFY: ~S ~S ~S~%") + (v1-19 (the-as mc-status-code (-> block param 1))) + ) + (t9-7 + a0-18 + a1-5 + (cond + ((= v1-19 (mc-status-code bad-version)) + "bad-version" + ) + ((= v1-19 (mc-status-code no-save)) + "no-save" + ) + ((= v1-19 (mc-status-code no-last)) + "no-last" + ) + ((= v1-19 (mc-status-code no-space)) + "no-space" + ) + ((= v1-19 (mc-status-code internal-error)) + "internal-error" + ) + ((= v1-19 (mc-status-code no-memory)) + "no-memory" + ) + ((= v1-19 (mc-status-code bad-handle)) + "bad-handle" + ) + ((= v1-19 (mc-status-code busy)) + "busy" + ) + ((= v1-19 (mc-status-code write-error)) + "write-error" + ) + ((= v1-19 (mc-status-code read-error)) + "read-error" + ) + ((= v1-19 (mc-status-code no-card)) + "no-card" + ) + ((= v1-19 (mc-status-code no-format)) + "no-format" + ) + ((= v1-19 (mc-status-code ok)) + "ok" + ) + ((= v1-19 (mc-status-code no-process)) + "no-process" + ) + ((= v1-19 (mc-status-code no-auto-save)) + "no-auto-save" + ) + ((= v1-19 (mc-status-code no-file)) + "no-file" + ) + ((= v1-19 (mc-status-code format-failed)) + "format-failed" + ) + ((= v1-19 (mc-status-code new-game)) + "new-game" + ) + (else + "*unknown*" ) - (-> self current) - (-> self next) ) + (-> self current) + (-> self next) ) - (case (-> event param 1) - ((14) - (set-next-state self 'insufficient-space 0) - ) - (else - (case (-> self current) - (('formatting 'format-card) - (set-next-state self 'error-formatting 0) - ) - (('creating) - (set-next-state self 'error-creating 0) - ) - (('saving 'select-save 'select-save-title 'select-save-title-hero) - (set-next-state self 'error-saving 0) - ) - (('loading 'select-load) - (set-next-state self 'error-loading 0) - ) - ) + ) + (case (-> block param 1) + ((14) + (set-next-state self 'insufficient-space 0) + ) + (else + (case (-> self current) + (('formatting 'format-card) + (set-next-state self 'error-formatting 0) + ) + (('creating) + (set-next-state self 'error-creating 0) + ) + (('saving 'select-save 'select-save-title 'select-save-title-hero) + (set-next-state self 'error-saving 0) + ) + (('loading 'select-load) + (set-next-state self 'error-loading 0) + ) ) ) ) - ) + ) ) - ) + ) ) ) :enter (behavior () (set! (-> self menu-transition) 1.0) - (none) ) :trans progress-trans :code (behavior () @@ -1766,7 +1757,6 @@ (suspend) ) #f - (none) ) :post progress-post ) @@ -1780,7 +1770,6 @@ (set! (-> v1-2 progress-interp-dest) 0.0) (set! (-> v1-2 progress-interp-speed) 0.022222223) ) - (none) ) :trans (behavior () (seek! (-> self anim-frame) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) @@ -1796,7 +1785,6 @@ ) ) (set-ring-position self) - (none) ) :code (behavior () (let ((gp-0 #f)) @@ -1810,7 +1798,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior progress) ja-post) ) @@ -1829,7 +1816,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak2/kernel/gkernel-h_REF.gc b/test/decompiler/reference/jak2/kernel/gkernel-h_REF.gc index 79830693ac7..b8acd5cae83 100644 --- a/test/decompiler/reference/jak2/kernel/gkernel-h_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gkernel-h_REF.gc @@ -393,6 +393,7 @@ ) ;; definition for method 3 of type dead-pool-heap +;; INFO: this function exists in multiple non-identical object files (defmethod inspect dead-pool-heap ((obj dead-pool-heap)) (when (not obj) (set! obj obj) @@ -556,13 +557,13 @@ ;; definition of type protect-frame (deftype protect-frame (stack-frame) - ((exit (function none) :offset-assert 12) + ((exit (function object) :offset-assert 12) ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 (:methods - (new (symbol type (function none)) protect-frame 0) + (new (symbol type (function object)) protect-frame 0) ) ) @@ -616,7 +617,7 @@ ;; definition of type state (deftype state (protect-frame) ((code function :offset-assert 16) - (trans (function none) :offset-assert 20) + (trans (function object) :offset-assert 20) (post function :offset-assert 24) (enter function :offset-assert 28) (event (function process int symbol event-message-block object) :offset-assert 32) @@ -625,7 +626,7 @@ :size-assert #x24 :flag-assert #x900000024 (:methods - (new (symbol type symbol function (function none) function (function none) (function process int symbol event-message-block object)) _type_ 0) + (new (symbol type symbol function (function object) function (function object) (function process int symbol event-message-block object)) _type_ 0) ) ) diff --git a/test/decompiler/reference/jak2/kernel/gkernel_REF.gc b/test/decompiler/reference/jak2/kernel/gkernel_REF.gc index a0e953383f6..adfc988c166 100644 --- a/test/decompiler/reference/jak2/kernel/gkernel_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gkernel_REF.gc @@ -1177,12 +1177,11 @@ ;; WARN: Return type mismatch symbol vs object. (defun sync-dispatcher () (let ((t9-0 *listener-function*)) - (the-as object (when t9-0 - (set! *listener-function* #f) - (t9-0) - #f - ) - ) + (when t9-0 + (set! *listener-function* #f) + (t9-0) + #f + ) ) ) @@ -1247,7 +1246,7 @@ ;; definition for method 0 of type protect-frame ;; WARN: Return type mismatch int vs protect-frame. -(defmethod new protect-frame ((allocation symbol) (type-to-make type) (arg0 (function none))) +(defmethod new protect-frame ((allocation symbol) (type-to-make type) (arg0 (function object))) (with-pp (let ((v0-0 (the-as object (+ (the-as int allocation) 4)))) (set! (-> (the-as protect-frame v0-0) type) type-to-make) diff --git a/test/decompiler/reference/jak2/kernel/gstate_REF.gc b/test/decompiler/reference/jak2/kernel/gstate_REF.gc index 161a1131e05..431cd2a2170 100644 --- a/test/decompiler/reference/jak2/kernel/gstate_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gstate_REF.gc @@ -6,9 +6,9 @@ (type-to-make type) (arg0 symbol) (arg1 function) - (arg2 (function none)) + (arg2 (function object)) (arg3 function) - (arg4 (function none)) + (arg4 (function object)) (arg5 (function process int symbol event-message-block object)) ) (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) diff --git a/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc b/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc index 64cdb444a07..f4962388d69 100644 --- a/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc @@ -54,13 +54,12 @@ ;; failed to figure out what this is: (defstate idle (piston) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('sync) - (-> self sync) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('sync) + (-> self sync) + ) + ) ) :trans (behavior () (cond @@ -87,7 +86,6 @@ (go-virtual running) ) ) - (none) ) :code (the-as (function none :behavior piston) sleep-code) ) @@ -107,7 +105,6 @@ (let ((f1-1 (- (-> self range-top) (-> self range-bottom)))) (set! (-> self root trans y) (+ (-> self init-height) (+ (-> self range-bottom) f1-1))) ) - (none) ) :code (the-as (function none :behavior piston) transform-and-sleep) ) @@ -120,7 +117,6 @@ (if (logtest? (actor-option user18) (-> self fact options)) (set! (-> self sound-time 0) (+ (get-timeframe-offset! (-> self sync) 0) (seconds -0.1))) ) - (none) ) :trans (the-as (function none :behavior piston) rider-trans) :code (the-as (function none :behavior piston) sleep-code) @@ -136,7 +132,6 @@ (+! (-> self sound-time 0) (the int (* 0.5 (the float (-> self sync period))))) ) (rider-post) - (none) ) ) @@ -288,8 +283,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (turbine) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('rise) (go-virtual risen) ) @@ -300,7 +295,6 @@ This commonly includes things such as: (go-virtual risen) ) (rider-trans) - (none) ) :code (the-as (function none :behavior turbine) sleep-code) :post (behavior () @@ -312,7 +306,6 @@ This commonly includes things such as: ) (update! (-> self sound)) (rider-post) - (none) ) ) @@ -321,7 +314,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self dest-height) (+ (-> self root trans y) (-> self rise-height))) - (none) ) :trans (the-as (function none :behavior turbine) rider-trans) :code (the-as (function none :behavior turbine) sleep-code) @@ -334,7 +326,6 @@ This commonly includes things such as: ) (update! (-> self sound)) (rider-post) - (none) ) ) @@ -450,8 +441,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle-up (liftcat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden 'edge-grabbed) (go-virtual going-down) ) @@ -468,18 +459,16 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate going-down (liftcat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('query) - 1 - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('query) + 1 + ) + ) ) :enter (behavior () (set! (-> self state-time) (current-time)) (sound-play "liftcat") - (none) ) :trans (behavior () (rider-trans) @@ -496,7 +485,6 @@ This commonly includes things such as: (set! (-> gp-0 trans y) (-> self down-y)) ) ) - (none) ) :code (the-as (function none :behavior liftcat) sleep-code) :post (the-as (function none :behavior liftcat) rider-post) @@ -505,17 +493,15 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle-down (liftcat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('query) - 2 - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('query) + 2 + ) + ) ) :enter (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (none) ) :code (the-as (function none :behavior liftcat) sleep-code) ) @@ -671,7 +657,6 @@ This commonly includes things such as: (quaternion*! (-> self root quat) (-> self init-quat) a2-1) ) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -724,11 +709,9 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (rider-post) - (none) ) ) @@ -848,44 +831,41 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (slider) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touch 'attack) - (when (>= (- (current-time) (the-as int (-> self collide-off-timer))) (seconds 2)) - (let* ((s4-0 proc) - (s3-0 (if (type? s4-0 process-focusable) - s4-0 - ) - ) - ) - (when s3-0 - (let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) - (let* ((v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s3-0) 0))) - (f0-1 (vector-dot s4-1 v1-7)) - ) - (if (< 0.0 f0-1) - (vector-float*! s4-1 s4-1 -1.0) - ) - ) - (sound-play "slide-zap") - (send-event - proc - 'attack-or-shove - (-> event param 0) - (static-attack-info ((id (-> self attack-id)) (vector s4-1) (shove-back (meters 8)) (shove-up (meters 3)))) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (when (>= (- (current-time) (the-as int (-> self collide-off-timer))) (seconds 2)) + (let* ((s4-0 proc) + (s3-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when s3-0 + (let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (let* ((v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s3-0) 0))) + (f0-1 (vector-dot s4-1 v1-7)) + ) + (if (< 0.0 f0-1) + (vector-float*! s4-1 s4-1 -1.0) + ) ) - (let ((v0-0 (current-time))) - (set! (-> self collide-off-timer) (the-as uint v0-0)) - v0-0 + (sound-play "slide-zap") + (send-event + proc + 'attack-or-shove + (-> block param 0) + (static-attack-info ((id (-> self attack-id)) (vector s4-1) (shove-back (meters 8)) (shove-up (meters 3)))) ) ) + (let ((v0-0 (current-time))) + (set! (-> self collide-off-timer) (the-as uint v0-0)) + v0-0 + ) ) ) ) - ) + ) ) ) :code (the-as (function none :behavior slider) sleep-code) @@ -927,7 +907,6 @@ This commonly includes things such as: (sound-play "slide-lightning" :id (the-as sound-id (-> self sound-id))) (update! (-> self sound)) (transform-post) - (none) ) ) @@ -1140,7 +1119,6 @@ This commonly includes things such as: (quaternion-normalize! (-> self root quat)) (update! (-> self sound)) (ja-post) - (none) ) ) @@ -1378,7 +1356,6 @@ This commonly includes things such as: :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/atoll/atoll-tank_REF.gc b/test/decompiler/reference/jak2/levels/atoll/atoll-tank_REF.gc index e27b5ba98d0..eb851f77c2d 100644 --- a/test/decompiler/reference/jak2/levels/atoll/atoll-tank_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/atoll-tank_REF.gc @@ -1779,7 +1779,6 @@ (if (-> self is-master?) (spawn (-> self aftermath-part) (-> self root trans)) ) - (none) ) :code (behavior () (when (-> self is-master?) @@ -1787,7 +1786,6 @@ (process-spawn atoll-tank self 2 :to self) ) (sleep-code) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc b/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc index 3d74b434505..f84cd0d7a18 100644 --- a/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc @@ -162,7 +162,6 @@ :virtual #t :enter (behavior () (go-virtual impact) - (none) ) ) @@ -1003,7 +1002,6 @@ ) ) #f - (none) ) ) @@ -1024,6 +1022,7 @@ ) ;; definition for method 93 of type juicer +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-93 juicer ((obj juicer)) (case (-> obj jump-why) ((2) @@ -1050,7 +1049,6 @@ (go-virtual notice) ) (get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp) - (none) ) :code (behavior () (set! (-> self ambush-path-pt) 1) @@ -1072,7 +1070,6 @@ (suspend) ) #f - (none) ) ) @@ -1107,7 +1104,6 @@ (suspend) ) #f - (none) ) ) @@ -1157,7 +1153,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -1179,7 +1174,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -1193,7 +1187,6 @@ ) ) (set! (-> self focus-is-up) #f) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) @@ -1201,7 +1194,6 @@ (t9-0) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -1232,7 +1224,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -1300,7 +1291,6 @@ ) ) (nav-enemy-travel-post) - (none) ) ) @@ -1400,7 +1390,6 @@ (set! (-> v1-9 attack-id) v0-0) (set! (-> self attack-id) v0-0) ) - (none) ) :exit (behavior () (set! (-> self torso-track-player) #f) @@ -1412,12 +1401,10 @@ (logclear! (-> self focus-status) (focus-status dangerous)) ) (send-event (handle->process (-> self current-projectile)) 'die) - (none) ) :trans (behavior () (when (skip-check-los? (-> self los) 90) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1499,7 +1486,6 @@ (go-virtual victory) ) (go-hostile self) - (none) ) :post juicer-face-player-post ) @@ -1583,7 +1569,6 @@ ) ) #f - (none) ) ) @@ -1635,7 +1620,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (go-virtual hostile) - (none) ) ) @@ -1659,7 +1643,6 @@ ) ) #f - (none) ) ) @@ -1700,7 +1683,6 @@ ) ) (go-virtual stare) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/atoll/sniper_REF.gc b/test/decompiler/reference/jak2/levels/atoll/sniper_REF.gc index f66d4559188..2d19592a83e 100644 --- a/test/decompiler/reference/jak2/levels/atoll/sniper_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/sniper_REF.gc @@ -268,7 +268,6 @@ ) ) (set! (-> self next-pick-time) (current-time)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -292,7 +291,6 @@ ) ) #f - (none) ) :post (behavior () (when (or (logtest? (-> self nav state flags) (nav-state-flag at-target)) @@ -304,7 +302,6 @@ (set! (-> self next-pick-time) (+ (current-time) (get-rand-int-range self 300 1050))) ) (nav-enemy-method-176 self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc b/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc index ef419cc9678..d472c004c60 100644 --- a/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc @@ -47,7 +47,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior cboss-tractor) ja-post) ) @@ -112,7 +111,6 @@ This commonly includes things such as: ) ) (process-grab? *target* #f) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type elevator running) exit))) @@ -123,7 +121,6 @@ This commonly includes things such as: (process-release? *target*) (sound-stop (-> self sound-id)) (sound-play "cas-elevate-end") - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type elevator running) post))) @@ -132,7 +129,6 @@ This commonly includes things such as: ) ) (sound-play "cas-elevate" :id (-> self sound-id) :position (-> self root trans)) - (none) ) ) @@ -975,11 +971,9 @@ For example for an elevator pre-compute the distance between the first and last ) :enter (behavior () (sound-play "krew-spawn") - (none) ) :exit (behavior () (set! (-> self id) (sound-play "krew-travel")) - (none) ) :trans (behavior () (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans))) @@ -992,7 +986,6 @@ For example for an elevator pre-compute the distance between the first and last (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (vector-y-angle a0-8)) ) ) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 12) @@ -1004,7 +997,6 @@ For example for an elevator pre-compute the distance between the first and last (ja :num! (seek!)) ) (go-virtual hostile) - (none) ) :post (behavior () (logior! (-> self enemy-flags) (enemy-flag directed)) @@ -1023,7 +1015,6 @@ For example for an elevator pre-compute the distance between the first and last ) (enemy-method-111 self) (track-target! self) - (none) ) ) @@ -1037,7 +1028,6 @@ For example for an elevator pre-compute the distance between the first and last (t9-2) ) ) - (none) ) ) @@ -1215,10 +1205,8 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 68 of type krew-boss-clone -;; WARN: Return type mismatch object vs none. (defmethod go-stare2 krew-boss-clone ((obj krew-boss-clone)) (go (method-of-object obj hostile)) - (none) ) ;; failed to figure out what this is: @@ -1236,7 +1224,6 @@ For example for an elevator pre-compute the distance between the first and last (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)) :num! min) ) ) - (none) ) :code (behavior () (set! (-> self wiggle-time) (+ (current-time) (seconds -10))) @@ -1252,12 +1239,10 @@ For example for an elevator pre-compute the distance between the first and last ) ) #f - (none) ) :post (behavior () (krew-boss-clone-method-179 self (target-pos 0)) (nav-enemy-method-176 self) - (none) ) ) @@ -1301,7 +1286,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (none) ) :code (behavior () (while (not (ja-done? 0)) @@ -1313,7 +1297,6 @@ For example for an elevator pre-compute the distance between the first and last (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior krew-boss-clone) enemy-simple-post) ) @@ -2109,8 +2092,8 @@ For example for an elevator pre-compute the distance between the first and last ;; failed to figure out what this is: (defstate hidden (krew-boss) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual play-intro) ) @@ -2124,13 +2107,11 @@ For example for an elevator pre-compute the distance between the first and last ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :trans (behavior () (if (task-node-closed? (game-task-node castle-boss-introduction)) (go-virtual play-intro) ) - (none) ) :code (the-as (function none :behavior krew-boss) sleep-code) ) @@ -2145,7 +2126,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> v1-5 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :code (behavior () (when (not (task-node-closed? (game-task-node castle-boss-introduction))) @@ -2159,7 +2139,6 @@ For example for an elevator pre-compute the distance between the first and last (suspend) ) (go-virtual idle) - (none) ) ) @@ -2297,7 +2276,6 @@ For example for an elevator pre-compute the distance between the first and last (krew-hit-speech self) (logclear! (-> self enemy-flags) (enemy-flag enable-on-active)) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) - (none) ) :exit (behavior () (local-vars (v1-5 enemy-flag)) @@ -2318,7 +2296,6 @@ For example for an elevator pre-compute the distance between the first and last (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) ) - (none) ) :post (behavior () (logior! (-> self enemy-flags) (enemy-flag directed)) @@ -2350,7 +2327,6 @@ For example for an elevator pre-compute the distance between the first and last (enemy-method-111 self) (nav-enemy-method-142 self (-> self nav)) (track-target! self) - (none) ) ) @@ -2458,7 +2434,6 @@ For example for an elevator pre-compute the distance between the first and last ) 0 (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) - (none) ) :exit (behavior () (set! (-> self next-shooting-frame) 200) @@ -2475,7 +2450,6 @@ For example for an elevator pre-compute the distance between the first and last (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -2487,7 +2461,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) #f - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type nav-enemy idle) post))) @@ -2499,7 +2472,6 @@ For example for an elevator pre-compute the distance between the first and last (seek! (-> self root trans y) 1470464.0 (* 204.8 (-> self clock time-adjust-ratio))) ) (nav-enemy-method-176 self) - (none) ) ) @@ -2674,14 +2646,12 @@ For example for an elevator pre-compute the distance between the first and last (send-event *target* 'get-notify self) ) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) - (none) ) :exit (behavior () (if (logtest? (enemy-flag enemy-flag43) (-> 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)) ) - (none) ) :trans (behavior () (local-vars (v1-25 enemy-flag)) @@ -2734,7 +2704,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (none) ) :code (behavior () (ja-channel-push! 2 (seconds 0.1)) @@ -2758,7 +2727,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) #f - (none) ) :post (behavior () (let ((a0-0 self)) @@ -2880,7 +2848,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (none) ) ) @@ -2952,21 +2919,17 @@ For example for an elevator pre-compute the distance between the first and last ) (iterate-process-tree *entity-pool* - (the-as - (function object object) - (lambda ((arg0 collectable)) - (if (and (or (type? arg0 ammo-collectable) (type? arg0 health)) - (and (nonzero? (-> arg0 root)) (>= 819200.0 (vector-vector-distance (-> arg0 root trans) (target-pos 0)))) - ) - (deactivate arg0) - ) - (none) - ) + (lambda ((arg0 collectable)) + (if (and (or (type? arg0 ammo-collectable) (type? arg0 health)) + (and (nonzero? (-> arg0 root)) (>= 819200.0 (vector-vector-distance (-> arg0 root trans) (target-pos 0)))) + ) + (deactivate arg0) + ) + (none) ) *null-kernel-context* ) (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy die) exit))) @@ -2978,7 +2941,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> v1-4 sphere-mask) (the-as uint #x800f8)) ) 0 - (none) ) :trans (behavior () (let ((f30-0 (vector-vector-xz-distance (target-pos 0) (-> *krew-boss-die-positions* (-> self next-path-point))))) @@ -2998,7 +2960,6 @@ For example for an elevator pre-compute the distance between the first and last 0 ) ) - (none) ) :code (behavior () (while (< 81920.0 @@ -3049,11 +3010,9 @@ For example for an elevator pre-compute the distance between the first and last (suspend) ) (cleanup-for-death self) - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc b/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc index ab855b85ffa..b21e7662bf9 100644 --- a/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc @@ -167,7 +167,6 @@ This commonly includes things such as: ((the-as (function none) t9-3)) ) ) - (none) ) ) @@ -251,10 +250,10 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (cas-conveyor-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((v1-1 (the-as object (-> event param 1)))) + (let ((v1-1 (the-as object (-> block param 1)))) (when (!= (-> (the-as attack-info v1-1) id) (-> self incoming-attack-id)) (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-1) id)) (when (and (-> self track-flag) (= (-> self speed) (-> self target-speed))) @@ -329,7 +328,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior cas-conveyor-switch) sleep-code) :post (behavior () @@ -402,7 +400,6 @@ This commonly includes things such as: ) ) (transform-post) - (none) ) ) @@ -554,7 +551,6 @@ This commonly includes things such as: ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (behavior () (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -576,35 +572,33 @@ This commonly includes things such as: ) ) (cleanup-for-death self) - (none) ) ) ;; failed to figure out what this is: (defstate idle (cas-electric-fence) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touched) - #f - ) - (('attack) - #f - ) - (('track) - #t - ) - (('stop) - (let ((v0-0 #t)) - (set! (-> self stop) v0-0) - v0-0 - ) - ) - (('stopped?) - (-> self stop) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + #f + ) + (('attack) + #f + ) + (('track) + #t + ) + (('stop) + (let ((v0-0 #t)) + (set! (-> self stop) v0-0) + v0-0 + ) + ) + (('stopped?) + (-> self stop) + ) + ) ) :code (the-as (function none :behavior cas-electric-fence) sleep-code) :post (behavior () @@ -712,7 +706,6 @@ This commonly includes things such as: ) ) ) - (none) ) ) @@ -831,10 +824,10 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate up-idle (cas-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((v1-1 (the-as attack-info (-> event param 1)))) + (let ((v1-1 (the-as attack-info (-> block param 1)))) (case (-> v1-1 mode) (('flop) (when (or (not (or (= (-> v1-1 mode) 'spin) (= (-> v1-1 mode) 'punch))) @@ -993,7 +986,6 @@ This commonly includes things such as: ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -1007,7 +999,6 @@ This commonly includes things such as: ) ) (sound-play "cas-elevate" :id (-> self sound-id) :position (-> self root trans)) - (none) ) :post (behavior () (cas-elevator-method-49 self) @@ -1035,7 +1026,6 @@ This commonly includes things such as: (-> gp-0 id) ) ) - (none) ) ) @@ -1050,7 +1040,6 @@ This commonly includes things such as: ) (sound-stop (-> self sound-id)) (sound-play "cas-elevate-end") - (none) ) :post (behavior () (if (-> self bouncing) @@ -1061,7 +1050,6 @@ This commonly includes things such as: ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -1161,70 +1149,69 @@ For example for an elevator pre-compute the distance between the first and last ;; failed to figure out what this is: (defstate idle (cas-rot-bridge) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 number)) - (the-as object (case event-type - (('move) - (set! (-> self anim-index) (/ (the-as int (-> event param 0)) 8)) - (set! v0-0 (logclear (-> self mask) (process-mask sleep-code))) - (set! (-> self mask) (the-as process-mask v0-0)) - v0-0 - ) - (('get-pos) - (set! (-> self test-index) (/ (the-as int (-> event param 0)) 8)) - (let ((f0-0 (ja-aframe-num 0))) - (cond - ((zero? (-> self test-index)) - (if (< f0-0 10.0) - (set! f0-0 10.0) - ) - (if (< 40.0 f0-0) - (set! f0-0 40.0) - ) - (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) - ) - ((= (-> self test-index) 1) - (if (< f0-0 50.0) - (set! f0-0 50.0) - ) - (if (< 80.0 f0-0) - (set! f0-0 80.0) - ) - (set! (-> self pos) (* 0.033333335 (+ -50.0 f0-0))) - ) - ((= (-> self test-index) 2) - (if (< f0-0 90.0) - (set! f0-0 90.0) - ) - (if (< 120.0 f0-0) - (set! f0-0 120.0) - ) - (set! (-> self pos) (* 0.033333335 (+ -90.0 f0-0))) - ) - ((= (-> self test-index) 3) - (if (< f0-0 10.0) - (set! f0-0 10.0) - ) - (if (< 40.0 f0-0) - (set! f0-0 40.0) - ) - (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) - ) - ) - ) - (-> self pos) - ) - (('reset) - (when (nonzero? (-> self anim-index)) - (ja-no-eval :group! (-> self draw art-group data 3) :num! min) - (set! (-> self anim-index) (the-as uint 0)) - (set! v0-0 (logclear (-> self mask) (process-mask sleep-code))) - (set! (-> self mask) (the-as process-mask v0-0)) - v0-0 - ) - ) - ) + (case message + (('move) + (set! (-> self anim-index) (/ (the-as int (-> block param 0)) 8)) + (set! v0-0 (logclear (-> self mask) (process-mask sleep-code))) + (set! (-> self mask) (the-as process-mask v0-0)) + v0-0 + ) + (('get-pos) + (set! (-> self test-index) (/ (the-as int (-> block param 0)) 8)) + (let ((f0-0 (ja-aframe-num 0))) + (cond + ((zero? (-> self test-index)) + (if (< f0-0 10.0) + (set! f0-0 10.0) + ) + (if (< 40.0 f0-0) + (set! f0-0 40.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) + ) + ((= (-> self test-index) 1) + (if (< f0-0 50.0) + (set! f0-0 50.0) + ) + (if (< 80.0 f0-0) + (set! f0-0 80.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -50.0 f0-0))) + ) + ((= (-> self test-index) 2) + (if (< f0-0 90.0) + (set! f0-0 90.0) + ) + (if (< 120.0 f0-0) + (set! f0-0 120.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -90.0 f0-0))) + ) + ((= (-> self test-index) 3) + (if (< f0-0 10.0) + (set! f0-0 10.0) + ) + (if (< 40.0 f0-0) + (set! f0-0 40.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) ) + ) + ) + (-> self pos) + ) + (('reset) + (when (nonzero? (-> self anim-index)) + (ja-no-eval :group! (-> self draw art-group data 3) :num! min) + (set! (-> self anim-index) (the-as uint 0)) + (set! v0-0 (logclear (-> self mask) (process-mask sleep-code))) + (set! (-> self mask) (the-as process-mask v0-0)) + v0-0 + ) + ) + ) ) :code (behavior () (until #f @@ -1338,7 +1325,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) #f - (none) ) :post (behavior () (let ((f0-0 (ja-aframe-num 0))) @@ -1431,7 +1417,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) (transform-post) - (none) ) ) @@ -1588,37 +1573,34 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (cas-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (let ((gp-0 (the-as attack-info (-> event param 1)))) - (when (or (= (-> gp-0 mode) 'spin) (= (-> gp-0 mode) 'spin-air)) - (let* ((s5-0 (the-as object (-> event param 0))) - (s4-0 (-> (the-as touching-shapes-entry s5-0) head)) - ) - (while s4-0 - (let ((a0-2 (get-touched-prim s4-0 (the-as collide-shape (-> self root)) (the-as touching-shapes-entry s5-0)))) - (when (= (-> a0-2 prim-id) 1) - (when (!= (-> gp-0 id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> gp-0 id)) - (let ((s3-0 (-> self actor-group 0))) - (dotimes (s2-0 (-> s3-0 length)) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) (process->ppointer self)) - (set! (-> a1-6 num-params) 1) - (set! (-> a1-6 message) 'move) - (set! (-> a1-6 param 0) (* (-> self anim-index) 8)) - (let ((t9-1 send-event-function) - (v1-20 (-> s3-0 data s2-0 actor)) - ) - (t9-1 - (if v1-20 - (-> v1-20 extra process) - ) - a1-6 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((gp-0 (the-as attack-info (-> block param 1)))) + (when (or (= (-> gp-0 mode) 'spin) (= (-> gp-0 mode) 'spin-air)) + (let* ((s5-0 (the-as object (-> block param 0))) + (s4-0 (-> (the-as touching-shapes-entry s5-0) head)) + ) + (while s4-0 + (let ((a0-2 (get-touched-prim s4-0 (the-as collide-shape (-> self root)) (the-as touching-shapes-entry s5-0)))) + (when (= (-> a0-2 prim-id) 1) + (when (!= (-> gp-0 id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> gp-0 id)) + (let ((s3-0 (-> self actor-group 0))) + (dotimes (s2-0 (-> s3-0 length)) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 1) + (set! (-> a1-6 message) 'move) + (set! (-> a1-6 param 0) (* (-> self anim-index) 8)) + (let ((t9-1 send-event-function) + (v1-20 (-> s3-0 data s2-0 actor)) ) + (t9-1 + (if v1-20 + (-> v1-20 extra process) + ) + a1-6 ) ) ) @@ -1626,14 +1608,14 @@ This commonly includes things such as: ) ) ) - (set! s4-0 (-> s4-0 next)) ) + (set! s4-0 (-> s4-0 next)) ) - #f ) + #f ) ) - ) + ) ) ) :trans (the-as (function none :behavior cas-switch) rider-trans) @@ -1694,7 +1676,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior cas-switch) rider-post) ) @@ -1862,20 +1843,19 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (cas-trapdoor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('attack) - (let ((gp-0 (the-as object (-> event param 1)))) - (when (and (not (task-node-closed? (game-task-node castle-boss-resolution))) - (logtest? (-> (the-as attack-info gp-0) penetrate-using) (penetrate flop)) - ) - (go-virtual die) - #f - ) - ) - ) - ) - ) + :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 (not (task-node-closed? (game-task-node castle-boss-resolution))) + (logtest? (-> (the-as attack-info gp-0) penetrate-using) (penetrate flop)) + ) + (go-virtual die) + #f + ) + ) + ) + ) ) :code (the-as (function none :behavior cas-trapdoor) sleep-code) ) @@ -1915,7 +1895,6 @@ This commonly includes things such as: :to self ) ) - (none) ) :code (behavior () (sound-play "trapdoor") @@ -1931,7 +1910,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior cas-trapdoor) ja-post) ) @@ -2018,8 +1996,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (cas-chain-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (sound-play "cas-shelf-plat") (go-virtual drop) @@ -2046,7 +2024,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (go-virtual down) - (none) ) :post (the-as (function none :behavior cas-chain-plat) transform-post) ) @@ -2157,26 +2134,23 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (cas-rot-blade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touched) - (let* ((s4-0 (the-as object (-> event param 0))) - (s3-0 (-> (the-as touching-shapes-entry s4-0) head)) - ) - (while s3-0 - (let ((a0-3 (get-touched-prim s3-0 (the-as collide-shape (-> self root)) (the-as touching-shapes-entry s4-0)))) - (if (= (-> a0-3 prim-id) 1) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (new-attack-id))))) - ) - ) - (set! s3-0 (-> s3-0 next)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (let* ((s4-0 (the-as object (-> block param 0))) + (s3-0 (-> (the-as touching-shapes-entry s4-0) head)) + ) + (while s3-0 + (let ((a0-3 (get-touched-prim s3-0 (the-as collide-shape (-> self root)) (the-as touching-shapes-entry s4-0)))) + (if (= (-> a0-3 prim-id) 1) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (new-attack-id))))) + ) ) + (set! s3-0 (-> s3-0 next)) ) - #f ) - ) + #f + ) ) ) :trans (behavior () @@ -2187,7 +2161,6 @@ This commonly includes things such as: :id (-> self sound-id) :position (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)) ) - (none) ) :code (behavior () (until #f @@ -2201,7 +2174,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior cas-rot-blade) transform-post) ) @@ -2333,7 +2305,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior cas-flag-a) ja-post) ) @@ -2404,7 +2375,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior cas-flag-b) ja-post) ) @@ -2492,8 +2462,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (cas-robot-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual spawning) ) @@ -2501,7 +2471,6 @@ This commonly includes things such as: ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.6)) @@ -2515,7 +2484,6 @@ This commonly includes things such as: ) (set! (-> self state-time) (current-time)) ) - (none) ) :code (the-as (function none :behavior cas-robot-door) sleep-code) ) @@ -2523,23 +2491,21 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate spawning (cas-robot-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('roboguard-die) - (let ((v0-0 (+ (-> self spawn-count) -1))) - (set! (-> self spawn-count) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('roboguard-die) + (let ((v0-0 (+ (-> self spawn-count) -1))) + (set! (-> self spawn-count) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self spawn-count) 0) (set! (-> self spawn-count-total) 0) (set! (-> self player-dist) (-> self notice-dist)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.6)) @@ -2550,7 +2516,6 @@ This commonly includes things such as: ) (set! (-> self state-time) (current-time)) ) - (none) ) :code (behavior () (sound-play "robo-hatch-open") @@ -2713,11 +2678,9 @@ This commonly includes things such as: (suspend) ) (sleep-code) - (none) ) :post (behavior () '() - (none) ) ) @@ -2813,7 +2776,6 @@ This commonly includes things such as: (suspend) ) (sleep-code) - (none) ) ) @@ -2986,7 +2948,6 @@ This commonly includes things such as: ) (set! (-> self timer) (current-time)) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/castle/pad/caspad-obs_REF.gc b/test/decompiler/reference/jak2/levels/castle/pad/caspad-obs_REF.gc index 1242b03b22c..1ead0f62fa2 100644 --- a/test/decompiler/reference/jak2/levels/castle/pad/caspad-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/pad/caspad-obs_REF.gc @@ -114,7 +114,6 @@ (configure-collision self #t) (set-setting! 'jump #f 0.0 0) ) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) @@ -124,7 +123,6 @@ (func) ) ) - (none) ) :code (behavior () (let ((frame-counter (current-time))) @@ -141,7 +139,6 @@ ) ) #f - (none) ) ) @@ -158,7 +155,6 @@ (configure-collision self #f) (remove-setting! 'jump) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc b/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc index cf918fa718a..5bd1ada7009 100644 --- a/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc @@ -395,7 +395,6 @@ (point-toward-point! (-> self root) (get-trans (the-as process-focusable a0-11) 0)) ) ) - (none) ) :exit (behavior () (logclear! (-> self nav flags) (nav-control-flag output-sphere-hash)) @@ -403,7 +402,6 @@ (logclear! (-> v1-2 shape nav-flags) (nav-flags has-extra-sphere)) ) 0 - (none) ) :code (behavior () (let ((a0-0 (-> self skel root-channel 0))) @@ -417,7 +415,6 @@ ) (sound-play "robo-bounce") (go-virtual roll-hostile) - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'vector))) @@ -427,7 +424,6 @@ (nav-enemy-falling-post) ) ) - (none) ) ) @@ -441,7 +437,6 @@ ) ) (roboguard-level-method-185 self (the-as symbol 0)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -511,7 +506,6 @@ ) ) #f - (none) ) :post (behavior () (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) @@ -519,7 +513,6 @@ ) (enemy-method-129 self) (ja-post) - (none) ) ) @@ -533,7 +526,6 @@ ) ) (roboguard-level-method-185 self (the-as symbol 0)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -547,7 +539,6 @@ ) ) #f - (none) ) ) @@ -558,7 +549,6 @@ (logior! (-> self flags) 4) (roboguard-level-method-185 self (the-as symbol 1)) (logand! (-> self flags) -9) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 9) @@ -570,7 +560,6 @@ (ja :num! (seek!)) ) (go-virtual roll-hostile) - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'collide-query)) @@ -581,7 +570,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -630,7 +618,6 @@ (set! (-> self roll-timer) 0) (set! (-> self roll-attack-count) (the-as uint 0)) 0 - (none) ) :exit (behavior () (sound-stop (-> self roll-sound)) @@ -638,7 +625,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (let ((a0-0 (static-sound-spec "robo-roll"))) @@ -726,7 +712,6 @@ (if (>= (-> self roll-attack-count) (the-as uint 3)) (go-virtual roll-to-walk) ) - (none) ) :code (behavior () (ja :group! (-> self draw art-group data 10)) @@ -744,7 +729,6 @@ (suspend) ) #f - (none) ) :post roboguard-roll-travel-post ) @@ -758,7 +742,6 @@ ) :enter (behavior () '() - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 27) @@ -774,7 +757,6 @@ (ja :num! (seek!)) ) (go-virtual idle-dizzy) - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'collide-query)) @@ -785,7 +767,6 @@ ) ) (nav-enemy-face-focus-post) - (none) ) ) @@ -799,7 +780,6 @@ :enter (behavior () (logand! (-> self flags) -5) (roboguard-level-method-185 self (the-as symbol 0)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -812,19 +792,15 @@ (ja :num! (seek!)) ) (go-virtual roll-enter) - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) ;; definition for method 70 of type roboguard-level -;; WARN: Return type mismatch object vs none. (defmethod go-hostile roboguard-level ((obj roboguard-level)) (go (method-of-object obj roll-enter)) - (none) ) ;; failed to figure out what this is: @@ -837,7 +813,6 @@ ) ) (roboguard-level-method-185 self (the-as symbol 0)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -879,7 +854,6 @@ ) ) (go-virtual explode) - (none) ) ) @@ -901,7 +875,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior roboguard-level) #f) ) diff --git a/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc b/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc index 2ab826e5ff2..f1ff921accd 100644 --- a/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc @@ -1477,7 +1477,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -1952,7 +1951,6 @@ ) (logior! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (+! (-> self shield-hit-points) -1.0) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) @@ -1963,7 +1961,6 @@ (sound-stop (-> self lazer-sound)) (sound-stop (-> self head-sound)) (sound-stop (-> self cannon-sound)) - (none) ) :trans (behavior () (rlet ((acc :class vf) @@ -2115,7 +2112,6 @@ ) ) (bombbot-method-180 self) - (none) ) ) :code (behavior () @@ -2131,7 +2127,6 @@ ) ) #f - (none) ) :post (behavior () (-> self current-node) @@ -2171,7 +2166,6 @@ ) ) ) - (none) ) ) @@ -2186,7 +2180,6 @@ (set! (-> self explosing) #f) (set! (-> self beep-time) 0) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (let ((v1-0 (-> self nav))) @@ -2217,7 +2210,6 @@ (+ (current-time) (the int (* 0.2 (the float (- (seconds 2.8) (- (current-time) (-> self state-time))))))) ) ) - (none) ) :code (behavior () (until #f @@ -2232,11 +2224,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -2313,13 +2303,11 @@ 0 (ja-channel-set! 0) (ja-post) - (none) ) :code (behavior () (while (-> self child) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/burning-bush/ctywide-bbush_REF.gc b/test/decompiler/reference/jak2/levels/city/burning-bush/ctywide-bbush_REF.gc index f7503d5a103..dc173eaccae 100644 --- a/test/decompiler/reference/jak2/levels/city/burning-bush/ctywide-bbush_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/burning-bush/ctywide-bbush_REF.gc @@ -351,7 +351,6 @@ ) ) ) - (none) ) :exit (behavior () (let ((a0-1 (handle->process (-> self part-track)))) @@ -393,7 +392,6 @@ ) ) ) - (none) ) :trans (behavior () (cond @@ -465,14 +463,12 @@ (set! (-> self last-target-pos quad) (-> gp-1 quad)) ) ) - (none) ) :code (behavior () (until #f (suspend) ) #f - (none) ) :post (the-as (function none :behavior race-ring) ja-post) ) @@ -485,7 +481,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -1774,8 +1769,8 @@ ;; failed to figure out what this is: (defstate idle (bush-collect) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (sound-play "homeing-pickup") (go-virtual die) @@ -1784,11 +1779,9 @@ ) :enter (behavior () '() - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (let ((f30-0 (+ (* 0.0033333334 (the float (current-time))) (* 0.1 (the float (-> self pid)))))) @@ -1824,12 +1817,10 @@ ) ) ) - (none) ) :code (the-as (function none :behavior bush-collect) sleep-code) :post (behavior () (ja-post) - (none) ) ) @@ -1838,7 +1829,6 @@ :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/common/pilot-states_REF.gc b/test/decompiler/reference/jak2/levels/city/common/pilot-states_REF.gc index df8962c8802..028c1c3ca77 100644 --- a/test/decompiler/reference/jak2/levels/city/common/pilot-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/pilot-states_REF.gc @@ -13,7 +13,6 @@ (go target-pilot-stance) (go target-pilot-get-on) ) - (none) ) :post target-post ) @@ -242,7 +241,6 @@ :exit (the-as (function none :behavior target) target-pilot-exit) :trans (behavior () (target-pilot-trans) - (none) ) :code (behavior () (target-pilot-signal-ready) @@ -260,11 +258,9 @@ (target-pilot-car-anim-loop) ) ) - (none) ) :post (behavior () (target-pilot-post) - (none) ) ) @@ -274,7 +270,6 @@ :exit (the-as (function none :behavior target) target-pilot-exit) :trans (behavior () (target-pilot-trans) - (none) ) :code (behavior () (local-vars (v1-1 float) (v1-252 int)) @@ -495,12 +490,10 @@ (.svf (&-> (-> gp-0 accel-array) 0 quad) vf0) ) (go target-pilot-stance) - (none) ) ) :post (behavior () (target-pilot-post) - (none) ) ) @@ -512,8 +505,8 @@ ;; failed to figure out what this is: (defstate target-pilot-get-on (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('end-mode) (cond ((focus-test? self pilot-riding) @@ -526,7 +519,7 @@ ) ) (else - (target-standard-event-handler proc arg1 event-type event) + (target-standard-event-handler proc argc message block) ) ) ) @@ -585,7 +578,6 @@ (ja :num! (seek!)) ) (go target-pilot-stance) - (none) ) :post target-no-move-post ) @@ -628,7 +620,6 @@ (go target-falling #f) ) ) - (none) ) :code (behavior () (local-vars (f30-0 float)) @@ -684,31 +675,30 @@ (vector+! (-> self control transv) (-> self control transv) (-> gp-2 2)) ) (go target-jump 10240.0 10240.0 *pilot-get-off-mods*) - (none) ) :post target-pilot-post ) ;; failed to figure out what this is: (defstate target-pilot-grab (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) + ((and (= message 'query) (= (-> block param 0) 'mode)) (-> self state name) ) (else - (case event-type + (case message (('end-mode) (go target-pilot-stance) ) (('clone-anim) - (go target-pilot-clone-anim (process->handle (the-as process (-> event param 0)))) + (go target-pilot-clone-anim (process->handle (the-as process (-> block param 0)))) ) (('vehicle-crash) (go target-grab 'stance) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -719,14 +709,12 @@ (set! (-> self neck flex-blend) 0.0) (logior! (-> self state-flags) (state-flags sf2)) (logior! (-> self focus-status) (focus-status grabbed)) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags sf2)) (logclear! (-> self focus-status) (focus-status grabbed)) (logclear! (-> self water flags) (water-flags jump-out)) ((-> target-pilot-start exit)) - (none) ) :code (behavior () (until #f @@ -734,18 +722,17 @@ (suspend) ) #f - (none) ) :post target-pilot-post ) ;; failed to figure out what this is: (defstate target-pilot-clone-anim (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) (set! (-> self control unknown-word04) (the-as uint #f)) ) - ((-> target-pilot-grab event) proc arg1 event-type event) + ((-> target-pilot-grab event) proc argc message block) ) :enter (-> target-clone-anim enter) :exit (behavior () @@ -755,7 +742,6 @@ ((-> target-clone-anim exit)) ((-> target-pilot-start exit)) (vector-reset! (-> self control transv)) - (none) ) :code (behavior ((arg0 handle)) (set! (-> self control unknown-word04) (the-as uint (-> self control draw-offset y))) @@ -763,14 +749,12 @@ (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (clone-anim arg0 #t "") (go target-pilot-stance) - (none) ) :post (behavior () (vector+! (-> self pilot pilot-trans) (-> self control trans) (-> self control cspace-offset)) (quaternion-copy! (the-as quaternion (-> self pilot pilot-quat)) (-> self control quat)) (set! (-> self pilot pilot-scale quad) (-> self control scale quad)) (target-no-ja-move-post) - (none) ) ) @@ -801,7 +785,6 @@ ) ) ) - (none) ) :exit (-> target-edge-grab exit) :trans (-> target-edge-grab trans) @@ -817,7 +800,6 @@ (logclear! (-> self focus-status) (focus-status dead hit)) ) ((-> target-pilot-start exit)) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (local-vars (sv-16 attack-info)) @@ -838,7 +820,6 @@ (combine! sv-16 arg1 self) (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) (go target-pilot-death (-> sv-16 mode)) - (none) ) :post target-no-stick-post ) @@ -849,7 +830,6 @@ :exit (behavior () ((-> target-pilot-start exit)) ((-> target-death exit)) - (none) ) :code (behavior ((arg0 symbol)) (set! (-> self control unknown-word04) (the-as uint #f)) @@ -1057,7 +1037,6 @@ ) ) (target-death-reset arg0 #f) - (none) ) :post target-pilot-post ) diff --git a/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc b/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc index 28aecb203f6..0f6e1db36e5 100644 --- a/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc @@ -76,7 +76,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior searchlight) ja-post) ) @@ -121,7 +120,3 @@ This commonly includes things such as: (go (method-of-object obj idle)) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/city/common/target-pilot_REF.gc b/test/decompiler/reference/jak2/levels/city/common/target-pilot_REF.gc index efc95ce092a..6a3d7b6ded8 100644 --- a/test/decompiler/reference/jak2/levels/city/common/target-pilot_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/target-pilot_REF.gc @@ -18,87 +18,84 @@ ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 47] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 9] (defbehavior target-pilot-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (cond - ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) - 'pilot - ) - (else - (case arg2 - (('end-mode) - (let ((v1-4 (-> self pilot))) - (when (nonzero? v1-4) - (let ((a0-5 (handle->process (-> v1-4 vehicle)))) - (if a0-5 - (put-rider-in-seat (the-as vehicle a0-5) (-> v1-4 seat-index) (the-as process-focusable #f)) - ) - ) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + 'pilot + ) + (else + (case arg2 + (('end-mode) + (let ((v1-4 (-> self pilot))) + (when (nonzero? v1-4) + (let ((a0-5 (handle->process (-> v1-4 vehicle)))) + (if a0-5 + (put-rider-in-seat (the-as vehicle a0-5) (-> v1-4 seat-index) (the-as process-focusable #f)) + ) ) ) - enter-state - (process->handle arg0) - (go target-pilot-get-off) ) - (('change-mode) - (case (-> arg3 param 0) - (('grab) - (when (not (focus-test? self dead)) - (if (not (-> arg3 param 1)) - #t - (go target-pilot-grab) - ) - ) - ) - (('normal) - enter-state - (process->handle arg0) - (go target-pilot-get-off) - ) - (('gun) - (if (logtest? (-> self game features) (game-feature gun)) - (target-gun-init (the-as int (-> arg3 param 2))) + enter-state + (process->handle arg0) + (go target-pilot-get-off) + ) + (('change-mode) + (case (-> arg3 param 0) + (('grab) + (when (not (focus-test? self dead)) + (if (not (-> arg3 param 1)) + #t + (go target-pilot-grab) ) ) - ) - ) - (('swim) - #f - ) - (('clone-anim) - (go target-pilot-clone-anim (process->handle (the-as process (-> arg3 param 0)))) - ) - (('get-vehicle) - (if (nonzero? (-> self pilot)) - (handle->process (-> self pilot vehicle)) - ) + ) + (('normal) + enter-state + (process->handle arg0) + (go target-pilot-get-off) + ) + (('gun) + (if (logtest? (-> self game features) (game-feature gun)) + (target-gun-init (the-as int (-> arg3 param 2))) + ) + ) ) - (('attack 'attack-or-shove 'attack-invinc) - (target-attacked - arg2 - (the-as attack-info (-> arg3 param 1)) - arg0 - (the-as touching-shapes-entry (-> arg3 param 0)) - target-pilot-hit + ) + (('swim) + #f + ) + (('clone-anim) + (go target-pilot-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (('get-vehicle) + (if (nonzero? (-> self pilot)) + (handle->process (-> self pilot vehicle)) ) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + target-pilot-hit ) - (('vehicle-hit) - (speech-control-method-12 *speech-control* self (if (-> self pilot as-daxter?) - (speech-type speech-type-42) - (speech-type speech-type-33) - ) - ) - ) - (('vehicle-got-hit) - (speech-control-method-12 *speech-control* self (if (-> self pilot as-daxter?) - (speech-type speech-type-43) - (speech-type speech-type-34) - ) - ) - ) - (else - (target-standard-event-handler arg0 arg1 arg2 arg3) - ) + ) + (('vehicle-hit) + (speech-control-method-12 *speech-control* self (if (-> self pilot as-daxter?) + (speech-type speech-type-42) + (speech-type speech-type-33) + ) + ) + ) + (('vehicle-got-hit) + (speech-control-method-12 *speech-control* self (if (-> self pilot as-daxter?) + (speech-type speech-type-43) + (speech-type speech-type-34) + ) + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) ) ) ) @@ -125,63 +122,60 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch none vs object. (defbehavior target-pilot-exit target () - (the-as - object - (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) - (or (= v1-3 'target-pilot-stance) - (= v1-3 'target-pilot-impact) - (= v1-3 'target-pilot-get-off) - (= v1-3 'target-pilot-grab) - (= v1-3 'target-pilot-clone-anim) - (= v1-3 'target-pilot-hit) - (= v1-3 'target-pilot-death) - ) - ) - ) - ) - (let ((v1-4 (-> self manipy))) - (when v1-4 - (deactivate (-> v1-4 0)) - (set! (-> self manipy) (the-as (pointer manipy) #f)) - ) + (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-pilot-stance) + (= v1-3 'target-pilot-impact) + (= v1-3 'target-pilot-get-off) + (= v1-3 'target-pilot-grab) + (= v1-3 'target-pilot-clone-anim) + (= v1-3 'target-pilot-hit) + (= v1-3 'target-pilot-death) + ) + ) + ) + ) + (let ((v1-4 (-> self manipy))) + (when v1-4 + (deactivate (-> v1-4 0)) + (set! (-> self manipy) (the-as (pointer manipy) #f)) ) - (if (-> self pilot as-daxter?) - (target-pilot-pidax-exit) - ) - (let ((v1-11 (-> self pilot))) - (when (nonzero? v1-11) - (set! (-> self control nav-radius) (-> v1-11 backup-nav-radius)) - (let ((gp-0 (handle->process (-> v1-11 vehicle)))) - (when gp-0 - (remove-rider (the-as vehicle gp-0) self) - (send-event gp-0 'player-get-off) - ) + ) + (if (-> self pilot as-daxter?) + (target-pilot-pidax-exit) + ) + (let ((v1-11 (-> self pilot))) + (when (nonzero? v1-11) + (set! (-> self control nav-radius) (-> v1-11 backup-nav-radius)) + (let ((gp-0 (handle->process (-> v1-11 vehicle)))) + (when gp-0 + (remove-rider (the-as vehicle gp-0) self) + (send-event gp-0 'player-get-off) ) ) ) - (set! (-> self neck flex-blend) 1.0) - (let ((v1-22 (-> self control root-prim))) - (set! (-> v1-22 prim-core collide-as) (-> self control backup-collide-as)) - (set! (-> v1-22 prim-core collide-with) (-> self control backup-collide-with)) - ) - (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) - (logclear! (-> self control root-prim prim-core action) (collide-action stuck-wall-escape)) - (set! (-> self control mod-surface) *walk-mods*) - (logclear! (-> self state-flags) (state-flags sf6)) - (enable-set! (-> self arm-ik 0) #f) - (enable-set! (-> self arm-ik 1) #f) - (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) - (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) - (let ((v1-43 (-> self node-list data))) - (set! (-> v1-43 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) - (set! (-> v1-43 0 param1) (the-as basic (-> self control trans))) - (set! (-> v1-43 0 param2) (the-as basic (-> self control cspace-offset))) - ) - (target-collide-set! 'normal 0.0) - (set! (-> self control reaction) target-collision-reaction) - (set! (-> self control cspace-offset quad) (the-as uint128 0)) - (target-exit) ) + (set! (-> self neck flex-blend) 1.0) + (let ((v1-22 (-> self control root-prim))) + (set! (-> v1-22 prim-core collide-as) (-> self control backup-collide-as)) + (set! (-> v1-22 prim-core collide-with) (-> self control backup-collide-with)) + ) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (logclear! (-> self control root-prim prim-core action) (collide-action stuck-wall-escape)) + (set! (-> self control mod-surface) *walk-mods*) + (logclear! (-> self state-flags) (state-flags sf6)) + (enable-set! (-> self arm-ik 0) #f) + (enable-set! (-> self arm-ik 1) #f) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (let ((v1-43 (-> self node-list data))) + (set! (-> v1-43 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) + (set! (-> v1-43 0 param1) (the-as basic (-> self control trans))) + (set! (-> v1-43 0 param2) (the-as basic (-> self control cspace-offset))) + ) + (target-collide-set! 'normal 0.0) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control cspace-offset quad) (the-as uint128 0)) + (target-exit) ) ) @@ -280,7 +274,7 @@ (set! (-> self control root-prim prim-core collide-as) (collide-spec jak-vehicle)) (set! (-> self neck flex-blend) 0.0) (set! (-> self control status) (collide-status)) - (the-as object 0) + 0 ) ;; definition for function pilot-on-ground? diff --git a/test/decompiler/reference/jak2/levels/city/ctyport-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/ctyport-obs_REF.gc index a95be9e0b82..51efd373517 100644 --- a/test/decompiler/reference/jak2/levels/city/ctyport-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctyport-obs_REF.gc @@ -633,11 +633,9 @@ :virtual #t :enter (behavior () (go-virtual idle) - (none) ) :exit (behavior () '() - (none) ) ) @@ -646,11 +644,9 @@ :virtual #t :enter (behavior () (go-virtual idle) - (none) ) :exit (behavior () '() - (none) ) ) @@ -661,20 +657,16 @@ :enter (behavior () (logior! (-> self flags) (rigid-body-object-flag riding)) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () '() - (none) ) :post (behavior () (rigid-body-object-method-37 self) (update-transforms (-> self root)) - (none) ) ) @@ -981,11 +973,9 @@ :virtual #t :enter (behavior () '() - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (dotimes (gp-0 4) @@ -995,7 +985,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior boat-manager) sleep-code) ) diff --git a/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc index 3a7295e6727..10d55b62f37 100644 --- a/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc @@ -252,7 +252,7 @@ ;; failed to figure out what this is: (defstate idle-close (security-wall) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -261,183 +261,178 @@ (vf7 :class vf) ) (init-vf0-vector) - (the-as - object - (case event-type - (('on) - (let ((v1-2 (-> self root root-prim))) - (set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as)) - (let ((v0-0 (the-as int (-> self root backup-collide-with)))) - (set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0)) - v0-0 - ) + (case message + (('on) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as)) + (let ((v0-0 (the-as object (-> self root backup-collide-with)))) + (set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0)) + v0-0 ) ) - (('off) - (let ((v1-4 (-> self root root-prim))) - (set! (-> v1-4 prim-core collide-as) (collide-spec)) - (set! (-> v1-4 prim-core collide-with) (collide-spec)) - ) - 0 + ) + (('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)) ) - (('attack) - (let ((v1-5 (the-as object (-> event param 1)))) - (when (!= (-> (the-as attack-info v1-5) id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-5) id)) - (let* ((s5-0 proc) - (s3-0 (if (type? s5-0 process-drawable) - (the-as process-drawable s5-0) - ) - ) - ) - (when s3-0 - (let ((s5-1 (process-spawn - manipy - :init manipy-init - (-> s3-0 root trans) - (-> self entity) - (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer uint32) #f)) - #f - 0 - :to self - ) + 0 + ) + (('attack) + (let ((v1-5 (the-as object (-> block param 1)))) + (when (!= (-> (the-as attack-info v1-5) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-5) id)) + (let* ((s5-0 proc) + (s3-0 (if (type? s5-0 process-drawable) + (the-as process-drawable s5-0) + ) + ) + ) + (when s3-0 + (let ((s5-1 (process-spawn + manipy + :init manipy-init + (-> s3-0 root trans) + (-> self entity) + (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer uint32) #f)) + #f + 0 + :to self ) + ) + ) + (when s5-1 + (send-event (ppointer->process s5-1) 'anim-mode 'play1) + (send-event (ppointer->process s5-1) 'speed 1.5) + (send-event (ppointer->process s5-1) 'art-joint-anim "generic-ripples-idle" 0) + (set-vector! (-> (the-as process-drawable (-> s5-1 0)) root scale) 1.0 1.0 1.0 1.0) + (quaternion-rotate-local-x! (-> (the-as process-drawable (-> s5-1 0)) root quat) (-> self root quat) -16384.0) + (let ((v1-45 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a0-29 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a1-11 *up-vector*)) + (let ((a2-9 8192.0)) + (.mov vf7 a2-9) + ) + (.lvf vf5 (&-> a1-11 quad)) + ) + (.lvf vf4 (&-> a0-29 quad)) ) - (when s5-1 - (send-event (ppointer->process s5-1) 'anim-mode 'play1) - (send-event (ppointer->process s5-1) 'speed 1.5) - (send-event (ppointer->process s5-1) 'art-joint-anim "generic-ripples-idle" 0) - (set-vector! (-> (the-as process-drawable (-> s5-1 0)) root scale) 1.0 1.0 1.0 1.0) - (quaternion-rotate-local-x! (-> (the-as process-drawable (-> s5-1 0)) root quat) (-> self root quat) -16384.0) - (let ((v1-45 (-> (the-as process-drawable (-> s5-1 0)) root trans))) - (let ((a0-29 (-> (the-as process-drawable (-> s5-1 0)) root trans))) - (let ((a1-11 *up-vector*)) - (let ((a2-9 8192.0)) - (.mov vf7 a2-9) + (.add.x.vf 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-45 quad) vf6) + ) + (let ((f0-6 (vector4-dot (-> (the-as process-drawable (-> s5-1 0)) root trans) (the-as vector (-> self plane))))) + (let ((v1-52 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a0-33 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a1-12 (-> self plane))) + (let ((a2-10 (- f0-6))) + (.mov vf7 a2-10) ) - (.lvf vf5 (&-> a1-11 quad)) + (.lvf vf5 (&-> a1-12 quad)) ) - (.lvf vf4 (&-> a0-29 quad)) + (.lvf vf4 (&-> a0-33 quad)) ) (.add.x.vf vf6 vf0 vf0 :mask #b1000) (.mul.x.vf acc vf5 vf7 :mask #b111) (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) - (.svf (&-> v1-45 quad) vf6) + (.svf (&-> v1-52 quad) vf6) ) - (let ((f0-6 (vector4-dot (-> (the-as process-drawable (-> s5-1 0)) root trans) (the-as vector (-> self plane))))) - (let ((v1-52 (-> (the-as process-drawable (-> s5-1 0)) root trans))) - (let ((a0-33 (-> (the-as process-drawable (-> s5-1 0)) root trans))) - (let ((a1-12 (-> self plane))) - (let ((a2-10 (- f0-6))) - (.mov vf7 a2-10) - ) - (.lvf vf5 (&-> a1-12 quad)) - ) - (.lvf vf4 (&-> a0-33 quad)) - ) - (.add.x.vf vf6 vf0 vf0 :mask #b1000) - (.mul.x.vf acc vf5 vf7 :mask #b111) - (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) - (.svf (&-> v1-52 quad) vf6) - ) - (let ((v1-55 (-> (the-as process-drawable (-> s5-1 0)) root trans))) - (let ((a0-36 (-> (the-as process-drawable (-> s5-1 0)) root trans))) - (let ((a1-13 (-> self plane))) - (let ((a2-12 (the-as float (if (< 0.0 f0-6) - -989855744 - #x45000000 - ) - ) - ) - ) - (.mov vf7 a2-12) - ) - (.lvf vf5 (&-> a1-13 quad)) + (let ((v1-55 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a0-36 (-> (the-as process-drawable (-> s5-1 0)) root trans))) + (let ((a1-13 (-> self plane))) + (let ((a2-12 (the-as float (if (< 0.0 f0-6) + -989855744 + #x45000000 + ) + ) + ) + ) + (.mov vf7 a2-12) ) - (.lvf vf4 (&-> a0-36 quad)) + (.lvf vf5 (&-> a1-13 quad)) ) - (.add.x.vf vf6 vf0 vf0 :mask #b1000) - (.mul.x.vf acc vf5 vf7 :mask #b111) - (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) - (.svf (&-> v1-55 quad) vf6) + (.lvf vf4 (&-> a0-36 quad)) ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-55 quad) vf6) ) - (send-event (ppointer->process s5-1) 'trans-hook (lambda () #f)) ) + (send-event (ppointer->process s5-1) 'trans-hook (lambda () #f)) ) ) ) - (when (zero? (-> self touch-count)) - (+! (-> self touch-count) 1) - (set! (-> self flash) 0.375) - ) + ) + (when (zero? (-> self touch-count)) (+! (-> self touch-count) 1) - (if (and (logtest? (-> proc mask) (process-mask target)) - (not (logtest? (process-mask projectile) (-> proc mask))) - ) - (the-as int (security-wall-method-23 self)) - ) + (set! (-> self flash) 0.375) ) - ) - ) - (('touched) - (when (zero? (-> self touch-count)) (+! (-> self touch-count) 1) - (set! (-> self flash) 0.375) + (if (and (logtest? (-> proc mask) (process-mask target)) + (not (logtest? (process-mask projectile) (-> proc mask))) + ) + (security-wall-method-23 self) + ) ) + ) + ) + (('touched) + (when (zero? (-> self touch-count)) (+! (-> self touch-count) 1) - (let ((v1-83 (if (type? proc process-focusable) - (the-as process-focusable proc) - ) - ) - ) - (when v1-83 - (let* ((gp-1 (-> v1-83 root)) - (a0-45 (if (type? gp-1 collide-shape) - gp-1 - ) - ) + (set! (-> self flash) 0.375) + ) + (+! (-> self touch-count) 1) + (let ((v1-83 (if (type? proc process-focusable) + (the-as process-focusable proc) + ) ) - (if (and a0-45 (logtest? (-> a0-45 root-prim prim-core collide-as) (collide-spec jak))) - (the-as int (security-wall-method-23 self)) - ) - ) + ) + (when v1-83 + (let* ((gp-1 (-> v1-83 root)) + (a0-45 (if (type? gp-1 collide-shape) + gp-1 + ) + ) + ) + (if (and a0-45 (logtest? (-> a0-45 root-prim prim-core collide-as) (collide-spec jak))) + (security-wall-method-23 self) + ) ) ) ) - ) + ) ) ) ) :trans (behavior () (security-wall-method-24 self) - (none) ) ) ;; failed to figure out what this is: (defstate idle-open (security-wall) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('on) - (let ((v1-2 (-> self root root-prim))) - (set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as)) - (let ((v0-0 (the-as int (-> self root backup-collide-with)))) - (set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0)) - v0-0 - ) - ) - ) - (('off) - (let ((v1-4 (-> self root root-prim))) - (set! (-> v1-4 prim-core collide-as) (collide-spec)) - (set! (-> v1-4 prim-core collide-with) (collide-spec)) - ) - 0 - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('on) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as)) + (let ((v0-0 (the-as int (-> self root backup-collide-with)))) + (set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0)) + v0-0 + ) + ) + ) + (('off) + (let ((v1-4 (-> self root root-prim))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) ) :enter (behavior () (let ((v1-1 (-> self root root-prim))) @@ -445,7 +440,6 @@ (set! (-> v1-1 prim-core collide-with) (collide-spec)) ) 0 - (none) ) :trans (behavior () (let* ((f28-0 (vector4-dot (the-as vector (-> self plane)) (target-pos 0))) @@ -463,14 +457,12 @@ (set! (-> gp-1 w) 1.0) (set-security-color! gp-1) ) - (none) ) :code (behavior () (until #f (suspend) ) #f - (none) ) ) @@ -926,27 +918,26 @@ This commonly includes things such as: ;; definition for function fruit-stand-event-handler ;; WARN: Return type mismatch int vs object. (defbehavior fruit-stand-event-handler fruit-stand ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('attack) - (let ((v1-1 (the-as object (-> arg3 param 1)))) - (when (!= (-> (the-as attack-info v1-1) id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-1) id)) - (let ((v0-0 1)) - (set! (-> self part state-mode 0) (the-as uint v0-0)) - v0-0 - ) - ) - ) - ) - ) - ) + (case arg2 + (('attack) + (let ((v1-1 (the-as object (-> arg3 param 1)))) + (when (!= (-> (the-as attack-info v1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-1) id)) + (let ((v0-0 1)) + (set! (-> self part state-mode 0) (the-as uint v0-0)) + v0-0 + ) + ) + ) + ) + ) ) ;; failed to figure out what this is: (defstate idle (fruit-stand) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (fruit-stand-event-handler proc arg1 event-type event) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (fruit-stand-event-handler proc argc message block) ) :code (behavior () (until #f @@ -960,7 +951,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (dotimes (gp-0 (the-as int (-> self num-sparts))) @@ -997,7 +987,6 @@ This commonly includes things such as: (set! (-> self count-sparts) (the-as uint 0)) (spawn-with-cspace (-> self part) (the-as cspace (-> self node-list data))) (ja-post) - (none) ) ) @@ -1521,11 +1510,9 @@ This commonly includes things such as: (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) (transform-post) (logior! (-> self focus-status) (focus-status ignore)) - (none) ) :exit (behavior () (logclear! (-> self focus-status) (focus-status ignore)) - (none) ) :code (the-as (function none :behavior cty-guard-turret) sleep-code) :post (behavior () @@ -1575,23 +1562,21 @@ This commonly includes things such as: ) ) (transform-post) - (none) ) ) ;; failed to figure out what this is: (defstate explode (cty-guard-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('button-down) - (let ((v0-0 #t)) - (set! (-> self button-down?) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('button-down) + (let ((v0-0 #t)) + (set! (-> self button-down?) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior () (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -1634,27 +1619,24 @@ This commonly includes things such as: ) (setup-masks (-> self draw) 0 2) (set! (-> self root root-prim specific 0) (+ (-> self root root-prim specific 1) -1)) - (none) ) :post (behavior () (ja-post) - (none) ) ) ;; failed to figure out what this is: (defstate wait-for-pushing (cty-guard-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('button-down) - (let ((v0-0 #t)) - (set! (-> self button-down?) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('button-down) + (let ((v0-0 #t)) + (set! (-> self button-down?) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior () (set! (-> self button-down?) #f) @@ -1679,7 +1661,6 @@ This commonly includes things such as: ) (setup-masks (-> self draw) 0 2) (set! (-> self root root-prim specific 0) (+ (-> self root root-prim specific 1) -1)) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! 20.0) :frame-num 20.0) @@ -1714,27 +1695,24 @@ This commonly includes things such as: (set! (-> self root root-prim specific 0) (-> self root root-prim specific 1)) (setup-masks (-> self draw) 2 0) (go-virtual idle) - (none) ) :post (behavior () (ja-post) - (none) ) ) ;; failed to figure out what this is: (defstate pushed (cty-guard-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('close) - (let ((v0-0 #t)) - (set! (-> self button-down?) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('close) + (let ((v0-0 #t)) + (set! (-> self button-down?) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior () (set! (-> self button-down?) #f) @@ -1760,7 +1738,6 @@ This commonly includes things such as: (setup-masks (-> self draw) 0 2) (set! (-> self root root-prim specific 0) (+ (-> self root root-prim specific 1) -1)) (set! (-> self button-down?) #f) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 3) @@ -1790,11 +1767,9 @@ This commonly includes things such as: (set! (-> self root root-prim specific 0) (-> self root root-prim specific 1)) (setup-masks (-> self draw) 2 0) (go-virtual idle) - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -2011,11 +1986,9 @@ This commonly includes things such as: (set! (-> self state-time) (current-time)) (set! (-> self num-shots) (the-as uint 0)) 0 - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! 20.0 0.5) :frame-num 0.0) @@ -2079,11 +2052,9 @@ This commonly includes things such as: (ja :num! (seek! 32.0 0.5)) ) (go-virtual idle) - (none) ) :post (behavior () (transform-post) - (none) ) ) @@ -2467,7 +2438,6 @@ This commonly includes things such as: :exit (behavior () (parking-spot-method-21 self) (send-event (handle->process (-> self vehicle)) 'traffic-off-force) - (none) ) :code (the-as (function none :behavior parking-spot) sleep-code) :post (behavior () @@ -2493,7 +2463,6 @@ This commonly includes things such as: ) ) 0 - (none) ) ) @@ -2669,7 +2638,7 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (propa) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -2678,98 +2647,95 @@ This commonly includes things such as: (vf7 :class vf) ) (init-vf0-vector) - (the-as - object - (case event-type - (('attack) - (get-penetrate-using-from-attack-event (the-as process-drawable proc) event) - (let ((v1-2 (the-as object (-> event param 1)))) - (when (!= (-> (the-as attack-info v1-2) id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-2) id)) - (let ((gp-1 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) - (if (and (not (logtest? (penetrate dark-skin) gp-1)) (zero? (propa-pu->knocked-type gp-1))) - (set! (-> self hit-points) (- (-> self hit-points) (penetrate-using->damage gp-1))) - (+! (-> self hit-points) -10) - ) - ) - (cond - ((< (-> self hit-points) 3) - (setup-masks (-> self draw) 0 -1) - (setup-masks (-> self draw) 1 0) - (let* ((a0-9 (the-as collide-shape-prim-group (-> self root root-prim))) - (v1-17 (-> a0-9 child 0)) - ) - (let ((a0-11 (-> a0-9 child 1))) - (set! (-> a0-11 prim-core collide-as) (-> v1-17 prim-core collide-as)) - (set! (-> a0-11 prim-core collide-with) (-> v1-17 prim-core collide-with)) - ) - (set! (-> v1-17 prim-core collide-as) (collide-spec)) - (set! (-> v1-17 prim-core collide-with) (collide-spec)) + (case message + (('attack) + (get-penetrate-using-from-attack-event (the-as process-drawable proc) block) + (let ((v1-2 (the-as object (-> block param 1)))) + (when (!= (-> (the-as attack-info v1-2) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-2) id)) + (let ((gp-1 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) + (if (and (not (logtest? (penetrate dark-skin) gp-1)) (zero? (propa-pu->knocked-type gp-1))) + (set! (-> self hit-points) (- (-> self hit-points) (penetrate-using->damage gp-1))) + (+! (-> self hit-points) -10) + ) + ) + (cond + ((< (-> self hit-points) 3) + (setup-masks (-> self draw) 0 -1) + (setup-masks (-> self draw) 1 0) + (let* ((a0-9 (the-as collide-shape-prim-group (-> self root root-prim))) + (v1-17 (-> a0-9 child 0)) + ) + (let ((a0-11 (-> a0-9 child 1))) + (set! (-> a0-11 prim-core collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> a0-11 prim-core collide-with) (-> v1-17 prim-core collide-with)) ) - 0 - (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-2 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 - (the-as part-tracker gp-2) - *entity-pool* - (symbol->string (-> part-tracker symbol)) - (the-as pointer #x70004000) - ) + (set! (-> v1-17 prim-core collide-as) (collide-spec)) + (set! (-> v1-17 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-2 + (let ((t9-7 (method-of-type part-tracker activate))) + (t9-7 + (the-as part-tracker gp-2) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) ) - (let ((t9-8 run-function-in-process) - (a0-14 gp-2) - (a1-10 part-tracker-init) - (a2-7 (-> *part-group-id-table* 161)) - (a3-2 0) - (t0-0 #f) - (t1-0 #f) - (t2-0 #f) - (t3-0 *launch-matrix*) + ) + (let ((t9-8 run-function-in-process) + (a0-14 gp-2) + (a1-10 part-tracker-init) + (a2-7 (-> *part-group-id-table* 161)) + (a3-2 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (let ((v1-25 (-> t3-0 trans)) + (t4-0 (new 'stack-no-clear 'vector)) ) - (let ((v1-25 (-> t3-0 trans)) - (t4-0 (new 'stack-no-clear 'vector)) + (let ((t5-1 (-> self root trans))) + (let ((t6-0 *up-vector*)) + (let ((t7-1 8192.0)) + (.mov vf7 t7-1) ) - (let ((t5-1 (-> self root trans))) - (let ((t6-0 *up-vector*)) - (let ((t7-1 8192.0)) - (.mov vf7 t7-1) - ) - (.lvf vf5 (&-> t6-0 quad)) - ) - (.lvf vf4 (&-> t5-1 quad)) + (.lvf vf5 (&-> t6-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 (&-> t4-0 quad) vf6) - (set! (-> v1-25 quad) (-> t4-0 quad)) + (.lvf vf4 (&-> t5-1 quad)) ) - ((the-as (function object object object object object object object object none) t9-8) - a0-14 - a1-10 - a2-7 - a3-2 - t0-0 - t1-0 - t2-0 - t3-0 - ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> t4-0 quad) vf6) + (set! (-> v1-25 quad) (-> t4-0 quad)) ) - (-> gp-2 ppointer) + ((the-as (function object object object object object object object object none) t9-8) + a0-14 + a1-10 + a2-7 + a3-2 + t0-0 + t1-0 + t2-0 + t3-0 + ) ) + (-> gp-2 ppointer) ) - (go-virtual broken) - ) - ((< (-> self hit-points) 6) - (setup-masks (-> self draw) 0 -1) - (the-as object (setup-masks (-> self draw) 2 0)) ) - ) + (go-virtual broken) + ) + ((< (-> self hit-points) 6) + (setup-masks (-> self draw) 0 -1) + (setup-masks (-> self draw) 2 0) + ) ) ) ) - ) + ) ) ) ) @@ -2779,7 +2745,6 @@ This commonly includes things such as: (set! (-> self sound-id) (new 'static 'sound-id)) 0 ) - (none) ) :code (the-as (function none :behavior propa) sleep-code) :post (behavior () @@ -2886,7 +2851,6 @@ This commonly includes things such as: (matrix<-trans gp-3 s5-1) (spawn-with-matrix (-> self part) gp-3) ) - (none) ) ) @@ -3138,7 +3102,6 @@ This commonly includes things such as: :virtual #t :exit (behavior () '() - (none) ) :trans (behavior () (let ((gp-0 (get-current-task-event (-> self task))) @@ -3223,7 +3186,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior burning-bush) sleep-code) :post (behavior () @@ -3256,7 +3218,6 @@ This commonly includes things such as: (t9-0 a0-0 a1-0 #f self) ) ) - (none) ) ) ) @@ -3268,7 +3229,6 @@ This commonly includes things such as: (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self time) -1.0) (process-entity-status! self (entity-perm-status no-kill) #t) - (none) ) :exit (behavior () (remove-setting! 'music-volume) @@ -3280,7 +3240,6 @@ This commonly includes things such as: (send-event *camera* 'change-target *target*) (remove-setting! 'interp-time) (remove-setting! 'mode-name) - (none) ) :trans (behavior () (local-vars (sv-272 vector) (sv-288 quaternion)) @@ -3360,7 +3319,6 @@ This commonly includes things such as: ) (spawn-with-matrix (-> self part) gp-1) ) - (none) ) ) :code (behavior () @@ -3414,7 +3372,6 @@ This commonly includes things such as: ) (task-node-close! (-> self task current-node)) (go-virtual idle) - (none) ) :post (behavior () (rlet ((acc :class vf) @@ -3446,7 +3403,6 @@ This commonly includes things such as: (t9-0 a0-0 a1-0 #f self) ) ) - (none) ) ) ) @@ -3458,14 +3414,12 @@ This commonly includes things such as: (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self time) -1.0) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (remove-setting! 'minimap) (send-event *camera* 'change-target *target*) (remove-setting! 'interp-time) (remove-setting! 'mode-name) - (none) ) :trans (behavior () (local-vars @@ -3853,7 +3807,6 @@ This commonly includes things such as: ) (spawn-with-matrix (-> self part-off) gp-2) ) - (none) ) ) :code (behavior () @@ -3904,7 +3857,6 @@ This commonly includes things such as: (suspend) ) (go-virtual idle) - (none) ) :post (behavior () (rlet ((acc :class vf) @@ -3936,7 +3888,6 @@ This commonly includes things such as: (t9-0 a0-0 a1-0 #f self) ) ) - (none) ) ) ) @@ -4228,7 +4179,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior barons-ship-lores) ja-post) ) @@ -4310,26 +4260,22 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (lurker-pipe-lid) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('spin) - (set! (-> self angle) 196608.0) - (set! (-> self rot) -655360.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('spin) + (set! (-> self angle) 196608.0) + (set! (-> self rot) -655360.0) + ) + ) ) :enter (behavior () '() - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () '() - (none) ) :code (the-as (function none :behavior lurker-pipe-lid) sleep-code) :post (behavior () @@ -4341,7 +4287,6 @@ This commonly includes things such as: ) (quaternion-vector-angle! (-> self root quat) *x-vector* (-> self angle)) (ja-post) - (none) ) ) @@ -4462,10 +4407,10 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (ctyn-lamp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (-> event param 1) + (-> block param 1) (let ((s5-0 (the-as process-drawable proc)) (gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1))) ) @@ -4506,7 +4451,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior ctyn-lamp) #f) ) diff --git a/test/decompiler/reference/jak2/levels/city/ctywide-scenes_REF.gc b/test/decompiler/reference/jak2/levels/city/ctywide-scenes_REF.gc index 89e62c9c2a1..f278fbcdb1b 100644 --- a/test/decompiler/reference/jak2/levels/city/ctywide-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctywide-scenes_REF.gc @@ -1523,18 +1523,17 @@ ) ) (let ((gp-1 (level-get *level* 'lyskdcd))) - (the-as object (when gp-1 - (clear-mood-context (-> gp-1 mood-context)) - (if #f - ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) - ) - (set! (-> gp-1 mood-func) update-mood-copy-ctywide) - (let ((v0-4 #t)) - (set! (-> gp-1 info sky) v0-4) - v0-4 - ) - ) - ) + (when gp-1 + (clear-mood-context (-> gp-1 mood-context)) + (if #f + ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) + ) + (set! (-> gp-1 mood-func) update-mood-copy-ctywide) + (let ((v0-4 #t)) + (set! (-> gp-1 info sky) v0-4) + v0-4 + ) + ) ) ) ) @@ -1570,17 +1569,14 @@ ) ) (let ((gp-1 (level-get *level* 'lyskdcd))) - (the-as - object - (when gp-1 - (clear-mood-context (-> gp-1 mood-context)) - (if #f - ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) - ) - (set! (-> gp-1 mood-func) (the-as (function mood-context float int none) update-mood-hideout)) - (set! (-> gp-1 info sky) #f) - #f - ) + (when gp-1 + (clear-mood-context (-> gp-1 mood-context)) + (if #f + ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) + ) + (set! (-> gp-1 mood-func) (the-as (function mood-context float int none) update-mood-hideout)) + (set! (-> gp-1 info sky) #f) + #f ) ) ) @@ -1759,18 +1755,17 @@ ) ) (let ((gp-1 (level-get *level* 'ltrntess))) - (the-as object (when gp-1 - (clear-mood-context (-> gp-1 mood-context)) - (if #f - ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) - ) - (set! (-> gp-1 mood-func) update-mood-copy-ctywide) - (let ((v0-4 #t)) - (set! (-> gp-1 info sky) v0-4) - v0-4 - ) - ) - ) + (when gp-1 + (clear-mood-context (-> gp-1 mood-context)) + (if #f + ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) + ) + (set! (-> gp-1 mood-func) update-mood-copy-ctywide) + (let ((v0-4 #t)) + (set! (-> gp-1 info sky) v0-4) + v0-4 + ) + ) ) ) ) @@ -1817,17 +1812,14 @@ ) ) (let ((gp-1 (level-get *level* 'ltrntess))) - (the-as - object - (when gp-1 - (clear-mood-context (-> gp-1 mood-context)) - (if #f - ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) - ) - (set! (-> gp-1 mood-func) (the-as (function mood-context float int none) update-mood-hideout)) - (set! (-> gp-1 info sky) #f) - #f - ) + (when gp-1 + (clear-mood-context (-> gp-1 mood-context)) + (if #f + ((the-as (function mood-context symbol) #f) (-> gp-1 mood-context)) + ) + (set! (-> gp-1 mood-func) (the-as (function mood-context float int none) update-mood-hideout)) + (set! (-> gp-1 info sky) #f) + #f ) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc index 3d2ca894d75..11565f14ea5 100644 --- a/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc @@ -1102,7 +1102,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior farm-marrow) #f) ) @@ -1110,10 +1109,10 @@ ;; failed to figure out what this is: (defstate idle (farm-marrow) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((a1-1 (the-as object (-> event param 1))) + (let ((a1-1 (the-as object (-> block param 1))) (a0-2 proc) ) (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) @@ -1121,7 +1120,7 @@ (when a0-2 (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) (when s5-0 - (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) (cond ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) (sound-play "hit-veggies") @@ -1245,7 +1244,6 @@ ) :exit (behavior () '() - (none) ) :code (the-as (function none :behavior farm-marrow) sleep-code) :post (behavior () @@ -1253,7 +1251,6 @@ (shaker-method-9 (-> self shakers gp-0)) ) (transform-post) - (none) ) ) @@ -1422,7 +1419,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior farm-beetree) #f) ) @@ -1430,10 +1426,10 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (farm-beetree) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((a1-1 (the-as object (-> event param 1))) + (let ((a1-1 (the-as object (-> block param 1))) (a0-2 proc) ) (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) @@ -1441,7 +1437,7 @@ This commonly includes things such as: (when a0-2 (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) (when s5-0 - (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) (cond ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) (sound-play "hit-veggies") @@ -1531,7 +1527,6 @@ This commonly includes things such as: (shaker-method-9 (-> self shakers gp-0)) ) (transform-post) - (none) ) ) @@ -1696,7 +1691,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior farm-cabbage) #f) ) @@ -1704,10 +1698,10 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (farm-cabbage) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((a1-1 (the-as object (-> event param 1))) + (let ((a1-1 (the-as object (-> block param 1))) (a0-2 proc) ) (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) @@ -1715,7 +1709,7 @@ This commonly includes things such as: (when a0-2 (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) (when s5-0 - (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) (cond ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) (sound-play "hit-veggies") @@ -1805,7 +1799,6 @@ This commonly includes things such as: (shaker-method-9 (-> self shakers gp-0)) ) (transform-post) - (none) ) ) @@ -1972,7 +1965,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior farm-small-cabbage) #f) ) @@ -1980,10 +1972,10 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (farm-small-cabbage) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((a1-1 (the-as object (-> event param 1))) + (let ((a1-1 (the-as object (-> block param 1))) (a0-2 proc) ) (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) @@ -1991,7 +1983,7 @@ This commonly includes things such as: (when a0-2 (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) (when s5-0 - (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) (cond ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) (sound-play "hit-veggies") @@ -2066,7 +2058,6 @@ This commonly includes things such as: (shaker-method-9 (-> self shakers gp-0)) ) (transform-post) - (none) ) ) @@ -2233,7 +2224,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior farm-chilirots) #f) ) @@ -2241,10 +2231,10 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (farm-chilirots) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((a1-1 (the-as object (-> event param 1))) + (let ((a1-1 (the-as object (-> block param 1))) (a0-2 proc) ) (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) @@ -2252,7 +2242,7 @@ This commonly includes things such as: (when a0-2 (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) (when s5-0 - (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) (cond ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) (sound-play "hit-veggies") @@ -2371,7 +2361,6 @@ This commonly includes things such as: (shaker-method-9 (-> self shakers gp-0)) ) (transform-post) - (none) ) ) @@ -2486,11 +2475,9 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (transform-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/farm/yakow_REF.gc b/test/decompiler/reference/jak2/levels/city/farm/yakow_REF.gc index 7d9097f5081..533a884ac73 100644 --- a/test/decompiler/reference/jak2/levels/city/farm/yakow_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/farm/yakow_REF.gc @@ -311,7 +311,6 @@ ) ) #f - (none) ) :post (behavior () (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) @@ -319,7 +318,6 @@ ) (enemy-method-129 self) (ja-post) - (none) ) ) @@ -332,7 +330,6 @@ (go-virtual idle) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -432,7 +429,6 @@ ) ) #f - (none) ) ) @@ -447,15 +443,12 @@ ) 0 (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.05)) @@ -468,7 +461,6 @@ (ja :num! (seek!)) ) (go-virtual active) - (none) ) :post (the-as (function none :behavior yakow) ja-post) ) diff --git a/test/decompiler/reference/jak2/levels/city/generic/neon-praxis-part_REF.gc b/test/decompiler/reference/jak2/levels/city/generic/neon-praxis-part_REF.gc index 776d3bffbcb..85249760bab 100644 --- a/test/decompiler/reference/jak2/levels/city/generic/neon-praxis-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/generic/neon-praxis-part_REF.gc @@ -1204,7 +1204,6 @@ (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-states_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-states_REF.gc index dbc4e5ba9f3..f3fae30631c 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-states_REF.gc @@ -23,7 +23,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -40,7 +39,6 @@ ) ) ) - (none) ) :code (behavior () (let ((gp-0 (get-rand-int self 4))) @@ -158,7 +156,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior crocadog-escort) nav-enemy-simple-post) ) @@ -184,7 +181,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -195,7 +191,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -208,12 +203,10 @@ (ja :num! (seek!)) ) (go-idle-or-move self) - (none) ) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 49152.0 (seconds 0.05)) (nav-enemy-simple-post) - (none) ) ) @@ -241,7 +234,6 @@ (stop-looking-at-target! self) (nav-enemy-method-166 self) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -260,7 +252,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -268,7 +259,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -280,7 +270,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -308,7 +297,6 @@ (stop-looking-at-target! self) (nav-enemy-method-166 self) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -363,7 +351,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -371,7 +358,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior crocadog-escort) nav-enemy-travel-post) ) @@ -415,7 +401,6 @@ (logior! (-> self focus-status) (focus-status disable)) (logclear! (-> self focus-status) (focus-status arrestable)) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :exit (behavior () (local-vars (v1-6 enemy-flag)) @@ -429,11 +414,9 @@ ) (set! (-> self enemy-flags) v1-6) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :trans (behavior () (check-vehicle-exit self) - (none) ) :code (behavior () (local-vars (sv-128 float)) @@ -546,7 +529,6 @@ ) (logior! (-> self focus-status) (focus-status pilot-riding pilot)) (go-virtual ride-vehicle) - (none) ) :post (the-as (function none :behavior crocadog-escort) nav-enemy-simple-post) ) @@ -577,7 +559,6 @@ 0 (logior! (-> self focus-status) (focus-status disable pilot-riding pilot)) (set! (-> self anim-speed) 0.0) - (none) ) :exit (behavior () (local-vars (v1-4 enemy-flag)) @@ -590,7 +571,6 @@ ) (set! (-> self enemy-flags) v1-4) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :trans (behavior () (check-vehicle-exit self) @@ -616,7 +596,6 @@ (if (and (logtest? (bot-flags bf16) (-> self bot-flags)) (want-exit-vehicle? self (-> self exit-vehicle-dest))) (go-virtual exit-vehicle) ) - (none) ) :code (behavior () (until #f @@ -633,7 +612,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior crocadog-escort) nav-enemy-simple-post) ) @@ -659,7 +637,6 @@ (logclear! (-> self enemy-flags) (enemy-flag enable-on-active)) (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) (logior! (-> self focus-status) (focus-status disable)) - (none) ) :exit (behavior () (local-vars (v1-11 enemy-flag)) @@ -680,7 +657,6 @@ ) (set! (-> self enemy-flags) v1-11) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :trans (behavior () (check-vehicle-exit self) @@ -694,7 +670,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -801,7 +776,6 @@ ) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior crocadog-escort) nav-enemy-simple-post) ) @@ -828,14 +802,12 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) (go-virtual traveling) ) - (none) ) :code (-> (method-of-type crocadog-escort waiting-idle) code) :post (the-as (function none :behavior crocadog-escort) nav-enemy-simple-post) @@ -855,7 +827,6 @@ ) 0 (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -864,7 +835,6 @@ (go-virtual traveling) ) ) - (none) ) :code (-> (method-of-type crocadog-escort waiting-idle) code) ) @@ -879,7 +849,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () (local-vars (v1-7 enemy-flag) (v1-15 enemy-flag)) @@ -908,7 +877,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -922,7 +890,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) ) @@ -936,7 +903,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () 0.0 @@ -983,7 +949,6 @@ ) ) #f - (none) ) ) @@ -1007,7 +972,6 @@ (set! (-> self travel-anim-interp) 0.0) (logior! (-> self bot-flags) (bot-flags bf09)) (logclear! (-> self bot-flags) (bot-flags bf19)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) @@ -1017,7 +981,6 @@ ) (fail-falling self) ) - (none) ) :code (-> (method-of-type crocadog-escort die-falling) code) ) @@ -1053,7 +1016,6 @@ (logclear! (-> self enemy-flags) (enemy-flag notice)) (logclear! (-> self focus-status) (focus-status disable)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (-> (method-of-type crocadog-escort waiting-idle) code) :post (the-as (function none :behavior crocadog-escort) nav-enemy-simple-post) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc_REF.gc index 79dc1174be9..f10baf08c79 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc_REF.gc @@ -561,14 +561,13 @@ This commonly includes things such as: (react-to-focus obj) ) ) - (none) ) ;; definition for method 72 of type crocadog-escort +;; WARN: Return type mismatch none vs object. (defmethod react-to-focus crocadog-escort ((obj crocadog-escort)) "@TODO - flesh out docs" (go-idle-or-move obj) - (none) ) ;; definition for method 236 of type crocadog-escort diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-states_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-states_REF.gc index 777d5f12668..356898963f1 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-states_REF.gc @@ -20,7 +20,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -50,7 +49,6 @@ ) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -78,7 +76,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kid-escort) nav-enemy-simple-post) ) @@ -101,7 +98,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -119,7 +115,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -132,12 +127,10 @@ (ja :num! (seek!)) ) (check-arrest self) - (none) ) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 49152.0 (seconds 0.05)) (nav-enemy-simple-post) - (none) ) ) @@ -162,7 +155,6 @@ (stop-looking-at-target! self) (nav-enemy-method-166 self) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -188,7 +180,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -196,7 +187,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -208,7 +198,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -234,7 +223,6 @@ (nav-enemy-method-166 self) (set! (-> self player-blocking) 0.0) (logclear! (-> self focus-status) (focus-status arrestable)) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -296,7 +284,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -304,7 +291,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior kid-escort) nav-enemy-travel-post) ) @@ -336,7 +322,6 @@ (logior! (-> self focus-status) (focus-status disable)) (logclear! (-> self focus-status) (focus-status arrestable)) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :exit (behavior () (local-vars (v1-6 enemy-flag)) @@ -350,11 +335,9 @@ ) (set! (-> self enemy-flags) v1-6) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :trans (behavior () (check-vehicle-exit self) - (none) ) :code (behavior () (local-vars (sv-112 float)) @@ -457,7 +440,6 @@ ) (logior! (-> self focus-status) (focus-status pilot-riding pilot)) (go-virtual ride-vehicle) - (none) ) :post (the-as (function none :behavior kid-escort) nav-enemy-simple-post) ) @@ -485,7 +467,6 @@ 0 (logior! (-> self focus-status) (focus-status disable pilot-riding pilot)) (logclear! (-> self focus-status) (focus-status arrestable)) - (none) ) :exit (behavior () (local-vars (v1-4 enemy-flag)) @@ -498,7 +479,6 @@ ) (set! (-> self enemy-flags) v1-4) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :trans (behavior () (check-vehicle-exit self) @@ -506,7 +486,6 @@ (go-virtual exit-vehicle) ) 0 - (none) ) :code (behavior () (ja-channel-push! 2 (seconds 0.2)) @@ -544,7 +523,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kid-escort) nav-enemy-simple-post) ) @@ -568,7 +546,6 @@ (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) (logior! (-> self focus-status) (focus-status disable)) (logclear! (-> self focus-status) (focus-status arrestable)) - (none) ) :exit (behavior () (local-vars (v1-17 enemy-flag)) @@ -594,11 +571,9 @@ ) (set! (-> self enemy-flags) v1-17) (logclear! (-> self bot-flags) (bot-flags bf15)) - (none) ) :trans (behavior () (check-vehicle-exit self) - (none) ) :code (behavior () (local-vars (sv-80 float) (sv-96 float)) @@ -703,7 +678,6 @@ ) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior kid-escort) nav-enemy-simple-post) ) @@ -727,7 +701,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -746,7 +719,6 @@ ) ) ) - (none) ) :code (-> (method-of-type kid-escort waiting-idle) code) :post (the-as (function none :behavior kid-escort) nav-enemy-simple-post) @@ -766,7 +738,6 @@ ) 0 (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -785,7 +756,6 @@ ) ) ) - (none) ) :code (-> (method-of-type kid-escort waiting-idle) code) ) @@ -800,7 +770,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () (local-vars (v1-7 enemy-flag) (v1-15 enemy-flag)) @@ -829,7 +798,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -843,7 +811,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) ) @@ -871,7 +838,6 @@ (if (logtest? (bot-flags bf19) (-> self bot-flags)) (logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water)) ) - (none) ) :trans (behavior () (cond @@ -897,7 +863,6 @@ ) ) ) - (none) ) :code (behavior () (cond @@ -984,7 +949,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kid-escort) nav-enemy-simple-post) ) @@ -1001,7 +965,6 @@ (set! (-> self travel-anim-interp) 0.0) (logior! (-> self focus-status) (focus-status arrestable)) (logclear! (-> self focus-status) (focus-status disable)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1037,7 +1000,6 @@ ) ) #f - (none) ) ) @@ -1053,7 +1015,6 @@ (set! (-> self travel-anim-interp) 0.0) (logior! (-> self focus-status) (focus-status arrestable)) (logclear! (-> self focus-status) (focus-status disable)) - (none) ) :code (-> (method-of-type kid-escort die-falling) code) ) @@ -1087,7 +1048,6 @@ (logior! (-> self focus-status) (focus-status arrestable)) (logior! (-> self focus-status) (focus-status disable)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1124,7 +1084,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kid-escort) nav-enemy-simple-post) ) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc_REF.gc index 21e3f8cb49c..ce6aa6d2661 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc_REF.gc @@ -517,10 +517,10 @@ This commonly includes things such as: ) ;; definition for method 72 of type kid-escort +;; WARN: Return type mismatch none vs object. (defmethod react-to-focus kid-escort ((obj kid-escort)) "@TODO - flesh out docs" (check-arrest obj) - (none) ) ;; definition for method 237 of type kid-escort @@ -778,7 +778,6 @@ This commonly includes things such as: (react-to-focus obj) ) ) - (none) ) ;; definition for method 102 of type kid-escort diff --git a/test/decompiler/reference/jak2/levels/city/market/ashelin/ctyasha-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/market/ashelin/ctyasha-obs_REF.gc index afed872ccb1..5df756bfea2 100644 --- a/test/decompiler/reference/jak2/levels/city/market/ashelin/ctyasha-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/ashelin/ctyasha-obs_REF.gc @@ -992,7 +992,6 @@ (set! (-> obj expensive-gnd-collide?) #f) (enemy-method-124 obj) ((method-of-type grunt go-hostile) obj) - (none) ) ;; failed to figure out what this is: @@ -1005,7 +1004,6 @@ ) ) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type grunt jump) trans))) @@ -1019,7 +1017,6 @@ (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) ) 0 - (none) ) ) @@ -1116,7 +1113,6 @@ (set! (-> obj expensive-gnd-collide?) #f) (enemy-method-124 obj) ((method-of-type juicer go-hostile) obj) - (none) ) ;; failed to figure out what this is: @@ -1129,7 +1125,6 @@ ) ) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type juicer jump) trans))) @@ -1143,7 +1138,6 @@ (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) ) 0 - (none) ) ) @@ -1327,7 +1321,6 @@ :enter (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior tanker-container) sleep-code) ) @@ -1343,7 +1336,6 @@ (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) ) (tanker-container-method-22 self) - (none) ) :code (the-as (function none :behavior tanker-container) sleep-code) ) @@ -1457,8 +1449,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate dormant (tanker-crash) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual idle) ) @@ -1467,7 +1459,6 @@ This commonly includes things such as: :enter (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior tanker-crash) sleep-code) ) @@ -1482,7 +1473,6 @@ This commonly includes things such as: (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) ) (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior tanker-crash) sleep-code) :post (the-as (function none :behavior tanker-crash) ja-post) @@ -1603,10 +1593,10 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate active (tanker-deadly) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) - (let ((a2-1 (-> event param 0)) + (let ((a2-1 (-> block param 0)) (v1-1 (new 'stack-no-clear 'vector)) ) (vector-! v1-1 (-> self root trans) (-> self prev-pos)) @@ -1640,7 +1630,6 @@ This commonly includes things such as: (if (>= (current-time) (-> self die-time)) (go-virtual die-fast) ) - (none) ) ) @@ -1649,7 +1638,6 @@ This commonly includes things such as: :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/market/ctymark-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/market/ctymark-obs_REF.gc index e44631ed23c..698f18ade83 100644 --- a/test/decompiler/reference/jak2/levels/city/market/ctymark-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/ctymark-obs_REF.gc @@ -1048,10 +1048,10 @@ ;; failed to figure out what this is: (defstate idle (market-object) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((attack-info (-> event param 1))) + (let ((attack-info (-> block param 1))) (when proc (let ((attacking-proc (find-offending-process-focusable proc (the-as attack-info attack-info)))) (when attacking-proc @@ -1104,7 +1104,6 @@ (suspend) ) ) - (none) ) ) @@ -1141,7 +1140,6 @@ :virtual #t :enter (behavior () (sound-play "break-vase") - (none) ) ) @@ -1238,7 +1236,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (sound-play "break-flour") - (none) ) ) @@ -1335,7 +1332,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (sound-play "break-veg-wood") - (none) ) ) @@ -1432,7 +1428,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (sound-play "break-crate") - (none) ) ) @@ -1529,7 +1524,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (sound-play "break-veg-straw") - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/meet-brutter/meet-brutter_REF.gc b/test/decompiler/reference/jak2/levels/city/meet-brutter/meet-brutter_REF.gc index ed72cb5dd85..53adcdf2912 100644 --- a/test/decompiler/reference/jak2/levels/city/meet-brutter/meet-brutter_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/meet-brutter/meet-brutter_REF.gc @@ -570,7 +570,6 @@ (t9-1) ) ) - (none) ) ) @@ -579,13 +578,11 @@ :virtual #t :enter (behavior () '() - (none) ) :trans (the-as (function none :behavior paddywagon) #f) :code (the-as (function none :behavior paddywagon) sleep-code) :post (behavior () (vehicle-guard-method-158 self) - (none) ) ) @@ -594,7 +591,6 @@ :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -947,7 +943,6 @@ (quaternion-from-two-vectors! gp-1 s5-2 *up-vector*) (quaternion*! (-> self root quat) gp-1 (-> self root quat)) ) - (none) ) ) ) @@ -966,7 +961,6 @@ ) ) #f - (none) ) ) @@ -1056,7 +1050,6 @@ ) (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) (go-virtual ride) - (none) ) ) @@ -1091,7 +1084,6 @@ ) ) ) - (none) ) ) @@ -1115,7 +1107,6 @@ (joint-channel-float-delete! a0-2) ) ) - (none) ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'vector))) @@ -1128,7 +1119,6 @@ ) (when (handle->process (-> self vehicle)) ) - (none) ) :code (behavior () (ja-channel-push! 3 (seconds 0.2)) @@ -1238,7 +1228,6 @@ (suspend) ) #f - (none) ) ) @@ -1246,12 +1235,12 @@ (defstate exit-vehicle (city-lurker) :virtual #t :event (the-as (function process int symbol event-message-block object :behavior city-lurker) enemy-event-handler) - :enter (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) - (let ((a0-2 (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)))) - (if a0-2 - (set! (-> self nav-mesh-aid) (-> a0-2 entity aid)) + :enter (behavior () + (let ((a0-1 (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)))) + (if a0-1 + (set! (-> self nav-mesh-aid) (-> a0-1 entity aid)) ) - (change-to a0-2 self) + (change-to a0-1 self) ) (when (not (-> self nav)) (format #t "nav mesh not found~%") @@ -1265,12 +1254,12 @@ self (vector-negate-in-place! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (let ((a0-9 (-> self nav state)) + (let ((a0-8 (-> self nav state)) (v1-17 (-> self controller turn-exit-point)) ) - (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) - (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-9 target-post quad) (-> v1-17 quad)) + (logclear! (-> a0-8 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-8 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-8 target-post quad) (-> v1-17 quad)) ) 0 (citizen-nav-init! self) @@ -1292,7 +1281,6 @@ (set! (-> v1-36 enemy-flags) (the-as enemy-flag (logclear (-> v1-36 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) @@ -1301,9 +1289,8 @@ (t9-0) ) ) - (none) ) - :code (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) + :code (behavior () (local-vars (sv-128 float)) (let ((gp-0 0)) (case (-> (the-as vehicle (handle->process (-> self vehicle))) info object-type) @@ -1365,8 +1352,8 @@ (s0-0 (ja-aframe-num 0)) ) (set! sv-128 (ja-aframe 8.0 0)) - (let* ((t0-1 (ja-aframe 2.0 0)) - (f0-9 (s3-2 s2-1 s1-0 s0-0 sv-128 t0-1)) + (let* ((t0-0 (ja-aframe 2.0 0)) + (f0-9 (s3-2 s2-1 s1-0 s0-0 sv-128 t0-0)) (f30-0 (- 1.0 f0-9)) ) (quaternion-copy! (-> self root quat) s4-2) @@ -1384,7 +1371,6 @@ (set! (-> v1-83 prim-core collide-with) (-> self root backup-collide-with)) ) (go-virtual wait-for-ride) - (none) ) ) @@ -1418,11 +1404,9 @@ ) 0 (set! (-> self vehicle) (the-as handle #f)) - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type civilian wait-for-ride) trans))) @@ -1436,7 +1420,6 @@ (go-virtual go-at-end) ) ) - (none) ) :code (behavior () (until #f @@ -1524,7 +1507,6 @@ (label cfg-28) ) #f - (none) ) :post (behavior () (let ((gp-0 (-> self nav state)) @@ -1536,7 +1518,6 @@ ) 0 (nav-enemy-method-176 self) - (none) ) ) @@ -1565,11 +1546,9 @@ ) 0 (set! (-> self vehicle) (the-as handle #f)) - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) - (none) ) :trans (behavior () (when (and (-> self jump-in-pipe?) (< (vector-vector-xz-distance (-> self root trans) (-> self end-pos)) 24576.0)) @@ -1607,7 +1586,6 @@ ) (go-virtual wait-at-end) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1620,7 +1598,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1632,7 +1609,6 @@ ) 0 (nav-enemy-method-176 self) - (none) ) ) @@ -1662,11 +1638,9 @@ 0 (set! (-> self vehicle) (the-as handle #f)) (logior! (-> self nav flags) (nav-control-flag output-sphere-hash)) - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack 'sphere))) @@ -1706,7 +1680,6 @@ (send-event self 'jump 0 (-> self end-pos)) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1719,7 +1692,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1731,7 +1703,6 @@ ) 0 (nav-enemy-method-176 self) - (none) ) ) @@ -1818,11 +1789,9 @@ ) ) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1844,11 +1813,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -1874,7 +1841,6 @@ (t9-1) ) ) - (none) ) ) @@ -1888,11 +1854,9 @@ ) ) (format #t "city-lurker active~%") - (none) ) :code (behavior () (go-virtual wait-for-ride) - (none) ) ) @@ -1901,7 +1865,6 @@ :virtual #t :code (behavior () (go-virtual wait-for-ride) - (none) ) ) @@ -1910,20 +1873,19 @@ :virtual #t :code (behavior () (go-virtual wait-for-ride) - (none) ) ) ;; failed to figure out what this is: (defstate idle (city-lurker) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) @@ -1948,7 +1910,6 @@ 0 (logior! (-> self focus-status) (focus-status pilot-riding pilot)) (set! (-> self coming-from-pw) #t) - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) @@ -1962,7 +1923,6 @@ (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :trans (behavior () (let ((a0-1 (handle->process (-> self vehicle)))) @@ -1982,7 +1942,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2041,11 +2000,9 @@ ) ) #f - (none) ) :post (behavior () (transform-post) - (none) ) ) @@ -2190,79 +2147,67 @@ ;; definition for method 74 of type city-lurker ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 134] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 139] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 110] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 114] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 118] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 15] (defmethod general-event-handler city-lurker ((obj city-lurker) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'nav-mesh-kill) - (format 0 "nav-mesh-kill event recieved by ~s ~d~%" (-> obj name) arg2) - (change-to *default-nav-mesh* obj) - #t - ) - ((= v1-0 'traffic-activate) - (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) - (let ((s5-0 (the-as object (-> arg3 param 0)))) - (set! (-> obj root trans quad) (-> (the-as traffic-object-spawn-params s5-0) position quad)) - (quaternion-copy! (-> obj root quat) (-> (the-as traffic-object-spawn-params s5-0) rotation)) - (set! (-> obj root transv quad) (-> (the-as traffic-object-spawn-params s5-0) velocity quad)) - (let ((a0-10 (-> (the-as traffic-object-spawn-params s5-0) nav-mesh))) - (when a0-10 - (change-to a0-10 obj) - (if (not (-> obj nav)) - (go-inactive obj) - ) - (let ((v1-17 (-> obj nav state))) - (set! (-> v1-17 current-poly) (the-as nav-poly #f)) - ) - 0 - (let ((a1-5 (-> (the-as traffic-object-spawn-params s5-0) nav-branch))) - (when a1-5 - (vehicle-controller-method-13 (-> obj controller) a1-5 (-> obj root trans)) - (let ((a0-14 (-> obj nav state)) - (v1-24 (-> obj controller turn-exit-point)) - ) - (logclear! (-> a0-14 flags) (nav-state-flag directional-mode)) - (logior! (-> a0-14 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-14 target-post quad) (-> v1-24 quad)) + (case arg2 + (('nav-mesh-kill) + (format 0 "nav-mesh-kill event recieved by ~s ~d~%" (-> obj name) arg2) + (change-to *default-nav-mesh* obj) + #t + ) + (('traffic-activate) + (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (let ((s5-0 (the-as object (-> arg3 param 0)))) + (set! (-> obj root trans quad) (-> (the-as traffic-object-spawn-params s5-0) position quad)) + (quaternion-copy! (-> obj root quat) (-> (the-as traffic-object-spawn-params s5-0) rotation)) + (set! (-> obj root transv quad) (-> (the-as traffic-object-spawn-params s5-0) velocity quad)) + (let ((a0-10 (-> (the-as traffic-object-spawn-params s5-0) nav-mesh))) + (when a0-10 + (change-to a0-10 obj) + (if (not (-> obj nav)) + (go-inactive obj) + ) + (let ((v1-17 (-> obj nav state))) + (set! (-> v1-17 current-poly) (the-as nav-poly #f)) + ) + 0 + (let ((a1-5 (-> (the-as traffic-object-spawn-params s5-0) nav-branch))) + (when a1-5 + (vehicle-controller-method-13 (-> obj controller) a1-5 (-> obj root trans)) + (let ((a0-14 (-> obj nav state)) + (v1-24 (-> obj controller turn-exit-point)) ) - 0 - ) + (logclear! (-> a0-14 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-14 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-14 target-post quad) (-> v1-24 quad)) ) - (citizen-nav-init! obj) - (citizen-init! obj) - (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) - (set! (-> obj gnd-height) (-> obj root gspot-pos y)) + 0 ) ) - (set-behavior! obj (the-as traffic-object-spawn-params s5-0)) + (citizen-nav-init! obj) + (citizen-init! obj) + (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) + (set! (-> obj gnd-height) (-> obj root gspot-pos y)) ) ) - ((= v1-0 'traffic-off) - #f - ) - ((= v1-0 'traffic-off-force) - #f - ) - ((= v1-0 'traffic-on) - #f - ) - ((or (= v1-0 'hit) (= v1-0 'hit-flinch) (= v1-0 'hit-knocked)) - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) - ) - (else - ((method-of-type civilian general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) + (set-behavior! obj (the-as traffic-object-spawn-params s5-0)) + ) + ) + (('traffic-off) + #f + ) + (('traffic-off-force) + #f + ) + (('traffic-on) + #f + ) + (('hit 'hit-flinch 'hit-knocked) + ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type civilian general-event-handler) obj arg0 arg1 arg2 arg3) ) ) ) @@ -3432,3 +3377,7 @@ (none) ) ) + + + + diff --git a/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc b/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc index 82369f0d0cd..170016c0ff7 100644 --- a/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc @@ -1899,13 +1899,13 @@ ;; failed to figure out what this is: (defstate idle (onin-game-bubble) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go empty-state) ) (('attack) - (if (-> event param 0) + (if (-> block param 0) (go empty-state) ) ) @@ -1968,15 +1968,14 @@ ) ) (go-virtual fall) - (none) ) ) ;; failed to figure out what this is: (defstate fall (onin-game-bubble) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (when (not (-> self dead?)) (sound-play "onin-pop") @@ -2047,7 +2046,6 @@ 819.2 1.0 ) - (none) ) :code (behavior () (while (and (not (and (< (-> self root transv y) 0.0) (< (-> self root trans y) 36044.8))) (not (-> self dead?))) @@ -2109,14 +2107,12 @@ (while (not (and (< (-> self root transv y) 0.0) (< (-> self root trans y) 31948.8))) (suspend) ) - (none) ) :post (behavior () (+! (-> self root transv y) (* (-> self gravity) (seconds-per-frame))) (set! (-> self root transv x) (* 0.999 (-> self root transv x))) (vector-v+! (-> self root trans) (-> self root trans) (-> self root transv)) (spawn (-> self part) (-> self root trans)) - (none) ) ) @@ -2488,7 +2484,6 @@ (ja-channel-set! 0) (ja-post) (sleep-code) - (none) ) ) @@ -2500,15 +2495,14 @@ (suspend) ) (go-virtual active #t) - (none) ) ) ;; failed to figure out what this is: (defstate active (onin-game) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('done) (sound-play "onin-splat") (set! (-> self last-type) -1) @@ -2597,7 +2591,6 @@ ) ) ) - (none) ) :exit (behavior () (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -2667,7 +2660,6 @@ (want-sound-banks *load-state* (the-as (pointer symbol) a1-29)) ) ) - (none) ) :trans (behavior () (cond @@ -2715,7 +2707,6 @@ (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons up right down left l1 r1 triangle circle x square) ) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-set! 0) @@ -2726,12 +2717,10 @@ ) (talker-spawn-func (-> *talker-speech* 145) *entity-pool* (target-pos 0) (the-as region #f)) (sleep-code) - (none) ) :post (behavior () (onin-game-method-25 self) (ja-post) - (none) ) ) @@ -2794,11 +2783,9 @@ (set-blackout-frames (seconds 0.1)) (sleep-code) ) - (none) ) :post (behavior () (onin-game-method-26 self) - (none) ) ) @@ -2855,7 +2842,6 @@ (set-blackout-frames (seconds 0.1)) (send-event (handle->process gp-4) 'complete) ) - (none) ) :post (-> (method-of-type onin-game lose) post) ) diff --git a/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc b/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc index a392766ac64..58d568d6cb8 100644 --- a/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc @@ -324,18 +324,17 @@ TASK_MANAGER_EVENT_HOOK (lambda :behavior task-manager ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('notify) - (case (-> arg3 param 0) - (('attack) - (if (= (-> arg3 param 1) 18) - #f - ) - ) - ) - ) - ) - ) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if (= (-> arg3 param 1) 18) + #f + ) + ) + ) + ) + ) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/package/delivery-task_REF.gc b/test/decompiler/reference/jak2/levels/city/package/delivery-task_REF.gc index bdcb08aef2d..fc654b51387 100644 --- a/test/decompiler/reference/jak2/levels/city/package/delivery-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/package/delivery-task_REF.gc @@ -93,7 +93,6 @@ (set-vector! (-> self root scale) f0-5 f0-5 f0-5 1.0) ) (ja-post) - (none) ) ) @@ -102,7 +101,6 @@ :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc index a186f31aa83..8d537ec9843 100644 --- a/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc @@ -201,12 +201,10 @@ This commonly includes things such as: (process-drawable-from-entity! self (the-as entity-actor (-> self ent))) (go-virtual done) ) - (none) ) :code (the-as (function none :behavior ctypal-broke-wall) sleep-code) :post (behavior () (transform-post) - (none) ) ) @@ -216,7 +214,6 @@ This commonly includes things such as: :code (the-as (function none :behavior ctypal-broke-wall) sleep-code) :post (behavior () (transform-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/port/ctyport-part_REF.gc b/test/decompiler/reference/jak2/levels/city/port/ctyport-part_REF.gc index cd72db8b6b3..ce06cac5ffe 100644 --- a/test/decompiler/reference/jak2/levels/city/port/ctyport-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/port/ctyport-part_REF.gc @@ -3643,7 +3643,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior hiphog-exterior-marquee) ja-post) ) @@ -3779,14 +3778,12 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (ja-post) (if (nonzero? (-> self part)) (spawn-with-cspace (-> self part) (-> self node-list data 5)) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/port/portrun/portrun_REF.gc b/test/decompiler/reference/jak2/levels/city/port/portrun/portrun_REF.gc index 6936f2c3e96..a110564cfea 100644 --- a/test/decompiler/reference/jak2/levels/city/port/portrun/portrun_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/port/portrun/portrun_REF.gc @@ -1035,7 +1035,6 @@ (set! (-> self state-time) (current-time)) (set! (-> self beep-time) 0) 0 - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -1044,7 +1043,6 @@ ) ) (cleanup-for-death self) - (none) ) :post (behavior () (cond @@ -1118,7 +1116,6 @@ ) (ctyport-mine-method-23 self) (transform-post) - (none) ) ) @@ -1127,7 +1124,6 @@ :virtual #t :enter (behavior () (set! (-> self acc-y) (* 4096.0 (+ 8.0 (* 8.0 (rand-vu))))) - (none) ) :code (behavior () (let ((v1-1 (-> self root root-prim))) @@ -1145,7 +1141,6 @@ #f (label cfg-5) (deactivate self) - (none) ) :post (behavior () (set! (-> self speed-y) (- (-> self speed-y) (* (-> self speed-y) (seconds-per-frame)))) @@ -1153,19 +1148,18 @@ (+! (-> self trans-y) (* (-> self speed-y) (seconds-per-frame))) (set! (-> self root trans y) (+ 2048.0 (-> self trans-y))) (transform-post) - (none) ) ) ;; failed to figure out what this is: (defstate idle (ctyport-mine) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched 'touch 'attack) (cond ((logtest? (process-mask projectile vehicle) (-> proc mask)) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (new-attack-id)) (mode 'mine)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (new-attack-id)) (mode 'mine)))) (set! (-> self beep) #f) ) (else @@ -1184,7 +1178,6 @@ :post (behavior () (ctyport-mine-method-23 self) (transform-post) - (none) ) ) @@ -1288,7 +1281,6 @@ :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.3)) @@ -1318,7 +1310,6 @@ (quaternion-slerp! (-> self root quat) (-> self root quat) gp-0 0.1) ) ) - (none) ) :code (behavior () (until #f @@ -1332,7 +1323,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior ctyport-spy) ja-post) ) @@ -1444,7 +1434,7 @@ ;; failed to figure out what this is: (defstate idle (ctyport-cargo) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1453,7 +1443,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (case event-type + (case message (('attack) (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) (set! (-> gp-0 fountain-rand-transv-lo quad) (-> (target-pos 0) quad)) @@ -1545,7 +1535,6 @@ (set! (-> self speed-y) (- (-> self speed-y) (* 409.6 (seconds-per-frame)))) (+! (-> self trans-y) (* (-> self speed-y) (seconds-per-frame))) (set! (-> self root trans y) (-> self trans-y)) - (none) ) :code (behavior () (until #f @@ -1556,7 +1545,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior ctyport-cargo) transform-post) ) @@ -1582,7 +1570,6 @@ (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) (remove-setting! 'interp-time) (remove-setting! 'mode-name) - (none) ) :trans (behavior () (set! (-> self root trans y) @@ -1593,7 +1580,6 @@ ) ) ) - (none) ) :code (behavior () (set-setting! 'interp-time 'abs 0.0 0) @@ -1612,7 +1598,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior ctyport-cargo) ja-post) ) @@ -1627,7 +1612,6 @@ ) ) (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc b/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc index 8e26bdf4e8d..e2ff5ec6e73 100644 --- a/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc @@ -454,7 +454,6 @@ :enter (behavior () (format #t "errol-rider::got-passed~%") (speech-control-method-12 *speech-control* self (speech-type speech-type-54)) - (none) ) ) @@ -468,7 +467,6 @@ :enter (behavior () (format #t "errol-rider::taunt race-errol-pass~%") (speech-control-method-12 *speech-control* self (speech-type speech-type-53)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.05)) @@ -495,7 +493,6 @@ ) ) (go-virtual active) - (none) ) :post (behavior () (let ((gp-0 (ppointer->process (-> self parent)))) @@ -505,7 +502,6 @@ ) ) (ja-post) - (none) ) ) @@ -842,54 +838,51 @@ ;; failed to figure out what this is: (defstate idle (turbo-ring) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touched) - (let* ((s4-0 (-> (the-as vehicle proc) root)) - (gp-0 (if (type? s4-0 collide-shape-moving) - s4-0 - ) - ) - ) - (when gp-0 - (let ((s4-1 (new 'stack-no-clear 'vehicle-control-point))) - (set! (-> s4-1 local-pos quad) (-> gp-0 trans quad)) - (set! (-> s4-1 normal quad) (-> gp-0 trans-old-old quad)) - (set! (-> s4-1 local-pos w) 1.0) - (set! (-> s4-1 normal w) 1.0) - (let ((f30-0 (vector4-dot (-> self plane) (-> s4-1 local-pos))) - (f28-0 (vector4-dot (-> self plane) (-> s4-1 normal))) - (f0-5 (fmax - (vector-vector-distance-squared (-> self root trans) (-> s4-1 local-pos)) - (vector-vector-distance-squared (-> self root trans) (-> s4-1 normal)) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (let* ((s4-0 (-> (the-as vehicle proc) root)) + (gp-0 (if (type? s4-0 collide-shape-moving) + s4-0 + ) + ) + ) + (when gp-0 + (let ((s4-1 (new 'stack-no-clear 'vehicle-control-point))) + (set! (-> s4-1 local-pos quad) (-> gp-0 trans quad)) + (set! (-> s4-1 normal quad) (-> gp-0 trans-old-old quad)) + (set! (-> s4-1 local-pos w) 1.0) + (set! (-> s4-1 normal w) 1.0) + (let ((f30-0 (vector4-dot (-> self plane) (-> s4-1 local-pos))) + (f28-0 (vector4-dot (-> self plane) (-> s4-1 normal))) + (f0-5 (fmax + (vector-vector-distance-squared (-> self root trans) (-> s4-1 local-pos)) + (vector-vector-distance-squared (-> self root trans) (-> s4-1 normal)) ) - (f1-0 40960.0) + ) + (f1-0 40960.0) + ) + (when (< f0-5 (* f1-0 f1-0)) + (when (or (and (< f30-0 0.0) (>= f28-0 0.0)) (and (< f28-0 0.0) (>= f30-0 0.0))) + (send-event proc 'turbo-ring (-> self boost)) + (set! (-> self touch-time) (current-time)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1059) + 0 + #f + #f + #f + (-> self mat) + :to *entity-pool* ) - (when (< f0-5 (* f1-0 f1-0)) - (when (or (and (< f30-0 0.0) (>= f28-0 0.0)) (and (< f28-0 0.0) (>= f30-0 0.0))) - (send-event proc 'turbo-ring (-> self boost)) - (set! (-> self touch-time) (current-time)) - (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 1059) - 0 - #f - #f - #f - (-> self mat) - :to *entity-pool* - ) - (when (logtest? (-> gp-0 root-prim prim-core collide-as) (collide-spec jak)) - (set! (-> self player-got) #t) - (send-event (ppointer->process (-> self parent)) 'turbo-ring-pickup (-> self id)) - (if (not (-> self persistent)) - (the-as symbol (kill-callback (-> *minimap* engine) (-> self minimap))) - ) - ) + (when (logtest? (-> gp-0 root-prim prim-core collide-as) (collide-spec jak)) + (set! (-> self player-got) #t) + (send-event (ppointer->process (-> self parent)) 'turbo-ring-pickup (-> self id)) + (if (not (-> self persistent)) + (kill-callback (-> *minimap* engine) (-> self minimap)) + ) ) ) ) @@ -897,7 +890,7 @@ ) ) ) - ) + ) ) ) :code (the-as (function none :behavior turbo-ring) sleep-code) @@ -914,7 +907,6 @@ ) (spawn-with-matrix (-> self part) (-> self mat)) 0 - (none) ) ) @@ -931,7 +923,6 @@ (until (>= (- (current-time) (-> self state-time)) (seconds 2)) (suspend) ) - (none) ) ) @@ -1548,15 +1539,14 @@ TASK_MANAGER_EVENT_HOOK (lambda :behavior task-manager ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('race-win 'race-lose) - (let ((v0-0 1)) - (set! (-> self sub-state) (the-as uint v0-0)) - v0-0 - ) - ) - ) - ) + (case arg2 + (('race-win 'race-lose) + (let ((v0-0 1)) + (set! (-> self sub-state) (the-as uint v0-0)) + v0-0 + ) + ) + ) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/protect/protect_REF.gc b/test/decompiler/reference/jak2/levels/city/protect/protect_REF.gc index 3600023f349..53395dafbde 100644 --- a/test/decompiler/reference/jak2/levels/city/protect/protect_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/protect/protect_REF.gc @@ -74,7 +74,6 @@ :post (behavior () (spawn (-> self part) (-> self node-list data 3 bone transform trans)) (ja-post) - (none) ) ) @@ -83,7 +82,6 @@ :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/sack/collection-task_REF.gc b/test/decompiler/reference/jak2/levels/city/sack/collection-task_REF.gc index 040b9541c9a..bbeab9756ef 100644 --- a/test/decompiler/reference/jak2/levels/city/sack/collection-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/sack/collection-task_REF.gc @@ -142,7 +142,6 @@ ) ) ) - (none) ) :code (behavior () (let ((beam-params (new 'stack-no-clear 'task-arrow-params))) @@ -167,7 +166,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior krew-collection-item) ja-post) ) @@ -177,7 +175,6 @@ :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -392,7 +389,7 @@ *game-info* (game-task-node city-krew-collection-collection) TASK_MANAGER_FAIL_HOOK - (lambda :behavior task-manager () (the-as object (kill-all-children self))) + (lambda :behavior task-manager () (kill-all-children self)) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/shuttle/shuttle_REF.gc b/test/decompiler/reference/jak2/levels/city/shuttle/shuttle_REF.gc index fab5acd787e..67473a3f00c 100644 --- a/test/decompiler/reference/jak2/levels/city/shuttle/shuttle_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/shuttle/shuttle_REF.gc @@ -335,7 +335,6 @@ (go-virtual active) (go-virtual wait-for-ride) ) - (none) ) ) @@ -361,7 +360,6 @@ (go-virtual active) (go-virtual wait-for-ride) ) - (none) ) ) @@ -395,7 +393,6 @@ (t9-8) ) ) - (none) ) ) @@ -403,12 +400,12 @@ (defstate exit-vehicle (citizen-rebel) :virtual #t :event (the-as (function process int symbol event-message-block object :behavior citizen-rebel) enemy-event-handler) - :enter (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) - (let ((a0-2 (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)))) - (if a0-2 - (set! (-> self nav-mesh-aid) (the-as actor-id (-> a0-2 entity aid))) + :enter (behavior () + (let ((a0-1 (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)))) + (if a0-1 + (set! (-> self nav-mesh-aid) (the-as actor-id (-> a0-1 entity aid))) ) - (change-to a0-2 self) + (change-to a0-1 self) ) (when (not (-> self nav)) (format #t "nav mesh not found~%") @@ -422,12 +419,12 @@ self (vector-negate-in-place! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (let ((a0-9 (-> self nav state)) + (let ((a0-8 (-> self nav state)) (v1-17 (-> self controller turn-exit-point)) ) - (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) - (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-9 target-post quad) (-> v1-17 quad)) + (logclear! (-> a0-8 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-8 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-8 target-post quad) (-> v1-17 quad)) ) 0 (citizen-nav-init! self) @@ -449,7 +446,6 @@ (set! (-> v1-36 enemy-flags) (the-as enemy-flag (logclear (-> v1-36 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type civilian exit-vehicle) exit))) @@ -457,9 +453,8 @@ (t9-0) ) ) - (none) ) - :code (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) + :code (behavior () (local-vars (sv-176 float) (sv-192 float) (sv-208 float)) (remove-rider (the-as vehicle (handle->process (-> self vehicle))) self) (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) @@ -498,8 +493,8 @@ (s0-0 (ja-aframe-num 0)) ) (set! sv-176 (ja-aframe 10.0 0)) - (let* ((t0-1 (ja-aframe 7.0 0)) - (f0-4 (s3-2 s2-0 s1-0 s0-0 sv-176 t0-1)) + (let* ((t0-0 (ja-aframe 7.0 0)) + (f0-4 (s3-2 s2-0 s1-0 s0-0 sv-176 t0-0)) ) (quaternion-rotate-local-y! (-> self root quat) s4-2 (* f0-4 (if (zero? (-> self seat)) -16384.0 @@ -534,12 +529,12 @@ :frame-num (ja-aframe 5.0 0) ) (until (ja-done? 0) - (let ((a0-60 (handle->process (-> self vehicle))) + (let ((a0-59 (handle->process (-> self vehicle))) (s2-1 (new 'stack-no-clear 'vector)) (s4-6 (new 'stack-no-clear 'vector)) (s3-4 (new 'stack-no-clear 'quaternion)) ) - (compute-seat-position (the-as vehicle a0-60) s2-1 (-> self seat)) + (compute-seat-position (the-as vehicle a0-59) s2-1 (-> self seat)) (vector-! s4-6 s2-1 gp-0) (let ((s2-2 lerp-scale) (s1-1 0.0) @@ -547,8 +542,8 @@ ) (set! sv-192 (ja-aframe-num 0)) (set! sv-208 (ja-aframe 5.0 0)) - (let* ((t0-2 (ja-aframe 1.0 0)) - (f0-13 (s2-2 s1-1 s0-1 sv-192 sv-208 t0-2)) + (let* ((t0-1 (ja-aframe 1.0 0)) + (f0-13 (s2-2 s1-1 s0-1 sv-192 sv-208 t0-1)) (f30-0 (- 1.0 f0-13)) ) (quaternion-rotate-local-y! s3-4 s5-0 (if (zero? (-> self seat)) @@ -556,10 +551,10 @@ 16384.0 ) ) - (let ((a1-40 (vector-y-quaternion! (new 'stack-no-clear 'vector) s3-4)) + (let ((a1-39 (vector-y-quaternion! (new 'stack-no-clear 'vector) s3-4)) (s2-3 (new 'stack-no-clear 'quaternion)) ) - (quaternion-from-two-vectors! s2-3 a1-40 *up-vector*) + (quaternion-from-two-vectors! s2-3 a1-39 *up-vector*) (quaternion*! s3-4 s2-3 s3-4) ) (quaternion-copy! (-> self root quat) s3-4) @@ -576,7 +571,6 @@ (set! (-> v1-96 prim-core collide-with) (-> self root backup-collide-with)) ) (go-virtual wait-for-ride) - (none) ) ) @@ -614,7 +608,6 @@ ) (go-virtual active) ) - (none) ) :code (behavior () (until #f @@ -671,7 +664,6 @@ ) ) #f - (none) ) ) @@ -701,7 +693,6 @@ ) ) ) - (none) ) ) @@ -781,7 +772,6 @@ :virtual #t :trans (behavior () '() - (none) ) :code (behavior () (until #f @@ -841,7 +831,6 @@ ) ) #f - (none) ) ) @@ -1856,3 +1845,7 @@ (none) ) ) + + + + diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kid-states_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kid-states_REF.gc index ef049c8f8e2..67b01b6b036 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kid-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kid-states_REF.gc @@ -20,7 +20,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -45,7 +44,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -73,7 +71,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kid) nav-enemy-simple-post) ) @@ -96,7 +93,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -112,7 +108,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (local-vars (s4-1 art-element) (f0-9 float)) @@ -218,7 +213,6 @@ ) ) (kid-method-232 self) - (none) ) :post (the-as (function none :behavior kid) nav-enemy-simple-post) ) @@ -236,7 +230,6 @@ (go-virtual traveling) ) ) - (none) ) :code (-> (method-of-type kid waiting-idle) code) :post (-> (method-of-type kid waiting-idle) post) @@ -261,7 +254,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -286,7 +278,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -314,7 +305,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kid) nav-enemy-simple-post) ) @@ -340,7 +330,6 @@ (stop-looking-at-target! self) (nav-enemy-method-166 self) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -363,7 +352,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -371,7 +359,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -383,7 +370,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -406,7 +392,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -422,7 +407,6 @@ ) ) ) - (none) ) :code (-> (method-of-type kid waiting-idle) code) :post (the-as (function none :behavior kid) nav-enemy-simple-post) @@ -442,7 +426,6 @@ ) 0 (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -458,7 +441,6 @@ (go-virtual traveling) ) ) - (none) ) :code (-> (method-of-type kid waiting-idle) code) ) @@ -473,7 +455,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () (local-vars (v1-31 enemy-flag) (v1-39 enemy-flag)) @@ -511,7 +492,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -525,7 +505,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) ) @@ -551,7 +530,6 @@ (if (logtest? (bot-flags bf20) (-> self bot-flags)) (logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water)) ) - (none) ) :trans (behavior () (cond @@ -577,7 +555,6 @@ ) ) ) - (none) ) :code (behavior () (when (not (logtest? (bot-flags bf20) (-> self bot-flags))) @@ -625,7 +602,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kid) nav-enemy-simple-post) ) @@ -636,7 +612,6 @@ :enter (behavior () (logior! (-> self bot-flags) (bot-flags bf20)) ((-> (method-of-type kid arrested) enter)) - (none) ) :trans (-> (method-of-type kid arrested) trans) :code (-> (method-of-type kid arrested) code) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc index 8d6a9beeb90..852baa1857e 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc @@ -487,16 +487,16 @@ ) ;; definition for method 70 of type kid +;; WARN: Return type mismatch none vs object. (defmethod go-hostile kid ((obj kid)) (kid-method-232 obj) - (none) ) ;; definition for method 72 of type kid +;; WARN: Return type mismatch none vs object. (defmethod react-to-focus kid ((obj kid)) "@TODO - flesh out docs" (kid-method-232 obj) - (none) ) ;; definition for method 233 of type kid diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kor-states_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kor-states_REF.gc index e0400f97e6f..668c14d58af 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kor-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kor-states_REF.gc @@ -20,7 +20,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -45,7 +44,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -73,7 +71,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kor) nav-enemy-simple-post) ) @@ -97,7 +94,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -113,7 +109,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (local-vars (s4-1 art-element) (f0-9 float)) @@ -229,7 +224,6 @@ ) ) (kor-method-232 self) - (none) ) :post (the-as (function none :behavior kor) nav-enemy-simple-post) ) @@ -247,7 +241,6 @@ (go-virtual traveling) ) ) - (none) ) :code (-> (method-of-type kor waiting-idle) code) :post (-> (method-of-type kor waiting-idle) post) @@ -272,7 +265,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -297,7 +289,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -325,7 +316,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kor) nav-enemy-simple-post) ) @@ -351,7 +341,6 @@ (stop-looking-at-target! self) (nav-enemy-method-166 self) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -374,7 +363,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -382,7 +370,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -394,7 +381,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -417,7 +403,6 @@ (vector-reset! (-> self root transv)) (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -433,7 +418,6 @@ ) ) ) - (none) ) :code (-> (method-of-type kor waiting-idle) code) :post (the-as (function none :behavior kor) nav-enemy-simple-post) @@ -453,7 +437,6 @@ ) 0 (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -469,7 +452,6 @@ (go-virtual traveling) ) ) - (none) ) :code (-> (method-of-type kor waiting-idle) code) ) @@ -484,7 +466,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () (local-vars (v1-31 enemy-flag) (v1-39 enemy-flag)) @@ -522,7 +503,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -536,7 +516,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) ) @@ -562,7 +541,6 @@ (if (logtest? (bot-flags bf20) (-> self bot-flags)) (logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water)) ) - (none) ) :trans (behavior () (cond @@ -588,7 +566,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.25)) @@ -651,7 +628,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior kor) nav-enemy-simple-post) ) @@ -662,7 +638,6 @@ :enter (behavior () (logior! (-> self bot-flags) (bot-flags bf20)) ((-> (method-of-type kor arrested) enter)) - (none) ) :trans (-> (method-of-type kor arrested) trans) :code (-> (method-of-type kor arrested) code) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc index f883b77e357..1793d002e85 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc @@ -503,16 +503,16 @@ ) ;; definition for method 70 of type kor +;; WARN: Return type mismatch none vs object. (defmethod go-hostile kor ((obj kor)) (kor-method-232 obj) - (none) ) ;; definition for method 72 of type kor +;; WARN: Return type mismatch none vs object. (defmethod react-to-focus kor ((obj kor)) "@TODO - flesh out docs" (kor-method-232 obj) - (none) ) ;; definition for method 233 of type kor diff --git a/test/decompiler/reference/jak2/levels/city/slums/neon-baron-part_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/neon-baron-part_REF.gc index c9a5a79f3c2..db6d511f6eb 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/neon-baron-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/neon-baron-part_REF.gc @@ -3396,7 +3396,6 @@ :virtual #t :trans (behavior () (spawn-parts self) - (none) ) :code (behavior () (until #f @@ -3587,7 +3586,6 @@ ) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-chick_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-chick_REF.gc index e8fc205f426..f41e8d33023 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-chick_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-chick_REF.gc @@ -470,7 +470,6 @@ (set! (-> v1-5 child 1 prim-core collide-with) (collide-spec)) ) 0 - (none) ) ) @@ -491,7 +490,6 @@ (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) ) ) - (none) ) ) @@ -512,7 +510,6 @@ (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) ) ) - (none) ) ) @@ -534,7 +531,6 @@ ) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-enemy_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-enemy_REF.gc index a7042fa924b..fd22aed9169 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-enemy_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-enemy_REF.gc @@ -263,7 +263,6 @@ ) ) #f - (none) ) ) @@ -280,7 +279,6 @@ (t9-0) ) ) - (none) ) ) @@ -330,17 +328,13 @@ ) ;; definition for method 70 of type citizen-enemy -;; WARN: Return type mismatch object vs none. (defmethod go-hostile citizen-enemy ((obj citizen-enemy)) (if (not (and (-> obj next-state) (= (-> obj next-state name) 'hostile))) (go (method-of-object obj hostile)) ) - (none) ) ;; definition for method 67 of type citizen-enemy -;; WARN: Return type mismatch object vs none. (defmethod go-stare citizen-enemy ((obj citizen-enemy)) (go (method-of-object obj active)) - (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-fat_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-fat_REF.gc index 6f7c2af2b41..365b8402c09 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-fat_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-fat_REF.gc @@ -470,7 +470,6 @@ (set! (-> v1-5 child 1 prim-core collide-with) (collide-spec)) ) 0 - (none) ) ) @@ -491,7 +490,6 @@ (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) ) ) - (none) ) ) @@ -512,7 +510,6 @@ (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) ) ) - (none) ) ) @@ -521,7 +518,6 @@ :virtual #t :trans (behavior () '() - (none) ) :code (behavior () (until #f @@ -575,7 +571,6 @@ ) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc index 81a94b985b9..676b68a8860 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc @@ -514,7 +514,6 @@ (set! (-> v1-5 child 1 prim-core collide-with) (collide-spec)) ) 0 - (none) ) ) @@ -535,7 +534,6 @@ (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) ) ) - (none) ) ) @@ -556,7 +554,6 @@ (collide-spec backgnd jak civilian enemy hit-by-others-list player-list) ) ) - (none) ) ) @@ -565,7 +562,6 @@ :virtual #t :trans (behavior () '() - (none) ) :code (behavior () (until #f @@ -619,7 +615,6 @@ ) ) #f - (none) ) ) @@ -714,12 +709,10 @@ :event (the-as (function process int symbol event-message-block object :behavior citizen-norm) enemy-event-handler) :enter (behavior () '() - (none) ) :code (behavior () (suspend) (throw-off-vehicle self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc index 9368c02c65c..88e7d9e961f 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc @@ -117,31 +117,25 @@ ) ;; definition for method 67 of type citizen -;; WARN: Return type mismatch object vs none. (defmethod go-stare citizen ((obj citizen)) (go (method-of-object obj flee)) - (none) ) ;; definition for method 70 of type citizen +;; WARN: Return type mismatch none vs object. (defmethod go-hostile citizen ((obj citizen)) (go-inactive obj) - (none) ) ;; definition for method 71 of type citizen -;; WARN: Return type mismatch object vs none. (defmethod go-flee citizen ((obj citizen)) (go (method-of-object obj flee)) - (none) ) ;; definition for method 72 of type citizen -;; WARN: Return type mismatch object vs none. (defmethod react-to-focus citizen ((obj citizen)) "@TODO - flesh out docs" (go (method-of-object obj active)) - (none) ) ;; definition for method 73 of type citizen @@ -150,7 +144,7 @@ "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (logclear! (-> obj flags) (citizen-flag persistent)) (send-event (ppointer->process (-> obj parent)) 'child-killed) - (the-as object (go-inactive obj)) + (go-inactive obj) ) ;; definition for method 17 of type citizen @@ -267,103 +261,94 @@ ;; definition for method 74 of type citizen ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 193] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 198] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 69] (defmethod general-event-handler citizen ((obj citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (let ((v1-0 arg2)) - (the-as - object - (cond - ((or (= v1-0 'hit) (= v1-0 'hit-flinch) (= v1-0 'hit-knocked)) - (let ((v1-1 #f)) - (case (-> obj incoming knocked-type) - (((knocked-type knocked-type-4) - (knocked-type knocked-type-6) - (knocked-type knocked-type-5) - (knocked-type knocked-type-2) - ) - (set! v1-1 #t) - ) - (((knocked-type knocked-type-0)) - (+! (-> obj hit-by-player-count) 1) - (set! v1-1 (>= (-> obj hit-by-player-count) 2)) - ) - ) - (when v1-1 - (let* ((s5-0 (handle->process (-> obj incoming attacker-handle))) - (a2-5 (if (type? s5-0 process-focusable) - s5-0 - ) + (case arg2 + (('hit 'hit-flinch 'hit-knocked) + (let ((v1-1 #f)) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-4) + (knocked-type knocked-type-6) + (knocked-type knocked-type-5) + (knocked-type knocked-type-2) + ) + (set! v1-1 #t) + ) + (((knocked-type knocked-type-0)) + (+! (-> obj hit-by-player-count) 1) + (set! v1-1 (>= (-> obj hit-by-player-count) 2)) + ) + ) + (when v1-1 + (let* ((s5-0 (handle->process (-> obj incoming attacker-handle))) + (a2-5 (if (type? s5-0 process-focusable) + s5-0 ) - ) - (if a2-5 - (trigger-alert obj 1 (the-as target a2-5)) - ) + ) + ) + (if a2-5 + (trigger-alert obj 1 (the-as target a2-5)) ) - ) ) - (go (method-of-object obj knocked)) ) - ((= v1-0 'traffic-off) - (if (not (logtest? (-> obj flags) (citizen-flag persistent))) - (go-inactive obj) - ) - ) - ((= v1-0 'traffic-off-force) + ) + (go (method-of-object obj knocked)) + ) + (('traffic-off) + (if (not (logtest? (-> obj flags) (citizen-flag persistent))) (go-inactive obj) ) - ((= v1-0 'traffic-activate) - (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) - (let ((s5-1 (the-as object (-> arg3 param 0)))) - (set! (-> obj root trans quad) (-> (the-as traffic-object-spawn-params s5-1) position quad)) - (quaternion-copy! (-> obj root quat) (-> (the-as traffic-object-spawn-params s5-1) rotation)) - (set! (-> obj root transv quad) (-> (the-as traffic-object-spawn-params s5-1) velocity quad)) - (let ((a0-24 (-> (the-as traffic-object-spawn-params s5-1) nav-mesh))) - (when a0-24 - (change-to a0-24 obj) - (if (not (-> obj nav)) - (go-inactive obj) - ) - (let ((v1-31 (-> obj nav state))) - (set! (-> v1-31 current-poly) (the-as nav-poly #f)) - ) - 0 - (let ((a1-11 (-> (the-as traffic-object-spawn-params s5-1) nav-branch))) - (when a1-11 - (vehicle-controller-method-13 (-> obj controller) a1-11 (-> obj root trans)) - (let ((a0-28 (-> obj nav state)) - (v1-38 (-> obj controller turn-exit-point)) - ) - (logclear! (-> a0-28 flags) (nav-state-flag directional-mode)) - (logior! (-> a0-28 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-28 target-post quad) (-> v1-38 quad)) + ) + (('traffic-off-force) + (go-inactive obj) + ) + (('traffic-activate) + (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (let ((s5-1 (the-as object (-> arg3 param 0)))) + (set! (-> obj root trans quad) (-> (the-as traffic-object-spawn-params s5-1) position quad)) + (quaternion-copy! (-> obj root quat) (-> (the-as traffic-object-spawn-params s5-1) rotation)) + (set! (-> obj root transv quad) (-> (the-as traffic-object-spawn-params s5-1) velocity quad)) + (let ((a0-24 (-> (the-as traffic-object-spawn-params s5-1) nav-mesh))) + (when a0-24 + (change-to a0-24 obj) + (if (not (-> obj nav)) + (go-inactive obj) + ) + (let ((v1-31 (-> obj nav state))) + (set! (-> v1-31 current-poly) (the-as nav-poly #f)) + ) + 0 + (let ((a1-11 (-> (the-as traffic-object-spawn-params s5-1) nav-branch))) + (when a1-11 + (vehicle-controller-method-13 (-> obj controller) a1-11 (-> obj root trans)) + (let ((a0-28 (-> obj nav state)) + (v1-38 (-> obj controller turn-exit-point)) ) - 0 - ) + (logclear! (-> a0-28 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-28 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-28 target-post quad) (-> v1-38 quad)) ) - (citizen-nav-init! obj) - (citizen-init! obj) - (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) - (set! (-> obj gnd-height) (-> obj root gspot-pos y)) - (set-behavior! obj (the-as traffic-object-spawn-params s5-1)) + 0 ) ) + (citizen-nav-init! obj) + (citizen-init! obj) + (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) + (set! (-> obj gnd-height) (-> obj root gspot-pos y)) + (set-behavior! obj (the-as traffic-object-spawn-params s5-1)) ) ) - ((= v1-0 'nav-mesh-kill) - (remove-process-drawable (-> obj nav state mesh) obj) - (set! (-> obj nav) #f) - (go-inactive obj) - #t - ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) + ) + ) + (('nav-mesh-kill) + (remove-process-drawable (-> obj nav state mesh) obj) + (set! (-> obj nav) #f) + (go-inactive obj) + #t + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) ) ) @@ -1368,11 +1353,9 @@ This commonly includes things such as: (splash-spawn 0.2 a1-3 1) ) ) - (none) ) :exit (behavior () '() - (none) ) :trans (the-as (function none :behavior citizen) #f) :code (behavior () @@ -1426,11 +1409,9 @@ This commonly includes things such as: #f ) ) - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -1449,17 +1430,14 @@ This commonly includes things such as: (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (if (and (-> self wait-return-state) (>= (- (current-time) (-> self state-time)) (-> self wait-time))) (go (-> self wait-return-state)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1481,14 +1459,12 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((a1-1 (vector-! (new 'stack-no-clear 'vector) (-> self controller turn-exit-point) (-> self root trans)))) (seek-toward-heading-vec! (-> self root) a1-1 32768.0 (seconds 0.05)) ) (nav-enemy-simple-post) - (none) ) ) @@ -1530,11 +1506,9 @@ This commonly includes things such as: (format 0 "citizen has no branch in active enter state~%") (citizen-method-195 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) @@ -1573,11 +1547,9 @@ This commonly includes things such as: (citizen-method-195 self a1-3) ) ) - (none) ) :code (behavior () (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 300) - (none) ) :post (behavior () (if (and (nonzero? (-> self controller branch)) @@ -1598,17 +1570,16 @@ This commonly includes things such as: ) 0 (nav-enemy-method-176 self) - (none) ) ) ;; failed to figure out what this is: (defstate inactive (citizen) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('nav-mesh-kill 'traffic-activate 'traffic-off-force 'traffic-off) - (general-event-handler self proc arg1 event-type event) + (general-event-handler self proc argc message block) ) ) ) @@ -1630,11 +1601,9 @@ This commonly includes things such as: (logior! (-> self draw status) (draw-control-status no-draw)) (logclear! (-> self root nav-flags) (nav-flags has-root-sphere has-extra-sphere)) (vehicle-controller-method-11 (-> self controller)) - (none) ) :exit (behavior () '() - (none) ) :code (the-as (function none :behavior citizen) sleep-code) ) @@ -1654,6 +1623,5 @@ This commonly includes things such as: (t9-3) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc index 6046c680220..2333626c541 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc @@ -132,7 +132,7 @@ (move-to-vehicle () _type_ :state 209) (board-vehicle () _type_ :state 210) (ride () _type_ :state 211) - (exit-vehicle (object object int symbol event-message-block) _type_ :state 212) + (exit-vehicle () _type_ :state 212) (wait-at-dest () _type_ :state 213) (civilian-method-214 (_type_ nav-branch int vector float) float 214) (civilian-method-215 (_type_ vector) none 215) @@ -184,6 +184,7 @@ ;; definition for method 17 of type civilian ;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. (defmethod cleanup-for-death civilian ((obj civilian)) (cond ((zero? (-> obj hit-points)) @@ -273,16 +274,16 @@ ) ;; definition for method 70 of type civilian +;; WARN: Return type mismatch none vs object. (defmethod go-hostile civilian ((obj civilian)) (cleanup-for-death obj) - (none) ) ;; definition for method 73 of type civilian ;; WARN: Return type mismatch none vs object. (defmethod kill-prefer-falling civilian ((obj civilian)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - (the-as object (cleanup-for-death obj)) + (cleanup-for-death obj) ) ;; definition for method 199 of type civilian @@ -347,121 +348,115 @@ ;; definition for method 74 of type civilian ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. (defmethod general-event-handler civilian ((obj civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'track) - #f - ) - ((= v1-0 'combo) - #f - ) - ((= v1-0 'touched) - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + (case arg2 + (('track) + #f + ) + (('combo) + #f + ) + (('touched) + ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (('panic) + (let ((a0-6 (-> arg3 param 0))) + (set! (-> obj danger-pos quad) (-> (the-as sphere (+ a0-6 0)) quad)) + ) + (if (and (-> obj next-state) (let ((v1-6 (-> obj next-state name))) + (or (= v1-6 'active) (= v1-6 'wait) (= v1-6 'avoid-danger)) + ) + ) + (go (method-of-object obj flee)) ) - ((= v1-0 'panic) - (let ((a0-6 (-> arg3 param 0))) - (set! (-> obj danger-pos quad) (-> (the-as sphere (+ a0-6 0)) quad)) - ) - (if (and (-> obj next-state) (let ((v1-6 (-> obj next-state name))) - (or (= v1-6 'active) (= v1-6 'wait) (= v1-6 'avoid-danger)) - ) - ) - (go (method-of-object obj flee)) - ) + ) + (('event-death) + (if (zero? (-> obj hit-points)) + (do-effect (-> obj skel effect) 'death-default 0.0 -1) ) - ((= v1-0 'event-death) - (if (zero? (-> obj hit-points)) - (the-as object (do-effect (-> obj skel effect) 'death-default 0.0 -1)) - ) + ) + (('avoid) + (set! (-> obj last-danger-time) (current-time)) + (let ((a0-15 (-> arg3 param 0))) + (set! (-> obj danger-pos quad) (-> (the-as vector (+ a0-15 0)) quad)) + ) + (if (and (-> obj next-state) (let ((v1-18 (-> obj next-state name))) + (or (= v1-18 'active) (= v1-18 'wait)) + ) + ) + (go (method-of-object obj avoid-danger)) ) - ((= v1-0 'avoid) - (set! (-> obj last-danger-time) (current-time)) - (let ((a0-15 (-> arg3 param 0))) - (set! (-> obj danger-pos quad) (-> (the-as vector (+ a0-15 0)) quad)) - ) - (if (and (-> obj next-state) (let ((v1-18 (-> obj next-state name))) - (or (= v1-18 'active) (= v1-18 'wait)) - ) - ) - (go (method-of-object obj avoid-danger)) - ) + ) + (('clear-path) + (set! (-> obj last-danger-time) (current-time)) + (let ((v1-23 (the-as traffic-danger-info (-> arg3 param 0)))) + (set! (-> obj cp-valid?) #t) + (set! (-> obj cp-sphere quad) (-> v1-23 sphere quad)) + (set! (-> obj cp-vec quad) (-> v1-23 velocity quad)) + (case (-> v1-23 danger-type) + (((traffic-danger-type tdt0)) + (set! (-> obj allow-dive) #f) + (set! (-> obj cp-factor) 20.0) + ) + (((traffic-danger-type tdt1)) + (set! (-> obj allow-dive) #f) + (set! (-> obj cp-factor) 20.0) + ) + (((traffic-danger-type tdt2)) + (set! (-> obj allow-dive) #t) + (set! (-> obj cp-factor) 50.0) + ) + (((traffic-danger-type tdt3)) + (set! (-> obj allow-dive) #t) + (set! (-> obj cp-factor) 50.0) + ) + (((traffic-danger-type tdt4)) + (set! (-> obj allow-dive) #f) + (set! (-> obj cp-factor) 2.0) + ) + (((traffic-danger-type tdt5)) + (set! (-> obj allow-dive) #t) + (set! (-> obj cp-factor) 50.0) + ) + (((traffic-danger-type tdt6)) + (set! (-> obj allow-dive) #t) + (set! (-> obj cp-factor) 50.0) + ) ) - ((= v1-0 'clear-path) - (set! (-> obj last-danger-time) (current-time)) - (let ((v1-23 (the-as traffic-danger-info (-> arg3 param 0)))) - (set! (-> obj cp-valid?) #t) - (set! (-> obj cp-sphere quad) (-> v1-23 sphere quad)) - (set! (-> obj cp-vec quad) (-> v1-23 velocity quad)) - (case (-> v1-23 danger-type) - (((traffic-danger-type tdt0)) - (set! (-> obj allow-dive) #f) - (set! (-> obj cp-factor) 20.0) - ) - (((traffic-danger-type tdt1)) - (set! (-> obj allow-dive) #f) - (set! (-> obj cp-factor) 20.0) - ) - (((traffic-danger-type tdt2)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) - ) - (((traffic-danger-type tdt3)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) - ) - (((traffic-danger-type tdt4)) - (set! (-> obj allow-dive) #f) - (set! (-> obj cp-factor) 2.0) - ) - (((traffic-danger-type tdt5)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) - ) - (((traffic-danger-type tdt6)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) + ) + (let ((s5-1 (-> obj cp-plane))) + (set! (-> s5-1 quad) (-> obj cp-vec quad)) + (set! (-> s5-1 y) 0.0) + (vector-rotate90-around-y! s5-1 s5-1) + (vector-normalize! s5-1 1.0) + (set! (-> s5-1 w) (- (vector-dot (the-as vector s5-1) (the-as vector (-> obj cp-sphere))))) + ) + (set! (-> obj cp-exit-time) (+ (current-time) (seconds 4))) + (if (and (-> obj next-state) (let ((v1-54 (-> obj next-state name))) + (or (= v1-54 'active) (= v1-54 'wait) (= v1-54 'avoid-danger)) + ) ) - ) - ) - (let ((s5-1 (-> obj cp-plane))) - (set! (-> s5-1 quad) (-> obj cp-vec quad)) - (set! (-> s5-1 y) 0.0) - (vector-rotate90-around-y! s5-1 s5-1) - (vector-normalize! s5-1 1.0) - (set! (-> s5-1 w) (- (vector-dot (the-as vector s5-1) (the-as vector (-> obj cp-sphere))))) - ) - (set! (-> obj cp-exit-time) (+ (current-time) (seconds 4))) - (if (and (-> obj next-state) (let ((v1-54 (-> obj next-state name))) - (or (= v1-54 'active) (= v1-54 'wait) (= v1-54 'avoid-danger)) - ) - ) - (go (method-of-object obj clear-path)) - ) + (go (method-of-object obj clear-path)) ) - ((or (= v1-0 'hit) (= v1-0 'hit-flinch) (= v1-0 'hit-knocked)) - (speech-control-method-13 *speech-control* (the-as handle obj)) - (if (logtest? (-> obj flags) (citizen-flag female)) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-27)) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-19)) - ) - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ((= v1-0 'end-task) - (let ((v0-0 (the-as object (logclear (-> obj flags) (citizen-flag persistent))))) - (set! (-> obj flags) (the-as citizen-flag v0-0)) - v0-0 - ) + ) + (('hit 'hit-flinch 'hit-knocked) + (speech-control-method-13 *speech-control* (the-as handle obj)) + (if (logtest? (-> obj flags) (citizen-flag female)) + (speech-control-method-12 *speech-control* obj (speech-type speech-type-27)) + (speech-control-method-12 *speech-control* obj (speech-type speech-type-19)) ) - (else - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) + ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (('end-task) + (let ((v0-0 (the-as object (logclear (-> obj flags) (citizen-flag persistent))))) + (set! (-> obj flags) (the-as citizen-flag v0-0)) + v0-0 + ) + ) + (else + ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) ) ) ) @@ -502,7 +497,6 @@ (t9-0) ) ) - (none) ) ) @@ -629,13 +623,11 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 0.0 0.0 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) ) - (none) ) :trans (behavior () (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) @@ -653,15 +645,12 @@ (go-virtual in-ditch) ) (citizen-method-192 self) - (none) ) :code (behavior () (citizen-travel-anim (the-as int (-> self draw art-group data (-> self anim-panic-run))) 30) - (none) ) :post (behavior () (civilian-flee-post) - (none) ) ) @@ -847,13 +836,11 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 0.0 0.0 1.0 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) ) - (none) ) :trans (behavior () (if (< (+ (-> self last-danger-time) (seconds 1)) (current-time)) @@ -874,15 +861,12 @@ ) ) ) - (none) ) :code (behavior () (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) - (none) ) :post (behavior () (civilian-avoid-danger-post2) - (none) ) ) @@ -1031,13 +1015,11 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 0.0 1.0 0.0 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) ) - (none) ) :trans (behavior () (when (citizen-method-187 self) @@ -1087,15 +1069,12 @@ (if (< (-> self cp-exit-time) (current-time)) (go-virtual active) ) - (none) ) :code (behavior () (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 30) - (none) ) :post (behavior () (civilian-clear-path-post2) - (none) ) ) @@ -1133,7 +1112,6 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 0.5 0.5 1.0 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* @@ -1144,13 +1122,11 @@ (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) ) (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) - (none) ) :trans (behavior () (if (< (+ (-> self last-danger-time) (seconds 1)) (current-time)) (go-virtual get-up-front) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1171,11 +1147,9 @@ (suspend) ) #f - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -1227,7 +1201,6 @@ (set-vector! (-> self draw color-mult) 0.5 0.5 1.0 1.0) ) (set! (-> self dive-finished?) #f) - (none) ) :exit (behavior () (if *citizen-debug* @@ -1242,11 +1215,9 @@ (set! (-> v1-9 sphere-mask) (the-as uint #x800fe)) ) 0 - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1270,7 +1241,6 @@ (set! (-> self dive-finished?) #t) (set! (-> self root transv quad) (the-as uint128 0)) (go-virtual cower-ground) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1284,7 +1254,6 @@ (track-target! self) (nav-enemy-method-176 self) ) - (none) ) ) @@ -1316,7 +1285,6 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 0.2 0.2 0.2 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* @@ -1331,11 +1299,9 @@ (set! (-> v1-9 sphere-mask) (the-as uint #x800fe)) ) 0 - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1398,7 +1364,6 @@ (ja :num! (seek! max (-> self speed-scale))) ) (go-virtual get-up-front) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1409,7 +1374,6 @@ ) 0 (track-target! self) - (none) ) ) @@ -1431,17 +1395,14 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1461,7 +1422,6 @@ (ja :num! (seek! max (-> self speed-scale))) ) (go-virtual flee) - (none) ) :post (behavior () (enemy-method-49 self) @@ -1473,7 +1433,6 @@ ) 0 (track-target! self) - (none) ) ) @@ -1495,17 +1454,14 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1523,7 +1479,6 @@ (ja :num! (seek! max (-> self speed-scale))) ) (go-virtual flee) - (none) ) :post (behavior () (enemy-method-49 self) @@ -1535,7 +1490,6 @@ ) 0 (track-target! self) - (none) ) ) @@ -1589,7 +1543,6 @@ ) ) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) @@ -1601,7 +1554,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type citizen knocked) trans))) @@ -1610,17 +1562,16 @@ ) ) (enemy-method-49 self) - (none) ) ) ;; failed to figure out what this is: (defstate wait-for-ride (civilian) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('board-vehicle) - (let ((a0-1 (the-as vehicle (-> event param 0)))) + (let ((a0-1 (the-as vehicle (-> block param 0)))) (when a0-1 (let ((v0-0 (the-as object (process->handle a0-1)))) (set! (-> self vehicle) (the-as handle v0-0)) @@ -1630,7 +1581,7 @@ ) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) @@ -1654,11 +1605,9 @@ ) 0 (set! (-> self vehicle) (the-as handle #f)) - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) - (none) ) :trans (behavior () (if (and (not (logtest? (-> self nav state flags) (nav-state-flag in-mesh))) (< (-> self root trans y) 4096.0)) @@ -1671,7 +1620,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1693,11 +1641,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -1799,8 +1745,8 @@ ;; failed to figure out what this is: (defstate move-to-vehicle (civilian) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (enemy-event-handler proc arg1 event-type event) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (enemy-event-handler proc argc message block) ) :enter (behavior () (logior! (-> self flags) (citizen-flag persistent)) @@ -1826,7 +1772,6 @@ (set! (-> v1-14 sphere-mask) (the-as uint #x800f8)) ) 0 - (none) ) :exit (behavior () (let ((v1-0 (-> self nav))) @@ -1834,7 +1779,6 @@ ) 0 (logclear! (-> self flags) (citizen-flag persistent)) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -1893,23 +1837,20 @@ (go-virtual wait-for-ride) ) ) - (none) ) :code (behavior () (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) ;; failed to figure out what this is: (defstate board-vehicle (civilian) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('vehicle-crash) #f ) @@ -1917,7 +1858,7 @@ (kill-prefer-falling self) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) @@ -1938,12 +1879,10 @@ (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logclear (-> v1-10 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) (logclear! (-> self focus-status) (focus-status pilot)) - (none) ) :trans (behavior () (let ((v1-1 (handle->process (-> self vehicle)))) @@ -1951,7 +1890,6 @@ (throw-off-vehicle self) ) ) - (none) ) :code (behavior () (local-vars (sv-128 float) (sv-144 float)) @@ -2038,47 +1976,30 @@ ) (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) (go-virtual ride) - (none) ) :post (behavior () (track-target! self) - (none) ) ) ;; failed to figure out what this is: (defstate ride (civilian) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type) - (t0-0 'exit-vehicle) - ) - (cond - ((= v1-0 t0-0) - (let ((a0-1 (the-as object (-> event param 0)))) - (set! (-> self event-param-point quad) (-> (the-as vector a0-1) quad)) - ) - (let ((v1-3 (current-time)) - (a0-3 (-> self state-time)) - ) - (if (>= (- v1-3 a0-3) (seconds 1)) - (go-virtual - exit-vehicle - a0-3 - arg1 - (the-as int event-type) - (the-as symbol event) - (the-as event-message-block t0-0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('exit-vehicle) + (let ((a0-1 (the-as object (-> block param 0)))) + (set! (-> self event-param-point quad) (-> (the-as vector a0-1) quad)) ) - ((= v1-0 'end-task) - (kill-prefer-falling self) - ) - (else - (enemy-event-handler proc arg1 event-type event) - ) + (if (>= (- (current-time) (-> self state-time)) (seconds 1)) + (go-virtual exit-vehicle) + ) + ) + (('end-task) + (kill-prefer-falling self) + ) + (else + (enemy-event-handler proc argc message block) ) ) ) @@ -2100,7 +2021,6 @@ ) 0 (logior! (-> self focus-status) (focus-status pilot-riding pilot)) - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) @@ -2114,7 +2034,6 @@ (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :trans (behavior () (let ((v1-1 (handle->process (-> self vehicle)))) @@ -2122,18 +2041,15 @@ (throw-off-vehicle self) ) ) - (none) ) :code (behavior () (until #f (suspend) ) #f - (none) ) :post (behavior () (track-target! self) - (none) ) ) @@ -2141,7 +2057,7 @@ (defstate exit-vehicle (civilian) :virtual #t :event (the-as (function process int symbol event-message-block object :behavior civilian) enemy-event-handler) - :enter (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) + :enter (behavior () (change-to (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000)) self) (if (not (-> self nav)) (go-inactive self) @@ -2154,12 +2070,12 @@ self (vector-negate-in-place! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (let ((a0-8 (-> self nav state)) + (let ((a0-7 (-> self nav state)) (v1-14 (-> self controller turn-exit-point)) ) - (logclear! (-> a0-8 flags) (nav-state-flag directional-mode)) - (logior! (-> a0-8 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-8 target-post quad) (-> v1-14 quad)) + (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-7 target-post quad) (-> v1-14 quad)) ) 0 (citizen-nav-init! self) @@ -2181,12 +2097,10 @@ (set! (-> v1-33 enemy-flags) (the-as enemy-flag (logclear (-> v1-33 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () (logclear! (-> self flags) (citizen-flag persistent)) (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) - (none) ) :trans (behavior () (let ((v1-1 (handle->process (-> self vehicle)))) @@ -2194,9 +2108,8 @@ (throw-off-vehicle self) ) ) - (none) ) - :code (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) + :code (behavior () (local-vars (sv-128 float) (sv-144 float)) (ja-channel-push! 1 (seconds 0.1)) (remove-rider (the-as vehicle (handle->process (-> self vehicle))) self) @@ -2248,12 +2161,12 @@ :frame-num (ja-aframe 5.0 0) ) (until (ja-done? 0) - (let ((a0-47 (handle->process (-> self vehicle))) + (let ((a0-46 (handle->process (-> self vehicle))) (s2-1 (new 'stack-no-clear 'vector)) (s4-3 (new 'stack-no-clear 'vector)) (s3-2 (new 'stack-no-clear 'quaternion)) ) - (compute-seat-position (the-as vehicle a0-47) s2-1 (-> self seat)) + (compute-seat-position (the-as vehicle a0-46) s2-1 (-> self seat)) (vector-! s4-3 s2-1 gp-3) (let ((s2-2 lerp-scale) (s1-1 0.0) @@ -2261,8 +2174,8 @@ ) (set! sv-128 (ja-aframe-num 0)) (set! sv-144 (ja-aframe 5.0 0)) - (let* ((t0-2 (ja-aframe 1.0 0)) - (f0-12 (s2-2 s1-1 s0-0 sv-128 sv-144 t0-2)) + (let* ((t0-1 (ja-aframe 1.0 0)) + (f0-12 (s2-2 s1-1 s0-0 sv-128 sv-144 t0-1)) (f30-0 (- 1.0 f0-12)) ) (quaternion-rotate-local-y! s3-2 s5-2 (if (zero? (-> self seat)) @@ -2284,11 +2197,9 @@ (set! (-> v1-74 prim-core collide-with) (-> self root backup-collide-with)) ) (go-virtual active) - (none) ) :post (behavior () (track-target! self) - (none) ) ) @@ -2308,11 +2219,9 @@ (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2334,10 +2243,12 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) + + + + diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc index 42a44bf29ff..8c13b4e12f8 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc @@ -599,7 +599,6 @@ (go (method-of-object obj active)) (go-hostile obj) ) - (none) ) ;; definition for method 56 of type crimson-guard @@ -613,198 +612,191 @@ ;; definition for method 74 of type crimson-guard ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. ;; WARN: disable def twice: 122. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod general-event-handler crimson-guard ((obj crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (let ((v1-0 arg2)) - (the-as - object - (cond - ((or (= v1-0 'hit) (= v1-0 'hit-flinch) (= v1-0 'hit-knocked)) - (speech-control-method-13 *speech-control* (the-as handle obj)) - (logior! (-> obj flags) (citizen-flag hostile)) - (let* ((s0-0 (handle->process (-> obj incoming attacker-handle))) - (s1-0 (if (type? s0-0 process-focusable) - s0-0 - ) + (case arg2 + (('hit 'hit-flinch 'hit-knocked) + (speech-control-method-13 *speech-control* (the-as handle obj)) + (logior! (-> obj flags) (citizen-flag hostile)) + (let* ((s0-0 (handle->process (-> obj incoming attacker-handle))) + (s1-0 (if (type? s0-0 process-focusable) + s0-0 ) - ) - (when s1-0 - (speech-control-method-12 *speech-control* obj (speech-type speech-type-11)) - (trigger-alert obj 1 (the-as target s1-0)) - ) - ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ((= v1-0 'event-death) - (if (zero? (-> obj hit-points)) - (the-as object (do-effect (-> obj skel effect) 'death-default 0.0 -1)) - ) + ) + ) + (when s1-0 + (speech-control-method-12 *speech-control* obj (speech-type speech-type-11)) + (trigger-alert obj 1 (the-as target s1-0)) ) - ((= v1-0 'bouncing-off) - (when (or (and (-> obj next-state) (= (-> obj next-state name) 'active)) - (and (-> obj next-state) (= (-> obj next-state name) 'wait)) - ) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-14)) - (go (method-of-object obj close-attack-active)) - ) + ) + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (('event-death) + (if (zero? (-> obj hit-points)) + (do-effect (-> obj skel effect) 'death-default 0.0 -1) ) - ((= v1-0 'combo) - (and (not (and (-> obj next-state) (= (-> obj next-state name) 'inactive))) - (and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points))) - ) + ) + (('bouncing-off) + (when (or (and (-> obj next-state) (= (-> obj next-state name) 'active)) + (and (-> obj next-state) (= (-> obj next-state name) 'wait)) + ) + (speech-control-method-12 *speech-control* obj (speech-type speech-type-14)) + (go (method-of-object obj close-attack-active)) + ) + ) + (('combo) + (and (not (and (-> obj next-state) (= (-> obj next-state name) 'inactive))) + (and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points))) + ) + ) + (('avoid) + #f + ) + (('panic) + (set! (-> obj last-danger-time) (current-time)) + (let ((v1-38 (the-as traffic-danger-info (-> arg3 param 0)))) + (case (-> v1-38 danger-type) + (((traffic-danger-type tdt7)) + (set! (-> obj cp-factor) 20.0) + (let ((s5-1 (method-of-object obj trigger-alert)) + (s4-1 1) + (s3-1 (handle->process (-> v1-38 handle))) + ) + (s5-1 obj s4-1 (the-as target (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + ) + ) ) - ((= v1-0 'avoid) - #f + ) + ) + (('clear-path) + (set! (-> obj last-danger-time) (current-time)) + (let ((v1-44 (the-as traffic-danger-info (-> arg3 param 0)))) + (set! (-> obj cp-valid?) #t) + (set! (-> obj cp-sphere quad) (-> v1-44 sphere quad)) + (set! (-> obj cp-vec quad) (-> v1-44 velocity quad)) + (case (-> v1-44 danger-type) + (((traffic-danger-type tdt0)) + (trigger-alert obj 1 *target*) + ) + (((traffic-danger-type tdt1)) + ) + (((traffic-danger-type tdt2)) + ) + (((traffic-danger-type tdt3)) + ) + (((traffic-danger-type tdt4)) + ) + (((traffic-danger-type tdt5)) + ) + (((traffic-danger-type tdt6)) + ) + (((traffic-danger-type tdt7)) + (trigger-alert obj 1 *target*) + ) ) - ((= v1-0 'panic) - (set! (-> obj last-danger-time) (current-time)) - (let ((v1-38 (the-as traffic-danger-info (-> arg3 param 0)))) - (case (-> v1-38 danger-type) - (((traffic-danger-type tdt7)) - (set! (-> obj cp-factor) 20.0) - (let ((s5-1 (method-of-object obj trigger-alert)) - (s4-1 1) - (s3-1 (handle->process (-> v1-38 handle))) - ) - (the-as object (s5-1 obj s4-1 (the-as target (if (type? s3-1 process-focusable) - s3-1 - ) - ) - ) - ) - ) - ) - ) - ) + ) + (let ((s5-2 (-> obj cp-plane))) + (set! (-> s5-2 quad) (-> obj cp-vec quad)) + (set! (-> s5-2 y) 0.0) + (vector-rotate90-around-y! s5-2 s5-2) + (vector-normalize! s5-2 1.0) + (set! (-> s5-2 w) (- (vector-dot (the-as vector s5-2) (the-as vector (-> obj cp-sphere))))) + ) + (let ((v0-4 (the-as object (+ (current-time) (seconds 1))))) + (set! (-> obj cp-exit-time) (the-as time-frame v0-4)) + v0-4 + ) + ) + (('end-pursuit) + (when *debug-segment* + (when (focus-test? obj inactive) + (format 0 "guard::event end-pursuit recieved by inactive process ~d~%" (-> obj pid)) + (break!) + 0 ) - ((= v1-0 'clear-path) - (set! (-> obj last-danger-time) (current-time)) - (let ((v1-44 (the-as traffic-danger-info (-> arg3 param 0)))) - (set! (-> obj cp-valid?) #t) - (set! (-> obj cp-sphere quad) (-> v1-44 sphere quad)) - (set! (-> obj cp-vec quad) (-> v1-44 velocity quad)) - (case (-> v1-44 danger-type) - (((traffic-danger-type tdt0)) - (trigger-alert obj 1 *target*) - ) - (((traffic-danger-type tdt1)) - ) - (((traffic-danger-type tdt2)) - ) - (((traffic-danger-type tdt3)) - ) - (((traffic-danger-type tdt4)) - ) - (((traffic-danger-type tdt5)) - ) - (((traffic-danger-type tdt6)) - ) - (((traffic-danger-type tdt7)) - (trigger-alert obj 1 *target*) - ) - ) - ) - (let ((s5-2 (-> obj cp-plane))) - (set! (-> s5-2 quad) (-> obj cp-vec quad)) - (set! (-> s5-2 y) 0.0) - (vector-rotate90-around-y! s5-2 s5-2) - (vector-normalize! s5-2 1.0) - (set! (-> s5-2 w) (- (vector-dot (the-as vector s5-2) (the-as vector (-> obj cp-sphere))))) - ) - (let ((v0-4 (the-as object (+ (current-time) (seconds 1))))) - (set! (-> obj cp-exit-time) (the-as time-frame v0-4)) - v0-4 - ) + ) + (when (not (focus-test? obj dead)) + (when (logtest? (-> obj flags) (citizen-flag hostile)) + (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) + (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (go (method-of-object obj active)) ) - ((= v1-0 'end-pursuit) - (when *debug-segment* - (when (focus-test? obj inactive) - (format 0 "guard::event end-pursuit recieved by inactive process ~d~%" (-> obj pid)) - (break!) - 0 - ) - ) - (when (not (focus-test? obj dead)) - (when (logtest? (-> obj flags) (citizen-flag hostile)) - (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) - (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (go (method-of-object obj active)) - ) - ) + ) + ) + (('alert-begin) + (when *debug-segment* + (when (focus-test? obj inactive) + (format 0 "guard::event alert-begin recieved by inactive process ~d~%" (-> obj pid)) + (break!) + 0 ) - ((= v1-0 'alert-begin) - (when *debug-segment* - (when (focus-test? obj inactive) - (format 0 "guard::event alert-begin recieved by inactive process ~d~%" (-> obj pid)) - (break!) - 0 - ) - ) - (when (not (focus-test? obj dead)) - (when (not (logtest? (-> obj flags) (citizen-flag hostile))) - (let ((a1-27 (the-as object (-> arg3 param 0)))) - (when (and (the-as uint a1-27) - (not (logtest? (-> (the-as process-focusable a1-27) focus-status) (focus-status disable dead inactive))) - ) - (set! (-> obj traffic-target-status handle) (process->handle (the-as process-focusable a1-27))) - (try-update-focus (-> obj focus) (the-as process-focusable a1-27) obj) - (if (and (not (and (-> obj next-state) (= (-> obj next-state name) 'jump))) - (not (and (-> obj next-state) (= (-> obj next-state name) 'exit-transport))) - ) - (the-as object (go-hostile obj)) - ) + ) + (when (not (focus-test? obj dead)) + (when (not (logtest? (-> obj flags) (citizen-flag hostile))) + (let ((a1-27 (the-as object (-> arg3 param 0)))) + (when (and (the-as uint a1-27) + (not (logtest? (-> (the-as process-focusable a1-27) focus-status) (focus-status disable dead inactive))) + ) + (set! (-> obj traffic-target-status handle) (process->handle (the-as process-focusable a1-27))) + (try-update-focus (-> obj focus) (the-as process-focusable a1-27) obj) + (if (and (not (and (-> obj next-state) (= (-> obj next-state name) 'jump))) + (not (and (-> obj next-state) (= (-> obj next-state name) 'exit-transport))) + ) + (go-hostile obj) ) - ) ) ) ) - ((= v1-0 'alert-end) - (when *debug-segment* - (when (focus-test? obj inactive) - (format 0 "guard::event alert-end recieved by inactive process ~d~%" (-> obj pid)) - (break!) - 0 - ) - ) - (when (not (focus-test? obj dead)) - (when (logtest? (-> obj flags) (citizen-flag hostile)) - (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-5)) - (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (go (method-of-object obj active)) - ) - ) + ) + ) + (('alert-end) + (when *debug-segment* + (when (focus-test? obj inactive) + (format 0 "guard::event alert-end recieved by inactive process ~d~%" (-> obj pid)) + (break!) + 0 ) - ((= v1-0 'track) - (if (and (-> obj next-state) (let ((v1-129 (-> obj next-state name))) - (or (= v1-129 'exit-transport) (= v1-129 'jump)) - ) - ) - #f - #t - ) + ) + (when (not (focus-test? obj dead)) + (when (logtest? (-> obj flags) (citizen-flag hostile)) + (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) + (speech-control-method-12 *speech-control* obj (speech-type speech-type-5)) + (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (go (method-of-object obj active)) ) - ((= v1-0 'notify) - (let ((a0-84 (-> arg3 param 0)) - (v1-130 (the-as object (-> arg3 param 1))) - ) - (when (= a0-84 'attack) - (when (logtest? (-> (the-as process-focusable v1-130) mask) (process-mask target)) - (when (focus-test? (the-as process-focusable v1-130) dead) - (format #t "guard killed player~%") - (the-as object (speech-control-method-12 *speech-control* obj (speech-type speech-type-10))) - ) - ) + ) + ) + (('track) + (if (and (-> obj next-state) (let ((v1-129 (-> obj next-state name))) + (or (= v1-129 'exit-transport) (= v1-129 'jump)) + ) + ) + #f + #t + ) + ) + (('notify) + (let ((a0-84 (-> arg3 param 0)) + (v1-130 (the-as object (-> arg3 param 1))) + ) + (when (= a0-84 'attack) + (when (logtest? (-> (the-as process-focusable v1-130) mask) (process-mask target)) + (when (focus-test? (the-as process-focusable v1-130) dead) + (format #t "guard killed player~%") + (speech-control-method-12 *speech-control* obj (speech-type speech-type-10)) ) ) ) - (else - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) + ) + ) + (else + ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) ) ) ) @@ -832,7 +824,6 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* @@ -847,11 +838,9 @@ (collide-spec backgnd jak civilian hit-by-others-list player-list) ) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -872,7 +861,6 @@ ) (set! (-> self hit-face) (the-as uint -1)) (react-to-focus self) - (none) ) :post (behavior () (enemy-method-49 self) @@ -884,7 +872,6 @@ ) 0 (track-target! self) - (none) ) ) @@ -906,7 +893,6 @@ (if *citizen-debug* (set-vector! (-> self draw color-mult) 1.0 0.5 0.5 1.0) ) - (none) ) :exit (behavior () (if *citizen-debug* @@ -921,11 +907,9 @@ (collide-spec backgnd jak civilian hit-by-others-list player-list) ) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -944,7 +928,6 @@ ) (set! (-> self hit-face) (the-as uint -1)) (react-to-focus self) - (none) ) :post (behavior () (enemy-method-49 self) @@ -956,7 +939,6 @@ ) 0 (track-target! self) - (none) ) ) @@ -990,7 +972,6 @@ ) ) ) - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) @@ -1002,7 +983,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy knocked) trans))) @@ -1011,7 +991,6 @@ ) ) (enemy-method-49 self) - (none) ) ) @@ -1339,17 +1318,15 @@ :event (the-as (function process int symbol event-message-block object :behavior crimson-guard) enemy-event-handler) :enter (behavior () '() - (none) ) :code (behavior () (suspend) (throw-off-vehicle self) - (none) ) ) ;; definition for method 70 of type crimson-guard -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod go-hostile crimson-guard ((obj crimson-guard)) (cond ((handle->process (-> obj focus handle)) @@ -1373,7 +1350,6 @@ ) ) 0 - (none) ) ;; definition for method 214 of type crimson-guard @@ -1423,7 +1399,6 @@ ) (logclear! (-> self flags) (citizen-flag in-pursuit hostile)) (set! (-> self already-shot) #f) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type citizen active) trans))) @@ -1443,7 +1418,6 @@ ) ) ) - (none) ) ) @@ -1472,7 +1446,6 @@ ) 0 (logior! (-> self focus-status) (focus-status dangerous)) - (none) ) :exit (behavior () (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) @@ -1482,11 +1455,9 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1507,11 +1478,9 @@ ) ) (go-virtual active) - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -1530,7 +1499,6 @@ ) (logclear! (-> self flags) (citizen-flag in-pursuit hostile)) (set! (-> self already-shot) #f) - (none) ) ) @@ -1845,11 +1813,9 @@ (if (zero? (-> self controller branch)) (citizen-method-195 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (-> self target-flags) @@ -1863,11 +1829,9 @@ (speech-control-method-12 *speech-control* self (speech-type speech-type-4)) ) ) - (none) ) :code (behavior () (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) - (none) ) :post (behavior () (if (and (nonzero? (-> self controller branch)) @@ -1888,7 +1852,6 @@ ) 0 (nav-enemy-method-176 self) - (none) ) ) @@ -2000,12 +1963,10 @@ ) (logior! (-> self flags) (citizen-flag persistent in-pursuit)) (set! (-> self root nav-radius) 6144.0) - (none) ) :exit (behavior () (when (-> self nav) ) - (none) ) :trans (behavior () (crimson-guard-method-220 self) @@ -2094,11 +2055,9 @@ ) ) ) - (none) ) :code (behavior () (citizen-travel-anim (the-as int (-> self draw art-group data (-> self enemy-info walk-anim))) 60) - (none) ) :post (behavior () (rlet ((acc :class vf) @@ -2168,7 +2127,6 @@ ) ) (nav-enemy-method-176 self) - (none) ) ) ) @@ -2202,7 +2160,6 @@ (set! (-> v1-10 target-speed) 0.0) ) 0 - (none) ) :exit (behavior () (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) @@ -2213,11 +2170,9 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (crimson-guard-method-220 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2238,11 +2193,9 @@ ) ) (go-virtual hostile) - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -2289,12 +2242,10 @@ ) (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self joint-enable) #t) - (none) ) :exit (behavior () (set! (-> self joint-enable) #f) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (crimson-guard-method-220 self) @@ -2325,7 +2276,6 @@ ) ) ) - (none) ) :code (behavior () (local-vars (v1-35 object)) @@ -2425,16 +2375,15 @@ ) ) (crimson-guard-method-226 self) - (none) ) :post (behavior () (citizen-method-200 self) (nav-enemy-method-176 self) - (none) ) ) ;; definition for method 226 of type crimson-guard +;; WARN: Return type mismatch object vs none. (defmethod crimson-guard-method-226 crimson-guard ((obj crimson-guard)) (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) (s5-0 (-> obj root)) @@ -2581,7 +2530,6 @@ ) ) (go-virtual gun-shoot) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -2603,7 +2551,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -2695,7 +2642,6 @@ ) ) (go-virtual gun-shoot) - (none) ) :post (-> (method-of-type crimson-guard roll-right) post) ) @@ -2729,17 +2675,14 @@ (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self joint-enable) #t) (crimson-guard-method-221 self) - (none) ) :exit (behavior () (set! (-> self joint-enable) #f) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (crimson-guard-method-220 self) (send-event (handle->process (-> self focus handle)) 'arrest) - (none) ) :code (behavior () (speech-control-method-12 *speech-control* self (speech-type speech-type-13)) @@ -2792,12 +2735,10 @@ ) ) (go-hostile self) - (none) ) :post (behavior () (citizen-method-200 self) (nav-enemy-simple-post) - (none) ) ) @@ -2829,19 +2770,16 @@ (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self joint-enable) #t) (crimson-guard-method-221 self) - (none) ) :exit (behavior () (set! (-> self joint-enable) #f) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (crimson-guard-method-220 self) (if (logtest? (-> self flags) (citizen-flag target-in-sight)) (speech-control-method-12 *speech-control* self (speech-type speech-type-3)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2883,12 +2821,10 @@ ) ) (go-hostile self) - (none) ) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) (nav-enemy-simple-post) - (none) ) ) @@ -3042,6 +2978,7 @@ ;; definition for method 222 of type crimson-guard ;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. (defmethod crimson-guard-method-222 crimson-guard ((obj crimson-guard)) (local-vars (sv-800 vector)) (rlet ((acc :class vf) @@ -3305,7 +3242,6 @@ (set! (-> self state-time) (current-time)) (set! (-> self lazer-sound) (new 'static 'sound-id)) 0 - (none) ) :exit (behavior () (if (nonzero? (-> self lazer-sound)) @@ -3339,7 +3275,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (crimson-guard-method-220 self) @@ -3358,7 +3293,6 @@ (go-virtual active) ) ) - (none) ) :code (behavior () (local-vars (v1-94 symbol)) @@ -3544,12 +3478,10 @@ ) ) #f - (none) ) :post (behavior () (citizen-method-200 self) (nav-enemy-method-176 self) - (none) ) ) @@ -3842,12 +3774,10 @@ ) 0 (set! (-> self already-shot) #f) - (none) ) :exit (behavior () (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) (logclear! (-> self nav flags) (nav-control-flag output-sphere-hash)) - (none) ) :trans (behavior () (rlet ((acc :class vf) @@ -3904,7 +3834,6 @@ ) (crimson-guard-method-223 self 0.0) ) - (none) ) ) :code (behavior () @@ -3930,11 +3859,9 @@ (suspend) ) #f - (none) ) :post (behavior () (ja-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc index f3f581c897b..cf1db0e3ba9 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc @@ -290,13 +290,11 @@ ) ;; definition for method 68 of type metalhead-flitter -;; WARN: Return type mismatch object vs none. (defmethod go-stare2 metalhead-flitter ((obj metalhead-flitter)) (if (and (= (-> obj focus aware) (enemy-aware enemy-aware-2)) (not (nav-enemy-method-163 obj))) (go (method-of-object obj pacing)) (go (method-of-object obj stare)) ) - (none) ) ;; failed to figure out what this is: @@ -332,7 +330,6 @@ ) ) ) - (none) ) :code (behavior () (case (-> self level name) @@ -425,7 +422,6 @@ ) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) - (none) ) ) @@ -455,7 +451,6 @@ (vector-reset! (-> gp-0 transv)) (set! (-> gp-0 transv y) (* 4096.0 (get-rand-float-range self 34.0 38.0))) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -549,7 +544,6 @@ #f (label cfg-33) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior metalhead-flitter) nav-enemy-falling-post) ) @@ -686,7 +680,6 @@ ) ) ) - (none) ) ) @@ -739,7 +732,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a0-0 self)) @@ -750,7 +742,6 @@ ) ) ) - (none) ) ) @@ -766,7 +757,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type citizen-enemy hostile) trans))) @@ -775,7 +765,6 @@ ) ) (metalhead-flitter-method-205 self) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -787,7 +776,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -801,7 +789,6 @@ (t9-2) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -812,7 +799,6 @@ ) (send-event self 'death-end) (cleanup-for-death self) - (none) ) ) @@ -847,7 +833,6 @@ (set! (-> v1-8 attack-id) v0-2) (set! (-> self attack-id) v0-2) ) - (none) ) :exit (behavior () (metalhead-flitter-method-208 self #f) @@ -855,7 +840,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (local-vars (s5-2 vector)) @@ -890,7 +874,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 2 (seconds 0.1)) @@ -941,7 +924,6 @@ ) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior metalhead-flitter) nav-enemy-travel-post) ) @@ -952,7 +934,6 @@ :post (behavior () (metalhead-flitter-method-206 self) (nav-enemy-simple-post) - (none) ) ) @@ -1005,7 +986,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a0-0 self)) @@ -1016,7 +996,6 @@ ) ) ) - (none) ) ) @@ -1030,7 +1009,6 @@ ) ) (set! (-> self off-screen-timer) (the-as uint (current-time))) - (none) ) :trans (behavior () (let ((gp-0 (handle->process (-> self focus handle)))) @@ -1076,7 +1054,6 @@ ) ) ) - (none) ) :code (behavior () (nav-enemy-method-166 self) @@ -1099,7 +1076,6 @@ ) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-grunt_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-grunt_REF.gc index 64ee66120fb..8654e53e1ff 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-grunt_REF.gc @@ -353,7 +353,6 @@ (go-hostile obj) ) ) - (none) ) ;; failed to figure out what this is: @@ -394,7 +393,6 @@ (set! (-> v1-17 attack-id) v0-9) (set! (-> self attack-id) v0-9) ) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim)) @@ -413,12 +411,12 @@ ) (sound-play "grunt-notice") (go-virtual hostile) - (none) ) :post (the-as (function none :behavior metalhead-grunt) nav-enemy-falling-post) ) ;; definition for method 93 of type metalhead-grunt +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-93 metalhead-grunt ((obj metalhead-grunt)) (case (-> obj jump-why) ((2) @@ -445,7 +443,6 @@ (go-virtual notice) ) (get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp) - (none) ) :code (behavior () (set! (-> self jumping-ambush-path-pt) 1) @@ -467,7 +464,6 @@ (suspend) ) #f - (none) ) ) @@ -505,7 +501,6 @@ (suspend) ) #f - (none) ) ) @@ -647,7 +642,6 @@ ) ) #f - (none) ) ) @@ -727,7 +721,6 @@ ) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -783,7 +776,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior metalhead-grunt) nav-enemy-chase-post) ) @@ -816,7 +808,6 @@ #t (t9-1 a0-6) ) - (none) ) :exit (behavior () (let* ((a0-0 self) @@ -829,7 +820,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (enemy-method-49 self) @@ -837,7 +827,6 @@ (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "grunt-hit") ) - (none) ) :code (behavior () (set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (get-rand-int self 2))) @@ -900,7 +889,6 @@ (set! (-> self use-charge-anim-index) v1-57) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior metalhead-grunt) nav-enemy-chase-post) ) @@ -943,7 +931,6 @@ #t (t9-3 a0-14) ) - (none) ) :exit (behavior () (let* ((a0-0 self) @@ -956,14 +943,12 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "grunt-hit") ) - (none) ) :code (behavior () (set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (get-rand-int self 2))) @@ -996,7 +981,6 @@ ) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior metalhead-grunt) nav-enemy-simple-post) ) @@ -1035,7 +1019,6 @@ ) ) #f - (none) ) ) @@ -1279,7 +1262,6 @@ ) ) ) - (none) ) :code (-> (method-of-type nav-enemy idle) code) :post (-> (method-of-type nav-enemy idle) post) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc index db2b8a4e968..f9e3b5d6c76 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc @@ -848,7 +848,6 @@ ) ) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type citizen-enemy active) trans))) @@ -856,7 +855,6 @@ (t9-0) ) ) - (none) ) ) @@ -875,7 +873,6 @@ (if (zero? (get-rand-int self 3)) (sound-play "pred-talk") ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type citizen-enemy hostile) trans))) @@ -906,7 +903,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -929,7 +925,6 @@ ) ) #f - (none) ) ) @@ -950,14 +945,12 @@ ) (traffic-danger-init! self) (logior! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (let ((v1-2 (handle->process (-> self focus handle)))) @@ -971,7 +964,6 @@ (go-virtual active) ) ) - (none) ) :code (behavior () (label cfg-0) @@ -1013,7 +1005,6 @@ (b! (not #f) cfg-0 :delay (empty-form)) (label cfg-26) (go-hostile self) - (none) ) :post (the-as (function none :behavior metalhead-predator) enemy-simple-post) ) @@ -1041,7 +1032,6 @@ (set! (-> v1-10 target-speed) 4096.0) ) 0 - (none) ) :exit (behavior () (metalhead-predator-method-205 self #f) @@ -1050,11 +1040,9 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (enemy-method-49 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1088,7 +1076,6 @@ (sound-play "pred-talk") ) (go-hostile self) - (none) ) :post (the-as (function none :behavior metalhead-predator) nav-enemy-chase-post) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/traffic-manager_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/traffic-manager_REF.gc index 8ddb522d0b0..f38cb706d4c 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/traffic-manager_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/traffic-manager_REF.gc @@ -741,13 +741,11 @@ :event traffic-manager-event-handler :enter (behavior () (spawn-all self) - (none) ) :code (behavior () (suspend) (suspend) (go-virtual active) - (none) ) ) @@ -758,7 +756,6 @@ :code (the-as (function none :behavior traffic-manager) sleep-code) :post (behavior () (update self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/transport_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/transport_REF.gc index 571a9c47a59..a910d825adc 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/transport_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/transport_REF.gc @@ -97,7 +97,6 @@ (turret-control-method-11 (-> self turret) self s5-1 (-> (the-as process-focusable gp-0) root transv)) ) ) - (none) ) :code (the-as (function none :behavior vehicle-turret) sleep-code) :post (the-as (function none :behavior vehicle-turret) transform-post) @@ -351,7 +350,6 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self last-guard-spawn-time) (current-time)) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -364,7 +362,6 @@ (ja :num! (seek!)) ) (sleep-code) - (none) ) :post (behavior () (set! (-> self root transv y) (* 2.0 (- (-> self y-dest) (-> self root trans y)))) @@ -375,7 +372,6 @@ ) (transport-method-35 self) (transform-post) - (none) ) ) @@ -388,11 +384,9 @@ (set! (-> self root transv y) 0.0) (set! (-> self last-guard-spawn-time) 0) 0 - (none) ) :exit (behavior () (transport-method-34 self (the-as process #f)) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -406,7 +400,6 @@ (ja :num! (seek! max 0.5)) ) (sleep-code) - (none) ) :post (behavior () (local-vars (gp-0 symbol)) @@ -444,7 +437,6 @@ (transport-method-34 self *target*) (transport-method-35 self) (transform-post) - (none) ) ) @@ -454,7 +446,6 @@ :code (behavior () (sound-stop (-> self ambient-sound-id)) (cleanup-for-death self) - (none) ) ) @@ -465,7 +456,6 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self root transv y) 0.0) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -480,7 +470,6 @@ (ja :num! (seek! max 0.2)) ) (sleep-code) - (none) ) :post (behavior () (transport-method-35 self) @@ -493,7 +482,6 @@ (go-virtual die-fast) ) (transform-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc index 53513f704b6..0b2592a70eb 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc @@ -1159,6 +1159,7 @@ ) ;; definition for method 130 of type vehicle-guard +;; WARN: Return type mismatch object vs none. (defmethod vehicle-method-130 vehicle-guard ((obj vehicle-guard) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((9) @@ -1385,7 +1386,6 @@ (t9-3) ) ) - (none) ) :trans (the-as (function none :behavior vehicle-guard) #f) :code (the-as (function none :behavior vehicle-guard) sleep-code) @@ -1411,7 +1411,6 @@ ) (check-player-get-on self) (vehicle-method-122 self) - (none) ) ) @@ -1424,7 +1423,6 @@ ) :enter (behavior () (set! (-> self ai-hook) (method-of-object self vehicle-method-93)) - (none) ) :trans (the-as (function none :behavior vehicle-guard) #f) :code (the-as (function none :behavior vehicle-guard) sleep-code) @@ -1467,7 +1465,6 @@ (go-virtual slow-pursuit) ) (vehicle-guard-method-154 self) - (none) ) ) @@ -1480,7 +1477,6 @@ ) :enter (behavior () (set! (-> self ai-hook) (method-of-object self vehicle-guard-method-156)) - (none) ) :trans (the-as (function none :behavior vehicle-guard) #f) :code (the-as (function none :behavior vehicle-guard) sleep-code) @@ -1498,7 +1494,6 @@ ) ) (vehicle-guard-method-154 self) - (none) ) ) @@ -1512,7 +1507,6 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self ai-hook) (method-of-object self vehicle-guard-method-156)) - (none) ) :trans (the-as (function none :behavior vehicle-guard) #f) :code (the-as (function none :behavior vehicle-guard) sleep-code) @@ -1536,7 +1530,6 @@ ) ) (vehicle-guard-method-154 self) - (none) ) ) @@ -1550,7 +1543,6 @@ :enter (behavior () (logior! (-> self flags) (rigid-body-object-flag riding ignition ai-driving)) (set! (-> self ai-hook) (method-of-object self vehicle-guard-method-156)) - (none) ) :trans (the-as (function none :behavior vehicle-guard) #f) :code (the-as (function none :behavior vehicle-guard) sleep-code) @@ -1574,6 +1566,5 @@ (the-as rigid-body-object-flag (logior (rigid-body-object-flag in-pursuit) (-> self flags))) ) (vehicle-guard-method-154 self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-rider_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-rider_REF.gc index 07f123bcbc0..c3f56fc8cf6 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-rider_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-rider_REF.gc @@ -141,6 +141,7 @@ ;; definition for function vehicle-rider-event-handler ;; INFO: Used lq/sq (defbehavior vehicle-rider-event-handler vehicle-rider ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) (case arg2 (('traffic-on) (logior! (-> self flags) 2) @@ -186,10 +187,14 @@ (go-virtual got-passed) ) (('hide) - (logior! (-> self draw status) (draw-control-status no-draw)) + (set! v0-0 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + v0-0 ) (('unhide) - (logclear! (-> self draw status) (draw-control-status no-draw)) + (set! v0-0 (logclear (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + v0-0 ) (('rider-on) (logior! (-> self flags) 1) @@ -202,72 +207,53 @@ (vehicle-rider-method-35 self) ) ) - (none) ) ;; failed to figure out what this is: (defstate active (vehicle-rider) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior vehicle-rider) - vehicle-rider-event-handler - ) + :event vehicle-rider-event-handler :enter (behavior () (ja-channel-push! 1 (seconds 0.05)) (ja :group! (-> self draw art-group data (-> self riding-anim))) - (none) ) :code (the-as (function none :behavior vehicle-rider) sleep-code) :post (behavior () (vehicle-rider-method-34 self) - (none) ) ) ;; failed to figure out what this is: (defstate taunt (vehicle-rider) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior vehicle-rider) - vehicle-rider-event-handler - ) + :event vehicle-rider-event-handler :code (the-as (function none :behavior vehicle-rider) sleep-code) :post (behavior () (go-virtual active) (vehicle-rider-method-34 self) - (none) ) ) ;; failed to figure out what this is: (defstate got-passed (vehicle-rider) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior vehicle-rider) - vehicle-rider-event-handler - ) + :event vehicle-rider-event-handler :code (the-as (function none :behavior vehicle-rider) sleep-code) :post (behavior () (go-virtual active) (vehicle-rider-method-34 self) - (none) ) ) ;; failed to figure out what this is: (defstate inactive (vehicle-rider) :virtual #t - :event (the-as - (function process int symbol event-message-block object :behavior vehicle-rider) - vehicle-rider-event-handler - ) + :event vehicle-rider-event-handler :enter (behavior () (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior vehicle-rider) sleep-code) ) @@ -287,6 +273,7 @@ This commonly includes things such as: ;; definition for function vehicle-rider-init-by-other ;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. (defbehavior vehicle-rider-init-by-other vehicle-rider ((arg0 traffic-object-spawn-params)) (initialize-collision self) (set! (-> self root trans quad) (-> arg0 position quad)) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-states_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-states_REF.gc index 2c5651abdaf..8a55bab16fb 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-states_REF.gc @@ -2,36 +2,32 @@ (in-package goal) ;; definition for function vehicle-event-handler -;; WARN: Return type mismatch object vs none. (defbehavior vehicle-event-handler vehicle ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (rigid-body-object-method-46 self (the-as process-drawable arg0) arg1 arg2 arg3) - (none) ) ;; failed to figure out what this is: (defstate idle (vehicle) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior vehicle) vehicle-event-handler) + :event vehicle-event-handler :enter (behavior () (set! (-> self state-time) (current-time)) (rigid-body-object-method-39 self) (go-virtual waiting) - (none) ) :code (the-as (function none :behavior vehicle) sleep-code) :post (behavior () (ja-post) - (none) ) ) ;; failed to figure out what this is: (defstate inactive (vehicle) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('nav-mesh-kill 'traffic-activate 'traffic-off-force 'traffic-off 'rider-on 'rider-off) - (rigid-body-object-method-46 self (the-as process-drawable proc) arg1 event-type event) + (rigid-body-object-method-46 self (the-as process-drawable proc) argc message block) ) ) ) @@ -41,13 +37,11 @@ (rigid-body-object-method-41 self) (vehicle-method-88 self) (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (behavior () (rigid-body-object-method-40 self) (logclear! (-> self focus-status) (focus-status disable inactive)) (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior vehicle) sleep-code) ) @@ -55,32 +49,29 @@ ;; failed to figure out what this is: (defstate active (vehicle) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior vehicle) vehicle-event-handler) + :event vehicle-event-handler :enter (behavior () (set! (-> self state-time) (current-time)) (vehicle-method-139 self) (logior! (-> self flags) (rigid-body-object-flag riding ai-driving)) (vehicle-method-142 self) (set! (-> self flight-level-index) 1) - (none) ) :exit (behavior () '() - (none) ) :trans (the-as (function none :behavior vehicle) #f) :code (the-as (function none :behavior vehicle) sleep-code) :post (behavior () (check-player-get-on self) (vehicle-method-122 self) - (none) ) ) ;; failed to figure out what this is: (defstate waiting (vehicle) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior vehicle) vehicle-event-handler) + :event vehicle-event-handler :enter (behavior () (set! (-> self state-time) (current-time)) (vehicle-method-140 self) @@ -103,7 +94,6 @@ 0 ) ) - (none) ) :exit (behavior () (logclear! (-> self flags) (rigid-body-object-flag waiting-for-player)) @@ -125,20 +115,18 @@ (set! (-> v1-3 prim-core collide-as) (collide-spec vehicle-sphere)) ) ) - (none) ) :trans (the-as (function none :behavior vehicle) #f) :code (the-as (function none :behavior vehicle) sleep-code) :post (behavior () (vehicle-method-123 self) - (none) ) ) ;; failed to figure out what this is: (defstate player-control (vehicle) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior vehicle) vehicle-event-handler) + :event vehicle-event-handler :enter (behavior () (set-setting! 'sound-flava #f 31.0 5) (set! (-> self state-time) (current-time)) @@ -163,7 +151,6 @@ (logior! (-> self root penetrated-by) (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot)) (set! (-> self damage-factor) (* 0.7518797 (-> self damage-factor))) 0 - (none) ) :exit (behavior () (logclear! (-> self root penetrated-by) (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot)) @@ -191,7 +178,6 @@ (rigid-body-object-method-42 self) (logclear! (-> self flags) (rigid-body-object-flag player-driving)) (remove-setting! 'sound-flava) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) @@ -209,7 +195,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior vehicle) sleep-code) :post (behavior () @@ -245,14 +230,13 @@ ) (label cfg-4) 0 - (none) ) ) ;; failed to figure out what this is: (defstate crash (vehicle) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior vehicle) vehicle-event-handler) + :event vehicle-event-handler :enter (behavior () (logclear! (-> self flags) (rigid-body-object-flag player-driving)) (set! (-> self state-time) (current-time)) @@ -262,19 +246,16 @@ (dotimes (gp-0 (-> self info seat-count)) (send-event (handle->process (-> self rider-array gp-0)) 'vehicle-crash) ) - (none) ) :trans (behavior () (set! (-> self hit-points) (- (-> self hit-points) (* 0.5 (seconds-per-frame)))) (if (and (>= (- (current-time) (-> self state-time)) 1) (< (-> self hit-points) -0.25)) (go-virtual explode) ) - (none) ) :code (the-as (function none :behavior vehicle) sleep-code) :post (behavior () (vehicle-method-121 self) - (none) ) ) @@ -383,7 +364,7 @@ ;; failed to figure out what this is: (defstate explode (vehicle) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior vehicle) vehicle-event-handler) + :event vehicle-event-handler :enter (behavior () (rlet ((vf0 :class vf)) (init-vf0-vector) @@ -467,13 +448,11 @@ ) ) (set! (-> self state-time) (current-time)) - (none) ) ) :code (the-as (function none :behavior vehicle) sleep-code) :post (behavior () (vehicle-explode-post) - (none) ) ) @@ -490,7 +469,6 @@ (cleanup-for-death self) ) ) - (none) ) ) @@ -499,26 +477,21 @@ :virtual #t :enter (behavior () '() - (none) ) :exit (behavior () (set! (-> self flags) (the-as rigid-body-object-flag (logclear (-> self flags) (rigid-body-object-flag measure-control-parameters))) ) - (none) ) :trans (behavior () (if (cpad-pressed? 1 square) (vehicle-method-138 self) ) - (none) ) :code (behavior () (vehicle-method-138 self) - (none) ) :post (behavior () (vehicle-method-121 self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc index 77125fe3c03..307a152a7ce 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc @@ -1792,110 +1792,105 @@ ) ) ) - (let ((v1-19 arg2)) - (the-as - object - (cond - ((= v1-19 'traffic-off) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag persistent))) - (cond - ((logtest? (-> obj flags) (rigid-body-object-flag dead)) - (go (method-of-object obj die)) - ) - (else - (if (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) - (vehicle-method-113 obj) - ) + (case arg2 + (('traffic-off) + (when (not (logtest? (-> obj flags) (rigid-body-object-flag persistent))) + (cond + ((logtest? (-> obj flags) (rigid-body-object-flag dead)) + (go (method-of-object obj die)) + ) + (else + (if (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) + (vehicle-method-113 obj) ) - ) ) ) - ((= v1-19 'traffic-off-force) - (vehicle-method-113 obj) - ) - ((= v1-19 'traffic-activate) - (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) - (logior! (-> obj flags) (rigid-body-object-flag traffic-managed)) - (let ((s5-1 (the-as traffic-object-spawn-params (-> arg3 param 0)))) - (set! (-> obj root trans quad) (-> s5-1 position quad)) - (quaternion-copy! (-> obj root quat) (-> s5-1 rotation)) - (set! (-> obj root transv quad) (-> s5-1 velocity quad)) - (vehicle-method-130 obj s5-1) + ) + ) + (('traffic-off-force) + (vehicle-method-113 obj) + ) + (('traffic-activate) + (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (logior! (-> obj flags) (rigid-body-object-flag traffic-managed)) + (let ((s5-1 (the-as traffic-object-spawn-params (-> arg3 param 0)))) + (set! (-> obj root trans quad) (-> s5-1 position quad)) + (quaternion-copy! (-> obj root quat) (-> s5-1 rotation)) + (set! (-> obj root transv quad) (-> s5-1 velocity quad)) + (vehicle-method-130 obj s5-1) + ) + ) + (('attack) + (let ((s3-1 (the-as attack-info (-> arg3 param 1))) + (s2-1 (get-penetrate-using-from-attack-event arg0 arg3)) ) - ) - ((= v1-19 'attack) - (let ((s3-1 (the-as attack-info (-> arg3 param 1))) - (s2-1 (get-penetrate-using-from-attack-event arg0 arg3)) - ) - (when (and (!= (-> s3-1 id) (-> obj incoming-attack-id)) - (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) - (or (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) - (not (logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot) s2-1)) - ) + (when (and (!= (-> s3-1 id) (-> obj incoming-attack-id)) + (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) + (or (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) + (not (logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot) s2-1)) ) - (set! (-> obj incoming-attack-id) (-> s3-1 id)) - (when (and (logtest? (-> obj info flags) 4) (logtest? (rigid-body-object-flag ai-driving) (-> obj flags))) - (let ((a1-8 (find-offending-process-focusable arg0 s3-1))) - (if (and a1-8 (logtest? (-> a1-8 mask) (process-mask target))) - (vehicle-method-134 obj a1-8) - ) + ) + (set! (-> obj incoming-attack-id) (-> s3-1 id)) + (when (and (logtest? (-> obj info flags) 4) (logtest? (rigid-body-object-flag ai-driving) (-> obj flags))) + (let ((a1-8 (find-offending-process-focusable arg0 s3-1))) + (if (and a1-8 (logtest? (-> a1-8 mask) (process-mask target))) + (vehicle-method-134 obj a1-8) ) - ) - (rigid-body-object-method-47 obj arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) s2-1) ) ) + (rigid-body-object-method-47 obj arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) s2-1) ) - ((= v1-19 'turbo-ring) - (set! (-> obj turbo-boost-factor) (the-as float (-> arg3 param 0))) - (set! (-> obj turbo-boost-time) (current-time)) - (set! (-> obj turbo-boost-duration) (the-as uint 75)) - (logior! (-> obj flags) (rigid-body-object-flag turbo-boost)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (sound-play "boost-ring") - ) + ) + ) + (('turbo-ring) + (set! (-> obj turbo-boost-factor) (the-as float (-> arg3 param 0))) + (set! (-> obj turbo-boost-time) (current-time)) + (set! (-> obj turbo-boost-duration) (the-as uint 75)) + (logior! (-> obj flags) (rigid-body-object-flag turbo-boost)) + (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (sound-play "boost-ring") ) - ((= v1-19 'get-offending-focusable) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - *target* - ) + ) + (('get-offending-focusable) + (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + *target* ) - ((= v1-19 'pilot-on) - (let* ((s3-2 (-> arg3 param 0)) - (s2-2 arg0) - (s5-3 (if (type? s2-2 process-focusable) - s2-2 - ) + ) + (('pilot-on) + (let* ((s3-2 (-> arg3 param 0)) + (s2-2 arg0) + (s5-3 (if (type? s2-2 process-focusable) + s2-2 ) - ) - (when s5-3 - (format #t "vehicle::event-handler: pilot-on (pid ~d) from pid ~d~%" (-> obj pid) (-> arg0 pid)) - (logior! (-> obj flags) (rigid-body-object-flag riding)) - (put-rider-in-seat obj (the-as int s3-2) (the-as process-focusable s5-3)) - (if (logtest? (-> s5-3 mask) (process-mask target)) - (logior! (-> obj flags) (rigid-body-object-flag player-driving)) - ) - #t - ) - ) - ) - ((= v1-19 'player-get-off) - (if (and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) (!= (-> obj crash-level) 3)) - (go (method-of-object obj waiting)) + ) + ) + (when s5-3 + (format #t "vehicle::event-handler: pilot-on (pid ~d) from pid ~d~%" (-> obj pid) (-> arg0 pid)) + (logior! (-> obj flags) (rigid-body-object-flag riding)) + (put-rider-in-seat obj (the-as int s3-2) (the-as process-focusable s5-3)) + (if (logtest? (-> s5-3 mask) (process-mask target)) + (logior! (-> obj flags) (rigid-body-object-flag player-driving)) ) + #t ) - ((= v1-19 'rider-off) - (send-event (ppointer->process (-> obj child)) 'rider-off) - ) - ((= v1-19 'rider-on) - (send-event (ppointer->process (-> obj child)) 'rider-on) - ) - ((= v1-19 'nav-mesh-kill) - (vehicle-method-142 obj) + ) + ) + (('player-get-off) + (if (and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) (!= (-> obj crash-level) 3)) + (go (method-of-object obj waiting)) ) - (else - ((method-of-type rigid-body-object rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) - ) - ) + ) + (('rider-off) + (send-event (ppointer->process (-> obj child)) 'rider-off) + ) + (('rider-on) + (send-event (ppointer->process (-> obj child)) 'rider-on) + ) + (('nav-mesh-kill) + (vehicle-method-142 obj) + ) + (else + ((method-of-type rigid-body-object rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-obs_REF.gc index ea5d9a266bf..4f14d5df3b4 100644 --- a/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-obs_REF.gc @@ -101,17 +101,14 @@ :virtual #t :enter (behavior () (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :trans (behavior () (if (>= (vector4-dot (the-as vector (-> self outside-plane)) (math-camera-pos)) 0.0) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior vin-turbine) sleep-code) ) @@ -125,7 +122,6 @@ ) (go-virtual dormant) ) - (none) ) :code (behavior () (until #f @@ -139,7 +135,6 @@ ) ) #f - (none) ) :post (behavior () (when (and (or (not (-> self dont-draw-outside?)) @@ -213,7 +208,6 @@ ) ) (ja-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-states_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-states_REF.gc index ac36c16df00..420223bf68e 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-states_REF.gc @@ -19,7 +19,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -34,7 +33,6 @@ ) ) 0 - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -95,7 +93,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) ) @@ -119,7 +116,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) (logclear! (-> self bot-flags) (bot-flags bf21)) - (none) ) :trans (behavior () (bot-method-223 self #t) @@ -188,7 +184,6 @@ ) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -244,7 +239,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) ) @@ -268,7 +262,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) (logclear! (-> self bot-flags) (bot-flags bf21)) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -287,7 +280,6 @@ ) ) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'bot-turn-info))) @@ -335,7 +327,6 @@ ) ) (go-virtual standing-idle) - (none) ) :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) ) @@ -361,7 +352,6 @@ (stop-looking-at-target! self) (nav-enemy-method-165 self) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (if (focus-test? self grabbed) @@ -383,7 +373,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -391,7 +380,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -403,7 +391,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -425,7 +412,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -437,7 +423,6 @@ (go-virtual traveling) ) ) - (none) ) :code (-> (method-of-type ashelin waiting-idle) code) :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) @@ -457,7 +442,6 @@ ) 0 (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -471,7 +455,6 @@ (go-virtual traveling) ) ) - (none) ) :code (-> (method-of-type ashelin waiting-idle) code) ) @@ -493,11 +476,9 @@ (react-to-focus self) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :code (behavior () (bot-method-223 self #t) @@ -534,7 +515,6 @@ ) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) ) @@ -546,7 +526,6 @@ :enter (behavior () ((-> (method-of-type nav-enemy hostile) enter)) (nav-enemy-method-166 self) - (none) ) :trans (behavior () (bot-method-223 self #t) @@ -574,7 +553,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -582,7 +560,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((gp-0 (-> self nav state)) @@ -594,7 +571,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -617,14 +593,12 @@ (nav-enemy-method-167 self) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (if (logtest? (enemy-flag enemy-flag43) (-> 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)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -725,7 +699,6 @@ (ja :num! (seek!)) ) (react-to-focus self) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -737,7 +710,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -760,14 +732,12 @@ (nav-enemy-method-167 self) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (if (logtest? (enemy-flag enemy-flag43) (-> 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)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -861,7 +831,6 @@ (ja :num! (seek!)) ) (react-to-focus self) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -873,7 +842,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -896,14 +864,12 @@ (nav-enemy-method-167 self) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (if (logtest? (enemy-flag enemy-flag43) (-> 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)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -997,7 +963,6 @@ (ja :num! (seek!)) ) (react-to-focus self) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1009,7 +974,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -1025,7 +989,6 @@ (set! (-> self travel-anim-interp) 0.0) (set! (-> self last-fire-time) 0) 0 - (none) ) :code (behavior () (local-vars (v1-7 enemy-flag) (v1-15 enemy-flag)) @@ -1054,7 +1017,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -1076,7 +1038,6 @@ (logior! (-> self bot-flags) (bot-flags bf23)) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type bot knocked) trans))) @@ -1088,7 +1049,6 @@ (logclear! (-> self bot-flags) (bot-flags bf23)) (ashelin-method-244 self) ) - (none) ) ) @@ -1102,7 +1062,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () (let ((v1-1 (get-rand-int self 3))) @@ -1156,7 +1115,6 @@ (suspend) ) #f - (none) ) ) @@ -1165,6 +1123,5 @@ :virtual #t :enter (behavior () (go-virtual die-falling) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash_REF.gc index 0804820a89c..22c24ba9e42 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash_REF.gc @@ -748,17 +748,17 @@ (go (method-of-object obj standing-idle)) ) ) - (none) ) ;; definition for method 72 of type ashelin +;; WARN: Return type mismatch none vs object. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 10] (defmethod react-to-focus ashelin ((obj ashelin)) "@TODO - flesh out docs" (if (bot-method-214 obj) (go-hostile obj) (ashelin-method-239 obj) ) - (none) ) ;; definition for method 239 of type ashelin diff --git a/test/decompiler/reference/jak2/levels/common/ai/bot-states_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/bot-states_REF.gc index ffc05d528cb..a7250850960 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/bot-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/bot-states_REF.gc @@ -13,7 +13,6 @@ (stop-speech self (the-as uint 0) #t) (bot-method-191 self) (logclear! (-> self bot-flags) (bot-flags bf11)) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hit) exit))) @@ -22,7 +21,6 @@ ) ) (logior! (-> self bot-flags) (bot-flags bf11)) - (none) ) :code (behavior () (local-vars (v1-37 enemy-flag) (v1-45 enemy-flag)) @@ -69,7 +67,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -96,7 +93,6 @@ (t9-2) ) ) - (none) ) :exit (behavior () (let ((gp-0 (-> self incoming attack-id))) @@ -109,7 +105,6 @@ ) (logior! (-> self bot-flags) (bot-flags bf11)) (logclear! (-> self bot-flags) (bot-flags bf12)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy knocked) trans))) @@ -121,7 +116,6 @@ (logclear! (-> self bot-flags) (bot-flags bf12)) (play-attacked-speech self) ) - (none) ) ) @@ -140,7 +134,6 @@ (set! (-> self delay-too-far-check) -1) (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) (fail-mission! self) - (none) ) :exit (behavior () (logior! (-> self bot-flags) (bot-flags bf11)) @@ -150,11 +143,9 @@ (t9-0) ) ) - (none) ) :trans (behavior () (fail-falling self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -185,7 +176,6 @@ (suspend) ) #f - (none) ) ) @@ -207,18 +197,15 @@ ) ) ) - (none) ) :exit (behavior () (logior! (-> self bot-flags) (bot-flags bf11)) - (none) ) :trans (behavior () ((-> (method-of-type bot die-falling) trans)) (if (channel-active? self (the-as uint 0)) (set! (-> self state-time) (current-time)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -245,7 +232,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior bot) nav-enemy-die-falling-post) ) @@ -264,7 +250,6 @@ (logior! (-> self draw status) (draw-control-status no-draw)) (set! (-> self notice-enemy-dist) 0.0) (logclear! (-> self enemy-flags) (enemy-flag trackable-backup)) - (none) ) :exit (behavior () (local-vars (v0-0 enemy-flag)) @@ -281,7 +266,6 @@ ) ) (set! (-> self enemy-flags) v0-0) - (none) ) :code (the-as (function none :behavior bot) sleep-code) :post (the-as (function none :behavior bot) nav-enemy-simple-post) diff --git a/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc index 6681e59cf34..38a61e3e269 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc @@ -446,6 +446,7 @@ ) ;; definition for method 129 of type bot +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-129 bot ((obj bot)) (local-vars (s5-1 process)) (let ((s5-0 (-> obj focus))) @@ -730,232 +731,205 @@ ;; definition for method 74 of type bot ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 17] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 23] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 87] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 111] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 128] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 141] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 180] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 186] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 192] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 32] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 224] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 232] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 238] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 213] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 302] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 312] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 348] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 252] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 267] ;; WARN: disable def twice: 280. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 5] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 9] (defmethod general-event-handler bot ((obj bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (local-vars (v0-0 none)) - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'track) - #f - ) - ((= v1-0 'combo) - #f + (local-vars (v0-0 object)) + (case arg2 + (('track) + #f + ) + (('combo) + #f + ) + (('query) + (case (-> arg3 param 0) + (('waypoint) + (-> obj waypoint waypoint-id) + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) - ((= v1-0 'query) - (case (-> arg3 param 0) - (('waypoint) - (-> obj waypoint waypoint-id) - ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) + ) + ) + (('request) + (case (-> arg3 param 0) + (('waypoint) + (set! (-> obj waypoint-request) (the-as int (-> arg3 param 1))) + #t + ) + (('health-meter) + (cond + ((-> arg3 param 1) + (set! v0-0 (logior (-> obj bot-flags) (bot-flags bf06))) + (set! (-> obj bot-flags) (the-as bot-flags v0-0)) ) - ) - ((= v1-0 'request) - (case (-> arg3 param 0) - (('waypoint) - (set! (-> obj waypoint-request) (the-as int (-> arg3 param 1))) - #t + (else + (set! v0-0 (logclear (-> obj bot-flags) (bot-flags bf06))) + (set! (-> obj bot-flags) (the-as bot-flags v0-0)) ) - (('health-meter) - (cond - ((-> arg3 param 1) - (set! v0-0 (the-as none (logior (-> obj bot-flags) (bot-flags bf06)))) - (set! (-> obj bot-flags) (the-as bot-flags v0-0)) - ) - (else - (set! v0-0 (the-as none (logclear (-> obj bot-flags) (bot-flags bf06)))) - (set! (-> obj bot-flags) (the-as bot-flags v0-0)) - ) - ) - v0-0 - ) - (('too-far-fail) - (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail bf09))) - (logior! (-> obj bot-flags) (bot-flags bf09)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag check-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (go (method-of-object obj failed)) - ) - ) - (('move-to-vehicle) - (let ((a0-19 (-> arg3 param 2))) - (cond - ((>= (the-as int a0-19) 0) - (let ((v1-29 (the-as object (-> arg3 param 1)))) - (cond - ((focus-test? obj pilot) - (if (= (-> obj vehicle-seat-index) a0-19) - (= (the-as uint v1-29) (handle->process (-> obj vehicle-handle))) - ) + ) + v0-0 + ) + (('too-far-fail) + (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail bf09))) + (logior! (-> obj bot-flags) (bot-flags bf09)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + (logclear! (-> obj enemy-flags) (enemy-flag check-water)) + (logclear! (-> obj mask) (process-mask collectable)) + (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> obj enemy-flags) (enemy-flag notice)) + (go (method-of-object obj failed)) + ) + ) + (('move-to-vehicle) + (let ((a0-19 (-> arg3 param 2))) + (cond + ((>= (the-as int a0-19) 0) + (let ((v1-29 (the-as object (-> arg3 param 1)))) + (cond + ((focus-test? obj pilot) + (if (= (-> obj vehicle-seat-index) a0-19) + (= (the-as uint v1-29) (handle->process (-> obj vehicle-handle))) ) - (else - (set! (-> obj vehicle-seat-index) (the-as int a0-19)) - (set! (-> obj vehicle-handle) (process->handle (the-as uint v1-29))) - (logior! (-> obj bot-flags) (bot-flags bf15)) - #t - ) - ) + ) + (else + (set! (-> obj vehicle-seat-index) (the-as int a0-19)) + (set! (-> obj vehicle-handle) (process->handle (the-as uint v1-29))) + (logior! (-> obj bot-flags) (bot-flags bf15)) + #t ) ) - (else - (when (not (focus-test? obj pilot)) - (set! (-> obj vehicle-seat-index) -1) - (set! (-> obj vehicle-handle) (the-as handle #f)) - (logclear! (-> obj bot-flags) (bot-flags bf15)) - #t - ) - ) + ) + ) + (else + (when (not (focus-test? obj pilot)) + (set! (-> obj vehicle-seat-index) -1) + (set! (-> obj vehicle-handle) (the-as handle #f)) + (logclear! (-> obj bot-flags) (bot-flags bf15)) + #t ) ) ) - (('exit-vehicle) - (when (focus-test? obj pilot) - (let ((v1-43 (-> arg3 param 1)) - (s5-1 (-> arg3 param 2)) - ) - (cond - (v1-43 - (logior! (-> obj bot-flags) (bot-flags bf16)) - (when (and (>= (the-as int s5-1) 0) (!= s5-1 (-> obj nav-mesh-index))) - (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor (the-as int s5-1)) obj) - (set! (-> obj nav-mesh-index) (the-as int s5-1)) - ) - ) - (else - (logclear! (-> obj bot-flags) (bot-flags bf16)) - ) + ) + ) + (('exit-vehicle) + (when (focus-test? obj pilot) + (let ((v1-43 (-> arg3 param 1)) + (s5-1 (-> arg3 param 2)) + ) + (cond + (v1-43 + (logior! (-> obj bot-flags) (bot-flags bf16)) + (when (and (>= (the-as int s5-1) 0) (!= s5-1 (-> obj nav-mesh-index))) + (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor (the-as int s5-1)) obj) + (set! (-> obj nav-mesh-index) (the-as int s5-1)) ) ) - #t - ) - ) - (('slave-id) - (set! (-> obj slave-id) (the-as int (-> arg3 param 1))) - #t - ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) - ) - ((= v1-0 'notify) - (case (-> arg3 param 0) - (('attack) - (let ((s5-2 (-> arg3 param 1))) - (when (if (type? s5-2 process-focusable) - s5-2 - ) - (logior! (-> obj enemy-flags) (enemy-flag look-at-focus)) - (set! (-> obj hit-focus-time) (current-time)) + (else + (logclear! (-> obj bot-flags) (bot-flags bf16)) ) ) - #t - ) - (('mission-failed) - (logior! (-> obj bot-flags) (bot-flags bf09)) - (logclear! (-> obj bot-flags) (bot-flags bf06)) - #t ) - (('follow-dir) - (set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) - #t - ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) - ) - ((= v1-0 'set-task) - (let ((a1-11 (/ (the-as int (-> arg3 param 0)) 8))) - (logior! (-> obj bot-task-bits) (ash 1 a1-11)) - ) - #t - ) - ((= v1-0 'clear-task) - (let ((a1-13 (/ (the-as int (-> arg3 param 0)) 8))) - (logclear! (-> obj bot-task-bits) (ash 1 a1-13)) - ) - #t - ) - ((= v1-0 'skip) - (skip-waypoint obj) - ) - ((= v1-0 'change-mode) - (when (= (-> arg3 param 0) 'grab) - (set! v0-0 (the-as none (alive? obj))) - (if (and (the-as symbol v0-0) (-> arg3 param 1)) - (logior! (-> obj focus-status) (focus-status grabbed)) - ) - v0-0 - ) - ) - ((= v1-0 'end-mode) - (when (focus-test? obj grabbed) - (logclear! (-> obj focus-status) (focus-status grabbed)) - #t - ) + #t + ) + ) + (('slave-id) + (set! (-> obj slave-id) (the-as int (-> arg3 param 1))) + #t + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) - ((= v1-0 'hide) - (cond - ((-> arg3 param 0) - (go (method-of-object obj hidden)) + ) + ) + (('notify) + (case (-> arg3 param 0) + (('attack) + (let ((s5-2 (-> arg3 param 1))) + (when (if (type? s5-2 process-focusable) + s5-2 + ) + (logior! (-> obj enemy-flags) (enemy-flag look-at-focus)) + (set! (-> obj hit-focus-time) (current-time)) ) - (else - (if (and (-> obj next-state) (= (-> obj next-state name) 'hidden)) - (react-to-focus obj) - ) - ) - ) + ) + #t + ) + (('mission-failed) + (logior! (-> obj bot-flags) (bot-flags bf09)) + (logclear! (-> obj bot-flags) (bot-flags bf06)) + #t + ) + (('follow-dir) + (set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) + #t + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) - ((= v1-0 'draw) - (cond - ((-> arg3 param 0) - (set! v0-0 (the-as none (logclear (-> obj draw status) (draw-control-status no-draw)))) - (set! (-> obj draw status) (the-as draw-control-status v0-0)) - ) - (else - (set! v0-0 (the-as none (logior (-> obj draw status) (draw-control-status no-draw)))) - (set! (-> obj draw status) (the-as draw-control-status v0-0)) - ) + ) + ) + (('set-task) + (let ((a1-11 (/ (the-as int (-> arg3 param 0)) 8))) + (logior! (-> obj bot-task-bits) (ash 1 a1-11)) + ) + #t + ) + (('clear-task) + (let ((a1-13 (/ (the-as int (-> arg3 param 0)) 8))) + (logclear! (-> obj bot-task-bits) (ash 1 a1-13)) + ) + #t + ) + (('skip) + (skip-waypoint obj) + ) + (('change-mode) + (when (= (-> arg3 param 0) 'grab) + (set! v0-0 (alive? obj)) + (if (and (the-as symbol v0-0) (-> arg3 param 1)) + (logior! (-> obj focus-status) (focus-status grabbed)) ) - v0-0 + v0-0 + ) + ) + (('end-mode) + (when (focus-test? obj grabbed) + (logclear! (-> obj focus-status) (focus-status grabbed)) + #t + ) + ) + (('hide) + (cond + ((-> arg3 param 0) + (go (method-of-object obj hidden)) + ) + (else + (if (and (-> obj next-state) (= (-> obj next-state name) 'hidden)) + (react-to-focus obj) + ) ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) + ) + ) + (('draw) + (cond + ((-> arg3 param 0) + (set! v0-0 (logclear (-> obj draw status) (draw-control-status no-draw))) + (set! (-> obj draw status) (the-as draw-control-status v0-0)) ) + (else + (set! v0-0 (logior (-> obj draw status) (draw-control-status no-draw))) + (set! (-> obj draw status) (the-as draw-control-status v0-0)) + ) + ) + v0-0 + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/halt/hal_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/halt/hal_REF.gc index b8f5c7d0c1f..0724778a6ef 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/halt/hal_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/halt/hal_REF.gc @@ -397,116 +397,112 @@ ;; definition for method 74 of type hal ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. (defmethod general-event-handler hal ((obj hal) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (the-as - object - (case arg2 - (('notify) - (case (-> arg3 param 0) - (('hit-by) - (let* ((s4-0 arg0) - (v1-2 (if (type? s4-0 bot) - s4-0 - ) - ) - ) - (when v1-2 - (when (= (-> (the-as process (-> arg3 param 1)) type) target) - (logior! (-> obj bot-flags) (ash 1 (+ (-> (the-as bot v1-2) slave-id) 19))) - (the-as object (stop-speech obj (the-as uint 0) #t)) - ) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('hit-by) + (let* ((s4-0 arg0) + (v1-2 (if (type? s4-0 bot) + s4-0 + ) + ) + ) + (when v1-2 + (when (= (-> (the-as process (-> arg3 param 1)) type) target) + (logior! (-> obj bot-flags) (ash 1 (+ (-> (the-as bot v1-2) slave-id) 19))) + (stop-speech obj (the-as uint 0) #t) ) ) ) - (('mission-failed) - (let* ((s4-1 arg0) - (s5-1 (if (type? s4-1 bot) - s4-1 - ) - ) - ) - (when s5-1 - (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail))) - (when (not (logtest? (-> obj bot-flags) (bot-flags bf09))) - (logior! (-> obj bot-flags) (bot-flags bf09)) - (let ((a1-7 (new 'stack-no-clear 'fail-mission-params))) - (set! (-> a1-7 flags) (fail-mission-flags famflags-5)) - (set! (-> a1-7 message) (fail-mission-message fammsg-0)) - (set! (-> a1-7 retry-continue) #f) - (set! (-> a1-7 fail-continue) #f) - (set! (-> a1-7 reset-delay) (the-as uint 1500)) - (set! (-> a1-7 task) (game-task none)) - (set! (-> a1-7 fail-message) (text-id null)) - (if (start! *fail-mission-control* a1-7) - (set! (-> obj handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) - ) - ) - (set! (-> obj delay-too-far-check) -1) - (stop-speech obj (the-as uint 0) #f) - (countdown (s4-2 3) - (send-event (handle->process (-> obj slave-handle s4-2)) 'notify 'mission-failed) - ) + ) + (('mission-failed) + (let* ((s4-1 arg0) + (s5-1 (if (type? s4-1 bot) + s4-1 + ) + ) + ) + (when s5-1 + (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail))) + (when (not (logtest? (-> obj bot-flags) (bot-flags bf09))) + (logior! (-> obj bot-flags) (bot-flags bf09)) + (let ((a1-7 (new 'stack-no-clear 'fail-mission-params))) + (set! (-> a1-7 flags) (fail-mission-flags famflags-5)) + (set! (-> a1-7 message) (fail-mission-message fammsg-0)) + (set! (-> a1-7 retry-continue) #f) + (set! (-> a1-7 fail-continue) #f) + (set! (-> a1-7 reset-delay) (the-as uint 1500)) + (set! (-> a1-7 task) (game-task none)) + (set! (-> a1-7 fail-message) (text-id null)) + (if (start! *fail-mission-control* a1-7) + (set! (-> obj handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) + ) + ) + (set! (-> obj delay-too-far-check) -1) + (stop-speech obj (the-as uint 0) #f) + (countdown (s4-2 3) + (send-event (handle->process (-> obj slave-handle s4-2)) 'notify 'mission-failed) ) - (= (-> obj handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) ) + (= (-> obj handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) ) ) ) - (('follow-dir) - (set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) - #t - ) - ) - ) - (('set-task) - (let ((a1-10 (/ (the-as int (-> arg3 param 0)) 8))) - (logior! (-> obj bot-task-bits) (ash 1 a1-10)) - ) - #t + ) + (('follow-dir) + (set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) + #t + ) ) - (('clear-task) - (let ((a1-12 (/ (the-as int (-> arg3 param 0)) 8))) - (logclear! (-> obj bot-task-bits) (ash 1 a1-12)) - ) - #t + ) + (('set-task) + (let ((a1-10 (/ (the-as int (-> arg3 param 0)) 8))) + (logior! (-> obj bot-task-bits) (ash 1 a1-10)) ) - (('change-mode) - (when (= (-> arg3 param 0) 'grab) - (let ((v0-1 (the-as object (alive? obj)))) - (if (and (the-as symbol v0-1) (-> arg3 param 1)) - (logior! (-> obj focus-status) (focus-status grabbed)) - ) - v0-1 - ) - ) + #t + ) + (('clear-task) + (let ((a1-12 (/ (the-as int (-> arg3 param 0)) 8))) + (logclear! (-> obj bot-task-bits) (ash 1 a1-12)) ) - (('end-mode) - (when (focus-test? obj grabbed) - (logclear! (-> obj focus-status) (focus-status grabbed)) - #t + #t + ) + (('change-mode) + (when (= (-> arg3 param 0) 'grab) + (let ((v0-1 (the-as object (alive? obj)))) + (if (and (the-as symbol v0-1) (-> arg3 param 1)) + (logior! (-> obj focus-status) (focus-status grabbed)) + ) + v0-1 ) ) - (('skip) - (the-as object (skip-waypoint obj)) - ) - (('move-trans) - (move-to-point! (-> obj root) (the-as vector (-> arg3 param 0))) - #t - ) - (('die-fast) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) - ) - (('nav-mesh-kill) - (remove-process-drawable (-> obj nav state mesh) obj) - (set! (-> obj nav) #f) - (set! (-> obj nav-mesh-index) -1) + ) + (('end-mode) + (when (focus-test? obj grabbed) + (logclear! (-> obj focus-status) (focus-status grabbed)) #t ) - ) + ) + (('skip) + (skip-waypoint obj) + ) + (('move-trans) + (move-to-point! (-> obj root) (the-as vector (-> arg3 param 0))) + #t + ) + (('die-fast) + (cleanup-for-death obj) + (go (method-of-object obj die-fast)) + ) + (('nav-mesh-kill) + (remove-process-drawable (-> obj nav state mesh) obj) + (set! (-> obj nav) #f) + (set! (-> obj nav-mesh-index) -1) + #t + ) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-states_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-states_REF.gc index 7851344c6f3..e835fab2a9a 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-states_REF.gc @@ -19,7 +19,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -42,7 +41,6 @@ (if (logtest? (bot-flags bf19) (-> self bot-flags)) (ruffian-method-240 self) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) @@ -66,7 +64,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -80,13 +77,11 @@ ) ) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 49152.0 (seconds 0.05)) (nav-enemy-simple-post) - (none) ) ) @@ -108,7 +103,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -128,7 +122,6 @@ (if (not (logtest? (bot-flags bf19) (-> self bot-flags))) (ruffian-method-240 self) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) @@ -152,7 +145,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -166,13 +158,11 @@ ) ) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 49152.0 (seconds 0.05)) (nav-enemy-simple-post) - (none) ) ) @@ -199,7 +189,6 @@ (if (and (-> self focus-info fproc) (>= (fabs (-> self focus-info ry-diff)) 9102.223)) (ruffian-method-241 self) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) @@ -223,17 +212,14 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #t) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 49152.0 (seconds 0.05)) (nav-enemy-simple-post) - (none) ) ) @@ -258,7 +244,6 @@ (stop-looking-at-target! self) (nav-enemy-method-166 self) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -277,7 +262,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -285,7 +269,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -297,7 +280,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -319,7 +301,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -331,7 +312,6 @@ (go-virtual traveling) ) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) @@ -351,7 +331,6 @@ ) 0 (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -363,7 +342,6 @@ (go-virtual traveling) ) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) ) @@ -389,7 +367,6 @@ (set! (-> self attack-id) a0-6) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -397,17 +374,14 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (bot-method-223 self #f) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 131072.0 (seconds 0.05)) (nav-enemy-simple-post) - (none) ) ) @@ -428,11 +402,9 @@ (react-to-focus self) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) @@ -450,7 +422,6 @@ 0 (nav-enemy-method-167 self) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) @@ -468,7 +439,6 @@ (set! (-> self travel-anim-interp) 0.0) (set! (-> self next-fire-time) 0) 0 - (none) ) :code (the-as (function none :behavior ruffian) nothing) ) @@ -490,7 +460,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type bot knocked) trans))) @@ -502,7 +471,6 @@ (logclear! (-> self bot-flags) (bot-flags bf24)) (ruffian-method-242 self) ) - (none) ) ) @@ -516,7 +484,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) ) @@ -530,7 +497,6 @@ ) ) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (the-as (function none :behavior ruffian) nothing) ) @@ -553,7 +519,6 @@ 0 (stop-looking-at-target! self) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -568,7 +533,6 @@ (react-to-focus self) ) ) - (none) ) :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-states_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-states_REF.gc index 1fa8e7e6805..bcdc5c54c8b 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-states_REF.gc @@ -22,7 +22,6 @@ (set! (-> self travel-anim-interp) 0.0) (logclear! (-> self enemy-flags) (enemy-flag enable-on-active)) (logior! (-> self focus-status) (focus-status disable)) - (none) ) :exit (behavior () (local-vars (v1-1 enemy-flag)) @@ -34,7 +33,6 @@ ) (set! (-> self enemy-flags) v1-1) (logclear! (-> self focus-status) (focus-status disable)) - (none) ) :trans (behavior () (if (and (not (focus-test? self grabbed)) @@ -42,7 +40,6 @@ ) (go-virtual traveling) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -57,7 +54,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -81,7 +77,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -114,7 +109,6 @@ ) (go-virtual waiting-close) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -161,7 +155,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -185,7 +178,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -219,7 +211,6 @@ ) (go-virtual waiting-far) ) - (none) ) :code (behavior () (let* ((v1-2 (ja-group)) @@ -293,7 +284,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -317,7 +307,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -337,7 +326,6 @@ ) ) ) - (none) ) :code (behavior () (local-vars (s4-1 art-element) (f0-19 float)) @@ -485,7 +473,6 @@ ) ) (go-virtual waiting-close) - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -511,12 +498,10 @@ (set! (-> self travel-anim-interp) 0.0) (logclear! (-> self plasma flags) (plasma-flags pf02 pf03 pf04)) (logclear! (-> self bot-flags) (bot-flags bf11)) - (none) ) :exit (behavior () (logclear! (-> self plasma flags) (plasma-flags pf01 pf02 pf03)) (logior! (-> self bot-flags) (bot-flags bf11)) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -537,7 +522,6 @@ (logior! (-> self plasma flags) (plasma-flags pf02)) (logclear! (-> self plasma flags) (plasma-flags pf02)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.15)) @@ -593,12 +577,10 @@ ) ) #f - (none) ) :post (behavior () (logclear! (-> self plasma flags) (plasma-flags pf03)) (nav-enemy-simple-post) - (none) ) ) @@ -617,11 +599,9 @@ (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) (logclear! (-> self bot-flags) (bot-flags bf11)) - (none) ) :exit (behavior () (logior! (-> self bot-flags) (bot-flags bf11)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -639,7 +619,6 @@ (ja-eval) ) (go-virtual repair-gun) - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -667,11 +646,9 @@ (reset-attacker! self) ) (logclear! (-> self bot-flags) (bot-flags bf11)) - (none) ) :exit (behavior () (logior! (-> self bot-flags) (bot-flags bf11)) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -684,7 +661,6 @@ (set! (-> self played-unjam-time) (current-time)) (sound-play "sig-gun-unjam") ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -823,7 +799,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -851,11 +826,9 @@ (reset-attacker! self) ) (logclear! (-> self bot-flags) (bot-flags bf11)) - (none) ) :exit (behavior () (logior! (-> self bot-flags) (bot-flags bf11)) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -869,7 +842,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.15)) @@ -932,7 +904,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -959,7 +930,6 @@ (nav-enemy-method-166 self) (set! (-> self skel top-anim interp) 1.0) (set! (-> self player-blocking) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -984,7 +954,6 @@ ) ) 0 - (none) ) :code (behavior () (until #f @@ -992,7 +961,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1004,7 +972,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -1027,7 +994,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -1045,7 +1011,6 @@ (go-virtual traveling) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.3)) @@ -1060,7 +1025,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -1080,7 +1044,6 @@ 0 (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (bot-method-223 self #f) @@ -1107,7 +1070,6 @@ ) ) ) - (none) ) :code (behavior () (let* ((v1-2 (ja-group)) @@ -1181,7 +1143,6 @@ ) ) #f - (none) ) ) @@ -1207,7 +1168,6 @@ ) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1216,11 +1176,9 @@ (logclear! (-> self focus-status) (focus-status dangerous)) ) (enemy-method-46 self 0) - (none) ) :trans (behavior () (bot-method-223 self #f) - (none) ) :code (behavior () (local-vars (a1-2 art-element)) @@ -1262,12 +1220,10 @@ (reset-attacker! self) ) (react-to-focus self) - (none) ) :post (behavior () (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 131072.0 (seconds 0.05)) (nav-enemy-simple-post) - (none) ) ) @@ -1289,11 +1245,9 @@ ) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :code (behavior () (local-vars (gp-0 art-element)) @@ -1344,7 +1298,6 @@ (reset-attacker! self) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -1356,7 +1309,6 @@ :enter (behavior () ((-> (method-of-type nav-enemy hostile) enter)) (set! (-> self skel top-anim interp) 1.0) - (none) ) :trans (behavior () (bot-method-223 self #t) @@ -1382,7 +1334,6 @@ (go-virtual chase-attack) ) ) - (none) ) :code (behavior () (until #f @@ -1390,7 +1341,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((gp-0 (-> self nav state)) @@ -1402,7 +1352,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -1417,11 +1366,9 @@ (go-virtual traveling) ) (logior! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :code (behavior () (push-anim-to-targ @@ -1472,7 +1419,6 @@ (reset-attacker! self) ) (go-virtual chase) - (none) ) :post (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -1488,7 +1434,6 @@ ) ) (nav-enemy-travel-post) - (none) ) ) @@ -1503,7 +1448,6 @@ ) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :code (behavior () (local-vars (v1-31 enemy-flag) (v1-39 enemy-flag)) @@ -1541,7 +1485,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -1560,7 +1503,6 @@ (if (logtest? (bot-flags bf19 bf20) (-> self bot-flags)) (logclear! (-> self bot-flags) (bot-flags bf12)) ) - (none) ) ) @@ -1577,7 +1519,6 @@ (set! (-> self travel-anim-interp) 0.0) (set! (-> self skel top-anim interp) 0.0) (play-death-sound self "sigt093") - (none) ) ) @@ -1593,7 +1534,6 @@ (sig-plasma-method-11 (-> self plasma) #f) (set! (-> self travel-anim-interp) 0.0) (set! (-> self skel top-anim interp) 0.0) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1633,7 +1573,6 @@ ) ) #f - (none) ) ) @@ -1656,7 +1595,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) @@ -1676,7 +1614,6 @@ (if (sig-method-257 self) (go-virtual sig-path-idle) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -1695,7 +1632,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -1720,7 +1656,6 @@ (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) (logior! (-> self bot-flags) (bot-flags bf24)) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) @@ -1745,7 +1680,6 @@ (quaternion-copy! (-> v1-27 quat) (-> gp-0 quat)) ) ) - (none) ) :code (behavior () (let ((f30-0 0.0)) @@ -1768,7 +1702,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -1792,7 +1725,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) @@ -1814,7 +1746,6 @@ (quaternion-copy! (-> v1-18 quat) (-> gp-0 quat)) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.15)) @@ -1838,7 +1769,6 @@ ) ) (go-virtual sig-path-run) - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -1864,7 +1794,6 @@ (set! (-> self travel-anim-interp) 0.0) (logior! (-> self bot-flags) (bot-flags bf24)) (logclear! (-> self bot-flags) (bot-flags bf25)) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) @@ -1889,7 +1818,6 @@ (quaternion-copy! (-> v1-29 quat) (-> gp-0 quat)) ) ) - (none) ) :code (behavior () (let ((f30-0 0.0)) @@ -1917,7 +1845,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -1941,7 +1868,6 @@ (look-at-target! self (enemy-flag lock-focus)) (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) @@ -1963,7 +1889,6 @@ (quaternion-copy! (-> v1-18 quat) (-> gp-0 quat)) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.15)) @@ -1987,7 +1912,6 @@ ) ) (go-virtual sig-path-run) - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) @@ -2012,7 +1936,6 @@ (set! (-> self skel top-anim interp) 0.0) (set! (-> self travel-anim-interp) 0.0) (vector-reset! (-> self root transv)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.15)) @@ -2035,7 +1958,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior sig) nav-enemy-simple-post) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc index b6b3c3e985d..71dce694a34 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc @@ -381,25 +381,20 @@ (defmethod general-event-handler sig ((obj sig) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'untrigger) - (sig-plasma-method-11 (-> obj plasma) #t) - ) - ((= v1-0 'sig-path) - (when (and (not (focus-test? obj dead)) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) - (let ((a1-2 (-> arg3 param 0))) - (sig-method-249 obj (the-as sig-path a1-2)) - ) - (go (method-of-object obj sig-path-run)) - ) + (case arg2 + (('untrigger) + (sig-plasma-method-11 (-> obj plasma) #t) + ) + (('sig-path) + (when (and (not (focus-test? obj dead)) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) + (let ((a1-2 (-> arg3 param 0))) + (sig-method-249 obj (the-as sig-path a1-2)) ) - (else - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) + (go (method-of-object obj sig-path-run)) + ) + ) + (else + ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) ) ) ) @@ -757,7 +752,6 @@ (go (method-of-object obj chase)) ) ) - (none) ) ;; definition for method 72 of type sig @@ -789,7 +783,6 @@ (go (method-of-object obj waiting-close)) ) ) - (none) ) ;; definition for method 116 of type sig diff --git a/test/decompiler/reference/jak2/levels/common/airlock_REF.gc b/test/decompiler/reference/jak2/levels/common/airlock_REF.gc index 8112a01640b..ee9c7dfa2f3 100644 --- a/test/decompiler/reference/jak2/levels/common/airlock_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/airlock_REF.gc @@ -407,66 +407,62 @@ ;; failed to figure out what this is: (defstate close (com-airlock) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('close) - (set! (-> self latch-closed-time) (+ (current-time) (if (>= arg1 1) - (the-as int (-> event param 0)) - 3000 - ) - ) - ) - (if (and (>= arg1 2) (and (= (-> event param 1) #t) (not (want-cross-airlock? self)))) - (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) :num! min) - ) - (and (-> self next-state) (= (-> self next-state name) 'open)) - ) - (('open) - (set! (-> self latch-open-time) (+ (current-time) (if (>= arg1 1) - (the-as int (-> event param 0)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('close) + (set! (-> self latch-closed-time) (+ (current-time) (if (>= argc 1) + (the-as int (-> block param 0)) 3000 ) ) - ) - (if (and (>= arg1 2) (and (= (-> event param 1) #t) (want-cross-airlock? self) (destination-loaded? self #f))) - (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) - :num! (identity - (the float (+ (-> (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) frames num-frames) -1)) - ) - ) ) - (and (-> self next-state) (= (-> self next-state name) 'close)) - ) - (('front) - (let ((f30-0 (check-crossing-distance self (target-pos 0) #f)) - (f0-3 (check-crossing-distance self (camera-pos) #f)) - ) - (and (< 2048.0 f30-0) (>= (* f30-0 f0-3) 0.0)) + (if (and (>= argc 2) (and (= (-> block param 1) #t) (not (want-cross-airlock? self)))) + (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) :num! min) ) - ) - (('back) - (let ((f30-1 (check-crossing-distance self (target-pos 0) #f)) - (f0-5 (check-crossing-distance self (camera-pos) #f)) + (and (-> self next-state) (= (-> self next-state name) 'open)) + ) + (('open) + (set! (-> self latch-open-time) (+ (current-time) (if (>= argc 1) + (the-as int (-> block param 0)) + 3000 + ) + ) + ) + (if (and (>= argc 2) (and (= (-> block param 1) #t) (want-cross-airlock? self) (destination-loaded? self #f))) + (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) + :num! (identity + (the float (+ (-> (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) frames num-frames) -1)) + ) ) - (and (< f30-1 -2048.0) (>= (* f30-1 f0-5) 0.0)) ) - ) - (('sound) - (if (>= (check-crossing-distance self (target-pos 0) #f) 0.0) - (the-as object (play-city-voice-sound self (the-as symbol (-> event param 0)))) + (and (-> self next-state) (= (-> self next-state name) 'close)) + ) + (('front) + (let ((f30-0 (check-crossing-distance self (target-pos 0) #f)) + (f0-3 (check-crossing-distance self (camera-pos) #f)) ) + (and (< 2048.0 f30-0) (>= (* f30-0 f0-3) 0.0)) ) - (('distance) - (* (the int (check-crossing-distance self (target-pos 0) #f)) 8) + ) + (('back) + (let ((f30-1 (check-crossing-distance self (target-pos 0) #f)) + (f0-5 (check-crossing-distance self (camera-pos) #f)) + ) + (and (< f30-1 -2048.0) (>= (* f30-1 f0-5) 0.0)) ) - ) + ) + (('sound) + (if (>= (check-crossing-distance self (target-pos 0) #f) 0.0) + (play-city-voice-sound self (the-as symbol (-> block param 0))) + ) + ) + (('distance) + (* (the int (check-crossing-distance self (target-pos 0) #f)) 8) + ) ) ) :enter (behavior ((arg0 symbol)) (set! (-> self visible-move?) #f) - (none) ) :exit (behavior () (when (nonzero? (-> self sound-id)) @@ -495,7 +491,6 @@ (set! (-> self gear-sound-id) (new 'static 'sound-id)) 0 ) - (none) ) :trans (behavior () (if (logtest? (-> self draw status) (draw-control-status on-screen)) @@ -525,7 +520,6 @@ ) (go-virtual open #f) ) - (none) ) :code (behavior ((arg0 symbol)) (process-entity-status! self (entity-perm-status subtask-complete) #f) @@ -661,7 +655,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) @@ -671,7 +664,6 @@ :event (-> (method-of-type com-airlock close) event) :enter (behavior ((arg0 symbol)) (set! (-> self visible-move?) #f) - (none) ) :exit (-> (method-of-type com-airlock close) exit) :trans (behavior () @@ -691,7 +683,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 symbol)) (when (not arg0) @@ -834,7 +825,6 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/battle_REF.gc b/test/decompiler/reference/jak2/levels/common/battle_REF.gc index 48364ec4ecb..2a20b192924 100644 --- a/test/decompiler/reference/jak2/levels/common/battle_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/battle_REF.gc @@ -1502,7 +1502,6 @@ (spawn-initial-creatures self) ) (unset-battle-music self) - (none) ) :trans (behavior () (let ((v1-1 (-> self info notice-spec))) @@ -1527,7 +1526,6 @@ (if *display-battle-marks* (draw-battle-marks self) ) - (none) ) :code (the-as (function none :behavior battle) sleep-code) ) @@ -1551,17 +1549,14 @@ (go-virtual hostile) ) (logior! (-> self flags) (battle-flags noticed)) - (none) ) :trans (behavior () (if *display-battle-marks* (draw-battle-marks self) ) - (none) ) :code (behavior () (go-virtual hostile) - (none) ) ) @@ -1678,7 +1673,6 @@ (script-eval (the-as pair gp-0) :vector (-> self root trans)) ) ) - (none) ) :trans (behavior () (if (beaten? self) @@ -1687,7 +1681,6 @@ (if *display-battle-marks* (draw-battle-marks self) ) - (none) ) :code (the-as (function none :behavior battle) sleep-code) ) @@ -1704,7 +1697,6 @@ ) ) (unset-battle-music self) - (none) ) :code (the-as (function none :behavior battle) sleep-code) ) diff --git a/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc b/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc index fbb202dc1ee..33ce7c8b8b0 100644 --- a/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc @@ -243,8 +243,8 @@ ;; failed to figure out what this is: (defstate idle (elec-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual active) ) @@ -303,7 +303,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior elec-gate) sleep-code) :post (behavior () @@ -311,15 +310,14 @@ (if (nonzero? (-> self part-off)) (spawn-particles self (-> self part-off)) ) - (none) ) ) ;; failed to figure out what this is: (defstate active (elec-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('shutdown) (go-virtual shutdown) ) @@ -409,7 +407,6 @@ (blocking-plane-spawn (the-as curve-control #f) vec-pair f0-6) ) ) - (none) ) :trans (behavior () (local-vars @@ -678,7 +675,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior elec-gate) sleep-code) :post (behavior () @@ -688,7 +684,6 @@ ) (update! (-> self sound)) (elec-gate-post) - (none) ) ) @@ -703,7 +698,6 @@ (if (-> self on-stop) (script-eval (-> self on-stop) :vector (-> self root trans)) ) - (none) ) :trans (behavior () (let ((go-idle? #t)) @@ -775,7 +769,6 @@ (go-virtual idle) ) ) - (none) ) :code (the-as (function none :behavior elec-gate) sleep-code) :post (behavior () @@ -784,7 +777,6 @@ (spawn-particles self (-> self part-off)) ) (elec-gate-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc index 358fb1e275b..c7279258014 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc @@ -507,6 +507,7 @@ ) ;; definition for method 52 of type amphibian +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-52 amphibian ((obj amphibian) (arg0 vector)) (cond ((and (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time)) (!= (-> obj incoming knocked-type) 6)) @@ -947,11 +948,9 @@ ) ) ) - (none) ) ;; definition for method 70 of type amphibian -;; WARN: Return type mismatch object vs none. (defmethod go-hostile amphibian ((obj amphibian)) (let* ((s4-0 (handle->process (-> obj attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) @@ -968,7 +967,6 @@ ) ) (go (method-of-object obj hostile)) - (none) ) ;; definition for method 55 of type amphibian @@ -1196,7 +1194,6 @@ ) ) #f - (none) ) ) @@ -1225,7 +1222,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1254,7 +1250,6 @@ ) 0 (react-to-focus self) - (none) ) ) @@ -1268,7 +1263,6 @@ (suspend) ) #f - (none) ) ) @@ -1281,7 +1275,6 @@ (suspend) ) #f - (none) ) ) @@ -1294,7 +1287,6 @@ (suspend) ) #f - (none) ) ) @@ -1338,7 +1330,6 @@ ) ) ) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy stare) exit))) @@ -1347,14 +1338,12 @@ ) ) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "amphib-hit") ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.07)) @@ -1408,7 +1397,6 @@ (ja-eval) ) (go-virtual stare-idle) - (none) ) ) @@ -1422,7 +1410,6 @@ (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (-> (method-of-type nav-enemy stare) exit) :trans (-> (method-of-type nav-enemy stare) trans) @@ -1441,7 +1428,6 @@ ) ) (go-virtual stare) - (none) ) :post (the-as (function none :behavior amphibian) nav-enemy-stare-post) ) @@ -1482,7 +1468,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -1490,7 +1475,6 @@ (suspend) ) #f - (none) ) ) @@ -1523,7 +1507,6 @@ ) (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) ) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1531,14 +1514,12 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "amphib-hit") ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.07)) @@ -1551,7 +1532,6 @@ (ja :num! (seek!)) ) (go-virtual attack-forward-lunge) - (none) ) :post (the-as (function none :behavior amphibian) nav-enemy-simple-post) ) @@ -1583,7 +1563,6 @@ ) 0 (logior! (-> self focus-status) (focus-status dangerous)) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1591,14 +1570,12 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "amphib-hit") ) - (none) ) :code (behavior () (until (>= (ja-aframe-num 0) (ja-aframe 8.0 0)) @@ -1606,7 +1583,6 @@ (ja :num! (seek!)) ) (go-virtual attack-forward-end) - (none) ) :post (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -1623,7 +1599,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -1640,7 +1615,6 @@ ) 0 (nav-enemy-method-167 self) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1648,14 +1622,12 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "amphib-hit") ) - (none) ) :code (behavior () (ja-no-eval :num! (seek!)) @@ -1664,7 +1636,6 @@ (ja-eval) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior amphibian) nav-enemy-simple-post) ) @@ -1702,7 +1673,6 @@ ) (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) ) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1710,14 +1680,12 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "amphib-hit") ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.07)) @@ -1776,7 +1744,6 @@ (ja-eval) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior amphibian) nav-enemy-simple-post) ) @@ -1803,12 +1770,10 @@ (set! (-> self tongue-mod max-length) (-> gp-1 max-length)) (set! (-> self tongue-mod target quad) (-> gp-1 clamped-pos quad)) ) - (none) ) :exit (behavior () (set! (-> self draw bounds w) 22528.0) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (let ((v1-0 (-> self tongue-mode))) @@ -1858,7 +1823,6 @@ (set! (-> self draw bounds w) 22528.0) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.7)) @@ -1871,7 +1835,6 @@ (ja :num! (seek!)) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior amphibian) nav-enemy-simple-post) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc index c7575c4782a..c8554b11c60 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc @@ -45,93 +45,89 @@ ;; failed to figure out what this is: (defstate idle (bouncer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('bonk) - (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) - (the-as collide-shape (-> self root)) - (the-as uint 1) - ) - (when (send-event proc 'jump (-> self spring-height) (-> self spring-height) (-> self mods)) - (sound-play "trampoline") - (go-virtual fire) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape (-> self root)) + (the-as uint 1) + ) + (when (send-event proc 'jump (-> self spring-height) (-> self spring-height) (-> self mods)) + (sound-play "trampoline") + (go-virtual fire) ) ) - (('touch) - (let ((gp-2 (-> event param 0))) - (cond - (((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry gp-2) - (the-as collide-shape (-> self root)) - (collide-action solid) - (collide-action) - ) - (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry gp-2) - (the-as collide-shape (-> self root)) - (the-as uint 1) - ) - (if (not (and (-> self next-state) (let ((v1-21 (-> self next-state name))) - (or (= v1-21 'smush) (= v1-21 'fire)) - ) - ) - ) - (go-virtual smush) - ) - ) - ) - (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry gp-2) - (the-as collide-shape (-> self root)) - (the-as uint 4) - ) - (the-as object (persist-with-delay - *setting-control* - (the-as symbol (process->ppointer self)) - (seconds 0.05) - 'double-jump - #f - 0.0 - 0 - ) - ) + ) + (('touch) + (let ((gp-2 (-> block param 0))) + (cond + (((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry gp-2) + (the-as collide-shape (-> self root)) + (collide-action solid) + (collide-action) + ) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry gp-2) + (the-as collide-shape (-> self root)) + (the-as uint 1) + ) + (if (not (and (-> self next-state) (let ((v1-21 (-> self next-state name))) + (or (= v1-21 'smush) (= v1-21 'fire)) + ) + ) + ) + (go-virtual smush) + ) ) + ) + (((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry gp-2) + (the-as collide-shape (-> self root)) + (the-as uint 4) ) + (persist-with-delay + *setting-control* + (the-as symbol (process->ppointer self)) + (seconds 0.05) + 'double-jump + #f + 0.0 + 0 + ) + ) ) ) - (('attack) - (let ((v1-28 (the-as object (-> event param 1))) - (a0-17 (-> event param 0)) - (a2-7 0) - ) - (cond - ((= (-> (the-as attack-info v1-28) mode) 'flop) - (set! a2-7 1) - ) - ((= (-> (the-as attack-info v1-28) mode) 'board) - (set! a2-7 9) - ) - ) - (when (and (nonzero? a2-7) - (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry a0-17) - (the-as collide-shape (-> self root)) - (the-as uint a2-7) - ) - (send-event proc 'jump (-> self spring-height) (-> self spring-height) (-> self mods)) - ) - ) - (sound-play "trampoline") - (go-virtual fire) - #f + ) + (('attack) + (let ((v1-28 (the-as object (-> block param 1))) + (a0-17 (-> block param 0)) + (a2-7 0) ) + (cond + ((= (-> (the-as attack-info v1-28) mode) 'flop) + (set! a2-7 1) + ) + ((= (-> (the-as attack-info v1-28) mode) 'board) + (set! a2-7 9) + ) + ) + (when (and (nonzero? a2-7) + (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry a0-17) + (the-as collide-shape (-> self root)) + (the-as uint a2-7) + ) + (send-event proc 'jump (-> self spring-height) (-> self spring-height) (-> self mods)) + ) + ) + (sound-play "trampoline") + (go-virtual fire) + #f ) ) - ) + ) ) ) :code (behavior () @@ -142,21 +138,20 @@ (suspend) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate smush (bouncer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (set! (-> self state-time) (current-time)) #f ) (else - ((-> (method-of-object self idle) event) proc arg1 event-type event) + ((-> (method-of-object self idle) event) proc argc message block) ) ) ) @@ -184,7 +179,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior bouncer) transform-post) ) @@ -205,7 +199,6 @@ (ja :num! (seek!)) ) (go-virtual idle) - (none) ) :post (the-as (function none :behavior bouncer) transform-post) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc index c44a8c392f9..56ca1cc3bed 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc @@ -685,7 +685,6 @@ (centurion-shield-little) (set! (-> self victory-sound) (new 'static 'sound-id)) 0 - (none) ) :exit (behavior () (if (nonzero? (-> self victory-sound)) @@ -699,7 +698,6 @@ (set! (-> self root root-prim specific 0) (-> self root root-prim specific 1)) (set! (-> self can-take-damage?) #f) (centurion-shield-big) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -726,17 +724,14 @@ (react-to-focus self) (set! (-> self victory-sound) (new 'static 'sound-id)) 0 - (none) ) ) ;; definition for method 67 of type centurion -;; WARN: Return type mismatch object vs none. (defmethod go-stare centurion ((obj centurion)) (if (not (and (-> obj next-state) (= (-> obj next-state name) 'hostile))) (go (method-of-object obj hostile)) ) - (none) ) ;; failed to figure out what this is: @@ -748,7 +743,6 @@ (t9-0) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -765,7 +759,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior centurion) nav-enemy-simple-post) ) @@ -870,7 +863,6 @@ (set! (-> v1-8 attack-id) v0-1) (set! (-> self attack-id) v0-1) ) - (none) ) :exit (behavior () (set! (-> self first-shoot?) #f) @@ -881,7 +873,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (let ((f30-0 1.0)) @@ -964,7 +955,6 @@ ) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior centurion) enemy-simple-post) ) @@ -985,7 +975,6 @@ (set! (-> v1-7 attack-id) v0-0) (set! (-> self attack-id) v0-0) ) - (none) ) :exit (behavior () (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3 prim-core action) @@ -996,7 +985,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1009,7 +997,6 @@ (ja :num! (seek!)) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior centurion) enemy-simple-post) ) @@ -1240,7 +1227,6 @@ (nav-enemy-method-165 self) (set! (-> self joint-enable) #t) (set! (-> self can-shoot?) (the-as basic #t)) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) @@ -1248,7 +1234,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (rlet ((acc :class vf) @@ -1306,7 +1291,6 @@ ) ) ) - (none) ) ) :code (behavior () @@ -1412,7 +1396,6 @@ #f ) #f - (none) ) :post (the-as (function none :behavior centurion) nav-enemy-travel-post) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc index 394917c91fe..4ddc986e544 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc @@ -648,7 +648,6 @@ ) ;; definition for method 68 of type flitter -;; WARN: Return type mismatch object vs none. (defmethod go-stare2 flitter ((obj flitter)) (if (and (= (-> obj focus aware) (enemy-aware enemy-aware-2)) (not (nav-enemy-method-163 obj)) @@ -657,7 +656,6 @@ (go (method-of-object obj pacing)) (go (method-of-object obj stare)) ) - (none) ) ;; failed to figure out what this is: @@ -679,7 +677,6 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (behavior () (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) @@ -746,7 +743,6 @@ ) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) - (none) ) ) @@ -773,7 +769,6 @@ (vector-reset! (-> gp-0 transv)) (set! (-> gp-0 transv y) (* 4096.0 (get-rand-float-range self 34.0 38.0))) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -867,7 +862,6 @@ #f (label cfg-33) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior flitter) nav-enemy-falling-post) ) @@ -1002,7 +996,6 @@ ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -1055,7 +1048,6 @@ ) ) #f - (none) ) :post (behavior () (flitter-method-181 self) @@ -1064,7 +1056,6 @@ ((the-as (function none) t9-1)) ) ) - (none) ) ) @@ -1078,7 +1069,6 @@ ) ) (set! (-> self off-screen-timer) (the-as uint (current-time))) - (none) ) :trans (behavior () (let ((gp-0 (handle->process (-> self focus handle)))) @@ -1124,7 +1114,6 @@ ) ) ) - (none) ) :code (behavior () (nav-enemy-method-166 self) @@ -1147,7 +1136,6 @@ ) ) #f - (none) ) ) @@ -1163,7 +1151,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -1172,7 +1159,6 @@ ) ) (flitter-method-180 self) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1184,7 +1170,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -1198,7 +1183,6 @@ (t9-2) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1209,7 +1193,6 @@ ) (send-event self 'death-end) (cleanup-for-death self) - (none) ) ) @@ -1241,17 +1224,15 @@ (set! (-> v1-8 attack-id) v0-2) (set! (-> self attack-id) v0-2) ) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () - (local-vars (s5-2 none)) + (local-vars (s5-2 object)) (let* ((s5-0 (handle->process (-> self focus handle))) (gp-0 (if (type? s5-0 process-focusable) (the-as process-focusable s5-0) @@ -1272,7 +1253,7 @@ (set! (-> s5-1 target-post quad) (-> v1-10 quad)) ) 0 - (set! s5-2 (the-as none (-> self attack-pos))) + (set! s5-2 (-> self attack-pos)) (set! (-> (the-as vector s5-2) quad) (-> (get-trans gp-0 3) quad)) s5-2 ) @@ -1282,7 +1263,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 2 (seconds 0.1)) @@ -1332,7 +1312,6 @@ ) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior flitter) nav-enemy-travel-post) ) @@ -1343,7 +1322,6 @@ :post (behavior () (flitter-method-181 self) (nav-enemy-simple-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc index c5d456da9cb..f1bba3c4c86 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc @@ -378,6 +378,7 @@ ) ;; definition for method 55 of type fodder +;; WARN: Return type mismatch object vs none. (defmethod track-target! fodder ((obj fodder)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn @@ -437,7 +438,6 @@ ) ) (update-transforms (-> self root)) - (none) ) ) @@ -451,7 +451,6 @@ ) ) (logclear! (-> self enemy-flags) (enemy-flag spawn-gem chase-startup use-notice-distance)) - (none) ) :code (behavior () (let ((f30-0 (get-rand-float-range self 0.9 1.1))) @@ -534,7 +533,6 @@ ) ) #f - (none) ) ) @@ -632,7 +630,6 @@ ) ) ) - (none) ) ) @@ -677,7 +674,6 @@ (set! (-> self slow-timer) 0) (set! (-> self fast-timer) 0) 0 - (none) ) :exit (behavior () (let ((v1-0 (-> self nav))) @@ -693,7 +689,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -856,7 +851,6 @@ ) ) ) - (none) ) :code (behavior () (fodder-method-182 self) @@ -872,7 +866,6 @@ ) ) #f - (none) ) ) @@ -886,7 +879,6 @@ ) ) (sound-play "fodder-bite" :position (-> self root trans)) - (none) ) ) @@ -986,7 +978,6 @@ ) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc index ef113820669..7807d9d918a 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc @@ -529,7 +529,6 @@ ) ) #f - (none) ) ) @@ -543,7 +542,6 @@ ) ) (vector-reset! (-> self root transv)) - (none) ) ) @@ -559,7 +557,6 @@ (grenadier-method-181 self) (look-at-target! self (enemy-flag death-start)) (logclear! (-> self status-flags) (grenadier-flags grflags-0)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -616,7 +613,6 @@ (go-stare self) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -644,7 +640,6 @@ ) ) #f - (none) ) :post (behavior () (let ((gp-0 (-> self bank))) @@ -661,7 +656,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -679,7 +673,6 @@ (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) ) 0 - (none) ) :trans (behavior () (let ((f0-0 (vector-vector-xz-distance (-> self root trans) (-> self move-pos)))) @@ -687,7 +680,6 @@ (go-hostile self) ) ) - (none) ) :code (behavior () (until #f @@ -701,7 +693,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -713,7 +704,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -743,7 +733,6 @@ (set! (-> v1-13 prim-core action) (collide-action deadly)) (set! (-> v1-13 local-sphere w) 7372.8) ) - (none) ) :exit (behavior () (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1))) @@ -754,7 +743,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.135)) @@ -767,7 +755,6 @@ (ja :num! (seek!)) ) (go-hostile self) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -785,7 +772,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -845,8 +831,8 @@ ;; failed to figure out what this is: (defstate attack (grenadier) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('event-attack) (let ((s4-0 (handle->process (-> self focus handle)))) (when s4-0 @@ -891,7 +877,7 @@ ) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) @@ -924,7 +910,6 @@ (set! (-> self attack-id) a0-19) ) (look-at-target! self (enemy-flag lock-focus)) - (none) ) :exit (behavior () (if (logtest? (enemy-flag enemy-flag43) (-> self enemy-flags)) @@ -936,7 +921,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (let ((f30-0 (get-rand-float-range self 0.9 1.1))) @@ -1053,7 +1037,6 @@ ) ) (go-hostile self) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -1071,7 +1054,6 @@ ) ) (nav-enemy-travel-post) - (none) ) ) @@ -1159,7 +1141,6 @@ (go-stare self) ) ) - (none) ) ) @@ -1177,7 +1158,6 @@ (go (method-of-object obj attack)) ) ((method-of-type nav-enemy go-hostile) obj) - (none) ) ;; failed to figure out what this is: @@ -1210,7 +1190,6 @@ ) ) (react-to-focus self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc index 9f6edb063e8..940d3ddbf25 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc @@ -473,7 +473,6 @@ (go-hostile obj) ) ) - (none) ) ;; failed to figure out what this is: @@ -516,14 +515,12 @@ (set! (-> v1-19 prim-core collide-with) (collide-spec)) ) 0 - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -556,12 +553,12 @@ (suspend) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior grunt) nav-enemy-falling-post) ) ;; definition for method 93 of type grunt +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-93 grunt ((obj grunt)) (case (-> obj jump-why) ((2) @@ -585,7 +582,6 @@ (go-virtual notice) ) (get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp) - (none) ) :code (behavior () (set! (-> self unknown-byte-1ji2n3) 1) @@ -607,7 +603,6 @@ (suspend) ) #f - (none) ) ) @@ -642,7 +637,6 @@ (suspend) ) #f - (none) ) ) @@ -777,7 +771,6 @@ ) ) #f - (none) ) ) @@ -857,7 +850,6 @@ ) ) ) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -909,7 +901,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior grunt) nav-enemy-chase-post) ) @@ -933,7 +924,6 @@ (set! (-> v1-10 attack-id) v0-1) (set! (-> self attack-id) v0-1) ) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -941,7 +931,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (enemy-method-49 self) @@ -949,7 +938,6 @@ (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "grunt-hit") ) - (none) ) :code (behavior () (set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (get-rand-int self 2))) @@ -1012,7 +1000,6 @@ (set! (-> self unknown-byte-n1k2n3) v1-57) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior grunt) nav-enemy-chase-post) ) @@ -1046,7 +1033,6 @@ (set! (-> v1-21 attack-id) v0-3) (set! (-> self attack-id) v0-3) ) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1054,14 +1040,12 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) (sound-play "grunt-hit") ) - (none) ) :code (behavior () (set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (get-rand-int self 2))) @@ -1094,7 +1078,6 @@ ) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior grunt) nav-enemy-simple-post) ) @@ -1202,7 +1185,6 @@ ) ) #f - (none) ) ) @@ -1268,7 +1250,6 @@ ) ) #f - (none) ) ) @@ -1306,7 +1287,6 @@ ) ) #f - (none) ) ) @@ -1551,7 +1531,6 @@ ) ) ) - (none) ) :code (-> (method-of-type nav-enemy idle) code) :post (-> (method-of-type nav-enemy idle) post) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc index c603a98581e..c4dca06a271 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc @@ -1167,7 +1167,6 @@ ) ) ) - (none) ) ;; failed to figure out what this is: @@ -1191,7 +1190,6 @@ ) 0 ) - (none) ) ) @@ -1220,66 +1218,61 @@ ) ) ) - (none) ) ) ;; definition for method 74 of type crimson-guard-level -;; WARN: Return type mismatch none vs object. (defmethod general-event-handler crimson-guard-level ((obj crimson-guard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'event-death) - (when (<= (-> obj hit-points) 0) - (set! (-> obj root penetrated-by) (the-as penetrate -1)) - (the-as object (do-effect (-> obj skel effect) 'death-default 0.0 -1)) - ) - ) - ((or (= v1-0 'hit) (= v1-0 'hit-flinch) (= v1-0 'hit-knocked)) - (speech-control-method-13 *speech-control* (the-as handle obj)) - (let* ((s1-0 (handle->process (-> obj incoming attacker-handle))) - (a0-13 (if (type? s1-0 process-focusable) - s1-0 - ) - ) - ) - (if (and a0-13 (logtest? (-> a0-13 mask) (process-mask target))) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-11)) - ) - ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ((= v1-0 'trigger) - (let ((v0-0 (the-as object #t))) - (set! (-> obj trigger) (the-as symbol v0-0)) - v0-0 - ) - ) - ((= v1-0 'untrigger) - (set! (-> obj trigger) #f) - #f - ) - ((= v1-0 'notify) - (let ((a0-21 (-> arg3 param 0)) - (v1-16 (the-as object (-> arg3 param 1))) - ) - (when (= a0-21 'attack) - (when (logtest? (-> (the-as process-focusable v1-16) mask) (process-mask target)) - (if (focus-test? (the-as process-focusable v1-16) dead) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-10)) - ) - ) - ) - ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + (case arg2 + (('event-death) + (when (<= (-> obj hit-points) 0) + (set! (-> obj root penetrated-by) (the-as penetrate -1)) + (do-effect (-> obj skel effect) 'death-default 0.0 -1) + ) + ) + (('hit 'hit-flinch 'hit-knocked) + (speech-control-method-13 *speech-control* (the-as handle obj)) + (let* ((s1-0 (handle->process (-> obj incoming attacker-handle))) + (a0-13 (if (type? s1-0 process-focusable) + s1-0 ) - ) + ) ) + (if (and a0-13 (logtest? (-> a0-13 mask) (process-mask target))) + (speech-control-method-12 *speech-control* obj (speech-type speech-type-11)) + ) + ) + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (('trigger) + (let ((v0-0 (the-as object #t))) + (set! (-> obj trigger) (the-as symbol v0-0)) + v0-0 + ) + ) + (('untrigger) + (set! (-> obj trigger) #f) + #f + ) + (('notify) + (let ((a0-21 (-> arg3 param 0)) + (v1-16 (the-as object (-> arg3 param 1))) + ) + (when (= a0-21 'attack) + (when (logtest? (-> (the-as process-focusable v1-16) mask) (process-mask target)) + (if (focus-test? (the-as process-focusable v1-16) dead) + (speech-control-method-12 *speech-control* obj (speech-type speech-type-10)) + ) + ) + ) + ) + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) ) ) @@ -1720,7 +1713,6 @@ ) (speech-control-method-12 *speech-control* self (speech-type speech-type-3)) (logior! (-> self enemy-flags) (enemy-flag chase-startup)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1756,7 +1748,6 @@ (react-to-focus self) ) ) - (none) ) ) @@ -1778,11 +1769,9 @@ (go-virtual gun-shoot) ) (set! (-> self reaction-time) (the-as time-frame (the int (* 300.0 (get-rand-float-range self 1.0 3.0))))) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (let ((gp-0 (-> self focus aware))) @@ -1840,7 +1829,6 @@ (set! (-> a0-21 target-post quad) (-> v1-62 quad)) ) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1853,7 +1841,6 @@ ) ) #f - (none) ) ) @@ -1868,11 +1855,9 @@ ((-> (method-of-type nav-enemy hostile) enter)) (set! (-> self state-time) (current-time)) (set! (-> self reaction-time) (the-as time-frame (the int (* 300.0 (get-rand-float-range self 0.5 1.5))))) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (let ((gp-0 (-> self focus aware))) @@ -1907,7 +1892,6 @@ (set! (-> a0-13 target-post quad) (-> v1-38 quad)) ) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1920,11 +1904,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -1939,11 +1921,9 @@ ((-> (method-of-type nav-enemy hostile) enter)) (set! (-> self state-time) (current-time)) (nav-enemy-method-156 self) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (let ((gp-0 (-> self focus aware))) @@ -1989,7 +1969,6 @@ ) ) ) - (none) ) :code (behavior () (speech-control-method-12 *speech-control* self (speech-type speech-type-9)) @@ -2003,11 +1982,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -2022,11 +1999,9 @@ ((-> (method-of-type nav-enemy hostile) enter)) (set! (-> self state-time) (current-time)) (nav-enemy-method-156 self) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (let ((gp-0 (-> self focus aware))) @@ -2070,7 +2045,6 @@ ) ) ) - (none) ) :code (behavior () (speech-control-method-12 *speech-control* self (speech-type speech-type-9)) @@ -2084,11 +2058,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -2124,12 +2096,10 @@ (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self joint-enable) #t) (set! (-> self reaction-time) (the-as time-frame (the int (* 300.0 (get-rand-float-range self 3.0 5.0))))) - (none) ) :exit (behavior () (set! (-> self joint-enable) #f) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (crimson-guard-level-method-200 self) @@ -2148,7 +2118,6 @@ ) ) ) - (none) ) :code (behavior () (speech-control-method-12 *speech-control* self (speech-type speech-type-13)) @@ -2200,11 +2169,9 @@ ) ) (go-hostile self) - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -2251,11 +2218,9 @@ ) (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self joint-enable) #t) - (none) ) :exit (behavior () (set! (-> self joint-enable) #f) - (none) ) :trans (behavior () (crimson-guard-level-method-200 self) @@ -2272,7 +2237,6 @@ ) ) ) - (none) ) :code (behavior () (local-vars (v1-48 object)) @@ -2396,11 +2360,9 @@ (crimson-guard-level-method-204 self) ) (go-hostile self) - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -2826,7 +2788,6 @@ (set! (-> v1-9 target-speed) 0.0) ) 0 - (none) ) :exit (behavior () (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) @@ -2837,11 +2798,9 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (crimson-guard-level-method-200 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2854,11 +2813,9 @@ (ja :num! (seek!)) ) (go-hostile self) - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -2937,7 +2894,6 @@ (set! (-> v1-9 target-speed) 0.0) ) 0 - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -2945,11 +2901,9 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (crimson-guard-level-method-200 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2997,11 +2951,9 @@ (ja :num! (seek! (ja-aframe 37.0 0))) ) (go-hostile self) - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -3036,7 +2988,6 @@ (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self lazer-sound) (new 'static 'sound-id)) 0 - (none) ) :exit (behavior () (if (nonzero? (-> self lazer-sound)) @@ -3072,14 +3023,12 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (crimson-guard-level-method-200 self) (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) (< 32768.0 (-> self target-self-xz-dist))) (go-hostile self) ) - (none) ) :code (behavior () (local-vars (v1-69 symbol)) @@ -3251,11 +3200,9 @@ #f (label cfg-81) (go-virtual active) - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -3277,7 +3224,6 @@ (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) @@ -3288,11 +3234,9 @@ (collide-spec backgnd jak obstacle hit-by-others-list player-list pusher) ) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -3312,7 +3256,6 @@ ) (set! (-> self hit-face) (the-as uint -1)) (go-hostile self) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -3323,7 +3266,6 @@ ) 0 (track-target! self) - (none) ) ) @@ -3345,7 +3287,6 @@ (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) @@ -3356,11 +3297,9 @@ (collide-spec backgnd jak obstacle hit-by-others-list player-list pusher) ) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -3378,7 +3317,6 @@ ) (set! (-> self hit-face) (the-as uint -1)) (go-hostile self) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -3389,7 +3327,6 @@ ) 0 (track-target! self) - (none) ) ) @@ -3541,7 +3478,6 @@ ) ) (go-virtual gun-shoot) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -3563,7 +3499,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -3658,7 +3593,6 @@ ) ) (go-virtual gun-shoot) - (none) ) :post (-> (method-of-type crimson-guard-level roll-right) post) ) @@ -3693,7 +3627,6 @@ ) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy knocked) trans))) @@ -3701,7 +3634,6 @@ (t9-0) ) ) - (none) ) ) @@ -3804,7 +3736,6 @@ ) ;; definition for method 70 of type crimson-guard-level -;; WARN: Return type mismatch object vs none. (defmethod go-hostile crimson-guard-level ((obj crimson-guard-level)) (let ((v1-0 (-> obj hit-face))) (cond @@ -3828,7 +3759,6 @@ ) ) ) - (none) ) ;; definition for method 78 of type crimson-guard-level @@ -4049,7 +3979,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -4338,12 +4267,10 @@ ) 0 (set! (-> self already-shot) (the-as uint #f)) - (none) ) :exit (behavior () (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) (logclear! (-> self nav flags) (nav-control-flag output-sphere-hash)) - (none) ) :trans (behavior () (rlet ((acc :class vf) @@ -4400,7 +4327,6 @@ ) (crimson-guard-level-method-201 self 0.0) ) - (none) ) ) :code (behavior () @@ -4426,11 +4352,9 @@ (suspend) ) #f - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -4555,6 +4479,7 @@ ;; definition for method 156 of type crimson-guard-level ;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. (defmethod nav-enemy-method-156 crimson-guard-level ((obj crimson-guard-level)) (cond ((logtest? (-> obj flags) 36) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc index 8685bed07e8..a3e73b0e27f 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc @@ -292,8 +292,8 @@ ;; failed to figure out what this is: (defstate dormant (guard-conversation) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (set! (-> self triggered?) #t) (go-virtual active) @@ -310,20 +310,19 @@ ;; failed to figure out what this is: (defstate active (guard-conversation) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('trigger) - (let ((v0-0 #t)) - (set! (-> self triggered?) v0-0) - v0-0 - ) - ) - (('untrigger) - (set! (-> self triggered?) #f) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (let ((v0-0 #t)) + (set! (-> self triggered?) v0-0) + v0-0 + ) + ) + (('untrigger) + (set! (-> self triggered?) #f) + #f + ) + ) ) :trans (behavior () (let ((gp-0 #t)) @@ -359,7 +358,6 @@ (if (and (-> self triggered?) (>= (- (current-time) (-> self last-playing-time)) (seconds 6))) (guard-conversation-method-24 self) ) - (none) ) :code (the-as (function none :behavior guard-conversation) sleep-code) ) @@ -408,7 +406,6 @@ (suspend) ) (go-virtual die) - (none) ) ) @@ -420,7 +417,6 @@ (process-entity-status! self (entity-perm-status dead) #t) (suspend) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/guards/transport-level_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/guards/transport-level_REF.gc index 434d2bdd620..7548b1e0461 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/guards/transport-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/guards/transport-level_REF.gc @@ -134,7 +134,6 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self last-guard-spawn-time) (current-time)) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -147,7 +146,6 @@ (ja :num! (seek!)) ) (sleep-code) - (none) ) :post (behavior () (set! (-> self root transv y) (* 2.0 (- (-> self y-dest) (-> self root trans y)))) @@ -158,7 +156,6 @@ ) (transport-level-method-34 self) (transform-post) - (none) ) ) @@ -171,11 +168,9 @@ (set! (-> self root transv y) 0.0) (set! (-> self last-guard-spawn-time) 0) 0 - (none) ) :exit (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -189,7 +184,6 @@ (ja :num! (seek! max 0.5)) ) (sleep-code) - (none) ) :post (behavior () (local-vars (gp-0 symbol)) @@ -226,7 +220,6 @@ ) (transport-level-method-34 self) (transform-post) - (none) ) ) @@ -236,7 +229,6 @@ :code (behavior () (sound-stop (-> self ambient-sound-id)) (cleanup-for-death self) - (none) ) ) @@ -247,7 +239,6 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self root transv y) 0.0) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -262,7 +253,6 @@ (ja :num! (seek! max 0.2)) ) (sleep-code) - (none) ) :post (behavior () (transport-level-method-34 self) @@ -275,7 +265,6 @@ (go-virtual die-fast) ) (transform-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc index e6d9633ce56..f321f4c5e5e 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc @@ -553,7 +553,6 @@ (t9-0) ) ) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy jump) exit))) @@ -570,7 +569,6 @@ (set! (-> v1-5 settings bot-plane w) (- -4096.0)) ) 0 - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy jump) trans))) @@ -587,7 +585,6 @@ (set! (-> v1-5 settings top-plane w) (- (+ (- 8192.0 (-> self root trans y)) (-> self root gspot-pos y)))) ) 0 - (none) ) ) @@ -696,7 +693,6 @@ (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) ) @@ -726,7 +722,6 @@ (set! (-> self next-jump-time) (the-as int (+ (current-time) (get-rand-int-range self 0 120)))) (set! (-> self step-num) 0) (set! (-> self best-score) -2.0) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) @@ -734,7 +729,6 @@ (t9-0) ) ) - (none) ) :post (the-as (function none :behavior hopper) nav-enemy-simple-post) ) @@ -748,7 +742,6 @@ (t9-0) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -765,7 +758,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior hopper) nav-enemy-simple-post) ) @@ -796,7 +788,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -842,18 +833,15 @@ (set! (-> gp-1 trans quad) (-> s5-0 quad)) ) ) - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) @@ -868,7 +856,6 @@ (send-event self 'jump 2 gp-0) ) (go-virtual hostile) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc index 91e288c13c6..10f8b44c2a4 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc @@ -683,11 +683,9 @@ ) (set! (-> self last-fire-time) (+ (current-time) (the int (* 300.0 (get-rand-float-range self 2.0 3.0))))) (go-virtual ambush-fly) - (none) ) :exit (behavior () '() - (none) ) ) @@ -717,7 +715,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior crimson-guard-hover) hover-enemy-fly-code) :post (-> (method-of-type hover-enemy ambush) post) @@ -726,8 +723,8 @@ ;; failed to figure out what this is: (defstate ambush-attack (crimson-guard-hover) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('event-attack) (when (< (-> self shots-fired) 2) (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) @@ -757,7 +754,7 @@ ) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) @@ -773,19 +770,16 @@ ) (set! (-> self shots-fired) 0) 0 - (none) ) :exit (behavior () (set! (-> self last-fire-time) (current-time)) (set! (-> self restart-fly-anims) #t) - (none) ) :trans (behavior () ((-> (method-of-type crimson-guard-hover ambush) trans)) (if (or (skip-check-los? (-> self los) 60) (not (enemy-method-95 self (-> self focus-pos) 9102.223))) (go-virtual ambush-fly) ) - (none) ) :code (behavior () (sound-play "hover-warn") @@ -805,7 +799,6 @@ (ja :num! (seek!)) ) (go-virtual ambush-fly) - (none) ) :post (behavior () (let* ((a1-0 (-> self node-list data (-> self hover-info gun-base))) @@ -827,7 +820,6 @@ (* 0.5 (seconds-per-frame) (- (-> self attack-miss-dist-max) (-> self attack-miss-dist-min))) ) ((the-as (function none) (-> (method-of-type crimson-guard-hover ambush) post))) - (none) ) ) @@ -842,7 +834,6 @@ ) (talker-spawn-func (-> *talker-speech* 10) *entity-pool* (target-pos 0) (the-as region #f)) (set! (-> self last-fire-time) (+ (current-time) (seconds -1.5))) - (none) ) ) @@ -865,7 +856,6 @@ ) ) ) - (none) ) ) @@ -878,13 +868,11 @@ ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 4)) (go-hostile self) ) - (none) ) :code (the-as (function none :behavior crimson-guard-hover) hover-enemy-fly-code) :post (behavior () @@ -916,15 +904,14 @@ (hover-nav-control-method-11 (-> self hover) gp-0) ) (hover-enemy-dest-post) - (none) ) ) ;; failed to figure out what this is: (defstate attack (crimson-guard-hover) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('event-attack) (when (< (-> self shots-fired) 2) (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) @@ -954,7 +941,7 @@ ) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) @@ -963,18 +950,15 @@ (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) (set! (-> self shots-fired) 0) 0 - (none) ) :exit (behavior () (set! (-> self last-fire-time) (current-time)) (set! (-> self restart-fly-anims) #t) - (none) ) :trans (behavior () (if (or (skip-check-los? (-> self los) 60) (not (enemy-method-95 self (-> self focus-pos) 9102.223))) (go-hostile self) ) - (none) ) :code (behavior () (sound-play "hover-warn") @@ -1001,7 +985,6 @@ (ja :num! (seek!)) ) (go-hostile self) - (none) ) :post (behavior () (let* ((a1-0 (-> self node-list data (-> self hover-info gun-base))) @@ -1023,7 +1006,6 @@ (* 0.5 (seconds-per-frame) (- (-> self attack-miss-dist-max) (-> self attack-miss-dist-min))) ) (hover-enemy-hostile-post) - (none) ) ) @@ -1036,7 +1018,6 @@ (t9-1) ) ) - (none) ) ) @@ -1087,7 +1068,6 @@ (logclear! (-> self focus-status) (focus-status hit)) (hover-nav-control-method-21 (-> self hover)) (go-hostile self) - (none) ) ) @@ -1114,7 +1094,6 @@ ) (send-event self 'death-end) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior crimson-guard-hover) transform-post) ) @@ -1158,7 +1137,6 @@ (-> gp-0 ppointer) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1185,7 +1163,6 @@ ) ) (sleep-code) - (none) ) ) @@ -1240,7 +1217,6 @@ ) ) (sound-stop (-> self sound-id)) - (none) ) ) @@ -1408,6 +1384,7 @@ ) ;; definition for method 52 of type crimson-guard-hover +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-52 crimson-guard-hover ((obj crimson-guard-hover) (arg0 vector)) (let ((s4-0 (-> obj root))) (case (-> obj incoming knocked-type) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/flamer_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/flamer_REF.gc index b39b7c5611c..e04683e4eac 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/flamer_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/flamer_REF.gc @@ -638,6 +638,7 @@ ;; definition for method 191 of type flamer ;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. (defmethod flamer-method-191 flamer ((obj flamer)) (cond ((and (-> obj draw shadow) @@ -809,7 +810,6 @@ ;; definition for method 67 of type flamer (defmethod go-stare flamer ((obj flamer)) (go-hostile obj) - (none) ) ;; failed to figure out what this is: @@ -830,7 +830,6 @@ (suspend) ) #f - (none) ) :post (-> (method-of-type flamer idle) post) ) @@ -845,7 +844,6 @@ ) ) (set! (-> self root trans quad) (-> self idle-pos quad)) - (none) ) ) @@ -859,7 +857,6 @@ ) ) (set! (-> self root trans quad) (-> self idle-pos quad)) - (none) ) :trans (behavior () (when (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) (flamer-method-183 self)) @@ -868,7 +865,6 @@ (go-virtual active) ) ) - (none) ) ) @@ -884,14 +880,12 @@ (flamer-method-190 self) (set! (-> self ground-mode) 0) 0 - (none) ) :trans (behavior () (if (flamer-method-183 self) (go-virtual active) ) (flamer-method-184 self) - (none) ) ) @@ -906,7 +900,6 @@ ) (set! (-> self ground-mode) 0) 0 - (none) ) :trans (behavior () (if (flamer-method-183 self) @@ -915,7 +908,6 @@ (if (>= 819.2 (vector-vector-xz-distance (-> self root trans) (-> self idle-pos))) (go-virtual idle) ) - (none) ) :post flamer-attack-post ) @@ -953,7 +945,6 @@ (sound-play "flamer-ambush") (quaternion-copy! (-> self root quat) (-> self init-quat)) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy ambush) exit))) @@ -965,7 +956,6 @@ (logior! (-> self enemy-flags) (enemy-flag notice)) (set! (-> self flit-joint twist-min-y) (the-as float #t)) (set! (-> self last-fire-time) (+ (current-time) (seconds -1.5))) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy ambush) trans))) @@ -987,13 +977,11 @@ ) (flamer-method-186 self f30-0) ) - (none) ) :code (the-as (function none :behavior flamer) flamer-fly-code) :post (behavior () (flamer-method-187 self) (nav-enemy-simple-post) - (none) ) ) @@ -1028,19 +1016,16 @@ ) 0 (set! (-> self ground-mode) 1) - (none) ) :trans (behavior () (if (< (vector-vector-xz-distance (-> self root trans) (-> self dest-pos)) 409.6) (go-virtual exit-ambush-path) ) - (none) ) :code (the-as (function none :behavior flamer) flamer-fly-code) :post (behavior () (flamer-method-187 self) (flamer-flit-post) - (none) ) ) @@ -1058,12 +1043,10 @@ ) 0 (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self enemy-flags) (enemy-flag notice)) - (none) ) :trans (behavior () (set! (-> self path-pos) (- (-> self path-pos) (* 0.33333334 (seconds-per-frame)))) @@ -1086,7 +1069,6 @@ (get-point-at-percent-along-path! (-> self path) (-> self base-pos) f30-0 'interp) (flamer-method-186 self f30-0) ) - (none) ) :code (the-as (function none :behavior flamer) flamer-fly-code) :post (behavior () @@ -1098,7 +1080,6 @@ (vector-seek! (-> self root trans) (-> self base-pos) (* 16384.0 (seconds-per-frame))) (flamer-method-184 self) (nav-enemy-simple-post) - (none) ) ) @@ -1112,7 +1093,6 @@ ) ) (go-virtual hostile) - (none) ) ) @@ -1136,7 +1116,6 @@ (flamer-method-189 self) (set! (-> self ground-mode) 0) (set! (-> self flit-timer) (+ (current-time) (seconds -3))) - (none) ) :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -1160,21 +1139,19 @@ (go-virtual attack) ) ) - (none) ) :code (the-as (function none :behavior flamer) flamer-fly-code) :post (behavior () (flamer-method-187 self) (flamer-flit-post) - (none) ) ) ;; failed to figure out what this is: (defstate attack (flamer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('event-attack) (let ((s5-0 (handle->process (-> self focus handle)))) (when s5-0 @@ -1210,13 +1187,12 @@ ) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1244,7 +1220,6 @@ ) (set! (-> self last-fire-time) (current-time)) (go-virtual hostile) - (none) ) :post flamer-attack-post ) @@ -1351,7 +1326,6 @@ ) (set-gravity-length (-> self root dynam) 368640.0) (set! (-> self hit-surface?) #f) - (none) ) :trans (behavior () (let ((gp-0 (-> self root))) @@ -1381,7 +1355,6 @@ (go-hostile self) ) ) - (none) ) :post (behavior () (seek! (-> self sound-volume) 0.0 (* 0.5 (seconds-per-frame))) @@ -1391,7 +1364,6 @@ ((the-as (function none) t9-2)) ) ) - (none) ) ) @@ -1419,7 +1391,6 @@ 0 (nav-enemy-method-167 self) (enemy-method-103 self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-battle_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-battle_REF.gc index a9bbbc162c7..6383856e771 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-battle_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-battle_REF.gc @@ -46,7 +46,7 @@ :flag-assert #x13003000a8 (:methods (idle () _type_ :state 14) - (spawning (object object process pointer) _type_ :state 15) + (spawning () _type_ :state 15) (die () _type_ :state 16) (hover-enemy-manager-init! (_type_ (array hover-enemy-battle-command)) none 17) (spawn-enemy (_type_ uint) none 18) @@ -176,13 +176,13 @@ ;; failed to figure out what this is: (defstate idle (hover-enemy-manager) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) - (go-virtual spawning proc arg1 (the-as process event-type) (the-as pointer event)) + (go-virtual spawning) ) (else - (hover-enemy-manager-handler proc arg1 event-type event) + (hover-enemy-manager-handler proc argc message block) ) ) ) @@ -193,25 +193,24 @@ ;; failed to figure out what this is: (defstate spawning (hover-enemy-manager) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('spawning?) #t ) (else - (hover-enemy-manager-handler proc arg1 event-type event) + (hover-enemy-manager-handler proc argc message block) ) ) ) - :enter (behavior ((arg0 object) (arg1 object) (arg2 process) (arg3 pointer)) - (let ((a0-1 (-> self formation))) - (if a0-1 - (set-anchor-proc a0-1 (process->handle *target*)) + :enter (behavior () + (let ((a0-0 (-> self formation))) + (if a0-0 + (set-anchor-proc a0-0 (process->handle *target*)) ) ) - (none) ) - :code (behavior ((arg0 object) (arg1 object) (arg2 process) (arg3 pointer)) + :code (behavior () (let ((gp-0 (-> self command-table))) (dotimes (s5-0 (-> gp-0 length)) (case (-> gp-0 s5-0 command) @@ -237,7 +236,6 @@ ) ) (go-virtual die) - (none) ) :post hover-enemy-manager-post ) @@ -251,7 +249,6 @@ (suspend) ) (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy_REF.gc index 7a2e8183925..cacac2d4791 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy_REF.gc @@ -527,7 +527,6 @@ (hover-enemy-method-144 self) (hover-nav-control-method-18 (-> self hover) (-> self path) -1 -1) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (local-vars (v1-5 enemy-flag)) @@ -541,7 +540,6 @@ ) (set! (-> self enemy-flags) v1-5) (hover-enemy-method-153 self) - (none) ) :trans (behavior () (when (hover-nav-control-method-23 (-> self hover)) @@ -551,7 +549,6 @@ ) (go-virtual hostile) ) - (none) ) :code hover-enemy-fly-code :post (behavior () @@ -578,7 +575,6 @@ ) (hover-nav-control-method-11 (-> self hover) (the-as vector #f)) (hover-enemy-dest-post) - (none) ) ) @@ -602,7 +598,6 @@ (hover-nav-control-method-10 (-> self hover) s5-0 gp-0 (the-as vector #t)) ) (hover-enemy-method-144 self) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type enemy notice) exit))) @@ -611,7 +606,6 @@ ) ) (hover-enemy-method-153 self) - (none) ) ) @@ -636,7 +630,6 @@ ) (set! (-> self hit-surface?) #f) (set! (-> self knocked-start-level) (-> self root trans y)) - (none) ) :exit (behavior () (let ((t9-1 (-> (the-as state (find-parent-method hover-enemy 30)) exit))) @@ -645,7 +638,6 @@ ) ) (set! (-> self hit-surface?) #f) - (none) ) :trans (behavior () (let ((gp-0 (-> self root))) @@ -672,7 +664,6 @@ ) (go-virtual knocked-recover) ) - (none) ) ) @@ -727,7 +718,6 @@ (logclear! (-> self focus-status) (focus-status hit)) (hover-nav-control-method-21 (-> self hover)) (go-hostile self) - (none) ) :post hover-enemy-hostile-post ) @@ -735,8 +725,8 @@ ;; failed to figure out what this is: (defstate flying-death (hover-enemy) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'touched 'attack) (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (go-virtual flying-death-explode) @@ -798,7 +788,6 @@ (set! (-> self flying-death-spin) 0.0) (enemy-method-103 self) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (or (logtest? (-> self root status) @@ -808,7 +797,6 @@ ) (go-virtual flying-death-explode) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -829,7 +817,6 @@ ) ) #f - (none) ) :post (behavior () (seek! (-> self flying-death-spin) (-> self flying-death-spin-dest) (* 196608.0 (seconds-per-frame))) @@ -867,7 +854,6 @@ ) (enemy-simple-post) (hover-enemy-method-143 self (-> self flying-death-engine) (-> self flying-death-thrust-rotate)) - (none) ) ) @@ -882,27 +868,23 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (behavior () (while (-> self child) (suspend) ) (cleanup-for-death self) - (none) ) ) ;; definition for method 67 of type hover-enemy (defmethod go-stare hover-enemy ((obj hover-enemy)) (go-hostile obj) - (none) ) ;; definition for method 68 of type hover-enemy (defmethod go-stare2 hover-enemy ((obj hover-enemy)) (go-hostile obj) - (none) ) ;; definition for method 146 of type hover-enemy diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation_REF.gc index fe7718a83b8..963691e4655 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation_REF.gc @@ -613,61 +613,55 @@ ;; failed to figure out what this is: (defstate idle (hover-formation) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (the-as - object - (case event-type - (('join) - (hover-formation-control-method-17 (-> self formation) proc) - ) - (('leave) - (hover-formation-control-method-18 (-> self formation) proc) - ) - (('set-type) - (let ((a1-11 1)) - (case (-> event param 0) - (('line) - (set! a1-11 0) - ) - (('circle) - (set! a1-11 2) - ) - (('semicircle) - (set! a1-11 3) - ) - ) - (try-update-formation-type (-> self formation) (the-as formation-type a1-11)) + (case message + (('join) + (hover-formation-control-method-17 (-> self formation) proc) + ) + (('leave) + (hover-formation-control-method-18 (-> self formation) proc) + ) + (('set-type) + (let ((a1-11 1)) + (case (-> block param 0) + (('line) + (set! a1-11 0) + ) + (('circle) + (set! a1-11 2) + ) + (('semicircle) + (set! a1-11 3) + ) ) + (try-update-formation-type (-> self formation) (the-as formation-type a1-11)) ) - (('update-sphere) - (the-as - object - (hover-formation-control-method-20 (-> self formation) (process->handle proc) (-> event param 0)) + ) + (('update-sphere) + (hover-formation-control-method-20 (-> self formation) (process->handle proc) (-> block param 0)) + ) + (('get-formation) + (-> self formation) + ) + (('set-los) + (cond + ((-> block param 0) + (set! v0-0 (logior (-> self formation flags) 2)) + (set! (-> self formation flags) (the-as uint v0-0)) + ) + (else + (set! v0-0 (logand -3 (-> self formation flags))) + (set! (-> self formation flags) (the-as uint v0-0)) ) ) - (('get-formation) - (-> self formation) - ) - (('set-los) - (cond - ((-> event param 0) - (set! v0-0 (logior (-> self formation flags) 2)) - (set! (-> self formation flags) (the-as uint v0-0)) - ) - (else - (set! v0-0 (logand -3 (-> self formation flags))) - (set! (-> self formation flags) (the-as uint v0-0)) - ) + v0-0 + ) + (('path) + (if (not (logtest? (-> self path flags) (path-control-flag not-found))) + (-> self path) ) - v0-0 - ) - (('path) - (if (not (logtest? (-> self path flags) (path-control-flag not-found))) - (-> self path) - ) - ) - ) + ) ) ) :code (the-as (function none :behavior hover-formation) sleep-code) @@ -683,7 +677,6 @@ (if (not (logtest? (-> self path flags) (path-control-flag not-found))) (debug-draw (-> self path)) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc index 45e4df09c91..320811250de 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc @@ -38,7 +38,6 @@ :post (behavior () (nav-network-method-29 (-> self nav-network)) (nav-network-method-27 (-> self nav-network)) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc index 3ab4e7f1341..eca1f052079 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc @@ -506,6 +506,7 @@ ) ;; definition for method 52 of type wasp +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-52 wasp ((obj wasp) (arg0 vector)) (let ((s4-0 (-> obj root))) (case (-> obj incoming knocked-type) @@ -561,21 +562,19 @@ ) ;; definition for method 70 of type wasp -;; WARN: Return type mismatch object vs none. (defmethod go-hostile wasp ((obj wasp)) (go (method-of-object obj hostile)) - (none) ) ;; definition for method 72 of type wasp (defmethod react-to-focus wasp ((obj wasp)) "@TODO - flesh out docs" (go-hostile obj) - (none) ) ;; definition for method 129 of type wasp ;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-129 wasp ((obj wasp)) (if (logtest? (-> obj fact enemy-options) (enemy-option user0)) (set! (-> obj focus-pos quad) (-> obj plat-pos quad)) @@ -610,7 +609,6 @@ (if (logtest? (-> self fact enemy-options) (enemy-option user0)) (go-virtual shoot-bridge-wait) ) - (none) ) ) @@ -624,7 +622,6 @@ ) ) (set! (-> self last-fire-time) (+ (current-time) (seconds -1.5))) - (none) ) ) @@ -638,15 +635,14 @@ ) ) (set! (-> self last-fire-time) (+ (current-time) (seconds -1.5))) - (none) ) ) ;; failed to figure out what this is: (defstate shoot-bridge-wait (wasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual shoot-bridge-intro) ) @@ -675,7 +671,6 @@ (logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water)) (logclear! (-> self mask) (process-mask collectable)) (logclear! (-> self enemy-flags) (enemy-flag look-at-move-dest)) - (none) ) :exit (behavior () (let ((gp-0 (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp)) @@ -688,7 +683,6 @@ (the-as vector #t) ) ) - (none) ) :code (the-as (function none :behavior wasp) sleep-code) ) @@ -696,8 +690,8 @@ ;; failed to figure out what this is: (defstate shoot-bridge-intro (wasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('shoot) (go-virtual shoot-bridge-hostile) ) @@ -705,7 +699,6 @@ ) :enter (behavior () (set! (-> self plat-pos quad) (-> self entity-group data 0 actor extra trans quad)) - (none) ) :trans (behavior () (if (< (vector-vector-distance @@ -716,21 +709,19 @@ ) (go-virtual shoot-bridge-hold) ) - (none) ) :code (the-as (function none :behavior wasp) hover-enemy-fly-code) :post (behavior () (hover-nav-control-method-11 (-> self hover) (the-as vector #f)) (hover-enemy-dest-post) - (none) ) ) ;; failed to figure out what this is: (defstate shoot-bridge-hold (wasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('shoot) (go-virtual shoot-bridge-hostile) ) @@ -740,7 +731,6 @@ :post (behavior () (hover-nav-control-method-11 (-> self hover) (the-as vector #f)) (hover-enemy-dest-post) - (none) ) ) @@ -771,7 +761,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior wasp) hover-enemy-fly-code) :post (behavior () @@ -782,15 +771,14 @@ (hover-nav-control-method-11 (-> self hover) a1-0) ) (hover-enemy-dest-post) - (none) ) ) ;; failed to figure out what this is: (defstate shoot-bridge-attack (wasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :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)) @@ -812,14 +800,13 @@ (sound-play "wasp-fire" :position (-> self root trans)) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -841,7 +828,6 @@ (set! (-> self last-fire-time) (current-time)) (set! (-> self restart-fly-anims) #t) (go-virtual shoot-bridge-hostile) - (none) ) :post (behavior () (let* ((a1-0 (-> self node-list data (-> self hover-info gun-base))) @@ -869,7 +855,6 @@ (hover-nav-control-method-11 (-> self hover) a1-8) ) (hover-enemy-dest-post) - (none) ) ) @@ -895,7 +880,6 @@ ) ) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (< (vector-vector-distance @@ -907,7 +891,6 @@ (cleanup-for-death self) (go empty-state) ) - (none) ) :code (the-as (function none :behavior wasp) hover-enemy-fly-code) :post (behavior () @@ -919,7 +902,6 @@ ) ) (hover-enemy-dest-post) - (none) ) ) @@ -946,15 +928,14 @@ ) ) ) - (none) ) ) ;; failed to figure out what this is: (defstate attack (wasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :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)) @@ -976,14 +957,13 @@ (sound-play "wasp-fire" :position (-> self root trans)) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1005,7 +985,6 @@ (set! (-> self last-fire-time) (current-time)) (set! (-> self restart-fly-anims) #t) (go-hostile self) - (none) ) :post (behavior () (let* ((a1-0 (-> self node-list data (-> self hover-info gun-base))) @@ -1027,7 +1006,6 @@ (* 0.5 (seconds-per-frame) (- (-> self attack-miss-dist-max) (-> self attack-miss-dist-min))) ) (hover-enemy-hostile-post) - (none) ) ) @@ -1079,7 +1057,6 @@ (logclear! (-> self focus-status) (focus-status hit)) (hover-nav-control-method-21 (-> self hover)) (go-hostile self) - (none) ) ) @@ -1142,7 +1119,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -1166,7 +1142,6 @@ ) (send-event self 'death-end) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior wasp) transform-post) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/metalmonk_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/metalmonk_REF.gc index 2079c632cd2..4c410d519ad 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/metalmonk_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/metalmonk_REF.gc @@ -620,7 +620,6 @@ (set! (-> v1-6 turning-acceleration) (* 2.0 (-> self enemy-info run-turning-acceleration))) ) 0 - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy notice) exit))) @@ -636,7 +635,6 @@ (set! (-> v1-6 turning-acceleration) (-> self enemy-info run-turning-acceleration)) ) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -658,7 +656,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -691,7 +688,6 @@ (go-virtual attack) ) ) - (none) ) :code (behavior () (talker-spawn-func (-> *talker-speech* 95) *entity-pool* (target-pos 0) (the-as region #f)) @@ -704,7 +700,6 @@ ) ) #f - (none) ) ) @@ -786,7 +781,6 @@ ) ) #f - (none) ) ) @@ -815,7 +809,6 @@ (set! (-> v1-15 attack-id) v0-3) (set! (-> self attack-id) v0-3) ) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -829,11 +822,9 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (enemy-method-49 self) - (none) ) :code (behavior () (let ((gp-0 #f)) @@ -862,7 +853,6 @@ (go-hostile self) ) ) - (none) ) :post (the-as (function none :behavior metalmonk) nav-enemy-chase-post) ) @@ -877,7 +867,6 @@ ) ) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy victory) trans))) @@ -898,7 +887,6 @@ (react-to-focus self) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -915,7 +903,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -933,7 +920,6 @@ ) ) #f - (none) ) ) @@ -964,7 +950,6 @@ ) ) #f - (none) ) ) @@ -982,7 +967,6 @@ (go-virtual notice) ) (get-point-at-percent-along-path! (-> self intro-path) (-> self root trans) 0.0 'interp) - (none) ) :code (behavior () (until #f @@ -1003,7 +987,6 @@ (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc index dc6670175ee..a899e698455 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc @@ -752,6 +752,7 @@ ) ;; definition for method 3 of type ik-setup +;; INFO: this function exists in multiple non-identical object files (defmethod inspect ik-setup ((obj ik-setup)) (when (not obj) (set! obj obj) @@ -786,7 +787,6 @@ (set! (-> self shock-effect-end) (+ (current-time) (seconds 1))) (set! (-> self dest-fade) 128.0) ) - (none) ) ) @@ -802,7 +802,6 @@ (dotimes (gp-0 4) (enable-set! (-> self joint-ik gp-0) #t) ) - (none) ) ) @@ -945,7 +944,6 @@ (set! (-> self dest-fade) 128.0) (sound-play "spyder-uncloak") ) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) @@ -955,7 +953,6 @@ ) (logclear! (-> self status-flags) (spyder-flags spflags-5)) (look-at-target! self (enemy-flag lock-focus)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -986,7 +983,6 @@ ) ) ) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -998,7 +994,6 @@ ) 0 (spyder-travel-post) - (none) ) ) @@ -1016,7 +1011,6 @@ (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) ) 0 - (none) ) :trans (behavior () (let ((f0-0 (vector-vector-xz-distance (-> self root trans) (-> self move-dest)))) @@ -1024,7 +1018,6 @@ (go-hostile self) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1045,11 +1038,9 @@ ) ) #f - (none) ) :post (behavior () (spyder-travel-post) - (none) ) ) @@ -1085,13 +1076,14 @@ ;; failed to figure out what this is: (defstate attack (spyder) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (if (= v1-0 'event-attack) - (the-as object (spyder-method-183 self (the-as matrix (-> self fire-info)) 307200.0)) - (enemy-event-handler proc arg1 event-type event) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('event-attack) + (spyder-method-183 self (the-as matrix (-> self fire-info)) 307200.0) + ) + (else + (enemy-event-handler proc argc message block) + ) ) ) :enter (behavior () @@ -1109,7 +1101,6 @@ 0 (look-at-target! self (enemy-flag lock-focus)) (logior! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1117,7 +1108,6 @@ (set! (-> v1-2 max-rotation-rate) (-> *spyder-nav-enemy-info* maximum-rotation-rate)) ) 0 - (none) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) @@ -1126,7 +1116,6 @@ (if (or (>= 2 (the-as int (-> self focus aware))) (not (get-enemy-target self))) (go-stare self) ) - (none) ) :code (behavior () (when (not (enemy-method-96 self 2730.6667 #t)) @@ -1219,16 +1208,13 @@ ) 0 (go-hostile self) - (none) ) :post (behavior () (spyder-face-player-post) - (none) ) ) ;; definition for method 70 of type spyder -;; WARN: Return type mismatch object vs none. (defmethod go-hostile spyder ((obj spyder)) (if (and (not (logtest? (-> obj status-flags) (spyder-flags spflags-1))) (-> obj next-state) @@ -1239,7 +1225,6 @@ (go (method-of-object obj attack)) ) (go (method-of-object obj hostile)) - (none) ) ;; failed to figure out what this is: @@ -1255,7 +1240,6 @@ (dotimes (gp-0 4) (enable-set! (-> self joint-ik gp-0) #f) ) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy knocked) exit))) @@ -1269,7 +1253,6 @@ (enable-set! (-> self joint-ik gp-0) #t) ) ) - (none) ) ) @@ -1278,11 +1261,9 @@ :virtual #t :enter (behavior () (set! (-> self draw bounds w) 30310.4) - (none) ) :exit (behavior () (set! (-> self draw bounds w) 20480.0) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc index 9f3e6a2fcb9..3a905aee716 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc @@ -120,7 +120,6 @@ ) ) (process-entity-status! self (entity-perm-status subtask-complete) #t) - (none) ) ) @@ -137,7 +136,6 @@ (if (not (logtest? (-> self elevator-status) (elevator-status moving))) (set-setting! 'allow-look-around #f 0.0 0) ) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) @@ -149,7 +147,6 @@ ) (com-elevator-method-49 self #f) (remove-setting! 'allow-look-around) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -180,7 +177,6 @@ ) ) #f - (none) ) ) @@ -307,7 +303,6 @@ For example for an elevator pre-compute the distance between the first and last (if (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) (set-setting! 'jump #f 0.0 0) ) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type com-elevator running) exit))) @@ -320,7 +315,6 @@ For example for an elevator pre-compute the distance between the first and last (if (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) (remove-setting! 'jump) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -350,7 +344,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/entities/cty-guard-turret-button_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/cty-guard-turret-button_REF.gc index 34c9fe89280..115f56a517a 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/cty-guard-turret-button_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/cty-guard-turret-button_REF.gc @@ -137,11 +137,9 @@ ) (ja :group! cty-guard-turret-button-idle-ja :num! min) (go-virtual up-idle) - (none) ) :post (behavior () (rider-post) - (none) ) ) @@ -175,6 +173,9 @@ (setup-masks (-> self draw) 4 0) (setup-masks (-> self draw) 1 0) (press! self #t) - (none) ) ) + + + + diff --git a/test/decompiler/reference/jak2/levels/common/entities/fort-floor-spike_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/fort-floor-spike_REF.gc index 57ea587578e..b6c1b93b837 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/fort-floor-spike_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/fort-floor-spike_REF.gc @@ -134,53 +134,49 @@ ;; failed to figure out what this is: (defstate idle (fort-floor-spike) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touched) - (when (+ (current-time) (seconds -2)) - (let* ((s3-0 proc) - (proc-draw (if (type? s3-0 process-drawable) - (the-as process-drawable s3-0) - ) - ) - ) - (when proc-draw - (let ((spike-quat (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) - (touched-from-dir (vector-normalize! - (vector-! (new 'stack-no-clear 'vector) (-> proc-draw root trans) (-> self root trans)) - 1.0 - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (when (+ (current-time) (seconds -2)) + (let* ((s3-0 proc) + (proc-draw (if (type? s3-0 process-drawable) + (the-as process-drawable s3-0) + ) + ) + ) + (when proc-draw + (let ((spike-quat (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (touched-from-dir (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> proc-draw root trans) (-> self root trans)) + 1.0 ) - ) - (vector-flatten! touched-from-dir touched-from-dir spike-quat) - (set! (-> touched-from-dir y) 0.0) - (vector-normalize! touched-from-dir 1.0) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (the-as uint (-> self attack-id))) - (mode 'deadly) - (shove-up (meters 6)) - (shove-back (meters 4)) - (vector touched-from-dir) - ) - ) - ) - ) - (let ((frame-count (current-time))) - (set! (-> self no-overlap-timer) (the-as uint frame-count)) - frame-count - ) + ) + ) + (vector-flatten! touched-from-dir touched-from-dir spike-quat) + (set! (-> touched-from-dir y) 0.0) + (vector-normalize! touched-from-dir 1.0) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (the-as uint (-> self attack-id))) + (mode 'deadly) + (shove-up (meters 6)) + (shove-back (meters 4)) + (vector touched-from-dir) + ) + ) + ) + ) + (let ((frame-count (current-time))) + (set! (-> self no-overlap-timer) (the-as uint frame-count)) + frame-count ) ) ) ) - ) + ) ) ) :enter (behavior () (set! (-> self no-overlap-timer) (the-as uint 0)) 0 - (none) ) :code (the-as (function none :behavior fort-floor-spike) sleep-code) :post (behavior () @@ -217,7 +213,6 @@ ) ) (transform-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc index f6a4d6e3b49..4507f19416a 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc @@ -447,8 +447,8 @@ ;; failed to figure out what this is: (defstate dormant-aware (gun-buoy) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('kill-player) (logior! (-> self flags) (gun-buoy-flags gubflags-2)) (go-virtual ambush) @@ -459,7 +459,6 @@ (set! (-> self root trans quad) (-> self start-pos quad)) (logclear! (-> self flags) (gun-buoy-flags gubflags-1)) (logclear! (-> self flags) (gun-buoy-flags gubflags-2)) - (none) ) :trans (behavior () (when (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) @@ -471,7 +470,6 @@ ) (go-ambush self) ) - (none) ) ) @@ -549,7 +547,6 @@ ) ) ) - (none) ) :trans (behavior () (when (< (fabs (-> self y-offset)) 409.6) @@ -562,7 +559,6 @@ ) (go-virtual open-guns) ) - (none) ) :code (the-as (function none :behavior gun-buoy) sleep-code) :post (behavior () @@ -591,7 +587,6 @@ (update-vol! (-> self sound) f30-0) ) (gun-buoy-chase-post) - (none) ) ) @@ -600,17 +595,14 @@ :virtual #t :enter (behavior () (logclear! (-> self flags) (gun-buoy-flags gubflags-0)) - (none) ) :exit (behavior () (nav-enemy-method-167 self) - (none) ) :trans (behavior () (if (< (-> self y-offset) -81510.4) (go-virtual dormant-aware) ) - (none) ) :code (the-as (function none :behavior gun-buoy) sleep-code) :post (behavior () @@ -632,7 +624,6 @@ (update-vol! (-> self sound) f30-0) ) (gun-buoy-chase-post) - (none) ) ) @@ -646,7 +637,6 @@ (if (and *target* (< 102400.0 (vector-length (get-transv *target*)))) (go-virtual attack) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -693,7 +683,6 @@ (go-virtual exit-ambush) ) ) - (none) ) :post gun-buoy-chase-post ) @@ -703,7 +692,6 @@ :virtual #t :enter (behavior () (set! (-> self stare-down-timer) (current-time)) - (none) ) :trans (behavior () (let ((v1-0 (-> self focus aware))) @@ -719,7 +707,6 @@ ) ) ) - (none) ) :code (behavior () (sound-play "buoy-guns-in") @@ -736,7 +723,6 @@ ) (set! (-> self gun-elev-jmod mode) (the-as joint-mod-mode #f)) (sleep-code) - (none) ) :post gun-buoy-chase-post ) @@ -744,8 +730,8 @@ ;; failed to figure out what this is: (defstate warning (gun-buoy) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('kill-player) (logior! (-> self flags) (gun-buoy-flags gubflags-2)) (go-virtual attack) @@ -780,14 +766,12 @@ ) (set! (-> self warning-timer) (current-time)) (set! (-> self warning-id) (sound-play "buoy-alarm")) - (none) ) :exit (behavior () (when (nonzero? (-> self warning-id)) (sound-stop (-> self warning-id)) (set! (-> self warning-id) (the-as sound-id -1)) ) - (none) ) :trans (behavior () (let ((gp-0 (-> self focus aware))) @@ -811,7 +795,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior gun-buoy) sleep-code) :post (behavior () @@ -826,7 +809,6 @@ ) ) (gun-buoy-chase-post) - (none) ) ) @@ -851,7 +833,6 @@ (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-7 enemy-flags)))) ) 0 - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) @@ -873,7 +854,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior gun-buoy) sleep-code) :post gun-buoy-chase-post @@ -903,7 +883,6 @@ (go-virtual exit-ambush) ) ) - (none) ) :code (behavior () (dotimes (gp-0 4) @@ -924,7 +903,6 @@ ) ) (go-virtual hostile) - (none) ) :post gun-buoy-chase-post ) @@ -938,7 +916,6 @@ (t9-0) ) ) - (none) ) :code (behavior () (set! *gun-buoy-victory-index* (rand-vu-int-range 0 (+ (-> *gun-buoy-victory-speech* length) -1))) @@ -959,7 +936,6 @@ ) ) (go-virtual exit-ambush) - (none) ) :post gun-buoy-chase-post ) @@ -969,7 +945,6 @@ :virtual #t :code (behavior () (go-virtual idle) - (none) ) ) @@ -1063,13 +1038,11 @@ ) ;; definition for method 70 of type gun-buoy -;; WARN: Return type mismatch object vs none. (defmethod go-hostile gun-buoy ((obj gun-buoy)) (if (logtest? (-> obj flags) (gun-buoy-flags gubflags-1)) (go (method-of-object obj hostile)) (go (method-of-object obj warning)) ) - (none) ) ;; definition for method 61 of type gun-buoy diff --git a/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc index 43773ac815a..6265334df9c 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc @@ -876,7 +876,6 @@ ) ) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy die-falling) trans))) @@ -887,7 +886,6 @@ (if (< (- (current-time) (-> self state-time)) (seconds 2)) (spawn (-> self explode-part) (-> self root trans)) ) - (none) ) :code (behavior () (dotimes (v1-0 4) @@ -936,7 +934,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -970,7 +967,6 @@ ) (ja-channel-push! 1 (seconds 0.1)) (ja :group! spydroid-attack-jump-ja :num! min) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -983,7 +979,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (enemy-method-49 self) @@ -1056,7 +1051,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior spydroid) sleep-code) :post (the-as (function none :behavior spydroid) nav-enemy-chase-post) @@ -1072,7 +1066,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -1135,7 +1128,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -1143,7 +1135,6 @@ (suspend) ) #f - (none) ) ) @@ -1193,7 +1184,6 @@ ) ) ) - (none) ) :code (behavior () (nav-enemy-method-165 self) @@ -1202,7 +1192,6 @@ (suspend) ) #f - (none) ) ) @@ -1252,7 +1241,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -1260,7 +1248,6 @@ (suspend) ) #f - (none) ) ) @@ -1310,7 +1297,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -1318,7 +1304,6 @@ (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc b/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc index 982d977a814..f162872f8a0 100644 --- a/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc @@ -571,7 +571,6 @@ (send-event *traffic-manager* 'add-danger-sphere v1-5) ) ) - (none) ) ) @@ -842,16 +841,13 @@ ;; failed to figure out what this is: (defstate impact (vehicle-grenade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touched) - (if (send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) - #t - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (if (send-event proc 'attack (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) + #t + ) + ) ) ) :code (behavior () @@ -876,7 +872,6 @@ (suspend) ) (deactivate self) - (none) ) ) @@ -995,7 +990,6 @@ :virtual #t :enter (behavior () (go-virtual impact) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc b/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc index 2ebe98f1673..1046823f1b1 100644 --- a/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc @@ -792,8 +792,8 @@ ;; failed to figure out what this is: (defstate impact (metalhead-grenade-shot) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (let* ((s4-0 proc) (v1-1 (if (type? s4-0 process-drawable) @@ -821,7 +821,7 @@ (set! (-> v1-6 action-mask) (collide-action solid)) ) (when (< (fill-and-probe-using-line-sphere *collide-cache* a1-3) 0.0) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) (let ((v1-15 (-> self notify-handle))) (if (handle->process v1-15) (send-event (-> v1-15 process 0) 'notify 'attack proc) @@ -860,7 +860,6 @@ (suspend) ) (deactivate self) - (none) ) ) @@ -869,7 +868,6 @@ :virtual #t :enter (behavior () (go-virtual impact) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc index cc276bf87fa..fcbef0a64f3 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc @@ -1395,7 +1395,6 @@ ) ) (go-virtual active) - (none) ) ) @@ -1471,7 +1470,6 @@ ) ) ) - (none) ) ) @@ -1528,11 +1526,9 @@ (suspend) ) #f - (none) ) :post (behavior () (update self) - (none) ) ) @@ -1572,11 +1568,9 @@ (suspend) ) #f - (none) ) :post (behavior () (update self) - (none) ) ) @@ -1593,7 +1587,6 @@ (suspend) ) #f - (none) ) ) @@ -1602,7 +1595,6 @@ :virtual #t :code (behavior () '() - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-obs_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-obs_REF.gc index ec4724e4269..b0bcb4b832a 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-obs_REF.gc @@ -53,7 +53,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior race-signal-banner) ja-post) ) @@ -193,7 +192,6 @@ ) (ja :num-func num-func-identity :frame-num (ja-aframe 0.0 0)) (go-virtual idle) - (none) ) ) @@ -204,7 +202,6 @@ :code (the-as (function none :behavior race-signal) sleep-code) :post (behavior () (race-signal-method-29 self) - (none) ) ) @@ -224,11 +221,9 @@ (suspend) ) #f - (none) ) :post (behavior () (race-signal-method-29 self) - (none) ) ) @@ -248,11 +243,9 @@ (suspend) ) #f - (none) ) :post (behavior () (race-signal-method-29 self) - (none) ) ) @@ -272,11 +265,9 @@ (suspend) ) #f - (none) ) :post (behavior () (race-signal-method-29 self) - (none) ) ) @@ -317,7 +308,6 @@ (suspend) ) #f - (none) ) :post (behavior () (let ((f30-0 (* 0.0033333334 (the float (- (current-time) (-> self start-time)))))) @@ -327,7 +317,6 @@ ) ) (race-signal-method-29 self) - (none) ) ) @@ -336,7 +325,6 @@ :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -393,11 +381,9 @@ ) ) #f - (none) ) :post (behavior () (race-signal-method-29 self) - (none) ) ) @@ -664,11 +650,9 @@ ) ) (go-virtual active) - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -700,7 +684,6 @@ :enter (behavior () (format #t "errol-rider::taunt race-errol-pass~%") (speech-control-method-12 *speech-control* self (speech-type speech-type-53)) - (none) ) ) @@ -710,7 +693,6 @@ :enter (behavior () (format #t "errol-rider::got-passed~%") (speech-control-method-12 *speech-control* self (speech-type speech-type-54)) - (none) ) ) @@ -796,8 +778,8 @@ ;; failed to figure out what this is: (defstate idle (turbo-pickup) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (when (-> self available) (when (send-event proc 'turbo-pickup) @@ -812,7 +794,6 @@ :post (behavior () (spawn (-> self part) (-> self root trans)) 0 - (none) ) ) @@ -864,7 +845,6 @@ (until (>= (- (current-time) (-> self state-time)) (seconds 2)) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/race/vehicle-racer_REF.gc b/test/decompiler/reference/jak2/levels/common/race/vehicle-racer_REF.gc index f530b3d9839..8597e12e897 100644 --- a/test/decompiler/reference/jak2/levels/common/race/vehicle-racer_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/vehicle-racer_REF.gc @@ -417,143 +417,124 @@ ) ;; definition for method 46 of type vehicle-racer -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 16] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 43] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 49] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 108] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 156] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 166] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 275] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 295] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 318] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 324] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 329] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 219] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 242] ;; WARN: disable def twice: 12. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod rigid-body-object-method-46 vehicle-racer ((obj vehicle-racer) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'test-ready) - (and (and (-> obj next-state) (= (-> obj next-state name) 'waiting-for-start)) - (logtest? (-> obj flags) (rigid-body-object-flag riding)) - ) - ) - ((= v1-0 'begin-race) - (logclear! (-> obj focus-status) (focus-status grabbed)) - (when (and (-> obj next-state) (= (-> obj next-state name) 'waiting-for-start)) - (cond - ((logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag player-grabbed))) - ) - (go (method-of-object obj player-control)) - ) - (else - (go (method-of-object obj racing)) - ) - ) + (case arg2 + (('test-ready) + (and (and (-> obj next-state) (= (-> obj next-state name) 'waiting-for-start)) + (logtest? (-> obj flags) (rigid-body-object-flag riding)) + ) + ) + (('begin-race) + (logclear! (-> obj focus-status) (focus-status grabbed)) + (when (and (-> obj next-state) (= (-> obj next-state name) 'waiting-for-start)) + (cond + ((logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (set! (-> obj flags) + (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag player-grabbed))) + ) + (go (method-of-object obj player-control)) + ) + (else + (go (method-of-object obj racing)) ) ) - ((= v1-0 'turbo-pickup) - (when (< (-> obj turbo-pickup-count) 3) - (sound-play "turbo-pickup") - (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (sound-play "turbo-pickup-pl") - (send-event *target* 'color-effect 'eco-pill-dark (seconds 0.2)) - ) - (+! (-> obj turbo-pickup-count) 1) - #t - ) + ) + ) + (('turbo-pickup) + (when (< (-> obj turbo-pickup-count) 3) + (sound-play "turbo-pickup") + (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (sound-play "turbo-pickup-pl") + (send-event *target* 'color-effect 'eco-pill-dark (seconds 0.2)) ) - ((= v1-0 'race-decision-point) - (when (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) - (let* ((v1-37 (the-as race-decision-point (-> arg3 param 0))) - (a0-16 (-> v1-37 decision-type)) - ) - (cond - ((zero? a0-16) - (cond - ((and (nonzero? (-> v1-37 shortcuts)) - (>= (-> obj race racer-state speed-factor) (-> obj race state info ai-max-speed-factor)) - (< 0.1 (- (+ (-> obj race state target-pos) (-> obj race racer-state target-pos-offset)) - (-> obj race racer-state pos) - ) - ) - ) - (select-path-randomly-from-mask obj (-> v1-37 shortcuts)) - (set! (-> obj shortcut-time) (current-time)) - (set! (-> obj shortcut-speed-factor) 1.0) - ) - (else - (select-path-randomly-from-mask obj (-> v1-37 safe-paths)) - (set! (-> obj shortcut-speed-factor) 0.0) + (+! (-> obj turbo-pickup-count) 1) + #t + ) + ) + (('race-decision-point) + (when (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) + (let* ((v1-37 (the-as race-decision-point (-> arg3 param 0))) + (a0-16 (-> v1-37 decision-type)) + ) + (cond + ((zero? a0-16) + (cond + ((and (nonzero? (-> v1-37 shortcuts)) + (>= (-> obj race racer-state speed-factor) (-> obj race state info ai-max-speed-factor)) + (< 0.1 (- (+ (-> obj race state target-pos) (-> obj race racer-state target-pos-offset)) + (-> obj race racer-state pos) + ) + ) ) - ) - ) - ((= a0-16 1) - (when (and (> (-> obj turbo-pickup-count) 0) - (< (-> obj path-deviation) 1.0) - (>= (-> obj race racer-state speed-factor) (-> obj race state info ai-max-speed-factor)) - ) - (rigid-body-object-method-38 obj) - (vehicle-method-66 obj) - ) - ) + (select-path-randomly-from-mask obj (-> v1-37 shortcuts)) + (set! (-> obj shortcut-time) (current-time)) + (set! (-> obj shortcut-speed-factor) 1.0) ) - ) + (else + (select-path-randomly-from-mask obj (-> v1-37 safe-paths)) + (set! (-> obj shortcut-speed-factor) 0.0) + ) + ) + ) + ((= a0-16 1) + (when (and (> (-> obj turbo-pickup-count) 0) + (< (-> obj path-deviation) 1.0) + (>= (-> obj race racer-state speed-factor) (-> obj race state info ai-max-speed-factor)) + ) + (rigid-body-object-method-38 obj) + (vehicle-method-66 obj) + ) + ) ) ) - ((= v1-0 'hide) - (logior! (-> obj draw status) (draw-control-status no-draw)) - (send-event (ppointer->process (-> obj child)) 'hide) - ) - ((= v1-0 'unhide) - (logclear! (-> obj draw status) (draw-control-status no-draw)) - (send-event (ppointer->process (-> obj child)) 'unhide) - ) - ((= v1-0 'race-pass) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (speech-control-method-12 *speech-control* obj (if (-> *target* pilot as-daxter?) - (speech-type speech-type-45) - (speech-type speech-type-36) - ) - ) - (send-event (ppointer->process (-> obj child)) 'race-pass) - ) + ) + ) + (('hide) + (logior! (-> obj draw status) (draw-control-status no-draw)) + (send-event (ppointer->process (-> obj child)) 'hide) + ) + (('unhide) + (logclear! (-> obj draw status) (draw-control-status no-draw)) + (send-event (ppointer->process (-> obj child)) 'unhide) + ) + (('race-pass) + (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (speech-control-method-12 *speech-control* obj (if (-> *target* pilot as-daxter?) + (speech-type speech-type-45) + (speech-type speech-type-36) + ) + ) + (send-event (ppointer->process (-> obj child)) 'race-pass) ) - ((= v1-0 'race-got-passed) - (if (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) - (send-event (ppointer->process (-> obj child)) 'race-got-passed) - ) + ) + (('race-got-passed) + (if (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) + (send-event (ppointer->process (-> obj child)) 'race-got-passed) ) - ((= v1-0 'race-finished) - (let ((s5-2 (-> arg3 param 0))) - (select-path-randomly-from-mask obj s5-2) - (set! (-> obj damage-factor) 0.0) - (cond - ((logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag player-grabbed) (-> obj flags))) - ) - (when (zero? s5-2) - (set! (-> obj race path) #f) - #f + ) + (('race-finished) + (let ((s5-2 (-> arg3 param 0))) + (select-path-randomly-from-mask obj s5-2) + (set! (-> obj damage-factor) 0.0) + (cond + ((logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (set! (-> obj flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag player-grabbed) (-> obj flags))) ) - ) - (else - (go (method-of-object obj race-finished)) - ) - ) + (when (zero? s5-2) + (set! (-> obj race path) #f) + #f + ) + ) + (else + (go (method-of-object obj race-finished)) ) ) - (else - ((method-of-type vehicle rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) - ) - ) + ) + ) + (else + ((method-of-type vehicle rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) ) ) ) @@ -1007,7 +988,6 @@ 0 ) ) - (none) ) :exit (behavior () (set! (-> self hit-points) 1.0) @@ -1030,7 +1010,6 @@ (set! (-> v1-4 prim-core collide-as) (collide-spec vehicle-sphere)) ) ) - (none) ) :trans (the-as (function none :behavior vehicle-racer) #f) :code (the-as (function none :behavior vehicle-racer) sleep-code) @@ -1045,7 +1024,6 @@ (update-transforms (-> self root)) (vehicle-method-119 self) (rigid-body-object-method-39 self) - (none) ) ) @@ -1061,7 +1039,6 @@ (set! (-> self damage-factor) (-> self info damage-factor)) (vehicle-method-143 self) (logior! (-> self flags) (rigid-body-object-flag ignition)) - (none) ) :code (the-as (function none :behavior vehicle-racer) sleep-code) :post (behavior () @@ -1075,7 +1052,6 @@ (clear-momentum! (-> self rbody state)) (vehicle-method-120 self) (vehicle-method-119 self) - (none) ) ) @@ -1092,7 +1068,6 @@ (set! (-> self controls throttle) 0.0) (set! (-> self controls brake) 0.0) (set! (-> self controls steering) 0.0) - (none) ) :exit (behavior () (logclear! (-> self flags) (rigid-body-object-flag waiting-for-player)) @@ -1114,13 +1089,11 @@ (set! (-> v1-3 prim-core collide-as) (collide-spec vehicle-sphere)) ) ) - (none) ) :trans (the-as (function none :behavior vehicle-racer) #f) :code (the-as (function none :behavior vehicle-racer) sleep-code) :post (behavior () (vehicle-racer-method-152 self) - (none) ) ) @@ -1141,12 +1114,10 @@ (set! (-> self controls throttle) 0.0) (set! (-> self controls brake) 0.0) (set! (-> self controls steering) 0.0) - (none) ) :trans (the-as (function none :behavior vehicle-racer) #f) :code (the-as (function none :behavior vehicle-racer) sleep-code) :post (behavior () (vehicle-racer-method-155 self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc b/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc index 034312521e2..1f62d3a28f1 100644 --- a/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc @@ -391,7 +391,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior metalkor-highres) ja-post) ) @@ -1038,7 +1037,6 @@ This commonly includes things such as: ) (process-taskable-anim-loop (lambda ((arg0 process-taskable)) (handle->process (-> arg0 slave)))) (go-virtual idle) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/scene-looper_REF.gc b/test/decompiler/reference/jak2/levels/common/scene-looper_REF.gc index af487c7bc9f..da7cd12e744 100644 --- a/test/decompiler/reference/jak2/levels/common/scene-looper_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/scene-looper_REF.gc @@ -36,7 +36,6 @@ :virtual #t :exit (behavior () (kill-by-type scene-player *active-pool*) - (none) ) :code (behavior () (until #f @@ -51,7 +50,6 @@ ) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc b/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc index 7dc48506a12..a2491f2507b 100644 --- a/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc @@ -553,8 +553,8 @@ ;; failed to figure out what this is: (defstate idle (warp-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('hide) (go-virtual hidden) ) @@ -650,39 +650,35 @@ (ja :num! (loop! (-> self anim-speed))) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate use (warp-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('effect) - (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 130) - 0 - #f - #f - #f - (-> self node-list data 4 bone transform) - :to *entity-pool* - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('effect) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 130) + 0 + #f + #f + #f + (-> self node-list data 4 bone transform) + :to *entity-pool* + ) + ) + ) ) :exit (behavior () (remove-setting! 'mode-name) (remove-setting! 'interp-time) - (none) ) :trans (behavior () (send-event *camera* 'joystick 0.0 0.0) - (none) ) :code (behavior ((arg0 continue-point)) (local-vars (v1-38 symbol)) @@ -757,7 +753,6 @@ ) (logior! (-> self mask) (process-mask actor-pause)) (go-virtual idle) - (none) ) ) @@ -870,8 +865,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate target-warp-out (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('death-end) (let ((v0-0 (the-as object (logior (-> self draw status) (draw-control-status no-draw))))) (set! (-> self draw status) (the-as draw-control-status v0-0)) @@ -884,7 +879,7 @@ This commonly includes things such as: ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -905,11 +900,9 @@ This commonly includes things such as: (vector-! (new 'stack-no-clear 'vector) arg1 (-> self control trans)) (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) ) - (none) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags sf6)) - (none) ) :code (behavior ((arg0 vector) (arg1 vector) (arg2 target)) (ja-channel-push! 1 (seconds 0.2)) @@ -1004,7 +997,6 @@ This commonly includes things such as: (ja :num! (seek! (ja-aframe 40.0 0))) ) (sleep-code) - (none) ) :post target-no-stick-post ) @@ -1015,7 +1007,6 @@ This commonly includes things such as: :enter (behavior ((arg0 vector) (arg1 vector) (arg2 target)) (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float arg2)) ((-> target-warp-out enter) arg0 arg1 arg2) - (none) ) :exit (-> target-warp-out exit) :trans (behavior () @@ -1028,7 +1019,6 @@ This commonly includes things such as: (if (logtest? (-> self control status) (collide-status on-surface)) (go target-hit-ground #f) ) - (none) ) :code (behavior ((arg0 vector) (arg1 vector) (arg2 target)) (let ((a0-1 (-> self control did-move-to-pole-or-max-jump-height))) @@ -1142,7 +1132,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (target-falling-anim -1 (seconds 0.33)) - (none) ) :post target-no-move-post ) @@ -1324,7 +1313,6 @@ This commonly includes things such as: ) ) (sound-play "air-train" :id (-> self hover-sound) :position (-> self root trans)) - (none) ) ) @@ -1347,7 +1335,6 @@ This commonly includes things such as: (set! (-> self hover-sound) (new 'static 'sound-id)) (script-eval (-> self on-activate)) (sleep-code) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/consite/consite-obs_REF.gc b/test/decompiler/reference/jak2/levels/consite/consite-obs_REF.gc index 9382242693c..13a3906157f 100644 --- a/test/decompiler/reference/jak2/levels/consite/consite-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/consite/consite-obs_REF.gc @@ -118,7 +118,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior consite-bomb-elevator-hinges) ja-post) ) @@ -210,7 +209,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior consite-bomb-elevator) ja-post) ) @@ -308,7 +306,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior consite-silo-doors) ja-post) ) @@ -420,7 +417,3 @@ This commonly includes things such as: 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc b/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc index 3c2b51dad14..4d1b137a1a0 100644 --- a/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc @@ -384,7 +384,7 @@ ) (send-event (handle->process (-> *game-info* controller 0)) 'pause) (time-of-day-setup #t) - (the-as object (remove-setting! 'half-speed)) + (remove-setting! 'half-speed) ) ) ) @@ -581,16 +581,15 @@ ;; failed to figure out what this is: (defstate idle (demo-control) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('pause) - (let ((v0-0 2)) - (set! (-> *game-info* demo-state) (the-as uint v0-0)) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pause) + (let ((v0-0 2)) + (set! (-> *game-info* demo-state) (the-as uint v0-0)) + v0-0 + ) + ) + ) ) :code (behavior () (let ((v1-1 (-> *game-info* demo-state))) @@ -889,7 +888,6 @@ ) ) (sleep-code) - (none) ) :post (behavior () (local-vars (v1-70 external-art-buffer)) @@ -1010,7 +1008,6 @@ ) ) ) - (none) ) ) @@ -1099,12 +1096,12 @@ ;; failed to figure out what this is: (defstate target-demo (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('grab) - (if (not (-> event param 1)) + (if (not (-> block param 1)) #t (go target-grab 'stance) ) @@ -1112,7 +1109,7 @@ ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -1136,7 +1133,6 @@ (ppointer->handle (process-spawn demo-control :init demo-control-init :to *entity-pool*)) ) ) - (none) ) :code (the-as (function symbol none :behavior target) sleep-code) :post target-no-move-post diff --git a/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc index 3ece567ec07..16c9280b7d8 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc @@ -621,13 +621,12 @@ ;; failed to figure out what this is: (defstate broken (dig-clasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('broken?) - #t - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('broken?) + #t + ) + ) ) :enter (behavior () (when (-> self conn) @@ -649,7 +648,6 @@ ) ) (ja-post) - (none) ) :code (the-as (function none :behavior dig-clasp) sleep-code) ) @@ -657,13 +655,12 @@ ;; failed to figure out what this is: (defstate break-it (dig-clasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('broken?) - #t - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('broken?) + #t + ) + ) ) :enter (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) @@ -690,7 +687,6 @@ :to self ) ) - (none) ) :trans (behavior () (ja :num! (seek!)) @@ -700,7 +696,6 @@ (if (ja-done? 0) (go-virtual broken) ) - (none) ) :code (the-as (function none :behavior dig-clasp) sleep-code) :post (the-as (function none :behavior dig-clasp) ja-post) @@ -709,13 +704,13 @@ ;; failed to figure out what this is: (defstate idle (dig-clasp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('tether-position) - (dig-clasp-method-23 self (the-as vector (-> event param 0))) + (dig-clasp-method-23 self (the-as vector (-> block param 0))) ) (('attack) - (let ((v1-2 (the-as attack-info (-> event param 1)))) + (let ((v1-2 (the-as attack-info (-> block param 1)))) (when (and (logtest? (-> v1-2 mask) (attack-mask mode)) (= (-> v1-2 mode) 'board)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 85 (seconds 0.1)) (go-virtual break-it) @@ -729,7 +724,6 @@ ) :enter (behavior () (ja-post) - (none) ) :code (the-as (function none :behavior dig-clasp) sleep-code) ) @@ -1081,39 +1075,36 @@ This commonly includes things such as: ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs object. (defbehavior dig-tether-handler dig-tether ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('set-pos) - (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> self digger-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) - (let ((v0-0 (-> self digger-vertical))) - (set! (-> v0-0 quad) (-> (the-as vector (-> arg3 param 2)) quad)) - v0-0 - ) - ) - ) - ) + (case arg2 + (('set-pos) + (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set! (-> self digger-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (let ((v0-0 (-> self digger-vertical))) + (set! (-> v0-0 quad) (-> (the-as vector (-> arg3 param 2)) quad)) + v0-0 + ) + ) + ) ) ;; failed to figure out what this is: (defstate broken (dig-tether) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('broken?) #t ) (else - (dig-tether-handler proc arg1 event-type event) + (dig-tether-handler proc argc message block) ) ) ) :enter (behavior () (dig-tether-method-23 self) - (none) ) :trans (behavior () (dig-tether-method-24 self) - (none) ) :code (the-as (function none :behavior dig-tether) sleep-code) :post (the-as (function none :behavior dig-tether) ja-post) @@ -1128,7 +1119,6 @@ This commonly includes things such as: (set-params! (-> self frame) 0.5 0.01 0.02 0.97) (set-params! (-> self frame-kicker) 9 30 0.4) (set! (-> self old-dist) 0.0) - (none) ) :trans (behavior () (dig-tether-method-22 self) @@ -1159,7 +1149,6 @@ This commonly includes things such as: (update! (-> self frame) (-> self frame-kicker value)) (ja :num-func num-func-identity :frame-num (* 10.0 (-> self frame value))) ) - (none) ) :code (the-as (function none :behavior dig-tether) sleep-code) :post (the-as (function none :behavior dig-tether) ja-post) @@ -1419,11 +1408,11 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (dig-digger) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape (-> self root)) (the-as uint 1) ) @@ -1433,7 +1422,7 @@ This commonly includes things such as: ) ) (when a0-7 - (if (send-event a0-7 'attack (-> event param 0) (static-attack-info ((id (new-attack-id))))) + (if (send-event a0-7 'attack (-> block param 0) (static-attack-info ((id (new-attack-id))))) #f ) ) @@ -1456,14 +1445,12 @@ This commonly includes things such as: (dig-digger-method-23 self) (set! (-> self motor-sound) (new-sound-id)) (set! (-> self bit-sound) (new-sound-id)) - (none) ) :exit (behavior () (sound-stop (-> self motor-sound)) (sound-stop (-> self bit-sound)) (send-event (handle->process (-> self hud-counter)) 'hide-and-die) (set! (-> self hud-counter) (the-as handle #f)) - (none) ) :trans (behavior () (let ((f0-0 (vector-vector-distance-squared (ear-trans 0) (-> self root trans))) @@ -1515,27 +1502,24 @@ This commonly includes things such as: (if (nonzero? (-> self part)) (spawn (-> self part) (-> self root trans)) ) - (none) ) :code (the-as (function none :behavior dig-digger) sleep-code) :post (behavior () (transform-post) (dig-digger-method-24 self) - (none) ) ) ;; failed to figure out what this is: (defstate hidden (dig-digger) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v1-0 message) (a0-1 'explode) ) - (the-as object (if (= v1-0 a0-1) - (set-dig1-explosion! (the-as float a0-1)) - ) - ) + (if (= v1-0 a0-1) + (set-dig1-explosion! (the-as float a0-1)) + ) ) ) :enter (behavior () @@ -1543,7 +1527,6 @@ This commonly includes things such as: (deactivate (-> self child 0)) ) (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior dig-digger) sleep-code) ) diff --git a/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc index 3f49a01d47a..7fe287de157 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc @@ -259,13 +259,13 @@ ;; failed to figure out what this is: (defstate idle (dig-sinking-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (set! (-> self last-ridden-time) (current-time)) ) ) - (rigid-body-object-event-handler proc arg1 event-type event) + (rigid-body-object-event-handler proc argc message block) ) ) @@ -626,11 +626,9 @@ :virtual #t :enter (behavior () (set-setting! 'ignore-target #t 0.0 0) - (none) ) :exit (behavior () (remove-setting! 'ignore-target) - (none) ) :code (behavior () (local-vars (v1-12 object)) @@ -731,7 +729,6 @@ (suspend) ) (go-virtual idle) - (none) ) :post (the-as (function none :behavior dig-log) transform-post) ) @@ -855,17 +852,14 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle-up (dig-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (when (logtest? (-> (the-as attack-info (-> event param 1)) penetrate-using) (penetrate flop)) - (go-virtual going-down) - #f - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (logtest? (-> (the-as attack-info (-> block param 1)) penetrate-using) (penetrate flop)) + (go-virtual going-down) + #f ) - ) + ) ) ) :code (behavior () @@ -873,7 +867,6 @@ This commonly includes things such as: (suspend) (transform-post) (sleep-code) - (none) ) ) @@ -896,7 +889,6 @@ This commonly includes things such as: ) ) (go-virtual idle-down) - (none) ) ) @@ -909,7 +901,6 @@ This commonly includes things such as: (suspend) (transform-post) (sleep-code) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc index d81311e337b..6d2c36b33d8 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc @@ -454,7 +454,6 @@ :virtual #t :code (behavior () (go-virtual die) - (none) ) ) @@ -469,7 +468,6 @@ ) (set! (-> self flash-counter) 0) 0 - (none) ) :trans (behavior () (let ((v1-2 (ja-group))) @@ -505,7 +503,6 @@ ) ) ) - (none) ) :code (behavior () (let ((f30-0 (rand-vu-float-range 0.22 0.27))) @@ -637,7 +634,6 @@ ) ) (go-virtual die) - (none) ) ) @@ -652,7 +648,6 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (behavior () (sound-play "dig-bomb-explo") @@ -671,7 +666,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -984,8 +978,8 @@ ;; failed to figure out what this is: (defstate idle (dig-bomb-crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual die) @@ -1019,7 +1013,6 @@ (dig-bomb-crate-method-29 self (get-trans a0-4 0)) ) ) - (none) ) :code (behavior () (suspend) @@ -1057,7 +1050,6 @@ ) ) (cleanup-for-death self) - (none) ) ) @@ -1243,6 +1235,5 @@ This commonly includes things such as: ((the-as (function none) t9-6)) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/dig/dig2-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig2-obs_REF.gc index a599eea7e17..909093b32eb 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig2-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig2-obs_REF.gc @@ -49,7 +49,6 @@ (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc index be9c6ddc9f0..3da7979f6eb 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc @@ -339,7 +339,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a2-1 (quaternion-vector-angle! @@ -352,7 +351,6 @@ (quaternion*! (-> self root quat) (-> self init-quat) a2-1) ) (rider-post) - (none) ) ) @@ -479,7 +477,6 @@ This commonly includes things such as: ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (behavior () (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -504,7 +501,6 @@ This commonly includes things such as: ((the-as (function none) t9-7)) ) ) - (none) ) ) @@ -752,7 +748,6 @@ This commonly includes things such as: (go-virtual active) ) ) - (none) ) :code (the-as (function none :behavior dig-spikey-sphere-door) sleep-code) ) @@ -804,7 +799,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (go-virtual idle) - (none) ) :post (the-as (function none :behavior dig-spikey-sphere-door) ja-post) ) @@ -1025,7 +1019,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior dig-balloon-lurker-trapeze) ja-post) ) @@ -1314,7 +1307,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior dig-balloon-lurker) transform-post) ) @@ -1360,7 +1352,6 @@ This commonly includes things such as: :trans (behavior () (sound-play "wheel-plat-loop" :id (-> self wheel-sound-id)) (rider-trans) - (none) ) :code (behavior () (until #f @@ -1374,7 +1365,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior dig-wheel-step) rider-post) ) @@ -1566,19 +1556,18 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (dig-tipping-rock) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (set! (-> self last-ridden-time) (current-time)) ) ) - (rigid-body-object-event-handler proc arg1 event-type event) + (rigid-body-object-event-handler proc argc message block) ) :trans (the-as (function none :behavior dig-tipping-rock) rider-trans) :code (the-as (function none :behavior dig-tipping-rock) sleep-code) :post (behavior () (rigid-body-object-method-37 self) - (none) ) ) @@ -1837,8 +1826,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate waiting (dig-stomp-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('set-flag) (let ((v0-0 (the-as object #t))) (set! (-> self flag) (the-as basic v0-0)) @@ -1850,7 +1839,7 @@ This commonly includes things such as: #f ) (('attack) - (case (-> (the-as attack-info (-> event param 1)) mode) + (case (-> (the-as attack-info (-> block param 1)) mode) (('flop) (when (not (-> self flag)) (set! (-> self desty) (+ -12288.0 (-> self root trans y))) @@ -1873,8 +1862,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate hit (dig-stomp-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('broken) (go-virtual active) ) @@ -1891,7 +1880,6 @@ This commonly includes things such as: (set! (-> self flag) #f) (send-event (ppointer->process (-> self parent)) 'clear-flag) (go-virtual waiting) - (none) ) :post (the-as (function none :behavior dig-stomp-block) transform-post) ) @@ -1913,7 +1901,6 @@ This commonly includes things such as: (set! (-> gp-0 z) (rand-vu-float-range -10000.0 10000.0)) (vector-float*! (-> self rbody state ang-momentum) gp-0 (-> self info info mass)) ) - (none) ) ) @@ -2127,26 +2114,25 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (dig-stomp-block-controller) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('set-flag) - (dotimes (gp-0 4) - (if (-> self stomp-blocks gp-0) - (send-event (ppointer->process (-> self stomp-blocks gp-0)) 'set-flag) - ) - ) - #f - ) - (('clear-flag) - (dotimes (gp-1 4) - (if (-> self stomp-blocks gp-1) - (send-event (ppointer->process (-> self stomp-blocks gp-1)) 'clear-flag) - ) - ) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('set-flag) + (dotimes (gp-0 4) + (if (-> self stomp-blocks gp-0) + (send-event (ppointer->process (-> self stomp-blocks gp-0)) 'set-flag) + ) + ) + #f + ) + (('clear-flag) + (dotimes (gp-1 4) + (if (-> self stomp-blocks gp-1) + (send-event (ppointer->process (-> self stomp-blocks gp-1)) 'clear-flag) + ) + ) + #f + ) + ) ) :enter (behavior () (change-parent self *pusher-pool*) @@ -2157,7 +2143,6 @@ This commonly includes things such as: (set! (-> self stomp-blocks s5-0) (process-spawn dig-stomp-block gp-0 :to self)) ) ) - (none) ) :code (the-as (function none :behavior dig-stomp-block-controller) sleep-code) :post (behavior () @@ -2189,7 +2174,6 @@ This commonly includes things such as: ) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc index 58b1b1093e1..4dfba0a3526 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc @@ -1294,7 +1294,6 @@ This commonly includes things such as: (suspend) (ja :num! (seek!)) ) - (none) ) :post (the-as (function none :behavior drill-barons-ship-explode) ja-post) ) @@ -1302,8 +1301,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate hidden (drill-barons-ship) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger-back) (set! (-> self pass) 1) (dotimes (gp-0 (length *ship-turrets-first-pass*)) @@ -1344,7 +1343,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (cond @@ -1379,7 +1377,6 @@ This commonly includes things such as: #f ) ) - (none) ) :post (behavior () (set! (-> self current-y-position) @@ -1398,21 +1395,19 @@ This commonly includes things such as: ) (drill-barons-ship-method-22 self) (transform-post) - (none) ) ) ;; failed to figure out what this is: (defstate idle (drill-barons-ship) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('pass-complete?) - (set! (-> self end-of-pass) #t) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pass-complete?) + (set! (-> self end-of-pass) #t) + #f + ) + ) ) :enter (behavior () (set-setting! 'music 'danger4 0.0 0) @@ -1427,11 +1422,9 @@ This commonly includes things such as: (set! (-> self inc-y) 2048.0) (set! (-> self ease-y) 40960.0) (set! (-> self end-of-pass) #f) - (none) ) :exit (behavior () (remove-setting! 'music) - (none) ) :code (behavior () (until #f @@ -1439,7 +1432,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (let ((gp-0 (if (= (-> self pass) 1) @@ -1521,7 +1513,6 @@ This commonly includes things such as: (drill-barons-ship-method-22 self) (+! (-> self x-offset-angle) (* 0.7 (-> self clock time-adjust-ratio))) (transform-post) - (none) ) ) @@ -1644,7 +1635,6 @@ This commonly includes things such as: ) 0 (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (vector<-cspace! @@ -1659,7 +1649,6 @@ This commonly includes things such as: ) (go-virtual going-down) ) - (none) ) :code (behavior () (until #f @@ -1667,11 +1656,9 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (transform-post) - (none) ) ) @@ -1770,7 +1757,6 @@ This commonly includes things such as: ) ) ) - (none) ) :trans (behavior () (vector<-cspace! @@ -1783,7 +1769,6 @@ This commonly includes things such as: ) (go-virtual dead) ) - (none) ) :code (behavior () (until #f @@ -1791,11 +1776,9 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (transform-post) - (none) ) ) @@ -1835,8 +1818,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate attack (drill-barons-ship-turret) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (when (and (-> self info alive) (= (-> self anim-frame) 1.0)) (+! (-> self hit-count) 1) @@ -1967,7 +1950,6 @@ This commonly includes things such as: (if (zero? (-> self info mesh)) (set! (-> self soundid) (sound-play "ship-gun1-chain")) ) - (none) ) :exit (behavior () (if (zero? (-> self info mesh)) @@ -1989,7 +1971,6 @@ This commonly includes things such as: (sound-play "ship-gun1-down") ) ) - (none) ) :code (behavior () (cond @@ -2027,7 +2008,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (drill-barons-ship-turret-method-24 self) @@ -2133,7 +2113,6 @@ This commonly includes things such as: (go-virtual idle) ) (transform-post) - (none) ) ) @@ -2143,7 +2122,6 @@ This commonly includes things such as: :enter (behavior () (set! (-> self hit-count) 0) 0 - (none) ) :code (behavior () (until #f @@ -2170,7 +2148,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (cond @@ -2185,6 +2162,5 @@ This commonly includes things such as: ) ) (transform-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-mech-master_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-mech-master_REF.gc index 00e04b57809..724525e76bd 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-mech-master_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-mech-master_REF.gc @@ -181,7 +181,6 @@ (set! (-> self next-warn-time) (+ (current-time) (seconds 10))) (talker-spawn-func (-> *talker-speech* 182) *entity-pool* (target-pos 0) (the-as region #f)) ) - (none) ) :code (the-as (function none :behavior drill-mech-master) sleep-code) ) @@ -211,7 +210,6 @@ ) ) (go-virtual hostile) - (none) ) ) @@ -225,7 +223,6 @@ (set! (-> self next-warn-time) (+ (current-time) (seconds 1))) (set! (-> self started-timer-time) (current-time)) (set! (-> self exited?) #f) - (none) ) :trans (behavior () (if (and (-> self exited?) (process-grab? *target* #f)) @@ -259,12 +256,10 @@ ) ) ) - (none) ) :code (behavior () (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to self))) (sleep-code) - (none) ) ) @@ -276,13 +271,11 @@ (set! (-> self state-time) (current-time)) (set-setting! 'allow-pause #f 0.0 0) (set-setting! 'allow-progress #f 0.0 0) - (none) ) :exit (behavior () (disable *screen-filter*) (remove-setting! 'allow-pause) (remove-setting! 'allow-progress) - (none) ) :trans (behavior () (when (and (not (-> self killed-jak?)) @@ -298,7 +291,6 @@ (bucket-id tex-all-map) ) ) - (none) ) :code (behavior () (remove-setting! 'music) @@ -342,7 +334,6 @@ ) ) (sleep-code) - (none) ) ) @@ -364,7 +355,6 @@ ) (process-release? *target*) (sleep-code) - (none) ) ) @@ -448,7 +438,7 @@ TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () (let ((v0-3 (ppointer->handle (process-spawn drill-mech-master :to self)))) (set! (-> self slave 0) (the-as handle v0-3)) - (the-as object v0-3) + v0-3 ) ) ) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-obs2_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-obs2_REF.gc index 6cac932b16d..21fcc46dcbb 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-obs2_REF.gc @@ -41,8 +41,8 @@ ;; failed to figure out what this is: (defstate down (drill-flip-step) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual swing-up) ) @@ -50,7 +50,7 @@ #t ) (('query) - (case (-> event param 0) + (case (-> block param 0) (('arrived?) #t ) @@ -63,20 +63,19 @@ (ja :group! (-> self draw art-group data 2) :num! min) (transform-post) (sleep-code) - (none) ) ) ;; failed to figure out what this is: (defstate up (drill-flip-step) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go-virtual swing-down) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -85,7 +84,6 @@ (ja-channel-push! 1 0) (ja :group! (-> self draw art-group data 3) :num! min) (sleep-code) - (none) ) :post (the-as (function none :behavior drill-flip-step) plat-post) ) @@ -96,7 +94,6 @@ :event (the-as (function process int symbol event-message-block object :behavior drill-flip-step) plat-event) :enter (behavior () (process-entity-status! self (entity-perm-status bit-12) #f) - (none) ) :trans (behavior () (if (>= (ja-aframe-num 0) 67.5) @@ -104,7 +101,6 @@ (logclear! (-> self root root-prim prim-core action) (collide-action rideable)) ) (plat-trans) - (none) ) :code (behavior () (logclear! (-> self root root-prim prim-core action) (collide-action rideable)) @@ -117,7 +113,6 @@ (ja :num! (seek! max 0.75)) ) (go-virtual down) - (none) ) :post (the-as (function none :behavior drill-flip-step) plat-post) ) @@ -128,7 +123,6 @@ :event (the-as (function process int symbol event-message-block object :behavior drill-flip-step) plat-event) :enter (behavior () (process-entity-status! self (entity-perm-status bit-12) #t) - (none) ) :trans (behavior () (if (>= (ja-aframe-num 0) 26.0) @@ -136,7 +130,6 @@ (logclear! (-> self root root-prim prim-core action) (collide-action rideable)) ) (plat-trans) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 2) @@ -148,7 +141,6 @@ (ja :num! (seek!)) ) (go-virtual up) - (none) ) :post (the-as (function none :behavior drill-flip-step) plat-post) ) @@ -330,7 +322,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior drill-falling-door) sleep-code) ) @@ -343,7 +334,6 @@ This commonly includes things such as: (if (>= (-> self hit-state) 3) (go-virtual fall #f) ) - (none) ) :code (behavior () (until #f @@ -371,7 +361,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -393,7 +382,6 @@ This commonly includes things such as: ) ) 0 - (none) ) :code (behavior ((arg0 symbol)) (process-entity-status! self (entity-perm-status bit-12) #t) @@ -415,7 +403,6 @@ This commonly includes things such as: ) ) (sleep-code) - (none) ) :post (the-as (function none :behavior drill-falling-door) transform-post) ) @@ -527,7 +514,6 @@ This commonly includes things such as: (go-virtual open) ) ) - (none) ) :code (the-as (function none :behavior drill-sliding-door) sleep-code) ) @@ -546,7 +532,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (sleep-code) - (none) ) ) @@ -694,7 +679,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type conveyor idle) post))) @@ -703,7 +687,6 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) @@ -753,7 +736,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior drill-breakable-barrel) ja-post) ) @@ -834,11 +816,11 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (drill-metalhead-eggs) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let* ((s5-0 (-> event param 0)) - (gp-0 (the-as object (-> event param 1))) + (let* ((s5-0 (-> block param 0)) + (gp-0 (the-as object (-> block param 1))) (s4-0 proc) (v1-1 (if (type? s4-0 process-drawable) s4-0 @@ -868,7 +850,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior drill-metalhead-eggs) ja-post) ) @@ -921,7 +902,6 @@ This commonly includes things such as: (task-node-close! (game-task-node drill-eggs-resolution)) (talker-spawn-func (-> *talker-speech* 99) *entity-pool* (target-pos 0) (the-as region #f)) ) - (none) ) :code (behavior () (let ((v1-1 (-> self root root-prim))) @@ -976,7 +956,6 @@ This commonly includes things such as: ) ) (cleanup-for-death self) - (none) ) ) @@ -996,7 +975,6 @@ This commonly includes things such as: ) ) (cleanup-for-death self) - (none) ) ) @@ -1306,11 +1284,11 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (drill-bridge-shot) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let* ((gp-0 (-> event param 0)) - (s5-0 (the-as object (-> event param 1))) + (let* ((gp-0 (-> block param 0)) + (s5-0 (the-as object (-> block param 1))) (s4-0 proc) (v1-1 (if (type? s4-0 process-drawable) s4-0 @@ -1347,7 +1325,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior drill-bridge-shot) transform-post) ) @@ -1357,7 +1334,6 @@ This commonly includes things such as: :virtual #t :enter (behavior ((arg0 symbol)) (process-entity-status! self (entity-perm-status subtask-complete) #t) - (none) ) :code (behavior ((arg0 symbol)) (let ((v1-1 (-> self root root-prim))) @@ -1423,7 +1399,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior drill-bridge-shot) transform-post) ) @@ -1535,7 +1510,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior drill-drill) ja-post) ) @@ -1596,8 +1570,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate up (drill-drop-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (let ((v0-0 (the-as object #t))) (set! (-> self ridden?) (the-as symbol v0-0)) @@ -1605,7 +1579,7 @@ This commonly includes things such as: ) ) (else - ((-> (method-of-type drill-flip-step up) event) proc arg1 event-type event) + ((-> (method-of-type drill-flip-step up) event) proc argc message block) ) ) ) @@ -1622,7 +1596,6 @@ This commonly includes things such as: (if (>= (- (current-time) (-> self not-ridden-timer)) (seconds 0.4)) (go-virtual swing-down) ) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type drill-flip-step up) post))) @@ -1630,7 +1603,6 @@ This commonly includes things such as: ((the-as (function none) t9-0)) ) ) - (none) ) ) @@ -1646,7 +1618,6 @@ This commonly includes things such as: (if (>= (- (current-time) (-> self not-ridden-timer)) (seconds 2)) (send-event self 'trigger) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc index bf0b767497a..d403a94a770 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc @@ -158,8 +158,8 @@ and translate the platform via the `smush` ;; failed to figure out what this is: (defstate idle (drill-plat-falling) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden 'edge-grabbed) (start-bouncing! self) (go-virtual falling) @@ -169,7 +169,6 @@ and translate the platform via the `smush` :enter (behavior () (ja :group! (-> self draw art-group data 2) :num! min) (logior! (-> self root root-prim prim-core action) (collide-action rideable)) - (none) ) :trans drill-plat-falling-trans :code (the-as (function none :behavior drill-plat-falling) sleep-code) @@ -184,7 +183,6 @@ and translate the platform via the `smush` (logclear! (-> self root root-prim prim-core action) (collide-action rideable)) ) (drill-plat-falling-trans) - (none) ) :code (behavior () (ja-no-eval :group! (ja-group) @@ -196,7 +194,6 @@ and translate the platform via the `smush` (ja :num! (seek!)) ) (go-virtual idle) - (none) ) :post (the-as (function none :behavior drill-plat-falling) plat-post) ) @@ -367,7 +364,6 @@ This commonly includes things such as: ) ) #f - (none) ) ) @@ -402,7 +398,6 @@ This commonly includes things such as: ) (logclear! (-> self elevator-status) (elevator-status waiting-to-ascend)) (sleep-code) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type elevator running) post))) @@ -411,7 +406,6 @@ This commonly includes things such as: ) ) (set-extent! (-> self shaft 0) (-> self root trans)) - (none) ) ) @@ -430,7 +424,6 @@ This commonly includes things such as: (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) (-> self skel root-channel 0) (ja-post) - (none) ) :code (behavior () (until #f @@ -449,7 +442,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -626,7 +618,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) (set! (-> self running-sound-id) (sound-play "mech-lift")) - (none) ) :exit (behavior () (remove-setting! 'pilot) @@ -637,7 +628,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) (sound-stop (-> self running-sound-id)) - (none) ) :code (behavior () (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) @@ -660,7 +650,6 @@ For example for an elevator pre-compute the distance between the first and last (sound-stop (-> self sound-id)) (logclear! (-> self elevator-status) (elevator-status waiting-to-ascend)) (sleep-code) - (none) ) ) @@ -804,63 +793,60 @@ For example for an elevator pre-compute the distance between the first and last ;; failed to figure out what this is: (defstate idle (fire-floor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touch 'attack) - (let* ((s4-0 proc) - (gp-0 (if (type? s4-0 process-focusable) - s4-0 - ) - ) - ) - (when gp-0 - (when (or (focus-test? (the-as process-focusable gp-0) mech) - (>= (- (current-time) (-> self no-collision-timer)) - (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) - ) - ) - (let ((f0-0 (get-norm! (-> self sync) 0))) - (when (and (< (-> self generous) f0-0) (< f0-0 (- (-> self flames-end-tt) (-> self generous)))) - (let ((s4-1 (new 'stack-no-clear 'vector))) - (vector-matrix*! s4-1 (get-trans (the-as process-focusable gp-0) 0) (-> self world-to-local)) - (when (and (>= (-> s4-1 x) 0.0) - (>= (-> self deadly-width) (-> s4-1 x)) - (>= (-> s4-1 z) 0.0) - (>= (-> self deadly-length) (-> s4-1 z)) - (>= (-> s4-1 y) -2048.0) - (>= 2048.0 (-> s4-1 y)) - ) - (let ((s4-2 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) - (let* ((v1-23 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as process-focusable gp-0) root quat))) - (f0-8 (vector-dot s4-2 v1-23)) - ) - (if (< 0.0 f0-8) - (vector-float*! s4-2 s4-2 -1.0) - ) - ) - (when (send-event - gp-0 - 'attack - (-> event param 0) - (static-attack-info ((id (-> self attack-id)) - (mode 'burnup) - (vector s4-2) - (shove-back (meters 0.1)) - (shove-up (meters 3)) - (control (if (focus-test? (the-as process-focusable gp-0) board) - 1.0 - 0.0 - ) - ) - ) - ) - ) - (let ((v0-0 (current-time))) - (set! (-> self no-collision-timer) v0-0) - v0-0 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (let* ((s4-0 proc) + (gp-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when gp-0 + (when (or (focus-test? (the-as process-focusable gp-0) mech) + (>= (- (current-time) (-> self no-collision-timer)) + (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) + ) + ) + (let ((f0-0 (get-norm! (-> self sync) 0))) + (when (and (< (-> self generous) f0-0) (< f0-0 (- (-> self flames-end-tt) (-> self generous)))) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (vector-matrix*! s4-1 (get-trans (the-as process-focusable gp-0) 0) (-> self world-to-local)) + (when (and (>= (-> s4-1 x) 0.0) + (>= (-> self deadly-width) (-> s4-1 x)) + (>= (-> s4-1 z) 0.0) + (>= (-> self deadly-length) (-> s4-1 z)) + (>= (-> s4-1 y) -2048.0) + (>= 2048.0 (-> s4-1 y)) + ) + (let ((s4-2 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (let* ((v1-23 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as process-focusable gp-0) root quat))) + (f0-8 (vector-dot s4-2 v1-23)) + ) + (if (< 0.0 f0-8) + (vector-float*! s4-2 s4-2 -1.0) ) + ) + (when (send-event + gp-0 + 'attack + (-> block param 0) + (static-attack-info ((id (-> self attack-id)) + (mode 'burnup) + (vector s4-2) + (shove-back (meters 0.1)) + (shove-up (meters 3)) + (control (if (focus-test? (the-as process-focusable gp-0) board) + 1.0 + 0.0 + ) + ) + ) + ) + ) + (let ((v0-0 (current-time))) + (set! (-> self no-collision-timer) v0-0) + v0-0 ) ) ) @@ -871,7 +857,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - ) + ) ) ) :trans (behavior () @@ -881,7 +867,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> a1-0 tlist) *touching-list*) (find-overlapping-shapes (-> self root) a1-0) ) - (none) ) :code (the-as (function none :behavior fire-floor) sleep-code) :post (behavior () @@ -959,7 +944,6 @@ For example for an elevator pre-compute the distance between the first and last ) (debug-draw (-> self path)) (transform-post) - (none) ) ) @@ -1297,13 +1281,13 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate up-idle (drill-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('track) #t ) (else - ((-> (method-of-type basebutton up-idle) event) proc arg1 event-type event) + ((-> (method-of-type basebutton up-idle) event) proc argc message block) ) ) ) @@ -1314,7 +1298,6 @@ This commonly includes things such as: ) ) (setup-masks (-> self draw) 4 2) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type basebutton up-idle) trans))) @@ -1323,13 +1306,11 @@ This commonly includes things such as: ) ) (set-switch-color self #f) - (none) ) :code (behavior () (ja :group! (-> self draw art-group data 2) :num! (identity 1.0)) (transform-post) (sleep-code) - (none) ) ) @@ -1354,7 +1335,6 @@ This commonly includes things such as: (set! (-> self down-frame) 2.0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type basebutton going-down) trans))) @@ -1363,7 +1343,6 @@ This commonly includes things such as: ) ) (set-switch-color self #f) - (none) ) :code (behavior () (ja-no-eval :num! (seek! (-> self down-frame) (-> self anim-speed))) @@ -1378,7 +1357,6 @@ This commonly includes things such as: ) ) (go-virtual down-idle) - (none) ) ) @@ -1393,7 +1371,6 @@ This commonly includes things such as: ) ) (setup-masks (-> self draw) 2 4) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type basebutton down-idle) trans))) @@ -1402,7 +1379,6 @@ This commonly includes things such as: ) ) (set-switch-color self #t) - (none) ) :code (behavior () (ja :group! (-> self draw art-group data 2) :num! (identity (-> self down-frame))) @@ -1419,7 +1395,6 @@ This commonly includes things such as: (go-virtual going-up) ) ) - (none) ) ) @@ -1433,7 +1408,6 @@ This commonly includes things such as: ) ) (setup-masks (-> self draw) 4 2) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type basebutton going-up) trans))) @@ -1442,7 +1416,6 @@ This commonly includes things such as: ) ) (set-switch-color self #f) - (none) ) :code (behavior () (local-vars @@ -1473,7 +1446,6 @@ This commonly includes things such as: (send-event! self (-> self event-up)) (sound-play "drill-switch") (go-virtual up-idle) - (none) ) ) @@ -1642,7 +1614,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (let* ((f0-2 (+ (* 0.0033333334 (the float (- (current-time) (-> self state-time)))) @@ -1734,7 +1705,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior drill-laser) sleep-code) ) @@ -1783,100 +1753,91 @@ This commonly includes things such as: (game-task-node drill-ship-resolution) TASK_MANAGER_INIT_HOOK (lambda () - (speech-table-set! - *speech-control* - (speech-type speech-type-6) - (new 'static 'speech-type-info - :min-delay (seconds 4) - :max-delay (seconds 8) - :list (new 'static 'boxed-array :type string - "kg001" - "kg006" - "kg001a" - "kg013" - "kg018" - "kg023" - "kg078a" - "kg079a" - "kg080a" - "kg081a" - "kg082a" - "kg083a" - "kg084a" - "kg085a" - "kg086a" - "kg088a" - "kg091a" - "kg023a" - "kg006a" - "kg092a" - "kg093a" - "kg094a" - "kg095a" - "kg103a" - "kg104a" - "kg112a" - "kg134" - "kg136" - "kg138" - "kg139" - "kg140" - "kg141" - "kg130" - "kg135" - "kg156" - "kg157" - ) - ) - ) - (speech-table-set! - *speech-control* - (speech-type speech-type-9) - (new 'static 'speech-type-info - :priority 1 - :min-delay (seconds 1) - :max-delay (seconds 2) - :list (new 'static 'boxed-array :type string - "kg133" - "kg142" - "kg144" - "kg145" - "kg146" - "kg147" - "kg148" - "kg149" - "kg150" - "kg138" - "kg151" - "kg152" - "kg153" - "kg154" - "kg155" - "kg159" - "kg163" - "kg164" - ) - ) - ) - (the-as - object - (speech-table-set! *speech-control* (speech-type speech-type-10) (new 'static 'speech-type-info - :priority 10 - :max-delay (seconds 1) - :list (new 'static 'boxed-array :type string - "kg166" - "kg167" - "kg168" - "kg169" - "kg171" - "kg172" - "kg173" - "kg174" - "kg175" - ) + (speech-table-set! *speech-control* (speech-type speech-type-6) (new 'static 'speech-type-info + :min-delay (seconds 4) + :max-delay (seconds 8) + :list (new 'static 'boxed-array :type string + "kg001" + "kg006" + "kg001a" + "kg013" + "kg018" + "kg023" + "kg078a" + "kg079a" + "kg080a" + "kg081a" + "kg082a" + "kg083a" + "kg084a" + "kg085a" + "kg086a" + "kg088a" + "kg091a" + "kg023a" + "kg006a" + "kg092a" + "kg093a" + "kg094a" + "kg095a" + "kg103a" + "kg104a" + "kg112a" + "kg134" + "kg136" + "kg138" + "kg139" + "kg140" + "kg141" + "kg130" + "kg135" + "kg156" + "kg157" + ) + ) + ) + (speech-table-set! *speech-control* (speech-type speech-type-9) (new 'static 'speech-type-info + :priority 1 + :min-delay (seconds 1) + :max-delay (seconds 2) + :list (new 'static 'boxed-array :type string + "kg133" + "kg142" + "kg144" + "kg145" + "kg146" + "kg147" + "kg148" + "kg149" + "kg150" + "kg138" + "kg151" + "kg152" + "kg153" + "kg154" + "kg155" + "kg159" + "kg163" + "kg164" + ) + ) + ) + (speech-table-set! *speech-control* (speech-type speech-type-10) (new 'static 'speech-type-info + :priority 10 + :max-delay (seconds 1) + :list (new 'static 'boxed-array :type string + "kg166" + "kg167" + "kg168" + "kg169" + "kg171" + "kg172" + "kg173" + "kg174" + "kg175" ) - ) - ) + ) + ) ) ) @@ -1885,7 +1846,7 @@ This commonly includes things such as: *game-info* (game-task-node drill-ship-resolution) TASK_MANAGER_CLEANUP_HOOK - (lambda () (the-as object (speech-control-method-9 *speech-control*))) + (lambda () (speech-control-method-9 *speech-control*)) ) ;; definition for function drill-login diff --git a/test/decompiler/reference/jak2/levels/drill/drill-panel_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-panel_REF.gc index 2df72e8db79..ad70a1941bc 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-panel_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-panel_REF.gc @@ -624,13 +624,11 @@ (send-event (ppointer->process *drill-mech-master*) 'drill-control-panel (-> self id)) (sound-play "crush-console") ) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 1)) (spawn-shock-part self) ) - (none) ) :code (behavior ((arg0 symbol)) (when (not arg0) @@ -654,17 +652,16 @@ ) (transform-post) (sleep-code) - (none) ) ) ;; failed to figure out what this is: (defstate idle (drill-control-panel) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (case (-> (the-as attack-info (-> event param 1)) mode) + (case (-> (the-as attack-info (-> block param 1)) mode) (('mech-punch 'crush) (go-virtual hit #f) ) @@ -691,20 +688,17 @@ ) ) ) - (none) ) :exit (behavior () (sound-stop (-> self idle-sound-id)) (while (-> self child) (deactivate (-> self child 0)) ) - (none) ) :code (the-as (function none :behavior drill-control-panel) sleep-code) :post (behavior () (spawn-with-cspace (-> self part) (the-as cspace (-> self node-list data))) (sound-play "small-panel" :id (-> self idle-sound-id)) - (none) ) ) @@ -876,7 +870,6 @@ This commonly includes things such as: ) (transform-post) (sleep-code) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-spool_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-spool_REF.gc index 4a97072ed29..e2bac58e258 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-spool_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-spool_REF.gc @@ -803,9 +803,9 @@ ;; failed to figure out what this is: (defstate idle (drill-wall) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v1-2 symbol)) - (case event-type + (case message (('trigger) (let ((v1-1 (-> self egg-group))) (when v1-1 @@ -822,8 +822,8 @@ (label cfg-10) (when v1-2 (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual hit (the-as symbol (if (>= arg1 1) - (-> event param 0) + (go-virtual hit (the-as symbol (if (>= argc 1) + (-> block param 0) (the-as uint #f) ) ) @@ -840,7 +840,6 @@ (suspend) ) #f - (none) ) ) @@ -849,7 +848,6 @@ :virtual #t :exit (behavior () (ja-abort-spooled-anim (-> self anim) (the-as art-joint-anim #f) -1) - (none) ) :trans (-> (method-of-type drill-wall idle) trans) :post (the-as (function none :behavior drill-wall) transform-post) @@ -1013,9 +1011,9 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (drill-crane) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v1-2 symbol)) - (case event-type + (case message (('trigger) (let ((v1-1 (-> self egg-group))) (when v1-1 @@ -1049,7 +1047,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -1058,7 +1055,6 @@ This commonly includes things such as: :virtual #t :exit (behavior () (ja-abort-spooled-anim (-> self anim) (the-as art-joint-anim #f) -1) - (none) ) :trans (-> (method-of-type drill-crane idle) trans) :post (the-as (function none :behavior drill-crane) transform-post) diff --git a/test/decompiler/reference/jak2/levels/drill/drillmid-obs_REF.gc b/test/decompiler/reference/jak2/levels/drill/drillmid-obs_REF.gc index 5a4caba964c..f2865e0d932 100644 --- a/test/decompiler/reference/jak2/levels/drill/drillmid-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drillmid-obs_REF.gc @@ -200,7 +200,6 @@ This commonly includes things such as: (set-collide-spec! self #t) (set-setting! 'jump #f 0.0 0) ) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) @@ -210,7 +209,6 @@ This commonly includes things such as: (t9-4) ) ) - (none) ) :post (behavior () (sound-play "drl-elevator-lp" :id (-> self sound-id) :position (-> self root trans)) @@ -219,7 +217,6 @@ This commonly includes things such as: ((the-as (function none) t9-2)) ) ) - (none) ) ) @@ -236,7 +233,6 @@ This commonly includes things such as: (set-collide-spec! self #f) (remove-setting! 'jump) ) - (none) ) ) @@ -371,7 +367,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type conveyor idle) post))) @@ -380,10 +375,5 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc b/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc index acd5f00e355..9698dc2d6f8 100644 --- a/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc @@ -643,7 +643,6 @@ (if (< 0.5 (rand-vu)) (set! (-> self enemy-flags) (the-as enemy-flag (logxor (shl 256 32) (the-as int (-> self enemy-flags))))) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy circling) trans))) @@ -652,7 +651,6 @@ ) ) (ginsu-method-182 self) - (none) ) :code (the-as (function none :behavior ginsu) sleep-code) ) @@ -673,7 +671,6 @@ (set! (-> self starting-time) (current-time)) (set! (-> self spiral-time) (current-time)) (set! (-> self desired-distance) (vector-length (ginsu-method-181 self (new 'stack-no-clear 'vector)))) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -693,7 +690,6 @@ (set! (-> self enemy-flags) (the-as enemy-flag (logxor (shl 256 32) (the-as int (-> self enemy-flags))))) ) (ginsu-method-182 self) - (none) ) :code (the-as (function none :behavior ginsu) sleep-code) :post (behavior () @@ -730,7 +726,6 @@ ) 0 (nav-enemy-method-176 self) - (none) ) ) @@ -748,7 +743,6 @@ (set! (-> self state-time) (current-time)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! ginsu-idle-ja :num! min) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -756,7 +750,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (if (not (and (handle->process (-> self focus handle)) @@ -775,7 +768,6 @@ (go-virtual attack) ) (ja :num! (loop!)) - (none) ) :code (the-as (function none :behavior ginsu) sleep-code) :post (behavior () @@ -796,7 +788,6 @@ ) 0 (nav-enemy-method-176 self) - (none) ) ) @@ -822,7 +813,6 @@ 0 (set! (-> self state-time) (current-time)) (ja :group! ginsu-attack-ja :num! min) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -831,7 +821,6 @@ (logclear! (-> self focus-status) (focus-status dangerous)) ) (ginsu-method-183 self #f) - (none) ) :trans (behavior () (enemy-method-49 self) @@ -851,7 +840,6 @@ (if (ja-done? 0) (go-virtual circling) ) - (none) ) :code (the-as (function none :behavior ginsu) sleep-code) :post (the-as (function none :behavior ginsu) nav-enemy-chase-post) @@ -872,12 +860,10 @@ (set! (-> self root scale x) 0.01) (set! (-> self root scale y) 0.01) (set! (-> self root scale z) 0.01) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self enemy-flags) (enemy-flag notice)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type enemy ambush) trans))) @@ -901,7 +887,6 @@ ) (ja :num! (loop!)) ) - (none) ) :code (the-as (function none :behavior ginsu) sleep-code) :post (the-as (function none :behavior ginsu) enemy-simple-post) @@ -932,7 +917,6 @@ ) ) (ginsu-sounds-off) - (none) ) ) @@ -946,7 +930,6 @@ ) ) (ginsu-sounds-off) - (none) ) ) @@ -960,7 +943,6 @@ ) ) (ginsu-sounds-off) - (none) ) ) @@ -974,7 +956,6 @@ ) ) (ginsu-sounds-off) - (none) ) ) @@ -997,7 +978,6 @@ ) ) ) - (none) ) ;; definition for method 116 of type ginsu diff --git a/test/decompiler/reference/jak2/levels/forest/fish_REF.gc b/test/decompiler/reference/jak2/levels/forest/fish_REF.gc index c3bf8a3f950..7237a74b193 100644 --- a/test/decompiler/reference/jak2/levels/forest/fish_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/fish_REF.gc @@ -80,7 +80,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior minnow) ja-post) ) @@ -150,8 +149,8 @@ ;; failed to figure out what this is: (defstate idle (fish-manager) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (format #t "training-manager received event ~s~%" event-type) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (format #t "training-manager received event ~s~%" message) (format #t "event-from ~s~%" proc) ) :code (the-as (function none :behavior fish-manager) sleep-code) @@ -492,7 +491,6 @@ ) ) ) - (none) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc b/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc index eb7c1d0c43e..f2f911ad630 100644 --- a/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc @@ -60,16 +60,10 @@ This commonly includes things such as: (set! (-> t1-0 y) 24576.0) (set! (-> t1-0 z) 61440.0) (set! (-> t1-0 w) 1.0) - (let ((a3-0 arg0)) - (set! (-> obj formation) (t9-3 a0-4 a1-4 a2-2 a3-0 t0-0 t1-0 5461.3335 (the-as handle #f))) - (let ((v1-8 (logior (-> obj formation flags) 4)) - (a0-5 (-> obj formation)) - ) - (set! (-> a0-5 flags) v1-8) - (go (method-of-object obj spawning) a0-5 (the-as object a1-4) (the-as process a2-2) (the-as pointer a3-0)) - ) - ) + (set! (-> obj formation) (t9-3 a0-4 a1-4 a2-2 arg0 t0-0 t1-0 5461.3335 (the-as handle #f))) ) + (logior! (-> obj formation flags) 4) + (go (method-of-object obj spawning)) (none) ) @@ -206,10 +200,10 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (forest-youngsamos) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) - (send-event proc 'touch (-> event param 0)) + (send-event proc 'touch (-> block param 0)) ) (('attack) (let ((s4-0 *target*) @@ -220,7 +214,7 @@ This commonly includes things such as: ) s4-0 ) - (let ((s5-1 (the-as attack-info (-> event param 1)))) + (let ((s5-1 (the-as attack-info (-> block param 1)))) (case (-> s5-1 mode) (('eco-red 'eco-yellow 'eco-blue 'eco-dark) #f @@ -267,7 +261,6 @@ This commonly includes things such as: :enter (behavior () (set! (-> self falling?) #f) (send-event (handle->process (-> self hud)) 'force-show) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -282,20 +275,18 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (sound-play "samos-hover" :id (-> self sound-id)) (forest-youngsamos-post) - (none) ) ) ;; failed to figure out what this is: (defstate hit (forest-youngsamos) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die-fast) (cleanup-for-death self) (go empty-state) @@ -307,7 +298,6 @@ This commonly includes things such as: (set! (-> self falling?) (the-as basic #t)) (logior! (-> self focus-status) (focus-status disable)) (set! (-> self focus-disable-timer) (the-as uint (+ (current-time) (seconds 3.5)))) - (none) ) :code (behavior () (set! (-> self root transv quad) (-> self hit-dir quad)) @@ -353,7 +343,6 @@ This commonly includes things such as: ) ) (go-virtual idle) - (none) ) :post forest-youngsamos-post ) @@ -361,8 +350,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate die (forest-youngsamos) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die-fast) (cleanup-for-death self) (go empty-state) @@ -371,7 +360,6 @@ This commonly includes things such as: ) :enter (behavior () (set! (-> self falling?) (the-as basic #t)) - (none) ) :code (behavior () (speech-control-method-12 *speech-control* self (speech-type speech-type-10)) @@ -424,7 +412,6 @@ This commonly includes things such as: ) (send-event *camera* 'change-target #f) (cleanup-for-death self) - (none) ) :post forest-youngsamos-post ) diff --git a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc index 2b202a82864..4308beeadae 100644 --- a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc @@ -815,7 +815,6 @@ The faster it's moving the fast it flaps it's wings, etc ) ) #f - (none) ) :post (the-as (function none :behavior pegasus) ja-post) ) @@ -861,7 +860,6 @@ The faster it's moving the fast it flaps it's wings, etc (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -887,7 +885,6 @@ The faster it's moving the fast it flaps it's wings, etc ) ) ) - (none) ) :code (behavior () (let ((anim-group (ja-group))) @@ -907,7 +904,6 @@ The faster it's moving the fast it flaps it's wings, etc (suspend) ) #f - (none) ) :post (the-as (function none :behavior pegasus) enemy-simple-post) ) @@ -1083,7 +1079,6 @@ The faster it's moving the fast it flaps it's wings, etc (set! (-> self state-time) (current-time)) (set! (-> self far-time) (current-time)) (set-setting! 'sound-mode #f 0.0 1) - (none) ) :exit (behavior () (let ((func (-> (method-of-type enemy flee) exit))) @@ -1092,7 +1087,6 @@ The faster it's moving the fast it flaps it's wings, etc ) ) (remove-setting! 'sound-mode) - (none) ) :trans (behavior () (let ((func (-> (method-of-type enemy flee) trans))) @@ -1115,7 +1109,6 @@ The faster it's moving the fast it flaps it's wings, etc ) ) (set! (-> self far-time) (current-time)) - (none) ) :code (behavior () (until #f @@ -1124,7 +1117,6 @@ The faster it's moving the fast it flaps it's wings, etc (suspend) ) #f - (none) ) :post (-> (method-of-type enemy flee) post) ) @@ -1141,7 +1133,6 @@ The faster it's moving the fast it flaps it's wings, etc (set! (-> self near-timer) 3000) (set! (-> self far-time) (current-time)) (set-setting! 'sound-mode #f 0.0 1) - (none) ) :exit (behavior () (let ((func (-> (method-of-type enemy flee) exit))) @@ -1151,7 +1142,6 @@ The faster it's moving the fast it flaps it's wings, etc ) (set! (-> self y-offset-desired) 0.0) (remove-setting! 'sound-mode) - (none) ) :trans (behavior () (when (-> self can-run) @@ -1177,7 +1167,6 @@ The faster it's moving the fast it flaps it's wings, etc (if (>= (- (current-time) (-> self far-time)) (seconds 3)) (set! (-> self near-timer) (the-as int (-> self timeout))) ) - (none) ) :code (behavior () (until #f @@ -1186,7 +1175,6 @@ The faster it's moving the fast it flaps it's wings, etc (suspend) ) #f - (none) ) ) @@ -1211,14 +1199,12 @@ The faster it's moving the fast it flaps it's wings, etc (set! (-> self allow-idle) #t) (ja-channel-push! 1 (seconds 0.1)) (sleep-code) - (none) ) :post (behavior () (if (-> self allow-idle) (idle-control-method-10 (-> self idle-anim-player) self) ) (enemy-simple-post) - (none) ) ) @@ -1232,7 +1218,6 @@ The faster it's moving the fast it flaps it's wings, etc ) ) (set-setting! 'sound-mode #f 0.0 1) - (none) ) :exit (behavior () (let ((func (-> (method-of-type enemy notice) exit))) @@ -1241,7 +1226,6 @@ The faster it's moving the fast it flaps it's wings, etc ) ) (remove-setting! 'sound-mode) - (none) ) :code (behavior () (displacement-between-points-at-percent-normalized! @@ -1292,7 +1276,6 @@ The faster it's moving the fast it flaps it's wings, etc ) ) (react-to-focus self) - (none) ) ) @@ -1307,7 +1290,6 @@ The faster it's moving the fast it flaps it's wings, etc ((the-as (function none) func)) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc index 3ac6093d4a4..283bab6a8e2 100644 --- a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc @@ -938,7 +938,6 @@ (t9-0) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -955,7 +954,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior predator) nav-enemy-simple-post) ) @@ -966,7 +964,6 @@ :event (the-as (function process int symbol event-message-block object :behavior predator) enemy-event-handler) :enter (behavior () (go-virtual hostile) - (none) ) ) @@ -980,7 +977,6 @@ ) ) (predator-method-183 self) - (none) ) ) @@ -996,20 +992,17 @@ (set! (-> v1-2 attack-id) v0-0) (set! (-> self attack-id) v0-0) ) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (if (not (handle->process (-> self focus handle))) (go-virtual active) ) - (none) ) :code (behavior () (until #f @@ -1052,7 +1045,6 @@ (the-as none #f) (label cfg-26) (go-virtual hide) - (none) ) :post (the-as (function none :behavior predator) enemy-simple-post) ) @@ -1075,7 +1067,6 @@ (set! (-> v1-7 target-speed) 0.0) ) 0 - (none) ) :exit (behavior () (set-dangerous! self #f) @@ -1083,7 +1074,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1111,7 +1101,6 @@ (sound-play "pred-talk") ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior predator) nav-enemy-chase-post) ) @@ -1130,7 +1119,6 @@ (set! (-> self next-change) (the-as uint (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) ) - (none) ) :trans (behavior () (predator-method-186 self) @@ -1155,7 +1143,6 @@ (if (< (the-as time-frame (-> self next-change)) (current-time)) (go-virtual hide) ) - (none) ) :code (behavior () (until #f @@ -1183,11 +1170,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -1209,7 +1194,6 @@ (predator-method-187 self) (set! (-> self next-change) (the-as uint 0)) 0 - (none) ) :trans (behavior () (let ((gp-0 (handle->process (-> self focus handle)))) @@ -1242,7 +1226,6 @@ ) (go-virtual hidden) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1257,11 +1240,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-method-176 self) - (none) ) ) @@ -1282,7 +1263,6 @@ (if (zero? (get-rand-int self 3)) (sound-play "pred-talk") ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -1312,7 +1292,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1335,7 +1314,6 @@ ) ) #f - (none) ) ) @@ -1724,14 +1702,12 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-predator :init hud-init-by-other :to self))) - (none) ) :exit (behavior () (when (-> self hud-counter) (send-event (handle->process (-> self hud-counter)) 'hide-and-die) (set! (-> self hud-counter) (the-as handle #f)) ) - (none) ) :trans (behavior () (predator-manager-method-16 self) @@ -1756,7 +1732,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior predator-manager) sleep-code) ) diff --git a/test/decompiler/reference/jak2/levels/forest/wren_REF.gc b/test/decompiler/reference/jak2/levels/forest/wren_REF.gc index 100763ff1dd..9bb2045def4 100644 --- a/test/decompiler/reference/jak2/levels/forest/wren_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/wren_REF.gc @@ -167,7 +167,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) ) - (none) ) :code (behavior () (until #f @@ -181,7 +180,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) #f - (none) ) :post (behavior () (local-vars (at-0 int)) @@ -205,7 +203,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) (ja-post) - (none) ) ) ) @@ -217,7 +214,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (set! (-> self state-time) (current-time)) (set! (-> self peck-timer) (the-as uint (the int (* 300.0 (rand-vu-float-range 1.4 4.3))))) (logclear! (-> self flags) (wren-flags wrflags-1 wrflags-2)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> self peck-timer))) @@ -239,7 +235,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (go-virtual hunt) ) ) - (none) ) :code (behavior () (local-vars (v1-34 symbol)) @@ -285,14 +280,12 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) #f - (none) ) :post (behavior () (if (logtest? (-> self flags) (wren-flags wrflags-0)) (seek-to-point-toward-point! (-> self root) (-> self move-dest) 262144.0 (seconds 0.02)) ) (ja-post) - (none) ) ) @@ -307,7 +300,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (set! (-> self fly-interp) 0.0) (set! (-> self bob-level) 0.0) (set! (-> self bob-level-seek) 0.0) - (none) ) :trans (behavior () (when (< 0.99 (-> self path-u)) @@ -316,7 +308,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (go-virtual die) ) ) - (none) ) :code (behavior () (let ((gp-0 (current-time)) @@ -372,7 +363,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (suspend) ) #f - (none) ) :post fly-post ) @@ -394,12 +384,10 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) (go-virtual on-branch) - (none) ) :post (behavior () (seek! (-> self path-du-mod) 0.0 (* 0.5 (seconds-per-frame))) (fly-post) - (none) ) ) @@ -416,7 +404,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) (vector+! (-> self move-dest) (-> self root trans) v1-6) ) - (none) ) :trans (behavior () (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans)))) @@ -427,7 +414,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) ) - (none) ) :code (behavior () (logclear! (-> self flags) (wren-flags wrflags-0)) @@ -453,7 +439,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (ja :num! (loop! f30-2)) ) ) - (none) ) :post (behavior () (if (logtest? (-> self flags) (wren-flags wrflags-0)) @@ -461,7 +446,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) (debug-draw-path self) (ja-post) - (none) ) ) @@ -472,7 +456,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (cleanup-for-death self) (suspend) 0 - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-obs_REF.gc index 177e1ca762d..d95de972794 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-obs_REF.gc @@ -51,8 +51,8 @@ ;; failed to figure out what this is: (defstate idle (fort-elec-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (go-virtual die) 'push @@ -85,7 +85,6 @@ ) (talker-spawn-func (-> *talker-speech* 86) *entity-pool* (target-pos 0) (the-as region #f)) (sleep-code) - (none) ) :post (-> (method-of-type fort-elec-switch idle) post) ) @@ -113,7 +112,6 @@ ) (set! (-> v1-0 state mode) (the-as lightning-mode v0-1)) ) - (none) ) :code (behavior () (let ((v1-1 (-> self root root-prim))) @@ -244,7 +242,6 @@ ) ) (cleanup-for-death self) - (none) ) ) @@ -417,8 +414,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (fort-fence) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('break) (go-virtual breaking) ) @@ -455,7 +452,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior fort-fence) sleep-code) ) @@ -474,7 +470,6 @@ This commonly includes things such as: (set! (-> v1-4 prim-core collide-as) (collide-spec)) ) 0 - (none) ) :exit (behavior () (let ((a0-0 (-> self anim))) @@ -484,7 +479,6 @@ This commonly includes things such as: (ja :group! (-> self exit-anim) :num! min) ) ) - (none) ) :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) @@ -497,7 +491,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior fort-fence) transform-post) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-obs_REF.gc index 5a4a4b226a7..6fd2ff2d7a0 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-obs_REF.gc @@ -59,7 +59,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior fort-plat-orbit) rider-post) ) @@ -210,7 +209,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (behavior () (+! (-> self path-pos) (* (-> self path-speed) (seconds-per-frame))) @@ -230,7 +228,6 @@ This commonly includes things such as: (update-trans! (-> self sound) (-> self root trans)) (update! (-> self sound)) (rider-post) - (none) ) ) @@ -316,8 +313,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate dormant (fort-plat-shuttle) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual idle) ) @@ -332,14 +329,12 @@ This commonly includes things such as: :enter (behavior () (fort-plat-shuttle-method-22 self) (set! (-> self next-spawn-time) (get-timeframe-offset! (-> self sync) 0)) - (none) ) :trans (behavior () (when (>= (current-time) (-> self next-spawn-time)) (process-spawn fort-plat-shuttle-plat 0 :to self) (set! (-> self next-spawn-time) (get-timeframe-offset! (-> self sync) 0)) ) - (none) ) :code (the-as (function none :behavior fort-plat-shuttle) sleep-code) ) @@ -428,6 +423,7 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-conveyor +;; INFO: this function exists in multiple non-identical object files (defmethod inspect fort-conveyor ((obj fort-conveyor)) (when (not obj) (set! obj obj) @@ -447,12 +443,14 @@ This commonly includes things such as: ) ;; definition for method 22 of type fort-conveyor +;; INFO: this function exists in multiple non-identical object files (defmethod get-art-group fort-conveyor ((obj fort-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-fort-conveyor" (the-as (pointer uint32) #f)) ) ;; definition for method 23 of type fort-conveyor +;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch collide-shape-moving vs none. (defmethod reset-root! fort-conveyor ((obj fort-conveyor)) "Re-initializes the `root` [[trsqv]]" @@ -484,6 +482,7 @@ This commonly includes things such as: ) ;; definition for method 24 of type fort-conveyor +;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch vector vs none. (defmethod init! fort-conveyor ((obj fort-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" @@ -503,6 +502,7 @@ This commonly includes things such as: ) ;; definition for method 25 of type fort-conveyor +;; INFO: this function exists in multiple non-identical object files (defmethod set-and-get-ambient-sound! fort-conveyor ((obj fort-conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-obs_REF.gc index b88236c2a2e..f4daa95fc39 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-obs_REF.gc @@ -80,11 +80,11 @@ ;; failed to figure out what this is: (defstate idle (fort-dump-bomb-a) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let* ((s5-0 (-> event param 0)) - (gp-0 (the-as attack-info (-> event param 1))) + (let* ((s5-0 (-> block param 0)) + (gp-0 (the-as attack-info (-> block param 1))) (s4-0 proc) (v1-1 (if (type? s4-0 process-drawable) (the-as process-drawable s4-0) @@ -101,7 +101,6 @@ :code (the-as (function none :behavior fort-dump-bomb-a) sleep-code) :post (behavior () (spawn (-> self part) (-> self root trans)) - (none) ) ) @@ -161,7 +160,6 @@ ) ) (cleanup-for-death self) - (none) ) ) @@ -271,11 +269,11 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (fort-missile-target) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'touch) - (let* ((gp-0 (-> event param 0)) - (s5-0 (the-as attack-info (-> event param 1))) + (let* ((gp-0 (-> block param 0)) + (s5-0 (the-as attack-info (-> block param 1))) (s4-0 proc) (v1-1 (if (type? s4-0 projectile) (the-as projectile s4-0) @@ -352,7 +350,6 @@ This commonly includes things such as: (set! (-> self part-mat 1 trans quad) (-> s4-0 quad)) ) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -410,13 +407,11 @@ This commonly includes things such as: ) (send-event (ppointer->process (-> self parent)) 'died) (sleep-code) - (none) ) :post (behavior () (sound-play "missile-steam" :id (the-as sound-id (-> self sound-id))) (spawn-with-matrix (-> self part) (the-as matrix (-> self part-mat))) (spawn-with-matrix (-> self part) (-> self part-mat 1)) - (none) ) ) @@ -553,8 +548,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (fort-missile) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go-virtual die) ) @@ -564,7 +559,6 @@ This commonly includes things such as: (if (and (task-node-closed? (game-task-node fortress-dump-deal)) *target*) (go-virtual targets-active) ) - (none) ) :code (the-as (function none :behavior fort-missile) sleep-code) ) @@ -572,8 +566,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate targets-active (fort-missile) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go-virtual die) ) @@ -602,7 +596,6 @@ This commonly includes things such as: (if *target* (set! (-> self hud) (ppointer->handle (process-spawn hud-rocketsensor :init hud-init-by-other :to *target*))) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -642,19 +635,17 @@ This commonly includes things such as: ) ) (go-virtual missile-countdown) - (none) ) :post (behavior () (set! (-> *game-info* counter) (the float (-> self bomb-count))) - (none) ) ) ;; failed to figure out what this is: (defstate missile-countdown (fort-missile) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('halt) (go-virtual dormant) ) @@ -667,7 +658,6 @@ This commonly includes things such as: (set-fordumpc-light-flag! #f) (send-event (handle->process (-> self hud)) 'hide-and-die) (sound-stop (-> self alarm-sound-id)) - (none) ) :code (behavior () (send-event (handle->process (-> self hud)) 'hide-and-die) @@ -777,19 +767,17 @@ This commonly includes things such as: ) ) (go-virtual die) - (none) ) :post (behavior () (sound-play "fort-alarm" :id (-> self alarm-sound-id)) - (none) ) ) ;; failed to figure out what this is: (defstate die (fort-missile) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('halt) (go-virtual dormant) ) @@ -798,7 +786,7 @@ This commonly includes things such as: (if (if (type? s4-0 process-drawable) s4-0 ) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) ) ) ) @@ -807,12 +795,10 @@ This commonly includes things such as: :enter (behavior () (set-setting! 'allow-pause #f 0.0 0) (set-setting! 'allow-progress #f 0.0 0) - (none) ) :exit (behavior () (remove-setting! 'allow-pause) (remove-setting! 'allow-progress) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -983,7 +969,6 @@ This commonly includes things such as: ) ) (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc index ca0953307a3..b7a21c488a9 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc @@ -167,8 +167,8 @@ ;; failed to figure out what this is: (defstate idle (fort-roboscreen) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (set! (-> self state-time) (current-time)) (go-virtual active) @@ -181,7 +181,6 @@ :enter (behavior () (logior! (-> self draw status) (draw-control-status no-draw)) (set! (-> self transition) 0.0) - (none) ) :code (the-as (function none :behavior fort-roboscreen) sleep-code) ) @@ -189,8 +188,8 @@ ;; failed to figure out what this is: (defstate active (fort-roboscreen) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go-virtual deactive) ) @@ -221,7 +220,6 @@ (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (none) ) :exit (behavior () (set-action! @@ -244,7 +242,6 @@ (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (none) ) :code (behavior () (until #f @@ -257,20 +254,18 @@ (suspend) ) #f - (none) ) :post (behavior () (fort-roboscreen-method-24 self) (ja-post) - (none) ) ) ;; failed to figure out what this is: (defstate deactive (fort-roboscreen) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go-virtual die) ) @@ -291,12 +286,10 @@ (suspend) ) #f - (none) ) :post (behavior () (fort-roboscreen-method-24 self) (ja-post) - (none) ) ) @@ -311,7 +304,6 @@ (suspend) ) ) - (none) ) ) @@ -575,12 +567,10 @@ (dotimes (v1-0 3) (set! (-> self ring-jmod v1-0 twist z) (the-as float #t)) ) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 3) :num! zero) (sleep-code) - (none) ) :post (behavior () (when (< (-> self ring-timer) (current-time)) @@ -594,7 +584,6 @@ (set! (-> self ring-timer) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.6 1.8))))) ) (fort-robotank-reticle-post) - (none) ) ) @@ -606,7 +595,6 @@ (dotimes (v1-0 3) (set! (-> self ring-jmod v1-0 twist z) (the-as float #f)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.04)) @@ -619,7 +607,6 @@ (ja :num! (seek!)) ) (sleep-code) - (none) ) :post fort-robotank-reticle-post ) @@ -1407,7 +1394,6 @@ :event robotank-turret-handler :enter (behavior () (set! (-> self gun-timer) (current-time)) - (none) ) :trans (behavior () (if (logtest? (-> self flags) (robotank-turret-flags rotflags-4)) @@ -1423,7 +1409,6 @@ (go-virtual fire) ) ) - (none) ) :code (behavior () (until #f @@ -1437,7 +1422,6 @@ ) ) #f - (none) ) :post turret-post ) @@ -1460,7 +1444,6 @@ (set! (-> self aim-pos-1 quad) (-> self aim-pos 0 quad)) ) ) - (none) ) :trans (behavior () (let ((gp-0 *target*)) @@ -1478,7 +1461,6 @@ (go-virtual ready) ) ) - (none) ) :code (behavior () (until #f @@ -1555,7 +1537,6 @@ ) ) #f - (none) ) :post turret-post ) @@ -1574,7 +1555,6 @@ (while (-> self child) (suspend) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc index df82c90161c..e5aaaf5aba0 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc @@ -585,107 +585,91 @@ ;; definition for function fort-robotank-handler ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. (defbehavior fort-robotank-handler fort-robotank ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (case arg2 - (('trigger) - (the-as - object - (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) - ) - (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) - (let ((v1-14 (-> *event-queue* data (-> *event-queue* length)))) - (+! (-> *event-queue* length) 1) - (set! (-> v1-14 form-handle) (process->handle self)) - (set! (-> v1-14 to-handle) (process->handle (handle->process (-> self turret)))) - (set! (-> v1-14 num-params) 0) - (set! (-> v1-14 message) 'trigger) - ) - ) - (logior! (-> self flags) (robotank-flags roflags-5)) - (let ((ret (the-as object (-> arg3 param 0)))) - (set! (-> self continue-index) (the-as int ret)) - ret - ) + (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) + ) + (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) + (let ((v1-14 (-> *event-queue* data (-> *event-queue* length)))) + (+! (-> *event-queue* length) 1) + (set! (-> v1-14 form-handle) (process->handle self)) + (set! (-> v1-14 to-handle) (process->handle (handle->process (-> self turret)))) + (set! (-> v1-14 num-params) 0) + (set! (-> v1-14 message) 'trigger) ) ) + (logior! (-> self flags) (robotank-flags roflags-5)) + (let ((ret (the-as object (-> arg3 param 0)))) + (set! (-> self continue-index) (the-as int ret)) + ret + ) ) - (('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) - ) - (('touch 'attack) - (the-as - object - (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self root) - (the-as uint 1) - ) - (let ((s5-0 (if (type? arg0 process-focusable) - (the-as process-focusable arg0) - ) - ) - ) - (the-as - object - (when s5-0 - (let ((a0-48 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) - (the-as - object - (when (send-event - s5-0 - 'attack-or-shove - (-> arg3 param 0) - (static-attack-info ((id (-> self attack-id)) - (vector a0-48) - (shove-back (if (and (-> self next-state) (= (-> self next-state name) 'idle)) - 16384.0 - 49152.0 - ) - ) - (shove-up (meters 6)) - (control (if (focus-test? s5-0 board) - 1.0 - 0.0 - ) - ) - ) - ) - ) - (set! (-> self no-collision-timer) (current-time)) - (let ((v1-45 (-> self root root-prim))) - (set! (-> v1-45 prim-core collide-as) (collide-spec)) - (set! (-> v1-45 prim-core collide-with) (collide-spec)) - ) - 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) + ) + (('touch 'attack) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self root) + (the-as uint 1) + ) + (let ((s5-0 (if (type? arg0 process-focusable) + (the-as process-focusable arg0) ) - ) ) + ) + (when s5-0 + (let ((a0-48 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (when (send-event + s5-0 + 'attack-or-shove + (-> arg3 param 0) + (static-attack-info ((id (-> self attack-id)) + (vector a0-48) + (shove-back (if (and (-> self next-state) (= (-> self next-state name) 'idle)) + 16384.0 + 49152.0 + ) + ) + (shove-up (meters 6)) + (control (if (focus-test? s5-0 board) + 1.0 + 0.0 + ) + ) + ) + ) + ) + (set! (-> self no-collision-timer) (current-time)) + (let ((v1-45 (-> self root root-prim))) + (set! (-> v1-45 prim-core collide-as) (collide-spec)) + (set! (-> v1-45 prim-core collide-with) (collide-spec)) ) + 0 ) ) ) ) ) - (('stop-music) - (remove-setting! 'music) - (remove-setting! 'music-volume) - (the-as object (remove-setting! 'sound-mode)) - ) - ) + ) + (('stop-music) + (remove-setting! 'music) + (remove-setting! 'music-volume) + (remove-setting! 'sound-mode) + ) ) ) @@ -803,7 +787,6 @@ :enter (behavior () (fort-robotank-method-25 self) (set! (-> self roller-spin-rate) 2730.6667) - (none) ) :trans (behavior () (when (and (name= (-> self name) "fort-robotank-6") (task-node-closed? (game-task-node fortress-dump-deal))) @@ -824,7 +807,6 @@ (set-setting! 'music-volume 'rel 0.9 0) (go-virtual moving) ) - (none) ) :code (the-as (function none :behavior fort-robotank) sleep-code) :post fort-robotank-post @@ -837,7 +819,6 @@ :enter (behavior () (set! (-> self path-info data (-> self path-index) start-y-angle) (quaternion-y-angle (-> self root quat))) (set! (-> self roller-spin-rate) 32768.0) - (none) ) :trans (behavior () (let* ((gp-0 (-> self path-info data (-> self path-index))) @@ -855,12 +836,10 @@ (go-virtual pause) ) ) - (none) ) :code (the-as (function none :behavior fort-robotank) sleep-code) :post (behavior () (fort-robotank-post) - (none) ) ) @@ -877,11 +856,9 @@ (set! (-> v1-4 du-final) 0.01) ) (fort-robotank-method-27 self) - (none) ) :exit (behavior () (logclear! (-> self flags) (robotank-flags roflags-2)) - (none) ) :trans (behavior () (if (not *target*) @@ -933,7 +910,6 @@ ) ) ) - (none) ) :code (behavior () (logclear! (-> self flags) (robotank-flags roflags-2)) @@ -944,7 +920,6 @@ ) (logior! (-> self flags) (robotank-flags roflags-2)) (sleep-code) - (none) ) :post (behavior () (when (logtest? (-> self flags) (robotank-flags roflags-2)) @@ -1040,7 +1015,6 @@ ) ) (fort-robotank-post) - (none) ) ) @@ -1050,14 +1024,12 @@ :event fort-robotank-handler :enter (behavior () (set! (-> self roller-spin-rate) 16384.0) - (none) ) :trans (behavior () (when (logtest? (-> self flags) (robotank-flags roflags-5)) (logclear! (-> self flags) (robotank-flags roflags-5)) (go-virtual moving) ) - (none) ) :code (the-as (function none :behavior fort-robotank) sleep-code) :post fort-robotank-post @@ -1083,7 +1055,6 @@ (while (-> self child) (suspend) ) - (none) ) :post (the-as (function none :behavior fort-robotank) pusher-post) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/exit/forexita-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/exit/forexita-obs_REF.gc index d1f95ebe342..a7afbc5ad3c 100644 --- a/test/decompiler/reference/jak2/levels/fortress/exit/forexita-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/exit/forexita-obs_REF.gc @@ -64,7 +64,6 @@ (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (set! (-> self last-val) 0.0) (set! (-> self sound-time) (get-timeframe-offset! (-> self sync) 0)) - (none) ) :trans (the-as (function none :behavior fort-lift-plat) plat-trans) :code (behavior () @@ -81,7 +80,6 @@ (suspend) ) #f - (none) ) :post (behavior () (when (< (-> self sound-time) (current-time)) @@ -90,7 +88,6 @@ ) (sound-play "fort-lift-plat" :id (-> self sound-id) :position (-> self root trans)) (plat-post) - (none) ) ) @@ -106,7 +103,6 @@ ) (set! (-> self last-val) 0.0) (set! (-> self sound-time) (get-timeframe-offset! (-> self sync) 0)) - (none) ) :trans (behavior () (set! (-> self path-pos) (get-norm! (-> self sync) 0)) @@ -118,7 +114,6 @@ ) (set! (-> self last-val) (-> self path-pos)) (plat-trans) - (none) ) :code (the-as (function none :behavior fort-lift-plat) sleep-code) :post (behavior () @@ -128,7 +123,6 @@ ) (sound-play "fort-lift-plat" :id (-> self sound-id) :position (-> self root trans)) (plat-post) - (none) ) ) @@ -318,7 +312,6 @@ otherwise, [[plat::34]] (get-point-at-percent-along-path! (-> self path) (-> self root trans) (ease-value-in-out f30-0 0.2) 'interp) ) (ja-post) - (none) ) ) @@ -327,13 +320,11 @@ otherwise, [[plat::34]] :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 2)) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior fort-claw) sleep-code) ) @@ -384,6 +375,6 @@ This commonly includes things such as: ) ) ) - (the-as object #f) + #f ) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc b/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc index f44f8d2d939..7985737ad9e 100644 --- a/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc @@ -771,7 +771,6 @@ :event (the-as (function process int symbol event-message-block object :behavior fort-turret) enemy-event-handler) :exit (behavior () (set! (-> self flash-state) #f) - (none) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) @@ -790,7 +789,6 @@ (go-virtual hostile) ) (fort-turret-method-139 self) - (none) ) :code (behavior () (sound-play "turret-up") @@ -845,7 +843,6 @@ ) ) #f - (none) ) :post (behavior () (when (-> self flash-state) @@ -853,7 +850,6 @@ (set-forrescb-turret-flash! (the-as int (-> self flash-index))) ) (enemy-simple-post) - (none) ) ) @@ -863,7 +859,6 @@ :event (the-as (function process int symbol event-message-block object :behavior fort-turret) enemy-event-handler) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) @@ -883,11 +878,9 @@ ) (go-virtual attack) ) - (none) ) :code (behavior () (sleep-code) - (none) ) :post (the-as (function none :behavior fort-turret) enemy-simple-post) ) @@ -905,7 +898,6 @@ (set! (-> self desired-twist) 0.0) (ja-channel-push! 1 (seconds 0.5)) (ja :group! fort-turret-idle-ja) - (none) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) @@ -928,11 +920,9 @@ (if (and (< (fabs (-> self gun-twist)) 364.0889) (< (fabs (-> self gun-tilt)) 364.0889)) (go-virtual sweep) ) - (none) ) :code (behavior () (sleep-code) - (none) ) ) @@ -985,7 +975,6 @@ 0 (set! (-> self hit-points) 0) 0 - (none) ) :code (behavior () (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -1020,11 +1009,9 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (behavior () (track-target! self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/fortress-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/fortress-obs_REF.gc index 35e808bc967..b28c30be755 100644 --- a/test/decompiler/reference/jak2/levels/fortress/fortress-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/fortress-obs_REF.gc @@ -71,17 +71,14 @@ ;; failed to figure out what this is: (defstate idle (fort-trap-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (when (logtest? (-> (the-as attack-info (-> event param 1)) penetrate-using) (penetrate flop)) - (go-virtual die) - #f - ) + :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 (the-as (function none :behavior fort-trap-door) sleep-code) @@ -112,7 +109,6 @@ ) ) ) - (none) ) :code (behavior () ((lambda () @@ -158,7 +154,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior fort-trap-door) ja-post) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc index 853cc7ccb3e..aa2b8b35306 100644 --- a/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc @@ -51,160 +51,154 @@ ;; definition for function dark-lightning-handler ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 119] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 195] (defbehavior dark-lightning-handler process-drawable ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (sv-112 sparticle-launcher) (sv-160 vector) (sv-164 vector) (sv-176 lightning-spec)) (let ((s3-0 (new 'static 'vector4w :x -1)) (s4-0 (new 'static 'vector4w :x -1)) (s5-0 (command-get-process "jak-highres-prison" *target*)) ) - (the-as - object - (cond - ((= arg2 'lightning-claw) - (let ((s1-0 (command-get-process "prsn-chair-shackle" *target*)) - (gp-1 (new 'stack-no-clear 'matrix)) - (s2-0 *prsn-torture-lightning-joints*) - (s3-1 (rand-vu-int-range-exclude 0 (+ (-> *prsn-torture-lightning-joints* length) -1) (-> s3-0 x))) - ) - *prsn-chair-shackle-lightning-joints* - (let ((v1-7 (rand-vu-int-range-exclude 0 (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) (-> s4-0 x)))) - (when s1-0 - (set! (-> s4-0 x) v1-7) - (vector<-cspace! (the-as vector (-> gp-1 vector)) (-> self node-list data 13)) - (vector<-cspace! (-> gp-1 vector 1) (-> self node-list data (-> s2-0 s3-1))) - (vector<-cspace! (-> gp-1 vector 2) (-> self node-list data (+ (-> s2-0 s3-1) 1))) - (vector<-cspace! (-> gp-1 trans) (-> (the-as process-drawable s5-0) node-list data 8)) - (dotimes (s5-1 3) - (process-spawn - lightning-tracker - :init lightning-tracker-init - (-> *lightning-spec-id-table* 19) - (the int (* 300.0 (rand-vu-float-range 1.0 2.0))) - lightning-probe-callback - #f - (+ (the-as uint gp-1) (* s5-1 16)) - (+ (the-as uint gp-1) (* (+ s5-1 1) 16)) - :to self - ) + (cond + ((= arg2 'lightning-claw) + (let ((s1-0 (command-get-process "prsn-chair-shackle" *target*)) + (gp-1 (new 'stack-no-clear 'matrix)) + (s2-0 *prsn-torture-lightning-joints*) + (s3-1 (rand-vu-int-range-exclude 0 (+ (-> *prsn-torture-lightning-joints* length) -1) (-> s3-0 x))) + ) + *prsn-chair-shackle-lightning-joints* + (let ((v1-7 (rand-vu-int-range-exclude 0 (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) (-> s4-0 x)))) + (when s1-0 + (set! (-> s4-0 x) v1-7) + (vector<-cspace! (the-as vector (-> gp-1 vector)) (-> self node-list data 13)) + (vector<-cspace! (-> gp-1 vector 1) (-> self node-list data (-> s2-0 s3-1))) + (vector<-cspace! (-> gp-1 vector 2) (-> self node-list data (+ (-> s2-0 s3-1) 1))) + (vector<-cspace! (-> gp-1 trans) (-> (the-as process-drawable s5-0) node-list data 8)) + (dotimes (s5-1 3) + (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 19) + (the int (* 300.0 (rand-vu-float-range 1.0 2.0))) + lightning-probe-callback + #f + (+ (the-as uint gp-1) (* s5-1 16)) + (+ (the-as uint gp-1) (* (+ s5-1 1) 16)) + :to self ) - #f ) + #f ) ) ) - ((= arg2 'lightning-needle) - (let ((gp-2 (command-get-process "prsn-chair-shackle" *target*))) - *prsn-chair-shackle-lightning-joints* - (let ((v1-38 (rand-vu-int-range-exclude 0 (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) (-> s4-0 x)))) - (when gp-2 - (set! (-> s4-0 x) v1-38) - (let ((s4-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 8))) - (s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s5-0) node-list data 5))) - (s3-3 (get-process *default-dead-pool* lightning-tracker #x4000)) + ) + ((= arg2 'lightning-needle) + (let ((gp-2 (command-get-process "prsn-chair-shackle" *target*))) + *prsn-chair-shackle-lightning-joints* + (let ((v1-38 (rand-vu-int-range-exclude 0 (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) (-> s4-0 x)))) + (when gp-2 + (set! (-> s4-0 x) v1-38) + (let ((s4-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 8))) + (s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s5-0) node-list data 5))) + (s3-3 (get-process *default-dead-pool* lightning-tracker #x4000)) + ) + (when s3-3 + (let ((t9-17 (method-of-type lightning-tracker activate))) + (t9-17 + (the-as lightning-tracker s3-3) + self + (symbol->string (-> lightning-tracker symbol)) + (the-as pointer #x70004000) ) - (when s3-3 - (let ((t9-17 (method-of-type lightning-tracker activate))) - (t9-17 - (the-as lightning-tracker s3-3) - self - (symbol->string (-> lightning-tracker symbol)) - (the-as pointer #x70004000) + ) + (let ((s2-2 run-function-in-process) + (s1-2 s3-3) + (s0-1 lightning-tracker-init) ) - ) - (let ((s2-2 run-function-in-process) - (s1-2 s3-3) - (s0-1 lightning-tracker-init) + (set! sv-176 (-> *lightning-spec-id-table* 19)) + (let ((a3-4 (the int (* 300.0 (rand-vu-float-range 1.0 2.0)))) + (t0-1 lightning-probe-callback) ) - (set! sv-176 (-> *lightning-spec-id-table* 19)) - (let ((a3-4 (the int (* 300.0 (rand-vu-float-range 1.0 2.0)))) - (t0-1 lightning-probe-callback) - ) - ((the-as (function object object object object object object object object none) s2-2) - s1-2 - s0-1 - sv-176 - a3-4 - t0-1 - gp-2 - s4-2 - s5-2 - ) - ) + ((the-as (function object object object object object object object object none) s2-2) + s1-2 + s0-1 + sv-176 + a3-4 + t0-1 + gp-2 + s4-2 + s5-2 + ) ) - (-> s3-3 ppointer) ) + (-> s3-3 ppointer) ) ) ) ) ) - ((= arg2 'lightning-shackle) - (let ((gp-3 (command-get-process "prsn-chair-shackle" *target*)) - (s2-3 *prsn-torture-lightning-joints*) - (s5-3 *prsn-chair-shackle-lightning-joints*) + ) + ((= arg2 'lightning-shackle) + (let ((gp-3 (command-get-process "prsn-chair-shackle" *target*)) + (s2-3 *prsn-torture-lightning-joints*) + (s5-3 *prsn-chair-shackle-lightning-joints*) + ) + (when gp-3 + (when (and (nonzero? (-> self skel)) (nonzero? (-> (the-as process-drawable gp-3) skel))) + (let* ((v1-52 (-> s2-3 length)) + (s1-3 (-> s5-3 length)) + (s0-2 (rand-vu-int-range-exclude 0 (+ v1-52 -1) (-> s3-0 x))) + (s1-4 (rand-vu-int-range-exclude 0 (+ s1-3 -1) (-> s4-0 x))) + ) + (set! sv-112 (-> *part-id-table* 179)) + (set! (-> s3-0 x) s0-2) + (set! (-> s4-0 x) s1-4) + (set! sv-160 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s2-3 s0-2)))) + (set! sv-164 (vector<-cspace! + (new 'stack-no-clear 'vector) + (-> (the-as process-drawable gp-3) node-list data (-> s5-3 s1-4)) + ) + ) ) - (when gp-3 - (when (and (nonzero? (-> self skel)) (nonzero? (-> (the-as process-drawable gp-3) skel))) - (let* ((v1-52 (-> s2-3 length)) - (s1-3 (-> s5-3 length)) - (s0-2 (rand-vu-int-range-exclude 0 (+ v1-52 -1) (-> s3-0 x))) - (s1-4 (rand-vu-int-range-exclude 0 (+ s1-3 -1) (-> s4-0 x))) - ) - (set! sv-112 (-> *part-id-table* 179)) - (set! (-> s3-0 x) s0-2) - (set! (-> s4-0 x) s1-4) - (set! sv-160 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s2-3 s0-2)))) - (set! sv-164 (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> (the-as process-drawable gp-3) node-list data (-> s5-3 s1-4)) - ) - ) - ) - (let ((s4-3 (process-spawn - lightning-tracker - :init lightning-tracker-init - (-> *lightning-spec-id-table* 19) - (the int (* 300.0 (rand-vu-float-range 1.0 2.0))) - lightning-probe-callback - self - sv-160 - sv-164 - :to gp-3 - ) + (let ((s4-3 (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 19) + (the int (* 300.0 (rand-vu-float-range 1.0 2.0))) + lightning-probe-callback + self + sv-160 + sv-164 + :to gp-3 ) - ) - (when (and sv-112 s4-3) - (let ((v1-74 (get-field-spec-by-id sv-112 (sp-field-id spt-timer)))) - (if v1-74 - (set! (-> v1-74 initial-valuef) (the-as float (-> (the-as lightning-tracker (-> s4-3 0)) duration))) - ) - ) - (let ((t9-30 sp-launch-particles-var) - (a0-35 *sp-particle-system-2d*) - (a1-37 sv-112) - (a2-19 *launch-matrix*) ) - (set! (-> a2-19 trans quad) (-> sv-160 quad)) - (t9-30 a0-35 a1-37 a2-19 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) - ) - (let ((t9-31 sp-launch-particles-var) - (a0-36 *sp-particle-system-2d*) - (a1-38 sv-112) - (a2-20 *launch-matrix*) - ) - (set! (-> a2-20 trans quad) (-> sv-164 quad)) - (t9-31 a0-36 a1-38 a2-20 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) - ) + ) + (when (and sv-112 s4-3) + (let ((v1-74 (get-field-spec-by-id sv-112 (sp-field-id spt-timer)))) + (if v1-74 + (set! (-> v1-74 initial-valuef) (the-as float (-> (the-as lightning-tracker (-> s4-3 0)) duration))) + ) + ) + (let ((t9-30 sp-launch-particles-var) + (a0-35 *sp-particle-system-2d*) + (a1-37 sv-112) + (a2-19 *launch-matrix*) + ) + (set! (-> a2-19 trans quad) (-> sv-160 quad)) + (t9-30 a0-35 a1-37 a2-19 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-31 sp-launch-particles-var) + (a0-36 *sp-particle-system-2d*) + (a1-38 sv-112) + (a2-20 *launch-matrix*) + ) + (set! (-> a2-20 trans quad) (-> sv-164 quad)) + (t9-31 a0-36 a1-38 a2-20 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) ) ) ) ) - ) + ) ) ) ) @@ -259,7 +253,6 @@ (ja :num! (loop!)) ) #f - (none) ) :post (behavior () (seek! (-> self path-u) 1.0 (* (-> self path-du) (seconds-per-frame))) @@ -269,7 +262,6 @@ ) (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-u) 'interp) (ja-post) - (none) ) ) @@ -433,8 +425,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (prsn-cell-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('open) (set! (-> self desired) 1.0) (format #t "open~%") @@ -460,7 +452,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior prsn-cell-door) transform-post) ) @@ -551,7 +542,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior prsn-vent-fan) ja-post) ) @@ -621,11 +611,9 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (transform-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc index 44e72c2b6ae..71fd593b553 100644 --- a/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc @@ -60,8 +60,8 @@ ;; failed to figure out what this is: (defstate waiting (fort-elec-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual pop-up) ) @@ -171,8 +171,8 @@ ;; failed to figure out what this is: (defstate red (fort-led) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual green) ) @@ -182,15 +182,14 @@ (setup-masks (-> self draw) 4 2) (ja-post) (sleep-code) - (none) ) ) ;; failed to figure out what this is: (defstate green (fort-led) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go-virtual red) ) @@ -200,7 +199,6 @@ (setup-masks (-> self draw) 2 4) (ja-post) (sleep-code) - (none) ) ) @@ -268,15 +266,15 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate active (elec-lock-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (if (elec-lock-gate-method-31 self (the-as symbol proc)) (go-virtual pre-shutdown) ) ) (else - ((-> (method-of-type elec-gate active) event) proc arg1 event-type event) + ((-> (method-of-type elec-gate active) event) proc argc message block) ) ) ) @@ -307,7 +305,6 @@ This commonly includes things such as: ) ) (go-virtual shutdown) - (none) ) :post (-> (method-of-type elec-lock-gate active) post) ) @@ -322,7 +319,6 @@ This commonly includes things such as: ) ) (set! (-> self all-gone?) #f) - (none) ) :trans (behavior () (let ((gp-0 #t)) @@ -396,7 +392,6 @@ This commonly includes things such as: ) (set! (-> self all-gone?) gp-0) ) - (none) ) :code (behavior () (until (-> self all-gone?) @@ -415,7 +410,6 @@ This commonly includes things such as: (remove-setting! 'interp-time) (process-release? *target*) (go-virtual idle) - (none) ) ) @@ -442,6 +436,7 @@ This commonly includes things such as: ) ;; definition for method 26 of type elec-lock-gate +;; WARN: Return type mismatch object vs none. (defmethod set-state! elec-lock-gate ((obj elec-lock-gate)) "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed make the gate `idle`. diff --git a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc index 43d8195921a..d598feb7d19 100644 --- a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc @@ -46,7 +46,6 @@ (quaternion-rotate-y! (-> self root quat) (-> self init-quat) (+ -2730.6667 (* 5461.3335 f0-0))) ) (rider-post) - (none) ) ) @@ -201,7 +200,6 @@ This commonly includes things such as: (set! (-> v1-0 state mode) (the-as lightning-mode a0-0)) ) (go-virtual running) - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -216,7 +214,6 @@ This commonly includes things such as: ) (+! (-> self path-u) (* (-> self path-du) (seconds-per-frame))) (ja-post) - (none) ) ) @@ -225,13 +222,11 @@ This commonly includes things such as: :virtual #t :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (if (>= (-> self path-u) 1.0) (go-virtual die) ) - (none) ) :code (the-as (function none :behavior fort-elec-belt-inst) sleep-code) :post (behavior () @@ -392,7 +387,6 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) @@ -420,7 +414,6 @@ This commonly includes things such as: ) (suspend) (cleanup-for-death self) - (none) ) ) @@ -527,18 +520,17 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (fort-elec-belt) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('get-point-norm) - (get-point-at-percent-along-path! - (-> self path) - (the-as vector (-> event param 0)) - (the-as float (-> event param 1)) - 'interp - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('get-point-norm) + (get-point-at-percent-along-path! + (-> self path) + (the-as vector (-> block param 0)) + (the-as float (-> block param 1)) + 'interp + ) + ) + ) ) :trans (behavior () (set-forrescb-electricity-scale! 1.0 0) @@ -554,7 +546,6 @@ This commonly includes things such as: ) (set! (-> self next-spawn-time) (get-timeframe-offset! (-> self sync) 0)) ) - (none) ) :code (the-as (function none :behavior fort-elec-belt) sleep-code) ) diff --git a/test/decompiler/reference/jak2/levels/gungame/gun-dummy_REF.gc b/test/decompiler/reference/jak2/levels/gungame/gun-dummy_REF.gc index ac106d8629f..b670f89e07e 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gun-dummy_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gun-dummy_REF.gc @@ -2303,79 +2303,76 @@ ;; failed to figure out what this is: (defstate idle (gun-dummy) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('combo) - (set! (-> self last-combo-time) (current-time)) - #t - ) - (('track) - (cond - ((-> event param 0) - (if (and (not (logtest? (-> self info flags) (tpath-flags citizen))) (> (-> self hit-points) 0)) - #t - 'abort - ) - ) - (else - (and (not (logtest? (-> self info flags) (tpath-flags citizen))) (> (-> self hit-points) 0)) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('combo) + (set! (-> self last-combo-time) (current-time)) + #t + ) + (('track) + (cond + ((-> block param 0) + (if (and (not (logtest? (-> self info flags) (tpath-flags citizen))) (> (-> self hit-points) 0)) + #t + 'abort + ) + ) + (else + (and (not (logtest? (-> self info flags) (tpath-flags citizen))) (> (-> self hit-points) 0)) ) ) - (('attack) - (let ((attack-info (the-as attack-info (-> event param 1)))) - (get-penetrate-using-from-attack-event (the-as process-drawable proc) event) - (when (or (not (logtest? (-> self info flags) (tpath-flags peace))) - (and (logtest? (-> self info flags) (tpath-flags peace)) - (or (= (-> attack-info mode) 'eco-dark) (= (-> attack-info mode) 'explode)) - ) - ) - (when (!= (-> attack-info id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> attack-info id)) - (let ((proc-draw (if (type? proc process-drawable) - (the-as process-drawable proc) - ) - ) - ) - (when proc-draw - (let ((cshape (-> proc-draw root))) - (when (if (type? cshape collide-shape) - cshape - ) - (vector+float*! (-> self impact) (-> self root trans) *up-vector* 8192.0) - (vector+! - (-> self impact) - (-> self impact) - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)) 4096.0) - ) + ) + (('attack) + (let ((attack-info (the-as attack-info (-> block param 1)))) + (get-penetrate-using-from-attack-event (the-as process-drawable proc) block) + (when (or (not (logtest? (-> self info flags) (tpath-flags peace))) + (and (logtest? (-> self info flags) (tpath-flags peace)) + (or (= (-> attack-info mode) 'eco-dark) (= (-> attack-info mode) 'explode)) + ) + ) + (when (!= (-> attack-info id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> attack-info id)) + (let ((proc-draw (if (type? proc process-drawable) + (the-as process-drawable proc) + ) + ) + ) + (when proc-draw + (let ((cshape (-> proc-draw root))) + (when (if (type? cshape collide-shape) + cshape + ) + (vector+float*! (-> self impact) (-> self root trans) *up-vector* 8192.0) + (vector+! + (-> self impact) + (-> self impact) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)) 4096.0) ) ) - (cond - ((= (-> self hit-points) 2) - (set! (-> self rot-y-offset) 262144.0) - (set! (-> self spin-sound) (sound-play "target-spin")) - ) - (else - (if (and (logtest? (process-mask projectile) (-> proc-draw mask)) - (< (- (current-time) (-> self last-combo-time)) (seconds 1)) - ) - (send-event (ppointer->process (-> self parent)) 'combo) - ) - ) + ) + (cond + ((= (-> self hit-points) 2) + (set! (-> self rot-y-offset) 262144.0) + (set! (-> self spin-sound) (sound-play "target-spin")) + ) + (else + (if (and (logtest? (process-mask projectile) (-> proc-draw mask)) + (< (- (current-time) (-> self last-combo-time)) (seconds 1)) + ) + (send-event (ppointer->process (-> self parent)) 'combo) + ) ) - (if (> (-> self hit-points) 0) - (+! (-> self hit-points) -1) - ) - #t ) + (if (> (-> self hit-points) 0) + (+! (-> self hit-points) -1) + ) + #t ) ) ) ) ) - ) + ) ) ) :enter (behavior () @@ -2385,11 +2382,9 @@ (set! (-> self rot-y-offset) 0.0) (set! (-> self first-time-command) #t) (set! (-> self done? value) (the-as object #f)) - (none) ) :exit (behavior () (logior! (-> self info flags) (tpath-flags broken)) - (none) ) :code (behavior () (while (not (-> self done? value)) @@ -2411,7 +2406,6 @@ 0 ) (cleanup-for-death self) - (none) ) :post (behavior () (set! (-> self done? value) (not (path-playing? self))) @@ -2440,7 +2434,6 @@ (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (-> self rot-y-offset)) (quaternion-slerp! (-> self root quat) (-> self root quat) (-> self quat-ground) (-> self inout-percent)) (transform-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc index 2d65ab906b5..a6aebf104c9 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc @@ -199,7 +199,6 @@ ) ) ) - (none) ) ) @@ -314,11 +313,9 @@ This commonly includes things such as: :enter (behavior () (set! (-> self start-time) 0) 0 - (none) ) :exit (behavior () '() - (none) ) :code (behavior () (until #f @@ -413,12 +410,10 @@ This commonly includes things such as: ) (task-node-close! (game-task-node city-red-gun-training-introduction)) (go-virtual red-training) - (none) ) :post (behavior () (training-manager-method-32 self) (training-manager-method-31 self) - (none) ) ) @@ -428,11 +423,9 @@ This commonly includes things such as: :enter (behavior () (set! (-> self start-time) 0) 0 - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (when (and (zero? (-> self start-time)) @@ -516,7 +509,6 @@ This commonly includes things such as: (if (task-node-open? (game-task-node city-yellow-gun-training-introduction)) (go-virtual yellow-training-intro) ) - (none) ) :code (behavior () (suspend) @@ -573,12 +565,10 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (training-manager-method-32 self) (training-manager-method-31 self) - (none) ) ) @@ -587,11 +577,9 @@ This commonly includes things such as: :enter (behavior () (set! (-> self start-time) 0) 0 - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (when (and (zero? (-> self start-time)) (cpad-pressed? 0 confirm)) @@ -636,7 +624,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (training-manager-method-24 self) @@ -695,12 +682,10 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (training-manager-method-32 self) (training-manager-method-31 self) - (none) ) ) @@ -710,11 +695,9 @@ This commonly includes things such as: :enter (behavior () (set! (-> self start-time) 0) 0 - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (if (task-node-open? (game-task-node city-yellow-gun-training-introduction)) @@ -896,7 +879,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (local-vars (a0-3 object) (a0-7 object)) @@ -977,12 +959,10 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (training-manager-method-32 self) (training-manager-method-31 self) - (none) ) ) @@ -1013,10 +993,10 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate yellow-training-intro (training-manager) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('path) - (let ((v1-2 (training-manager-method-21 self (the-as handle (-> event param 0))))) + (let ((v1-2 (training-manager-method-21 self (the-as handle (-> block param 0))))) (if v1-2 (-> (the-as process-drawable (if v1-2 (the-as process-drawable (-> v1-2 extra process)) @@ -1041,11 +1021,9 @@ This commonly includes things such as: :enter (behavior () (set! (-> self start-time) 0) (training-manager-method-27 self *yellow-training-path-combo-info*) - (none) ) :exit (behavior () '() - (none) ) :code (behavior () (until #f @@ -1139,7 +1117,6 @@ This commonly includes things such as: ) (task-node-close! (game-task-node city-yellow-gun-training-introduction)) (go yellow-training) - (none) ) :post (behavior () (training-manager-method-32 self) @@ -1147,18 +1124,17 @@ This commonly includes things such as: (training-manager-method-22 self #t) ) (training-manager-method-31 self) - (none) ) ) ;; failed to figure out what this is: (defstate course (training-manager) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (case event-type + (case message (('score) - (let ((a1-3 (-> event param 0)) + (let ((a1-3 (-> block param 0)) (v1-1 (the-as process-taskable proc)) ) (+! (-> self score) a1-3) @@ -1180,7 +1156,7 @@ This commonly includes things such as: v0-0 ) (('path) - (let ((v1-9 (training-manager-method-21 self (the-as handle (-> event param 0))))) + (let ((v1-9 (training-manager-method-21 self (the-as handle (-> block param 0))))) (if v1-9 (-> (the-as process-drawable (if v1-9 (the-as process-drawable (-> v1-9 extra process)) @@ -1300,7 +1276,6 @@ This commonly includes things such as: (sound-play "course-clear") ) ) - (none) ) :exit (behavior () (cond @@ -1313,7 +1288,6 @@ This commonly includes things such as: ((= (-> self course) *peace-training-path-global-info*) ) ) - (none) ) :trans (behavior () (set! (-> *game-info* score) (the float (-> self score))) @@ -1487,7 +1461,6 @@ This commonly includes things such as: ((= (-> self course) *peace-training-path-global-info*) ) ) - (none) ) :code (the-as (function none :behavior training-manager) sleep-code) :post (behavior () @@ -1697,17 +1670,16 @@ This commonly includes things such as: ) (vector-rotate-around-y! gp-5 gp-5 4460.999) ) - (none) ) ) ;; failed to figure out what this is: (defstate end-course (training-manager) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('path) - (let ((v1-2 (training-manager-method-21 self (the-as handle (-> event param 0))))) + (let ((v1-2 (training-manager-method-21 self (the-as handle (-> block param 0))))) (if v1-2 (-> (the-as process-drawable (if v1-2 (the-as process-drawable (-> v1-2 extra process)) @@ -1891,18 +1863,15 @@ This commonly includes things such as: ) ) ) - (none) ) :exit (behavior () (set! (-> self egg-count) 0) (remove-setting! 'features) (send-event (handle->process (-> self hud-score)) 'hide-and-die) (send-event (handle->process (-> self hud-goal)) 'hide-and-die) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) @@ -1953,11 +1922,9 @@ This commonly includes things such as: (suspend) ) (training-manager-method-28 self) - (none) ) :post (behavior () '() - (none) ) ) @@ -2222,13 +2189,12 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate wait (training-manager) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('start) - (the-as symbol (training-manager-method-28 self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('start) + (training-manager-method-28 self) + ) + ) ) :code (the-as (function none :behavior training-manager) sleep-code) ) @@ -2356,15 +2322,15 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (gungame-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('open) (set! (-> self train) (process->handle proc)) - (set! (-> self open-side) (the-as symbol (-> event param 0))) + (set! (-> self open-side) (the-as symbol (-> block param 0))) (go-virtual open) ) (('player-in-open-area?) - (set! (-> self open-side) (the-as symbol (-> event param 0))) + (set! (-> self open-side) (the-as symbol (-> block param 0))) (gungame-door-method-24 self) ) (('closed?) @@ -2379,17 +2345,16 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate open (gungame-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('closed?) - #f - ) - (('player-in-open-area?) - (set! (-> self open-side) (the-as symbol (-> event param 0))) - (gungame-door-method-24 self) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('closed?) + #f + ) + (('player-in-open-area?) + (set! (-> self open-side) (the-as symbol (-> block param 0))) + (gungame-door-method-24 self) + ) + ) ) :enter (behavior () (set! (-> self last-player-dist) @@ -2405,11 +2370,9 @@ This commonly includes things such as: ) (set! (-> self close-state) (the-as uint 0)) 0 - (none) ) :trans (behavior () (gungame-door-method-23 self) - (none) ) :code (behavior () (sound-play "gungame-door") @@ -2434,7 +2397,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior gungame-door) transform-post) ) @@ -2517,21 +2479,19 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate close (gungame-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('closed?) - #f - ) - (('player-in-open-area?) - (set! (-> self open-side) (the-as symbol (-> event param 0))) - (gungame-door-method-24 self) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('closed?) + #f + ) + (('player-in-open-area?) + (set! (-> self open-side) (the-as symbol (-> block param 0))) + (gungame-door-method-24 self) + ) + ) ) :enter (behavior () (set! (-> self close-sound) (sound-play "door-close-all")) - (none) ) :code (behavior () (let ((gp-0 #t)) @@ -2562,7 +2522,6 @@ This commonly includes things such as: #f (label cfg-12) (go-virtual idle) - (none) ) :post (the-as (function none :behavior gungame-door) transform-post) ) @@ -2656,7 +2615,7 @@ This commonly includes things such as: ) ) ) - (the-as object 0) + 0 ) ) @@ -2665,17 +2624,16 @@ This commonly includes things such as: *game-info* (game-task-node sewer-enemy-resolution) TASK_MANAGER_UPDATE_HOOK - (lambda :behavior task-manager () (the-as object (gui-control-method-12 - *gui-control* - self - (gui-channel art-load) - (gui-action queue) - (-> self info resolution-scene) - 0 - -99.0 - (new 'static 'sound-id) - ) - ) + (lambda :behavior task-manager () (gui-control-method-12 + *gui-control* + self + (gui-channel art-load) + (gui-action queue) + (-> self info resolution-scene) + 0 + -99.0 + (new 'static 'sound-id) + ) ) ) @@ -2706,7 +2664,7 @@ This commonly includes things such as: ) ) ) - (the-as object 0) + 0 ) ) @@ -2715,17 +2673,16 @@ This commonly includes things such as: *game-info* (game-task-node sewer-escort-get-gun) TASK_MANAGER_UPDATE_HOOK - (lambda :behavior task-manager () (the-as object (gui-control-method-12 - *gui-control* - self - (gui-channel art-load) - (gui-action queue) - (-> self info resolution-scene) - 0 - -99.0 - (new 'static 'sound-id) - ) - ) + (lambda :behavior task-manager () (gui-control-method-12 + *gui-control* + self + (gui-channel art-load) + (gui-action queue) + (-> self info resolution-scene) + 0 + -99.0 + (new 'static 'sound-id) + ) ) ) diff --git a/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc b/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc index 3fb91eaab83..adaa751a326 100644 --- a/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc @@ -176,7 +176,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior hide-light) ja-post) ) diff --git a/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc index d74a48490a3..169ca201e6d 100644 --- a/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc @@ -504,7 +504,3 @@ This commonly includes things such as: (go (method-of-object obj idle)) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc index 49e777e0883..94de7e7b095 100644 --- a/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc @@ -121,7 +121,6 @@ This commonly includes things such as: :code (behavior () (ja-post) (sleep-code) - (none) ) ) @@ -175,7 +174,6 @@ This commonly includes things such as: (process-taskable-anim-loop (lambda ((arg0 process-taskable)) (handle->process (-> arg0 slave)))) (remove-setting! 'borrow) (go-virtual idle) - (none) ) ) @@ -221,7 +219,6 @@ This commonly includes things such as: (ja :num-func num-func-identity :frame-num (ja-aframe f0-1 0)) ) (ja-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc index 05cbc40d9b2..81d68a3f536 100644 --- a/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc +++ b/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc @@ -1529,10 +1529,10 @@ ;; failed to figure out what this is: (defstate idle (hip-mole) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('active) - (go-virtual active (the-as time-frame (-> event param 0)) (-> event param 1)) + (go-virtual active (the-as time-frame (-> block param 0)) (-> block param 1)) ) ) ) @@ -1542,7 +1542,6 @@ (ja-channel-push! 1 (seconds 0.05)) (ja :group! (-> self draw art-group data 3) :num! min) (sleep-code) - (none) ) :post (behavior () (let* ((s5-0 (handle->process (-> self cabinet))) @@ -1587,15 +1586,14 @@ ) ) (ja-post) - (none) ) ) ;; failed to figure out what this is: (defstate active (hip-mole) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch) (case (-> self mode) ((10) @@ -1634,11 +1632,9 @@ (sound-play "whack-up") (set! (-> self sound-id) (sound-play "whack-bounce")) (set! (-> self abort?) #f) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (case (-> self mode) @@ -1668,7 +1664,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 time-frame) (arg1 uint)) (ja-no-eval :group! (-> self draw art-group data 3) @@ -1706,7 +1701,6 @@ ) ) (go-virtual idle) - (none) ) :post (-> (method-of-type hip-mole idle) post) ) @@ -2158,7 +2152,6 @@ (ja-channel-set! 0) (ja-post) (sleep-code) - (none) ) ) @@ -2177,23 +2170,21 @@ (send-event-function *target* a1-1) (go-virtual active #t (the-as int a1-1)) ) - (none) ) ) ;; failed to figure out what this is: (defstate active (whack-a-metal) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('done) - (let ((v0-0 (+ (-> self miss-count) 1))) - (set! (-> self miss-count) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('done) + (let ((v0-0 (+ (-> self miss-count) 1))) + (set! (-> self miss-count) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior ((arg0 symbol) (arg1 int)) (when arg0 @@ -2223,7 +2214,6 @@ (set! (-> self hud-goal) (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :to self))) ) ) - (none) ) :exit (behavior () (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -2254,7 +2244,6 @@ (want-display-level *load-state* 'ctyport 'display) (want-display-level *load-state* 'ctywide 'display) ) - (none) ) :trans (behavior () (cond @@ -2280,7 +2269,6 @@ (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons up right down left l1 r1 triangle circle x square) ) - (none) ) :code (behavior ((arg0 symbol) (arg1 int)) (local-vars @@ -2414,12 +2402,10 @@ ) ) #f - (none) ) :post (behavior () (whack-a-metal-method-27 self) (ja-post) - (none) ) ) @@ -2719,7 +2705,6 @@ (go-virtual active #f (the-as int a1-9)) ) ) - (none) ) :post (-> (method-of-type whack-a-metal active) post) ) @@ -2790,12 +2775,10 @@ ) ) ) - (none) ) :post (behavior () (whack-a-metal-method-28 self) (ja-post) - (none) ) ) @@ -2865,7 +2848,6 @@ (ja-channel-set! 0) (ja-post) (set-blackout-frames (seconds 0.2)) - (none) ) :post (-> (method-of-type whack-a-metal lose) post) ) diff --git a/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc b/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc index 9262d895d49..63295130f79 100644 --- a/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc @@ -61,8 +61,8 @@ ;; failed to figure out what this is: (defstate idle (intro-flamer) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go-virtual die) ) @@ -84,7 +84,6 @@ ) (set! (-> self flit-timer) (the-as uint (current-time))) ) - (none) ) :code (behavior () (ja-channel-set! 1) @@ -104,7 +103,6 @@ ) ) #f - (none) ) :post (behavior () (seek! (-> self path-u) 1.0 (* (-> self path-du) (seconds-per-frame))) @@ -212,7 +210,6 @@ ) ) (ja-post) - (none) ) ) @@ -222,7 +219,6 @@ :code (behavior () (suspend) (cleanup-for-death self) - (none) ) ) @@ -322,13 +318,13 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (metalhead-spawner) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual active) ) (('path) - (-> self path-tbl (-> event param 0)) + (-> self path-tbl (-> block param 0)) ) ) ) @@ -338,8 +334,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate active (metalhead-spawner) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go-virtual idle) ) @@ -347,7 +343,7 @@ This commonly includes things such as: (go-virtual die) ) (('path) - (-> self path-tbl (-> event param 0)) + (-> self path-tbl (-> block param 0)) ) ) ) @@ -374,13 +370,11 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (dotimes (gp-0 19) (debug-draw (-> self path-tbl gp-0)) ) - (none) ) ) @@ -398,7 +392,6 @@ This commonly includes things such as: (suspend) ) (process-entity-status! self (entity-perm-status dead) #t) - (none) ) ) @@ -492,7 +485,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior vil-windmill-sail) ja-post) ) diff --git a/test/decompiler/reference/jak2/levels/mountain/canyon/mincan-obs_REF.gc b/test/decompiler/reference/jak2/levels/mountain/canyon/mincan-obs_REF.gc index 0d49f6ad27f..e714119be92 100644 --- a/test/decompiler/reference/jak2/levels/mountain/canyon/mincan-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/canyon/mincan-obs_REF.gc @@ -96,7 +96,6 @@ (if (task-node-closed? (game-task-node canyon-insert-items-resolution)) (go-virtual erect) ) - (none) ) :code (behavior () (until #f @@ -110,7 +109,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior mincan-lighthouse-lens) ja-post) ) @@ -131,7 +129,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior mincan-lighthouse-lens) ja-post) ) @@ -217,7 +214,6 @@ This commonly includes things such as: (if (task-node-closed? (game-task-node canyon-insert-items-resolution)) (go-virtual erect) ) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -232,7 +228,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior mincan-lighthouse) ja-post) ) @@ -253,7 +248,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior mincan-lighthouse) ja-post) ) @@ -319,7 +313,6 @@ This commonly includes things such as: (if (task-node-closed? (game-task-node canyon-insert-items-resolution)) (go-virtual open) ) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -334,7 +327,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior mincan-lens) transform-post) ) @@ -355,7 +347,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior mincan-lens) transform-post) ) @@ -491,7 +482,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior mincan-cogs) ja-post) ) diff --git a/test/decompiler/reference/jak2/levels/mountain/mountain-obs2_REF.gc b/test/decompiler/reference/jak2/levels/mountain/mountain-obs2_REF.gc index c79ee57ba7d..f7ac37c2bf3 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-obs2_REF.gc @@ -42,7 +42,6 @@ (if (task-node-closed? (game-task-node canyon-insert-items-door)) (go-virtual open) ) - (none) ) :code (behavior () (let ((root-prim (-> self root root-prim))) @@ -52,7 +51,6 @@ (ja :num-func num-func-identity :frame-num 0.0) (ja-post) (sleep-code) - (none) ) ) @@ -63,7 +61,6 @@ (if (not (task-node-closed? (game-task-node canyon-insert-items-door))) (go-virtual close) ) - (none) ) :code (behavior () (let ((root-prim (-> self root root-prim))) @@ -74,7 +71,6 @@ (ja :num-func num-func-identity :frame-num max) (ja-post) (sleep-code) - (none) ) ) @@ -231,83 +227,80 @@ For example for an elevator pre-compute the distance between the first and last ;; failed to figure out what this is: (defstate plat-path-active (mtn-plat-shoot) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('bonk) - (the-as object (start-bouncing! self)) - ) - (('attack) - (when (zero? (-> self state-flip)) - (let ((attack-info (the-as object (-> event param 1)))) - (when (!= (-> (the-as attack-info attack-info) id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> (the-as attack-info attack-info) id)) - (let* ((attacking-proc proc) - (attacker (if (type? attacking-proc process-drawable) - (the-as process-drawable attacking-proc) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (start-bouncing! self) + ) + (('attack) + (when (zero? (-> self state-flip)) + (let ((attack-info (the-as object (-> block param 1)))) + (when (!= (-> (the-as attack-info attack-info) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info attack-info) id)) + (let* ((attacking-proc proc) + (attacker (if (type? attacking-proc process-drawable) + (the-as process-drawable attacking-proc) + ) + ) + ) + (when attacker + (let* ((attacker-root (-> attacker root)) + (cshape (if (type? attacker-root collide-shape) + (the-as collide-shape attacker-root) ) ) - ) - (when attacker - (let* ((attacker-root (-> attacker root)) - (cshape (if (type? attacker-root collide-shape) - (the-as collide-shape attacker-root) - ) - ) - ) - (when cshape - (when (logtest? (-> cshape root-prim prim-core collide-as) (collide-spec projectile)) - (when (zero? (-> self state-flip)) - (sound-play "mtn-plat-flip1") - (set! (-> self state-flip) (the-as uint 1)) - ) - (set! (-> self hint-count) -1.0) - (vector-! (-> self axe-flip) (-> cshape trans) (-> self root trans)) - (set! (-> self axe-flip y) 0.0) - (vector-normalize! (-> self axe-flip) 1.0) - (vector-rotate90-around-y! (-> self axe-flip) (-> self axe-flip)) - (set! (-> self angle-flip-vel) -10.0) - (set! (-> self state-time) (current-time)) + ) + (when cshape + (when (logtest? (-> cshape root-prim prim-core collide-as) (collide-spec projectile)) + (when (zero? (-> self state-flip)) + (sound-play "mtn-plat-flip1") + (set! (-> self state-flip) (the-as uint 1)) ) + (set! (-> self hint-count) -1.0) + (vector-! (-> self axe-flip) (-> cshape trans) (-> self root trans)) + (set! (-> self axe-flip y) 0.0) + (vector-normalize! (-> self axe-flip) 1.0) + (vector-rotate90-around-y! (-> self axe-flip) (-> self axe-flip)) + (set! (-> self angle-flip-vel) -10.0) + (set! (-> self state-time) (current-time)) ) ) ) ) - #f ) + #f ) ) ) - (('hint) - (when (>= (-> self hint-count) 0.0) - (+! (-> self hint-count) (seconds-per-frame)) - (when (< (rand-vu-float-range 6.0 10.0) (-> self hint-count)) - (talker-spawn-func (-> *talker-speech* 56) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self hint-count) 0.0) - ) + ) + (('hint) + (when (>= (-> self hint-count) 0.0) + (+! (-> self hint-count) (seconds-per-frame)) + (when (< (rand-vu-float-range 6.0 10.0) (-> self hint-count)) + (talker-spawn-func (-> *talker-speech* 56) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self hint-count) 0.0) ) ) - (('track) - (cond - ((-> event param 0) - (if (zero? (-> self state-flip)) - #t - 'abort - ) - ) - ((and *target* - (-> self disable-track-under) - (< (-> *target* control trans y) (+ -20480.0 (-> self root trans y))) - ) - #f - ) - (else - (zero? (-> self state-flip)) - ) + ) + (('track) + (cond + ((-> block param 0) + (if (zero? (-> self state-flip)) + #t + 'abort + ) + ) + ((and *target* + (-> self disable-track-under) + (< (-> *target* control trans y) (+ -20480.0 (-> self root trans y))) + ) + #f + ) + (else + (zero? (-> self state-flip)) ) ) - ) + ) ) ) :enter (behavior () @@ -319,7 +312,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> self dest-angle) 180.0) (set! (-> self on-shake) #f) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (the int (-> self time-flip))) @@ -372,7 +364,6 @@ For example for an elevator pre-compute the distance between the first and last (func) ) ) - (none) ) :post (behavior () (let ((func (-> (method-of-type plat plat-path-active) post))) @@ -380,7 +371,6 @@ For example for an elevator pre-compute the distance between the first and last ((the-as (function none) func)) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc b/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc index ae16bb210fb..0fbddbb5de7 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc @@ -151,7 +151,6 @@ (t9-0) ) ) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type basebutton down-idle) trans))) @@ -162,7 +161,6 @@ (if (and (not (task-node-closed? (game-task-node mountain-shard-dice))) (< 1 *dice-back-way-num*)) (go-virtual going-up) ) - (none) ) ) @@ -172,7 +170,6 @@ :enter (behavior () (sound-play "dice-button") (press! self #t) - (none) ) ) @@ -413,7 +410,6 @@ ) (sound-play "dice-sink") (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (set! (-> self draw color-mult quad) (-> self color quad)) @@ -466,7 +462,6 @@ (set! (-> self active) (-> self first)) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior mtn-dice) sleep-code) :post (the-as (function none :behavior mtn-dice) transform-post) @@ -786,10 +781,10 @@ ;; failed to figure out what this is: (defstate idle (mtn-dice) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (sv-192 vector)) (cond - ((= event-type 'print-info) + ((= message 'print-info) (dotimes (gp-1 6) (let ((s5-1 (-> self face-matrix gp-1))) (format #t "(static-mtn-dice-info (") @@ -802,7 +797,7 @@ ) #f ) - ((= event-type 'trigger) + ((= message 'trigger) (mem-set32! (the-as pointer *dice-blocked-array*) 13 0) (set! (-> *dice-blocked-array* 1) (the-as uint 256)) (set! *dice-back-way-num* 0) @@ -814,7 +809,7 @@ (go-virtual restart) ) ) - ((= event-type 'hint) + ((= message 'hint) (when (>= (-> self hint-count) 0.0) (+! (-> self hint-count) (seconds-per-frame)) (if (< 6.0 (-> self hint-count)) @@ -822,7 +817,7 @@ ) ) ) - ((= event-type 'touch) + ((= message 'touch) (let* ((s3-0 proc) (s2-0 proc) (s4-1 (if (type? s2-0 process-focusable) @@ -836,7 +831,7 @@ ) ) (when s3-1 - (let* ((s2-2 (the-as object (-> event param 0))) + (let* ((s2-2 (the-as object (-> block param 0))) (s1-0 (-> (the-as touching-shapes-entry s2-2) head)) ) (while s1-0 @@ -870,7 +865,7 @@ (s0-2 (vector-! s0-1 sv-192 v1-42)) ) (vector-float*! s0-2 s0-2 0.5) - (send-event proc 'shove (-> event param 0) (static-attack-info ((id (new-attack-id)) (vector s0-2)))) + (send-event proc 'shove (-> block param 0) (static-attack-info ((id (new-attack-id)) (vector s0-2)))) ) ) ) @@ -885,9 +880,9 @@ ) ) ) - ((= event-type 'attack) + ((= message 'attack) (when (= (-> self active) 1) - (let ((v1-56 (the-as object (-> event param 1)))) + (let ((v1-56 (the-as object (-> block param 1)))) (when (!= (-> (the-as attack-info v1-56) id) (-> self incoming-attack-id)) (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-56) id)) (let ((s3-2 proc) @@ -901,7 +896,7 @@ (empty) ) ) - (let* ((gp-3 (-> event param 0)) + (let* ((gp-3 (-> block param 0)) (a1-26 (mtn-dice-method-26 self s4-2 (the-as touching-shapes-entry gp-3))) ) (cond @@ -930,7 +925,6 @@ (set! (-> self curtime) 0) (set! (-> self first-touch-time) 0) 0 - (none) ) :trans (behavior () (if (nonzero? (-> self curtime)) @@ -939,7 +933,6 @@ (set! (-> self curtime) (current-time)) (when (and (zero? (-> self active)) (dice-wrong-way?)) ) - (none) ) :code (the-as (function none :behavior mtn-dice) sleep-code) :post (behavior () @@ -980,7 +973,6 @@ (when (= (-> self first) 1) ) (rider-post) - (none) ) ) @@ -991,17 +983,14 @@ (set! (-> self curtime) 0) (set! (-> self first-touch-time) 0) 0 - (none) ) :trans (behavior () '() - (none) ) :code (the-as (function none :behavior mtn-dice) sleep-code) :post (behavior () (rider-trans) (rider-post) - (none) ) ) @@ -1026,7 +1015,6 @@ (set! (-> self state-time) (current-time)) (set! (-> self time-anim) 1.0) (set! (-> self speed-anim) -0.5) - (none) ) :trans (behavior () (set! (-> self draw color-mult quad) (-> self color quad)) @@ -1076,12 +1064,10 @@ ) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior mtn-dice) sleep-code) :post (behavior () (transform-post) - (none) ) ) @@ -1093,7 +1079,6 @@ (set! (-> self speed-anim) 0.0) (set! (-> self state-time) (current-time)) (sound-play "dice-sink") - (none) ) :trans (behavior () (set! (-> self draw color-mult quad) (-> self color quad)) @@ -1112,7 +1097,6 @@ ) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior mtn-dice) sleep-code) :post (the-as (function none :behavior mtn-dice) transform-post) @@ -1672,7 +1656,6 @@ This commonly includes things such as: (set! (-> self path-pos) (get-norm! (-> self sync) 0)) (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (plat-trans) - (none) ) :code (behavior () (until #f @@ -1686,7 +1669,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior mtn-plat-updown) plat-post) ) @@ -1823,8 +1805,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate wait (mtn-plat-eject) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('eject) (go-virtual eject) ) @@ -1840,7 +1822,6 @@ This commonly includes things such as: (process-entity-status! self (entity-perm-status subtask-complete) #t) (ja-channel-push! 1 0) (ja-no-eval :group! (-> self draw art-group data 3) :num! (loop!) :frame-num 0.0) - (none) ) :code (the-as (function none :behavior mtn-plat-eject) sleep-code) :post (behavior () @@ -1849,7 +1830,6 @@ This commonly includes things such as: (vector+! (-> self root trans) (-> self root trans) gp-1) ) (transform-post) - (none) ) ) @@ -1963,7 +1943,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior mtn-plat-long) plat-post) ) @@ -2068,8 +2047,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (mtn-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual open) ) @@ -2108,7 +2087,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior mtn-gate) transform-post) ) @@ -2326,7 +2304,6 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) @@ -2366,10 +2343,10 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (mtn-aval-rocks) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('draw) - (if (-> event param 0) + (if (-> block param 0) (go-virtual fall) ) ) @@ -2383,7 +2360,6 @@ This commonly includes things such as: (go-virtual fall) ) ) - (none) ) :code (behavior () (ja-channel-set! 0) @@ -2391,18 +2367,17 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) ;; failed to figure out what this is: (defstate fall (mtn-aval-rocks) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (a2-3 int)) - (case event-type + (case message (('touch 'attack) - (let ((s3-0 (-> event param 0)) + (let ((s3-0 (-> block param 0)) (s4-0 0) ) (when s3-0 @@ -2426,7 +2401,7 @@ This commonly includes things such as: (set! (-> a1-4 from) (process->ppointer self)) (set! (-> a1-4 num-params) 2) (set! (-> a1-4 message) 'attack) - (set! (-> a1-4 param 0) (-> event param 0)) + (set! (-> a1-4 param 0) (-> block param 0)) (let ((v1-11 (new 'static 'attack-info :mask (attack-mask shove-up id damage)))) (set! a2-3 (cond ((nonzero? s4-0) @@ -2451,7 +2426,7 @@ This commonly includes things such as: ) ) (('draw) - (if (not (-> event param 0)) + (if (not (-> block param 0)) (go-virtual idle) ) ) @@ -2475,7 +2450,6 @@ This commonly includes things such as: (set! (-> v1-10 params mask) (the-as uint 17)) (-> v1-10 id) ) - (none) ) :code (behavior () (let ((gp-0 2) @@ -2518,7 +2492,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (local-vars (sv-16 vector-array) (sv-20 vector) (sv-48 float) (sv-52 symbol)) @@ -2618,7 +2591,6 @@ This commonly includes things such as: ) (seek! (-> sv-16 data gp-0 w) 0.0 1.0) ) - (none) ) ) @@ -2808,8 +2780,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate waiting (mtn-plat-return) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (let ((v0-0 (the-as object (logior (-> self flags) (mtn-plat-flags mtpflags-0))))) (set! (-> self flags) (the-as mtn-plat-flags v0-0)) @@ -2817,14 +2789,13 @@ This commonly includes things such as: ) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) :enter (behavior () (set! (-> self ride-timer) (current-time)) (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) - (none) ) :trans (behavior () (logclear! (-> self flags) (mtn-plat-flags mtpflags-0)) @@ -2849,7 +2820,6 @@ This commonly includes things such as: (go-virtual running) ) ) - (none) ) :code (the-as (function none :behavior mtn-plat-return) sleep-code) :post (the-as (function none :behavior mtn-plat-return) plat-post) @@ -2858,8 +2828,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate running (mtn-plat-return) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (let ((v0-0 (the-as object (logior (-> self flags) (mtn-plat-flags mtpflags-0))))) (set! (-> self flags) (the-as mtn-plat-flags v0-0)) @@ -2867,7 +2837,7 @@ This commonly includes things such as: ) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -2876,7 +2846,6 @@ This commonly includes things such as: (go-virtual waiting-for-no-player) ) (plat-trans) - (none) ) :code (the-as (function none :behavior mtn-plat-return) sleep-code) :post (behavior () @@ -2888,15 +2857,14 @@ This commonly includes things such as: 'interp ) (plat-post) - (none) ) ) ;; failed to figure out what this is: (defstate waiting-for-no-player (mtn-plat-return) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (let ((v0-0 (the-as object (current-time)))) (set! (-> self ride-timer) (the-as time-frame v0-0)) @@ -2904,7 +2872,7 @@ This commonly includes things such as: ) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -2921,7 +2889,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior mtn-plat-return) sleep-code) :post (the-as (function none :behavior mtn-plat-return) plat-post) @@ -3020,12 +2987,11 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate running (mtn-plat-gap) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (plat-event proc arg1 event-type event) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (plat-event proc argc message block) ) :trans (behavior () (plat-trans) - (none) ) :code (the-as (function none :behavior mtn-plat-gap) sleep-code) :post (behavior () @@ -3037,32 +3003,29 @@ This commonly includes things such as: 'interp ) (plat-post) - (none) ) ) ;; failed to figure out what this is: (defstate waiting (mtn-plat-gap) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (set! (-> self dest-pos) 0.0) (go-virtual running) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) :enter (behavior () (set! (-> self path-pos) 1.0) (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) - (none) ) :trans (behavior () (plat-trans) - (none) ) :code (the-as (function none :behavior mtn-plat-gap) sleep-code) :post (the-as (function none :behavior mtn-plat-gap) plat-post) @@ -3107,8 +3070,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (mtn-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual open) ) @@ -3131,7 +3094,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (go-virtual waiting) - (none) ) :post (the-as (function none :behavior mtn-button) rider-post) ) @@ -3139,8 +3101,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate waiting (mtn-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('bonk) (go-virtual pressed #f) ) @@ -3152,7 +3114,6 @@ This commonly includes things such as: :frame-num 0.0 ) (transform-post) - (none) ) :code (the-as (function none :behavior mtn-button) sleep-code) ) @@ -3183,7 +3144,6 @@ This commonly includes things such as: (transform-post) (process-entity-status! self (entity-perm-status subtask-complete) #t) (sleep-code) - (none) ) ) @@ -3305,7 +3265,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior mtn-gear-device) ja-post) ) @@ -3559,7 +3518,6 @@ This commonly includes things such as: ) ) (go-virtual waiting) - (none) ) :post (the-as (function none :behavior trans-plat) plat-post) ) @@ -3586,7 +3544,6 @@ This commonly includes things such as: ((the-as (function none) t9-5)) ) ) - (none) ) :exit (behavior () (while (-> self child) @@ -3597,7 +3554,6 @@ This commonly includes things such as: (t9-2) ) ) - (none) ) :trans (behavior () (cond @@ -3622,7 +3578,6 @@ This commonly includes things such as: (t9-2) ) ) - (none) ) ) @@ -3638,7 +3593,6 @@ This commonly includes things such as: (if (logtest? (-> self flags) (mtn-plat-flags mtpflags-0)) (process-release? *target*) ) - (none) ) ) @@ -3650,7 +3604,6 @@ This commonly includes things such as: (if (>= (- (current-time) (-> self ride-timer)) (seconds 1)) (go-virtual waiting) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/mountain/mountain-scenes_REF.gc b/test/decompiler/reference/jak2/levels/mountain/mountain-scenes_REF.gc index d6effe9e1fb..cd053c25c58 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-scenes_REF.gc @@ -1705,27 +1705,25 @@ ;; failed to figure out what this is: (defstate idle (mtn-plat-buried-rocks) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('trigger) - (process-spawn scene-player :init scene-player-init "mtn-plat-buried-rocks-a" #t #f) - ) - (('done) - (go-virtual done #f) - ) - (('die) - (cleanup-for-death self) - (the-as object (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (process-spawn scene-player :init scene-player-init "mtn-plat-buried-rocks-a" #t #f) + ) + (('done) + (go-virtual done #f) + ) + (('die) + (cleanup-for-death self) + (deactivate self) + ) + ) ) :code (behavior () (ja-post) (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -1753,7 +1751,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -1993,11 +1990,11 @@ otherwise, [[plat::34]] ;; failed to figure out what this is: (defstate plat-idle (mtn-plat-buried) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('bonk) (if (not (logtest? (-> self options) (actor-option blocked))) - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) (('trigger) @@ -2008,7 +2005,7 @@ otherwise, [[plat::34]] ) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -2024,13 +2021,11 @@ otherwise, [[plat::34]] (func) ) ) - (none) ) :trans (behavior () (if (not (logtest? (-> self options) (actor-option blocked))) (execute-effects self) ) - (none) ) ) @@ -3223,7 +3218,6 @@ This commonly includes things such as: :code (the-as (function none :behavior mtn-lens-floor) transform-and-sleep-code) :post (behavior () (spawn-with-cspace (-> self part) (-> self node-list data 3)) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/mountain/rhino-wall_REF.gc b/test/decompiler/reference/jak2/levels/mountain/rhino-wall_REF.gc index 05d84c99d04..eaa8cf087f6 100644 --- a/test/decompiler/reference/jak2/levels/mountain/rhino-wall_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/rhino-wall_REF.gc @@ -85,8 +85,8 @@ ;; failed to figure out what this is: (defstate unbroken (rhino-wall) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual hit) ) @@ -98,7 +98,6 @@ (suspend) (transform-post) (sleep-code) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc b/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc index 735f830dd33..ed39e6ee920 100644 --- a/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc @@ -628,16 +628,6 @@ ;; definition for method 74 of type rhino ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 10] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 25] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 30] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 45] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 151] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 216] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 272] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 318] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 323] (defmethod general-event-handler rhino ((obj rhino) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" @@ -655,187 +645,182 @@ (sv-256 vector) (sv-272 matrix) ) - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'charge) - (if (-> obj wall) - (go (method-of-object obj charge)) - ) + (case arg2 + (('charge) + (if (-> obj wall) + (go (method-of-object obj charge)) ) - ((= v1-0 'hit) - (cond - ((zero? (-> obj hit-points)) - (set! (-> *rhino-nav-enemy-info* die-anim) 15) - (set! (-> obj frame-die-smush) 11.0) - (kill-prefer-falling obj) - ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) + ) + (('hit) + (cond + ((zero? (-> obj hit-points)) + (set! (-> *rhino-nav-enemy-info* die-anim) 15) + (set! (-> obj frame-die-smush) 11.0) + (kill-prefer-falling obj) + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) - ((= v1-0 'hit-flinch) - (cond - ((zero? (-> obj hit-points)) - (set! (-> *rhino-nav-enemy-info* die-anim) 14) - (set! (-> obj frame-die-smush) 16.0) - (kill-prefer-falling obj) - ) - (else - (let* ((s5-0 arg0) - (s2-0 (if (type? s5-0 process-drawable) - s5-0 - ) + ) + ) + (('hit-flinch) + (cond + ((zero? (-> obj hit-points)) + (set! (-> *rhino-nav-enemy-info* die-anim) 14) + (set! (-> obj frame-die-smush) 16.0) + (kill-prefer-falling obj) + ) + (else + (let* ((s5-0 arg0) + (s2-0 (if (type? s5-0 process-drawable) + s5-0 ) - (s3-0 (new 'stack-no-clear 'vector)) - (s4-0 (new 'stack-no-clear 'vector)) - (s5-1 (new 'stack-no-clear 'vector)) - ) - (vector-z-quaternion! s3-0 (-> obj root quat)) - (vector-x-quaternion! s4-0 (-> obj root quat)) - (vector-! s5-1 (-> (the-as process-focusable s2-0) root trans) (-> obj root trans)) - (set! (-> s5-1 y) 0.0) - (vector-normalize! s5-1 1.0) - (let* ((f30-0 (vector-dot s3-0 s5-1)) - (f28-0 (vector-dot s4-0 s5-1)) - (a0-16 (cond - ((>= f30-0 (cos 8192.0)) - (-> obj draw art-group data 16) - ) - ((>= (cos 24576.0) f30-0) - (-> obj draw art-group data 19) - ) - ((>= f28-0 (cos 8192.0)) - (-> obj draw art-group data 17) - ) - ((>= (cos 24576.0) f28-0) - (-> obj draw art-group data 18) - ) - (else - (-> obj draw art-group data 16) - ) - ) - ) - (v0-9 (ja-channel-float! (the-as art-joint-anim a0-16) 0.0 0.0 0.0)) ) - (when v0-9 - (set! (-> obj skel interp-select 0) (the-as int (the-as uint #x1c9002228))) - (set! (-> obj skel interp-select 1) 0) - (set! (-> v0-9 param 0) 1.0) - (set! (-> v0-9 param 1) 1.0) - (set! (-> v0-9 param 2) 3.0) - (set! (-> v0-9 num-func) num-func-interp1-play!) - ) - ) + (s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (vector-z-quaternion! s3-0 (-> obj root quat)) + (vector-x-quaternion! s4-0 (-> obj root quat)) + (vector-! s5-1 (-> (the-as process-focusable s2-0) root trans) (-> obj root trans)) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (let* ((f30-0 (vector-dot s3-0 s5-1)) + (f28-0 (vector-dot s4-0 s5-1)) + (a0-16 (cond + ((>= f30-0 (cos 8192.0)) + (-> obj draw art-group data 16) + ) + ((>= (cos 24576.0) f30-0) + (-> obj draw art-group data 19) + ) + ((>= f28-0 (cos 8192.0)) + (-> obj draw art-group data 17) + ) + ((>= (cos 24576.0) f28-0) + (-> obj draw art-group data 18) + ) + (else + (-> obj draw art-group data 16) + ) + ) + ) + (v0-9 (ja-channel-float! (the-as art-joint-anim a0-16) 0.0 0.0 0.0)) + ) + (when v0-9 + (set! (-> obj skel interp-select 0) (the-as int (the-as uint #x1c9002228))) + (set! (-> obj skel interp-select 1) 0) + (set! (-> v0-9 param 0) 1.0) + (set! (-> v0-9 param 1) 1.0) + (set! (-> v0-9 param 2) 3.0) + (set! (-> v0-9 num-func) num-func-interp1-play!) ) - (+! (-> obj num-hit-flinch) 1) - 'back ) ) + (+! (-> obj num-hit-flinch) 1) + 'back ) - ((= v1-0 'event-slide-poof) - (let ((s5-2 (-> arg3 param 1))) - (cond - ((= (-> obj root ground-pat material) (pat-material grass)) - (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-1 - (let ((t9-14 (method-of-type part-tracker activate))) - (t9-14 (the-as part-tracker s4-1) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) - ) - (let ((s3-1 run-function-in-process) - (s2-1 s4-1) - (s1-0 part-tracker-init) - (s0-0 (-> *part-group-id-table* 351)) - ) - (set! sv-96 0) - (set! sv-112 (the-as symbol #f)) - (set! sv-128 (the-as symbol #f)) - (set! sv-144 (the-as symbol #f)) - (set! sv-176 *launch-matrix*) - (set! sv-160 (-> sv-176 trans)) - (let ((v1-52 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data s5-2)) quad))) - (set! (-> sv-160 quad) v1-52) - ) - ((the-as (function object object object object object object object object none) s3-1) - s2-1 - s1-0 - s0-0 - sv-96 - sv-112 - sv-128 - sv-144 - sv-176 - ) + ) + ) + (('event-slide-poof) + (let ((s5-2 (-> arg3 param 1))) + (cond + ((= (-> obj root ground-pat material) (pat-material grass)) + (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when s4-1 + (let ((t9-14 (method-of-type part-tracker activate))) + (t9-14 (the-as part-tracker s4-1) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((s3-1 run-function-in-process) + (s2-1 s4-1) + (s1-0 part-tracker-init) + (s0-0 (-> *part-group-id-table* 351)) ) - (-> s4-1 ppointer) + (set! sv-96 0) + (set! sv-112 (the-as symbol #f)) + (set! sv-128 (the-as symbol #f)) + (set! sv-144 (the-as symbol #f)) + (set! sv-176 *launch-matrix*) + (set! sv-160 (-> sv-176 trans)) + (let ((v1-52 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data s5-2)) quad))) + (set! (-> sv-160 quad) v1-52) ) + ((the-as (function object object object object object object object object none) s3-1) + s2-1 + s1-0 + s0-0 + sv-96 + sv-112 + sv-128 + sv-144 + sv-176 + ) ) + (-> s4-1 ppointer) ) - (else - (let ((s4-2 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-2 - (let ((t9-18 (method-of-type part-tracker activate))) - (t9-18 (the-as part-tracker s4-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) - ) - (let ((s3-2 run-function-in-process) - (s2-2 s4-2) - (s1-1 part-tracker-init) - (s0-1 (-> *part-group-id-table* 350)) - ) - (set! sv-192 0) - (set! sv-208 (the-as symbol #f)) - (set! sv-224 (the-as symbol #f)) - (set! sv-240 (the-as symbol #f)) - (set! sv-272 *launch-matrix*) - (set! sv-256 (-> sv-272 trans)) - (let ((v1-64 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data s5-2)) quad))) - (set! (-> sv-256 quad) v1-64) - ) - ((the-as (function object object object object object object object object none) s3-2) - s2-2 - s1-1 - s0-1 - sv-192 - sv-208 - sv-224 - sv-240 - sv-272 - ) + ) + ) + (else + (let ((s4-2 (get-process *default-dead-pool* part-tracker #x4000))) + (when s4-2 + (let ((t9-18 (method-of-type part-tracker activate))) + (t9-18 (the-as part-tracker s4-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((s3-2 run-function-in-process) + (s2-2 s4-2) + (s1-1 part-tracker-init) + (s0-1 (-> *part-group-id-table* 350)) ) - (-> s4-2 ppointer) + (set! sv-192 0) + (set! sv-208 (the-as symbol #f)) + (set! sv-224 (the-as symbol #f)) + (set! sv-240 (the-as symbol #f)) + (set! sv-272 *launch-matrix*) + (set! sv-256 (-> sv-272 trans)) + (let ((v1-64 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data s5-2)) quad))) + (set! (-> sv-256 quad) v1-64) ) + ((the-as (function object object object object object object object object none) s3-2) + s2-2 + s1-1 + s0-1 + sv-192 + sv-208 + sv-224 + sv-240 + sv-272 + ) ) + (-> s4-2 ppointer) ) ) ) ) - ((= v1-0 'interesting) - (+! (-> obj interest) 1) - (let ((v1-67 (process->ppointer obj))) - (set-setting! 'handle-of-interest v1-67 0.0 (-> v1-67 0 pid)) - ) - ) - ((= v1-0 'uninteresting) - (+! (-> obj interest) -1) - (when (<= (-> obj interest) 0) - (set! (-> obj interest) 0) - (remove-setting! 'handle-of-interest) - ) - ) - ((= v1-0 'death-end) - (let ((v1-74 (-> obj root root-prim))) - (set! (-> v1-74 prim-core collide-as) (collide-spec)) - (set! (-> v1-74 prim-core collide-with) (collide-spec)) - ) - 0 - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) + ) + ) + (('interesting) + (+! (-> obj interest) 1) + (let ((v1-67 (process->ppointer obj))) + (set-setting! 'handle-of-interest v1-67 0.0 (-> v1-67 0 pid)) + ) + ) + (('uninteresting) + (+! (-> obj interest) -1) + (when (<= (-> obj interest) 0) + (set! (-> obj interest) 0) + (remove-setting! 'handle-of-interest) + ) + ) + (('death-end) + (let ((v1-74 (-> obj root root-prim))) + (set! (-> v1-74 prim-core collide-as) (collide-spec)) + (set! (-> v1-74 prim-core collide-with) (collide-spec)) + ) + 0 + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) ) ) @@ -853,7 +838,6 @@ ) ) (logclear! (-> self enemy-flags) (enemy-flag enable-on-active)) - (none) ) :exit (behavior () (local-vars (v0-1 enemy-flag)) @@ -869,7 +853,6 @@ ) ) (set! (-> self enemy-flags) v0-1) - (none) ) :trans (behavior () (cond @@ -893,7 +876,6 @@ ) ) ) - (none) ) ) @@ -905,7 +887,6 @@ (dispose! self) (set! (-> self hit-points) 0) 0 - (none) ) :code (behavior () (set! (-> self smush-target) (the-as smush-control #t)) @@ -939,7 +920,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) @@ -1007,7 +987,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (go-hostile self) - (none) ) ) @@ -1049,40 +1028,37 @@ ) ) ) - (the-as - object - (when (and (the-as uint touch-entry) v1-0) - (cond - ((and (focus-test? obj dangerous) ((method-of-type touching-shapes-entry prims-touching-action?) - touch-entry - (-> obj root) - (collide-action deadly) - (collide-action) - ) - ) - (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) - touch-entry - (-> obj root) - (collide-action persistent-attack) - (collide-action) - ) - (-> obj persistent-attack-id) - (-> obj attack-id) - ) - ) - ) - (enemy-method-104 obj arg0 touch-entry a3-2) - ) - ) - (((method-of-type touching-shapes-entry prims-touching-action?) - touch-entry - (-> obj root) - (collide-action no-standon) - (collide-action) - ) - (send-shoves (-> obj root) arg0 touch-entry 0.7 6144.0 16384.0) + (when (and (the-as uint touch-entry) v1-0) + (cond + ((and (focus-test? obj dangerous) ((method-of-type touching-shapes-entry prims-touching-action?) + touch-entry + (-> obj root) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + touch-entry + (-> obj root) + (collide-action persistent-attack) + (collide-action) + ) + (-> obj persistent-attack-id) + (-> obj attack-id) + ) + ) + ) + (enemy-method-104 obj arg0 touch-entry a3-2) ) + ) + (((method-of-type touching-shapes-entry prims-touching-action?) + touch-entry + (-> obj root) + (collide-action no-standon) + (collide-action) ) + (send-shoves (-> obj root) arg0 touch-entry 0.7 6144.0 16384.0) + ) ) ) ) @@ -1128,7 +1104,6 @@ (t9-0) ) ) - (none) ) ) @@ -1141,7 +1116,6 @@ (t9-0) ) ) - (none) ) ) @@ -1172,7 +1146,6 @@ (if (and (= (-> self victory-count) 3) (not (-> self stomach-touched-once?))) (talker-spawn-func (-> *talker-speech* 59) *entity-pool* (target-pos 0) (the-as region #f)) ) - (none) ) :exit (behavior () (set! (-> self can-hit?) #f) @@ -1192,7 +1165,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -1293,7 +1265,6 @@ ) ) ) - (none) ) ) @@ -1344,13 +1315,11 @@ ) ) 0 - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 1.5)) (go-virtual active) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.05)) @@ -1366,11 +1335,9 @@ (suspend) ) #f - (none) ) :post (behavior () (nav-enemy-travel-post) - (none) ) ) @@ -1389,7 +1356,6 @@ (nav-enemy-method-166 self) (set! (-> self state-time) (current-time)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -1475,7 +1441,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1488,7 +1453,6 @@ ) ) #f - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1500,7 +1464,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -1534,7 +1497,6 @@ (set! (-> a0-10 target-post quad) (-> v1-17 quad)) ) 0 - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -1542,11 +1504,9 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (enemy-method-49 self) - (none) ) :code (behavior () (let ((gp-0 #f)) @@ -1567,7 +1527,6 @@ (go-hostile self) ) ) - (none) ) :post (the-as (function none :behavior rhino) nav-enemy-travel-post) ) @@ -1632,7 +1591,6 @@ (set! (-> self angle-speed) 0.0) (set! (-> self num-hit-flinch) 0) 0 - (none) ) :exit (behavior () (let ((v1-1 (-> self nav state))) @@ -1644,7 +1602,6 @@ ) 0 (set! (-> self in-stop-run) #f) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1713,7 +1670,6 @@ (go-virtual victory) (go-virtual hostile) ) - (none) ) :post (the-as (function none :behavior rhino) nav-enemy-travel-post) ) @@ -1747,11 +1703,9 @@ (vector-xz-normalize! s5-1 163840.0) (vector+! (-> self dest) gp-0 s5-1) ) - (none) ) :exit (behavior () (set! (-> self wall) #f) - (none) ) :code (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -1796,7 +1750,6 @@ (ja :num! (seek!)) ) (go-virtual victory) - (none) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -1808,7 +1761,6 @@ ) 0 (nav-enemy-travel-post) - (none) ) ) @@ -1825,7 +1777,6 @@ (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) ) @@ -1842,7 +1793,6 @@ (set! (-> v1-5 speed) 0.0) ) 0 - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -1937,7 +1887,6 @@ ) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc index 1ef312f8e36..37e1996c546 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc @@ -34,13 +34,11 @@ ) ) ) - (none) ) :code (the-as (function none :behavior metalkor-egg) sleep-code) :post (behavior () (ja-post) (do-push-aways (-> self root)) - (none) ) ) @@ -81,7 +79,6 @@ (send-event-function (ppointer->process (-> self parent)) gp-0) ) ) - (none) ) :trans (behavior () (let ((v1-2 (ja-group))) @@ -98,13 +95,11 @@ ) ) ) - (none) ) :code (the-as (function none :behavior metalkor-egg) sleep-code) :post (behavior () (ja-post) (do-push-aways (-> self root)) - (none) ) ) @@ -114,7 +109,6 @@ :event metalkor-egg-handler :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (local-vars (v1-5 float) (v1-27 float) (v1-34 float)) @@ -210,14 +204,12 @@ ) ) ) - (none) ) ) :code (the-as (function none :behavior metalkor-egg) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -227,7 +219,6 @@ :event metalkor-egg-handler :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 3)) @@ -253,13 +244,11 @@ ) ) ) - (none) ) :code (the-as (function none :behavior metalkor-egg) sleep-code) :post (behavior () (ja-post) (do-push-aways (-> self root)) - (none) ) ) @@ -713,7 +702,6 @@ ((method-of-type cam-float-seeker init) (the-as cam-float-seeker (-> self foot-locks gp-0)) 0.0 0.1 0.3 0.9) (set! (-> self foot-locks gp-0 initialized) #f) ) - (none) ) :trans (behavior () (clone-anim-once (ppointer->handle (-> self parent)) #t (-> self prefix)) @@ -750,13 +738,11 @@ ) ) (metalkor-update-ik) - (none) ) :code (the-as (function none :behavior metalkor-legs) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1301,131 +1287,127 @@ ;; failed to figure out what this is: (defstate idle (metalkor-lowtorso) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) - (the-as - object - (case event-type - (('egg-toss) - (set! (-> self egg-toss-joint-angle target) (the-as float (-> event param 0))) - ) - (('color) - (set! (-> self draw color-mult quad) (-> (the-as rgbaf (-> event param 0)) quad)) - (set! v0-0 (-> self draw color-emissive)) - (set! (-> (the-as rgbaf v0-0) quad) (-> (the-as rgbaf (-> event param 1)) quad)) - v0-0 - ) - (('move-chain) - (let ((v1-7 (-> event param 0)) - (a0-9 (-> self tail)) - ) - (dotimes (a1-1 (the-as int (-> a0-9 num-joints))) - (vector+! - (the-as vector (-> a0-9 chain-joints a1-1)) - (the-as vector (-> a0-9 chain-joints a1-1)) - (the-as vector v1-7) - ) + (case message + (('egg-toss) + (set! (-> self egg-toss-joint-angle target) (the-as float (-> block param 0))) + ) + (('color) + (set! (-> self draw color-mult quad) (-> (the-as rgbaf (-> block param 0)) quad)) + (set! v0-0 (-> self draw color-emissive)) + (set! (-> (the-as rgbaf v0-0) quad) (-> (the-as rgbaf (-> block param 1)) quad)) + v0-0 + ) + (('move-chain) + (let ((v1-7 (-> block param 0)) + (a0-9 (-> self tail)) + ) + (dotimes (a1-1 (the-as int (-> a0-9 num-joints))) + (vector+! + (the-as vector (-> a0-9 chain-joints a1-1)) + (the-as vector (-> a0-9 chain-joints a1-1)) + (the-as vector v1-7) ) ) - #f ) - (('spinner) - (let ((v1-10 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))) - (the-as object (metalkor-lowtorso-start-spinner (the-as int (-> event param 0)) (-> v1-10 vector 2))) - ) + #f + ) + (('spinner) + (let ((v1-10 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))) + (metalkor-lowtorso-start-spinner (the-as int (-> block param 0)) (-> v1-10 vector 2)) ) - (('spinner-off) - (let ((gp-1 (-> event param 0))) - (when (< (the-as int gp-1) 4) - (let ((a0-17 (handle->process (-> self spinners gp-1)))) - (when a0-17 - (send-event a0-17 'break) - (set! (-> self spinners gp-1) (the-as handle #f)) - #f - ) + ) + (('spinner-off) + (let ((gp-1 (-> block param 0))) + (when (< (the-as int gp-1) 4) + (let ((a0-17 (handle->process (-> self spinners gp-1)))) + (when a0-17 + (send-event a0-17 'break) + (set! (-> self spinners gp-1) (the-as handle #f)) + #f ) ) ) ) - (('ja-float) - (dotimes (s5-1 3) - (when (not (-> (the-as metalkor-lowtorso (+ (the-as uint self) (* s5-1 16))) ja-float-info 0 float-anim)) - (set! (-> (the-as metalkor-lowtorso (+ (the-as uint self) (* s5-1 16))) ja-float-info 0 float-anim) - (get-art-by-name (-> self draw art-group) (the-as string (-> event param 0)) art-joint-anim) - ) - (set! (-> (the-as metalkor-lowtorso (+ (the-as uint self) (* s5-1 16))) ja-float-info 0 channel-index) - (the-as int (-> event param 1)) - ) - (set! v0-0 #t) - (goto cfg-31) - ) + ) + (('ja-float) + (dotimes (s5-1 3) + (when (not (-> (the-as metalkor-lowtorso (+ (the-as uint self) (* s5-1 16))) ja-float-info 0 float-anim)) + (set! (-> (the-as metalkor-lowtorso (+ (the-as uint self) (* s5-1 16))) ja-float-info 0 float-anim) + (get-art-by-name (-> self draw art-group) (the-as string (-> block param 0)) art-joint-anim) + ) + (set! (-> (the-as metalkor-lowtorso (+ (the-as uint self) (* s5-1 16))) ja-float-info 0 channel-index) + (the-as int (-> block param 1)) + ) + (set! v0-0 #t) + (goto cfg-31) ) - (set! v0-0 #f) - (label cfg-31) - v0-0 ) - (('attack) - (let ((v1-32 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-32 from) (process->ppointer proc)) - (set! (-> v1-32 num-params) arg1) - (set! (-> v1-32 message) event-type) - (set! (-> v1-32 param 0) (-> event param 0)) - (set! (-> v1-32 param 1) (-> event param 1)) - (set! (-> v1-32 param 2) (-> event param 2)) - (set! (-> v1-32 param 3) (-> event param 3)) - (set! (-> v1-32 param 4) (-> event param 4)) - (set! (-> v1-32 param 5) (-> event param 5)) - (send-event-function (ppointer->process (-> self parent)) v1-32) - ) + (set! v0-0 #f) + (label cfg-31) + v0-0 + ) + (('attack) + (let ((v1-32 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-32 from) (process->ppointer proc)) + (set! (-> v1-32 num-params) argc) + (set! (-> v1-32 message) message) + (set! (-> v1-32 param 0) (-> block param 0)) + (set! (-> v1-32 param 1) (-> block param 1)) + (set! (-> v1-32 param 2) (-> block param 2)) + (set! (-> v1-32 param 3) (-> block param 3)) + (set! (-> v1-32 param 4) (-> block param 4)) + (set! (-> v1-32 param 5) (-> block param 5)) + (send-event-function (ppointer->process (-> self parent)) v1-32) ) - (('touch) - (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> self entity trans quad)) - (let* ((s3-0 proc) - (v1-36 (if (type? s3-0 process-drawable) - s3-0 - ) - ) - ) - (when v1-36 - (let ((s3-2 (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable v1-36) root trans) s4-0)) - (s4-2 - (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable v1-36) root trans) (-> self root trans)) + ) + (('touch) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> self entity trans quad)) + (let* ((s3-0 proc) + (v1-36 (if (type? s3-0 process-drawable) + s3-0 + ) ) + ) + (when v1-36 + (let ((s3-2 (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable v1-36) root trans) s4-0)) + (s4-2 + (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable v1-36) root trans) (-> self root trans)) ) - (set! (-> s3-2 y) 0.0) - (set! (-> s4-2 y) 0.0) - (when (< (vector-dot s3-2 s4-2) 0.0) - (vector-normalize! s3-2 1.0) - (vector-normalize! s4-2 1.0) - (vector-flatten! s4-2 s4-2 s3-2) ) - (vector-normalize! s4-2 32768.0) - (when (send-event - proc - 'attack - (-> event param 0) - (static-attack-info ((id (new-attack-id)) (mode 'deadly) (vector s4-2) (shove-up (meters 4)))) - ) - (set! (-> self no-collision-timer) (current-time)) - (let ((v1-52 (-> self root root-prim))) - (set! (-> v1-52 prim-core collide-as) (collide-spec)) - (set! (-> v1-52 prim-core collide-with) (collide-spec)) - ) - 0 + (set! (-> s3-2 y) 0.0) + (set! (-> s4-2 y) 0.0) + (when (< (vector-dot s3-2 s4-2) 0.0) + (vector-normalize! s3-2 1.0) + (vector-normalize! s4-2 1.0) + (vector-flatten! s4-2 s4-2 s3-2) + ) + (vector-normalize! s4-2 32768.0) + (when (send-event + proc + 'attack + (-> block param 0) + (static-attack-info ((id (new-attack-id)) (mode 'deadly) (vector s4-2) (shove-up (meters 4)))) + ) + (set! (-> self no-collision-timer) (current-time)) + (let ((v1-52 (-> self root root-prim))) + (set! (-> v1-52 prim-core collide-as) (collide-spec)) + (set! (-> v1-52 prim-core collide-with) (collide-spec)) ) + 0 ) ) ) ) ) - ) + ) ) ) :enter (behavior () (set! (-> self state-time) (current-time)) (set-params! (-> self egg-toss-joint-angle) 0.0 0.05 0.3 0.9) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self no-collision-timer)) (seconds 0.1)) @@ -1490,13 +1472,11 @@ ) ) (update (-> self tail) self) - (none) ) :code (the-as (function none :behavior metalkor-lowtorso) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1703,16 +1683,15 @@ ;; failed to figure out what this is: (defstate idle (rift-ring-ingame) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('stutter) - (set! (-> self stutter) (the-as symbol (-> event param 0))) - (set-params! (-> self anim-speed) 3 15 0.25) - (reset! (-> self anim-speed)) - (set! (-> self anim-speed value) -0.25) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('stutter) + (set! (-> self stutter) (the-as symbol (-> block param 0))) + (set-params! (-> self anim-speed) 3 15 0.25) + (reset! (-> self anim-speed)) + (set! (-> self anim-speed value) -0.25) + ) + ) ) :trans (behavior () (cond @@ -1726,13 +1705,11 @@ ) (sound-play "warp-ring" :id (-> self spin-sound) :position (-> self root trans)) (set! (-> self spin-sound-playing) #t) - (none) ) :code (the-as (function none :behavior rift-ring-ingame) sleep-code) :post (behavior () (spawn (-> self part) (-> self root trans)) (ja-post) - (none) ) ) @@ -1818,7 +1795,6 @@ This commonly includes things such as: (turn-off (-> self chain) (the-as time-frame (the int (* 300.0 (rand-vu-float-range 0.9 1.2))))) (ja-channel-push! 1 (seconds 0.1)) (ja :group! (-> self draw art-group data 52) :num! min) - (none) ) :trans (behavior () (let* ((v1-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) @@ -1850,7 +1826,6 @@ This commonly includes things such as: (ja :group! (-> self draw art-group data 53) :num! min) ) ) - (none) ) :code (the-as (function none :behavior metalkor-spinner) sleep-code) :post (the-as (function none :behavior metalkor-spinner) ja-post) @@ -1859,8 +1834,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (metalkor-spinner) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('break) (go-virtual break-it) ) @@ -1868,7 +1843,6 @@ This commonly includes things such as: ) :enter (behavior () (ja :group! (-> self draw art-group data 50)) - (none) ) :trans (behavior () (ja :num! (loop!)) @@ -1897,7 +1871,6 @@ This commonly includes things such as: (quaternion-from-two-vectors! (-> self root quat) (new 'static 'vector :y -1.0) gp-1) (set! (-> self root scale y) (* 0.000009042245 f30-0)) ) - (none) ) :code (the-as (function none :behavior metalkor-spinner) sleep-code) :post (the-as (function none :behavior metalkor-spinner) ja-post) @@ -1906,13 +1879,12 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate shoot-out (metalkor-spinner) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('break) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('break) + (deactivate self) + ) + ) ) :enter (behavior () (let* ((f30-0 0.9) @@ -1922,7 +1894,6 @@ This commonly includes things such as: ) (set! (-> self anim-speed) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-4))))) ) - (none) ) :trans (behavior () (let ((v1-2 (ja-group))) @@ -1964,7 +1935,6 @@ This commonly includes things such as: ) (quaternion-from-two-vectors! (-> self root quat) (new 'static 'vector :y -1.0) gp-2) ) - (none) ) :code (the-as (function none :behavior metalkor-spinner) sleep-code) :post (the-as (function none :behavior metalkor-spinner) ja-post) @@ -2007,7 +1977,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (ja-post) - (none) ) :code (the-as (function none :behavior nest-break-precipice) sleep-code) ) @@ -2018,7 +1987,6 @@ This commonly includes things such as: :trans (behavior () (cleanup-for-death self) (deactivate self) - (none) ) :code (the-as (function none :behavior nest-break-precipice) sleep-code) ) @@ -2131,7 +2099,6 @@ This commonly includes things such as: :trans (behavior () (ja :num! (loop!)) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) - (none) ) :code (the-as (function none :behavior metalkor-kid) sleep-code) :post (the-as (function none :behavior metalkor-kid) ja-post) @@ -2142,7 +2109,6 @@ This commonly includes things such as: :virtual #t :trans (behavior () (clone-anim-once (ppointer->handle (-> self parent)) #t (-> self prefix)) - (none) ) :code (the-as (function none :behavior metalkor-wings) sleep-code) :post (the-as (function none :behavior metalkor-wings) ja-post) @@ -2187,14 +2153,12 @@ This commonly includes things such as: :virtual #t :enter (behavior () (metalkor-distort-update) - (none) ) :trans (behavior () (ja :num! (seek!)) (if (ja-done? 0) (deactivate self) ) - (none) ) :code (the-as (function none :behavior metalkor-distort) sleep-code) :post (the-as (function none :behavior metalkor-distort) ja-post) @@ -2236,14 +2200,12 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 0.0) - (none) ) :trans (behavior () (clone-anim-once (ppointer->handle (-> self parent)) #t "") (let ((f0-0 (calc-fade-from-fog (-> self root trans)))) (set-vector! (-> self draw color-emissive) f0-0 f0-0 f0-0 1.0) ) - (none) ) :code (the-as (function none :behavior metalkor-rays) sleep-code) :post (the-as (function none :behavior metalkor-rays) ja-post) @@ -2311,7 +2273,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (process-spawn metalkor-rays (-> self root trans) (-> self root quat) :to self) - (none) ) :trans (behavior () (local-vars (sv-384 symbol) (sv-400 symbol) (sv-416 vector) (sv-432 matrix)) @@ -2402,7 +2363,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior metalkor-explode) sleep-code) :post (the-as (function none :behavior metalkor-explode) ja-post) @@ -2411,34 +2371,29 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (rift-occlude) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('movie-pos) - (format 0 "changing to movie position~%") - (let ((a2-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))) - (vector+! - (-> self root trans) - (-> self original-trans) - (vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :x -10240.0 :y -7168.0 :z 11264.0) a2-1) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('movie-pos) + (format 0 "changing to movie position~%") + (let ((a2-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))) + (vector+! + (-> self root trans) + (-> self original-trans) + (vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :x -10240.0 :y -7168.0 :z 11264.0) a2-1) ) - (the-as symbol (ja-post)) ) - ) + (ja-post) + ) ) ) :enter (behavior () (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 0.0) (ja-post) - (none) ) :trans (behavior () (let ((f0-0 (calc-fade-from-fog (-> self root trans)))) (set-vector! (-> self draw color-emissive) f0-0 f0-0 f0-0 1.0) ) - (none) ) :code (the-as (function none :behavior rift-occlude) sleep-code) ) @@ -2607,13 +2562,13 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (metalkor-bomb) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched 'touch) (send-event proc 'attack - (-> event param 0) + (-> block param 0) (static-attack-info ((id (new-attack-id)) (mode 'deadly) (shove-back (meters 0)) (shove-up (meters 4)))) ) ) @@ -2626,7 +2581,6 @@ This commonly includes things such as: ) (metalkor-bomb-ground-check) (metalkor-bomb-collide) - (none) ) :code (the-as (function none :behavior metalkor-bomb) sleep-code) :post (the-as (function none :behavior metalkor-bomb) ja-post) diff --git a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-setup_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-setup_REF.gc index 13e93df5d6a..e59caa01609 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-setup_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-setup_REF.gc @@ -177,8 +177,8 @@ ;; failed to figure out what this is: (defstate idle (gem-tracker) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('spawn-with-gem?) (!= (gem-tracker-get-slot (the-as process #f)) -1) ) @@ -186,9 +186,9 @@ (!= (gem-tracker-get-slot proc) -1) ) (('change-gem 'flitter-change-gem 'wasp-change-gem) - (let ((v1-3 (gem-tracker-get-slot (the-as process (-> event param 0))))) + (let ((v1-3 (gem-tracker-get-slot (the-as process (-> block param 0))))) (when (!= v1-3 -1) - (let ((gp-1 (-> event param 1))) + (let ((gp-1 (-> block param 1))) (set! (-> self gems v1-3) (process->handle (the-as process gp-1))) (if (type? gp-1 gem) (send-event (the-as process-tree gp-1) 'get-notify self) @@ -198,7 +198,7 @@ ) ) (('notify) - (case (-> event param 0) + (case (-> block param 0) (('pickup) (+! (-> self gems-collected) 1) (let ((v1-14 (-> self entity extra perm))) @@ -2135,10 +2135,7 @@ This commonly includes things such as: (let ((s5-2 (-> v1-48 data 0 actor))) (let ((a0-52 (search-process-tree *active-pool* - (the-as - (function process-tree object) - (lambda ((arg0 gem-tracker)) (= (-> arg0 type) flitter-gem-tracker) (none)) - ) + (lambda ((arg0 gem-tracker)) (= (-> arg0 type) flitter-gem-tracker) (none)) ) ) ) @@ -2152,11 +2149,7 @@ This commonly includes things such as: ) ) (let ((a0-63 - (search-process-tree *active-pool* (the-as - (function process-tree object) - (lambda ((arg0 gem-tracker)) (= (-> arg0 type) wasp-gem-tracker) (none)) - ) - ) + (search-process-tree *active-pool* (lambda ((arg0 gem-tracker)) (= (-> arg0 type) wasp-gem-tracker) (none))) ) ) (if a0-63 diff --git a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc index 0f55470758a..311b70df62f 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc @@ -561,286 +561,281 @@ ;; definition for function metalkor-handler ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. (defbehavior metalkor-handler metalkor ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-2 object)) - (the-as - object - (case arg2 - (('skip) - (dotimes (gp-1 10) - (let ((a0-4 (handle->process (-> self flitters gp-1)))) - (if a0-4 - (send-event a0-4 'die-fast) - ) - ) - ) - (dotimes (gp-2 3) - (let ((a0-8 (handle->process (-> self wasps gp-2)))) - (if a0-8 - (send-event a0-8 'die-fast) - ) - ) - ) - (the-as object (metalkor-go-next-stage)) - ) - (('track) - (-> self trackable) - ) - (('flitter-change-gem) - (let ((v1-23 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-23 from) (process->ppointer arg0)) - (set! (-> v1-23 num-params) arg1) - (set! (-> v1-23 message) arg2) - (set! (-> v1-23 param 0) (-> arg3 param 0)) - (set! (-> v1-23 param 1) (-> arg3 param 1)) - (set! (-> v1-23 param 2) (-> arg3 param 2)) - (set! (-> v1-23 param 3) (-> arg3 param 3)) - (set! (-> v1-23 param 4) (-> arg3 param 4)) - (set! (-> v1-23 param 5) (-> arg3 param 5)) - (send-event-function (handle->process (-> self flitter-gem-tracker)) v1-23) + (case arg2 + (('skip) + (dotimes (gp-1 10) + (let ((a0-4 (handle->process (-> self flitters gp-1)))) + (if a0-4 + (send-event a0-4 'die-fast) + ) ) ) - (('wasp-change-gem) - (let ((v1-24 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-24 from) (process->ppointer arg0)) - (set! (-> v1-24 num-params) arg1) - (set! (-> v1-24 message) arg2) - (set! (-> v1-24 param 0) (-> arg3 param 0)) - (set! (-> v1-24 param 1) (-> arg3 param 1)) - (set! (-> v1-24 param 2) (-> arg3 param 2)) - (set! (-> v1-24 param 3) (-> arg3 param 3)) - (set! (-> v1-24 param 4) (-> arg3 param 4)) - (set! (-> v1-24 param 5) (-> arg3 param 5)) - (send-event-function (handle->process (-> self wasp-gem-tracker)) v1-24) + (dotimes (gp-2 3) + (let ((a0-8 (handle->process (-> self wasps gp-2)))) + (if a0-8 + (send-event a0-8 'die-fast) + ) ) ) - (('have-gem?) - (let ((s4-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> s4-0 from) (process->ppointer arg0)) - (set! (-> s4-0 num-params) arg1) - (set! (-> s4-0 message) arg2) - (set! (-> s4-0 param 0) (-> arg3 param 0)) - (set! (-> s4-0 param 1) (-> arg3 param 1)) - (set! (-> s4-0 param 2) (-> arg3 param 2)) - (set! (-> s4-0 param 3) (-> arg3 param 3)) - (set! (-> s4-0 param 4) (-> arg3 param 4)) - (set! (-> s4-0 param 5) (-> arg3 param 5)) - (send-event-function (the-as process-tree (metalkor-get-gem-tracker (the-as process-focusable arg0))) s4-0) - ) + (metalkor-go-next-stage) + ) + (('track) + (-> self trackable) + ) + (('flitter-change-gem) + (let ((v1-23 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-23 from) (process->ppointer arg0)) + (set! (-> v1-23 num-params) arg1) + (set! (-> v1-23 message) arg2) + (set! (-> v1-23 param 0) (-> arg3 param 0)) + (set! (-> v1-23 param 1) (-> arg3 param 1)) + (set! (-> v1-23 param 2) (-> arg3 param 2)) + (set! (-> v1-23 param 3) (-> arg3 param 3)) + (set! (-> v1-23 param 4) (-> arg3 param 4)) + (set! (-> v1-23 param 5) (-> arg3 param 5)) + (send-event-function (handle->process (-> self flitter-gem-tracker)) v1-23) ) - (('setup-flitter-gem) - (let ((gp-3 (-> self entity extra))) - (cond - ((send-event (handle->process (-> self flitter-gem-tracker)) 'spawn-with-gem?) - (set! v0-2 (logclear (-> gp-3 perm status) (entity-perm-status save))) - (set! (-> gp-3 perm status) (the-as entity-perm-status v0-2)) - ) - (else - (set! v0-2 (logior (-> gp-3 perm status) (entity-perm-status save))) - (set! (-> gp-3 perm status) (the-as entity-perm-status v0-2)) - ) - ) - ) - v0-2 + ) + (('wasp-change-gem) + (let ((v1-24 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-24 from) (process->ppointer arg0)) + (set! (-> v1-24 num-params) arg1) + (set! (-> v1-24 message) arg2) + (set! (-> v1-24 param 0) (-> arg3 param 0)) + (set! (-> v1-24 param 1) (-> arg3 param 1)) + (set! (-> v1-24 param 2) (-> arg3 param 2)) + (set! (-> v1-24 param 3) (-> arg3 param 3)) + (set! (-> v1-24 param 4) (-> arg3 param 4)) + (set! (-> v1-24 param 5) (-> arg3 param 5)) + (send-event-function (handle->process (-> self wasp-gem-tracker)) v1-24) ) - (('hatch) - (let ((v1-41 (-> arg3 param 0))) - (set! (-> self flitters v1-41) (the-as handle (-> arg3 param 1))) - (send-event - (handle->process (-> self flitter-gem-tracker)) - 'change-gem - #f - (handle->process (-> self flitters v1-41)) - ) - ) + ) + (('have-gem?) + (let ((s4-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-0 from) (process->ppointer arg0)) + (set! (-> s4-0 num-params) arg1) + (set! (-> s4-0 message) arg2) + (set! (-> s4-0 param 0) (-> arg3 param 0)) + (set! (-> s4-0 param 1) (-> arg3 param 1)) + (set! (-> s4-0 param 2) (-> arg3 param 2)) + (set! (-> s4-0 param 3) (-> arg3 param 3)) + (set! (-> s4-0 param 4) (-> arg3 param 4)) + (set! (-> s4-0 param 5) (-> arg3 param 5)) + (send-event-function (the-as process-tree (metalkor-get-gem-tracker (the-as process-focusable arg0))) s4-0) ) - (('child-die) + ) + (('setup-flitter-gem) + (let ((gp-3 (-> self entity extra))) (cond - ((not (and (-> self next-state) (= (-> self next-state name) 'hang-shoot-n-launch))) - #f - ) - ((>= 1 (-> self countdown-to-roar)) - (set-countdown-to-roar) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! (-> self draw art-group data 21) :num! min) - (metalkor-all-spinners-on) + ((send-event (handle->process (-> self flitter-gem-tracker)) 'spawn-with-gem?) + (set! v0-2 (logclear (-> gp-3 perm status) (entity-perm-status save))) + (set! (-> gp-3 perm status) (the-as entity-perm-status v0-2)) ) (else - (set! v0-2 (+ (-> self countdown-to-roar) -1)) - (set! (-> self countdown-to-roar) (the-as int v0-2)) - v0-2 + (set! v0-2 (logior (-> gp-3 perm status) (entity-perm-status save))) + (set! (-> gp-3 perm status) (the-as entity-perm-status v0-2)) ) ) ) - (('attack) - (let ((f28-0 1.0) - (s5-2 (the-as object (-> arg3 param 1))) - (f30-0 (* 0.2 (the float (the int (* 4.99 (-> self stage-hit-points)))))) - ) - (when (!= (-> self stage-hit-points) 0.0) - (when (or (not (logtest? (-> (the-as attack-info s5-2) mask) (attack-mask id))) - (!= (-> self last-attack-id) (-> (the-as attack-info s5-2) id)) - ) - (if (logtest? (-> (the-as attack-info s5-2) mask) (attack-mask id)) - (set! (-> self last-attack-id) (-> (the-as attack-info s5-2) id)) - ) - (if (logtest? (attack-mask damage) (-> (the-as attack-info s5-2) mask)) - (set! f28-0 (-> (the-as attack-info s5-2) damage)) - ) - (let* ((s4-1 arg0) - (f0-4 (cond - ((if (type? s4-1 gun-blue-shot) - s4-1 + v0-2 + ) + (('hatch) + (let ((v1-41 (-> arg3 param 0))) + (set! (-> self flitters v1-41) (the-as handle (-> arg3 param 1))) + (send-event + (handle->process (-> self flitter-gem-tracker)) + 'change-gem + #f + (handle->process (-> self flitters v1-41)) + ) + ) + ) + (('child-die) + (cond + ((not (and (-> self next-state) (= (-> self next-state name) 'hang-shoot-n-launch))) + #f + ) + ((>= 1 (-> self countdown-to-roar)) + (set-countdown-to-roar) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 21) :num! min) + (metalkor-all-spinners-on) + ) + (else + (set! v0-2 (+ (-> self countdown-to-roar) -1)) + (set! (-> self countdown-to-roar) (the-as int v0-2)) + v0-2 + ) + ) + ) + (('attack) + (let ((f28-0 1.0) + (s5-2 (the-as object (-> arg3 param 1))) + (f30-0 (* 0.2 (the float (the int (* 4.99 (-> self stage-hit-points)))))) + ) + (when (!= (-> self stage-hit-points) 0.0) + (when (or (not (logtest? (-> (the-as attack-info s5-2) mask) (attack-mask id))) + (!= (-> self last-attack-id) (-> (the-as attack-info s5-2) id)) + ) + (if (logtest? (-> (the-as attack-info s5-2) mask) (attack-mask id)) + (set! (-> self last-attack-id) (-> (the-as attack-info s5-2) id)) + ) + (if (logtest? (attack-mask damage) (-> (the-as attack-info s5-2) mask)) + (set! f28-0 (-> (the-as attack-info s5-2) damage)) + ) + (let* ((s4-1 arg0) + (f0-4 (cond + ((if (type? s4-1 gun-blue-shot) + s4-1 + ) + (if (= (-> self stage) 3) + (* 0.0012 f28-0) + (* 0.0024 f28-0) + ) + ) + (else + (let ((s4-2 arg0)) + (cond + ((if (type? s4-2 gun-dark-shot) + s4-2 + ) + (if (= (-> self stage) 3) + (* 0.003 f28-0) + (* 0.006 f28-0) + ) ) - (if (= (-> self stage) 3) - (* 0.0012 f28-0) - (* 0.0024 f28-0) + ((= (-> self stage) 3) + (* 0.004 f28-0) ) - ) - (else - (let ((s4-2 arg0)) - (cond - ((if (type? s4-2 gun-dark-shot) - s4-2 - ) - (if (= (-> self stage) 3) - (* 0.003 f28-0) - (* 0.006 f28-0) - ) - ) - ((= (-> self stage) 3) - (* 0.004 f28-0) - ) - (else - (* 0.008 f28-0) - ) + (else + (* 0.008 f28-0) ) ) ) ) ) - ) - (if (and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info s5-2) mask)) - (logtest? (penetrate dark-bomb) (-> (the-as attack-info s5-2) penetrate-using)) - ) - (set! f0-4 0.5) - ) - (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) - (set! f0-4 (* 0.6666667 f0-4)) - ) - (if (not (and (-> self next-state) (let ((v1-109 (-> self next-state name))) - (or (= v1-109 'fall-down) - (= v1-109 'overload-recover) - (= v1-109 'tail-attack) - (= v1-109 'foot-attack) - (= v1-109 'start-second-stage) - ) - ) - ) ) - (set! (-> self stage-hit-points) (fmax 0.0 (- (-> self stage-hit-points) f0-4))) - ) - ) - (metalkor-update-hud) - (cond - ((and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info s5-2) mask)) - (logtest? (penetrate dark-bomb) (-> (the-as attack-info s5-2) penetrate-using)) - (= (-> self stage-hit-points) 0.0) - ) - (set! v0-2 (+ (current-time) (seconds 1))) - (set! (-> self next-stage-timer) (the-as time-frame v0-2)) - v0-2 - ) - ((= (-> self stage-hit-points) 0.0) - (the-as object (metalkor-go-next-stage)) - ) - ((and (-> self next-state) (= (-> self next-state name) 'hang-shoot-n-launch)) - (metalkor-setup-hit-anim - (the-as attack-info s5-2) - (the-as process-drawable arg0) - (-> self draw art-group data 18) - (-> self draw art-group data 20) - (the-as float (-> self draw art-group data 19)) ) - (metalkor-all-spinners-on) - ) - ((and (and (-> self next-state) (= (-> self next-state name) 'fall-down)) - (let ((v1-139 (ja-group))) - (or (not (and v1-139 (= v1-139 (-> self draw art-group data 7)))) (>= (ja-aframe-num 0) 10.0)) - ) - ) - (the-as object (metalkor-setup-hit-anim - (the-as attack-info s5-2) - (the-as process-drawable arg0) - (-> self draw art-group data 25) - (-> self draw art-group data 27) - (the-as float (-> self draw art-group data 26)) - ) - ) + (if (and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info s5-2) mask)) + (logtest? (penetrate dark-bomb) (-> (the-as attack-info s5-2) penetrate-using)) + ) + (set! f0-4 0.5) + ) + (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) + (set! f0-4 (* 0.6666667 f0-4)) + ) + (if (not (and (-> self next-state) (let ((v1-109 (-> self next-state name))) + (or (= v1-109 'fall-down) + (= v1-109 'overload-recover) + (= v1-109 'tail-attack) + (= v1-109 'foot-attack) + (= v1-109 'start-second-stage) + ) + ) + ) + ) + (set! (-> self stage-hit-points) (fmax 0.0 (- (-> self stage-hit-points) f0-4))) + ) + ) + (metalkor-update-hud) + (cond + ((and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info s5-2) mask)) + (logtest? (penetrate dark-bomb) (-> (the-as attack-info s5-2) penetrate-using)) + (= (-> self stage-hit-points) 0.0) + ) + (set! v0-2 (+ (current-time) (seconds 1))) + (set! (-> self next-stage-timer) (the-as time-frame v0-2)) + v0-2 + ) + ((= (-> self stage-hit-points) 0.0) + (metalkor-go-next-stage) + ) + ((and (-> self next-state) (= (-> self next-state name) 'hang-shoot-n-launch)) + (metalkor-setup-hit-anim + (the-as attack-info s5-2) + (the-as process-drawable arg0) + (-> self draw art-group data 18) + (-> self draw art-group data 20) + (the-as float (-> self draw art-group data 19)) ) - ((and (-> self next-state) (let ((v1-153 (-> self next-state name))) - (or (= v1-153 'chase-target) - (= v1-153 'standing-shot) - (= v1-153 'overload-recover) - (= v1-153 'tail-attack) - (= v1-153 'foot-attack) - (= v1-153 'get-close) - ) - ) + (metalkor-all-spinners-on) + ) + ((and (and (-> self next-state) (= (-> self next-state name) 'fall-down)) + (let ((v1-139 (ja-group))) + (or (not (and v1-139 (= v1-139 (-> self draw art-group data 7)))) (>= (ja-aframe-num 0) 10.0)) ) - (if (< (-> self stage-hit-points) f30-0) - (go-virtual fall-down) - (metalkor-ja-float (the-as art-joint-anim (-> self draw art-group data 34)) 1.0 0.25 2.0) - ) + ) + (metalkor-setup-hit-anim + (the-as attack-info s5-2) + (the-as process-drawable arg0) + (-> self draw art-group data 25) + (-> self draw art-group data 27) + (the-as float (-> self draw art-group data 26)) ) - ) + ) + ((and (-> self next-state) (let ((v1-153 (-> self next-state name))) + (or (= v1-153 'chase-target) + (= v1-153 'standing-shot) + (= v1-153 'overload-recover) + (= v1-153 'tail-attack) + (= v1-153 'foot-attack) + (= v1-153 'get-close) + ) + ) + ) + (if (< (-> self stage-hit-points) f30-0) + (go-virtual fall-down) + (metalkor-ja-float (the-as art-joint-anim (-> self draw art-group data 34)) 1.0 0.25 2.0) + ) + ) ) ) ) ) - (('touch) - (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self root) - (the-as uint 1) + ) + (('touch) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self root) + (the-as uint 1) + ) + (let* ((s4-3 arg0) + (gp-5 (if (type? s4-3 process-focusable) + s4-3 + ) + ) ) - (let* ((s4-3 arg0) - (gp-5 (if (type? s4-3 process-focusable) - s4-3 - ) - ) - ) - (when gp-5 - (let ((s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) - (s4-4 (new 'stack-no-clear 'vector)) - ) - (if (>= (metalkor-ja-float-group? (the-as art-joint-anim (-> self draw art-group data 42))) 0) - (vector+! s4-4 (-> s3-0 vector 2) (the-as vector (-> s3-0 vector))) - (vector-! s4-4 (-> s3-0 vector 2) (the-as vector (-> s3-0 vector))) - ) - (set! (-> s4-4 y) 0.0) - (vector-normalize! s4-4 32768.0) - (set! (-> s4-4 y) 24576.0) - (when (send-event - gp-5 - 'attack - (-> arg3 param 0) - (static-attack-info ((id (new-attack-id)) (vector s4-4) (shove-up (meters 6)))) - ) - (set! (-> self no-collision-timer) (current-time)) - (let ((v1-175 (-> self root root-prim))) - (set! (-> v1-175 prim-core collide-as) (collide-spec)) - (set! (-> v1-175 prim-core collide-with) (collide-spec)) - ) - 0 + (when gp-5 + (let ((s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) + (s4-4 (new 'stack-no-clear 'vector)) + ) + (if (>= (metalkor-ja-float-group? (the-as art-joint-anim (-> self draw art-group data 42))) 0) + (vector+! s4-4 (-> s3-0 vector 2) (the-as vector (-> s3-0 vector))) + (vector-! s4-4 (-> s3-0 vector 2) (the-as vector (-> s3-0 vector))) ) + (set! (-> s4-4 y) 0.0) + (vector-normalize! s4-4 32768.0) + (set! (-> s4-4 y) 24576.0) + (when (send-event + gp-5 + 'attack + (-> arg3 param 0) + (static-attack-info ((id (new-attack-id)) (vector s4-4) (shove-up (meters 6)))) + ) + (set! (-> self no-collision-timer) (current-time)) + (let ((v1-175 (-> self root root-prim))) + (set! (-> v1-175 prim-core collide-as) (collide-spec)) + (set! (-> v1-175 prim-core collide-with) (collide-spec)) + ) + 0 ) ) ) ) ) - ) + ) ) ) @@ -1441,17 +1436,16 @@ ;; failed to figure out what this is: (defstate beaten (metalkor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('occlude-off) - (let ((a0-3 (handle->process (-> self rift-occlude)))) - (if a0-3 - (the-as symbol (deactivate a0-3)) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('occlude-off) + (let ((a0-3 (handle->process (-> self rift-occlude)))) + (if a0-3 + (deactivate a0-3) + ) + ) + ) + ) ) :enter (behavior ((arg0 symbol)) (ja-channel-set! 0) @@ -1465,12 +1459,10 @@ (send-event (handle->process (-> self rift-occlude)) 'movie-pos) (outro-play) ) - (none) ) :exit (behavior () (ja-channel-push! 1 (seconds 0.1)) (ja :group! (-> self draw art-group data 3) :num! min) - (none) ) :code (the-as (function symbol none :behavior metalkor) sleep-code) ) @@ -1478,37 +1470,35 @@ ;; failed to figure out what this is: (defstate explode (metalkor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('exploding) - (let ((gp-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> gp-0 from) (process->ppointer self)) - (set! (-> gp-0 num-params) 1) - (set! (-> gp-0 message) 'stutter) - (set! (-> gp-0 param 0) (the-as uint #f)) - (let ((s5-0 send-event-function) - (v1-4 (metalkor-get-ring self)) - ) - (s5-0 - (if v1-4 - (-> v1-4 extra process) - ) - gp-0 - ) - ) - ) - ) - (('explode-done) - (the-as object (metalkor-go-next-stage)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('exploding) + (let ((gp-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-0 from) (process->ppointer self)) + (set! (-> gp-0 num-params) 1) + (set! (-> gp-0 message) 'stutter) + (set! (-> gp-0 param 0) (the-as uint #f)) + (let ((s5-0 send-event-function) + (v1-4 (metalkor-get-ring self)) + ) + (s5-0 + (if v1-4 + (-> v1-4 extra process) + ) + gp-0 + ) + ) + ) + ) + (('explode-done) + (metalkor-go-next-stage) + ) + ) ) :enter (behavior () (process-grab? *target* #f) (set-setting! 'entity-name "camera-271" 0.0 0) (send-event *camera* 'change-target self) - (none) ) :exit (behavior () (process-release? *target*) @@ -1537,7 +1527,6 @@ ) (remove-setting! 'entity-name) (send-event *camera* 'change-target #f) - (none) ) :trans (behavior () (when (not (handle->process (-> self explode))) @@ -1621,13 +1610,11 @@ ) ) (update! (-> self ring-cam-pos) 0.0) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1667,7 +1654,6 @@ (set! (-> self explode-sound) (add-process *gui-control* self (gui-channel jak) (gui-action queue) "nbexplo" -99.0 0) ) - (none) ) :exit (behavior () (process-release? *target*) @@ -1683,7 +1669,6 @@ (if (nonzero? (-> self neck)) (set! (-> self neck flex-blend) 0.0) ) - (none) ) :trans (behavior () (let ((v1-2 (ja-group))) @@ -1746,13 +1731,11 @@ ) ) (update! (-> self ring-cam-pos) 0.0) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1768,13 +1751,11 @@ (if (nonzero? (-> self neck)) (set! (-> self neck flex-blend) 0.0) ) - (none) ) :exit (behavior () (process-release? *target*) (remove-setting! 'entity-name) (send-event *camera* 'change-target #f) - (none) ) :trans (behavior () (let ((v1-2 (ja-group))) @@ -1810,13 +1791,11 @@ ) ) ) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1828,13 +1807,11 @@ (set! (-> self state-time) (current-time)) (ja-channel-push! 1 (seconds 0.1)) (ja :group! (-> self draw art-group data 30) :num! min) - (none) ) :exit (behavior () (if (nonzero? (-> self neck)) (set! (-> self neck flex-blend) 1.0) ) - (none) ) :trans (behavior () (ja :num! (seek!)) @@ -1842,13 +1819,11 @@ (go-virtual get-close) ) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1892,7 +1867,6 @@ (add-process *gui-control* self (gui-channel jak) (gui-action queue) "nbshock" -99.0 0) ) (set! (-> self stop-bomb-sound) #t) - (none) ) :exit (behavior () (if (-> self stop-bomb-sound) @@ -1907,7 +1881,6 @@ (the-as process #f) ) ) - (none) ) :trans (behavior () (if (or (>= (- (current-time) (-> self state-time)) (seconds 1)) @@ -1965,13 +1938,11 @@ ) ) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1982,19 +1953,16 @@ (set! (-> self state-time) (current-time)) (process-entity-status! self (entity-perm-status subtask-complete) #t) (process-spawn scene-player :init scene-player-init "nest-kor-boss-fight-mid" #t "nestb-boss") - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (deactivate self) ) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -2174,13 +2142,11 @@ ) ) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -2224,12 +2190,10 @@ ) ) (set! (-> self arm-frame) -1000.0) - (none) ) :exit (behavior () (metalkor-set-deadly self #f 2) (metalkor-set-deadly self #f 3) - (none) ) :trans (behavior () (local-vars (a0-10 int)) @@ -2277,13 +2241,11 @@ ) ) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -2293,7 +2255,6 @@ :event metalkor-handler :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (cond @@ -2323,13 +2284,11 @@ ) (metalkor-walk-the-walk 53248.0 #f) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -2343,11 +2302,9 @@ (set! (-> self current-nav-poly) (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (-> self current-nav-poly)) ) - (none) ) :exit (behavior () (metalkor-ja-float-stop (the-as art-joint-anim (-> self draw art-group data 32))) - (none) ) :trans (behavior () (if (>= (-> self shots-fired) (-> self stage)) @@ -2387,13 +2344,11 @@ ) ) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -2406,7 +2361,6 @@ (set! (-> self current-nav-poly) (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (-> self current-nav-poly)) ) - (none) ) :trans (behavior () (let ((v1-2 (ja-group))) @@ -2435,13 +2389,11 @@ ) (metalkor-walk-the-walk 122880.0 #f) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -2460,7 +2412,6 @@ ) ) ) - (none) ) :trans (behavior () (let ((v1-2 (ja-group))) @@ -2501,13 +2452,11 @@ ) ) ) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -2526,12 +2475,10 @@ (set! (-> self launching-wasps) #f) (set! (-> self egg-timer) 0) 0 - (none) ) :exit (behavior () (send-event (handle->process (-> self lowtorso)) 'egg-toss 0) (metalkor-ja-float-stop (the-as art-joint-anim (-> self draw art-group data 23))) - (none) ) :trans (behavior () (local-vars (sv-16 res-tag)) @@ -2682,36 +2629,32 @@ ) ) (metalkor-common) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) ;; failed to figure out what this is: (defstate hidden (metalkor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('occlude-off) - (let ((a0-3 (handle->process (-> self rift-occlude)))) - (if a0-3 - (the-as symbol (deactivate a0-3)) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('occlude-off) + (let ((a0-3 (handle->process (-> self rift-occlude)))) + (if a0-3 + (deactivate a0-3) + ) + ) + ) + ) ) :trans (behavior () (if (task-node-closed? (game-task-node nest-boss-introduction)) (metalkor-go-next-stage) ) - (none) ) :code (the-as (function none :behavior metalkor) sleep-code) ) @@ -2726,7 +2669,6 @@ (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (-> self current-nav-poly)) ) (ja :group! (-> self draw art-group data 5)) - (none) ) :trans (behavior () (local-vars (v1-72 float)) @@ -2889,13 +2831,11 @@ (camera-line-rel gp-1 s5-3 (new 'static 'vector4w :x #xff :w #x80)) ) (metalkor-common) - (none) ) ) :code (the-as (function none :behavior metalkor) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc index 6dcb9b3b330..8c395358718 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc @@ -1681,7 +1681,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior nest-gun-parts) ja-post) ) @@ -1754,12 +1753,12 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior nest-unbroken-rocks) ja-post) ) ;; definition for method 11 of type nest-unbroken-rocks +;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! nest-unbroken-rocks ((obj nest-unbroken-rocks) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: diff --git a/test/decompiler/reference/jak2/levels/nest/flying-spider_REF.gc b/test/decompiler/reference/jak2/levels/nest/flying-spider_REF.gc index d0f138c7ec4..42ec4df8043 100644 --- a/test/decompiler/reference/jak2/levels/nest/flying-spider_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/flying-spider_REF.gc @@ -210,7 +210,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior flying-spider) nav-enemy-simple-post) ) @@ -230,13 +229,11 @@ (logclear! (-> self enemy-flags) (enemy-flag lock-focus death-start)) (set! (-> self path-du) (get-rand-float-range self 0.2 0.5)) (set-vector! (-> self root scale) 0.0 0.0 0.0 0.0) - (none) ) :trans (behavior () (if (= (-> self path-u) 1.0) (go-virtual ambush-falling) ) - (none) ) :code (behavior () (ja-channel-push! 1 0) @@ -251,7 +248,6 @@ ) ) #f - (none) ) :post (behavior () (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-u) 'interp) @@ -271,7 +267,6 @@ (forward-up-nopitch->quaternion (-> self root quat) a1-3 *y-vector*) ) (nav-enemy-simple-post) - (none) ) ) @@ -309,7 +304,6 @@ ) (enemy-method-127 self 40960.0 40960.0 #t (collide-spec backgnd)) (go-hostile self) - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'collide-query))) @@ -317,7 +311,6 @@ ) (flying-spider-method-182 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (nav-enemy-falling-post) - (none) ) ) @@ -341,7 +334,6 @@ ) ) ) - (none) ) ) @@ -359,7 +351,6 @@ (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) ) 0 - (none) ) :trans (behavior () (if (>= 2 (the-as int (-> self focus aware))) @@ -399,7 +390,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -432,12 +422,10 @@ ) ) #f - (none) ) :post (behavior () (flying-spider-method-182 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (nav-enemy-face-focus-post) - (none) ) ) @@ -454,7 +442,6 @@ (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) ) @@ -467,7 +454,6 @@ (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :trans (behavior () (let ((a0-1 (get-enemy-target self))) @@ -483,7 +469,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -501,19 +486,17 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) ;; failed to figure out what this is: (defstate attack-fire (flying-spider) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('event-attack-l) (let* ((s5-0 (-> self node-list data 30)) (gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) s5-0)) @@ -533,7 +516,7 @@ ) ) (else - (enemy-event-handler proc arg1 event-type event) + (enemy-event-handler proc argc message block) ) ) ) @@ -542,7 +525,6 @@ (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -579,11 +561,9 @@ (ja :num! (seek! max 2.0)) ) (go-virtual attack) - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -596,7 +576,6 @@ (set! (-> self state-time) (current-time)) (set! (-> self hit-points) 0) (enemy-method-103 self) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -627,7 +606,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior flying-spider) enemy-simple-post) ) diff --git a/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc b/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc index 4859bed4862..36eea460a36 100644 --- a/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc @@ -415,8 +415,8 @@ ;; failed to figure out what this is: (defstate waiting (mammoth) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('cue-chase) (go-virtual wait-to-walk) ) @@ -433,7 +433,6 @@ ) 0 (logior! (-> self foot-flags) 15) - (none) ) :code (behavior () (move-to-ground (-> self root) 40960.0 122880.0 #t (collide-spec backgnd)) @@ -453,7 +452,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior mammoth) nav-enemy-simple-post) ) @@ -476,7 +474,6 @@ (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-5 enemy-flags)))) ) 0 - (none) ) :code (behavior () (next-path-index) @@ -491,7 +488,6 @@ (ja :num! (seek!)) ) (go-virtual walking) - (none) ) :post mammoth-walk-post ) @@ -515,7 +511,6 @@ ) 0 (logior! (-> self foot-flags) 6) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -556,7 +551,6 @@ ) ) #f - (none) ) :post mammoth-walk-post ) @@ -564,8 +558,8 @@ ;; failed to figure out what this is: (defstate walking-attack (mammoth) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('event-attack) (let ((v0-0 (the-as object (current-time)))) (set! (-> self lightning-timer) (the-as time-frame v0-0)) @@ -573,7 +567,7 @@ ) ) (else - (mammoth-walk-handler proc arg1 event-type event) + (mammoth-walk-handler proc argc message block) ) ) ) @@ -592,7 +586,6 @@ ) 0 (logior! (-> self foot-flags) 6) - (none) ) :trans (behavior () (when (and (< (- (current-time) (-> self lightning-timer)) (seconds 3)) (< (-> self spawn-timer) (current-time))) @@ -601,7 +594,6 @@ ) (set! (-> self spawn-timer) (+ (current-time) (the int (* 300.0 (get-rand-float-range self 0.0 0.1))))) ) - (none) ) :code (behavior () (set-nav-destination) @@ -632,7 +624,6 @@ ) ) #f - (none) ) :post mammoth-walk-post ) @@ -699,7 +690,6 @@ (set! (-> v1-33 enemy-flags) (the-as enemy-flag (logclear (-> v1-33 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -761,11 +751,9 @@ ) ) (go-virtual walking) - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -803,7 +791,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post mammoth-walk-post ) @@ -908,17 +895,13 @@ ) ;; definition for method 67 of type mammoth -;; WARN: Return type mismatch object vs none. (defmethod go-stare mammoth ((obj mammoth)) (go (method-of-object obj walking)) - (none) ) ;; definition for method 70 of type mammoth -;; WARN: Return type mismatch object vs none. (defmethod go-hostile mammoth ((obj mammoth)) (go (method-of-object obj walking)) - (none) ) ;; definition for method 116 of type mammoth @@ -1213,7 +1196,7 @@ ) ) ) - (the-as object (handle-copy! arg0 s5-0)) + (handle-copy! arg0 s5-0) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc b/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc index 1fec93dd9f3..b036e1de56f 100644 --- a/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc @@ -456,7 +456,6 @@ (if (logtest? (-> self flags) (mantis-flag tracked)) (mantis-method-187 self) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -503,7 +502,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior mantis) nav-enemy-face-focus-post) ) @@ -546,7 +544,6 @@ ) ) ) - (none) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -604,7 +601,6 @@ (go-virtual ambush-jumping) (go-virtual ambush-crawling) ) - (none) ) ) @@ -629,7 +625,6 @@ (set! (-> v1-28 prim-core collide-with) (-> self root backup-collide-with)) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior mantis) nav-enemy-simple-post) ) @@ -662,7 +657,6 @@ (vector-reset! (-> gp-0 transv)) (set! (-> gp-0 transv y) (* 4096.0 (get-rand-float-range self 28.0 32.0))) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -725,7 +719,6 @@ ) (label cfg-32) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior mantis) nav-enemy-falling-post) ) @@ -735,7 +728,6 @@ :virtual #t :exit (behavior () (logclear! (-> self flags) (mantis-flag attack1-enabled)) - (none) ) :trans (behavior () (rlet ((acc :class vf) @@ -814,7 +806,6 @@ ) ) ) - (none) ) ) ) @@ -831,7 +822,6 @@ (set! (-> v1-6 max-rotation-rate) 21845.334) ) 0 - (none) ) :exit (behavior () (change-to (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor 0) self) @@ -839,14 +829,12 @@ (set! (-> v1-2 max-rotation-rate) (-> self enemy-info maximum-rotation-rate)) ) 0 - (none) ) :trans (behavior () (nav-enemy-method-160 self) (if (logtest? (-> self flags) (mantis-flag tracked)) (go-virtual hostile) ) - (none) ) :code (behavior () (until #f @@ -954,7 +942,6 @@ (label cfg-38) ) #f - (none) ) :post (the-as (function none :behavior mantis) nav-enemy-travel-post) ) @@ -974,14 +961,12 @@ ) 0 (set! (-> self attack-timer) (current-time)) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (logior! (-> self focus-status) (focus-status dangerous)) @@ -1024,7 +1009,6 @@ ) 0 (go-hostile self) - (none) ) :post (the-as (function none :behavior mantis) nav-enemy-chase-post) ) @@ -1036,14 +1020,12 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self attack-timer) (current-time)) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (let ((v1-0 self)) @@ -1117,7 +1099,6 @@ ) 0 (go-hostile self) - (none) ) :post (the-as (function none :behavior mantis) nav-enemy-chase-post) ) @@ -1163,7 +1144,6 @@ ) (logior! (-> self flags) (mantis-flag attack1-enabled)) (go-hostile self) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -1185,7 +1165,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -1229,7 +1208,6 @@ (ja :num! (seek!)) ) (go-hostile self) - (none) ) :post (-> (method-of-type mantis roll-right) post) ) @@ -1257,11 +1235,9 @@ 0 (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self starting-time) (current-time)) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (rlet ((acc :class vf) @@ -1321,7 +1297,6 @@ ) ) #f - (none) ) ) :post (the-as (function none :behavior mantis) nav-enemy-face-focus-post) @@ -1716,7 +1691,6 @@ ) ;; definition for method 67 of type mantis -;; WARN: Return type mismatch object vs none. (defmethod go-stare mantis ((obj mantis)) (let ((a0-2 (handle->process (-> obj focus handle)))) (if (and a0-2 @@ -1728,7 +1702,6 @@ ) ) (go (method-of-object obj hop-away)) - (none) ) ;; definition for method 190 of type mantis diff --git a/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc b/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc index 8f9fd9b809f..9d681f2611e 100644 --- a/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc @@ -47,10 +47,10 @@ ;; failed to figure out what this is: (defstate up (nest-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (let ((v1-1 (the-as attack-info (-> event param 1)))) + (let ((v1-1 (the-as attack-info (-> block param 1)))) (when (or (= (-> v1-1 mode) 'spin) (= (-> v1-1 mode) 'spin-air)) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) (process->ppointer self)) @@ -84,7 +84,6 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self set-camera) #f) - (none) ) :trans (behavior () (when (and (not (-> self set-camera)) (>= (- (current-time) (-> self state-time)) (seconds 0.6))) @@ -95,7 +94,6 @@ (set! (-> self set-camera) #t) ) (rider-trans) - (none) ) :code (behavior () (set! (-> self y-rot-rate) 0.0) @@ -132,7 +130,6 @@ (process-release? *target*) (logior! (-> self mask) (process-mask actor-pause)) (sleep-code) - (none) ) :post (the-as (function none :behavior nest-switch) rider-post) ) @@ -234,8 +231,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (nest-piston) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual up) ) @@ -261,7 +258,6 @@ This commonly includes things such as: ) (logior! (-> self mask) (process-mask actor-pause)) (sleep-code) - (none) ) :post (the-as (function none :behavior nest-piston) rider-post) ) diff --git a/test/decompiler/reference/jak2/levels/nest/nest-scenes_REF.gc b/test/decompiler/reference/jak2/levels/nest/nest-scenes_REF.gc index 85f5f3b5a11..fe2c2222c1f 100644 --- a/test/decompiler/reference/jak2/levels/nest/nest-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/nest-scenes_REF.gc @@ -94,7 +94,6 @@ :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (dotimes (v1-0 5) @@ -117,7 +116,6 @@ (set! (-> control state mode) (the-as lightning-mode mode)) ) ) - (none) ) :trans (behavior () (cond @@ -181,7 +179,6 @@ (spawn (-> self part) (-> self root trans)) ) ) - (none) ) :code (the-as (function none :behavior canyon-lightning-thingy) sleep-code) ) diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc index bfb97b64b68..76808775174 100644 --- a/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc @@ -4,31 +4,29 @@ ;; failed to figure out what this is: (defstate idle (squid-driver) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('matrix) - (let ((v0-0 (the-as object (-> event param 0)))) - (let* ((a2-1 (-> self node-list data 3 bone transform)) - (v1-3 (-> a2-1 quad 0)) - (a0-2 (-> a2-1 quad 1)) - (a1-1 (-> a2-1 quad 2)) - (a2-2 (-> a2-1 trans quad)) - ) - (set! (-> (the-as matrix v0-0) quad 0) v1-3) - (set! (-> (the-as matrix v0-0) quad 1) a0-2) - (set! (-> (the-as matrix v0-0) quad 2) a1-1) - (set! (-> (the-as matrix v0-0) trans quad) a2-2) - ) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('matrix) + (let ((v0-0 (the-as object (-> block param 0)))) + (let* ((a2-1 (-> self node-list data 3 bone transform)) + (v1-3 (-> a2-1 quad 0)) + (a0-2 (-> a2-1 quad 1)) + (a1-1 (-> a2-1 quad 2)) + (a2-2 (-> a2-1 trans quad)) + ) + (set! (-> (the-as matrix v0-0) quad 0) v1-3) + (set! (-> (the-as matrix v0-0) quad 1) a0-2) + (set! (-> (the-as matrix v0-0) quad 2) a1-1) + (set! (-> (the-as matrix v0-0) trans quad) a2-2) + ) + v0-0 + ) + ) + ) ) :trans (behavior () (ja :num! (loop!)) (ja-post) - (none) ) :code (the-as (function none :behavior squid-driver) sleep-code) ) @@ -36,25 +34,23 @@ ;; failed to figure out what this is: (defstate idle (squid-baron) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (rlet ((vf0 :class vf)) (init-vf0-vector) - (the-as object (case event-type - (('color) - (.svf (&-> (-> self draw color-mult) quad) vf0) - (set! (-> self draw color-mult w) 1.0) - (let ((v0-0 (-> self draw color-emissive))) - (set! (-> v0-0 quad) (-> (the-as rgbaf (-> event param 0)) quad)) - v0-0 - ) - ) - ) - ) + (case message + (('color) + (.svf (&-> (-> self draw color-mult) quad) vf0) + (set! (-> self draw color-mult w) 1.0) + (let ((v0-0 (-> self draw color-emissive))) + (set! (-> v0-0 quad) (-> (the-as rgbaf (-> block param 0)) quad)) + v0-0 + ) + ) + ) ) ) :trans (behavior () (clone-anim-once (ppointer->handle (-> self parent)) #f "") - (none) ) :code (the-as (function none :behavior squid-baron) sleep-code) ) @@ -65,20 +61,17 @@ :event squid-tentacle-handler :enter (behavior () (joint-setup self) - (none) ) :trans (behavior () (ja :num! (loop!)) (squid-tentacle-method-23 self) (dotimes (v1-6 11) ) - (none) ) :code (the-as (function none :behavior squid-tentacle) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -90,13 +83,11 @@ (ja :num! (loop!)) (ja-post) (go-virtual test) - (none) ) :code (the-as (function none :behavior squid-tentacle) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -127,7 +118,6 @@ (set! (-> gp-1 penetrate-using) (penetrate explode)) (explosion-spawn (the-as process-drawable *default-pool*) explosion gp-1) ) - (none) ) ) @@ -141,7 +131,6 @@ (t9-1) ) ) - (none) ) ) @@ -402,7 +391,6 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self duration) (the-as time-frame (+ (the int (* 150.0 (rand-vu))) 1050))) - (none) ) :trans (behavior () (squid-whirlwind-move) @@ -435,7 +423,6 @@ (sound-play "sqd-whirl-xplod") (deactivate self) ) - (none) ) :code (the-as (function none :behavior squid-whirlwind) sleep-code) ) diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc index 6d248125639..b292138bc9a 100644 --- a/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc @@ -223,7 +223,6 @@ :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (ja :num! (loop!)) @@ -234,12 +233,10 @@ (debug-draw (-> self first-path)) (debug-draw (-> self second-path)) (debug-draw (-> self third-path)) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -351,7 +348,6 @@ (set! (-> self tentacle-sound-playing) #f) ) (remove-setting! 'point-of-interest) - (none) ) :code (the-as (function none :behavior squid) sleep-code) ) @@ -362,7 +358,6 @@ :event squid-handler :enter (behavior () (remove-setting! 'point-of-interest) - (none) ) :trans (behavior () (let ((v1-1 (squid-method-42 self (new 'stack-no-clear 'vector)))) @@ -372,7 +367,6 @@ (go-virtual fire-whirlwind) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) ) @@ -383,14 +377,12 @@ :event squid-handler :enter (behavior () (remove-setting! 'point-of-interest) - (none) ) :trans (behavior () (vector-reset! (-> self residual-velocity)) (if (>= (-> self max-plane) 8) (go-virtual fly-to-post) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) ) @@ -442,14 +434,12 @@ ) (set! (-> self gate-intact) #t) (set! (-> self force-onto-mesh) #f) - (none) ) :exit (behavior () (set! (-> self hit-points) 10) (set! (-> self stage) (min 2 (+ (-> self stage) 1))) (change-to (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor (-> self stage)) self) (set! (-> self current-nav-poly) #f) - (none) ) :trans (behavior () (ja :num! (loop!)) @@ -498,12 +488,10 @@ ) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -534,7 +522,6 @@ (set! (-> self tentacle-base-rotation-speed target) 1.0) (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data 36) :num! min) - (none) ) :exit (behavior () (process-release? *target*) @@ -543,7 +530,6 @@ (sound-stop (-> self spin-sound)) (set! (-> self spin-sound-playing) #f) ) - (none) ) :trans (behavior () (local-vars @@ -686,12 +672,10 @@ ) (sound-play "squid-spin" :id (-> self spin-sound) :position (-> self root trans)) (set! (-> self spin-sound-playing) #t) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -711,14 +695,12 @@ (set! (-> self driver-blend target) 0.0) (ja-channel-push! 1 (seconds 0.5)) (ja :group! (-> self draw art-group data 33) :num! min) - (none) ) :exit (behavior () (squid-talker 'done-recharging) (dotimes (gp-0 6) (send-event (handle->process (-> self tentacles gp-0)) 'set-anim 45) ) - (none) ) :trans (behavior () (if (and (zero? (-> self hit-points)) @@ -803,12 +785,10 @@ ) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -911,7 +891,6 @@ (set-traj-towards-vec self (-> self trans) (-> self trans) *squid-first-pole*) ) ) - (none) ) :trans (behavior () (if (and (zero? (-> self hit-points)) @@ -928,12 +907,10 @@ (go-virtual recharge) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -947,7 +924,6 @@ (set! (-> self traj-timer) (current-time)) (vector-reset! (-> self residual-velocity)) (set! (-> self can-play-squid-boost) #t) - (none) ) :exit (behavior () (sound-play "squid-rush-end") @@ -962,7 +938,6 @@ (set! (-> self negate-jet-pitch) #t) ) ) - (none) ) :trans (behavior () (if (and (zero? (-> self hit-points)) @@ -1067,12 +1042,10 @@ ) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -1106,14 +1079,12 @@ (dotimes (gp-0 6) (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel 0.76) ) - (none) ) :exit (behavior () (set! (-> self tentacle-base-rotation-speed target) 0.0) (dotimes (gp-0 6) (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel 0.7) ) - (none) ) :trans (behavior () (if (and (zero? (-> self hit-points)) @@ -1141,12 +1112,10 @@ (spawn-whirlwind self) (set! (-> self traj-timer) (current-time)) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -1236,13 +1205,11 @@ (dotimes (gp-0 6) (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel 0.76) ) - (none) ) :exit (behavior () (dotimes (gp-0 6) (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel 0.7) ) - (none) ) :trans (behavior () (if (and (zero? (-> self hit-points)) @@ -1410,12 +1377,10 @@ ) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -1445,13 +1410,11 @@ (dotimes (gp-1 6) (send-event (handle->process (-> self tentacles gp-1)) 'set-stretch-vel 0.76) ) - (none) ) :exit (behavior () (dotimes (gp-0 6) (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel 0.7) ) - (none) ) :trans (behavior () (if (and (zero? (-> self hit-points)) @@ -1588,12 +1551,10 @@ ) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -1608,11 +1569,9 @@ (send-event (handle->process (-> self tentacles gp-0)) 'set-gravity-slow (new 'static 'vector :y -1.0)) ) (set! (-> self reload-played) #f) - (none) ) :exit (behavior () (set! (-> self force-onto-mesh) #t) - (none) ) :trans (behavior () (squid-talker 'general) @@ -1662,12 +1621,10 @@ ) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -1692,18 +1649,15 @@ ) (sound-play "squid-reload") (go-virtual fire) - (none) ) :trans (behavior () (ja :num! (loop!)) (when (>= (- (current-time) (-> self state-time)) (seconds 3)) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) :post (behavior () (squid-post self) - (none) ) ) @@ -1713,12 +1667,10 @@ :enter (behavior () (ja-channel-set! 0) (ja-post) - (none) ) :exit (behavior () (ja-channel-push! 1 0) (ja :group! (-> self draw art-group data 3) :num! min) - (none) ) :trans (behavior () (cond @@ -1744,7 +1696,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior squid) sleep-code) ) diff --git a/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc b/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc index 343f106ba96..11c4aeb7c9c 100644 --- a/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc @@ -100,62 +100,58 @@ ;; failed to figure out what this is: (defstate idle (pal-electric-fan) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touch) - (let* ((s4-0 proc) - (gp-0 (if (type? s4-0 process-focusable) - s4-0 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (let* ((s4-0 proc) + (gp-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when (and gp-0 ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self root) + (the-as uint 1) ) - ) - ) - (when (and gp-0 ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) - (-> self root) - (the-as uint 1) - ) - ) - (let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) - (let ((v1-5 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as process-focusable gp-0) root quat)))) - (if (< 0.0 (vector-dot s4-1 v1-5)) - (vector-float*! s4-1 s4-1 -1.0) - ) - ) - (when (send-event - gp-0 - 'attack - (-> event param 0) - (static-attack-info ((id (-> self attack-id)) - (vector s4-1) - (shove-back (meters 3)) - (shove-up (meters 9)) - (control (if (focus-test? (the-as process-focusable gp-0) board) - 1.0 - 0.0 - ) - ) - ) - ) - ) - (set! (-> self no-collision-timer) (current-time)) - (let ((v1-19 (-> self root root-prim))) - (set! (-> v1-19 prim-core collide-as) (collide-spec)) - (set! (-> v1-19 prim-core collide-with) (collide-spec)) + ) + (let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (let ((v1-5 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as process-focusable gp-0) root quat)))) + (if (< 0.0 (vector-dot s4-1 v1-5)) + (vector-float*! s4-1 s4-1 -1.0) ) - 0 + ) + (when (send-event + gp-0 + 'attack + (-> block param 0) + (static-attack-info ((id (-> self attack-id)) + (vector s4-1) + (shove-back (meters 3)) + (shove-up (meters 9)) + (control (if (focus-test? (the-as process-focusable gp-0) board) + 1.0 + 0.0 + ) + ) + ) + ) + ) + (set! (-> self no-collision-timer) (current-time)) + (let ((v1-19 (-> self root root-prim))) + (set! (-> v1-19 prim-core collide-as) (collide-spec)) + (set! (-> v1-19 prim-core collide-with) (collide-spec)) ) + 0 ) ) ) ) - ) + ) ) ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (and (nonzero? (-> self no-collision-timer)) @@ -171,7 +167,6 @@ 0 ) (rider-trans) - (none) ) :code (the-as (function none :behavior pal-electric-fan) sleep-code) :post (behavior () @@ -244,7 +239,6 @@ ) (update! (-> self sound)) (rider-post) - (none) ) ) ) @@ -470,7 +464,6 @@ This commonly includes things such as: :enter (behavior () (set! (-> self sound-played? 0) #f) (set! (-> self sound-played? 1) #f) - (none) ) :trans (the-as (function none :behavior pal-cable-nut) rider-trans) :code (behavior () @@ -512,7 +505,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (the-as (function none :behavior pal-cable-nut) rider-post) ) @@ -764,7 +756,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (go-virtual impact) - (none) ) ) @@ -893,8 +884,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (pal-rot-gun) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual spin) ) @@ -906,8 +897,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate spin (pal-rot-gun) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (sound-stop (-> self sound-id)) (sound-stop (-> self shot-sound-id)) @@ -919,7 +910,6 @@ This commonly includes things such as: (set! (-> self fire-timer) (current-time)) (set! (-> self gun-index) 0) 0 - (none) ) :code (the-as (function none :behavior pal-rot-gun) sleep-code) :post (behavior () @@ -970,15 +960,14 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) ;; failed to figure out what this is: (defstate spin-down (pal-rot-gun) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual spin) ) @@ -986,13 +975,11 @@ This commonly includes things such as: ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (if (>= 0.0 (-> self spin-rate)) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior pal-rot-gun) sleep-code) :post (behavior () @@ -1016,7 +1003,6 @@ This commonly includes things such as: #t ) (ja-post) - (none) ) ) @@ -1141,7 +1127,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior pal-windmill) ja-post) ) @@ -1206,8 +1191,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (pal-flip-step) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual fall) ) @@ -1220,7 +1205,6 @@ This commonly includes things such as: ) (go-virtual fall) ) - (none) ) :code (the-as (function none :behavior pal-flip-step) sleep-code) ) @@ -1239,7 +1223,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (go-virtual fallen) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc b/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc index a58841273f7..e330c1de5d6 100644 --- a/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc @@ -37,8 +37,8 @@ ;; failed to figure out what this is: (defstate idle (pal-falling-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (go-virtual fall) ) @@ -46,14 +46,12 @@ ) :enter (behavior () (logior! (-> self root root-prim prim-core action) (collide-action rideable)) - (none) ) :trans (the-as (function none :behavior pal-falling-plat) rider-trans) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) (transform-post) (sleep-code) - (none) ) :post (the-as (function none :behavior pal-falling-plat) rider-post) ) @@ -61,28 +59,26 @@ ;; failed to figure out what this is: (defstate fall (pal-falling-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) - (-> self root) - (the-as uint 8) - ) - (when (< 18.0 (ja-frame-num 0)) - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 num-func) num-func-identity) - (set! (-> v1-6 frame-num) 18.0) - ) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self root) + (the-as uint 8) + ) + (when (< 18.0 (ja-frame-num 0)) + (let ((v1-6 (-> self skel root-channel 0))) + (set! (-> v1-6 num-func) num-func-identity) + (set! (-> v1-6 frame-num) 18.0) + ) + ) + ) + ) + ) ) :enter (behavior () (sound-play "pal-fall-plat") - (none) ) :trans (the-as (function none :behavior pal-falling-plat) rider-trans) :code (behavior () @@ -104,7 +100,6 @@ (ja :num! (seek!)) ) (go-virtual idle) - (none) ) :post (the-as (function none :behavior pal-falling-plat) rider-post) ) @@ -315,8 +310,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (pal-grind-ring-center) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('track) #t ) @@ -337,11 +332,9 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (ja-post) - (none) ) ) @@ -372,7 +365,6 @@ This commonly includes things such as: ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (the-as (function none :behavior pal-grind-ring-center) #f) :trans (the-as (function none :behavior pal-grind-ring-center) #f) @@ -382,7 +374,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior pal-grind-ring-center) #f) ) @@ -513,8 +504,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (pal-grind-ring) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('track) #t ) @@ -535,12 +526,10 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (spawn (-> self part) (-> self root trans)) (ja-post) - (none) ) ) @@ -586,7 +575,6 @@ This commonly includes things such as: (-> gp-1 ppointer) ) ) - (none) ) :trans (behavior () (+! (-> self speed-y) (* -163840.0 (seconds-per-frame))) @@ -599,7 +587,6 @@ This commonly includes things such as: (set! (-> self root trans y) 1441792.0) (set! (-> self speed-y) (* -0.3 (-> self speed-y))) ) - (none) ) :code (behavior () (until #f @@ -613,7 +600,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior pal-grind-ring) transform-post) ) @@ -758,7 +744,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior pal-ent-glass) #f) ) @@ -766,8 +751,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (pal-ent-glass) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (when (not (and (-> self next-state) (= (-> self next-state name) 'die))) (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -792,12 +777,10 @@ This commonly includes things such as: ) :exit (behavior () '() - (none) ) :code (the-as (function none :behavior pal-ent-glass) sleep-code) :post (behavior () '() - (none) ) ) @@ -948,11 +931,9 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () '() - (none) ) :trans (behavior () (cond @@ -998,12 +979,10 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior palent-turret) sleep-code) :post (behavior () (transform-post) - (none) ) ) @@ -1178,7 +1157,6 @@ This commonly includes things such as: (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior pal-breakable-window) #f) ) @@ -1186,8 +1164,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (pal-breakable-window) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (sound-play "glass-crash-big") (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -1211,12 +1189,10 @@ This commonly includes things such as: ) :exit (behavior () '() - (none) ) :code (the-as (function none :behavior pal-breakable-window) sleep-code) :post (behavior () '() - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc b/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc index 6702fa11906..2bc26afbe4e 100644 --- a/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc @@ -217,7 +217,6 @@ This commonly includes things such as: (setup-masks (-> self draw) 0 1) (pal-prong-small-collision) (transform-post) - (none) ) :code (the-as (function none :behavior pal-prong) sleep-code) ) @@ -240,11 +239,9 @@ This commonly includes things such as: :to self ) ) - (none) ) :trans (behavior () (go-virtual broken) - (none) ) :code (the-as (function none :behavior pal-prong) sleep-code) ) @@ -252,8 +249,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (pal-prong) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual break-it) ) @@ -261,7 +258,6 @@ This commonly includes things such as: ) :enter (behavior () (transform-post) - (none) ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'vector))) @@ -269,7 +265,6 @@ This commonly includes things such as: (+! (-> a1-0 y) 36864.0) (spawn (-> self part) a1-0) ) - (none) ) :code (the-as (function none :behavior pal-prong) sleep-code) ) diff --git a/test/decompiler/reference/jak2/levels/palace/throne/palace-scenes_REF.gc b/test/decompiler/reference/jak2/levels/palace/throne/palace-scenes_REF.gc index 2a8253e50b5..7c68ab8a146 100644 --- a/test/decompiler/reference/jak2/levels/palace/throne/palace-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/throne/palace-scenes_REF.gc @@ -47,7 +47,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior throne-throne) ja-post) ) diff --git a/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc b/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc index 03299814778..6d4ee0f8f00 100644 --- a/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc @@ -322,11 +322,11 @@ ;; failed to figure out what this is: (defstate unbroken (ruins-breakable-wall) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (when (task-node-closed? (game-task-node ruins-mech-introduction)) - (let ((s4-0 (the-as object (-> event param 1)))) + (let ((s4-0 (the-as object (-> block param 1)))) (case (-> (the-as attack-info s4-0) mode) (('mech-punch 'crush) (let ((s3-0 @@ -340,7 +340,7 @@ (if (type? proc process-drawable) proc ) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) ) (if (logtest? (-> (the-as attack-info s3-0) mask) (attack-mask intersection)) (go-virtual hit) @@ -375,13 +375,11 @@ (if (and (-> self nav-mesh) (not (nav-mesh-connect-from-ent self))) (set! (-> self nav-mesh) #f) ) - (none) ) :exit (behavior () (while (-> self child) (deactivate (-> self child 0)) ) - (none) ) :code (behavior () (if (task-node-closed? (game-task-node ruins-mech-introduction)) @@ -393,7 +391,6 @@ (suspend) ) #f - (none) ) ) @@ -431,14 +428,12 @@ ) ) (ruins-breakable-wall-method-30 self 'hit) - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :code (behavior () (let ((a2-1 (get-art-by-name (-> self draw art-group) (-> self side end-anim) art-joint-anim))) @@ -451,7 +446,6 @@ ) ) (go-virtual broken) - (none) ) :post (the-as (function none :behavior ruins-breakable-wall) ja-post) ) @@ -471,7 +465,6 @@ (suspend) (transform-post) (sleep-code) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc b/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc index 30ec00cdc0a..2ab8797d302 100644 --- a/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc @@ -48,8 +48,8 @@ ;; failed to figure out what this is: (defstate idle (mechblock) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('carry? 'carry-info) (-> self carry) ) @@ -57,15 +57,15 @@ (cond ((-> self allow-drag?) (carry! - (the-as carry-info (-> event param 0)) + (the-as carry-info (-> block param 0)) (-> self carry) - (the-as vector (-> event param 1)) - (the-as vector (-> event param 2)) + (the-as vector (-> block param 1)) + (the-as vector (-> block param 2)) ) (go-virtual drag) ) (else - (drag! (the-as carry-info (-> event param 0)) (-> self carry)) + (drag! (the-as carry-info (-> block param 0)) (-> self carry)) (go-virtual carry) ) ) @@ -82,7 +82,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -95,7 +94,6 @@ (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :trans (behavior () (when (or (not *target*) (< 40960.0 (vector-vector-distance (-> self origin) (-> *target* control trans)))) @@ -108,7 +106,6 @@ (set! (-> self drop-point quad) (-> self origin quad)) (go-virtual fall) ) - (none) ) :code (behavior () (let ((v1-1 (-> self root root-prim))) @@ -120,20 +117,19 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 - (none) ) ) ;; failed to figure out what this is: (defstate carry (mechblock) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('carry? 'carry-info) (-> self carry) ) (('drop) - (set! (-> self root transv quad) (-> (the-as vector (-> event param 1)) quad)) + (set! (-> self root transv quad) (-> (the-as vector (-> block param 1)) quad)) (set! (-> self drop-point quad) (-> self root trans quad)) (go-virtual fall) ) @@ -145,21 +141,20 @@ (carry-info-method-9 (-> self carry)) (carry-info-method-13 (-> self carry)) (update-transforms (-> self root)) - (none) ) ) ;; failed to figure out what this is: (defstate drag (mechblock) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) - (case event-type + (case message (('carry? 'carry-info) (-> self carry) ) @@ -167,7 +162,7 @@ (if (handle->process (-> self carry other)) (drop! (the-as carry-info (send-event (handle->process (-> self carry other)) 'carry-info)) (-> self carry)) ) - (set! (-> self root transv quad) (-> (the-as vector (-> event param 1)) quad)) + (set! (-> self root transv quad) (-> (the-as vector (-> block param 1)) quad)) (set! (-> self drop-point quad) (-> self root trans quad)) (go-virtual fall) ) @@ -176,7 +171,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> s5-0 quad) (-> s4-0 trans quad)) - (set! (-> s4-0 transv quad) (-> (the-as vector (-> event param 0)) quad)) + (set! (-> s4-0 transv quad) (-> (the-as vector (-> block param 0)) quad)) (let ((s2-0 (-> self nav)) (s1-0 (-> s4-0 root-prim prim-core)) (s3-0 (new 'stack-no-clear 'vector)) @@ -267,7 +262,7 @@ (set! (-> v1-50 prim-core collide-with) (collide-spec)) ) 0 - (vector-! (the-as vector (-> event param 1)) (-> s4-0 trans) s5-0) + (vector-! (the-as vector (-> block param 1)) (-> s4-0 trans) s5-0) ) ) ) @@ -279,35 +274,31 @@ (carry-info-method-9 (-> self carry)) (translate! (-> self carry)) (update-transforms (-> self root)) - (none) ) ) ;; failed to figure out what this is: (defstate fall (mechblock) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('carry-info) - (-> self carry) - ) - (('carry? 'pickup) - (the-as basic #f) - ) - (('touched) - (when (and (!= (-> proc type) target) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'crush)))) - ) - (sound-play "block-hit") - (let ((v0-0 (the-as basic (-> proc entity)))) - (set! (-> self hit-something?) (the-as symbol v0-0)) - v0-0 - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('carry-info) + (-> self carry) + ) + (('carry? 'pickup) + (the-as basic #f) + ) + (('touched) + (when (and (!= (-> proc type) target) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'crush)))) + ) + (sound-play "block-hit") + (let ((v0-0 (the-as basic (-> proc entity)))) + (set! (-> self hit-something?) (the-as symbol v0-0)) + v0-0 ) ) - ) + ) ) ) :enter (behavior () @@ -321,7 +312,6 @@ ) (set! (-> self root status) (collide-status)) (set! (-> self root root-prim local-sphere w) (-> self carry carry-radius)) - (none) ) :trans (behavior () (when (or (and (logtest? (-> self root status) (collide-status on-surface)) (< 0.8 (-> self root surface-angle))) @@ -413,7 +403,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior mechblock) sleep-code) :post (behavior () @@ -452,7 +441,6 @@ ) (transform-post) (carry-info-method-9 (-> self carry)) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc b/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc index fdfe669d340..c1526e9b80c 100644 --- a/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc @@ -67,11 +67,11 @@ ;; failed to figure out what this is: (defstate idle (ruins-pillar-collapse) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (when (task-node-closed? (game-task-node ruins-mech-introduction)) - (let* ((gp-1 (the-as attack-info (-> event param 1))) + (let* ((gp-1 (the-as attack-info (-> block param 1))) (s4-0 (-> gp-1 id)) (s5-0 (vector-x-quaternion! (new-stack-vector0) (-> self root quat))) (a0-6 (vector-z-quaternion! (new-stack-vector0) (-> self root quat))) @@ -136,13 +136,11 @@ ) ) ) - (none) ) :exit (behavior () (while (-> self child) (deactivate (-> self child 0)) ) - (none) ) :code (behavior () (if (task-node-closed? (game-task-node ruins-mech-introduction)) @@ -152,7 +150,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior ruins-pillar-collapse) transform-post) ) @@ -164,7 +161,6 @@ :trans (the-as (function none :behavior ruins-pillar-collapse) rider-trans) :code (behavior () (go-virtual idle) - (none) ) :post (the-as (function none :behavior ruins-pillar-collapse) rider-post) ) @@ -180,7 +176,6 @@ (go-virtual fall #f) ) (go-virtual idle) - (none) ) :post (the-as (function none :behavior ruins-pillar-collapse) rider-post) ) @@ -188,10 +183,10 @@ ;; failed to figure out what this is: (defstate fall (ruins-pillar-collapse) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) - (let* ((s5-0 (-> event param 0)) + (let* ((s5-0 (-> block param 0)) (s4-0 proc) (gp-0 (if (type? s4-0 process-focusable) s4-0 diff --git a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc index 4b4a805f81b..403afc4ec04 100644 --- a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc @@ -416,6 +416,7 @@ ) ;; definition for method 52 of type rapid-gunner +;; WARN: Return type mismatch object vs none. (defmethod enemy-method-52 rapid-gunner ((obj rapid-gunner) (arg0 vector)) (cond ((> (-> obj hit-points) 0) @@ -634,10 +635,8 @@ ) ;; definition for method 67 of type rapid-gunner -;; WARN: Return type mismatch object vs none. (defmethod go-stare rapid-gunner ((obj rapid-gunner)) (go (method-of-object obj hostile)) - (none) ) ;; failed to figure out what this is: @@ -685,7 +684,6 @@ (vector-reset! (-> self focus-dir)) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -707,7 +705,6 @@ ) ) (react-to-focus self) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -725,7 +722,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -762,14 +758,12 @@ (set! (-> self shoot-anim-index) 15) (set! (-> self shoot-anim-index) 14) ) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (seek! (-> self joint-blend) 0.95 (seconds-per-frame)) @@ -833,7 +827,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -874,7 +867,6 @@ ) ) #f - (none) ) :post (behavior () (rapid-gunner-method-185 self (-> self target-next-pos) 4.0) @@ -893,7 +885,6 @@ ) (rapid-gunner-common-post) (nav-enemy-simple-post) - (none) ) ) @@ -941,18 +932,15 @@ (set! (-> v1-9 attack-id) v0-0) (set! (-> self attack-id) v0-0) ) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (rlet ((acc :class vf) @@ -1038,13 +1026,11 @@ ) 0 (go-hostile self) - (none) ) ) :post (behavior () (rapid-gunner-common-post) (nav-enemy-travel-post) - (none) ) ) @@ -1070,14 +1056,12 @@ (set! (-> v1-9 attack-id) v0-0) (set! (-> self attack-id) v0-0) ) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (seek! (-> self joint-blend) 0.0 (seconds-per-frame)) @@ -1089,7 +1073,6 @@ ) (go-hostile self) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1104,7 +1087,6 @@ ) ) #f - (none) ) :post (behavior () (rapid-gunner-method-185 self (-> self target-next-pos) 4.0) @@ -1123,7 +1105,6 @@ ) (rapid-gunner-common-post) (nav-enemy-simple-post) - (none) ) ) @@ -1135,13 +1116,11 @@ (set! (-> self state-time) (current-time)) (set! (-> self shots-fired) (the-as uint 0)) 0 - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (go-hostile self) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1156,12 +1135,10 @@ ) ) #f - (none) ) :post (behavior () (rapid-gunner-common-post) (nav-enemy-face-focus-post) - (none) ) ) @@ -1181,7 +1158,6 @@ (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1198,12 +1174,10 @@ (go-virtual hop) ) (go-hostile self) - (none) ) :post (behavior () (rapid-gunner-common-post) (nav-enemy-face-focus-post) - (none) ) ) @@ -1233,7 +1207,6 @@ (set! (-> v1-18 nav callback-info) *nav-enemy-null-callback-info*) ) 0 - (none) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) @@ -1274,7 +1247,6 @@ (go-virtual active) ) ) - (none) ) :code (behavior () (when (not (enemy-method-96 self 2730.6667 #t)) @@ -1318,13 +1290,11 @@ ) ) #f - (none) ) :post (behavior () (rapid-gunner-method-185 self (-> self target-next-pos) 3.6) (rapid-gunner-common-post) (nav-enemy-face-focus-post) - (none) ) ) @@ -1354,7 +1324,6 @@ (set! (-> v1-13 prim-core action) (collide-action deadly)) (set! (-> v1-13 local-sphere w) 7372.8) ) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) @@ -1365,7 +1334,6 @@ (set! (-> v1-9 prim-core action) (collide-action)) (set! (-> v1-9 local-sphere w) 4096.0) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.135)) @@ -1378,7 +1346,6 @@ (ja :num! (seek!)) ) (go-hostile self) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -1396,7 +1363,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -1414,7 +1380,6 @@ (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) ) 0 - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -1429,7 +1394,6 @@ (ja :num! (loop!)) ) #f - (none) ) :post (the-as (function none :behavior rapid-gunner) nav-enemy-simple-post) ) diff --git a/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc index d6827cdbc4e..5e225992ab0 100644 --- a/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc @@ -151,13 +151,11 @@ ) ) #f - (none) ) :post (behavior () (set! (-> self info) *ruins-sinking-platform-constants*) (set! (-> self rbody state info) (-> self info info)) (rigid-body-object-method-37 self) - (none) ) ) @@ -204,7 +202,6 @@ (go-virtual collapse) ) ) - (none) ) :code (the-as (function none :behavior beam) sleep-code) ) @@ -225,7 +222,6 @@ (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior beam) ja-post) ) @@ -481,8 +477,8 @@ and translate the platform via the `smush` ;; failed to figure out what this is: (defstate fall (ruins-drop-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('collide-shape) (let ((v1-2 (-> self root root-prim))) (set! (-> v1-2 prim-core collide-as) (collide-spec)) @@ -496,7 +492,7 @@ and translate the platform via the `smush` 0 ) (else - ((-> (method-of-type drop-plat fall) event) proc arg1 event-type event) + ((-> (method-of-type drop-plat fall) event) proc argc message block) ) ) ) @@ -515,7 +511,6 @@ and translate the platform via the `smush` ((the-as (function none) t9-0)) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc b/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc index c262902db3b..bf0d334634f 100644 --- a/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc @@ -1371,7 +1371,6 @@ The scale will be linearly-interpolated based on the distance from the camera" (deactivate self) ) (ja-post) - (none) ) ) @@ -1437,23 +1436,20 @@ Touching it flips the `play?` field which will trigger the cutscene" ;; failed to figure out what this is: (defstate idle (ruins-precipice) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('trigger) - (when (not (-> self play?)) - (set! (-> self play?) #t) - (process-spawn scene-player :init scene-player-init "ruins-tower-victory" #t #f) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (when (not (-> self play?)) + (set! (-> self play?) #t) + (process-spawn scene-player :init scene-player-init "ruins-tower-victory" #t #f) ) - (('touch 'attack) - (when (and (not (-> self play?)) *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (set! (-> self play?) #t) - (process-spawn scene-player :init scene-player-init "ruins-tower-victory" #t #f) - ) + ) + (('touch 'attack) + (when (and (not (-> self play?)) *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) + (set! (-> self play?) #t) + (process-spawn scene-player :init scene-player-init "ruins-tower-victory" #t #f) ) - ) + ) ) ) :code (behavior () @@ -1484,7 +1480,6 @@ Touching it flips the `play?` field which will trigger the cutscene" (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/grim_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/grim_REF.gc index e10f2c33129..167b00f1ca2 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/grim_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/grim_REF.gc @@ -162,6 +162,5 @@ ) ) (play-death-sound self "hal159") - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/jinx-bomb_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/jinx-bomb_REF.gc index 7dc4465a66b..03f288ea39d 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/jinx-bomb_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/jinx-bomb_REF.gc @@ -44,8 +44,8 @@ ;; failed to figure out what this is: (defstate idle (jinx-bomb) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual explode) ) @@ -56,7 +56,6 @@ ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (and (nonzero? (-> self fuse-delay)) @@ -64,7 +63,6 @@ ) (go-virtual explode) ) - (none) ) :code (behavior () (let ((v1-1 (-> self root root-prim))) @@ -72,7 +70,6 @@ (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) ) (sleep-code) - (none) ) :post (the-as (function none :behavior jinx-bomb) ja-post) ) @@ -109,7 +106,6 @@ (suspend) ) (deactivate self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/jinx-states_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/jinx-states_REF.gc index 527355328c3..df1b16a1b50 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/jinx-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/jinx-states_REF.gc @@ -74,7 +74,6 @@ (look-at-target! self (enemy-flag lock-focus)) ) #f - (none) ) ) @@ -189,7 +188,6 @@ ) ) (ruffian-method-240 self) - (none) ) :post (the-as (function none :behavior jinx) nav-enemy-simple-post) ) @@ -267,7 +265,6 @@ ) ) #f - (none) ) ) @@ -379,7 +376,6 @@ ) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior jinx) nav-enemy-simple-post) ) @@ -418,7 +414,6 @@ ) ) #f - (none) ) ) @@ -460,7 +455,6 @@ (reset-attacker! self) ) (react-to-focus self) - (none) ) ) @@ -545,7 +539,6 @@ (reset-attacker! self) ) (react-to-focus self) - (none) ) ) @@ -567,7 +560,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -601,7 +593,6 @@ (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self focus-status) (focus-status hit)) (react-to-focus self) - (none) ) ) @@ -636,7 +627,6 @@ ) ) #f - (none) ) ) @@ -647,7 +637,6 @@ (if (logtest? (bot-flags bf21) (-> self bot-flags)) (logior! (-> self bot-flags) (bot-flags bf22)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -690,7 +679,6 @@ (ja :num! (seek!)) ) (react-to-focus self) - (none) ) ) @@ -704,6 +692,5 @@ ) ) (play-death-sound self "hal116") - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/mog_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/mog_REF.gc index 54f6c2e9bb0..ff31de46e10 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/mog_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/mog_REF.gc @@ -358,6 +358,5 @@ ) ) (play-death-sound self "hal143") - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc b/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc index 7da8b4f8997..5ea4fc0e0c5 100644 --- a/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc @@ -319,10 +319,8 @@ ) ;; definition for method 70 of type gator -;; WARN: Return type mismatch object vs none. (defmethod go-hostile gator ((obj gator)) (go (method-of-object obj hostile)) - (none) ) ;; definition for method 107 of type gator @@ -381,7 +379,6 @@ ) ) ) - (none) ) :code (behavior () (let ((circle-for (get-rand-float-range self 0.9 1.1))) @@ -392,7 +389,6 @@ ) ) #f - (none) ) ) @@ -426,7 +422,6 @@ (set! (-> game-info attack-id) id) (set! (-> self attack-id) id) ) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -434,7 +429,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (let ((focus (handle->process (-> self focus handle)))) @@ -483,7 +477,6 @@ 0 ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.07)) @@ -508,7 +501,6 @@ (ja :num! (seek!)) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior gator) nav-enemy-travel-post) ) @@ -525,7 +517,6 @@ ) ) #f - (none) ) ) @@ -534,7 +525,6 @@ :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (let ((func (-> (method-of-type nav-enemy stare) trans))) @@ -545,7 +535,6 @@ (if (>= (- (current-time) (-> self state-time)) (seconds 0.017)) (go-virtual pacing) ) - (none) ) :code (behavior () (let ((circle-for? (get-rand-float-range self 0.9 1.1))) @@ -556,7 +545,6 @@ ) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/hosehead-fake_REF.gc b/test/decompiler/reference/jak2/levels/sewer/hosehead-fake_REF.gc index 70b450ccba3..a09d36edeaf 100644 --- a/test/decompiler/reference/jak2/levels/sewer/hosehead-fake_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/hosehead-fake_REF.gc @@ -301,12 +301,10 @@ ) ) #f - (none) ) :post (behavior () (ja-post) 0 - (none) ) ) @@ -321,7 +319,6 @@ (go-virtual idle) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -344,7 +341,6 @@ ) ) #f - (none) ) :post (-> (method-of-type hosehead-fake idle) post) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc b/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc index 4e966a06ecf..9d0bf0e2bca 100644 --- a/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc @@ -1067,7 +1067,6 @@ (go-virtual active) ) ) - (none) ) :code (-> (method-of-type nav-enemy idle) code) :post (-> (method-of-type nav-enemy idle) post) @@ -1091,7 +1090,6 @@ (set! (-> self allow-head) #t) (set! (-> self lazer-length) 0.0) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (sound-stop (-> self lazer-sound)) @@ -1103,7 +1101,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :trans (behavior () (rlet ((acc :class vf) @@ -1165,7 +1162,6 @@ (if (not (-> self fire-beam?)) (set! (-> self lazer-length) 0.0) ) - (none) ) ) :code (behavior () @@ -1195,14 +1191,12 @@ (ja :num! (seek! max f30-0)) ) ) - (none) ) :post (behavior () (enemy-simple-post) (if (-> self fire-beam?) (hosehead-method-197 self) ) - (none) ) ) @@ -1374,7 +1368,6 @@ (t9-0) ) ) - (none) ) ) @@ -1442,11 +1435,9 @@ (logior! (-> self enemy-flags) (enemy-flag trackable-backup enable-on-hostile)) ) (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (behavior () (logclear! (-> self focus-status) (focus-status dangerous)) - (none) ) :trans (behavior () (when (>= 61440.0 (- (-> self root trans y) (-> self jump-point y))) @@ -1455,7 +1446,6 @@ (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.17)) @@ -1471,14 +1461,12 @@ (suspend) ) #f - (none) ) :post (behavior () (nav-enemy-falling-post) (if (logtest? (-> self root status) (collide-status on-surface)) (go-virtual ambush-land) ) - (none) ) ) @@ -1497,7 +1485,6 @@ (ja :num! (seek!)) ) (go-hostile self) - (none) ) :post (the-as (function none :behavior hosehead) nav-enemy-falling-post) ) @@ -1521,11 +1508,9 @@ ) 0 (stop-looking-at-target! self) - (none) ) :trans (behavior () '() - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.05)) @@ -1541,7 +1526,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior hosehead) nav-enemy-simple-post) ) @@ -1739,7 +1723,6 @@ ) ) ) - (none) ) ) :code (behavior () @@ -1764,11 +1747,9 @@ (suspend) ) #f - (none) ) :post (behavior () (nav-enemy-simple-post) - (none) ) ) @@ -1784,7 +1765,6 @@ (t9-1) ) ) - (none) ) ) @@ -1800,7 +1780,6 @@ (t9-0) ) ) - (none) ) ) @@ -1816,7 +1795,6 @@ (t9-0) ) ) - (none) ) ) @@ -1886,7 +1864,6 @@ ) (set! (-> self lazer-dist) 0.0) (set! (-> self lazer-length) 0.0) - (none) ) ) :exit (behavior () @@ -1899,7 +1876,6 @@ (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (let ((f30-0 (get-rand-float-range self 0.9 1.1))) @@ -1940,14 +1916,12 @@ ) ) (go-hostile self) - (none) ) :post (behavior () (enemy-simple-post) (if (-> self fire-beam?) (hosehead-method-197 self) ) - (none) ) ) @@ -1963,14 +1937,12 @@ (set! (-> v1-2 attack-id) v0-0) (set! (-> self attack-id) v0-0) ) - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2025,7 +1997,6 @@ ) ) (go-hostile self) - (none) ) :post (the-as (function none :behavior hosehead) enemy-simple-post) ) @@ -2043,7 +2014,6 @@ (set! (-> self last-time-dist-changed) (current-time)) (set! (-> self next-lazer-time) 0) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) @@ -2052,7 +2022,6 @@ ) ) (set! (-> self come-from-notice) #f) - (none) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) @@ -2080,7 +2049,6 @@ ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2096,7 +2064,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior hosehead) nav-enemy-chase-post) ) @@ -2136,7 +2103,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -2160,7 +2126,6 @@ ) ) #f - (none) ) ) @@ -2529,20 +2494,16 @@ ) ;; definition for method 66 of type hosehead -;; WARN: Return type mismatch object vs none. (defmethod go-ambush hosehead ((obj hosehead)) (go (method-of-object obj ambush)) - (none) ) ;; definition for method 70 of type hosehead -;; WARN: Return type mismatch object vs none. (defmethod go-hostile hosehead ((obj hosehead)) (if (-> obj sentry?) (go (method-of-object obj hostile-sentry)) (go (method-of-object obj hostile)) ) - (none) ) ;; definition for method 116 of type hosehead diff --git a/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc index b93fec6bb73..1b2607288a4 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc @@ -783,7 +783,6 @@ ) (ja :group! (-> self draw art-group data (-> self params idle-anim))) (set! (-> self flash-state) #f) - (none) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) @@ -795,7 +794,6 @@ ) ) (set! (-> self root penetrated-by) (get-penetrate-info self)) - (none) ) :code (behavior () (set-aim-at-default! self) @@ -854,7 +852,6 @@ ) ) #f - (none) ) ) @@ -870,7 +867,6 @@ (if (!= (-> self activate-distance) 0.0) (aim-turret! self #f) ) - (none) ) ) @@ -923,7 +919,6 @@ 0 (set! (-> self hit-points) 0) (play-communicator-speech! (-> *talker-speech* 53)) - (none) ) :code (behavior () (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 0)))) @@ -960,11 +955,9 @@ (while (-> self child) (suspend) ) - (none) ) :post (behavior () (track-target! self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc index ac2ac9cabfa..49635d05c53 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc @@ -119,7 +119,6 @@ (configure-collision self #t) (set-setting! 'jump #f 0.0 0) ) - (none) ) :post (behavior () (let ((func (-> (method-of-type elevator running) post))) @@ -128,7 +127,6 @@ ) ) (sound-play "sew-elevator-lp" :id (-> self sound-id) :position (-> self root trans)) - (none) ) ) @@ -149,7 +147,6 @@ (configure-collision self #f) (remove-setting! 'jump) ) - (none) ) ) @@ -290,10 +287,10 @@ For example for an elevator pre-compute the distance between the first and last ;; failed to figure out what this is: (defstate idle (sew-valve) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (case (-> (the-as attack-info (-> event param 1)) mode) + (case (-> (the-as attack-info (-> block param 1)) mode) (('spin 'punch 'flop 'uppercut) (if (!= (-> self water-height) (get-base-height *ocean-map-sewer*)) (go-virtual turn) @@ -328,18 +325,15 @@ For example for an elevator pre-compute the distance between the first and last (script-eval (the-as pair data)) ) ) - (none) ) :exit (behavior () (set! (-> self joint enable) #f) (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (behavior () (if (= (-> self water-height) (get-base-height *ocean-map-sewer*)) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior sew-valve) sleep-code) :post (behavior () @@ -363,7 +357,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) (ja-post) - (none) ) ) @@ -670,7 +663,6 @@ This commonly includes things such as: (setup-masks (-> self draw) 4 2) (setup-masks (-> self draw) 2 4) ) - (none) ) :code (the-as (function none :behavior sew-mar-statue) sleep-code) ) @@ -686,7 +678,6 @@ This commonly includes things such as: ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior sew-mar-statue) sleep-code) ) @@ -812,7 +803,6 @@ and translate the platform via the `smush` (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -943,8 +933,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (sew-mine) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (let* ((_proc proc) (focus-proc (if (type? _proc process-focusable) @@ -963,7 +953,7 @@ This commonly includes things such as: (send-event focus-proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((id (new-attack-id)) (vector a0-4) (shove-back (meters 5)) @@ -992,7 +982,6 @@ This commonly includes things such as: ) (set! (-> self last-time) (the-as time-frame gp-0)) ) - (none) ) ) @@ -1044,7 +1033,6 @@ This commonly includes things such as: (suspend) ) ) - (none) ) ) @@ -1181,7 +1169,6 @@ This commonly includes things such as: (set! (-> self root trans y) (+ (-> self center y) (* 819.2 f28-0))) ) (transform-post) - (none) ) ) @@ -1332,8 +1319,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (sew-wall) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (logclear! (-> self mask) (process-mask actor-pause)) (if (-> self first-wall?) @@ -1355,7 +1342,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -1365,11 +1351,9 @@ This commonly includes things such as: :enter (behavior ((arg0 symbol)) (set! (-> self deadly-radius) -1.0) (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (behavior () (ja-abort-spooled-anim (-> self anim) (the-as art-joint-anim #f) -1) - (none) ) :trans (behavior () (let ((f0-0 (-> self deadly-radius))) @@ -1378,7 +1362,6 @@ This commonly includes things such as: (attack-target! self) ) ) - (none) ) :code (behavior ((arg0 symbol)) (if (not (-> self first-wall?)) @@ -1437,7 +1420,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (the-as (function none :behavior sew-wall) ja-post) ) @@ -1602,7 +1584,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior sew-grill) ja-post) ) @@ -1791,7 +1772,6 @@ This commonly includes things such as: :enter (behavior () (set! (-> self state-time) (current-time)) (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :trans (behavior () (let* ((target *target*) @@ -1820,7 +1800,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (until #f @@ -1834,7 +1813,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior sew-scare-grunt) ja-post) ) @@ -1875,7 +1853,6 @@ This commonly includes things such as: (set! (-> self spooled-sound-id) (lookup-gui-connection-id *gui-control* (-> self anim name) (gui-channel art-load) (gui-action none)) ) - (none) ) :exit (behavior () (let* ((actor (-> self grill-actor)) @@ -1888,7 +1865,6 @@ This commonly includes things such as: (logclear! (-> (the-as sew-grill actor-proc) draw status) (draw-control-status no-draw)) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1909,7 +1885,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) :post (behavior () (let* ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) @@ -1945,7 +1920,6 @@ This commonly includes things such as: ) ) (transform-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-obs_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-obs_REF.gc index 5b0efe87bd8..85293386e1b 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-obs_REF.gc @@ -110,8 +110,8 @@ ;; failed to figure out what this is: (defstate idle (sew-single-blade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (let* ((_proc proc) (hit-proc (if (type? _proc process-focusable) @@ -129,7 +129,7 @@ (send-event hit-proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((id (-> self attack-id)) (vector v1-5) (shove-back (meters 5)) (shove-up (meters 3)))) ) ) @@ -150,12 +150,10 @@ ) ) #f - (none) ) :post (behavior () (update-sound! self) (transform-post) - (none) ) ) @@ -286,8 +284,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (sew-tri-blade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (let* ((_proc proc) (hit-proc (if (type? _proc process-focusable) @@ -299,7 +297,7 @@ This commonly includes things such as: (send-event hit-proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((id (-> self attack-id)) (shove-back (meters 5)) (shove-up (meters 2)))) ) ) @@ -362,12 +360,10 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (update-sound! self) (transform-post) - (none) ) ) @@ -490,8 +486,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (sew-arm-blade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (let* ((s5-0 proc) (a0-2 (if (type? s5-0 process-focusable) @@ -503,7 +499,7 @@ This commonly includes things such as: (send-event a0-2 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((id (-> self attack-id)) (shove-back (meters 5)) (shove-up (meters 2)))) ) ) @@ -523,12 +519,10 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (update-sound! self) (transform-post) - (none) ) ) @@ -624,8 +618,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (sew-multi-blade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) (let* ((_proc proc) (hit-proc (if (type? _proc process-focusable) @@ -643,7 +637,7 @@ This commonly includes things such as: (send-event hit-proc 'attack-or-shove - (-> event param 0) + (-> block param 0) (static-attack-info ((id (-> self attack-id)) (vector v1-5) (shove-back (meters 7)) (shove-up (meters 4)))) ) ) @@ -664,12 +658,10 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (update-sound! self) (transform-post) - (none) ) ) @@ -768,41 +760,38 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (sew-twist-blade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('touch 'attack) - (let* ((_proc proc) - (hit-proc (if (type? _proc process-focusable) - (the-as process-focusable _proc) - ) - ) - ) - (when hit-proc - (let ((hit-direction (vector-! (new 'stack-no-clear 'vector) (-> hit-proc root trans) (-> self root-overide trans))) - (v1-5 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-overide quat))) - ) - (if (< (vector-dot v1-5 hit-direction) 0.0) - (vector-float*! v1-5 v1-5 -1.0) - ) - (send-event - hit-proc - 'attack-or-shove - (-> event param 0) - (static-attack-info ((id (-> self attack-id)) (vector v1-5) (shove-back (meters 4)) (shove-up (meters 2)))) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (let* ((_proc proc) + (hit-proc (if (type? _proc process-focusable) + (the-as process-focusable _proc) + ) + ) + ) + (when hit-proc + (let ((hit-direction (vector-! (new 'stack-no-clear 'vector) (-> hit-proc root trans) (-> self root-overide trans))) + (v1-5 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-overide quat))) ) + (if (< (vector-dot v1-5 hit-direction) 0.0) + (vector-float*! v1-5 v1-5 -1.0) + ) + (send-event + hit-proc + 'attack-or-shove + (-> block param 0) + (static-attack-info ((id (-> self attack-id)) (vector v1-5) (shove-back (meters 4)) (shove-up (meters 2)))) ) - (set! (-> self no-collision-timer) (the-as uint (current-time))) - (let ((root-prim (-> self root-overide root-prim))) - (set! (-> root-prim prim-core collide-as) (collide-spec)) - (set! (-> root-prim prim-core collide-with) (collide-spec)) - ) - 0 ) + (set! (-> self no-collision-timer) (the-as uint (current-time))) + (let ((root-prim (-> self root-overide root-prim))) + (set! (-> root-prim prim-core collide-as) (collide-spec)) + (set! (-> root-prim prim-core collide-with) (collide-spec)) + ) + 0 ) ) - ) + ) ) ) :trans (behavior () @@ -824,7 +813,6 @@ This commonly includes things such as: (set! (-> overlap-params tlist) *touching-list*) (find-overlapping-shapes (-> self root-overide) overlap-params) ) - (none) ) :code (behavior () (until #f @@ -838,12 +826,10 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (update-sound! self) (transform-post) - (none) ) ) @@ -986,14 +972,14 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (sew-light-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (broadcast-to-actors self 'cue-chase) (go-virtual pressed) ) (('touch 'attack) - (let* ((gp-0 (-> event param 0)) + (let* ((gp-0 (-> block param 0)) (_proc proc) (target-proc (if (type? _proc target) _proc @@ -1010,27 +996,24 @@ This commonly includes things such as: ) :enter (behavior () (set! (-> self light-state) #f) - (none) ) :code (behavior () (ja-channel-set! 1) (ja :group! (-> self draw art-group data 2) :num! min) (transform-post) (sleep-code) - (none) ) :post (behavior () (launch-particles (-> *part-id-table* 1442) (-> self root trans)) (ja-post) - (none) ) ) ;; failed to figure out what this is: (defstate pressed (sew-light-switch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go-virtual idle) ) @@ -1039,7 +1022,6 @@ This commonly includes things such as: :enter (behavior () (set! (-> self light-state) #t) (sound-play "sew-light-switc") - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 2) @@ -1052,7 +1034,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (sleep-code) - (none) ) ) @@ -1274,28 +1255,26 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (sew-light-control) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (actor entity)) - (the-as object (case event-type - (('use-switch) - (set! actor (entity-by-name (the-as string (-> event param 0)))) - (set! (-> self switch-ent) (the-as entity-actor actor)) - actor - ) - (('use-turret) - (set! actor (entity-by-name (the-as string (-> event param 0)))) - (set! (-> self turret-ent) (the-as entity-actor actor)) - actor - ) - ) - ) + (case message + (('use-switch) + (set! actor (entity-by-name (the-as string (-> block param 0)))) + (set! (-> self switch-ent) (the-as entity-actor actor)) + actor + ) + (('use-turret) + (set! actor (entity-by-name (the-as string (-> block param 0)))) + (set! (-> self turret-ent) (the-as entity-actor actor)) + actor + ) + ) ) :code (behavior () (until #f (suspend) ) #f - (none) ) :post (behavior () (let* ((target *target*) @@ -1338,7 +1317,6 @@ This commonly includes things such as: ) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/stadium/skate/skatea-obs_REF.gc b/test/decompiler/reference/jak2/levels/stadium/skate/skatea-obs_REF.gc index 10290af0539..f3884eedf52 100644 --- a/test/decompiler/reference/jak2/levels/stadium/skate/skatea-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/skate/skatea-obs_REF.gc @@ -243,11 +243,9 @@ ) ) ) - (none) ) :exit (behavior () (set-continue! *game-info* "skatea-training" #f) - (none) ) :trans (behavior () (when (-> self board-picked-up) @@ -271,7 +269,6 @@ (send-event (handle->process (-> self arrow)) 'leave) (go-virtual jump) ) - (none) ) :code (the-as (function none :behavior hoverboard-training-manager) sleep-code) ) @@ -301,17 +298,14 @@ ) ) ) - (none) ) :exit (behavior () (set-continue! *game-info* "skatea-training" #f) - (none) ) :trans (behavior () (if (-> self board-picked-up) (go-virtual idle-training) ) - (none) ) :code (the-as (function none :behavior hoverboard-training-manager) sleep-code) ) @@ -324,7 +318,6 @@ (if (task-node-open? (game-task-node stadium-board1-board)) (go-virtual wait-for-pickup) ) - (none) ) :code (the-as (function none :behavior hoverboard-training-manager) sleep-code) ) @@ -337,7 +330,6 @@ (if (task-node-open? (game-task-node stadium-board1-training-judge)) (go-virtual jump) ) - (none) ) :code (the-as (function none :behavior hoverboard-training-manager) sleep-code) ) @@ -382,7 +374,6 @@ (label cfg-51) (send-event *target* 'get-notify #f) (go-virtual duck-jump) - (none) ) ) @@ -421,7 +412,6 @@ (label cfg-36) (send-event *target* 'get-notify #f) (go-virtual boost-jump) - (none) ) ) @@ -431,7 +421,6 @@ :event hoverboard-training-manager-event-handler :exit (behavior () (send-event (handle->process (-> self arrow)) 'leave) - (none) ) :code (behavior () (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) @@ -498,7 +487,6 @@ (label cfg-42) (send-event *target* 'get-notify #f) (go-virtual grind) - (none) ) ) @@ -508,7 +496,6 @@ :event hoverboard-training-manager-event-handler :exit (behavior () (send-event (handle->process (-> self arrow)) 'leave) - (none) ) :code (behavior () (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) @@ -568,7 +555,6 @@ (label cfg-35) (send-event *target* 'get-notify #f) (go-virtual spin) - (none) ) ) @@ -610,7 +596,6 @@ (label cfg-36) (send-event *target* 'get-notify #f) (go-virtual flip) - (none) ) ) @@ -649,7 +634,6 @@ (label cfg-36) (send-event *target* 'get-notify #f) (go-virtual trick) - (none) ) ) @@ -696,7 +680,6 @@ (label cfg-47) (send-event *target* 'get-notify #f) (go-virtual game) - (none) ) ) @@ -726,7 +709,6 @@ ) (task-node-close! (game-task-node stadium-board1-training)) (go-virtual idle) - (none) ) ) @@ -959,11 +941,9 @@ (if (task-node-closed? (game-task-node stadium-board1-training-judge)) (set! (-> self training?) #f) ) - (none) ) :exit (behavior () (send-event *target* 'get-notify #f) - (none) ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -1025,7 +1005,6 @@ (set! (-> self hint-time) (current-time)) ) ) - (none) ) :code (behavior () (suspend) @@ -1207,7 +1186,6 @@ ) ) #f - (none) ) ) @@ -1228,11 +1206,9 @@ (set! (-> self task-gold) (the-as uint 71)) (set! (-> self task-silver) (the-as uint 70)) (set! (-> self task-bronze) (the-as uint 69)) - (none) ) :exit (behavior () (send-event *target* 'get-notify #f) - (none) ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -1284,7 +1260,6 @@ ) ) (hoverboard-training-manager-method-29 self) - (none) ) :code (behavior () (send-event *target* 'get-notify self) @@ -1376,13 +1351,11 @@ ) ) #f - (none) ) :post (behavior () (if (not (logtest? (-> *game-info* features) (game-feature board))) (go-virtual wait-for-pickup-training) ) - (none) ) ) @@ -1510,24 +1483,22 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (skate-training-ramp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('open) - (let ((v0-0 #t)) - (set! (-> self onoff) v0-0) - v0-0 - ) - ) - (('close) - (set! (-> self onoff) #f) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open) + (let ((v0-0 #t)) + (set! (-> self onoff) v0-0) + v0-0 + ) + ) + (('close) + (set! (-> self onoff) #f) + #f + ) + ) ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :code (behavior () (until #f @@ -1538,11 +1509,9 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (transform-post) - (none) ) ) @@ -1658,26 +1627,24 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (skate-gate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('open) - (remove-setting! 'minimap) - (let ((v0-1 #t)) - (set! (-> self onoff) v0-1) - v0-1 - ) - ) - (('close) - (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) - (set! (-> self onoff) #f) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open) + (remove-setting! 'minimap) + (let ((v0-1 #t)) + (set! (-> self onoff) v0-1) + v0-1 + ) + ) + (('close) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set! (-> self onoff) #f) + #f + ) + ) ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :code (behavior () (until #f @@ -1688,7 +1655,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (if (logtest? (-> *game-info* features) (game-feature board)) @@ -1696,7 +1662,6 @@ This commonly includes things such as: (send-event self 'open) ) (transform-post) - (none) ) ) @@ -1905,7 +1870,6 @@ This commonly includes things such as: ((the-as (function none) t9-6)) ) ) - (none) ) ) @@ -1950,7 +1914,6 @@ This commonly includes things such as: :virtual #t :exit (behavior () '() - (none) ) :code (the-as (function none :behavior skatea-floating-ring) sleep-code) :post (behavior () @@ -1990,7 +1953,6 @@ This commonly includes things such as: ) ) (transform-post) - (none) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc index 7a88a8d510c..f3f9d470485 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc @@ -88,7 +88,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior dummy-vehicle) ja-post) ) @@ -222,7 +221,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior gar-curtain) transform-post) ) @@ -751,14 +749,14 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate defend-stadium-wait (rift-rider) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (sound-play "rift-lift-off") (go-virtual defend-stadium-move) ) (else - (defend-stadium-rift-rider-handler proc arg1 event-type event) + (defend-stadium-rift-rider-handler proc argc message block) ) ) ) @@ -776,11 +774,9 @@ This commonly includes things such as: (set! (-> self height) 49152.0) (set! (-> self hover-volume) 0.0) (set! (-> self dest-pos quad) (-> self root trans quad)) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (dotimes (gp-0 2) @@ -815,7 +811,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior rift-rider) sleep-code) :post (behavior () @@ -833,24 +828,23 @@ This commonly includes things such as: (seek! (-> self hover-volume) 1.0 (seconds-per-frame)) (spawn (-> self part) (-> self root trans)) (rift-rider-travel-post) - (none) ) ) ;; failed to figure out what this is: (defstate defend-stadium-land (rift-rider) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('get-position) - (set! (-> (the-as vector (-> event param 1)) quad) (-> self root trans quad)) - (set! (-> (the-as vector (-> event param 1)) y) + (set! (-> (the-as vector (-> block param 1)) quad) (-> self root trans quad)) + (set! (-> (the-as vector (-> block param 1)) y) (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self path-pos) 'interp) y) ) - (-> event param 1) + (-> block param 1) ) (else - (defend-stadium-rift-rider-handler proc arg1 event-type event) + (defend-stadium-rift-rider-handler proc argc message block) ) ) ) @@ -886,13 +880,11 @@ This commonly includes things such as: (rigid-body-object-method-39 self) (rigid-body-object-method-41 self) (logclear! (-> self rbody state flags) (rigid-body-flag enable-collision)) - (none) ) :exit (behavior () (rigid-body-object-method-38 self) (rigid-body-object-method-40 self) (logior! (-> self rbody state flags) (rigid-body-flag enable-collision)) - (none) ) :trans (behavior () (if (< (vector-vector-xz-distance @@ -903,7 +895,6 @@ This commonly includes things such as: ) (go-virtual defend-stadium-complete) ) - (none) ) :code (the-as (function none :behavior rift-rider) sleep-code) :post (behavior () @@ -945,7 +936,6 @@ This commonly includes things such as: ) (spawn (-> self part) (-> self root trans)) (pusher-post) - (none) ) ) @@ -971,7 +961,6 @@ This commonly includes things such as: ) ) (cleanup-for-death self) - (none) ) ) @@ -981,13 +970,11 @@ This commonly includes things such as: :event defend-stadium-rift-rider-handler :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (< (-> self height) (-> self init-height)) (go-virtual defend-stadium-explode) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -997,7 +984,6 @@ This commonly includes things such as: ) (rigid-body-object-method-39 self) (sleep-code) - (none) ) :post (behavior () (dotimes (gp-0 2) @@ -1015,7 +1001,6 @@ This commonly includes things such as: ) (rigid-body-object-method-37 self) (pusher-post) - (none) ) ) @@ -1055,7 +1040,6 @@ This commonly includes things such as: ) (suspend) (cleanup-for-death self) - (none) ) ) @@ -1219,7 +1203,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior spotlight) ja-post) ) @@ -1708,7 +1691,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (go-virtual raise-rift-rider) - (none) ) :post stad-samos-post ) @@ -1757,7 +1739,6 @@ This commonly includes things such as: (set! (-> self speed) 12288.0) (set! (-> self observed-speed) 0.0) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (and (nonzero? (-> self state-time)) (>= (- (current-time) (-> self state-time)) (seconds 1))) @@ -1798,7 +1779,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (send-event (handle->process (-> self hud)) 'force-show) @@ -1817,12 +1797,10 @@ This commonly includes things such as: (ja :num! (seek! max 0.75)) ) (sleep-code) - (none) ) :post (behavior () (spawn-energy) (stad-samos-post) - (none) ) ) @@ -1855,7 +1833,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1867,7 +1844,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (when (not (-> self enable-move?)) @@ -1948,7 +1924,6 @@ This commonly includes things such as: ) (spawn-energy) (stad-samos-post) - (none) ) ) @@ -1994,7 +1969,6 @@ This commonly includes things such as: ) ) (set! (-> self falling?) #t) - (none) ) :exit (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -2012,7 +1986,6 @@ This commonly includes things such as: ) ) ) - (none) ) :trans (behavior () (let ((v1-0 (-> self rift-rider-actor))) @@ -2023,7 +1996,6 @@ This commonly includes things such as: (go empty-state) ) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -2060,7 +2032,6 @@ This commonly includes things such as: ) (spawn-lightning self) (go-virtual move-rift-rider) - (none) ) :post (behavior () (if (-> self falling?) @@ -2082,23 +2053,21 @@ This commonly includes things such as: ) ) (stad-samos-post) - (none) ) ) ;; failed to figure out what this is: (defstate die (stad-samos) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('death-end) - (let ((v0-0 (logior (-> self draw status) (draw-control-status no-draw)))) - (set! (-> self draw status) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('death-end) + (let ((v0-0 (logior (-> self draw status) (draw-control-status no-draw)))) + (set! (-> self draw status) v0-0) + v0-0 + ) + ) + ) ) :enter (behavior () (logior! (-> self focus-status) (focus-status ignore)) @@ -2119,7 +2088,6 @@ This commonly includes things such as: ) ) (kill-lightning self) - (none) ) :code (behavior () (send-event *camera* 'change-target self) @@ -2182,7 +2150,6 @@ This commonly includes things such as: ) (send-event *camera* 'change-target #f) (cleanup-for-death self) - (none) ) :post stad-samos-post ) @@ -2456,7 +2423,6 @@ This commonly includes things such as: ) ) #f - (none) ) ) @@ -2557,7 +2523,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (sound-play "stadium-shield") - (none) ) :code (the-as (function none :behavior stadium-barrier) sleep-code) :post (behavior () @@ -2576,7 +2541,6 @@ This commonly includes things such as: (if (and (= (-> self colorf) 0.0) (= (-> self flashf) 0.0)) (go-virtual die) ) - (none) ) ) @@ -2585,7 +2549,6 @@ This commonly includes things such as: :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -2860,50 +2823,47 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (stad-force-field) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (let ((v1-1 (the-as object (-> event param 1))) - (a1-1 (-> event param 0)) - ) - (when (!= (-> (the-as attack-info v1-1) id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-1) id)) - (stad-force-field-method-29 self (the-as touching-shapes-entry a1-1)) - (send-event - proc - 'shove - (-> event param 0) - (static-attack-info - ((id (new-attack-id)) (vector (-> self plane)) (shove-back (meters 1)) (shove-up (meters 1.5))) - ) - ) - (when (< (-> self next-message-time) (current-time)) - (set! (-> self next-message-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) - (add-process *gui-control* self (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((v1-1 (the-as object (-> block param 1))) + (a1-1 (-> block param 0)) + ) + (when (!= (-> (the-as attack-info v1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-1) id)) + (stad-force-field-method-29 self (the-as touching-shapes-entry a1-1)) + (send-event + proc + 'shove + (-> block param 0) + (static-attack-info + ((id (new-attack-id)) (vector (-> self plane)) (shove-back (meters 1)) (shove-up (meters 1.5))) ) ) - ) - ) - (('touch) - (let ((a1-5 (-> event param 0))) - (stad-force-field-method-29 self (the-as touching-shapes-entry a1-5)) - ) - (send-event - proc - 'shove - (-> event param 0) - (static-attack-info - ((id (new-attack-id)) (vector (-> self plane)) (shove-back (meters 1)) (shove-up (meters 1.5))) + (when (< (-> self next-message-time) (current-time)) + (set! (-> self next-message-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) + (add-process *gui-control* self (gui-channel alert) (gui-action play) "cityv014" -99.0 0) ) ) - (when (< (-> self next-message-time) (current-time)) - (set! (-> self next-message-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) - (add-process *gui-control* self (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + ) + ) + (('touch) + (let ((a1-5 (-> block param 0))) + (stad-force-field-method-29 self (the-as touching-shapes-entry a1-5)) + ) + (send-event + proc + 'shove + (-> block param 0) + (static-attack-info + ((id (new-attack-id)) (vector (-> self plane)) (shove-back (meters 1)) (shove-up (meters 1.5))) ) ) - ) + (when (< (-> self next-message-time) (current-time)) + (set! (-> self next-message-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) + (add-process *gui-control* self (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + ) + ) ) ) :code (the-as (function none :behavior stad-force-field) sleep-code) @@ -3120,8 +3080,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (stad-keira) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go empty-state) ) @@ -3139,7 +3099,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -3181,7 +3140,6 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) @@ -3238,8 +3196,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (stad-brutter) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die) (go empty-state) ) @@ -3257,7 +3215,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -3299,7 +3256,6 @@ This commonly includes things such as: ) ) (ja-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/stadium/stadium-race-obs_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadium-race-obs_REF.gc index 97ae3ffa4e0..ac9fd9f33c8 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-race-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-race-obs_REF.gc @@ -41,16 +41,15 @@ ;; failed to figure out what this is: (defstate idle (stdmb-race-hatch) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('open) - (set! (-> self tt-target) 1.0) - ) - (('close) - (set! (-> self tt-target) 0.0) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open) + (set! (-> self tt-target) 1.0) + ) + (('close) + (set! (-> self tt-target) 0.0) + ) + ) ) :code (the-as (function none :behavior stdmb-race-hatch) sleep-code) :post (behavior () @@ -64,7 +63,6 @@ (ja-post) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc index 67de99393ab..62c67db9de0 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc @@ -1984,7 +1984,7 @@ (set! (-> gp-0 info sky) #f) ) ) - (the-as object (race-start 2 (the-as process #f) #t)) + (race-start 2 (the-as process #f) #t) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/strip/chaincrate_REF.gc b/test/decompiler/reference/jak2/levels/strip/chaincrate_REF.gc index 76ce56e8afb..7ef86d13f17 100644 --- a/test/decompiler/reference/jak2/levels/strip/chaincrate_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/chaincrate_REF.gc @@ -198,7 +198,6 @@ ) (update-trans! (-> self sound) (-> self root trans)) (update! (-> self sound)) - (none) ) :code (the-as (function none :behavior strip-chain-crate-slave) sleep-code) :post (the-as (function none :behavior strip-chain-crate-slave) rider-post) @@ -360,7 +359,6 @@ (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc b/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc index 1a18ebf933a..ae536f781ff 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc @@ -243,8 +243,8 @@ ;; failed to figure out what this is: (defstate idle (strip-game-crate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('go-final) (go-virtual final-position) ) @@ -266,7 +266,6 @@ (set! (-> self swing-angle x) (+ f28-1 f0-15)) ) (rider-post) - (none) ) ) @@ -276,7 +275,6 @@ :enter (behavior () (ja :group! (-> self draw art-group data 3) :num! min) (ja-post) - (none) ) :code (the-as (function none :behavior strip-game-crate) sleep-code) ) @@ -394,56 +392,49 @@ (suspend) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate swinging (crane) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('notice) - (when (and *target* - (not (task-complete? *game-info* (game-task strip-drop))) - (or (demo?) (and (task-node-closed? (game-task-node strip-drop-introduction)) - (not (task-node-closed? (game-task-node strip-drop-resolution))) - ) - ) - ) - (let ((gp-0 (if (demo?) - "crane-victory-demo" - "crane-victory" - ) - ) - ) - (process-spawn scene-player :init scene-player-init gp-0 #t #f) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notice) + (when (and *target* + (not (task-complete? *game-info* (game-task strip-drop))) + (or (demo?) (and (task-node-closed? (game-task-node strip-drop-introduction)) + (not (task-node-closed? (game-task-node strip-drop-resolution))) + ) + ) + ) + (let ((gp-0 (if (demo?) + "crane-victory-demo" + "crane-victory" + ) + ) + ) + (process-spawn scene-player :init scene-player-init gp-0 #t #f) ) ) - ) + ) ) ) :enter (behavior () (set! (-> self angle) 0.0) (set! (-> self angle-vel) 0.0) (quaternion-copy! (-> self init-quat) (-> self root quat)) - (none) ) :trans (behavior () (if (task-complete? *game-info* (game-task strip-drop)) (go-virtual final-position) ) - (none) ) :code (behavior () (until #f (suspend) ) #f - (none) ) :post (behavior () (let* ((f0-1 (* 3.640889 (the float (mod (current-time) #x4650)))) @@ -455,7 +446,6 @@ (let ((a1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)))) (strip-game-crate-method-22 (-> self crate 0) a1-2 (-> self root quat)) ) - (none) ) ) @@ -471,7 +461,6 @@ (strip-game-crate-method-22 (-> self crate 0) a1-3 (-> self root quat)) ) ) - (none) ) :code (the-as (function none :behavior crane) sleep-code) :post (the-as (function none :behavior crane) ja-post) @@ -548,15 +537,14 @@ This commonly includes things such as: (suspend) ) (sleep-code) - (none) ) ) ;; failed to figure out what this is: (defstate hidden (cranecrate) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('wake-up) (go-virtual idle) ) @@ -569,7 +557,6 @@ This commonly includes things such as: (suspend) ) (sleep-code) - (none) ) ) @@ -721,10 +708,10 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (grunt-egg) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) - (let* ((s5-0 (-> event param 0)) + (let* ((s5-0 (-> block param 0)) (s4-0 proc) (v1-2 (if (type? s4-0 process-focusable) (the-as process-focusable s4-0) @@ -759,7 +746,6 @@ This commonly includes things such as: ) (idle-control-method-10 (-> self idle-anim-player) self) (ja-post) - (none) ) ) @@ -768,7 +754,6 @@ This commonly includes things such as: :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc b/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc index f2e329bfb61..48950bb5188 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc @@ -82,49 +82,46 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs object. (defbehavior strip-handler strip-hazard ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as - object - (case arg2 - (('touch 'attack) - (let* ((s4-0 arg0) - (gp-0 (if (type? s4-0 process-focusable) - (the-as process-focusable s4-0) - ) - ) - ) - (when gp-0 - (let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) - (let* ((v1-4 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> gp-0 root quat))) - (f0-1 (vector-dot s4-1 v1-4)) - ) - (if (< 0.0 f0-1) - (vector-float*! s4-1 s4-1 -1.0) - ) - ) - (when (send-event gp-0 'attack (-> arg3 param 0) (static-attack-info ((id (-> self attack-id)) - (vector s4-1) - (shove-back (-> self shove-vec z)) - (shove-up (-> self shove-vec y)) - (control (if (focus-test? gp-0 board) - 1.0 - 0.0 - ) - ) - ) - ) - ) - (set! (-> self no-collision-timer) (the-as uint (current-time))) - (let ((v1-18 (-> self root root-prim))) - (set! (-> v1-18 prim-core collide-as) (collide-spec)) - (set! (-> v1-18 prim-core collide-with) (collide-spec)) + (case arg2 + (('touch 'attack) + (let* ((s4-0 arg0) + (gp-0 (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + ) + (when gp-0 + (let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (let* ((v1-4 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> gp-0 root quat))) + (f0-1 (vector-dot s4-1 v1-4)) + ) + (if (< 0.0 f0-1) + (vector-float*! s4-1 s4-1 -1.0) ) - 0 + ) + (when (send-event gp-0 'attack (-> arg3 param 0) (static-attack-info ((id (-> self attack-id)) + (vector s4-1) + (shove-back (-> self shove-vec z)) + (shove-up (-> self shove-vec y)) + (control (if (focus-test? gp-0 board) + 1.0 + 0.0 + ) + ) + ) + ) + ) + (set! (-> self no-collision-timer) (the-as uint (current-time))) + (let ((v1-18 (-> self root root-prim))) + (set! (-> v1-18 prim-core collide-as) (collide-spec)) + (set! (-> v1-18 prim-core collide-with) (collide-spec)) ) + 0 ) ) ) ) - ) + ) ) ) @@ -170,7 +167,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior strip-hazard) transform-post) ) @@ -277,7 +273,6 @@ This commonly includes things such as: ) (quaternion-rotate-local-x! (-> self root quat) (-> self root quat) (* (-> self spin) (seconds-per-frame))) (strip-trans) - (none) ) ) @@ -414,7 +409,6 @@ This commonly includes things such as: ) (update-trans! (-> self sound) (vector<-cspace! (new 'static 'vector) (-> self node-list data 4))) (update! (-> self sound)) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type strip-hazard idle) post))) @@ -429,7 +423,6 @@ This commonly includes things such as: ) (spawn (-> self part) gp-0) ) - (none) ) ) @@ -538,7 +531,6 @@ This commonly includes things such as: ) (update-trans! (-> self sound) (vector<-cspace! (new 'static 'vector) (-> self node-list data 3))) (update! (-> self sound)) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type strip-hazard idle) post))) @@ -557,7 +549,6 @@ This commonly includes things such as: (spawn (-> self part) s5-0) ) ) - (none) ) ) @@ -856,46 +847,43 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (grenade-point) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch 'attack) - (send-event proc 'ramp) - (when (logtest? (-> self level task-mask) (task-mask task1)) - (cond - ((send-event proc 'grenade (-> self speed)) - (if (-> self camera-name) - (set-setting! 'entity-name (-> self camera-name) 0.0 -1) - ) - ) - ((>= (- (current-time) (-> self enter-time)) (seconds 3)) - (talker-speech-class-method-12 (-> *talker-speech* 194) 1) - ) - ) - (set! (-> self enter-time) (current-time)) - ) - #f - ) - (('exit) - (the-as object (remove-setting! 'entity-name)) - ) - (('die) - (go-virtual die #t) - ) - (('kill) - (process-entity-status! self (entity-perm-status subtask-complete) #t) - (cleanup-for-death self) - (the-as object (deactivate self)) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (send-event proc 'ramp) + (when (logtest? (-> self level task-mask) (task-mask task1)) + (cond + ((send-event proc 'grenade (-> self speed)) + (if (-> self camera-name) + (set-setting! 'entity-name (-> self camera-name) 0.0 -1) + ) ) + ((>= (- (current-time) (-> self enter-time)) (seconds 3)) + (talker-speech-class-method-12 (-> *talker-speech* 194) 1) + ) + ) + (set! (-> self enter-time) (current-time)) + ) + #f + ) + (('exit) + (remove-setting! 'entity-name) + ) + (('die) + (go-virtual die #t) + ) + (('kill) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (cleanup-for-death self) + (deactivate self) + ) + ) ) :enter (behavior () (set! (-> self lightning-time) (+ (current-time) -1)) - (none) ) :exit (behavior () (remove-setting! 'entity-name) - (none) ) :code (the-as (function none :behavior grenade-point) sleep-code) :post (behavior () @@ -943,22 +931,20 @@ This commonly includes things such as: ) ) (update! (-> self sound)) - (none) ) ) ;; failed to figure out what this is: (defstate die (grenade-point) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('kill) - (process-entity-status! self (entity-perm-status subtask-complete) #t) - (cleanup-for-death self) - (the-as symbol (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('kill) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (cleanup-for-death self) + (deactivate self) + ) + ) ) :code (behavior ((arg0 symbol)) (play-communicator-speech! (-> *talker-speech* 194)) @@ -978,7 +964,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) ) @@ -1375,8 +1360,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate impact (grenade) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched) (let* ((s4-0 proc) (v1-1 (if (type? s4-0 process-drawable) @@ -1404,7 +1389,7 @@ This commonly includes things such as: (set! (-> v1-5 action-mask) (collide-action solid)) ) (if (< (fill-and-probe-using-line-sphere *collide-cache* a1-2) 0.0) - (send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) + (send-event proc 'attack (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode)))) ) ) ) @@ -1421,7 +1406,6 @@ This commonly includes things such as: (set! (-> self state-time) (current-time)) (send-event (handle->process (-> self end-target)) 'die) (remove-setting! 'point-of-interest) - (none) ) :code (behavior () (ja-channel-set! 0) @@ -1447,7 +1431,6 @@ This commonly includes things such as: ) 0 (deactivate self) - (none) ) ) @@ -1456,7 +1439,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (go-virtual impact) - (none) ) ) @@ -1781,13 +1763,13 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (drill-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touch 'attack) #f ) (else - (strip-handler proc arg1 event-type event) + (strip-handler proc argc message block) ) ) ) @@ -1798,7 +1780,6 @@ This commonly includes things such as: ) ) (rider-trans) - (none) ) :code (behavior () (until #f @@ -1818,7 +1799,6 @@ This commonly includes things such as: (suspend) ) #f - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type strip-hazard idle) post))) @@ -1833,7 +1813,6 @@ This commonly includes things such as: (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 7)) ) (update! (-> self plat-sound)) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/strip/strip-rescue_REF.gc b/test/decompiler/reference/jak2/levels/strip/strip-rescue_REF.gc index 3c8a03d5550..ae39e0ccf5a 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-rescue_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-rescue_REF.gc @@ -45,7 +45,6 @@ (suspend) ) (sleep-code) - (none) ) ) @@ -59,7 +58,6 @@ (suspend) ) (sleep-code) - (none) ) ) @@ -166,7 +164,6 @@ This commonly includes things such as: (suspend) ) (sleep-code) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc b/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc index 9650a419d22..7f77cf98360 100644 --- a/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc @@ -644,17 +644,16 @@ ;; failed to figure out what this is: (defstate startup (title-control) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('pause) - (set! (-> *game-info* demo-state) (the-as uint 2)) - (the-as object (remove-setting! 'bg-a)) - ) - (('scrap-book) - (go-virtual scrap-book (the-as int (-> event param 0))) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pause) + (set! (-> *game-info* demo-state) (the-as uint 2)) + (remove-setting! 'bg-a) + ) + (('scrap-book) + (go-virtual scrap-book (the-as int (-> block param 0))) + ) + ) ) :exit (behavior () (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) @@ -665,7 +664,6 @@ (disable *screen-filter*) (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) ) - (none) ) :code (behavior () (let ((v1-1 (-> *game-info* demo-state))) @@ -745,7 +743,6 @@ ) ) (go-virtual wait) - (none) ) :post (behavior () (local-vars (v1-73 external-art-buffer)) @@ -824,7 +821,6 @@ (set! (-> self active) #t) ) ) - (none) ) ) @@ -841,7 +837,6 @@ (go-virtual idle) ) (sleep-code) - (none) ) :post (-> (method-of-type title-control startup) post) ) @@ -856,7 +851,6 @@ (title-fade-out (* 3.0 (seconds-per-frame))) (title-progress 'title) (sleep-code) - (none) ) :post (-> (method-of-type title-control startup) post) ) @@ -928,7 +922,6 @@ (set-blackout-frames (seconds 0.2)) (set! (-> *game-info* demo-state) (the-as uint 1)) (go-virtual idle) - (none) ) :post (-> (method-of-type title-control startup) post) ) @@ -1034,12 +1027,12 @@ ;; failed to figure out what this is: (defstate target-title (target) - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('change-mode) - (case (-> event param 0) + (case (-> block param 0) (('grab) - (if (not (-> event param 1)) + (if (not (-> block param 1)) #t (go target-grab 'stance) ) @@ -1047,7 +1040,7 @@ ) ) (else - (target-generic-event-handler proc arg1 event-type event) + (target-generic-event-handler proc argc message block) ) ) ) @@ -1080,7 +1073,6 @@ (ppointer->handle (process-spawn title-control :init title-control-init :to *entity-pool*)) ) ) - (none) ) :code (the-as (function symbol none :behavior target) sleep-code) :post target-no-move-post diff --git a/test/decompiler/reference/jak2/levels/tomb/monster-frog_REF.gc b/test/decompiler/reference/jak2/levels/tomb/monster-frog_REF.gc index 71534a27037..530ad93fe65 100644 --- a/test/decompiler/reference/jak2/levels/tomb/monster-frog_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/monster-frog_REF.gc @@ -312,7 +312,6 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (behavior () (enemy-method-129 self) @@ -345,7 +344,6 @@ (set! (-> v1-37 prim-core collide-with) (-> self root backup-collide-with)) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior monster-frog) nav-enemy-simple-post) ) @@ -393,7 +391,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -495,7 +492,6 @@ ) ) #f - (none) ) ) @@ -524,7 +520,6 @@ (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) ) @@ -542,7 +537,6 @@ (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :trans (behavior () (nav-enemy-method-160 self) @@ -576,7 +570,6 @@ ) ) ) - (none) ) :code (behavior () (until #f @@ -678,7 +671,6 @@ ) ) #f - (none) ) ) @@ -713,7 +705,6 @@ (ja :num! (seek!)) ) (react-to-focus self) - (none) ) :post (behavior () (let ((a0-0 self)) @@ -731,7 +722,6 @@ ) ) (nav-enemy-simple-post) - (none) ) ) @@ -775,14 +765,12 @@ ) ) 0 - (none) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) ) - (none) ) :code (behavior ((arg0 vector)) (ja-channel-push! 1 (seconds 0.04)) @@ -801,7 +789,6 @@ (logclear! (-> self focus-status) (focus-status dangerous)) ) (go-virtual attack-recover) - (none) ) :post (the-as (function none :behavior monster-frog) nav-enemy-travel-post) ) @@ -820,7 +807,6 @@ (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :code (behavior () (ja-no-eval :group! monster-frog-attack0-end-ja @@ -864,7 +850,6 @@ ) ) (react-to-focus self) - (none) ) :post (the-as (function none :behavior monster-frog) nav-enemy-simple-post) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc b/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc index c686fbf60c3..fee380abd50 100644 --- a/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc @@ -446,7 +446,6 @@ :code (behavior ((arg0 handle)) (target-indax-init) (go target-indax-stance) - (none) ) :post target-indax-post ) @@ -457,12 +456,10 @@ :enter (behavior () ((-> target-stance enter)) (set! (-> self control mod-surface) *indax-walk-mods*) - (none) ) :exit (behavior () ((-> target-stance exit)) (target-indax-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -511,7 +508,6 @@ (go target-indax-attack) ) (fall-test target-indax-falling -4096000.0) - (none) ) :code (behavior () (let ((v1-2 (ja-group))) @@ -574,7 +570,6 @@ ) ) #f - (none) ) :post target-indax-post ) @@ -585,13 +580,11 @@ :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self control mod-surface) *indax-walk-mods*) - (none) ) :exit (behavior () (target-effect-exit) (target-state-hook-exit) (target-indax-exit) - (none) ) :trans (behavior () ((-> self state-hook)) @@ -639,7 +632,6 @@ (go target-indax-attack) ) (fall-test target-indax-falling -4096000.0) - (none) ) :code (behavior () (let ((f26-0 0.0) @@ -748,7 +740,6 @@ ) ) #f - (none) ) :post target-indax-post ) @@ -759,7 +750,6 @@ :enter (behavior ((arg0 symbol)) ((-> target-falling enter) arg0) (set! (-> self control mod-surface) *indax-jump-mods*) - (none) ) :exit target-indax-exit :trans (behavior () @@ -780,7 +770,6 @@ (seek! (-> self control unknown-float35) f0-3 (* 4.0 (seconds-per-frame))) ) ) - (none) ) :code (behavior ((arg0 symbol)) (let ((a1-0 75)) @@ -813,7 +802,6 @@ (ja :num! (loop!)) ) #f - (none) ) :post target-indax-post ) @@ -836,12 +824,10 @@ (t9-0 arg0 arg1 arg2) ) (set! (-> self control unknown-float35) 0.0) - (none) ) :exit (behavior () (target-exit) (target-indax-exit) - (none) ) :trans (behavior () ((-> target-indax-falling trans)) @@ -859,7 +845,6 @@ (-> *TARGET-bank* indax-double-jump-height-max) ) ) - (none) ) :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) (ja-channel-push! 2 (seconds 0.02)) @@ -893,7 +878,6 @@ (suspend) ) (go target-indax-falling #f) - (none) ) :post target-indax-post ) @@ -917,13 +901,11 @@ ) ) ) - (none) ) :exit (-> target-indax-jump exit) :trans (behavior () ((-> target-indax-falling trans)) (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) - (none) ) :code (behavior ((arg0 float) (arg1 float)) (sound-play "jump-double") @@ -960,7 +942,6 @@ ) ) (go target-indax-falling #f) - (none) ) :post target-post ) @@ -971,7 +952,6 @@ :enter (behavior ((arg0 symbol)) ((-> target-hit-ground enter) arg0) (set! (-> self control mod-surface) *indax-walk-mods*) - (none) ) :exit target-indax-exit :trans (behavior () @@ -1017,7 +997,6 @@ (go target-indax-attack) ) (fall-test target-falling -4096000.0) - (none) ) :code (behavior ((arg0 symbol)) (ja-channel-push! 1 (seconds 0.05)) @@ -1030,7 +1009,6 @@ (ja :num! (seek!)) ) (go target-indax-stance) - (none) ) :post target-indax-post ) @@ -1042,12 +1020,10 @@ (set! (-> self state-time) (current-time)) (sound-play "jump" :vol 70) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) - (none) ) :exit (behavior () (target-exit) (target-indax-exit) - (none) ) :code (behavior () (set! (-> self control mod-surface) *indax-bounce-mods*) @@ -1074,7 +1050,6 @@ (ja :num! (seek!)) ) (sleep-code) - (none) ) :post target-no-stick-post ) @@ -1086,7 +1061,6 @@ :exit (behavior () ((-> target-attack exit)) (target-indax-exit) - (none) ) :code (behavior () (let ((gp-0 (-> self draw art-group data 421))) @@ -1128,7 +1102,6 @@ (ja :num-func num-func-identity :frame-num max) ) (go target-indax-stance) - (none) ) :post target-indax-post ) @@ -1140,7 +1113,6 @@ :exit (behavior () ((-> target-attack-air exit)) (target-indax-exit) - (none) ) :code (behavior ((arg0 symbol)) (let ((gp-0 (-> self draw art-group data 428))) @@ -1178,7 +1150,6 @@ ) (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) (go target-indax-falling #f) - (none) ) :post target-indax-post ) @@ -1190,7 +1161,6 @@ :exit (behavior () ((-> target-running-attack enter)) (target-indax-exit) - (none) ) :code (behavior () (if (logtest? (water-flags touch-water) (-> self water flags)) @@ -1285,7 +1255,6 @@ (go target-indax-falling #f) ) (go target-indax-stance) - (none) ) :post target-post ) @@ -1320,7 +1289,6 @@ :exit (behavior () ((-> target-hit exit)) (target-indax-exit) - (none) ) :trans (behavior () (when (= *cheat-mode* 'debug) @@ -1329,7 +1297,6 @@ (go target-indax-stance) ) ) - (none) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags jump-out)) @@ -1435,7 +1402,6 @@ ) ) (go target-indax-hit-ground #f) - (none) ) :post target-indax-post ) @@ -1446,7 +1412,6 @@ :exit (behavior () ((-> target-death exit)) (target-indax-exit) - (none) ) :trans (-> target-indax-hit trans) :code (behavior ((arg0 symbol)) @@ -1567,7 +1532,6 @@ (initialize! (-> self game) 'life (the-as game-save #f) (the-as string #f)) (set! (-> self state-time) (current-time)) (sleep-code) - (none) ) :post target-no-stick-post ) diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-baby-spider_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-baby-spider_REF.gc index adc1be32bdb..28ea0e133ef 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-baby-spider_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-baby-spider_REF.gc @@ -270,7 +270,6 @@ ) ) #f - (none) ) ) @@ -319,7 +318,6 @@ ) ) (react-to-focus self) - (none) ) ) @@ -345,7 +343,6 @@ (set! (-> v1-14 attack-id) v0-2) (set! (-> self attack-id) v0-2) ) - (none) ) :exit (behavior () (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1))) @@ -357,14 +354,12 @@ (logclear! (-> self focus-status) (focus-status dangerous)) ) (nav-enemy-method-165 self) - (none) ) :trans (behavior () (enemy-method-49 self) (if (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) ) - (none) ) :code (behavior () (let ((v1-0 (-> self nav))) @@ -388,7 +383,6 @@ (ja :num! (seek! max 0.8)) ) (go-virtual attack-stop) - (none) ) :post (the-as (function none :behavior tomb-baby-spider) nav-enemy-chase-post) ) @@ -409,14 +403,12 @@ (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (none) ) :exit (behavior () (let ((v1-0 self)) (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-0 enemy-flags)))) ) 0 - (none) ) :code (behavior () (ja-no-eval :group! tomb-baby-spider-attack0-stop-ja @@ -484,7 +476,6 @@ ) ) (go-virtual hostile) - (none) ) :post (the-as (function none :behavior tomb-baby-spider) nav-enemy-face-focus-post) ) @@ -507,7 +498,6 @@ ) ) ) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc index 3726fc40c04..5ddb7170e99 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc @@ -275,6 +275,7 @@ ;; definition for method 185 of type tomb-beetle ;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. (defmethod tomb-beetle-method-185 tomb-beetle ((obj tomb-beetle)) (cond ((-> obj draw shadow) @@ -347,7 +348,6 @@ (t9-2) ) ) - (none) ) ) @@ -392,20 +392,17 @@ (setup-masks (-> self draw) 4 0) (setup-masks (-> self draw) 8 0) ) - (none) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :trans (behavior () (if (< (fabs (- (-> self root trans y) (-> self move-dest y))) 4096.0) (go-virtual land) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -420,12 +417,10 @@ ) ) #f - (none) ) :post (behavior () (tomb-beetle-method-185 self) (nav-enemy-falling-post) - (none) ) ) @@ -438,7 +433,6 @@ ) 0 (set! (-> self state-time) (current-time)) - (none) ) :code (behavior () (ja-no-eval :group! tomb-beetle-land-ja @@ -468,7 +462,6 @@ (ja :num! (seek!)) ) (go-virtual active) - (none) ) :post (the-as (function none :behavior tomb-beetle) nav-enemy-falling-post) ) @@ -514,13 +507,11 @@ (set! (-> a0-23 target-post quad) (-> v1-19 quad)) ) 0 - (none) ) :trans (behavior () (if (< (vector-vector-xz-distance (-> self root trans) (-> self move-dest)) 16384.0) (go-virtual stand) ) - (none) ) :code (behavior () (until #f @@ -548,11 +539,9 @@ ) ) #f - (none) ) :post (behavior () (nav-enemy-travel-post) - (none) ) ) @@ -572,13 +561,11 @@ ) 0 (set! (-> self state-timeout) (the-as time-frame (the int (* 300.0 (rand-vu-float-range 0.2 0.8))))) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) (go-virtual active) ) - (none) ) :code (behavior () (until #f @@ -592,7 +579,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior tomb-beetle) nav-enemy-simple-post) ) @@ -620,7 +606,6 @@ (set! (-> self fly-away-acc) (get-rand-float-range self 204800.0 512000.0)) (set! (-> self fly-away-ry-speed) (get-rand-float-range self 32768.0 109226.664)) (set! (-> self flying?) #f) - (none) ) :trans (behavior () (let ((f30-0 (- (-> self root trans y) (-> self fly-info 1 dst y)))) @@ -632,7 +617,6 @@ (set-vector! (-> self root scale) f0-2 f0-2 f0-2 1.0) ) ) - (none) ) :code (behavior () (set! (-> self state-timeout) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.0 0.8))))) @@ -691,7 +675,6 @@ ) ) #f - (none) ) :post (behavior () (local-vars (at-0 int)) @@ -736,7 +719,6 @@ ) (tomb-beetle-method-185 self) (transform-post) - (none) ) ) ) @@ -765,7 +747,6 @@ ) (send-event self 'death-end) (go-virtual explode) - (none) ) :post (the-as (function none :behavior tomb-beetle) nav-enemy-simple-post) ) @@ -839,7 +820,6 @@ (suspend) ) ) - (none) ) :post (the-as (function none :behavior tomb-beetle) nav-enemy-simple-post) ) @@ -921,7 +901,6 @@ (set! (-> self dest-index) 0) (set! (-> self speed) 122880.0) (vector-reset! (-> self root transv)) - (none) ) :trans (behavior () (when (< (vector-length (vector-! @@ -942,7 +921,6 @@ (quaternion-copy! (-> self src-quat) (-> self root quat)) (+! (-> self dest-index) 1) ) - (none) ) :code (behavior () (ja-channel-push! 1 (seconds 0.075)) @@ -968,7 +946,6 @@ ) ) #f - (none) ) :post (behavior () (local-vars (at-0 int)) @@ -1004,7 +981,6 @@ ) (tomb-beetle-method-185 self) (transform-post) - (none) ) ) ) @@ -1033,7 +1009,6 @@ ) ) ) - (none) ) :trans (the-as (function none :behavior tomb-beetle) ja-post) :code (behavior () @@ -1046,7 +1021,6 @@ (ja :num! (seek!)) ) (sleep-code) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc index 8f2991ac044..6484e4c6a13 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc @@ -50,7 +50,6 @@ (set! (-> self sound-id) (new 'static 'sound-id)) 0 ) - (none) ) :trans (behavior () (rlet ((acc :class vf) @@ -97,7 +96,6 @@ (set! (-> self last-pos) f30-0) ) (plat-trans) - (none) ) ) :code (behavior () @@ -112,7 +110,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior tomb-plat-wall) plat-post) ) @@ -231,35 +228,34 @@ This commonly includes things such as: ;; WARN: Return type mismatch int vs object. (defbehavior tomb-stair-block-collision tomb-stair-block-spikes ((arg0 symbol)) (let ((v1-1 (-> self root root-prim))) - (the-as object (cond - (arg0 - (set! (-> v1-1 prim-core collide-with) (collide-spec jak bot player-list)) - (let ((v0-0 (the-as int (-> v1-1 specific 1)))) - (set! (-> v1-1 specific 0) (the-as uint v0-0)) - v0-0 - ) - ) - (else - (set! (-> v1-1 prim-core collide-with) (collide-spec)) - (set! (-> v1-1 specific 0) (the-as uint 0)) - 0 - ) - ) - ) + (cond + (arg0 + (set! (-> v1-1 prim-core collide-with) (collide-spec jak bot player-list)) + (let ((v0-0 (the-as int (-> v1-1 specific 1)))) + (set! (-> v1-1 specific 0) (the-as uint v0-0)) + v0-0 + ) + ) + (else + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + (set! (-> v1-1 specific 0) (the-as uint 0)) + 0 + ) + ) ) ) ;; failed to figure out what this is: (defstate idle (tomb-stair-block-spikes) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('sound) (sound-play "tomb-spikes") ) (('set-position) (let ((v0-1 (the-as object (-> self root trans)))) - (set! (-> (the-as vector v0-1) quad) (-> (the-as vector (-> event param 0)) quad)) + (set! (-> (the-as vector v0-1) quad) (-> (the-as vector (-> block param 0)) quad)) v0-1 ) ) @@ -536,20 +532,17 @@ This commonly includes things such as: :num! (identity (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) ) (transform-post) - (none) ) :trans (behavior () (lift-pool 1) (drop-pool 0) (position-spikes 1200) - (none) ) :code (behavior () (suspend) (suspend) (transform-post) (sleep-code) - (none) ) ) @@ -560,13 +553,11 @@ This commonly includes things such as: (set! (-> self camera-state) 0) (set! (-> self state-time) (current-time)) (task-node-close! (game-task-node tomb-poles-block)) - (none) ) :exit (behavior () (remove-setting! 'entity-name) (remove-setting! 'interp-time) (remove-setting! 'string-startup-vector) - (none) ) :trans (behavior () (rider-trans) @@ -587,7 +578,6 @@ This commonly includes things such as: (process-release? *target*) ) ) - (none) ) :code (behavior () (local-vars (v1-5 symbol) (v1-51 symbol)) @@ -634,7 +624,6 @@ This commonly includes things such as: (set! v1-51 (or (not *target*) (process-release? *target*))) ) (go-virtual sunk) - (none) ) :post (the-as (function none :behavior tomb-stair-block) rider-post) ) @@ -642,8 +631,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate moving (tomb-stair-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('cue-chase) (set-action! *gui-control* @@ -666,13 +655,11 @@ This commonly includes things such as: ) (set! (-> self camera-state) 0) 0 - (none) ) :exit (behavior () (remove-setting! 'entity-name) (remove-setting! 'interp-time) (remove-setting! 'string-startup-vector) - (none) ) :trans (behavior () (rider-trans) @@ -713,7 +700,6 @@ This commonly includes things such as: ) (lift-pool 0) (drop-pool 1) - (none) ) :code (behavior () (local-vars (v1-1 symbol)) @@ -739,7 +725,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior tomb-stair-block) rider-post) ) @@ -747,8 +732,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (tomb-stair-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('cue-chase) (set-action! *gui-control* @@ -794,7 +779,6 @@ This commonly includes things such as: ) ) ) - (none) ) :trans (behavior () (let ((f0-3 (seek (-> self root trans y) (+ -104448.0 (-> self initial-y)) 409.6))) @@ -804,7 +788,6 @@ This commonly includes things such as: (lift-pool 0) (drop-pool 1) (position-spikes 1500) - (none) ) :code (the-as (function none :behavior tomb-stair-block) sleep-code) :post (the-as (function none :behavior tomb-stair-block) transform-post) @@ -851,7 +834,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior tomb-stair-block) sleep-code) ) @@ -1179,7 +1161,6 @@ This commonly includes things such as: ) ) (set! (-> self speed) 0.0) - (none) ) :code (behavior () (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) @@ -1193,7 +1174,6 @@ This commonly includes things such as: (ja :num! (loop! (* 0.00007771238 (-> self speed)))) ) #f - (none) ) :post (behavior () (set! (-> self last-pos quad) (-> self basetrans quad)) @@ -1203,7 +1183,6 @@ This commonly includes things such as: ) ) (set! (-> self speed) (* (- (-> self last-pos y) (-> self basetrans y)) (-> self clock frames-per-second))) - (none) ) ) @@ -1526,8 +1505,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate close (tomb-boulder-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('reset) (if (task-node-closed? (game-task-node tomb-poles-boulder)) (go-virtual close) @@ -1544,7 +1523,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -1558,7 +1536,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask sleep)) (suspend) 0 - (none) ) ) @@ -1653,8 +1630,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate hidden (tomb-plat-return) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger 'cue-chase) (go-virtual run-intro) ) @@ -1662,7 +1639,6 @@ This commonly includes things such as: ) :enter (behavior () (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (the-as (function none :behavior tomb-plat-return) sleep-code) ) @@ -1678,11 +1654,9 @@ This commonly includes things such as: (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) (set! (-> self path-pos) 0.0) (set-vector! (-> self root scale) 0.0 0.0 0.0 0.0) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (when (= (-> self path-pos) 1.0) @@ -1690,7 +1664,6 @@ This commonly includes things such as: (go-virtual waiting) ) (plat-trans) - (none) ) :code (the-as (function none :behavior tomb-plat-return) sleep-code) :post (behavior () @@ -1706,15 +1679,14 @@ This commonly includes things such as: (set-vector! (-> self root scale) f30-0 f30-0 f30-0 f30-0) ) (plat-post) - (none) ) ) ;; failed to figure out what this is: (defstate waiting (tomb-plat-return) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (let ((v0-0 (the-as object (logior (-> self flags) (tomb-plat-flags topflags-0))))) (set! (-> self flags) (the-as tomb-plat-flags v0-0)) @@ -1722,14 +1694,13 @@ This commonly includes things such as: ) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) :enter (behavior () (set! (-> self ride-timer) (current-time)) (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) - (none) ) :trans (behavior () (logclear! (-> self flags) (tomb-plat-flags topflags-0)) @@ -1744,7 +1715,6 @@ This commonly includes things such as: ) (go-virtual running) ) - (none) ) :code (the-as (function none :behavior tomb-plat-return) sleep-code) :post (the-as (function none :behavior tomb-plat-return) plat-post) @@ -1753,8 +1723,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate running (tomb-plat-return) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (let ((v0-0 (the-as object (logior (-> self flags) (tomb-plat-flags topflags-0))))) (set! (-> self flags) (the-as tomb-plat-flags v0-0)) @@ -1762,20 +1732,18 @@ This commonly includes things such as: ) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) :exit (behavior () (sound-stop (-> self sound-id)) - (none) ) :trans (behavior () (if (= (-> self path-pos) (-> self dest-pos)) (go-virtual waiting-for-no-player) ) (plat-trans) - (none) ) :code (the-as (function none :behavior tomb-plat-return) sleep-code) :post (behavior () @@ -1788,15 +1756,14 @@ This commonly includes things such as: 'interp ) (plat-post) - (none) ) ) ;; failed to figure out what this is: (defstate waiting-for-no-player (tomb-plat-return) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('ridden) (let ((v0-0 (the-as object (current-time)))) (set! (-> self ride-timer) (the-as time-frame v0-0)) @@ -1804,7 +1771,7 @@ This commonly includes things such as: ) ) (else - (plat-event proc arg1 event-type event) + (plat-event proc argc message block) ) ) ) @@ -1821,7 +1788,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior tomb-plat-return) sleep-code) :post (the-as (function none :behavior tomb-plat-return) plat-post) @@ -2033,8 +1999,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (tomb-sphinx) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger 'cue-chase) (go-virtual active) ) @@ -2046,8 +2012,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate active (tomb-sphinx) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('door-left) (set! (-> self move-dir) -1.0) (go-virtual doors-open) @@ -2060,7 +2026,6 @@ This commonly includes things such as: ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :code (behavior () (local-vars (sv-96 vector)) @@ -2113,7 +2078,6 @@ This commonly includes things such as: ) ) #f - (none) ) ) ) @@ -2123,7 +2087,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :code (behavior () (local-vars (sv-96 vector) (sv-112 vector)) @@ -2196,7 +2159,6 @@ This commonly includes things such as: ) ) #f - (none) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc index 4b98e49646e..dee6cb6bbce 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc @@ -40,8 +40,8 @@ ;; failed to figure out what this is: (defstate idle (tomb-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('simon-done) (sound-play "simon-correct") ) @@ -71,7 +71,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior tomb-door) sleep-code) ) @@ -113,7 +112,6 @@ ) ) ) - (none) ) :code (behavior ((arg0 time-frame)) (let ((s5-0 (current-time))) @@ -132,7 +130,6 @@ (ja :num! (seek!)) ) (sleep-code) - (none) ) ) @@ -249,8 +246,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (tomb-beetle-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('add-beetle) (set! (-> self beetle (-> self offset-index)) (process->handle proc)) (+! (-> self offset-index) 1) @@ -270,7 +267,6 @@ This commonly includes things such as: :code (the-as (function none :behavior tomb-beetle-door) sleep-code) :post (behavior () 0 - (none) ) ) @@ -316,7 +312,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 3) @@ -329,7 +324,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (sleep-code) - (none) ) :post (the-as (function none :behavior tomb-beetle-door) ja-post) ) @@ -590,13 +584,13 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate going-down (tomb-beetle-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('get-round) (-> self round) ) (else - ((-> (method-of-type basebutton going-down) event) proc arg1 event-type event) + ((-> (method-of-type basebutton going-down) event) proc argc message block) ) ) ) @@ -607,31 +601,27 @@ This commonly includes things such as: ) ) (process-grab? *target* #f) - (none) ) ) ;; failed to figure out what this is: (defstate down-idle (tomb-beetle-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (cond - ((= v1-0 'set-round) - (let ((v0-0 (the-as object (-> event param 0)))) - (set! (-> self round) (the-as uint v0-0)) - v0-0 - ) - ) - ((= v1-0 'door-open) - (remove-setting! 'gun) - (the-as object (remove-setting! 'entity-name)) - ) - (else - ((-> (method-of-type basebutton down-idle) event) proc arg1 event-type event) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('set-round) + (let ((v0-0 (the-as object (-> block param 0)))) + (set! (-> self round) (the-as uint v0-0)) + v0-0 + ) + ) + (('door-open) + (remove-setting! 'gun) + (remove-setting! 'entity-name) + ) + (else + ((-> (method-of-type basebutton down-idle) event) proc argc message block) + ) ) ) :trans (behavior () @@ -651,23 +641,22 @@ This commonly includes things such as: (tomb-beetle-button-method-39 self) ) ) - (none) ) ) ;; failed to figure out what this is: (defstate going-up (tomb-beetle-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('set-round) - (let ((v0-0 (the-as object (-> event param 0)))) + (let ((v0-0 (the-as object (-> block param 0)))) (set! (-> self round) (the-as uint v0-0)) v0-0 ) ) (else - ((-> (method-of-type basebutton going-up) event) proc arg1 event-type event) + ((-> (method-of-type basebutton going-up) event) proc argc message block) ) ) ) @@ -676,19 +665,19 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate up-idle (tomb-beetle-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('get-round) (-> self round) ) (('set-round) - (let ((v0-0 (the-as object (-> event param 0)))) + (let ((v0-0 (the-as object (-> block param 0)))) (set! (-> self round) (the-as uint v0-0)) v0-0 ) ) (else - ((-> (method-of-type basebutton up-idle) event) proc arg1 event-type event) + ((-> (method-of-type basebutton up-idle) event) proc argc message block) ) ) ) @@ -723,7 +712,6 @@ This commonly includes things such as: ) ) ) - (none) ) ) @@ -917,89 +905,84 @@ This commonly includes things such as: ) ;; definition for function tomb-plat-simon-handler -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 135] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 199] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 280] (defbehavior tomb-plat-simon-handler tomb-plat-simon ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('ready-index) - (tomb-plat-simon-method-24 self (the-as int (-> arg3 param 0))) - ) - (('plat-ridden) - (logior! (-> self flags) 1) - (when (= (-> arg3 param 0) (-> self plat-seq (+ (-> self plat-seq-count) -1))) - (when (-> self notify-actor) - (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) 'simon-done) - (let ((t9-1 send-event-function) - (v1-11 (-> self notify-actor)) - ) - (t9-1 - (if v1-11 - (-> v1-11 extra process) - ) - a1-2 - ) - ) - ) - (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) - (let ((v1-20 (-> *event-queue* data (-> *event-queue* length)))) - (+! (-> *event-queue* length) 1) - (set! (-> v1-20 form-handle) (process->handle self)) - (let ((a0-23 (-> self notify-actor))) - (set! (-> v1-20 to-handle) (process->handle (if a0-23 - (-> a0-23 extra process) - ) - ) - ) - ) - (set! (-> v1-20 num-params) 0) - (set! (-> v1-20 message) 'trigger) - ) - ) - ) - (sound-play "tomb-simon-fall") - (dotimes (s5-1 (-> self plat-count)) - (if (!= s5-1 (-> arg3 param 0)) - (send-event (handle->process (-> self plat s5-1)) 'die-unmaskable) - ) - ) - #f - ) - ) - (('finished) - (if (-> self button-handle) - (send-event (handle->process (-> self button-handle)) 'trigger) - ) - (dotimes (gp-1 (-> self plat-count)) - (send-event (handle->process (-> self plat gp-1)) 'die-unmaskable) - ) - (go-virtual dormant) - ) - (('die-but) - (if (-> self button-handle) - (send-event (handle->process (-> self button-handle)) 'untrigger) - ) - (sound-play "tomb-simon-fall") - (dotimes (s5-3 (-> self plat-count)) - (if (!= s5-3 (-> arg3 param 0)) - (send-event (handle->process (-> self plat s5-3)) 'die) - ) - ) - (go-virtual dormant) - ) + (case arg2 + (('ready-index) + (tomb-plat-simon-method-24 self (the-as int (-> arg3 param 0))) + ) + (('plat-ridden) + (logior! (-> self flags) 1) + (when (= (-> arg3 param 0) (-> self plat-seq (+ (-> self plat-seq-count) -1))) + (when (-> self notify-actor) + (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) 'simon-done) + (let ((t9-1 send-event-function) + (v1-11 (-> self notify-actor)) + ) + (t9-1 + (if v1-11 + (-> v1-11 extra process) ) - ) + a1-2 + ) + ) + ) + (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) + (let ((v1-20 (-> *event-queue* data (-> *event-queue* length)))) + (+! (-> *event-queue* length) 1) + (set! (-> v1-20 form-handle) (process->handle self)) + (let ((a0-23 (-> self notify-actor))) + (set! (-> v1-20 to-handle) (process->handle (if a0-23 + (-> a0-23 extra process) + ) + ) + ) + ) + (set! (-> v1-20 num-params) 0) + (set! (-> v1-20 message) 'trigger) + ) + ) + ) + (sound-play "tomb-simon-fall") + (dotimes (s5-1 (-> self plat-count)) + (if (!= s5-1 (-> arg3 param 0)) + (send-event (handle->process (-> self plat s5-1)) 'die-unmaskable) + ) + ) + #f + ) + ) + (('finished) + (if (-> self button-handle) + (send-event (handle->process (-> self button-handle)) 'trigger) + ) + (dotimes (gp-1 (-> self plat-count)) + (send-event (handle->process (-> self plat gp-1)) 'die-unmaskable) + ) + (go-virtual dormant) + ) + (('die-but) + (if (-> self button-handle) + (send-event (handle->process (-> self button-handle)) 'untrigger) + ) + (sound-play "tomb-simon-fall") + (dotimes (s5-3 (-> self plat-count)) + (if (!= s5-3 (-> arg3 param 0)) + (send-event (handle->process (-> self plat s5-3)) 'die) + ) + ) + (go-virtual dormant) + ) + ) ) ;; failed to figure out what this is: (defstate dormant (tomb-plat-simon) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger 'cue-chase) (set! (-> self button-handle) (process->handle proc)) (go-virtual appear) @@ -1092,7 +1075,6 @@ This commonly includes things such as: (set! (-> self plat gp-2) (ppointer->handle s4-0)) ) ) - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -1101,7 +1083,6 @@ This commonly includes things such as: ) ) (go-virtual show-sequence) - (none) ) ) @@ -1113,7 +1094,6 @@ This commonly includes things such as: (set! (-> self state-time) (+ (current-time) (seconds -1))) (set! (-> self plat-idx) 0) 0 - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 2)) @@ -1129,7 +1109,6 @@ This commonly includes things such as: (go-virtual idle) ) ) - (none) ) :code (the-as (function none :behavior tomb-plat-simon) sleep-code) ) @@ -1137,8 +1116,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (tomb-plat-simon) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger 'cue-chase) (dotimes (gp-0 (-> self plat-count)) (send-event (handle->process (-> self plat gp-0)) 'reset) @@ -1146,7 +1125,7 @@ This commonly includes things such as: (go-virtual show-sequence) ) (else - (tomb-plat-simon-handler proc arg1 event-type event) + (tomb-plat-simon-handler proc argc message block) ) ) ) @@ -1154,12 +1133,10 @@ This commonly includes things such as: (if (-> self button-handle) (send-event (handle->process (-> self button-handle)) 'untrigger) ) - (none) ) :code (the-as (function none :behavior tomb-plat-simon) sleep-code) :post (behavior () (debug-draw (-> self path)) - (none) ) ) @@ -1282,51 +1259,47 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (tomb-simon-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('reparent) - (change-parent self proc) - ) - (('blink) - (the-as object (set-blink-timers! self)) - ) - (('edge-grabbed) - (go-virtual dangerous) - ) - (('ridden 'bonk) - (let* ((gp-0 *target*) - (a0-12 (if (type? gp-0 process-focusable) - gp-0 - ) - ) - ) - (when a0-12 - (let ((v1-6 (get-trans a0-12 0)) - (a0-14 (-> self root trans)) - ) - (if (and (>= 8192.0 (fabs (- (-> v1-6 x) (-> a0-14 x)))) (>= 8192.0 (fabs (- (-> v1-6 z) (-> a0-14 z))))) - (go-virtual dangerous) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('reparent) + (change-parent self proc) + ) + (('blink) + (set-blink-timers! self) + ) + (('edge-grabbed) + (go-virtual dangerous) + ) + (('ridden 'bonk) + (let* ((gp-0 *target*) + (a0-12 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (when a0-12 + (let ((v1-6 (get-trans a0-12 0)) + (a0-14 (-> self root trans)) + ) + (if (and (>= 8192.0 (fabs (- (-> v1-6 x) (-> a0-14 x)))) (>= 8192.0 (fabs (- (-> v1-6 z) (-> a0-14 z))))) + (go-virtual dangerous) + ) ) ) ) - (('die 'die-unmaskable) - (go-virtual die) - ) - (('ready) - (go-virtual ready) - ) - ) + ) + (('die 'die-unmaskable) + (go-virtual die) + ) + (('ready) + (go-virtual ready) + ) ) ) :enter (behavior () (set! (-> self state-time) (current-time)) (logclear! (-> self flags) (simon-block-flags sbf0 sbf1 sbf2 sbf5)) (set! (-> self move-rate) 122880.0) - (none) ) :trans tomb-simon-block-trans :code (the-as (function none :behavior tomb-simon-block) sleep-code) @@ -1337,15 +1310,14 @@ This commonly includes things such as: (tomb-simon-block-post) (plat-post) ) - (none) ) ) ;; failed to figure out what this is: (defstate dangerous (tomb-simon-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die-unmaskable) (go-virtual die) ) @@ -1392,7 +1364,6 @@ This commonly includes things such as: (logior! (-> self flags) (simon-block-flags sbf4)) (set! (-> self ride-timer) (current-time)) (send-event (ppointer->process (-> self parent)) 'die-but (-> self my-idx)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self ride-timer)) (seconds 1)) @@ -1400,7 +1371,6 @@ This commonly includes things such as: (go-virtual die) ) (plat-trans) - (none) ) :code (the-as (function none :behavior tomb-simon-block) sleep-code) :post tomb-simon-block-post @@ -1409,29 +1379,28 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate ready (tomb-simon-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (start-bouncing! self)) - ) - (('reset) - (go-virtual idle) - ) - (('blink) - (the-as object (set-blink-timers! self)) - ) - (('die 'die-unmaskable) - (go-virtual die) - ) - (('ridden) - (send-event (ppointer->process (-> self parent)) 'plat-ridden (-> self my-idx)) - (if (!= (-> self next-idx) -1) - (send-event (ppointer->process (-> self parent)) 'ready-index (-> self next-idx)) - ) - (go-virtual ridden) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (start-bouncing! self) + ) + (('reset) + (go-virtual idle) + ) + (('blink) + (set-blink-timers! self) + ) + (('die 'die-unmaskable) + (go-virtual die) + ) + (('ridden) + (send-event (ppointer->process (-> self parent)) 'plat-ridden (-> self my-idx)) + (if (!= (-> self next-idx) -1) + (send-event (ppointer->process (-> self parent)) 'ready-index (-> self next-idx)) + ) + (go-virtual ridden) + ) + ) ) :trans tomb-simon-block-trans :code (the-as (function none :behavior tomb-simon-block) sleep-code) @@ -1441,32 +1410,30 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate ridden (tomb-simon-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (start-bouncing! self)) - ) - (('reset) - (go-virtual idle) - ) - (('die-unmaskable) - (go-virtual die) - ) - (('die) - (go-virtual temporary) - ) - (('ridden) - (let ((v0-0 (the-as object (current-time)))) - (set! (-> self ride-timer) (the-as time-frame v0-0)) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (start-bouncing! self) + ) + (('reset) + (go-virtual idle) + ) + (('die-unmaskable) + (go-virtual die) + ) + (('die) + (go-virtual temporary) + ) + (('ridden) + (let ((v0-0 (the-as object (current-time)))) + (set! (-> self ride-timer) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) ) :enter (behavior () (set! (-> self ride-timer) (current-time)) - (none) ) :trans (behavior () (let* ((gp-0 *target*) @@ -1500,7 +1467,6 @@ This commonly includes things such as: ) ) (tomb-simon-block-trans) - (none) ) :code (the-as (function none :behavior tomb-simon-block) sleep-code) :post tomb-simon-block-post @@ -1509,33 +1475,31 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate temporary (tomb-simon-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('bonk) - (the-as object (start-bouncing! self)) - ) - (('reset) - (go-virtual idle) - ) - (('die-unmaskable) - (go-virtual die) - ) - (('ridden) - (when (not (logtest? (-> self flags) (simon-block-flags sbf2))) - (logior! (-> self flags) (simon-block-flags sbf2)) - (let ((v0-0 (the-as object (current-time)))) - (set! (-> self ride-timer) (the-as time-frame v0-0)) - v0-0 - ) - ) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (start-bouncing! self) + ) + (('reset) + (go-virtual idle) + ) + (('die-unmaskable) + (go-virtual die) + ) + (('ridden) + (when (not (logtest? (-> self flags) (simon-block-flags sbf2))) + (logior! (-> self flags) (simon-block-flags sbf2)) + (let ((v0-0 (the-as object (current-time)))) + (set! (-> self ride-timer) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ) ) :enter (behavior () (logclear! (-> self flags) (simon-block-flags sbf0 sbf1 sbf2)) (set! (-> self draw color-mult quad) (-> self color quad)) - (none) ) :trans (behavior () (if (and (logtest? (-> self flags) (simon-block-flags sbf2)) @@ -1544,7 +1508,6 @@ This commonly includes things such as: (go-virtual wobble-die) ) (plat-trans) - (none) ) :code (the-as (function none :behavior tomb-simon-block) sleep-code) :post tomb-simon-block-post @@ -1553,8 +1516,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate wobble-die (tomb-simon-block) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('reset) (go-virtual idle) ) @@ -1575,7 +1538,6 @@ This commonly includes things such as: ) (sound-play "tomb-simon-last") (go-virtual die) - (none) ) :post tomb-simon-block-post ) @@ -1597,13 +1559,11 @@ This commonly includes things such as: ) ) (cleanup-for-death self) - (none) ) :post (behavior () (set! (-> self root transv y) (- (-> self root transv y) (* (-> self move-rate) (seconds-per-frame)))) (+! (-> self root trans y) (-> self root transv y)) (transform-post) - (none) ) ) @@ -1718,8 +1678,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (tomb-simon-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual open #f) ) @@ -1733,7 +1693,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior tomb-simon-button) sleep-code) ) @@ -1745,7 +1704,6 @@ This commonly includes things such as: (let ((v1-2 (-> self entity extra perm))) (set! (-> v1-2 user-int8 0) 1) ) - (none) ) :trans (the-as (function none :behavior tomb-simon-button) rider-trans) :code (behavior ((arg0 symbol)) @@ -1768,7 +1726,6 @@ This commonly includes things such as: ) ) (go-virtual waiting) - (none) ) :post (the-as (function none :behavior tomb-simon-button) rider-post) ) @@ -1776,11 +1733,11 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate waiting (tomb-simon-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('bonk 'touch) (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> event param 0)) + (the-as touching-shapes-entry (-> block param 0)) (the-as collide-shape (-> self root)) (the-as uint 1) ) @@ -1808,7 +1765,6 @@ This commonly includes things such as: :frame-num 0.0 ) (transform-post) - (none) ) :code (the-as (function none :behavior tomb-simon-button) sleep-code) ) @@ -1816,8 +1772,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate pressed (tomb-simon-button) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go-virtual unpress) ) @@ -1853,7 +1809,6 @@ This commonly includes things such as: ) ) (sleep-code) - (none) ) ) @@ -1874,7 +1829,6 @@ This commonly includes things such as: (set! (-> v1-26 user-int8 0) 1) ) (go-virtual waiting) - (none) ) ) @@ -2083,14 +2037,13 @@ This commonly includes things such as: ) ) #f - (none) ) ) ;; failed to figure out what this is: (defstate idle (tomb-vibe) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (let ((v1-0 (new 'static 'array int32 4 -1 0 0 0)) (gp-0 (new 'static 'array handle 2 (new 'static 'handle :process #xffffffff :pid #xffffffff :u64 #xffffffffffffffff) @@ -2098,9 +2051,9 @@ This commonly includes things such as: ) ) ) - (case event-type + (case message (('attack) - (case (-> (the-as attack-info (-> event param 1)) mode) + (case (-> (the-as attack-info (-> block param 1)) mode) (('flop 'spin 'punch) (cond ((and (= (-> v1-0 0) (-> self pat-tbl (-> self pat-index))) (!= (-> gp-0 0) (process->handle self))) @@ -2121,7 +2074,7 @@ This commonly includes things such as: (('set-pattern) (set! (-> v1-0 0) -1) (set! (-> gp-0 0) (the-as handle #f)) - (let ((v0-0 (the-as object (-> event param 0)))) + (let ((v0-0 (the-as object (-> block param 0)))) (set! (-> self pat-index) (the-as int v0-0)) v0-0 ) @@ -2140,7 +2093,6 @@ This commonly includes things such as: ) :trans (behavior () 0 - (none) ) :code (the-as (function none :behavior tomb-vibe) sleep-code) :post (behavior () @@ -2165,24 +2117,20 @@ This commonly includes things such as: ) ) ) - (none) ) ) ;; failed to figure out what this is: (defstate vibrate (tomb-vibe) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('interrupt) - (the-as object (kill-persister *setting-control* (the-as engine-pers (process->ppointer self)) 'sound-tune)) - ) - (('die) - (go-virtual die #f) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('interrupt) + (kill-persister *setting-control* (the-as engine-pers (process->ppointer self)) 'sound-tune) + ) + (('die) + (go-virtual die #f) + ) ) ) :enter (behavior () @@ -2216,17 +2164,14 @@ This commonly includes things such as: ) ) ) - (none) ) :exit (behavior () (process-release? *target*) (kill-persister *setting-control* (the-as engine-pers (process->ppointer self)) 'sound-tune) (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) - (none) ) :trans (behavior () 0 - (none) ) :code (behavior () (let ((gp-0 (current-time))) @@ -2264,7 +2209,6 @@ This commonly includes things such as: (go-virtual die #f) (go-virtual idle) ) - (none) ) :post (the-as (function none :behavior tomb-vibe) transform-post) ) @@ -2274,7 +2218,6 @@ This commonly includes things such as: :virtual #t :enter (behavior ((arg0 symbol)) (process-entity-status! self (entity-perm-status subtask-complete) #t) - (none) ) :code (behavior ((arg0 symbol)) (cond @@ -2336,7 +2279,6 @@ This commonly includes things such as: ) (label cfg-13) (sleep-code) - (none) ) ) @@ -2542,7 +2484,6 @@ This commonly includes things such as: (logior! (-> self mask) (process-mask actor-pause)) ) ) - (none) ) :code (the-as (function none :behavior tomb-water-trap) sleep-code) ) @@ -2560,11 +2501,9 @@ This commonly includes things such as: ) ) ) - (none) ) :exit (behavior () (set-tombc-electricity-scale! 0.0) - (none) ) :trans (behavior () (when (-> self can-exit-running?) @@ -2574,7 +2513,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (until #f @@ -2647,12 +2585,10 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (update-vol! (-> self sound) (-> self volume)) (update! (-> self sound)) - (none) ) ) @@ -2896,8 +2832,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (tomb-smash-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger 'cue-chase) (set! (-> self button) (process->handle proc)) (go-virtual open) @@ -2912,7 +2848,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (-> self timeout)) @@ -2944,7 +2879,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (behavior () (ja-no-eval :group! (-> self draw art-group data 3) @@ -2957,7 +2891,6 @@ This commonly includes things such as: (ja :num! (seek!)) ) (sleep-code) - (none) ) ) @@ -2976,7 +2909,6 @@ This commonly includes things such as: ) (send-event (handle->process (-> self button)) 'untrigger) (go-virtual idle) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc b/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc index 62564597384..b0fc7d883c8 100644 --- a/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc @@ -620,30 +620,28 @@ ;; failed to figure out what this is: (defstate idle (baron-pod) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('frame) - (let ((v1-3 (ja-group))) - (when (not (and v1-3 (= v1-3 (-> self draw art-group data 4)))) - (ja :group! (-> self draw art-group data 4) :num! min) - (set! (-> self draw bounds w) 81920.0) - ) - ) - (when (and (< (ja-aframe-num 0) 834.0) (>= (the-as float (-> event param 0)) 834.0)) - (setup-masks (-> self draw) 4 2) - (set! (-> self has-stone) #t) - (the-as symbol (baron-pod-method-21 self #t)) - ) - ) - (('finale) - (the-as symbol (setup-masks (-> self draw) 8 0)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('frame) + (let ((v1-3 (ja-group))) + (when (not (and v1-3 (= v1-3 (-> self draw art-group data 4)))) + (ja :group! (-> self draw art-group data 4) :num! min) + (set! (-> self draw bounds w) 81920.0) + ) + ) + (when (and (< (ja-aframe-num 0) 834.0) (>= (the-as float (-> block param 0)) 834.0)) + (setup-masks (-> self draw) 4 2) + (set! (-> self has-stone) #t) + (baron-pod-method-21 self #t) + ) + ) + (('finale) + (setup-masks (-> self draw) 8 0) + ) + ) ) :trans (behavior () (baron-pod-method-21 self #f) - (none) ) :code (the-as (function none :behavior baron-pod) sleep-code) :post (the-as (function none :behavior baron-pod) transform-post) @@ -728,7 +726,6 @@ (cleanup-for-death self) (deactivate self) ) - (none) ) :code (the-as (function none :behavior tomb-boss-bridge) sleep-code) ) @@ -1152,186 +1149,182 @@ This commonly includes things such as: ;; definition for function widow-handler ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. (defbehavior widow-handler widow ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object) (sv-224 symbol) (sv-240 symbol) (sv-256 vector) (sv-272 matrix)) - (the-as - object - (case arg2 - (('attack) - (let ((v1-1 (the-as object (-> arg3 param 1)))) - (when (and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info v1-1) mask)) - (logtest? (penetrate dark-bomb) (-> (the-as attack-info v1-1) penetrate-using)) - (!= (-> self last-attack-id) (-> (the-as attack-info v1-1) id)) - ) - (set! (-> self last-attack-id) (-> (the-as attack-info v1-1) id)) - (send-event self 'bomb-hit (target-pos 0) 4) - (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-2 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 - (the-as part-tracker gp-2) - *entity-pool* - (symbol->string (-> part-tracker symbol)) - (the-as pointer #x70004000) - ) + (case arg2 + (('attack) + (let ((v1-1 (the-as object (-> arg3 param 1)))) + (when (and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info v1-1) mask)) + (logtest? (penetrate dark-bomb) (-> (the-as attack-info v1-1) penetrate-using)) + (!= (-> self last-attack-id) (-> (the-as attack-info v1-1) id)) + ) + (set! (-> self last-attack-id) (-> (the-as attack-info v1-1) id)) + (send-event self 'bomb-hit (target-pos 0) 4) + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-2 + (let ((t9-3 (method-of-type part-tracker activate))) + (t9-3 + (the-as part-tracker gp-2) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) ) - (let ((s5-0 run-function-in-process) - (s4-0 gp-2) - (s3-0 part-tracker-init) - (s2-0 (-> *part-group-id-table* 710)) - (s1-0 600) - (s0-0 #f) - ) - (set! sv-224 (the-as symbol #f)) - (set! sv-240 (the-as symbol #f)) - (set! sv-272 *launch-matrix*) - (set! sv-256 (-> sv-272 trans)) - (let ((v1-16 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 11)) quad))) - (set! (-> sv-256 quad) v1-16) + ) + (let ((s5-0 run-function-in-process) + (s4-0 gp-2) + (s3-0 part-tracker-init) + (s2-0 (-> *part-group-id-table* 710)) + (s1-0 600) + (s0-0 #f) ) - ((the-as (function object object object object object object object object none) s5-0) - s4-0 - s3-0 - s2-0 - s1-0 - s0-0 - sv-224 - sv-240 - sv-272 - ) + (set! sv-224 (the-as symbol #f)) + (set! sv-240 (the-as symbol #f)) + (set! sv-272 *launch-matrix*) + (set! sv-256 (-> sv-272 trans)) + (let ((v1-16 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 11)) quad))) + (set! (-> sv-256 quad) v1-16) ) - (-> gp-2 ppointer) + ((the-as (function object object object object object object object object none) s5-0) + s4-0 + s3-0 + s2-0 + s1-0 + s0-0 + sv-224 + sv-240 + sv-272 + ) ) + (-> gp-2 ppointer) ) ) ) ) - (('shot-hit-target) - (when (< (-> self last-gun-hit-stage) (-> self current-shoot-stage)) - (+! (-> self gun-hits) 1) - (set! v0-0 (-> self current-shoot-stage)) - (set! (-> self last-gun-hit-stage) (the-as int v0-0)) - v0-0 - ) - ) - (('bomb-kicked) - (set! v0-0 (+ (-> self kicked-bombs) 1)) - (set! (-> self kicked-bombs) (the-as int v0-0)) + ) + (('shot-hit-target) + (when (< (-> self last-gun-hit-stage) (-> self current-shoot-stage)) + (+! (-> self gun-hits) 1) + (set! v0-0 (-> self current-shoot-stage)) + (set! (-> self last-gun-hit-stage) (the-as int v0-0)) v0-0 ) - (('widow-get-center) - (-> self circle-center) - ) - (('debris-hit) - (when (< -819.2 (-> self osc vel y)) - (sound-play "wid-debris-hit") - (case (-> arg3 param 0) - ((1) - (set! (-> self osc vel y) (+ -3072.0 (-> self osc vel y))) - ) - ((2) - (set! (-> self osc vel y) (+ -2048.0 (-> self osc vel y))) - ) - ) + ) + (('bomb-kicked) + (set! v0-0 (+ (-> self kicked-bombs) 1)) + (set! (-> self kicked-bombs) (the-as int v0-0)) + v0-0 + ) + (('widow-get-center) + (-> self circle-center) + ) + (('debris-hit) + (when (< -819.2 (-> self osc vel y)) + (sound-play "wid-debris-hit") + (case (-> arg3 param 0) + ((1) + (set! (-> self osc vel y) (+ -3072.0 (-> self osc vel y))) + ) + ((2) + (set! (-> self osc vel y) (+ -2048.0 (-> self osc vel y))) + ) ) ) - (('catwalk-hit) - (let ((v1-26 (-> arg3 param 0))) - (when (and (> (the-as int v1-26) 0) (< (the-as int v1-26) 8)) - (let ((v1-28 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-28 from) (process->ppointer arg0)) - (set! (-> v1-28 num-params) arg1) - (set! (-> v1-28 message) arg2) - (set! (-> v1-28 param 0) (-> arg3 param 0)) - (set! (-> v1-28 param 1) (-> arg3 param 1)) - (set! (-> v1-28 param 2) (-> arg3 param 2)) - (set! (-> v1-28 param 3) (-> arg3 param 3)) - (set! (-> v1-28 param 4) (-> arg3 param 4)) - (set! (-> v1-28 param 5) (-> arg3 param 5)) - (send-event-function (handle->process (-> self catwalk 0)) v1-28) - ) + ) + (('catwalk-hit) + (let ((v1-26 (-> arg3 param 0))) + (when (and (> (the-as int v1-26) 0) (< (the-as int v1-26) 8)) + (let ((v1-28 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-28 from) (process->ppointer arg0)) + (set! (-> v1-28 num-params) arg1) + (set! (-> v1-28 message) arg2) + (set! (-> v1-28 param 0) (-> arg3 param 0)) + (set! (-> v1-28 param 1) (-> arg3 param 1)) + (set! (-> v1-28 param 2) (-> arg3 param 2)) + (set! (-> v1-28 param 3) (-> arg3 param 3)) + (set! (-> v1-28 param 4) (-> arg3 param 4)) + (set! (-> v1-28 param 5) (-> arg3 param 5)) + (send-event-function (handle->process (-> self catwalk 0)) v1-28) ) ) ) - (('child-jumped) - (set! v0-0 (logclear (-> (the-as spydroid arg0) enemy-flags) (enemy-flag alert))) - (set! (-> (the-as spydroid arg0) enemy-flags) (the-as enemy-flag v0-0)) - v0-0 + ) + (('child-jumped) + (set! v0-0 (logclear (-> (the-as spydroid arg0) enemy-flags) (enemy-flag alert))) + (set! (-> (the-as spydroid arg0) enemy-flags) (the-as enemy-flag v0-0)) + v0-0 + ) + (('bomb-hit) + (set! (-> self bomb-hits) (min 4 (+ (-> self bomb-hits) (-> arg3 param 1)))) + (let ((v1-33 (handle->process (-> self hud)))) + (if v1-33 + (set! (-> (the-as hud-widow v1-33) values 1 target) (/ (* 100 (- 4 (-> self bomb-hits))) 4)) + ) ) - (('bomb-hit) - (set! (-> self bomb-hits) (min 4 (+ (-> self bomb-hits) (-> arg3 param 1)))) - (let ((v1-33 (handle->process (-> self hud)))) - (if v1-33 - (set! (-> (the-as hud-widow v1-33) values 1 target) (/ (* 100 (- 4 (-> self bomb-hits))) 4)) - ) - ) - (when (and (not (-> self flying)) (< (-> self bomb-hits) 4)) - (let* ((s4-2 (-> arg3 param 0)) - (v0-9 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) - (s5-2 (-> self node-list data 3 bone transform)) - (s4-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (the-as vector s4-2) v0-9) 1.0)) - (f30-0 (vector-dot s4-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-2 vector 2) 1.0))) - (f28-0 - (vector-dot s4-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> s5-2 vector)) 1.0)) - ) + (when (and (not (-> self flying)) (< (-> self bomb-hits) 4)) + (let* ((s4-2 (-> arg3 param 0)) + (v0-9 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) + (s5-2 (-> self node-list data 3 bone transform)) + (s4-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (the-as vector s4-2) v0-9) 1.0)) + (f30-0 (vector-dot s4-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-2 vector 2) 1.0))) + (f28-0 + (vector-dot s4-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> s5-2 vector)) 1.0)) ) - (ja-channel-push! 1 (seconds 0.03)) - (set! (-> self drill-speed target) 0.0) - (cond - ((< (cos 5461.3335) f30-0) - (ja :group! (-> self draw art-group data 25) :num! min) - (setup-masks (-> self draw) 2 128) - ) - ((and (< (cos 8192.0) f30-0) (< 0.0 f28-0)) - (ja :group! (-> self draw art-group data 26) :num! min) - (setup-masks (-> self draw) 4 256) - ) - ((< (cos 8192.0) f30-0) - (ja :group! (-> self draw art-group data 27) :num! min) - (setup-masks (-> self draw) 8 512) ) - ((< 0.0 f28-0) - (ja :group! (-> self draw art-group data 23) :num! min) - (setup-masks (-> self draw) 16 1024) - ) - (else - (ja :group! (-> self draw art-group data 24) :num! min) - (setup-masks (-> self draw) 32 2048) - ) - ) - ) - ) - (when (-> self flying) + (ja-channel-push! 1 (seconds 0.03)) (set! (-> self drill-speed target) 0.0) (cond - ((>= (-> self bomb-hits) 4) - #f + ((< (cos 5461.3335) f30-0) + (ja :group! (-> self draw art-group data 25) :num! min) + (setup-masks (-> self draw) 2 128) ) - ((begin - (ja-channel-push! 1 (seconds 0.03)) - (let* ((gp-3 (-> arg3 param 0)) - (v0-28 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) - (s5-8 (-> self node-list data 3 bone transform)) - (f0-20 (vector-dot - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (the-as vector gp-3) v0-28) 1.0) - (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> s5-8 vector)) 1.0) - ) - ) - ) - (< 0.0 f0-20) - ) - ) - (ja :group! (-> self draw art-group data 37) :num! min) - (the-as object (setup-masks (-> self draw) 16 1024)) + ((and (< (cos 8192.0) f30-0) (< 0.0 f28-0)) + (ja :group! (-> self draw art-group data 26) :num! min) + (setup-masks (-> self draw) 4 256) + ) + ((< (cos 8192.0) f30-0) + (ja :group! (-> self draw art-group data 27) :num! min) + (setup-masks (-> self draw) 8 512) + ) + ((< 0.0 f28-0) + (ja :group! (-> self draw art-group data 23) :num! min) + (setup-masks (-> self draw) 16 1024) ) (else - (ja :group! (-> self draw art-group data 36) :num! min) - (the-as object (setup-masks (-> self draw) 32 2048)) + (ja :group! (-> self draw art-group data 24) :num! min) + (setup-masks (-> self draw) 32 2048) ) ) ) ) - ) + (when (-> self flying) + (set! (-> self drill-speed target) 0.0) + (cond + ((>= (-> self bomb-hits) 4) + #f + ) + ((begin + (ja-channel-push! 1 (seconds 0.03)) + (let* ((gp-3 (-> arg3 param 0)) + (v0-28 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) + (s5-8 (-> self node-list data 3 bone transform)) + (f0-20 (vector-dot + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (the-as vector gp-3) v0-28) 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> s5-8 vector)) 1.0) + ) + ) + ) + (< 0.0 f0-20) + ) + ) + (ja :group! (-> self draw art-group data 37) :num! min) + (setup-masks (-> self draw) 16 1024) + ) + (else + (ja :group! (-> self draw art-group data 36) :num! min) + (setup-masks (-> self draw) 32 2048) + ) + ) + ) + ) ) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc b/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc index 58ca61d23d0..ecb8d8b97c3 100644 --- a/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc @@ -165,14 +165,12 @@ ) ) ) - (none) ) :trans (behavior () (ja :num! (seek!)) (if (ja-done? 0) (deactivate self) ) - (none) ) :code (the-as (function none :behavior tomb-boss-catwalk) sleep-code) :post (the-as (function none :behavior tomb-boss-catwalk) ja-post) @@ -181,43 +179,42 @@ ;; failed to figure out what this is: (defstate idle (tomb-boss-catwalk) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('catwalk-hit) - (when (zero? (-> self which-look)) - (case (-> event param 0) - ((1) - (the-as object (setup-masks (-> self draw) 0 1)) - ) - ((2) - (the-as object (setup-masks (-> self draw) 0 2)) - ) - ((3) - (the-as object (setup-masks (-> self draw) 0 4)) - ) - ((4) - (the-as object (setup-masks (-> self draw) 0 8)) - ) - ((5) - (the-as object (setup-masks (-> self draw) 0 16)) - ) - ((6) - (the-as object (setup-masks (-> self draw) 0 32)) - ) - ((7) - (the-as object (setup-masks (-> self draw) 0 64)) - ) - ) - ) - ) - (('green-hit) - (when (nonzero? (-> self which-look)) - (send-event (ppointer->process (-> self parent)) 'catwalk-hit (-> self which-look)) - (go-virtual shatter) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('catwalk-hit) + (when (zero? (-> self which-look)) + (case (-> block param 0) + ((1) + (setup-masks (-> self draw) 0 1) + ) + ((2) + (setup-masks (-> self draw) 0 2) + ) + ((3) + (setup-masks (-> self draw) 0 4) ) + ((4) + (setup-masks (-> self draw) 0 8) + ) + ((5) + (setup-masks (-> self draw) 0 16) + ) + ((6) + (setup-masks (-> self draw) 0 32) + ) + ((7) + (setup-masks (-> self draw) 0 64) + ) + ) + ) + ) + (('green-hit) + (when (nonzero? (-> self which-look)) + (send-event (ppointer->process (-> self parent)) 'catwalk-hit (-> self which-look)) + (go-virtual shatter) + ) + ) + ) ) :code (the-as (function none :behavior tomb-boss-catwalk) sleep-code) ) @@ -697,7 +694,6 @@ This commonly includes things such as: ) ;; definition for function widow-bomb-handler -;; WARN: Return type mismatch object vs none. (defbehavior widow-bomb-handler widow-bomb ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v1-13 float)) (rlet ((acc :class vf) @@ -778,17 +774,17 @@ This commonly includes things such as: (f30-1 600.0) (v1-34 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-35 (the-as number (logior #x3f800000 v1-34))) + (v0-7 (the-as object (- gp-1 (the-as time-frame (the int (* f30-1 (+ -1.0 (the-as float v1-35)))))))) ) - (set! (-> self fizzle-timer) (- gp-1 (the-as time-frame (the int (* f30-1 (+ -1.0 (the-as float v1-35))))))) + (set! (-> self fizzle-timer) (the-as time-frame v0-7)) + v0-7 ) ) ) - (none) ) ) ;; definition for function widow-bomb-back-handler -;; WARN: Return type mismatch object vs none. (defbehavior widow-bomb-back-handler widow-bomb ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('impact-control) @@ -821,21 +817,21 @@ This commonly includes things such as: (f30-0 600.0) (v1-34 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-35 (the-as number (logior #x3f800000 v1-34))) + (v0-6 (the-as object (- gp-1 (the-as time-frame (the int (* f30-0 (+ -1.0 (the-as float v1-35)))))))) ) - (set! (-> self fizzle-timer) (- gp-1 (the-as time-frame (the int (* f30-0 (+ -1.0 (the-as float v1-35))))))) + (set! (-> self fizzle-timer) (the-as time-frame v0-6)) + v0-6 ) ) ) - (none) ) ;; failed to figure out what this is: (defstate freefall (widow-bomb) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior widow-bomb) widow-bomb-back-handler) + :event widow-bomb-back-handler :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (and (nonzero? (-> self fizzle-timer)) (>= (- (current-time) (-> self fizzle-timer)) (seconds 3))) @@ -865,7 +861,6 @@ This commonly includes things such as: ) ) (ja :num! (loop!)) - (none) ) :code (the-as (function none :behavior widow-bomb) sleep-code) :post (the-as (function none :behavior widow-bomb) transform-post) @@ -874,7 +869,7 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate back-atcha (widow-bomb) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior widow-bomb) widow-bomb-back-handler) + :event widow-bomb-back-handler :enter (behavior () (set! (-> self state-time) (current-time)) (initialize @@ -888,7 +883,6 @@ This commonly includes things such as: (logior! (-> v1-5 prim-core collide-with) (collide-spec enemy)) (logclear! (-> v1-5 prim-core collide-with) (collide-spec jak)) ) - (none) ) :trans (behavior () (if (and (nonzero? (-> self fizzle-timer)) (>= (- (current-time) (-> self fizzle-timer)) (seconds 3))) @@ -936,7 +930,6 @@ This commonly includes things such as: ) ) (ja :num! (loop!)) - (none) ) :code (the-as (function none :behavior widow-bomb) sleep-code) :post (the-as (function none :behavior widow-bomb) transform-post) @@ -968,7 +961,6 @@ This commonly includes things such as: 0 (sound-play "w-bomb-explode") (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (cond @@ -983,7 +975,6 @@ This commonly includes things such as: (deactivate self) ) ) - (none) ) :code (the-as (function none :behavior widow-bomb) sleep-code) :post (the-as (function none :behavior widow-bomb) ja-post) @@ -1039,7 +1030,7 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate smoke (widow-bomb) :virtual #t - :event (the-as (function process int symbol event-message-block object :behavior widow-bomb) widow-bomb-handler) + :event widow-bomb-handler :enter (behavior () (set! (-> self state-time) (current-time)) (let* ((v1-2 3600) @@ -1049,16 +1040,13 @@ This commonly includes things such as: (set! (-> self next-countdown-tick) (the-as time-frame (- v1-3 (mod v1-3 (* a0-0 a0-0))))) ) (set! (-> self steam-sound) (new-sound-id)) - (none) ) :exit (behavior () (sound-stop (-> self steam-sound)) - (none) ) :trans (behavior () (widow-bomb-method-32 self) (ja :num! (loop!)) - (none) ) :code (the-as (function none :behavior widow-bomb) sleep-code) :post (the-as (function none :behavior widow-bomb) ja-post) @@ -1085,48 +1073,42 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (widow-bomb) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as - object - (cond - ((or (= v1-0 'touch) (= v1-0 'bonk)) - (if (< (-> self which-trajectory) 2) - (send-event - *target* - 'attack - #f - (static-attack-info ((id (new-attack-id)) (shove-up (meters 1)) (shove-back (meters 3)))) - ) - ) - ) - ((= v1-0 'impact-control) - (if (and (!= proc self) (!= proc (-> self parent))) - (send-event proc 'bomb-hit (-> self root trans) 1) - ) - ) - ((= v1-0 'fizzle) - (let* ((gp-0 (current-time)) - (f30-0 600.0) - (v1-17 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-18 (the-as number (logior #x3f800000 v1-17))) - (v0-0 (the-as object (- gp-0 (the-as time-frame (the int (* f30-0 (+ -1.0 (the-as float v1-18)))))))) - ) - (set! (-> self fizzle-timer) (the-as time-frame v0-0)) - v0-0 + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'bonk) + (if (< (-> self which-trajectory) 2) + (send-event + *target* + 'attack + #f + (static-attack-info ((id (new-attack-id)) (shove-up (meters 1)) (shove-back (meters 3)))) ) ) - (else - (the-as object (widow-bomb-handler proc arg1 event-type event)) - ) - ) + ) + (('impact-control) + (if (and (!= proc self) (!= proc (-> self parent))) + (send-event proc 'bomb-hit (-> self root trans) 1) + ) + ) + (('fizzle) + (let* ((gp-0 (current-time)) + (f30-0 600.0) + (v1-17 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-18 (the-as number (logior #x3f800000 v1-17))) + (v0-0 (the-as object (- gp-0 (the-as time-frame (the int (* f30-0 (+ -1.0 (the-as float v1-18)))))))) + ) + (set! (-> self fizzle-timer) (the-as time-frame v0-0)) + v0-0 + ) + ) + (else + (widow-bomb-handler proc argc message block) ) ) ) :enter (behavior () (set! (-> self state-time) (current-time)) (initialize (-> self impact) self 3 4096.0 (collide-spec backgnd obstacle hit-by-others-list player-list)) - (none) ) :exit (behavior () (when (nonzero? (-> self fizzle-timer)) @@ -1138,7 +1120,6 @@ This commonly includes things such as: (set! (-> self fizzle-timer) (- gp-0 (the-as time-frame (the int (* f30-0 (+ -1.0 (the-as float v1-5))))))) ) ) - (none) ) :trans (behavior () (let ((v1-0 (-> self which-trajectory))) @@ -1268,13 +1249,11 @@ This commonly includes things such as: ) ) (ja :num! (loop!)) - (none) ) :code (the-as (function none :behavior widow-bomb) sleep-code) :post (behavior () (transform-post) (do-push-aways (-> self root)) - (none) ) ) @@ -1442,34 +1421,33 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (heart-mar) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('frame) - (let ((v1-3 (ja-group))) - (when (not (and v1-3 (= v1-3 (-> self draw art-group data 3)))) - (ja :group! (-> self draw art-group data 3) :num! min) - (set! (-> self draw bounds w) 81920.0) - (setup-masks (-> self draw) 2 0) - ) - ) - (if (and (< (ja-aframe-num 0) 775.0) (>= (the-as float (-> event param 0)) 775.0)) - (setup-masks (-> self draw) 0 4) - ) - (if (>= (the-as float (-> event param 0)) 834.0) - (deactivate self) - ) - (set-tombboss-gem-light! (lerp-scale 1.0 0.0 (ja-aframe-num 0) 760.0 800.0)) - (ja :num-func num-func-identity :frame-num (ja-aframe (the-as float (-> event param 0)) 0)) - (let ((v0-9 (logclear (-> self mask) (process-mask sleep-code)))) - (set! (-> self mask) v0-9) - v0-9 - ) - ) - (('grab-done) - (the-as process-mask (deactivate self)) - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('frame) + (let ((v1-3 (ja-group))) + (when (not (and v1-3 (= v1-3 (-> self draw art-group data 3)))) + (ja :group! (-> self draw art-group data 3) :num! min) + (set! (-> self draw bounds w) 81920.0) + (setup-masks (-> self draw) 2 0) + ) + ) + (if (and (< (ja-aframe-num 0) 775.0) (>= (the-as float (-> block param 0)) 775.0)) + (setup-masks (-> self draw) 0 4) + ) + (if (>= (the-as float (-> block param 0)) 834.0) + (deactivate self) + ) + (set-tombboss-gem-light! (lerp-scale 1.0 0.0 (ja-aframe-num 0) 760.0 800.0)) + (ja :num-func num-func-identity :frame-num (ja-aframe (the-as float (-> block param 0)) 0)) + (let ((v0-9 (the-as object (logclear (-> self mask) (process-mask sleep-code))))) + (set! (-> self mask) (the-as process-mask v0-9)) + v0-9 + ) + ) + (('grab-done) + (deactivate self) + ) + ) ) :code (behavior () (until #f @@ -1478,7 +1456,6 @@ This commonly includes things such as: (ja-post) ) #f - (none) ) ) @@ -1626,7 +1603,6 @@ This commonly includes things such as: ) (tomb-boss-pillar-shrink-collision) (ja-post) - (none) ) :code (the-as (function none :behavior tomb-boss-pillar) sleep-code) ) @@ -1637,7 +1613,6 @@ This commonly includes things such as: :enter (behavior () (set! (-> self draw bounds w) 245760.0) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (if (< (- (current-time) (-> self state-time)) (seconds 1)) @@ -1657,7 +1632,6 @@ This commonly includes things such as: ) ) ) - (none) ) :code (the-as (function none :behavior tomb-boss-pillar) sleep-code) :post (the-as (function none :behavior tomb-boss-pillar) ja-post) @@ -1666,8 +1640,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (tomb-boss-pillar) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (let ((gp-0 proc)) (when (if (type? gp-0 widow-shot) @@ -1707,14 +1681,12 @@ This commonly includes things such as: ) 0 (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status bit-5)) (set! (-> v1-2 user-object 1) (-> self segs-shot)) ) - (none) ) :code (the-as (function none :behavior tomb-boss-pillar) sleep-code) ) @@ -1862,7 +1834,6 @@ This commonly includes things such as: ) (tomb-boss-firepot-shrink-collision) (ja-post) - (none) ) :code (the-as (function none :behavior tomb-boss-firepot) sleep-code) ) @@ -1910,14 +1881,12 @@ This commonly includes things such as: (-> gp-1 ppointer) ) ) - (none) ) :trans (behavior () (ja :num! (seek!)) (if (ja-done? 0) (go-virtual broken) ) - (none) ) :code (the-as (function none :behavior tomb-boss-firepot) sleep-code) :post (the-as (function none :behavior tomb-boss-firepot) ja-post) @@ -1926,14 +1895,14 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (tomb-boss-firepot) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) (let ((gp-0 proc)) (when (if (type? gp-0 widow-shot) (the-as widow-shot gp-0) ) - (let ((v1-2 (the-as object (-> event param 1))) + (let ((v1-2 (the-as object (-> block param 1))) (gp-1 (new 'stack-no-clear 'vector)) ) (cond @@ -1941,7 +1910,7 @@ This commonly includes things such as: (set! (-> gp-1 quad) (-> (the-as attack-info v1-2) attacker-velocity quad)) ) (else - (let* ((a3-1 (the-as object (-> event param 0))) + (let* ((a3-1 (the-as object (-> block param 0))) (a1-4 (-> (the-as touching-shapes-entry a3-1) head)) ) (get-intersect-point gp-1 a1-4 (-> self root) (the-as touching-shapes-entry a3-1)) @@ -1970,7 +1939,6 @@ This commonly includes things such as: (set! (-> v1-3 prim-core collide-with) (collide-spec)) ) 0 - (none) ) :code (the-as (function none :behavior tomb-boss-firepot) sleep-code) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/widow-more-extras_REF.gc b/test/decompiler/reference/jak2/levels/tomb/widow-more-extras_REF.gc index 6d1246f09a9..eb0bc5c1901 100644 --- a/test/decompiler/reference/jak2/levels/tomb/widow-more-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/widow-more-extras_REF.gc @@ -102,21 +102,19 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :code (behavior () (suspend) (suspend) 0 - (none) ) ) ;; failed to figure out what this is: (defstate idle (tomb-boss-debris) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('touched 'touch 'attack) (let ((v1-2 (-> self look))) (cond @@ -242,7 +240,6 @@ ) :enter (behavior () (set! (-> self sound-floor) 81920.0) - (none) ) :trans (behavior () (local-vars (sv-16 float)) @@ -299,7 +296,6 @@ ) (set-vector! (-> self draw color-mult) f30-1 f30-1 f30-1 1.0) ) - (none) ) :code (the-as (function none :behavior tomb-boss-debris) sleep-code) :post (behavior () @@ -310,7 +306,6 @@ (set! (-> a1-0 tlist) *touching-list*) (find-overlapping-shapes (-> self root) a1-0) ) - (none) ) ) @@ -501,7 +496,6 @@ :virtual #t :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (spawn (-> self part) (-> self root trans)) @@ -513,7 +507,6 @@ ) (set! (-> self state-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.1 0.5))))) ) - (none) ) :code (the-as (function none :behavior cave-in-master) sleep-code) ) @@ -521,8 +514,8 @@ ;; failed to figure out what this is: (defstate wait (cave-in-master) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('start) (go-virtual idle) ) diff --git a/test/decompiler/reference/jak2/levels/under/centipede_REF.gc b/test/decompiler/reference/jak2/levels/under/centipede_REF.gc index 3d97d94b144..9fe7f91daaf 100644 --- a/test/decompiler/reference/jak2/levels/under/centipede_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/centipede_REF.gc @@ -820,7 +820,6 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) @@ -829,7 +828,6 @@ (set! (-> v1-5 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :code (the-as (function none :behavior centipede) sleep-code) ) @@ -839,7 +837,6 @@ :virtual #t :exit (behavior () (set-chan1-effects self) - (none) ) :code (behavior () (logior! (-> self enemy-flags) (enemy-flag chase-startup)) @@ -865,7 +862,6 @@ (suspend) ) #f - (none) ) ) @@ -883,7 +879,6 @@ (logior! (-> self enemy-flags) (enemy-flag chase-startup)) (vector-reset! (-> self root transv)) (set! (-> self desired-talking-volume) 1.0) - (none) ) :exit (behavior () (set-chan1-effects self) @@ -892,7 +887,6 @@ (t9-1) ) ) - (none) ) :code (behavior () (until #f @@ -911,7 +905,6 @@ (suspend) ) #f - (none) ) :post (the-as (function none :behavior centipede) nav-enemy-simple-post) ) @@ -930,7 +923,6 @@ (logior! (-> self enemy-flags) (enemy-flag chase-startup)) (vector-reset! (-> self root transv)) (set! (-> self desired-talking-volume) 1.0) - (none) ) :exit (behavior () (set-chan1-effects self) @@ -939,7 +931,6 @@ (t9-1) ) ) - (none) ) :code (-> (method-of-type centipede idle) code) :post (-> (method-of-type centipede idle) post) @@ -959,7 +950,6 @@ (logior! (-> self enemy-flags) (enemy-flag chase-startup)) (vector-reset! (-> self root transv)) (set! (-> self desired-talking-volume) 1.0) - (none) ) :exit (behavior () (set-chan1-effects self) @@ -968,7 +958,6 @@ (t9-1) ) ) - (none) ) :code (-> (method-of-type centipede idle) code) ) @@ -984,7 +973,6 @@ ) (stop-looking-at-target! self) (set! (-> self desired-talking-volume) 1.0) - (none) ) :exit (behavior () (set-chan1-effects self) @@ -993,7 +981,6 @@ (t9-1) ) ) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 0.5)) @@ -1011,7 +998,6 @@ (if (target-close? self) (go-virtual attack) ) - (none) ) :code (the-as (function none :behavior centipede) sleep-code) :post (behavior () @@ -1031,7 +1017,6 @@ ) ) (nav-enemy-method-176 self) - (none) ) ) @@ -1046,7 +1031,6 @@ ) (stop-looking-at-target! self) (set! (-> self desired-talking-volume) 1.0) - (none) ) :exit (behavior () (set-chan1-effects self) @@ -1055,19 +1039,16 @@ (t9-1) ) ) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self state-time)) (seconds 2)) (react-to-focus self) ) - (none) ) :code (the-as (function none :behavior centipede) sleep-code) :post (behavior () (centipede-method-188 self) (nav-enemy-method-176 self) - (none) ) ) @@ -1141,11 +1122,9 @@ ) (quaternion-copy! (-> self src-quat) (-> self root quat)) (quaternion-copy! (-> self dest-quat) (-> self src-quat)) - (none) ) :exit (behavior () (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) - (none) ) :trans (behavior () (when (-> self grabbed-focus?) @@ -1160,7 +1139,6 @@ ) ) ) - (none) ) :code (behavior () (local-vars (a1-5 event-message-block)) @@ -1197,12 +1175,10 @@ ) ) (go-hostile self) - (none) ) :post (behavior () (transform-post) (centipede-method-183 self) - (none) ) ) @@ -1211,7 +1187,6 @@ :virtual #t :exit (behavior () (set-chan1-effects self) - (none) ) :code (behavior () (set! (-> self state-time) (current-time)) @@ -1230,7 +1205,6 @@ (suspend) ) (go-hostile self) - (none) ) :post (-> (method-of-type centipede attack) post) ) @@ -1247,11 +1221,9 @@ (nav-enemy-method-167 self) (vector-reset! (-> self root transv)) (set! (-> self desired-talking-volume) 1.0) - (none) ) :exit (behavior () (set-chan1-effects self) - (none) ) :code (behavior () (logior! (-> self focus-status) (focus-status disable)) @@ -1274,11 +1246,9 @@ (logior! (-> self draw status) (draw-control-status no-draw)) (cleanup-for-death self) (sleep-code) - (none) ) :post (behavior () (centipede-method-183 self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc b/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc index 1afc9d365ab..087d5ca615a 100644 --- a/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc @@ -477,7 +477,6 @@ (hover-nav-control-method-10 (-> self hover) gp-1 s5-2 (the-as vector #t)) ) (set! (-> self restart-fly-anims) #t) - (none) ) :trans (behavior () (local-vars (a0-8 vector) (gp-2 vector)) @@ -498,13 +497,11 @@ (set! (-> self path-stare-u) (get-norm! (-> self sync) 0)) (go-virtual stare) ) - (none) ) :code (the-as (function none :behavior jellyfish) hover-enemy-fly-code) :post (behavior () (debug-draw (-> self path)) (hover-enemy-dest-post) - (none) ) ) @@ -537,7 +534,6 @@ ) (set! (-> self charge-path-timer) 0) (look-at-target! self (enemy-flag lock-focus)) - (none) ) :trans (behavior () (local-vars (gp-0 vector)) @@ -570,12 +566,10 @@ (go-virtual threaten) ) ) - (none) ) :post (behavior () (hover-nav-control-method-11 (-> self hover) (-> self stare-pos)) (hover-enemy-dest-post) - (none) ) ) @@ -585,15 +579,12 @@ :event (the-as (function process int symbol event-message-block object :behavior jellyfish) enemy-event-handler) :enter (behavior () (set! *jellyfish-mech-reserved* #t) - (none) ) :exit (behavior () (set! *jellyfish-mech-reserved* #f) - (none) ) :trans (behavior () (seek! (-> self tentacle-blend) 0.0 (seconds-per-frame)) - (none) ) :code (behavior () (set! (-> self restart-fly-anims) #t) @@ -624,12 +615,10 @@ ) ) ) - (none) ) :post (behavior () (hover-nav-control-method-11 (-> self hover) (the-as vector #f)) (hover-enemy-dest-post) - (none) ) ) @@ -649,7 +638,6 @@ ) (logior! (-> self focus-status) (focus-status dangerous)) (set! (-> self state-time) (current-time)) - (none) ) :exit (behavior () (hover-nav-control-method-14 (-> self hover) 1.0 1.0) @@ -659,7 +647,6 @@ ) (hover-nav-control-method-20 (-> self hover)) (set! *jellyfish-mech-reserved* #f) - (none) ) :trans (behavior () (let ((gp-0 (-> self root trans))) @@ -677,7 +664,6 @@ ) ) ) - (none) ) :code (behavior () (ja-no-eval :group! jellyfish-notice-charge-ja @@ -699,7 +685,6 @@ ) ) #f - (none) ) :post (behavior () (let* ((gp-0 (-> self root trans)) @@ -721,7 +706,6 @@ ) (hover-nav-control-method-11 (-> self hover) (-> self charge-pos)) (hover-enemy-dest-post) - (none) ) ) @@ -743,7 +727,6 @@ ) ) ) - (none) ) :exit (behavior () (sound-stop (-> self sound-id)) @@ -756,7 +739,6 @@ (initialize-chain-joints (-> self tentacles gp-0)) ) (set! *jellyfish-mech-reserved* #f) - (none) ) :trans (behavior () (let ((gp-0 *target*)) @@ -773,7 +755,6 @@ ) ) ) - (none) ) :code (behavior () (dotimes (gp-0 3) @@ -859,7 +840,6 @@ ) (set! (-> self last-attack-time) (current-time)) (go-virtual active) - (none) ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -875,7 +855,6 @@ ) ) (enemy-simple-post) - (none) ) ) @@ -926,7 +905,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior jellyfish) enemy-falling-post) ) @@ -956,7 +934,6 @@ (suspend) ) (cleanup-for-death self) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/under/pipe-grunt_REF.gc b/test/decompiler/reference/jak2/levels/under/pipe-grunt_REF.gc index 042ec1bd382..332f920a464 100644 --- a/test/decompiler/reference/jak2/levels/under/pipe-grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/pipe-grunt_REF.gc @@ -31,10 +31,8 @@ ) ;; definition for method 66 of type pipe-grunt -;; WARN: Return type mismatch object vs none. (defmethod go-ambush pipe-grunt ((obj pipe-grunt)) (go (method-of-object obj ambush)) - (none) ) ;; definition for method 186 of type pipe-grunt @@ -86,7 +84,6 @@ (vector-normalize! gp-0 (get-rand-float-range self -4096.0 4096.0)) (move-by-vector! (-> self root) gp-0) ) - (none) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -102,7 +99,6 @@ ) ) ) - (none) ) :code (behavior () (let ((f30-0 (get-rand-float-range self 0.9 1.1))) @@ -121,7 +117,6 @@ ) ) #f - (none) ) :post (the-as (function none :behavior pipe-grunt) nav-enemy-simple-post) ) diff --git a/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc b/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc index ac9e6d719c6..d8bdc68f5e8 100644 --- a/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc @@ -391,12 +391,10 @@ (logior! (-> self bot-flags) (bot-flags bf11 bf18)) (logior! (-> self root penetrated-by) (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot)) (look-at-target! self (enemy-flag lock-focus)) - (none) ) :exit (behavior () (logclear! (-> self bot-flags) (bot-flags bf18)) (set! (-> self root penetrated-by) (get-penetrate-info self)) - (none) ) :trans (behavior () (if (focus-test? self grabbed) @@ -407,7 +405,6 @@ (bot-method-222 self (get-trans (the-as process-focusable a0-1) 3)) ) ) - (none) ) :code (behavior () (until #f @@ -471,7 +468,6 @@ (logior! (-> self bot-flags) (bot-flags bf18)) ) #f - (none) ) :post (the-as (function none :behavior sig-under) nav-enemy-simple-post) ) diff --git a/test/decompiler/reference/jak2/levels/under/under-laser_REF.gc b/test/decompiler/reference/jak2/levels/under/under-laser_REF.gc index 7b7e9b6746f..93b24a6b571 100644 --- a/test/decompiler/reference/jak2/levels/under/under-laser_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-laser_REF.gc @@ -228,7 +228,6 @@ (let ((f0-3 (vector-vector-distance (math-camera-pos) (-> self root trans)))) (set! (-> self root scale x) (lerp-scale 0.5 3.5 f0-3 32768.0 245760.0)) ) - (none) ) :code (the-as (function none :behavior under-laser-shadow) sleep-code) :post (the-as (function none :behavior under-laser-shadow) ja-post) @@ -279,7 +278,6 @@ (set! (-> a0-1 trans quad) (-> (the-as under-laser v1-0) root trans quad)) (vector+! (-> a0-1 trans) (-> a0-1 trans) (-> (the-as under-laser v1-0) slave-trans-offset)) ) - (none) ) :code (the-as (function none :behavior under-laser-slave) sleep-code) :post (the-as (function none :behavior under-laser-slave) ja-post) @@ -362,17 +360,14 @@ :virtual #t :enter (behavior () (logior! (-> self draw status) (draw-control-status no-draw)) - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) - (none) ) :trans (behavior () (if (not (script-eval (the-as pair (-> self draw-test-script)))) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior under-laser) sleep-code) ) @@ -400,7 +395,6 @@ (process-spawn under-laser-shadow (-> self info) gp-1 s5-0 :to self) ) (update-vol! (-> self sound) 1.0) - (none) ) :code (the-as (function none :behavior under-laser) sleep-code) :post (behavior () @@ -439,7 +433,6 @@ (update! (-> self sound)) (under-laser-method-22 self) (ja-post) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc b/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc index 0427eb53fca..2aa137621e6 100644 --- a/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc @@ -332,7 +332,6 @@ (if (send-event (ppointer->process *underb-master*) 'query 'bubbler) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior bubbler) sleep-code) ) @@ -340,8 +339,8 @@ ;; failed to figure out what this is: (defstate idle (bubbler) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('untrigger) (go-virtual idle) ) @@ -383,7 +382,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior bubbler) sleep-code) ) @@ -494,7 +492,6 @@ This commonly includes things such as: (send-event (ppointer->process *underb-master*) 'request 'big-room 'under-plat 'up #t) ) 0 - (none) ) :trans (behavior () (rider-trans) @@ -505,7 +502,6 @@ This commonly includes things such as: (go-virtual idle-up) ) (set! (-> self ridden) #f) - (none) ) :code (the-as (function none :behavior under-rise-plat) sleep-code) :post (the-as (function none :behavior under-rise-plat) rider-post) @@ -518,7 +514,6 @@ This commonly includes things such as: :enter (behavior () (logior! (-> self mask) (process-mask actor-pause)) 0 - (none) ) :trans (behavior () (rider-trans) @@ -533,7 +528,6 @@ This commonly includes things such as: (go-virtual going-down) ) ) - (none) ) :code (the-as (function none :behavior under-rise-plat) sleep-code) :post (the-as (function none :behavior under-rise-plat) rider-post) @@ -550,7 +544,6 @@ This commonly includes things such as: (send-event (ppointer->process *underb-master*) 'request 'big-room 'under-plat 'up #f) ) 0 - (none) ) :trans (behavior () (rider-trans) @@ -563,7 +556,6 @@ This commonly includes things such as: (set! (-> gp-0 trans y) (-> self down-y)) ) ) - (none) ) :code (the-as (function none :behavior under-rise-plat) sleep-code) :post (the-as (function none :behavior under-rise-plat) rider-post) @@ -577,7 +569,6 @@ This commonly includes things such as: (set! (-> self rider-started) #f) (set! (-> self ridden) #f) 0 - (none) ) :trans (behavior () (rider-trans) @@ -588,7 +579,6 @@ This commonly includes things such as: (go-virtual idle-down) ) (set! (-> self ridden) #f) - (none) ) :code (the-as (function none :behavior under-rise-plat) sleep-code) :post (the-as (function none :behavior under-rise-plat) rider-post) @@ -601,7 +591,6 @@ This commonly includes things such as: :enter (behavior () (logior! (-> self mask) (process-mask actor-pause)) 0 - (none) ) :trans (behavior () (rider-trans) @@ -620,7 +609,6 @@ This commonly includes things such as: (go-virtual going-up) ) ) - (none) ) :code (the-as (function none :behavior under-rise-plat) sleep-code) :post (the-as (function none :behavior under-rise-plat) rider-post) @@ -635,7 +623,6 @@ This commonly includes things such as: (set! (-> self root transv y) 20480.0) (set! (-> self ridden) #f) 0 - (none) ) :trans (behavior () (rider-trans) @@ -657,7 +644,6 @@ This commonly includes things such as: (set! (-> gp-0 trans y) (-> self up-y)) ) ) - (none) ) :code (the-as (function none :behavior under-rise-plat) sleep-code) :post (the-as (function none :behavior under-rise-plat) rider-post) @@ -763,10 +749,10 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (under-buoy-base) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (case (-> (the-as attack-info (-> event param 1)) mode) + (case (-> (the-as attack-info (-> block param 1)) mode) (('mech-punch 'crush) (let ((a0-5 (ppointer->process (-> self parent)))) (send-event a0-5 'base-hit) @@ -784,7 +770,6 @@ This commonly includes things such as: ) :enter (behavior () 0 - (none) ) :trans (behavior () (when (-> self release) @@ -794,7 +779,6 @@ This commonly includes things such as: (go-virtual opened) ) ) - (none) ) :code (the-as (function none :behavior under-buoy-base) sleep-code) :post (the-as (function none :behavior under-buoy-base) ja-post) @@ -805,7 +789,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (none) ) :code (the-as (function none :behavior under-buoy-base) sleep-code) :post (the-as (function none :behavior under-buoy-base) ja-post) @@ -909,13 +892,11 @@ This commonly includes things such as: :virtual #t :enter (behavior () 0 - (none) ) :trans (behavior () (let ((v1-0 (ppointer->process (-> self parent)))) (set! (-> self root trans quad) (-> (the-as process-drawable v1-0) root trans quad)) ) - (none) ) :code (the-as (function none :behavior under-buoy-chain) sleep-code) :post (the-as (function none :behavior under-buoy-chain) ja-post) @@ -1144,10 +1125,10 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate waiting (under-buoy-plat) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack) - (case (-> (the-as attack-info (-> event param 1)) mode) + (case (-> (the-as attack-info (-> block param 1)) mode) (('mech-punch 'crush) (go-virtual running) ) @@ -1160,7 +1141,6 @@ This commonly includes things such as: ) :enter (behavior () 0 - (none) ) :code (the-as (function none :behavior under-buoy-plat) sleep-code) :post (the-as (function none :behavior under-buoy-plat) ja-post) @@ -1177,7 +1157,6 @@ This commonly includes things such as: (sound-play "break-chain") (send-event (ppointer->process (-> self base)) 'release) (process-entity-status! self (entity-perm-status subtask-complete) #t) - (none) ) :code (behavior () (until #f @@ -1191,11 +1170,9 @@ This commonly includes things such as: ) ) #f - (none) ) :post (behavior () (rigid-body-object-method-37 self) - (none) ) ) @@ -1481,14 +1458,12 @@ This commonly includes things such as: (activate! *camera-smush-control* 819.2 37 210 1.0 0.995 (-> self clock)) (ja-channel-set! 0) (ja-post) - (none) ) :trans (behavior () (when (not (-> self child)) (cleanup-for-death self) (deactivate self) ) - (none) ) :code (the-as (function none :behavior under-mine) sleep-code) ) @@ -1496,8 +1471,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle (under-mine) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('attack 'bonk 'touched) (go-virtual explode) ) @@ -1572,7 +1547,6 @@ This commonly includes things such as: ) (update (-> self chain) self) ) - (none) ) ) :code (the-as (function none :behavior under-mine) sleep-code) @@ -1585,7 +1559,6 @@ This commonly includes things such as: (set! (-> self chain-initialized) #t) (initialize-chain-joints (-> self chain)) ) - (none) ) ) @@ -1774,7 +1747,6 @@ This commonly includes things such as: (under-lift-method-49 self #t) (set-setting! 'jump #f 0.0 0) ) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type elevator running) post))) @@ -1783,7 +1755,6 @@ This commonly includes things such as: ) ) (sound-play "under-lift-lp" :id (-> self sound-id) :position (-> self root trans)) - (none) ) ) @@ -1804,7 +1775,6 @@ This commonly includes things such as: (under-lift-method-49 self #f) (remove-setting! 'jump) ) - (none) ) ) @@ -1910,13 +1880,13 @@ For example for an elevator pre-compute the distance between the first and last ;; failed to figure out what this is: (defstate idle (under-break-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual hit #f) ) (('attack) - (case (-> (the-as attack-info (-> event param 1)) mode) + (case (-> (the-as attack-info (-> block param 1)) mode) (('mech-punch 'crush) (go-virtual hit #f) ) @@ -1943,7 +1913,6 @@ For example for an elevator pre-compute the distance between the first and last (suspend) ) #f - (none) ) ) @@ -1952,7 +1921,6 @@ For example for an elevator pre-compute the distance between the first and last :virtual #t :exit (behavior () (ja-abort-spooled-anim (the-as spool-anim (-> self anim)) (the-as art-joint-anim #f) -1) - (none) ) :post (the-as (function none :behavior under-break-door) ja-post) ) @@ -2090,7 +2058,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () 0 - (none) ) :code (behavior () (until #f @@ -2104,7 +2071,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior under-seaweed-a) ja-post) ) @@ -2211,7 +2177,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () 0 - (none) ) :code (behavior () (until #f @@ -2225,7 +2190,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior under-seaweed-b) ja-post) ) @@ -2286,7 +2250,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () 0 - (none) ) :code (behavior () (until #f @@ -2300,7 +2263,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior under-seaweed-c) ja-post) ) @@ -2361,7 +2323,6 @@ This commonly includes things such as: :virtual #t :enter (behavior () 0 - (none) ) :code (behavior () (until #f @@ -2375,7 +2336,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior under-seaweed-d) ja-post) ) diff --git a/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc b/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc index d807a476610..adddb2b34bc 100644 --- a/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc @@ -1361,7 +1361,6 @@ :event under-block-event-handler :enter (behavior () (logclear! (-> self flags) (under-block-flags unbflags-0)) - (none) ) :code (the-as (function none :behavior under-block) sleep-code) ) @@ -1392,7 +1391,6 @@ ) (rider-post) (go-virtual idle) - (none) ) ) @@ -1418,7 +1416,6 @@ (rider-post) (go-virtual waiting) 0 - (none) ) ) @@ -1429,7 +1426,6 @@ :enter (behavior () (logior! (-> self flags) (under-block-flags unbflags-0)) (under-block-method-41 self 'active) - (none) ) :code (the-as (function none :behavior under-block) sleep-code) ) @@ -1441,15 +1437,12 @@ :enter (behavior () (logior! (-> self flags) (under-block-flags unbflags-0)) (under-block-method-41 self 'active) - (none) ) :exit (behavior () (logclear! (-> self flags) (under-block-flags unbflags-0)) - (none) ) :trans (behavior () (under-block-method-45 self) - (none) ) :code (the-as (function none :behavior under-block) sleep-code) ) @@ -1464,15 +1457,12 @@ (+! (-> self col) (-> self move-dir-x)) (+! (-> self row) (-> self move-dir-z)) (under-block-method-48 self (-> self col) (-> self row)) - (none) ) :exit (behavior () (under-block-method-46 self (-> self prev-col) (-> self prev-row)) - (none) ) :trans (behavior () (under-block-method-45 self) - (none) ) :code (behavior () (local-vars (at-0 int)) @@ -1551,7 +1541,6 @@ ) ) #f - (none) ) ) ) @@ -1562,7 +1551,6 @@ :event under-block-event-handler :trans (behavior () (under-block-method-45 self) - (none) ) :code (behavior () (sound-play "und-block-knock") @@ -1642,7 +1630,6 @@ ) ) #f - (none) ) ) @@ -1652,11 +1639,9 @@ :event under-block-event-handler :enter (behavior () (logclear! (-> self flags) (under-block-flags unbflags-0)) - (none) ) :trans (behavior () (under-block-method-45 self) - (none) ) :code (behavior () (set! (-> self state-time) (current-time)) @@ -1672,7 +1657,6 @@ ) ) (go-virtual sunk-partially) - (none) ) ) @@ -1682,7 +1666,6 @@ :event under-block-event-handler :trans (behavior () (under-block-method-45 self) - (none) ) :code (the-as (function none :behavior under-block) sleep-code) ) @@ -1693,7 +1676,6 @@ :event under-block-event-handler :trans (behavior () (under-block-method-45 self) - (none) ) :code (behavior () (set! (-> self state-time) (current-time)) @@ -1710,7 +1692,6 @@ ) ) (go-virtual beaten) - (none) ) ) @@ -1721,7 +1702,6 @@ :enter (behavior () (logclear! (-> self flags) (under-block-flags unbflags-0)) (under-block-method-41 self 'beaten) - (none) ) :code (the-as (function none :behavior under-block) sleep-code) ) @@ -1734,11 +1714,9 @@ (logclear! (-> self flags) (under-block-flags unbflags-0)) (logclear! (-> self mask) (process-mask actor-pause)) (under-block-method-41 self 'fall) - (none) ) :trans (behavior () (under-block-method-45 self) - (none) ) :code (behavior () (set! (-> self state-time) (current-time)) @@ -1755,7 +1733,6 @@ ) ) (go-virtual explode) - (none) ) :post (behavior () (let ((gp-0 (-> self root))) @@ -1776,7 +1753,6 @@ ) ) (ja-post) - (none) ) ) @@ -1799,7 +1775,6 @@ (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) (set-vector! (-> self draw color-emissive) 0.0 0.0 0.0 1.0) (send-event (ppointer->process (-> self my-parent)) 'explode (-> self spawner-id)) - (none) ) :code (behavior () (sound-play "und-block-explo") @@ -1813,7 +1788,6 @@ (while (-> self child) (suspend) ) - (none) ) ) @@ -2290,7 +2264,6 @@ ) ) 0 - (none) ) :code (the-as (function none :behavior under-shoot-block) sleep-code) ) @@ -2318,7 +2291,6 @@ (go-virtual victory) ) ) - (none) ) :code (the-as (function none :behavior under-shoot-block) sleep-code) ) @@ -2361,7 +2333,6 @@ ) ) (go-virtual beaten) - (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/under/under-sig-obs_REF.gc b/test/decompiler/reference/jak2/levels/under/under-sig-obs_REF.gc index 045a3c0ad59..d36ba2de10b 100644 --- a/test/decompiler/reference/jak2/levels/under/under-sig-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-sig-obs_REF.gc @@ -169,7 +169,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> v1-4 prim-core collide-with) (collide-spec)) ) 0 - (none) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) @@ -177,7 +176,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) ) - (none) ) :trans (behavior () (when (not (script-eval (the-as pair (-> self draw-test-script)))) @@ -185,7 +183,6 @@ For example for an elevator pre-compute the distance between the first and last #t (go-virtual plat-path-active) ) - (none) ) :code (the-as (function none :behavior under-plat-shoot) sleep-code) ) @@ -193,109 +190,106 @@ For example for an elevator pre-compute the distance between the first and last ;; failed to figure out what this is: (defstate plat-path-active (under-plat-shoot) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('bonk) - (the-as object (start-bouncing! self)) - ) - (('attack) - (when (zero? (-> self state-flip)) - (let ((s5-0 (the-as object (-> event param 1)))) - (when (!= (-> (the-as attack-info s5-0) id) (-> self incoming-attack-id)) - (set! (-> self incoming-attack-id) (-> (the-as attack-info s5-0) id)) - (let* ((gp-0 proc) - (s4-0 (if (type? gp-0 process-drawable) - gp-0 - ) - ) - ) - (when s4-0 - (let* ((s3-0 (-> (the-as process-drawable s4-0) root)) - (gp-1 (if (type? (the-as collide-shape s3-0) collide-shape) - s3-0 - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (start-bouncing! self) + ) + (('attack) + (when (zero? (-> self state-flip)) + (let ((s5-0 (the-as object (-> block param 1)))) + (when (!= (-> (the-as attack-info s5-0) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info s5-0) id)) + (let* ((gp-0 proc) + (s4-0 (if (type? gp-0 process-drawable) + gp-0 + ) ) - (when gp-1 - (when (logtest? (-> (the-as collide-shape gp-1) root-prim prim-core collide-as) (collide-spec projectile)) - (when (zero? (-> self state-flip)) - (sound-play "mtn-plat-flip1") - (set! (-> self state-flip) (the-as uint 1)) - ) - (if (= (-> (find-offending-process-focusable s4-0 (the-as attack-info s5-0)) type) target) - (set! (-> self time-flip) (the-as uint 1140)) - (set! (-> self time-flip) (the-as uint 570)) - ) - (set! (-> self hint-count) -1.0) - (vector-! (-> self axe-flip) (-> gp-1 trans) (-> self root trans)) - (set! (-> self axe-flip y) 0.0) - (vector-normalize! (-> self axe-flip) 1.0) - (vector-rotate90-around-y! (-> self axe-flip) (-> self axe-flip)) - (set! (-> self angle-flip-vel) -10.0) - (set! (-> self state-time) (current-time)) + ) + (when s4-0 + (let* ((s3-0 (-> (the-as process-drawable s4-0) root)) + (gp-1 (if (type? (the-as collide-shape s3-0) collide-shape) + s3-0 + ) + ) + ) + (when gp-1 + (when (logtest? (-> (the-as collide-shape gp-1) root-prim prim-core collide-as) (collide-spec projectile)) + (when (zero? (-> self state-flip)) + (sound-play "mtn-plat-flip1") + (set! (-> self state-flip) (the-as uint 1)) ) + (if (= (-> (find-offending-process-focusable s4-0 (the-as attack-info s5-0)) type) target) + (set! (-> self time-flip) (the-as uint 1140)) + (set! (-> self time-flip) (the-as uint 570)) + ) + (set! (-> self hint-count) -1.0) + (vector-! (-> self axe-flip) (-> gp-1 trans) (-> self root trans)) + (set! (-> self axe-flip y) 0.0) + (vector-normalize! (-> self axe-flip) 1.0) + (vector-rotate90-around-y! (-> self axe-flip) (-> self axe-flip)) + (set! (-> self angle-flip-vel) -10.0) + (set! (-> self state-time) (current-time)) ) ) ) ) - #f ) + #f ) ) ) - (('hint) - (when (>= (-> self hint-count) 0.0) - (+! (-> self hint-count) (seconds-per-frame)) - (if (< 6.0 (-> self hint-count)) - #f - ) - ) - ) - (('track) - (cond - ((-> event param 0) - (if (zero? (-> self state-flip)) - #t - 'abort - ) - ) - ((and *target* - (-> self disable-track-under) - (< (-> *target* control trans y) (+ -20480.0 (-> self root trans y))) - ) - #f - ) - (else - (zero? (-> self state-flip)) + ) + (('hint) + (when (>= (-> self hint-count) 0.0) + (+! (-> self hint-count) (seconds-per-frame)) + (if (< 6.0 (-> self hint-count)) + #f ) + ) + ) + (('track) + (cond + ((-> block param 0) + (if (zero? (-> self state-flip)) + #t + 'abort + ) + ) + ((and *target* + (-> self disable-track-under) + (< (-> *target* control trans y) (+ -20480.0 (-> self root trans y))) + ) + #f + ) + (else + (zero? (-> self state-flip)) ) ) - (('centipede) - (when (not (and (-> self next-state) (let ((v1-39 (-> self next-state name))) - (or (= v1-39 'die-falling) (= v1-39 'empty-state)) - ) - ) - ) - (vector-reset! (-> self root transv)) - (let* ((gp-2 proc) - (a0-11 (if (type? (the-as process-focusable gp-2) process-focusable) - gp-2 - ) - ) + ) + (('centipede) + (when (not (and (-> self next-state) (let ((v1-39 (-> self next-state name))) + (or (= v1-39 'die-falling) (= v1-39 'empty-state)) + ) + ) ) - (when a0-11 - (vector-! (-> self root transv) (-> self root trans) (get-trans (the-as process-focusable a0-11) 0)) - (set! (-> self root transv y) 0.0) - (vector-normalize! (-> self root transv) 163840.0) - (set! (-> self root transv y) 20480.0) - ) + (vector-reset! (-> self root transv)) + (let* ((gp-2 proc) + (a0-11 (if (type? (the-as process-focusable gp-2) process-focusable) + gp-2 + ) + ) + ) + (when a0-11 + (vector-! (-> self root transv) (-> self root trans) (get-trans (the-as process-focusable a0-11) 0)) + (set! (-> self root transv y) 0.0) + (vector-normalize! (-> self root transv) 163840.0) + (set! (-> self root transv y) 20480.0) ) - (go-virtual die-falling) ) + (go-virtual die-falling) ) - ) + ) ) ) :enter (behavior () @@ -307,7 +301,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> self dest-angle) 180.0) (set! (-> self on-shake) #f) (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> self time-flip))) @@ -363,7 +356,6 @@ For example for an elevator pre-compute the distance between the first and last (t9-12) ) ) - (none) ) :post (behavior () (let ((t9-0 (-> (method-of-type plat plat-path-active) post))) @@ -371,7 +363,6 @@ For example for an elevator pre-compute the distance between the first and last ((the-as (function none) t9-0)) ) ) - (none) ) ) @@ -386,7 +377,6 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> v1-7 prim-core collide-with) (collide-spec)) ) 0 - (none) ) :trans (behavior () (when (>= (- (current-time) (-> self state-time)) (seconds 1)) @@ -400,7 +390,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (none) ) :code (behavior () (let ((f30-0 (rand-vu-float-range 0.5 0.8))) @@ -431,7 +420,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) #f - (none) ) :post (behavior () (let ((v1-0 (-> self root))) @@ -446,7 +434,6 @@ For example for an elevator pre-compute the distance between the first and last ) ) (ja-post) - (none) ) ) @@ -531,17 +518,14 @@ otherwise, [[plat::34]] ;; failed to figure out what this is: (defstate idle (under-break-floor) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (case event-type - (('attack) - (when (logtest? (-> (the-as attack-info (-> event param 1)) penetrate-using) (penetrate flop)) - (go-virtual die) - #f - ) + :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 (the-as (function none :behavior under-break-floor) sleep-code) @@ -557,7 +541,6 @@ otherwise, [[plat::34]] ) 0 (process-entity-status! self (entity-perm-status subtask-complete) #t) - (none) ) :code (behavior () ((lambda () @@ -591,7 +574,6 @@ otherwise, [[plat::34]] (suspend) ) (cleanup-for-death self) - (none) ) :post (the-as (function none :behavior under-break-floor) ja-post) ) @@ -601,7 +583,6 @@ otherwise, [[plat::34]] :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -715,7 +696,6 @@ This commonly includes things such as: :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -851,7 +831,6 @@ This commonly includes things such as: (ja :group! (-> self draw art-group data 3) :num! min) (transform-post) (sleep-code) - (none) ) ) @@ -860,7 +839,6 @@ This commonly includes things such as: :virtual #t :code (behavior () (cleanup-for-death self) - (none) ) ) @@ -982,8 +960,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate idle-closed (under-int-door) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('trigger) (go-virtual open) ) @@ -1009,7 +987,6 @@ This commonly includes things such as: ) (logclear! (-> self skel status) (joint-control-status sync-math)) (go-virtual idle-open) - (none) ) :post (the-as (function none :behavior under-int-door) transform-post) ) @@ -1160,7 +1137,6 @@ This commonly includes things such as: :trans (behavior () (plat-trans) (vector-lerp! (-> self root trans) (-> self move-start) (-> self move-end) (get-norm! (-> self sync) 0)) - (none) ) :code (the-as (function none :behavior under-plat-long) sleep-code) :post (the-as (function none :behavior under-plat-long) plat-post) @@ -1308,22 +1284,19 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate active (under-plat-wall) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('touch) - (send-event proc 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (none) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (none) ) :trans (the-as (function none :behavior under-plat-wall) rider-trans) :code (behavior () @@ -1353,7 +1326,6 @@ This commonly includes things such as: ) ) #f - (none) ) :post (the-as (function none :behavior under-plat-wall) rider-post) ) @@ -1504,8 +1476,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate intro-shooting (under-pipe-growls) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('sig-shot) (when (>= (-> self volume) 0.6) (when (nonzero? (-> self approach-sound-id)) @@ -1559,7 +1531,6 @@ This commonly includes things such as: (set! (-> self volume) 0.0) (set! (-> self desired-volume) 1.0) (set! (-> self volume-seek-speed) (rand-vu-float-range 0.5 0.2)) - (none) ) :code (the-as (function none :behavior under-pipe-growls) sleep-code) :post (the-as (function none :behavior under-pipe-growls) under-pipe-growls-post) @@ -1568,8 +1539,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (defstate block-puzzle (under-pipe-growls) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('fade) (go-virtual block-puzzle-fade) ) @@ -1579,7 +1550,6 @@ This commonly includes things such as: (set! (-> self volume) 0.25) (set! (-> self desired-volume) 1.0) (set! (-> self volume-seek-speed) 0.8) - (none) ) :code (behavior () (sound-play "grunt-notice" :vol 40 :position (target-pos 0)) @@ -1609,7 +1579,6 @@ This commonly includes things such as: ) (sound-play "grunt-notice" :vol 200 :position (target-pos 0)) (sleep-code) - (none) ) :post (the-as (function none :behavior under-pipe-growls) under-pipe-growls-post) ) @@ -1620,14 +1589,12 @@ This commonly includes things such as: :enter (behavior () (set! (-> self desired-volume) 0.0) (set! (-> self volume-seek-speed) 0.5) - (none) ) :trans (behavior () (when (= (-> self volume) (-> self desired-volume)) (cleanup-for-death self) (go empty-state) ) - (none) ) :code (the-as (function none :behavior under-pipe-growls) sleep-code) :post (the-as (function none :behavior under-pipe-growls) under-pipe-growls-post) diff --git a/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc b/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc index 081f86190f3..7d91da3b296 100644 --- a/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc @@ -39,8 +39,8 @@ ;; failed to figure out what this is: (defstate idle (under-warp) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('die-fast) (set-under-fog-interp! 0.0) (go-virtual die-fast) @@ -67,12 +67,10 @@ ) ) #f - (none) ) :post (behavior () (under-warp-method-22 self) (ja-post) - (none) ) ) @@ -474,13 +472,11 @@ :event underb-master-event-handler :enter (behavior () 0 - (none) ) :trans (behavior () (if (-> self big-room-entered) (go-virtual big-room-player-under) ) - (none) ) :code (the-as (function none :behavior underb-master) sleep-code) :post underb-master-post @@ -492,7 +488,6 @@ :event underb-master-event-handler :enter (behavior () 0 - (none) ) :trans (behavior () (if (-> self under-plat-player-on) @@ -501,7 +496,6 @@ (if (not (-> self big-room-entered)) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior underb-master) sleep-code) :post underb-master-post @@ -514,11 +508,9 @@ :enter (behavior () (set-setting! 'entity-name "camera-239" 0.0 0) (send-event (ppointer->process *underb-master*) 'request 'under-warp #f) - (none) ) :exit (behavior () (remove-setting! 'entity-name) - (none) ) :trans (behavior () (let ((gp-0 (target-pos 0))) @@ -529,7 +521,6 @@ (go-virtual big-room-player-falling) ) ) - (none) ) :code (the-as (function none :behavior underb-master) sleep-code) :post underb-master-post @@ -542,13 +533,11 @@ :enter (behavior () (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 600.0 0) (remove-setting! 'mode-name) - (none) ) :trans (behavior () (if (< (-> (target-pos 0) y) -245760.0) (go-virtual big-room-player-falling) ) - (none) ) :code (the-as (function none :behavior underb-master) sleep-code) :post underb-master-post @@ -560,13 +549,11 @@ :event underb-master-event-handler :enter (behavior () (set-setting! 'mode-name 'cam-endlessfall 0.0 0) - (none) ) :exit (behavior () (send-event (ppointer->process *underb-master*) 'request 'under-warp #t) (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) (remove-setting! 'mode-name) - (none) ) :trans (behavior () (cond @@ -584,7 +571,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior underb-master) sleep-code) :post underb-master-post @@ -599,18 +585,15 @@ (set-setting! 'entity-name "camera-244" 0.0 0) (set! (-> self big-room-timer) (current-time)) (send-event (ppointer->process *underb-master*) 'request 'under-warp #t) - (none) ) :exit (behavior () (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 600.0 0) (remove-setting! 'entity-name) - (none) ) :trans (behavior () (if (>= (- (current-time) (-> self big-room-timer)) (seconds 1)) (go-virtual idle) ) - (none) ) :code (the-as (function none :behavior underb-master) sleep-code) :post underb-master-post @@ -622,7 +605,6 @@ :event underb-master-event-handler :enter (behavior () (go-virtual idle) - (none) ) :code (the-as (function none :behavior underb-master) sleep-code) :post underb-master-post @@ -745,17 +727,15 @@ ;; failed to figure out what this is: (defstate startup (under-locking) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as object (case event-type - (('test) - #f - ) - ) - ) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('test) + #f + ) + ) ) :enter (behavior () (set! (-> self state-time) (current-time)) - (none) ) :trans (behavior () (let ((v1-0 (-> self actor-group))) @@ -838,7 +818,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior under-locking) sleep-code) ) @@ -846,12 +825,12 @@ ;; failed to figure out what this is: (defstate active (under-locking) :virtual #t - :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (case event-type + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message (('test) (let ((v1-1 (-> self mode))) (cond - ((-> event param 0) + ((-> block param 0) (when (or (= v1-1 (under-locking-mode want-mech)) (= v1-1 (under-locking-mode want-exit-mech))) (let ((a0-4 *target*)) (and a0-4 (not (logtest? (focus-status mech) (-> a0-4 focus-status)))) @@ -940,7 +919,6 @@ ) ) ) - (none) ) :code (the-as (function none :behavior under-locking) sleep-code) ) @@ -959,7 +937,6 @@ 0 ) ) - (none) ) :trans (behavior () (when (and (zero? (-> self state-time)) @@ -1004,7 +981,6 @@ ) ) ) - (none) ) :code (behavior () (while (zero? (-> self state-time)) @@ -1052,7 +1028,6 @@ (suspend) ) #f - (none) ) ) @@ -1066,7 +1041,6 @@ ) (set! (-> self state-time) 0) 0 - (none) ) :trans (behavior () (when (and (zero? (-> self state-time)) @@ -1106,7 +1080,6 @@ ) ) ) - (none) ) :code (behavior () (while (zero? (-> self state-time)) @@ -1155,7 +1128,6 @@ (suspend) ) #f - (none) ) ) diff --git a/test/decompiler/test_FormExpressionBuild3.cpp b/test/decompiler/test_FormExpressionBuild3.cpp index 051b6e1821e..a20ffebede3 100644 --- a/test/decompiler/test_FormExpressionBuild3.cpp +++ b/test/decompiler/test_FormExpressionBuild3.cpp @@ -161,6 +161,6 @@ TEST_F(FormRegressionTestJak1, WeirdShortCircuit2) { " jr ra\n" " daddu sp, sp, r0"; std::string type = "(function actor-link-info object)"; - std::string expected = "(the-as object (and (-> arg0 prev) (-> arg0 prev extra process)))"; + std::string expected = "(and (-> arg0 prev) (-> arg0 prev extra process))"; test_with_stack_structures(func, type, expected, "[[16, \"event-message-block\"]]"); }