From bc66d416b454fb07f9a587649b66ccdab27aafea Mon Sep 17 00:00:00 2001 From: Hat Kid <6624576+Hat-Kid@users.noreply.github.com> Date: Wed, 4 Sep 2024 19:35:54 +0200 Subject: [PATCH] decompiler: `call-parent-state-handler` and `suspend-for` macros (#3625) Also fix `hud-draw-pris2` bucket in Jak 3 to make subtitles work and foreground HUD envmap. --- common/goos/PrettyPrinter2.cpp | 8 +- decompiler/IR2/GenericElementMatcher.cpp | 23 ++ decompiler/IR2/GenericElementMatcher.h | 2 + decompiler/ObjectFile/ObjectFileDB.h | 10 +- decompiler/analysis/insert_lets.cpp | 105 +++++++++ .../opengl_renderer/OpenGLRenderer.cpp | 4 +- game/mips2c/jak3_functions/foreground.cpp | 5 + goal_src/jak1/engine/common-obs/crates.gc | 10 +- .../jak1/engine/common-obs/generic-obs.gc | 17 +- goal_src/jak1/engine/common-obs/nav-enemy.gc | 14 +- goal_src/jak1/engine/entity/ambient.gc | 40 ++-- goal_src/jak1/engine/game/powerups.gc | 26 +-- goal_src/jak1/engine/target/target-death.gc | 13 +- goal_src/jak1/engine/target/target2.gc | 16 +- goal_src/jak1/kernel/gstate.gc | 7 + goal_src/jak1/levels/beach/beach-obs.gc | 18 +- goal_src/jak1/levels/beach/lurkercrab.gc | 11 +- goal_src/jak1/levels/beach/lurkerpuppy.gc | 8 +- goal_src/jak1/levels/citadel/citadel-obs.gc | 40 +++- .../jak1/levels/citadel/citb-drop-plat.gc | 11 +- .../jak1/levels/common/battlecontroller.gc | 13 +- goal_src/jak1/levels/finalboss/final-door.gc | 11 +- .../jak1/levels/finalboss/sage-finalboss.gc | 13 +- goal_src/jak1/levels/flut_common/flutflut.gc | 9 +- .../jak1/levels/flut_common/target-flut.gc | 38 ++-- goal_src/jak1/levels/jungle/darkvine.gc | 5 +- goal_src/jak1/levels/jungle/fisher.gc | 10 +- .../jak1/levels/jungle/jungle-elevator.gc | 3 +- goal_src/jak1/levels/jungle/jungle-mirrors.gc | 14 +- goal_src/jak1/levels/jungleb/jungleb-obs.gc | 6 +- goal_src/jak1/levels/jungleb/plant-boss.gc | 36 ++-- goal_src/jak1/levels/maincave/baby-spider.gc | 11 +- goal_src/jak1/levels/maincave/dark-crystal.gc | 3 +- .../jak1/levels/misty/babak-with-cannon.gc | 3 +- goal_src/jak1/levels/misty/balloonlurker.gc | 17 +- goal_src/jak1/levels/misty/misty-warehouse.gc | 6 +- goal_src/jak1/levels/misty/mistycannon.gc | 17 +- goal_src/jak1/levels/ogre/flying-lurker.gc | 6 +- goal_src/jak1/levels/ogre/ogreboss.gc | 17 +- .../jak1/levels/racer_common/racer-states.gc | 46 ++-- goal_src/jak1/levels/racer_common/racer.gc | 9 +- goal_src/jak1/levels/snow/snow-obs.gc | 19 +- goal_src/jak1/levels/swamp/billy.gc | 11 +- goal_src/jak1/levels/swamp/swamp-rat.gc | 10 +- goal_src/jak1/levels/title/title-obs.gc | 20 +- goal_src/jak1/levels/training/training-obs.gc | 14 +- .../jak1/levels/village1/fishermans-boat.gc | 24 +-- .../jak1/levels/village2/sunken-elevator.gc | 3 +- goal_src/jak1/levels/village2/village2-obs.gc | 15 +- .../levels/village_common/villagep-obs.gc | 13 +- goal_src/jak2/engine/ambient/ambient.gc | 20 +- goal_src/jak2/engine/common_objs/crates.gc | 28 +-- .../jak2/engine/common_objs/generic-obs.gc | 99 +++++---- goal_src/jak2/engine/common_objs/powerups.gc | 44 ++-- .../jak2/engine/game/task/task-control.gc | 46 ++-- .../process-drawable/process-taskable.gc | 28 ++- .../jak2/engine/target/board/board-states.gc | 6 +- .../jak2/engine/target/gun/gun-dark-shot.gc | 20 +- .../jak2/engine/target/mech/mech-states.gc | 19 +- goal_src/jak2/engine/target/mech/mech.gc | 17 +- goal_src/jak2/engine/target/target-death.gc | 120 ++++------- goal_src/jak2/engine/target/target-turret.gc | 23 +- goal_src/jak2/engine/target/target2.gc | 33 +-- goal_src/jak2/kernel/gkernel-h.gc | 3 + goal_src/jak2/kernel/gstate.gc | 6 + goal_src/jak2/levels/atoll/atoll-obs.gc | 139 ++++++------ goal_src/jak2/levels/atoll/juicer.gc | 115 +++++----- goal_src/jak2/levels/castle/castle-obs.gc | 199 +++++++----------- goal_src/jak2/levels/castle/pad/caspad-obs.gc | 19 +- .../jak2/levels/castle/pad/castle-tasks.gc | 6 +- .../jak2/levels/castle/roboguard-level.gc | 26 +-- .../levels/city/burning-bush/ctywide-bbush.gc | 16 +- .../jak2/levels/city/common/pilot-states.gc | 18 +- goal_src/jak2/levels/city/ctywide-obs.gc | 160 +++++++------- goal_src/jak2/levels/city/ctywide-tasks.gc | 36 +--- .../jak2/levels/city/market/ctymark-obs.gc | 56 +++-- .../jak2/levels/city/onintent/onin-game.gc | 18 +- .../jak2/levels/city/port/portrun/portrun.gc | 18 +- .../city/traffic/citizen/metalhead-flitter.gc | 12 +- goal_src/jak2/levels/common/enemy/flitter.gc | 12 +- goal_src/jak2/levels/common/enemy/grunt.gc | 14 +- .../enemy/guards/crimson-guard-level.gc | 49 ++--- .../common/enemy/hover/crimson-guard-hover.gc | 45 ++-- .../common/enemy/hover/hover-enemy-battle.gc | 20 +- .../jak2/levels/common/enemy/hover/wasp.gc | 25 +-- goal_src/jak2/levels/common/enemy/spyder.gc | 20 +- .../levels/common/entities/com-elevator.gc | 32 +-- .../jak2/levels/common/entities/gun-buoy.gc | 34 ++- .../jak2/levels/common/entities/spydroid.gc | 23 +- goal_src/jak2/levels/common/race/race-obs.gc | 30 +-- goal_src/jak2/levels/common/warp-gate.gc | 27 ++- goal_src/jak2/levels/demo/demo-obs.gc | 157 +++++--------- goal_src/jak2/levels/dig/dig1-obs.gc | 52 ++--- goal_src/jak2/levels/dig/dig3-obs.gc | 105 ++++----- goal_src/jak2/levels/drill/drill-obs2.gc | 76 ++++--- goal_src/jak2/levels/forest/forest-obs.gc | 108 +++------- .../jak2/levels/fortress/dump/fordumpa-obs.gc | 56 ++--- .../jak2/levels/fortress/dump/fordumpc-obs.gc | 112 +++------- .../fortress/dump/fort-robotank-turret.gc | 53 ++--- .../levels/fortress/dump/fort-robotank.gc | 43 ++-- .../jak2/levels/fortress/exit/forexita-obs.gc | 23 +- goal_src/jak2/levels/fortress/fort-turret.gc | 51 ++--- goal_src/jak2/levels/fortress/fortress-obs.gc | 16 +- .../levels/fortress/rescue/forresca-obs.gc | 32 +-- goal_src/jak2/levels/gungame/gungame-obs.gc | 38 ++-- goal_src/jak2/levels/intro/intro-obs.gc | 44 ++-- goal_src/jak2/levels/intro/intro-scenes.gc | 156 +++++++------- goal_src/jak2/levels/mountain/mountain-obs.gc | 118 +++++------ .../jak2/levels/nest/boss/nestb-scenes.gc | 32 ++- goal_src/jak2/levels/nest/mantis.gc | 32 +-- goal_src/jak2/levels/nest/nest-obs.gc | 48 ++--- goal_src/jak2/levels/sewer/sew-gunturret.gc | 95 ++++----- goal_src/jak2/levels/sewer/sewer-obs2.gc | 110 +++++----- .../jak2/levels/stadium/skate/skatea-obs.gc | 89 +++----- goal_src/jak2/levels/stadium/stadium-obs.gc | 118 +++++------ goal_src/jak2/levels/title/title-obs.gc | 13 +- goal_src/jak2/levels/tomb/target-indax.gc | 6 +- goal_src/jak2/levels/tomb/tomb-beetle.gc | 8 +- goal_src/jak2/levels/tomb/tomb-water.gc | 157 ++++++-------- goal_src/jak2/levels/under/under-sig-obs.gc | 72 +++---- goal_src/jak3/engine/ambient/ambient.gc | 12 +- .../jak3/engine/common-obs/collectables.gc | 6 +- goal_src/jak3/engine/common-obs/crates.gc | 18 +- .../jak3/engine/common-obs/enemy-states.gc | 30 +-- .../jak3/engine/common-obs/generic-obs.gc | 25 +-- goal_src/jak3/engine/common-obs/powerups.gc | 44 ++-- goal_src/jak3/engine/common-obs/warp-gate.gc | 6 +- goal_src/jak3/engine/game/game-info.gc | 64 +++--- .../jak3/engine/game/task/task-control.gc | 20 +- .../process-drawable/process-taskable.gc | 12 +- goal_src/jak3/engine/scene/scene.gc | 22 +- goal_src/jak3/engine/sound/gsound.gc | 6 +- .../jak3/engine/target/board/board-states.gc | 6 +- goal_src/jak3/engine/target/flut/flut.gc | 14 +- .../jak3/engine/target/flut/target-flut.gc | 62 +++--- .../jak3/engine/target/gun/gun-blue-shot.gc | 12 +- .../jak3/engine/target/gun/gun-dark-shot.gc | 116 +++++----- .../jak3/engine/target/gun/gun-red-shot.gc | 12 +- .../jak3/engine/target/gun/gun-yellow-shot.gc | 26 +-- .../jak3/engine/target/indax/target-indax.gc | 14 +- .../jak3/engine/target/mech/mech-states.gc | 19 +- goal_src/jak3/engine/target/mech/mech.gc | 7 +- goal_src/jak3/engine/target/pilot-states.gc | 30 +-- goal_src/jak3/engine/target/target-darkjak.gc | 6 +- goal_src/jak3/engine/target/target-death.gc | 108 ++++------ goal_src/jak3/engine/target/target-handler.gc | 32 ++- .../jak3/engine/target/target-invisible.gc | 12 +- .../jak3/engine/target/target-lightjak.gc | 7 +- goal_src/jak3/engine/target/target-turret.gc | 6 +- goal_src/jak3/engine/target/target2.gc | 47 ++--- goal_src/jak3/engine/ui/progress/progress.gc | 6 +- goal_src/jak3/kernel/gkernel-h.gc | 5 +- goal_src/jak3/kernel/gstate.gc | 6 + .../levels/city/blow-tower/blow-tower-obs.gc | 12 +- .../levels/city/blow-tower/blow-tower-obs2.gc | 108 ++-------- .../levels/city/blow-tower/cty-blow-tower.gc | 6 +- .../levels/city/common/mh-squad-member.gc | 6 +- goal_src/jak3/levels/city/ctywide-obs.gc | 8 +- goal_src/jak3/levels/city/ctywide-tasks.gc | 60 +----- .../city/destroy-grid/cty-destroy-grid.gc | 36 +--- .../jak3/levels/city/hijack/cty-hijack.gc | 36 +--- .../city/port/attack/ctyport-attack-bbush.gc | 12 +- .../levels/city/port/attack/ctyport-attack.gc | 18 +- .../jak3/levels/city/port/attack/h-torpedo.gc | 12 +- .../levels/city/protect/assault-enemies.gc | 36 +--- .../jak3/levels/city/protect/assault-task.gc | 30 +-- .../jak3/levels/city/protect/cty-protect.gc | 24 +-- .../jak3/levels/city/protect/flying-turret.gc | 6 +- .../levels/city/protect/protect-gunship.gc | 6 +- .../levels/city/protect/roboguard-city.gc | 30 +-- .../levels/city/sniper/cty-sniper-battery.gc | 6 +- .../levels/city/sniper/cty-sniper-turret.gc | 78 +++---- .../levels/city/traffic/citizen/civilian.gc | 6 +- .../city/traffic/citizen/metalhead-flitter.gc | 12 +- goal_src/jak3/levels/comb/comb-obs.gc | 19 +- goal_src/jak3/levels/comb/comb-sentry.gc | 6 +- goal_src/jak3/levels/comb/comb-travel.gc | 24 +-- goal_src/jak3/levels/comb/h-sled.gc | 6 +- goal_src/jak3/levels/common/elec-gate.gc | 12 +- .../levels/common/enemy/darkprec/neo-wasp.gc | 6 +- goal_src/jak3/levels/common/enemy/flitter.gc | 12 +- goal_src/jak3/levels/common/enemy/grunt.gc | 6 +- .../levels/common/enemy/hover/robo-hover.gc | 6 +- goal_src/jak3/levels/common/enemy/kg-grunt.gc | 6 +- goal_src/jak3/levels/common/enemy/mantis.gc | 30 +-- .../jak3/levels/common/enemy/roboguard.gc | 18 +- goal_src/jak3/levels/common/enemy/spyder.gc | 12 +- .../jak3/levels/common/enemy/spydroid-orig.gc | 6 +- goal_src/jak3/levels/common/enemy/spydroid.gc | 12 +- .../desert/artifact-race/artifact-race.gc | 18 +- .../jak3/levels/desert/chase/desert-chase.gc | 126 +++-------- .../jak3/levels/desert/chase/desert-jump.gc | 6 +- .../levels/desert/chase/wcar-marauder-b.gc | 6 +- .../jak3/levels/desert/des-bbush-tasks.gc | 6 +- .../jak3/levels/desert/des-burning-bush.gc | 14 +- goal_src/jak3/levels/desert/des-bush.gc | 6 +- goal_src/jak3/levels/desert/des-cactus.gc | 6 +- .../jak3/levels/desert/hover/des-beast-2.gc | 26 +-- goal_src/jak3/levels/desert/hover/mh-flyer.gc | 18 +- .../jak3/levels/desert/hover/scorpion-gun.gc | 18 +- .../desert/lizard/desert-lizard-task.gc | 18 +- .../jak3/levels/desert/race/course-race.gc | 60 +----- .../levels/desert/race/turtle-training.gc | 49 +---- .../levels/desert/rescue/desert-rescue.gc | 12 +- .../levels/desert/wvehicle/w-parking-spot.gc | 6 +- .../levels/desert/wvehicle/wcar-marauder.gc | 6 +- .../levels/desert/wvehicle/wvehicle-states.gc | 6 +- goal_src/jak3/levels/factory/car/hvehicle.gc | 6 +- .../jak3/levels/factory/car/wcar-faccar.gc | 54 +++-- goal_src/jak3/levels/factory/fac-gunturret.gc | 51 ++--- .../levels/factory/fac-robotank-turret.gc | 25 +-- goal_src/jak3/levels/factory/fac-robotank.gc | 12 +- goal_src/jak3/levels/factory/fac-tower.gc | 6 +- .../jak3/levels/factory/factory-manager.gc | 6 +- goal_src/jak3/levels/factory/factoryc-obs.gc | 121 ++++++----- goal_src/jak3/levels/factory/factoryc-obs2.gc | 61 ++---- goal_src/jak3/levels/factory/lfacrm2-mood.gc | 25 +-- .../jak3/levels/factory/warf-projectile.gc | 6 +- .../jak3/levels/forest/forest-ring-chase.gc | 31 +-- goal_src/jak3/levels/forest/forest-tasks.gc | 24 +-- goal_src/jak3/levels/gungame/gun-dummy.gc | 6 +- .../jak3/levels/gungame/gungame-manager.gc | 24 +-- goal_src/jak3/levels/gungame/gungame-obs.gc | 7 +- goal_src/jak3/levels/intro/intro-scenes.gc | 28 +-- .../jak3/levels/mhcity/destroy-dark-eco.gc | 18 +- goal_src/jak3/levels/mhcity/mhcity-obs.gc | 18 +- goal_src/jak3/levels/mhcity/mhcity-obs2.gc | 12 +- goal_src/jak3/levels/mine/gekko.gc | 6 +- goal_src/jak3/levels/mine/mine-obs.gc | 18 +- goal_src/jak3/levels/mine/mine-platforms.gc | 30 +-- goal_src/jak3/levels/mine/mine-train.gc | 6 +- goal_src/jak3/levels/mine/rat.gc | 12 +- goal_src/jak3/levels/nest/egg-spider.gc | 12 +- goal_src/jak3/levels/nest/mh-bat.gc | 12 +- goal_src/jak3/levels/nest/nst-obs.gc | 44 +--- goal_src/jak3/levels/precursor/precura-obs.gc | 62 ++---- .../jak3/levels/precursor/precura-obs2.gc | 6 +- goal_src/jak3/levels/sewer/mh-wasp.gc | 6 +- goal_src/jak3/levels/sewer/neo-juicer.gc | 93 ++++---- goal_src/jak3/levels/sewer/saberfish.gc | 56 +---- goal_src/jak3/levels/sewer/sew-laser-guard.gc | 13 +- .../jak3/levels/sewer/sew-laser-turret.gc | 15 +- goal_src/jak3/levels/sewer/sew-platforms.gc | 24 +-- goal_src/jak3/levels/sewer/sewer-obs.gc | 54 +---- goal_src/jak3/levels/sewer/sewer-obs2.gc | 36 +--- .../jak3/levels/stadium/dm-mine-spider.gc | 12 +- goal_src/jak3/levels/temple/hover-training.gc | 12 +- goal_src/jak3/levels/temple/temple-obs.gc | 81 ++----- goal_src/jak3/levels/temple/temple-obs2.gc | 96 ++------- goal_src/jak3/levels/title/title-obs.gc | 36 +--- goal_src/jak3/levels/tower/tower-obs.gc | 26 +-- goal_src/jak3/levels/volcano/spiky-frog.gc | 12 +- goal_src/jak3/levels/volcano/volcano-obs.gc | 6 +- goal_src/jak3/levels/volcano/volcano-obs2.gc | 6 +- goal_src/jak3/levels/volcano/volcanox-obs.gc | 12 +- .../levels/wascity/defend/was-pre-game.gc | 12 +- goal_src/jak3/levels/wascity/dm-flyer.gc | 12 +- .../jak3/levels/wascity/maker-projectile.gc | 13 +- .../jak3/levels/wascity/palace/waspala-obs.gc | 6 +- goal_src/jak3/levels/wascity/tizard.gc | 16 +- goal_src/jak3/levels/wascity/wasall-tasks.gc | 24 +-- .../jak3/levels/wascity/wascity-turret.gc | 24 +-- .../jak3/levels/wascity/wasdef-manager.gc | 12 +- .../jak3/levels/wascity/wasgun-manager.gc | 6 +- .../levels/wascity/wasstadium/nst-tasks.gc | 60 ++---- .../levels/wascity/wasstadium/wasstadb-obs.gc | 12 +- .../levels/wascity/wasstadium/wasstadc-obs.gc | 50 +---- goal_src/jak3/levels/wascity/wlander-male.gc | 6 +- .../reference/jak1/decompiler-macros.gc | 12 +- .../jak1/engine/common-obs/crates_REF.gc | 10 +- .../jak1/engine/common-obs/generic-obs_REF.gc | 23 +- .../jak1/engine/common-obs/nav-enemy_REF.gc | 7 +- .../jak1/engine/entity/ambient_REF.gc | 31 ++- .../jak1/engine/game/game-info_REF.gc | 7 +- .../reference/jak1/engine/game/main_REF.gc | 5 +- .../jak1/engine/game/powerups_REF.gc | 42 ++-- .../jak1/engine/target/target-death_REF.gc | 32 +-- .../jak1/engine/target/target2_REF.gc | 14 +- .../jak1/levels/beach/beach-obs_REF.gc | 10 +- .../jak1/levels/beach/lurkercrab_REF.gc | 25 +-- .../jak1/levels/beach/lurkerpuppy_REF.gc | 7 +- .../jak1/levels/citadel/citadel-obs_REF.gc | 6 +- .../jak1/levels/citadel/citb-drop-plat_REF.gc | 5 +- .../levels/common/battlecontroller_REF.gc | 5 +- .../jak1/levels/finalboss/final-door_REF.gc | 15 +- .../levels/finalboss/sage-finalboss_REF.gc | 5 +- .../jak1/levels/flut_common/flutflut_REF.gc | 7 +- .../levels/flut_common/target-flut_REF.gc | 50 ++--- .../jak1/levels/jungle/darkvine_REF.gc | 10 +- .../jak1/levels/jungle/fisher_REF.gc | 17 +- .../jak1/levels/jungle/jungle-elevator_REF.gc | 6 +- .../jak1/levels/jungle/jungle-mirrors_REF.gc | 5 +- .../jak1/levels/jungleb/jungleb-obs_REF.gc | 10 +- .../jak1/levels/jungleb/plant-boss_REF.gc | 28 +-- .../jak1/levels/maincave/baby-spider_REF.gc | 7 +- .../jak1/levels/maincave/dark-crystal_REF.gc | 5 +- .../levels/misty/babak-with-cannon_REF.gc | 6 +- .../jak1/levels/misty/balloonlurker_REF.gc | 5 +- .../jak1/levels/misty/misty-warehouse_REF.gc | 10 +- .../jak1/levels/misty/mistycannon_REF.gc | 7 +- .../jak1/levels/ogre/flying-lurker_REF.gc | 10 +- .../jak1/levels/ogre/ogreboss_REF.gc | 15 +- .../levels/racer_common/racer-states_REF.gc | 59 +++--- .../jak1/levels/racer_common/racer_REF.gc | 7 +- .../jak1/levels/snow/snow-bunny_REF.gc | 8 +- .../jak1/levels/snow/snow-obs_REF.gc | 5 +- .../reference/jak1/levels/swamp/billy_REF.gc | 6 +- .../jak1/levels/swamp/swamp-rat_REF.gc | 7 +- .../jak1/levels/title/title-obs_REF.gc | 19 +- .../jak1/levels/training/training-obs_REF.gc | 5 +- .../levels/village1/fishermans-boat_REF.gc | 14 +- .../levels/village2/sunken-elevator_REF.gc | 6 +- .../jak1/levels/village2/village2-obs_REF.gc | 10 +- .../levels/village_common/villagep-obs_REF.gc | 10 +- .../reference/jak2/decompiler-macros.gc | 12 +- .../jak2/engine/ambient/ambient_REF.gc | 10 +- .../jak2/engine/common_objs/crates_REF.gc | 15 +- .../engine/common_objs/generic-obs_REF.gc | 46 ++-- .../jak2/engine/common_objs/powerups_REF.gc | 42 ++-- .../jak2/engine/debug/default-menu_REF.gc | 5 +- .../jak2/engine/game/game-info_REF.gc | 35 ++- .../reference/jak2/engine/game/main_REF.gc | 5 +- .../jak2/engine/game/task/task-control_REF.gc | 33 ++- .../process-drawable/process-taskable_REF.gc | 5 +- .../reference/jak2/engine/scene/scene_REF.gc | 5 +- .../reference/jak2/engine/sound/gsound_REF.gc | 5 +- .../engine/target/board/board-states_REF.gc | 5 +- .../engine/target/gun/gun-dark-shot_REF.gc | 5 +- .../engine/target/mech/mech-states_REF.gc | 17 +- .../jak2/engine/target/mech/mech_REF.gc | 7 +- .../jak2/engine/target/target-death_REF.gc | 109 ++++------ .../jak2/engine/target/target-turret_REF.gc | 5 +- .../jak2/engine/target/target2_REF.gc | 30 +-- .../jak2/levels/atoll/atoll-obs_REF.gc | 26 +-- .../reference/jak2/levels/atoll/juicer_REF.gc | 92 ++++---- .../jak2/levels/castle/castle-obs_REF.gc | 55 +---- .../jak2/levels/castle/pad/caspad-obs_REF.gc | 5 +- .../levels/castle/pad/castle-tasks_REF.gc | 5 +- .../jak2/levels/castle/roboguard-level_REF.gc | 24 +-- .../city/burning-bush/ctywide-bbush_REF.gc | 5 +- .../levels/city/common/pilot-states_REF.gc | 15 +- .../jak2/levels/city/ctywide-obs_REF.gc | 5 +- .../jak2/levels/city/ctywide-tasks_REF.gc | 30 +-- .../levels/city/market/ctymark-obs_REF.gc | 5 +- .../levels/city/onintent/onin-game_REF.gc | 20 +- .../levels/city/port/portrun/portrun_REF.gc | 15 +- .../traffic/citizen/metalhead-flitter_REF.gc | 10 +- .../jak2/levels/common/enemy/flitter_REF.gc | 10 +- .../jak2/levels/common/enemy/grunt_REF.gc | 5 +- .../enemy/guards/crimson-guard-level_REF.gc | 31 ++- .../enemy/hover/crimson-guard-hover_REF.gc | 23 +- .../enemy/hover/hover-enemy-battle_REF.gc | 10 +- .../levels/common/enemy/hover/wasp_REF.gc | 5 +- .../jak2/levels/common/enemy/spyder_REF.gc | 11 +- .../common/entities/com-elevator_REF.gc | 16 +- .../levels/common/entities/gun-buoy_REF.gc | 10 +- .../levels/common/entities/spydroid_REF.gc | 5 +- .../jak2/levels/common/race/race-obs_REF.gc | 25 +-- .../jak2/levels/common/warp-gate_REF.gc | 5 +- .../jak2/levels/demo/demo-obs_REF.gc | 136 ++++-------- .../reference/jak2/levels/dig/dig1-obs_REF.gc | 35 +-- .../reference/jak2/levels/dig/dig3-obs_REF.gc | 36 +--- .../jak2/levels/drill/drill-obs2_REF.gc | 5 +- .../jak2/levels/forest/forest-obs_REF.gc | 70 ++---- .../levels/fortress/dump/fordumpa-obs_REF.gc | 25 +-- .../levels/fortress/dump/fordumpc-obs_REF.gc | 70 ++---- .../fortress/dump/fort-robotank-turret_REF.gc | 30 +-- .../levels/fortress/dump/fort-robotank_REF.gc | 10 +- .../levels/fortress/exit/forexita-obs_REF.gc | 5 +- .../jak2/levels/fortress/fort-turret_REF.gc | 27 +-- .../jak2/levels/fortress/fortress-obs_REF.gc | 5 +- .../fortress/rescue/forresca-obs_REF.gc | 15 +- .../jak2/levels/gungame/gungame-obs_REF.gc | 12 +- .../jak2/levels/intro/intro-obs_REF.gc | 7 +- .../jak2/levels/intro/intro-scenes_REF.gc | 153 +++++++------- .../jak2/levels/mountain/mountain-obs_REF.gc | 10 +- .../jak2/levels/nest/boss/nestb-scenes_REF.gc | 10 +- .../reference/jak2/levels/nest/mantis_REF.gc | 21 +- .../jak2/levels/nest/nest-obs_REF.gc | 25 +-- .../jak2/levels/sewer/sew-gunturret_REF.gc | 67 +++--- .../jak2/levels/sewer/sewer-obs2_REF.gc | 5 +- .../levels/stadium/skate/skatea-obs_REF.gc | 40 +--- .../jak2/levels/stadium/stadium-obs_REF.gc | 15 +- .../jak2/levels/title/title-obs_REF.gc | 5 +- .../jak2/levels/tomb/target-indax_REF.gc | 5 +- .../jak2/levels/tomb/tomb-beetle_REF.gc | 5 +- .../jak2/levels/tomb/tomb-water_REF.gc | 59 ++---- .../jak2/levels/under/under-sig-obs_REF.gc | 5 +- .../reference/jak3/decompiler-macros.gc | 10 + .../jak3/engine/ambient/ambient_REF.gc | 10 +- .../engine/common-obs/collectables_REF.gc | 6 +- .../jak3/engine/common-obs/crates_REF.gc | 15 +- .../engine/common-obs/enemy-states_REF.gc | 25 +-- .../jak3/engine/common-obs/generic-obs_REF.gc | 22 +- .../jak3/engine/common-obs/powerups_REF.gc | 42 ++-- .../jak3/engine/common-obs/warp-gate_REF.gc | 5 +- .../jak3/engine/game/game-info_REF.gc | 39 ++-- .../reference/jak3/engine/game/main_REF.gc | 5 +- .../jak3/engine/game/task/task-control_REF.gc | 15 +- .../process-drawable/process-taskable_REF.gc | 10 +- .../reference/jak3/engine/scene/scene_REF.gc | 5 +- .../reference/jak3/engine/sound/gsound_REF.gc | 5 +- .../engine/target/board/board-states_REF.gc | 5 +- .../jak3/engine/target/flut/flut_REF.gc | 14 +- .../engine/target/flut/target-flut_REF.gc | 58 ++--- .../engine/target/gun/gun-blue-shot_REF.gc | 10 +- .../engine/target/gun/gun-dark-shot_REF.gc | 113 +++++----- .../engine/target/gun/gun-red-shot_REF.gc | 12 +- .../engine/target/gun/gun-yellow-shot_REF.gc | 22 +- .../engine/target/indax/target-indax_REF.gc | 10 +- .../engine/target/mech/mech-states_REF.gc | 17 +- .../jak3/engine/target/mech/mech_REF.gc | 7 +- .../jak3/engine/target/pilot-states_REF.gc | 25 +-- .../jak3/engine/target/target-darkjak_REF.gc | 6 +- .../jak3/engine/target/target-death_REF.gc | 99 ++++----- .../jak3/engine/target/target-handler_REF.gc | 7 +- .../engine/target/target-invisible_REF.gc | 10 +- .../jak3/engine/target/target-lightjak_REF.gc | 7 +- .../jak3/engine/target/target-turret_REF.gc | 5 +- .../jak3/engine/target/target2_REF.gc | 43 ++-- .../jak3/engine/ui/progress/progress_REF.gc | 5 +- .../city/blow-tower/blow-tower-obs2_REF.gc | 102 ++------- .../city/blow-tower/blow-tower-obs_REF.gc | 10 +- .../city/blow-tower/cty-blow-tower_REF.gc | 6 +- .../levels/city/common/mh-squad-member_REF.gc | 6 +- .../jak3/levels/city/ctywide-obs_REF.gc | 7 +- .../jak3/levels/city/ctywide-tasks_REF.gc | 57 +---- .../city/destroy-grid/cty-destroy-grid_REF.gc | 39 +--- .../jak3/levels/city/hijack/cty-hijack_REF.gc | 32 +-- .../port/attack/ctyport-attack-bbush_REF.gc | 16 +- .../city/port/attack/ctyport-attack_REF.gc | 15 +- .../levels/city/port/attack/h-torpedo_REF.gc | 12 +- .../city/protect/assault-enemies_REF.gc | 35 +-- .../levels/city/protect/assault-task_REF.gc | 27 +-- .../levels/city/protect/cty-protect_REF.gc | 21 +- .../levels/city/protect/flying-turret_REF.gc | 10 +- .../city/protect/protect-gunship_REF.gc | 9 +- .../levels/city/protect/roboguard-city_REF.gc | 31 +-- .../city/sniper/cty-sniper-battery_REF.gc | 9 +- .../city/sniper/cty-sniper-turret_REF.gc | 74 +++---- .../city/traffic/citizen/civilian_REF.gc | 10 +- .../traffic/citizen/metalhead-flitter_REF.gc | 14 +- .../jak3/levels/comb/comb-obs_REF.gc | 17 +- .../jak3/levels/comb/comb-sentry_REF.gc | 9 +- .../jak3/levels/comb/comb-travel_REF.gc | 27 +-- .../reference/jak3/levels/comb/h-sled_REF.gc | 6 +- .../jak3/levels/common/elec-gate_REF.gc | 10 +- .../common/enemy/darkprec/neo-wasp_REF.gc | 9 +- .../jak3/levels/common/enemy/flitter_REF.gc | 14 +- .../jak3/levels/common/enemy/grunt_REF.gc | 5 +- .../common/enemy/hover/robo-hover_REF.gc | 10 +- .../jak3/levels/common/enemy/kg-grunt_REF.gc | 9 +- .../jak3/levels/common/enemy/mantis_REF.gc | 31 +-- .../jak3/levels/common/enemy/roboguard_REF.gc | 15 +- .../jak3/levels/common/enemy/spyder_REF.gc | 15 +- .../levels/common/enemy/spydroid-orig_REF.gc | 9 +- .../jak3/levels/common/enemy/spydroid_REF.gc | 12 +- .../desert/artifact-race/artifact-race_REF.gc | 20 +- .../levels/desert/chase/desert-chase_REF.gc | 101 ++------- .../levels/desert/chase/desert-jump_REF.gc | 5 +- .../desert/chase/wcar-marauder-b_REF.gc | 6 +- .../jak3/levels/desert/des-bbush-tasks_REF.gc | 5 +- .../levels/desert/des-burning-bush_REF.gc | 12 +- .../jak3/levels/desert/des-bush_REF.gc | 10 +- .../jak3/levels/desert/des-cactus_REF.gc | 9 +- .../levels/desert/hover/des-beast-2_REF.gc | 22 +- .../jak3/levels/desert/hover/mh-flyer_REF.gc | 17 +- .../levels/desert/hover/scorpion-gun_REF.gc | 15 +- .../desert/lizard/desert-lizard-task_REF.gc | 17 +- .../levels/desert/race/course-race_REF.gc | 40 +--- .../levels/desert/race/turtle-training_REF.gc | 46 +--- .../levels/desert/rescue/desert-rescue_REF.gc | 11 +- .../desert/wvehicle/w-parking-spot_REF.gc | 5 +- .../desert/wvehicle/wcar-marauder_REF.gc | 6 +- .../desert/wvehicle/wvehicle-states_REF.gc | 10 +- .../jak3/levels/factory/car/hvehicle_REF.gc | 6 +- .../levels/factory/car/wcar-faccar_REF.gc | 11 +- .../jak3/levels/factory/fac-gunturret_REF.gc | 53 ++--- .../levels/factory/fac-robotank-turret_REF.gc | 25 +-- .../jak3/levels/factory/fac-robotank_REF.gc | 14 +- .../jak3/levels/factory/fac-tower_REF.gc | 9 +- .../levels/factory/factory-manager_REF.gc | 6 +- .../jak3/levels/factory/factoryc-obs2_REF.gc | 63 ++---- .../jak3/levels/factory/factoryc-obs_REF.gc | 123 +++++------ .../jak3/levels/factory/lfacrm2-mood_REF.gc | 29 +-- .../levels/factory/warf-projectile_REF.gc | 10 +- .../levels/forest/forest-ring-chase_REF.gc | 32 +-- .../jak3/levels/forest/forest-tasks_REF.gc | 20 +- .../jak3/levels/gungame/gun-dummy_REF.gc | 10 +- .../levels/gungame/gungame-manager_REF.gc | 24 +-- .../jak3/levels/gungame/gungame-obs_REF.gc | 11 +- .../jak3/levels/intro/intro-scenes_REF.gc | 29 +-- .../levels/mhcity/destroy-dark-eco_REF.gc | 16 +- .../jak3/levels/mhcity/mhcity-obs2_REF.gc | 16 +- .../jak3/levels/mhcity/mhcity-obs_REF.gc | 19 +- .../reference/jak3/levels/mine/gekko_REF.gc | 5 +- .../jak3/levels/mine/mine-obs_REF.gc | 15 +- .../jak3/levels/mine/mine-platforms_REF.gc | 25 +-- .../jak3/levels/mine/mine-train_REF.gc | 9 +- .../reference/jak3/levels/mine/rat_REF.gc | 11 +- .../jak3/levels/nest/egg-spider_REF.gc | 10 +- .../reference/jak3/levels/nest/mh-bat_REF.gc | 16 +- .../reference/jak3/levels/nest/nst-obs_REF.gc | 43 +--- .../jak3/levels/precursor/precura-obs2_REF.gc | 5 +- .../jak3/levels/precursor/precura-obs_REF.gc | 32 +-- .../jak3/levels/sewer/mh-wasp_REF.gc | 9 +- .../jak3/levels/sewer/neo-juicer_REF.gc | 96 ++++----- .../jak3/levels/sewer/saberfish_REF.gc | 59 +----- .../jak3/levels/sewer/sew-laser-guard_REF.gc | 17 +- .../jak3/levels/sewer/sew-laser-turret_REF.gc | 13 +- .../jak3/levels/sewer/sew-platforms_REF.gc | 28 +-- .../jak3/levels/sewer/sewer-obs2_REF.gc | 34 +-- .../jak3/levels/sewer/sewer-obs_REF.gc | 45 +--- .../jak3/levels/stadium/dm-mine-spider_REF.gc | 10 +- .../jak3/levels/temple/hover-training_REF.gc | 14 +- .../jak3/levels/temple/temple-obs2_REF.gc | 73 ++----- .../jak3/levels/temple/temple-obs_REF.gc | 70 ++---- .../jak3/levels/title/title-obs_REF.gc | 30 +-- .../jak3/levels/tower/tower-obs_REF.gc | 23 +- .../jak3/levels/volcano/spiky-frog_REF.gc | 15 +- .../jak3/levels/volcano/volcano-obs2_REF.gc | 10 +- .../jak3/levels/volcano/volcano-obs_REF.gc | 5 +- .../jak3/levels/volcano/volcanox-obs_REF.gc | 10 +- .../levels/wascity/defend/was-pre-game_REF.gc | 14 +- .../jak3/levels/wascity/dm-flyer_REF.gc | 12 +- .../levels/wascity/maker-projectile_REF.gc | 13 +- .../levels/wascity/palace/waspala-obs_REF.gc | 5 +- .../jak3/levels/wascity/tizard_REF.gc | 18 +- .../jak3/levels/wascity/wasall-tasks_REF.gc | 25 +-- .../jak3/levels/wascity/wascity-turret_REF.gc | 18 +- .../jak3/levels/wascity/wasdef-manager_REF.gc | 10 +- .../jak3/levels/wascity/wasgun-manager_REF.gc | 5 +- .../wascity/wasstadium/nst-tasks_REF.gc | 57 ++--- .../wascity/wasstadium/wasstadb-obs_REF.gc | 14 +- .../wascity/wasstadium/wasstadc-obs_REF.gc | 46 +--- .../jak3/levels/wascity/wlander-male_REF.gc | 10 +- 536 files changed, 4365 insertions(+), 9381 deletions(-) diff --git a/common/goos/PrettyPrinter2.cpp b/common/goos/PrettyPrinter2.cpp index d0aa416f52..f12e4828e5 100644 --- a/common/goos/PrettyPrinter2.cpp +++ b/common/goos/PrettyPrinter2.cpp @@ -295,7 +295,7 @@ void break_list(Node* node) { } } else if (name == "until" || name == "while" || name == "dotimes" || name == "countdown" || name == "when" || name == "behavior" || name == "lambda" || name == "defpart" || - name == "define") { + name == "define" || name == "suspend-for") { node->top_line_count = 2; } else if (name == "let" || name == "let*" || name == "rlet" || name == "with-dma-buffer-add-bucket") { @@ -341,9 +341,9 @@ void break_list(Node* node) { void insert_required_breaks(const std::vector& bfs_order) { const std::unordered_set always_break = { - "when", "defun-debug", "countdown", "case", "defun", "defmethod", "let", - "until", "while", "if", "dotimes", "cond", "else", "defbehavior", - "with-pp", "rlet", "defstate", "behavior", "defpart", "loop", "let*"}; + "when", "defun-debug", "countdown", "case", "defun", "defmethod", "let", "until", + "while", "if", "dotimes", "cond", "else", "defbehavior", "with-pp", "rlet", + "defstate", "behavior", "defpart", "loop", "let*", "suspend-for"}; for (auto node : bfs_order) { if (!node->break_list && node->kind == Node::Kind::LIST && node->child_nodes.at(0).kind == Node::Kind::ATOM) { diff --git a/decompiler/IR2/GenericElementMatcher.cpp b/decompiler/IR2/GenericElementMatcher.cpp index 54fd5a733a..65a7e796c2 100644 --- a/decompiler/IR2/GenericElementMatcher.cpp +++ b/decompiler/IR2/GenericElementMatcher.cpp @@ -211,6 +211,13 @@ Matcher Matcher::while_loop(const Matcher& condition, const Matcher& body) { return m; } +Matcher Matcher::until_loop(const Matcher& condition, const Matcher& body) { + Matcher m; + m.m_kind = Kind::UNTIL_LOOP; + m.m_sub_matchers = {condition, body}; + return m; +} + Matcher Matcher::any_constant_token(int match_id) { Matcher m; m.m_kind = Kind::ANY_CONSTANT_TOKEN; @@ -671,6 +678,22 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out, const Env* cons return true; } break; + case Kind::UNTIL_LOOP: { + auto as_until = dynamic_cast(input->try_as_single_active_element()); + if (!as_until) { + return false; + } + + if (!m_sub_matchers.at(0).do_match(as_until->condition, maps_out, env)) { + return false; + } + + if (!m_sub_matchers.at(1).do_match(as_until->body, maps_out, env)) { + return false; + } + return true; + } break; + case Kind::BEGIN: { if ((int)m_sub_matchers.size() != input->size()) { return false; diff --git a/decompiler/IR2/GenericElementMatcher.h b/decompiler/IR2/GenericElementMatcher.h index d1c9d0fca9..66b9a2b1bc 100644 --- a/decompiler/IR2/GenericElementMatcher.h +++ b/decompiler/IR2/GenericElementMatcher.h @@ -69,6 +69,7 @@ class Matcher { const Matcher& false_case); static Matcher if_no_else(const Matcher& condition, const Matcher& true_case); static Matcher while_loop(const Matcher& condition, const Matcher& body); + static Matcher until_loop(const Matcher& condition, const Matcher& body); static Matcher any_constant_token(int match_id = -1); static Matcher constant_token(const std::string& name); static Matcher or_expression(const std::vector& elts); @@ -100,6 +101,7 @@ class Matcher { IF_WITH_ELSE, IF_NO_ELSE, WHILE_LOOP, + UNTIL_LOOP, ANY_CONSTANT_TOKEN, CONSTANT_TOKEN, SC_OR, diff --git a/decompiler/ObjectFile/ObjectFileDB.h b/decompiler/ObjectFile/ObjectFileDB.h index 574e6e28a8..9c0e40cf06 100644 --- a/decompiler/ObjectFile/ObjectFileDB.h +++ b/decompiler/ObjectFile/ObjectFileDB.h @@ -79,12 +79,14 @@ struct LetRewriteStats { int with_dma_buf_add_bucket = 0; int dma_buffer_add_gs_set = 0; int launch_particles = 0; + int call_parent_state_handler = 0; + int suspend_for = 0; int total() const { return dotimes + countdown + abs + abs2 + unused + ja + case_no_else + case_with_else + set_vector + set_vector2 + send_event + font_context_meth + proc_new + attack_info + vector_dot + rand_float_gen + set_let + with_dma_buf_add_bucket + dma_buffer_add_gs_set + - launch_particles; + launch_particles + call_parent_state_handler + suspend_for; } std::string print() const { @@ -111,6 +113,8 @@ struct LetRewriteStats { out += fmt::format(" with_dma_buf_add_bucket: {}\n", with_dma_buf_add_bucket); out += fmt::format(" dma_buffer_add_gs_set: {}\n", dma_buffer_add_gs_set); out += fmt::format(" launch_particles: {}\n", launch_particles); + out += fmt::format(" call_parent_state_handler: {}\n", call_parent_state_handler); + out += fmt::format(" suspend_for: {}\n", suspend_for); return out; } @@ -135,6 +139,8 @@ struct LetRewriteStats { result.set_let = rand_float_gen + other.set_let; result.with_dma_buf_add_bucket = rand_float_gen + other.with_dma_buf_add_bucket; result.launch_particles = launch_particles + other.launch_particles; + result.call_parent_state_handler = call_parent_state_handler + other.call_parent_state_handler; + result.suspend_for = suspend_for + other.suspend_for; return result; } @@ -158,6 +164,8 @@ struct LetRewriteStats { set_let += other.set_let; with_dma_buf_add_bucket += other.with_dma_buf_add_bucket; launch_particles += other.launch_particles; + call_parent_state_handler += other.call_parent_state_handler; + suspend_for += other.suspend_for; return *this; } }; diff --git a/decompiler/analysis/insert_lets.cpp b/decompiler/analysis/insert_lets.cpp index 29d5a420e4..6328f6e34e 100644 --- a/decompiler/analysis/insert_lets.cpp +++ b/decompiler/analysis/insert_lets.cpp @@ -1673,6 +1673,99 @@ FormElement* rewrite_part_tracker_new(const std::string& type, ->try_as_single_element(); } +FormElement* rewrite_call_parent_state_handler(LetElement* in, const Env& env, FormPool& pool) { + // (let ((t9-3 (-> (find-parent-state) code))) + // (if t9-3 + // ((the-as (function none) t9-3)) + // ) + // ) + auto mr = + Matcher::let(false, + {LetEntryMatcher::any(Matcher::deref(Matcher::func("find-parent-state", {}), + false, {DerefTokenMatcher::any_string(1)}), + 0)}, + {Matcher::if_no_else(Matcher::any(), Matcher::any(2))}); + auto let_mr = match(mr, in); + if (!let_mr.matched) { + return nullptr; + } + auto handler = let_mr.maps.strings.at(1); + auto valid_handlers = {"enter", "trans", "code", "post"}; + if (std::find(valid_handlers.begin(), valid_handlers.end(), handler) != valid_handlers.end()) { + std::vector macro_args; + macro_args.push_back(pool.form(handler)); + // there are no examples of this being used with args, so that is not handled for now... + // auto func = let_mr.maps.forms.at(2); + return pool + .form(GenericOperator::make_function( + pool.form("call-parent-state-handler")), + macro_args) + ->try_as_single_element(); + } + return nullptr; +} + +FormElement* rewrite_suspend_for(LetElement* in, const Env& env, FormPool& pool) { + // (let ((gp-1 (current-time))) + // (until (time-elapsed? gp-1 (seconds 0.5)) + // (suspend) + // ) + // ) + // -> + // (suspend-for (seconds 0.5)) + auto until = dynamic_cast(in->body()->at(0)); + if (!until) { + return nullptr; + } + auto mr = Matcher::let( + false, {LetEntryMatcher::any(Matcher::func("current-time", {}), 0)}, + {Matcher::until_loop(Matcher::func("time-elapsed?", {Matcher::any_reg(1), Matcher::any(2)}), + Matcher::any(3))}); + auto let_mr = match(mr, in); + if (!let_mr.matched) { + return nullptr; + } + auto var = let_mr.maps.regs.at(1); + auto time = let_mr.maps.forms.at(2); + auto body = let_mr.maps.forms.at(3); + std::vector macro_args; + std::vector macro_elts; + macro_args.push_back(time); + for (auto& elt : body->elts()) { + auto op = dynamic_cast(elt); + auto suspend = op && op->op() && dynamic_cast(op->op()) && + dynamic_cast(op->op())->kind() == SpecialOp::Kind::SUSPEND; + if (!suspend || elt != body->elts().back()) { + elt->apply_form([&](Form* form) { + for (auto& e : form->elts()) { + auto as_expr = dynamic_cast(e); + if (as_expr) { + RegAccessSet regs; + as_expr->collect_vars(regs, false); + for (auto reg : regs) { + if (reg.to_string(env, RegisterAccess::Print::AS_VARIABLE) == + var.value().to_string(env, RegisterAccess::Print::AS_VARIABLE)) { + e = pool.alloc_element("time"); + } + } + } + } + }); + macro_elts.push_back(elt); + } + } + if (!macro_elts.empty()) { + for (auto elt : macro_elts) { + macro_args.push_back(pool.alloc_single_form(nullptr, elt)); + } + } + return pool + .form( + GenericOperator::make_function(pool.form("suspend-for")), + macro_args) + ->try_as_single_element(); +} + FormElement* rewrite_proc_new(LetElement* in, const Env& env, FormPool& pool) { // this function checks for the process-spawn macros. // it uses recursive form scanning to wrap the macro inside a potential "shell" @@ -2185,6 +2278,12 @@ FormElement* rewrite_let(LetElement* in, const Env& env, FormPool& pool, LetRewr return as_set_vector3; } + auto suspend_for = rewrite_suspend_for(in, env, pool); + if (suspend_for) { + stats.suspend_for++; + return suspend_for; + } + auto as_abs_2 = fix_up_abs_2(in, env, pool); if (as_abs_2) { stats.abs2++; @@ -2215,6 +2314,12 @@ FormElement* rewrite_let(LetElement* in, const Env& env, FormPool& pool, LetRewr return as_attack_info; } + auto as_call_parent_state = rewrite_call_parent_state_handler(in, env, pool); + if (as_call_parent_state) { + stats.call_parent_state_handler++; + return as_call_parent_state; + } + // nothing matched. return nullptr; } diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index 7d88d9c2ce..4718177cd9 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -374,8 +374,8 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { BucketId::HUD_DRAW_HUD_ALPHA, 0x8000); init_bucket_renderer("tex-hud-pris2", BucketCategory::TEX, BucketId::TEX_HUD_PRIS2, m_texture_animator); - init_bucket_renderer("hud-draw-pris2", BucketCategory::TEX, - BucketId::HUD_DRAW_PRIS2, m_texture_animator); + init_bucket_renderer("hud-draw-pris2", BucketCategory::OTHER, + BucketId::HUD_DRAW_PRIS2, 0x8000); init_bucket_renderer("progress", BucketCategory::OTHER, BucketId::BUCKET582, 0x8000); diff --git a/game/mips2c/jak3_functions/foreground.cpp b/game/mips2c/jak3_functions/foreground.cpp index dca45f55f0..75aa5c610e 100644 --- a/game/mips2c/jak3_functions/foreground.cpp +++ b/game/mips2c/jak3_functions/foreground.cpp @@ -1544,6 +1544,11 @@ block_11: block_16: c->gprs[t0].du64[0] = 0; // or t0, r0, r0 // Unknown instr: ld t0, L217(fp) + // L217: + // .word 0x80808080 + // .word 0x0 + c->gprs[t0].du32[0] = 0x80808080; + c->gprs[t0].du32[1] = 0x0; c->dsll(t1, a3, 3); // dsll t1, a3, 3 c->daddu(t1, v1, t1); // daddu t1, v1, t1 c->sw(t0, 124, t1); // sw t0, 124(t1) diff --git a/goal_src/jak1/engine/common-obs/crates.gc b/goal_src/jak1/engine/common-obs/crates.gc index a41cbf0ceb..a3ca881f16 100644 --- a/goal_src/jak1/engine/common-obs/crates.gc +++ b/goal_src/jak1/engine/common-obs/crates.gc @@ -61,6 +61,7 @@ (COLLIDE_RADIUS float) (DARKECO_EXPLODE_RADIUS float))) + (define *CRATE-bank* (new 'static 'crate-bank :COLLIDE_YOFF 4096.0 :COLLIDE_RADIUS 4915.2 :DARKECO_EXPLODE_RADIUS 16384.0)) @@ -87,6 +88,7 @@ (check-dead (_type_) none) (smush-update! (_type_) none))) + (method-set! crate 12 (method-of-type process run-logic?)) (defbehavior crate-post crate () @@ -635,7 +637,7 @@ (not arg0))) (logior! (-> self fact options) (fact-options instant-collect))) (when (not arg0) - (let ((s5-1 (current-time))) (until (time-elapsed? s5-1 (seconds 0.04)) (suspend))) + (suspend-for (seconds 0.04)) (logior! (-> self draw status) (draw-status hidden)) (case (-> self look) (('iron) (sound-play "icrate-break")) @@ -702,7 +704,7 @@ (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) arg1) (process-entity-status! self (entity-perm-status dead) #t) (process-entity-status! self (entity-perm-status complete) #t) - (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 5)) (suspend))))) + (suspend-for (seconds 5)))) (defstate special-contents-die (crate) :virtual #t @@ -868,6 +870,7 @@ (deftype barrel (crate) ()) + (defmethod params-init ((this barrel) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) (t9-0 this arg0)) (set! (-> this look) 'barrel) @@ -875,6 +878,7 @@ (deftype bucket (crate) ()) + (defmethod params-init ((this bucket) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) (t9-0 this arg0)) (set! (-> this look) 'bucket) @@ -912,6 +916,7 @@ (deftype crate-buzzer (crate) ()) + (defmethod art-init ((this crate-buzzer)) (let ((t9-0 (method-of-type crate art-init))) (t9-0 this)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 74) this)) @@ -969,6 +974,7 @@ (deftype pickup-spawner (crate) ((blocker entity-actor))) + (defmethod params-init ((this pickup-spawner) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) (t9-0 this arg0)) (set! (-> this look) 'none) diff --git a/goal_src/jak1/engine/common-obs/generic-obs.gc b/goal_src/jak1/engine/common-obs/generic-obs.gc index 4069830869..fff7c6ae8e 100644 --- a/goal_src/jak1/engine/common-obs/generic-obs.gc +++ b/goal_src/jak1/engine/common-obs/generic-obs.gc @@ -96,7 +96,7 @@ (suspend) (while (and *target* (= (handle->process (-> *target* control unknown-handle10)) self)) (suspend)) - (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 0.5)) (suspend))) + (suspend-for (seconds 0.5)) (go swingpole-stance))) (defmethod init-from-entity! ((this swingpole) (arg0 entity-actor)) @@ -127,8 +127,10 @@ (deftype target-start (process-hidden) ()) + (deftype camera-start (process-hidden) ()) + (defstate manipy-idle (manipy) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) @@ -365,10 +367,7 @@ (vector+! (-> self root trans) (-> (the-as process-drawable gp-0) root trans) (-> self offset))))) (let ((gp-1 (-> self root trans))) (if (-> self callback) ((-> self callback) self)) (spawn (-> self part) gp-1)) (suspend)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (-> self linger-duration)) - (if (-> self linger-callback) ((-> self linger-callback) self)) - (suspend))) + (suspend-for (-> self linger-duration) (if (-> self linger-callback) ((-> self linger-callback) self))) (if (-> self linger-callback) ((-> self linger-callback) self)) (part-tracker-notify) (suspend) @@ -551,11 +550,7 @@ (set! s2-1 (cdr s2-1)) (set! a1-5 (car s2-1))))))) (('not) (set! gp-0 (not (eval this (the-as pair (car s4-0)))))) - (('wait-for 'wait 'suspend) - (let ((s5-1 (command-get-time (car s4-0) 1)) - (s4-1 (current-time))) - (until (time-elapsed? s4-1 s5-1) - (suspend)))) + (('wait-for 'wait 'suspend) (let ((s5-1 (command-get-time (car s4-0) 1))) (suspend-for s5-1))) (('message?) (when (= (-> this message) (car s4-0)) (set! gp-0 (-> this message)) (set! (-> this message) #f))) (('send-event) (let ((s5-2 (command-get-process (car s4-0) *target*)) @@ -688,6 +683,7 @@ (:states med-res-level-idle)) + (defstate med-res-level-idle (med-res-level) :code (behavior () @@ -836,6 +832,7 @@ launcher-deactivated launcher-idle)) + (defpartgroup group-beach-launcher :id 37 :bounds (static-bspherem 0 3 0 5) diff --git a/goal_src/jak1/engine/common-obs/nav-enemy.gc b/goal_src/jak1/engine/common-obs/nav-enemy.gc index 5d3f7b7012..440d53fce2 100644 --- a/goal_src/jak1/engine/common-obs/nav-enemy.gc +++ b/goal_src/jak1/engine/common-obs/nav-enemy.gc @@ -35,11 +35,11 @@ (+! (-> result y) (* 0.5 time time (-> this gravity))) result) -(defmethod relocate ((this nav-enemy) (arg0 int)) - (if (nonzero? (-> this neck)) (set! (-> this neck) (the-as joint-mod (+ (the-as int (-> this neck)) arg0)))) +(defmethod relocate ((this nav-enemy) (offset int)) + (if (nonzero? (-> this neck)) (set! (-> this neck) (the-as joint-mod (+ (the-as int (-> this neck)) offset)))) (if (nonzero? (-> this rand-gen)) - (set! (-> this rand-gen) (the-as random-generator (+ (the-as int (-> this rand-gen)) arg0)))) - (call-parent-method this arg0)) + (set! (-> this rand-gen) (the-as random-generator (+ (the-as int (-> this rand-gen)) offset)))) + (call-parent-method this offset)) (defmethod new-patrol-point! ((this nav-enemy)) (local-vars (v1-11 symbol)) @@ -1060,11 +1060,7 @@ nav-enemy-default-event-handler (ja :num! (loop! f30-0))) (ja-channel-push! 1 (seconds 0.1)) (nav-enemy-turn-to-face-point (-> self event-param-point) 910.2222) - (let ((gp-0 (nav-enemy-rnd-int-range 0 150)) - (s5-0 (current-time))) - (until (time-elapsed? s5-0 gp-0) - (ja :num! (loop! f30-0)) - (suspend)))) + (let ((gp-0 (nav-enemy-rnd-int-range 0 150))) (suspend-for gp-0 (ja :num! (loop! f30-0))))) (go-virtual nav-enemy-jump-to-point)) :post nav-enemy-simple-post) diff --git a/goal_src/jak1/engine/entity/ambient.gc b/goal_src/jak1/engine/entity/ambient.gc index 355b248e7a..e374dc8bda 100644 --- a/goal_src/jak1/engine/entity/ambient.gc +++ b/goal_src/jak1/engine/entity/ambient.gc @@ -11,21 +11,21 @@ ;; DECOMP BEGINS -(defmethod mem-usage ((this drawable-ambient) (arg0 memory-usage-block) (arg1 int)) - (set! (-> arg0 length) (max 50 (-> arg0 length))) - (set! (-> arg0 data 49 name) "ambient") - (+! (-> arg0 data 49 count) 1) - (let ((v1-6 (asize-of this))) (+! (-> arg0 data 49 used) v1-6) (+! (-> arg0 data 49 total) (logand -16 (+ v1-6 15)))) - (mem-usage (-> this ambient) arg0 (logior arg1 128)) +(defmethod mem-usage ((this drawable-ambient) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 50 (-> usage length))) + (set! (-> usage data 49 name) "ambient") + (+! (-> usage data 49 count) 1) + (let ((v1-6 (asize-of this))) (+! (-> usage data 49 used) v1-6) (+! (-> usage data 49 total) (logand -16 (+ v1-6 15)))) + (mem-usage (-> this ambient) usage (logior flags 128)) (the-as drawable-ambient 0)) -(defmethod mem-usage ((this drawable-inline-array-ambient) (arg0 memory-usage-block) (arg1 int)) - (set! (-> arg0 length) (max 1 (-> arg0 length))) - (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) - (+! (-> arg0 data 0 count) 1) - (let ((v1-7 32)) (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15)))) +(defmethod mem-usage ((this drawable-inline-array-ambient) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 1 (-> usage length))) + (set! (-> usage data 0 name) (symbol->string 'drawable-group)) + (+! (-> usage data 0 count) 1) + (let ((v1-7 32)) (+! (-> usage data 0 used) v1-7) (+! (-> usage data 0 total) (logand -16 (+ v1-7 15)))) (dotimes (s3-0 (-> this length)) - (mem-usage (-> this data s3-0) arg0 arg1)) + (mem-usage (-> this data s3-0) usage flags)) (the-as drawable-inline-array-ambient 0)) (define *hint-semaphore* (the-as (pointer level-hint) #f)) @@ -368,15 +368,13 @@ :code (behavior ((arg0 string) (arg1 string)) (remove-setting! 'hint) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 (seconds 1)) - (when (and *debug-segment* (not (paused?)) (not (str-is-playing?)) (bottom-hud-hidden?)) - (let ((s3-0 (new 'stack 'font-context *font-default-matrix* 56 160 0.0 (font-color default) (font-flags shadow kerning)))) - (let ((v1-7 s3-0)) (set! (-> v1-7 width) (the float 400))) - (let ((v1-8 s3-0)) (set! (-> v1-8 height) (the float 96))) - (set! (-> s3-0 flags) (font-flags shadow kerning middle)) - (let ((s2-0 print-game-text)) (format (clear *temp-string*) "~S~S" arg0 arg1) (s2-0 *temp-string* s3-0 #f 128 22)))) - (suspend))) + (suspend-for (seconds 1) + (when (and *debug-segment* (not (paused?)) (not (str-is-playing?)) (bottom-hud-hidden?)) + (let ((s3-0 (new 'stack 'font-context *font-default-matrix* 56 160 0.0 (font-color default) (font-flags shadow kerning)))) + (let ((v1-7 s3-0)) (set! (-> v1-7 width) (the float 400))) + (let ((v1-8 s3-0)) (set! (-> v1-8 height) (the float 96))) + (set! (-> s3-0 flags) (font-flags shadow kerning middle)) + (let ((s2-0 print-game-text)) (format (clear *temp-string*) "~S~S" arg0 arg1) (s2-0 *temp-string* s3-0 #f 128 22))))) (go level-hint-exit))) (defstate level-hint-exit (level-hint) diff --git a/goal_src/jak1/engine/game/powerups.gc b/goal_src/jak1/engine/game/powerups.gc index 16c4fade94..8ef508e857 100644 --- a/goal_src/jak1/engine/game/powerups.gc +++ b/goal_src/jak1/engine/game/powerups.gc @@ -16,24 +16,20 @@ (change-parent self arg0) (let ((s1-1 (process->handle arg0)) (s2-1 (process->handle arg1))) - (let ((s0-0 (current-time))) - (until (time-elapsed? s0-0 (+ arg3 arg4)) - (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) (if v1-8 (deactivate self))) - (let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) s0-0)) (the float arg3)) (the float arg4))))) - (a0-18 (process-drawable-pair-random-point! (the-as process-drawable (-> s1-1 process 0)) - (the-as process-drawable (-> s2-1 process 0)) - (new-stack-vector0) - f0-1))) - (arg2 a0-18)) - (suspend))) + (suspend-for (+ arg3 arg4) + (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) (if v1-8 (deactivate self))) + (let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) time)) (the float arg3)) (the float arg4))))) + (a0-18 (process-drawable-pair-random-point! (the-as process-drawable (-> s1-1 process 0)) + (the-as process-drawable (-> s2-1 process 0)) + (new-stack-vector0) + f0-1))) + (arg2 a0-18))) (cond ((zero? arg5) (loop (suspend))) (else - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 arg5) - (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) - (arg2 a0-21)) - (suspend)))))) + (suspend-for arg5 + (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) + (arg2 a0-21)))))) (none)) (defpart 255 diff --git a/goal_src/jak1/engine/target/target-death.gc b/goal_src/jak1/engine/target/target-death.gc index 84b19dd11b..536fa63b65 100644 --- a/goal_src/jak1/engine/target/target-death.gc +++ b/goal_src/jak1/engine/target/target-death.gc @@ -180,7 +180,7 @@ (suspend) (suspend) (send-event (if gp-0 (-> gp-0 extra process)) 'play-anim))) - (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 2)) (suspend))) + (suspend-for (seconds 2)) (until (not v1-10) (suspend) (set! v1-10 (and *target* (logtest? (-> *target* state-flags) (state-flags grabbed))))) @@ -271,7 +271,7 @@ (s3-7 (if v1-235 (-> v1-235 extra process)) s4-13)))) (set-continue! *game-info* "lavatube-end"))) (go target-warp-in s5-6 (-> arg0 trans)))) - (else (let ((s5-7 (current-time))) (until (time-elapsed? s5-7 (seconds 0.05)) (suspend))))) + (else (suspend-for (seconds 0.05)))) (set-continue! *game-info* arg0) (when *auto-continue* (let ((s5-8 (next-level (-> arg0 level)))) @@ -712,7 +712,7 @@ (-> self attack-info attacker) (ja-channel-set! 0) (ja-post) - (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 1)) (suspend)))) + (suspend-for (seconds 1))) (('drown 'drown-death) (sound-play "death-drown") (logclear! (-> self water flags) (water-flags wt04)) @@ -772,7 +772,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((gp-9 (current-time))) (until (time-elapsed? gp-9 (seconds 2)) (suspend)))) + (suspend-for (seconds 2))) (('endlessfall) (sound-play "death-fall") (camera-change-to (the-as string cam-endlessfall) 30 #f) @@ -809,10 +809,7 @@ (target-falling-anim (seconds 0.1) (seconds 0.33)) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! eichar-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (let ((gp-12 (current-time))) - (until (time-elapsed? gp-12 (seconds 0.8)) - (ja :group! eichar-launch-jump-loop-ja :num! (loop! 0.5)) - (suspend))) + (suspend-for (seconds 0.8) (ja :group! eichar-launch-jump-loop-ja :num! (loop! 0.5))) (camera-change-to (the-as string 'base) 0 #f)) (('target-hit-ground-hard) (set! (-> self control unknown-surface00) *neutral-mods*) diff --git a/goal_src/jak1/engine/target/target2.gc b/goal_src/jak1/engine/target/target2.gc index 854aca3f48..c4e0c2b42d 100644 --- a/goal_src/jak1/engine/target/target2.gc +++ b/goal_src/jak1/engine/target/target2.gc @@ -28,11 +28,7 @@ (send-event *camera* 'joystick 0.0 0.0) (suspend) (ja :num! (seek!))) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.3)) - (suspend) - (ja :num! (seek! (ja-aframe (the-as float 19.0) 0) 0.05)) - (suspend))) + (suspend-for (seconds 0.3) (suspend) (ja :num! (seek! (ja-aframe (the-as float 19.0) 0) 0.05))) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! eichar-painful-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 40.0) 0)) (until (ja-done? 0) @@ -166,11 +162,11 @@ (go hud-waiting) (none)) -(defmethod relocate ((this first-person-hud) (arg0 int)) +(defmethod relocate ((this first-person-hud) (offset int)) (dotimes (v1-0 (-> this nb-of-particles)) (when (-> this particles v1-0 part) - (if (nonzero? (-> this particles v1-0 part)) (&+! (-> this particles v1-0 part) arg0)))) - (the-as first-person-hud ((method-of-type process relocate) this arg0))) + (if (nonzero? (-> this particles v1-0 part)) (&+! (-> this particles v1-0 part) offset)))) + (the-as first-person-hud ((method-of-type process relocate) this offset))) (defmethod spawn-particles! ((this first-person-hud)) (dotimes (s5-0 (-> this nb-of-particles)) @@ -1007,7 +1003,7 @@ :to self) (set-time! (-> self control unknown-dword82)) - (let ((gp-4 (current-time))) (until (time-elapsed? gp-4 (seconds 0.1)) (suspend))) + (suspend-for (seconds 0.1)) (ja-no-eval :group! eichar-yellow-jumping-blast-ja :num! (seek!) :frame-num (ja-frame-num 0)) (until (ja-done? 0) (suspend) @@ -1676,7 +1672,7 @@ 143360.0 :to self)) - ;; PAL patch (sound plays elsewhere) + ;; og:preserve-this PAL patch (sound plays elsewhere) ;(sound-play "launch-fire") (go target-high-jump arg0 arg0 'launch)) :post target-no-stick-post) diff --git a/goal_src/jak1/kernel/gstate.gc b/goal_src/jak1/kernel/gstate.gc index 2152bdbe0e..1fc3e7cf53 100644 --- a/goal_src/jak1/kernel/gstate.gc +++ b/goal_src/jak1/kernel/gstate.gc @@ -209,6 +209,10 @@ It type checks the arguments for the entry function. ,*defstate-current-state-name* (find-parent-method ,*defstate-current-type* (method-id-of-type ,*defstate-current-type* ,*defstate-current-state-name*)))) +(defmacro call-parent-state-handler (handler &key (type (function none)) &rest args) + "Call the parent handler for this state." + `(let ((handler (-> (find-parent-state) ,handler))) (if handler ((the ,type handler) ,@args)))) + (defmacro behavior (bindings &rest body) "Define an anonymous behavior for a process state. This may only be used inside a defstate!" (let ((behavior-type (first *defstate-type-stack*))) @@ -428,3 +432,6 @@ It type checks the arguments for the entry function. (defmacro time-passed? (time) "has it been 'time' since set-state-time?" `(>= (time-passed) ,time)) + +(defmacro suspend-for (time &rest body) + `(let ((time (current-time))) (until (time-elapsed? time ,time) ,@body (suspend)))) diff --git a/goal_src/jak1/levels/beach/beach-obs.gc b/goal_src/jak1/levels/beach/beach-obs.gc index 52a6d7b04c..931248f431 100644 --- a/goal_src/jak1/levels/beach/beach-obs.gc +++ b/goal_src/jak1/levels/beach/beach-obs.gc @@ -21,6 +21,7 @@ (:states windmill-one-idle)) + (defskelgroup *windmill-one-sg* windmill-one windmill-one-lod0-jg @@ -167,6 +168,7 @@ grottopole-moving-down grottopole-moving-up)) + (defskelgroup *grottopole-sg* grottopole grottopole-lod0-jg @@ -319,6 +321,7 @@ (:states (ecoventrock-break symbol) ecoventrock-idle)) + (defskelgroup *ecoventrock-sg* ecoventrock ecoventrock-lod0-jg @@ -525,7 +528,7 @@ (set! sv-128 (the-as symbol #f)) (apply-all (-> self link) actor-link-subtask-complete-hook (& sv-128)) (when sv-128 - (let ((s5-2 (current-time))) (until (time-elapsed? s5-2 (seconds 0.5)) (suspend))) + (suspend-for (seconds 0.5)) (let ((gp-1 (cond (arg0 (the-as int #f)) (else @@ -570,6 +573,7 @@ flying-rock-idle flying-rock-rolling)) + (defskelgroup *kickrock-sg* kickrock kickrock-lod0-jg @@ -675,6 +679,7 @@ (:states bladeassm-idle)) + (defskelgroup *bladeassm-sg* bladeassm bladeassm-lod0-jg @@ -739,6 +744,7 @@ flutflutegg-physics flutflutegg-physics-fall)) + (defskelgroup *flutflutegg-sg* flutflutegg flutflutegg-lod0-jg @@ -753,9 +759,9 @@ ((flutflut-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 8)) -(defmethod relocate ((this flutflutegg) (arg0 int)) - (if (nonzero? (-> this wobbler)) (&+! (-> this wobbler) arg0)) - (call-parent-method this arg0)) +(defmethod relocate ((this flutflutegg) (offset int)) + (if (nonzero? (-> this wobbler)) (&+! (-> this wobbler) offset)) + (call-parent-method this offset)) ;; WARN: Function (method 20 flutflutegg) has a return type of none, but the expression builder found a return statement. (defmethod flutflutegg-method-20 ((this flutflutegg) (arg0 float) (arg1 float) (arg2 float)) @@ -875,7 +881,7 @@ (suspend)) (camera-change-to "camera-135" 0 #f) (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 9)) - (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 4)) (suspend))) + (suspend-for (seconds 4)) (while (not (process-release? (handle->process (-> self grab-target)))) (suspend)) (camera-look-at (the-as pair *target*) (the-as uint 0)) @@ -994,6 +1000,7 @@ harvester-idle (harvester-inflate symbol))) + (defskelgroup *harvester-sg* harvester harvester-lod0-jg @@ -1094,6 +1101,7 @@ (deftype beachcam (process-hidden) ()) + (defun beachcam-spawn () (with-pp (let ((gp-0 (entity-actor-lookup (-> pp entity) 'alt-actor 0))) diff --git a/goal_src/jak1/levels/beach/lurkercrab.gc b/goal_src/jak1/levels/beach/lurkercrab.gc index 565df30fb0..1139fb8083 100644 --- a/goal_src/jak1/levels/beach/lurkercrab.gc +++ b/goal_src/jak1/levels/beach/lurkercrab.gc @@ -56,6 +56,7 @@ (:states lurkercrab-pushed)) + (defskelgroup *lurkercrab-sg* lurkercrab lurkercrab-lod0-jg @@ -146,13 +147,13 @@ nav-enemy-default-event-handler (ja-channel-push! 1 (seconds 0.075)) (loop (ja :group! lurkercrab-idle-ja :num! (identity (ja-aframe 1.0 0))) - (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 3)) (suspend))) + (suspend-for (seconds 3)) (ja-no-eval :group! lurkercrab-idle-ja :num! (seek! (ja-aframe 19.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe 19.0 0)))) (ja :num-func num-func-identity :frame-num (ja-aframe 19.0 0)) - (let ((gp-5 (current-time))) (until (time-elapsed? gp-5 (seconds 1)) (suspend))) + (suspend-for (seconds 1)) (ja-no-eval :group! lurkercrab-idle-ja :num! (seek! (ja-aframe 1.0 0)) :frame-num (ja-aframe 19.0 0)) (until (ja-done? 0) (suspend) @@ -199,7 +200,7 @@ nav-enemy-default-event-handler (nav-enemy-rnd-int-range 2 6) (until (not (nav-enemy-rnd-go-idle? 0.2)) (ja :group! lurkercrab-idle-ja :num! (identity (ja-aframe 1.0 0))) - (let ((gp-2 (current-time))) (until (time-elapsed? gp-2 (seconds 2)) (suspend)))) + (suspend-for (seconds 2))) (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (ja-no-eval :group! lurkercrab-idle-to-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -326,8 +327,8 @@ nav-enemy-default-event-handler (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe 18.0 0) 0.75))) - (let ((gp-2 (current-time))) (until (time-elapsed? gp-2 (seconds 0.25)) (suspend))) - (let ((gp-3 (current-time))) (until (time-elapsed? gp-3 (seconds 0.1)) (suspend))) + (suspend-for (seconds 0.25)) + (suspend-for (seconds 0.1)) (go-virtual nav-enemy-chase)) :post (behavior () diff --git a/goal_src/jak1/levels/beach/lurkerpuppy.gc b/goal_src/jak1/levels/beach/lurkerpuppy.gc index 334f1e44c9..8d46e0568c 100644 --- a/goal_src/jak1/levels/beach/lurkerpuppy.gc +++ b/goal_src/jak1/levels/beach/lurkerpuppy.gc @@ -7,6 +7,7 @@ (deftype lurkerpuppy (nav-enemy) ()) + (defskelgroup *lurkerpuppy-sg* lurkerpuppy lurkerpuppy-lod0-jg @@ -77,12 +78,7 @@ nav-enemy-default-event-handler (ja-channel-push! 1 (seconds 0.1)) (ja :group! lurkerpuppy-idle-ja) (ja :num-func num-func-identity :frame-num 0.0) - (let ((gp-2 (rand-vu-int-range 750 900)) - (s5-0 (current-time))) - (until (time-elapsed? s5-0 gp-2) - (ja :num! (loop!)) - (ja-blend-eval) - (suspend))))))) + (let ((gp-2 (rand-vu-int-range 750 900))) (suspend-for gp-2 (ja :num! (loop!)) (ja-blend-eval))))))) (defstate nav-enemy-give-up (lurkerpuppy) :virtual #t diff --git a/goal_src/jak1/levels/citadel/citadel-obs.gc b/goal_src/jak1/levels/citadel/citadel-obs.gc index 5666d4f860..901527dd06 100644 --- a/goal_src/jak1/levels/citadel/citadel-obs.gc +++ b/goal_src/jak1/levels/citadel/citadel-obs.gc @@ -20,6 +20,7 @@ (setup-new-process! (_type_) none) (idle () _type_ :state))) + (defskelgroup *citb-arm-a-sg* citb-arm citb-arm-a-lod0-jg @@ -121,6 +122,7 @@ (deftype citb-arm (citb-arm-section) ((root collide-shape-moving :override))) + (defstate idle (citb-arm) :virtual #t :trans rider-trans @@ -161,6 +163,7 @@ (deftype citb-arm-shoulder (citb-arm-section) ()) + (defmethod setup-new-process! ((this citb-arm-shoulder)) (call-parent-method this) (set! (-> this draw origin-joint-index) (the-as uint 4)) @@ -171,16 +174,22 @@ (deftype citb-arm-a (citb-arm) ()) + (deftype citb-arm-b (citb-arm) ()) + (deftype citb-arm-c (citb-arm) ()) + (deftype citb-arm-d (citb-arm) ()) + (deftype citb-arm-shoulder-a (citb-arm-shoulder) ()) + (deftype citb-arm-shoulder-b (citb-arm-shoulder) ()) + (defmethod setup-new-process! ((this citb-arm-a)) (initialize-skeleton this *citb-arm-a-sg* '()) (call-parent-method this) @@ -263,6 +272,7 @@ (:states citb-disc-idle)) + (defstate citb-disc-idle (citb-disc) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) @@ -323,12 +333,16 @@ (deftype citb-disc-a (citb-disc) ()) + (deftype citb-disc-b (citb-disc) ()) + (deftype citb-disc-c (citb-disc) ()) + (deftype citb-disc-d (citb-disc) ()) + (defmethod citb-disc-method-21 ((this citb-disc-a)) (initialize-skeleton this *citb-disc-a-sg* '()) 0 @@ -351,6 +365,7 @@ (deftype citb-iris-door (eco-door) ()) + (defskelgroup *citb-iris-door-sg* citb-iris-door citb-iris-door-lod0-jg @@ -393,6 +408,7 @@ (deftype citb-button (basebutton) ()) + (defmethod basebutton-method-27 ((this citb-button)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -433,6 +449,7 @@ (deftype citb-launcher (plat) ((launcher (pointer launcher)))) + (defstate plat-path-active (citb-launcher) :virtual #t :post @@ -538,6 +555,7 @@ citb-robotboss-die citb-robotboss-idle)) + (defstate citb-robotboss-idle (citb-robotboss) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) @@ -650,9 +668,10 @@ citb-coil-broken citb-coil-idle)) -(defmethod relocate ((this citb-coil) (arg0 int)) - (if (nonzero? (-> this part-off)) (&+! (-> this part-off) arg0)) - (the-as citb-coil ((method-of-type process-drawable relocate) this arg0))) + +(defmethod relocate ((this citb-coil) (offset int)) + (if (nonzero? (-> this part-off)) (&+! (-> this part-off) offset)) + (the-as citb-coil ((method-of-type process-drawable relocate) this offset))) (defmethod deactivate ((this citb-coil)) (if (nonzero? (-> this part-off)) (kill-and-free-particles (-> this part-off))) @@ -724,6 +743,7 @@ citb-hose-idle citb-hose-spawn)) + (defbehavior citb-hose-event-handler citb-hose ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('spawn) (go citb-hose-spawn)) @@ -776,6 +796,7 @@ (deftype citb-chains (process-hidden) ()) + (defskelgroup *citb-generator-sg* citb-generator citb-generator-lod0-jg @@ -808,10 +829,11 @@ citb-generator-broken citb-generator-idle)) -(defmethod relocate ((this citb-generator) (arg0 int)) - (if (nonzero? (-> this part-broken)) (&+! (-> this part-broken) arg0)) - (if (nonzero? (-> this part-mushroom)) (&+! (-> this part-mushroom) arg0)) - (the-as citb-generator ((method-of-type process-drawable relocate) this arg0))) + +(defmethod relocate ((this citb-generator) (offset int)) + (if (nonzero? (-> this part-broken)) (&+! (-> this part-broken) offset)) + (if (nonzero? (-> this part-mushroom)) (&+! (-> this part-mushroom) offset)) + (the-as citb-generator ((method-of-type process-drawable relocate) this offset))) (defmethod deactivate ((this citb-generator)) (if (nonzero? (-> this part-broken)) (kill-and-free-particles (-> this part-broken))) @@ -998,6 +1020,7 @@ citadelcam-idle citadelcam-stair-plats)) + (defstate citadelcam-idle (citadelcam) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) @@ -1044,6 +1067,7 @@ (deftype citb-battlecontroller (battlecontroller) ()) + (defstate battlecontroller-play-intro-camera (citb-battlecontroller) :virtual #t :code @@ -1070,7 +1094,7 @@ :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (let ((t9-2 (-> (find-parent-state) code))) (if t9-2 ((the-as (function none :behavior battlecontroller) t9-2)))))) + (call-parent-state-handler code))) (defmethod battlecontroller-method-27 ((this citb-battlecontroller)) (call-parent-method this) diff --git a/goal_src/jak1/levels/citadel/citb-drop-plat.gc b/goal_src/jak1/levels/citadel/citb-drop-plat.gc index 6df877e8f6..3f8b131de8 100644 --- a/goal_src/jak1/levels/citadel/citb-drop-plat.gc +++ b/goal_src/jak1/levels/citadel/citb-drop-plat.gc @@ -59,6 +59,7 @@ (drop-plat-rise draw-control) drop-plat-spawn)) + (defstate drop-plat-idle (drop-plat) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) @@ -231,6 +232,7 @@ (deftype handle-inline-array (inline-array-class) ((data handle :dynamic))) + (set! (-> handle-inline-array heap-base) (the-as uint 8)) (deftype citb-drop-plat (process-drawable) @@ -251,9 +253,10 @@ citb-drop-plat-active citb-drop-plat-idle)) -(defmethod relocate ((this citb-drop-plat) (arg0 int)) - (if (nonzero? (-> this child-array)) (&+! (-> this child-array) arg0)) - (the-as citb-drop-plat ((method-of-type process-drawable relocate) this arg0))) + +(defmethod relocate ((this citb-drop-plat) (offset int)) + (if (nonzero? (-> this child-array)) (&+! (-> this child-array) offset)) + (the-as citb-drop-plat ((method-of-type process-drawable relocate) this offset))) (defbehavior citb-drop-plat-spawn-children citb-drop-plat () (local-vars (s0-0 int) (sv-48 process) (sv-64 int)) @@ -286,7 +289,7 @@ (t0-0 (-> self duration))) ((the-as (function process function vector int int int none) t9-7) a0-8 a1-5 a2-4 sv-64 (the-as int t0-0) s0-0)) (-> sv-48 ppointer))))))) - (let ((s2-1 (current-time))) (until (time-elapsed? s2-1 (seconds 0.12)) (suspend))) + (suspend-for (seconds 0.12)) (+! s5-0 s4-0)))) (set-time! (-> self drop-time)) 0 diff --git a/goal_src/jak1/levels/common/battlecontroller.gc b/goal_src/jak1/levels/common/battlecontroller.gc index 07fe5f52c3..a15f5103fd 100644 --- a/goal_src/jak1/levels/common/battlecontroller.gc +++ b/goal_src/jak1/levels/common/battlecontroller.gc @@ -13,6 +13,7 @@ (state int8) (enabled symbol))) + (deftype battlecontroller-creature-type (structure) ((type2 type) (percent float) @@ -22,6 +23,7 @@ (pickup-count int8)) :allow-misaligned) + (deftype battlecontroller (process-drawable) ((final-pickup-spawn-point vector :inline) (activate-distance float) @@ -54,6 +56,7 @@ (battlecontroller-method-27 (_type_) none) (cleanup-if-finished! (_type_) none))) + (defbehavior battlecontroller-spawners-full? battlecontroller () (dotimes (v1-0 (-> self spawner-count)) (if (= (-> self spawner-array v1-0 creature) #f) (return #f))) @@ -301,7 +304,7 @@ battlecontroller-default-event-handler (let ((v1-8 (-> self child))) (while v1-8 (+! gp-0 1) (set! v1-8 (-> v1-8 0 brother)) (nop!) (nop!))) (if (and (zero? gp-0) (= (-> self spawn-count) (-> self max-spawn-count))) (go-virtual battlecontroller-die)) (when (< gp-0 (-> self target-count)) - (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (-> self spawn-period)) (suspend))) + (suspend-for (-> self spawn-period)) (battlecontroller-spawn-creature-random-spawner)))) (suspend))) :post #f) @@ -373,11 +376,11 @@ battlecontroller-default-event-handler (process-entity-status! self (entity-perm-status dead) #t)) :post #f) -(defmethod relocate ((this battlecontroller) (arg0 int)) +(defmethod relocate ((this battlecontroller) (offset int)) (dotimes (v1-0 (-> this spawner-count)) - (let ((a0-3 (-> this spawner-array v1-0))) (if (nonzero? (-> a0-3 path)) (&+! (-> a0-3 path) arg0)))) - (if (nonzero? (-> this path-spawn)) (&+! (-> this path-spawn) arg0)) - (call-parent-method this arg0)) + (let ((a0-3 (-> this spawner-array v1-0))) (if (nonzero? (-> a0-3 path)) (&+! (-> a0-3 path) offset)))) + (if (nonzero? (-> this path-spawn)) (&+! (-> this path-spawn) offset)) + (call-parent-method this offset)) (defmethod deactivate ((this battlecontroller)) (with-pp diff --git a/goal_src/jak1/levels/finalboss/final-door.gc b/goal_src/jak1/levels/finalboss/final-door.gc index bc0ba7ac4f..c7cd44675d 100644 --- a/goal_src/jak1/levels/finalboss/final-door.gc +++ b/goal_src/jak1/levels/finalboss/final-door.gc @@ -11,6 +11,7 @@ (deftype fin-door (process-hidden) ()) + (deftype final-door (process-drawable) () (:state-methods idle) @@ -18,6 +19,7 @@ (final-door-method-21 (_type_) none) (open (symbol) _type_ :state))) + (defskelgroup *power-left-sg* power-left power-left-lod0-jg @@ -110,8 +112,10 @@ (deftype power-left (final-door) ()) + (deftype power-right (final-door) ()) + (defstate idle (power-left) :virtual #t :code @@ -151,6 +155,7 @@ (jump () _type_ :state) (idle () _type_ :state))) + (defstate jump (powercellalt) :virtual #t :code @@ -263,7 +268,7 @@ (t9-16 (the-as powercellalt sv-144) s1-0 'powercellalt (the-as pointer #x70004000))) (run-now-in-process sv-144 powercellalt-init-by-other s4-3 s3-1 sv-160 s0-0) (-> sv-144 ppointer)))) - (let ((s1-1 (current-time))) (until (time-elapsed? s1-1 (seconds 0.1)) (suspend))) + (suspend-for (seconds 0.1)) (when (handle->process arg1) (let ((s1-2 (handle->process arg1)) (s0-1 (+ s2-0 4))) @@ -274,8 +279,8 @@ (t9-20 (the-as powercellalt sv-176) s1-2 'powercellalt (the-as pointer #x70004000))) (run-now-in-process sv-176 powercellalt-init-by-other s4-3 s3-1 sv-192 s0-1) (-> sv-176 ppointer)))) - (let ((s1-3 (current-time))) (until (time-elapsed? s1-3 (seconds 0.1)) (suspend))))) - (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 2)) (suspend))) + (suspend-for (seconds 0.1)))) + (suspend-for (seconds 2)) (let ((v0-22 (entity-by-name "sage-finalboss-1")) (a1-26 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-26 from) self) diff --git a/goal_src/jak1/levels/finalboss/sage-finalboss.gc b/goal_src/jak1/levels/finalboss/sage-finalboss.gc index 3af6147864..ebe5186e3d 100644 --- a/goal_src/jak1/levels/finalboss/sage-finalboss.gc +++ b/goal_src/jak1/levels/finalboss/sage-finalboss.gc @@ -47,6 +47,7 @@ (speed float) (touch-time time-frame))) + (defmethod get-unlit-skel ((this plat-eco-finalboss)) *plat-eco-finalboss-unlit-sg*) @@ -114,6 +115,7 @@ (active symbol)) :allow-misaligned) + (deftype sage-finalboss (process-taskable) ((redsage handle) (bluesage handle) @@ -135,11 +137,12 @@ (:states sage-finalboss-credits)) -(defmethod relocate ((this sage-finalboss) (arg0 int)) + +(defmethod relocate ((this sage-finalboss) (offset int)) (dotimes (v1-0 9) - (if (nonzero? (-> this particle v1-0 part)) (&+! (-> this particle v1-0 part) arg0))) - (if (nonzero? (-> this particle-whiteout)) (&+! (-> this particle-whiteout) arg0)) - (the-as sage-finalboss ((method-of-type process-taskable relocate) this arg0))) + (if (nonzero? (-> this particle v1-0 part)) (&+! (-> this particle v1-0 part) offset))) + (if (nonzero? (-> this particle-whiteout)) (&+! (-> this particle-whiteout) offset)) + (the-as sage-finalboss ((method-of-type process-taskable relocate) this offset))) (defmethod deactivate ((this sage-finalboss)) (dotimes (s5-0 9) @@ -619,7 +622,7 @@ (remove-setting! 'music) (apply-settings *setting-control*) (set-blackout-frames (seconds 0.05)) - (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 0.05)) (suspend))) + (suspend-for (seconds 0.05)) (go-virtual hidden))) (defmethod should-display? ((this sage-finalboss)) diff --git a/goal_src/jak1/levels/flut_common/flutflut.gc b/goal_src/jak1/levels/flut_common/flutflut.gc index 42affa6c5d..eef2a7407a 100644 --- a/goal_src/jak1/levels/flut_common/flutflut.gc +++ b/goal_src/jak1/levels/flut_common/flutflut.gc @@ -27,10 +27,11 @@ (pickup (state flutflut)) wait-for-return)) -(defmethod relocate ((this flutflut) (arg0 int)) + +(defmethod relocate ((this flutflut) (offset int)) (countdown (v1-0 2) - (if (-> this path-data v1-0) (&+! (-> this path-data v1-0) arg0))) - (the-as flutflut ((method-of-type process-drawable relocate) this arg0))) + (if (-> this path-data v1-0) (&+! (-> this path-data v1-0) offset))) + (the-as flutflut ((method-of-type process-drawable relocate) this offset))) (define *flutflut-shadow-control* (new 'static @@ -187,7 +188,7 @@ (while (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut))) (flutflut-effect) (suspend)) - (let ((s5-0 (current-time))) (until (time-elapsed? s5-0 (seconds 1)) (flutflut-effect) (suspend))) + (suspend-for (seconds 1) (flutflut-effect)) (go arg0))) (defstate wait-for-return (flutflut) diff --git a/goal_src/jak1/levels/flut_common/target-flut.gc b/goal_src/jak1/levels/flut_common/target-flut.gc index 59b544fbc8..0cf802b7bb 100644 --- a/goal_src/jak1/levels/flut_common/target-flut.gc +++ b/goal_src/jak1/levels/flut_common/target-flut.gc @@ -18,6 +18,7 @@ (stick-lock basic) (flap-sound-id sound-id))) + (deftype flut-bank (basic) ((jump-height-min meters) (jump-height-max meters) @@ -26,6 +27,7 @@ (air-attack-speed meters) (ground-timeout time-frame))) + (define *FLUT-bank* (new 'static 'flut-bank @@ -1084,7 +1086,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-known-safe-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (current-time))) (until (time-elapsed? s3-1 (seconds 1)) (suspend))) + (suspend-for (seconds 1)) (move-to-point! (-> self control) s4-1)) (set! (-> (&-> (-> self control) unknown-qword00) 0) (-> self control trans quad)) (send-event *camera* 'teleport) @@ -1159,24 +1161,22 @@ (vector+! (-> self control transv) (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f30-0) (vector-float*! gp-3 gp-3 (/ f0-4 f1-3)))))) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 1)) - (target-flut-falling-anim-trans) - (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) - (let ((s5-2 (new-stack-vector0)) - (f30-1 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))) - 0.0 - (vector-! s5-2 - (-> self control transv) - (vector-float*! s5-2 (-> self control dynam gravity-normal) (the-as float f30-1))) - (let* ((f0-10 (vector-length s5-2)) - (f1-4 f0-10)) - (if (< (the-as float (-> self control unknown-uint20)) (the-as float f30-1)) (set! f30-1 (-> self control unknown-uint20))) - (vector+! (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f30-1)) - (vector-float*! s5-2 s5-2 (/ f0-10 f1-4))))) - (target-flut-post-post) - (suspend))) + (suspend-for (seconds 1) + (target-flut-falling-anim-trans) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) + (let ((s5-2 (new-stack-vector0)) + (f30-1 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))) + 0.0 + (vector-! s5-2 + (-> self control transv) + (vector-float*! s5-2 (-> self control dynam gravity-normal) (the-as float f30-1))) + (let* ((f0-10 (vector-length s5-2)) + (f1-4 f0-10)) + (if (< (the-as float (-> self control unknown-uint20)) (the-as float f30-1)) (set! f30-1 (-> self control unknown-uint20))) + (vector+! (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f30-1)) + (vector-float*! s5-2 s5-2 (/ f0-10 f1-4))))) + (target-flut-post-post)) (camera-change-to (the-as string 'base) 0 #f)) (else (set! (-> self control unknown-surface00) *neutral-mods*) diff --git a/goal_src/jak1/levels/jungle/darkvine.gc b/goal_src/jak1/levels/jungle/darkvine.gc index 608dfabde3..8ce47ceaaf 100644 --- a/goal_src/jak1/levels/jungle/darkvine.gc +++ b/goal_src/jak1/levels/jungle/darkvine.gc @@ -23,6 +23,7 @@ darkvine-idle darkvine-retreat)) + (defmethod run-logic? ((this darkvine)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) @@ -167,7 +168,7 @@ (suspend) (ja :num! (seek!))) (ja-channel-set! 0) - (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 2)) (suspend))) + (suspend-for (seconds 2)) (process-spawn part-tracker :init part-tracker-init @@ -179,7 +180,7 @@ (-> self root trans) :to *entity-pool*) - (let ((gp-2 (current-time))) (until (time-elapsed? gp-2 (seconds 0.5)) (suspend))) + (suspend-for (seconds 0.5)) (set! (-> self dangerous) #t) (logior! (-> self mask) (process-mask actor-pause)) (ja-channel-set! 1) diff --git a/goal_src/jak1/levels/jungle/fisher.gc b/goal_src/jak1/levels/jungle/fisher.gc index 6937772412..7dcd04c95f 100644 --- a/goal_src/jak1/levels/jungle/fisher.gc +++ b/goal_src/jak1/levels/jungle/fisher.gc @@ -15,6 +15,7 @@ (max-caught int32) (max-missed int32))) + (define *FISHER-bank* (new 'static 'fisher-bank :width (meters 3.3) :net-radius (meters 0.7) :max-caught #xc8 :max-missed 20)) @@ -148,6 +149,7 @@ (powerup-percent float)) :allow-misaligned) + (define *fisher-params* (new 'static 'boxed-array @@ -696,6 +698,7 @@ fisher-done fisher-playing)) + (deftype fisher-fish (process-drawable) ((dir vector :inline) (offset float) @@ -708,6 +711,7 @@ fisher-fish-die fisher-fish-fall)) + (defskelgroup *catch-fisha-sg* catch-fisha catch-fisha-lod0-jg @@ -1084,7 +1088,7 @@ (-> gp-2 user-uint8 6))) (process-spawn-function process (lambda :behavior process () - (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 0.1)) (suspend))) + (suspend-for (seconds 0.1)) (ambient-hint-spawn "st-lose" (the-as vector #f) *entity-pool* 'stinger) (none))) (send-event *target* 'lose)))) @@ -1400,13 +1404,13 @@ (launch-particles (-> *part-id-table* 828) gp-0) (launch-particles (-> *part-id-table* 2013) gp-0) (fisher-fish-water gp-0 (+ 32768.0 (vector-y-angle (-> self node-list data 80 bone transform vector 1)))))) - (let ((t9-14 (-> (find-parent-state) trans))) (if t9-14 (t9-14))))) + (call-parent-state-handler trans))) (defstate idle (fisher) :virtual #t :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) (if t9-1 (t9-1))) + (call-parent-state-handler trans) (when (task-complete? *game-info* (-> self entity extra perm task)) (when (nonzero? (-> *cpad-list* cpads 0 button0-rel 0)) (let ((v1-9 (-> self cheat-temp))) diff --git a/goal_src/jak1/levels/jungle/jungle-elevator.gc b/goal_src/jak1/levels/jungle/jungle-elevator.gc index 9e9140d126..cb790ddb35 100644 --- a/goal_src/jak1/levels/jungle/jungle-elevator.gc +++ b/goal_src/jak1/levels/jungle/jungle-elevator.gc @@ -10,6 +10,7 @@ (teleport-if-below-y float) (teleport-if-above-y float))) + (defmethod can-activate? ((this jungle-elevator)) (and ((method-of-type plat-button can-activate?) this) (task-complete? *game-info* (game-task jungle-tower)))) @@ -31,7 +32,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> self root trans quad)) - (let ((t9-1 (-> (find-parent-state) trans))) (if t9-1 (t9-1))) + (call-parent-state-handler trans) (vector-! gp-0 (-> self root trans) s5-0) (when (< (-> self path-pos) 0.9) (move-by-vector! (-> *target* control) gp-0) diff --git a/goal_src/jak1/levels/jungle/jungle-mirrors.gc b/goal_src/jak1/levels/jungle/jungle-mirrors.gc index c935d53dbf..e3dc34a44f 100644 --- a/goal_src/jak1/levels/jungle/jungle-mirrors.gc +++ b/goal_src/jak1/levels/jungle/jungle-mirrors.gc @@ -493,10 +493,11 @@ periscope-wait-for-player periscope-wait-for-power-input)) -(defmethod relocate ((this periscope) (arg0 int)) - (if (nonzero? (-> this grips)) (&+! (-> this grips) arg0)) - (if (nonzero? (-> this part-aligned)) (&+! (-> this part-aligned) arg0)) - (the-as periscope ((method-of-type process-drawable relocate) this arg0))) + +(defmethod relocate ((this periscope) (offset int)) + (if (nonzero? (-> this grips)) (&+! (-> this grips) offset)) + (if (nonzero? (-> this part-aligned)) (&+! (-> this part-aligned) offset)) + (the-as periscope ((method-of-type process-drawable relocate) this offset))) (defmethod deactivate ((this periscope)) (if (nonzero? (-> this part-aligned)) (kill-and-free-particles (-> this part-aligned))) @@ -509,6 +510,7 @@ (:states reflector-idle)) + (deftype reflector-origin (process-drawable) ((reflector-trans vector :inline) (next-reflector-trans vector :inline) @@ -518,12 +520,14 @@ (:states reflector-origin-idle)) + (deftype reflector-mirror (process-drawable) ((root collide-shape :override) (beam-end vector :inline)) (:states (reflector-mirror-broken symbol) reflector-mirror-idle)) + (defskelgroup *periscope-base-sg* periscope periscope-base-lod0-jg @@ -1436,7 +1440,7 @@ (ambient-hint-spawn "gamcam21" (the-as vector #f) *entity-pool* 'camera) (let ((v1-11 (manipy-spawn (-> self root trans) (-> self entity) *reflector-mirror-break-sg* #f :to self))) (send-event (ppointer->process v1-11) 'anim-mode 'play1)) - (let ((gp-2 (current-time))) (until (time-elapsed? gp-2 (seconds 0.5)) (suspend))) + (suspend-for (seconds 0.5)) (process-grab? *target*) (while (or (-> self child) (-> *setting-control* current ambient)) (suspend)) diff --git a/goal_src/jak1/levels/jungleb/jungleb-obs.gc b/goal_src/jak1/levels/jungleb/jungleb-obs.gc index fe50c22ab6..30dc79f301 100644 --- a/goal_src/jak1/levels/jungleb/jungleb-obs.gc +++ b/goal_src/jak1/levels/jungleb/jungleb-obs.gc @@ -14,6 +14,7 @@ (:states (eggtop-close symbol) eggtop-idle)) + (defskelgroup *eggtop-sg* eggtop eggtop-lod0-jg @@ -204,11 +205,11 @@ (lambda :behavior camera-tracker () (while (not (process-grab? *target*)) (suspend)) - (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 1)) (suspend))) + (suspend-for (seconds 1)) (send-event *camera* 'blend-from-as-fixed) (camera-look-at (the-as pair "ecovent-171") (the-as uint 0)) (camera-change-to "camera-223" 0 #f) - (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 3)) (suspend))) + (suspend-for (seconds 3)) (while (not (process-release? (handle->process (-> self grab-target)))) (suspend)) (send-event *camera* 'blend-from-as-fixed) @@ -271,6 +272,7 @@ (deftype jng-iris-door (eco-door) ()) + (defskelgroup *jng-iris-door-sg* jng-iris-door jng-iris-door-lod0-jg diff --git a/goal_src/jak1/levels/jungleb/plant-boss.gc b/goal_src/jak1/levels/jungleb/plant-boss.gc index 8324ca5e94..711a59cdd5 100644 --- a/goal_src/jak1/levels/jungleb/plant-boss.gc +++ b/goal_src/jak1/levels/jungleb/plant-boss.gc @@ -40,13 +40,14 @@ plant-boss-spawn plant-boss-vulnerable)) -(defmethod relocate ((this plant-boss) (arg0 int)) - (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0)) - (if (nonzero? (-> this body)) (&+! (-> this body) arg0)) + +(defmethod relocate ((this plant-boss) (offset int)) + (if (nonzero? (-> this neck)) (&+! (-> this neck) offset)) + (if (nonzero? (-> this body)) (&+! (-> this body) offset)) (dotimes (v1-8 3) - (if (nonzero? (-> this attack-prim v1-8)) (&+! (-> this attack-prim v1-8) arg0)) - (if (nonzero? (-> this death-prim v1-8)) (&+! (-> this death-prim v1-8) arg0))) - (call-parent-method this arg0)) + (if (nonzero? (-> this attack-prim v1-8)) (&+! (-> this attack-prim v1-8) offset)) + (if (nonzero? (-> this death-prim v1-8)) (&+! (-> this death-prim v1-8) offset))) + (call-parent-method this offset)) (deftype plant-boss-arm (process-drawable) ((root collide-shape :override) @@ -64,6 +65,7 @@ (plant-boss-vine-hit basic) plant-boss-vine-idle)) + (deftype plant-boss-leaf (process-drawable) ((root collide-shape-moving :override) (side int32) @@ -77,6 +79,7 @@ (plant-boss-leaf-open symbol) (plant-boss-leaf-open-idle symbol))) + (defskelgroup *plant-boss-sg* plant-boss plant-boss-main-lod0-jg @@ -356,11 +359,8 @@ :code (behavior ((arg0 symbol)) (when (not arg0) - (let ((f30-0 (rand-vu-float-range (the-as float 0.0) (the-as float 1.0))) - (gp-0 (current-time))) - (until (time-elapsed? gp-0 (the int (* 300.0 f30-0))) - (ja :num! (loop!)) - (suspend))) + (let ((f30-0 (rand-vu-float-range (the-as float 0.0) (the-as float 1.0)))) + (suspend-for (the int (* 300.0 f30-0)) (ja :num! (loop!)))) (ja-channel-push! 1 (seconds 0.25)) (ja-no-eval :group! plant-boss-vine-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -387,11 +387,7 @@ (defstate plant-boss-root-die (plant-boss-arm) :code (behavior ((arg0 symbol)) - (when (not arg0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 4)) - (+! (-> self root trans z) (* -4096.0 (seconds-per-frame))) - (suspend))))) + (if (not arg0) (suspend-for (seconds 4) (+! (-> self root trans z) (* -4096.0 (seconds-per-frame)))))) :post ja-post) (defbehavior plant-boss-arm-init plant-boss-arm ((arg0 vector) (arg1 float) (arg2 int)) @@ -733,7 +729,7 @@ (while (not (send-event *camera* 'intro-done?)) (suspend)) (camera-change-to "camera-222" 600 #f) - (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 2)) (suspend))) + (suspend-for (seconds 2)) (while (not (process-release? (handle->process (-> self grab-target)))) (suspend)) (send-event *camera* 'blend-from-as-fixed) @@ -1203,11 +1199,7 @@ (behavior () (ja-channel-set! 1) (ja :group! plant-boss-main-die-ja :num! max) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 5)) - (transform-post) - (do-push-aways! (-> self root)) - (suspend))) + (suspend-for (seconds 5) (transform-post) (do-push-aways! (-> self root))) (loop (logior! (-> self mask) (process-mask sleep)) (suspend)))) diff --git a/goal_src/jak1/levels/maincave/baby-spider.gc b/goal_src/jak1/levels/maincave/baby-spider.gc index b231467314..ef91eee63c 100644 --- a/goal_src/jak1/levels/maincave/baby-spider.gc +++ b/goal_src/jak1/levels/maincave/baby-spider.gc @@ -23,6 +23,7 @@ (init! (_type_ symbol symbol symbol symbol int int symbol) none) (set-delay! (_type_ time-frame) none))) + (deftype baby-spider (nav-enemy) ((die-if-not-visible? symbol) (hack-move-above-ground? symbol) @@ -45,6 +46,7 @@ baby-spider-hatching baby-spider-resume)) + (defskelgroup *baby-spider-sg* baby-spider baby-spider-lod0-jg @@ -380,13 +382,8 @@ baby-spider-default-event-handler (ja :num! (seek! max f30-0))) (ja-no-eval :num! (loop!)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) - (let ((gp-0 (rand-vu-int-range 300 600)) - (s5-0 (current-time))) - (until (time-elapsed? s5-0 gp-0) - (ja :num-func num-func-identity :frame-num 0.0) - (ja-blend-eval) - (suspend) - (suspend))))))) + (let ((gp-0 (rand-vu-int-range 300 600))) + (suspend-for gp-0 (ja :num-func num-func-identity :frame-num 0.0) (ja-blend-eval) (suspend))))))) (defstate nav-enemy-give-up (baby-spider) :virtual #t diff --git a/goal_src/jak1/levels/maincave/dark-crystal.gc b/goal_src/jak1/levels/maincave/dark-crystal.gc index 423949601e..62dd41fa07 100644 --- a/goal_src/jak1/levels/maincave/dark-crystal.gc +++ b/goal_src/jak1/levels/maincave/dark-crystal.gc @@ -25,6 +25,7 @@ dark-crystal-idle dark-crystal-spawn-fuel-cell)) + (defskelgroup *dark-crystal-sg* dark-crystal dark-crystal-lod0-jg @@ -459,7 +460,7 @@ (-> self root trans) :to *entity-pool*) - (let ((s5-4 (current-time))) (until (time-elapsed? s5-4 (seconds 0.25)) (suspend))) + (suspend-for (seconds 0.25)) (if gp-1 (go dark-crystal-spawn-fuel-cell))) (cleanup-for-death self) (until (not (-> self child)) diff --git a/goal_src/jak1/levels/misty/babak-with-cannon.gc b/goal_src/jak1/levels/misty/babak-with-cannon.gc index 866ee65c86..29263e6a7c 100644 --- a/goal_src/jak1/levels/misty/babak-with-cannon.gc +++ b/goal_src/jak1/levels/misty/babak-with-cannon.gc @@ -15,6 +15,7 @@ babak-with-cannon-jump-onto-cannon babak-with-cannon-shooting)) + nav-enemy-default-event-handler (defstate nav-enemy-idle (babak-with-cannon) @@ -206,7 +207,7 @@ nav-enemy-default-event-handler (behavior () (if (and *target* (= (-> *target* current-level name) 'beach)) (spool-push *art-control* "beachcam-cannon" 0 self -1.0)) (if (and *target* (= (-> *target* current-level name) 'misty)) (spool-push *art-control* "mistycam-cannon" 0 self -1.0)) - (let ((t9-3 (-> (find-parent-state) trans))) (if t9-3 (t9-3))))) + (call-parent-state-handler trans))) (defstate nav-enemy-fuel-cell (babak-with-cannon) :virtual #t diff --git a/goal_src/jak1/levels/misty/balloonlurker.gc b/goal_src/jak1/levels/misty/balloonlurker.gc index ef6ce49ef1..e7deb7bce8 100644 --- a/goal_src/jak1/levels/misty/balloonlurker.gc +++ b/goal_src/jak1/levels/misty/balloonlurker.gc @@ -211,6 +211,7 @@ (explosion-force float) (mine-weight float))) + (define *BALLOONLURKER-bank* (new 'static 'balloonlurker-bank @@ -281,6 +282,7 @@ (balloonlurker-mine-explode int) balloonlurker-patrol)) + (deftype balloonlurker-pilot (process-drawable) ((root collide-shape-moving :override) (parent-override (pointer balloonlurker) :overlay-at parent)) @@ -291,6 +293,7 @@ balloonlurker-pilot-die balloonlurker-pilot-idle)) + (defskelgroup *balloonlurker-sg* balloonlurker balloonlurker-lod0-jg @@ -586,7 +589,7 @@ (apply-all (-> self link) actor-link-dead-hook (& sv-16)) (when (and sv-16 sv-24) (process-grab? *target*) - (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 1)) (suspend))) + (suspend-for (seconds 1)) (process-release? *target*) (while (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) self) @@ -607,12 +610,12 @@ (suspend))) :post balloonlurker-post) -(defmethod relocate ((this balloonlurker) (arg0 int)) - (if (nonzero? (-> this propeller)) (&+! (-> this propeller) arg0)) - (if (nonzero? (-> this rudder)) (&+! (-> this rudder) arg0)) - (if (nonzero? (-> this mine 0)) (&+! (-> this mine 0) arg0)) - (if (nonzero? (-> this mine 1)) (&+! (-> this mine 1) arg0)) - (call-parent-method this arg0)) +(defmethod relocate ((this balloonlurker) (offset int)) + (if (nonzero? (-> this propeller)) (&+! (-> this propeller) offset)) + (if (nonzero? (-> this rudder)) (&+! (-> this rudder) offset)) + (if (nonzero? (-> this mine 0)) (&+! (-> this mine 0) offset)) + (if (nonzero? (-> this mine 1)) (&+! (-> this mine 1) offset)) + (call-parent-method this offset)) (defstate balloonlurker-pilot-idle (balloonlurker-pilot) :event diff --git a/goal_src/jak1/levels/misty/misty-warehouse.gc b/goal_src/jak1/levels/misty/misty-warehouse.gc index cffe44e544..852e98920b 100644 --- a/goal_src/jak1/levels/misty/misty-warehouse.gc +++ b/goal_src/jak1/levels/misty/misty-warehouse.gc @@ -15,6 +15,7 @@ silostep-idle (silostep-rise symbol))) + (defskelgroup *silostep-sg* silostep silostep-lod0-jg @@ -45,7 +46,7 @@ (while (not (process-grab? *target*)) (suspend)) (camera-change-to "camera-160" 150 #f) - (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 3)) (suspend))) + (suspend-for (seconds 3)) (while (not (process-release? (handle->process (-> self grab-target)))) (suspend)) (camera-change-to (the-as string 'base) 150 #f) @@ -62,7 +63,7 @@ (v1-1 (get-reminder gp-0 0))) (save-reminder gp-0 (logior v1-1 2) 0)) (set-time! (-> self state-time)) - (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 1)) (suspend))) + (suspend-for (seconds 1)) (sound-play "arena-steps") (send-to-all-after (-> self link) 'trigger-rise) (go silostep-rise #f)) @@ -124,6 +125,7 @@ (deftype rounddoor (eco-door) ()) + (defmethod eco-door-method-24 ((this rounddoor)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) diff --git a/goal_src/jak1/levels/misty/mistycannon.gc b/goal_src/jak1/levels/misty/mistycannon.gc index 3124999c13..c2fb6a7189 100644 --- a/goal_src/jak1/levels/misty/mistycannon.gc +++ b/goal_src/jak1/levels/misty/mistycannon.gc @@ -13,6 +13,7 @@ (range float) (speed float))) + (defun angle-tracker-apply-move! ((arg0 angle-tracker) (arg1 float)) (let* ((f0-2 (* arg1 (-> arg0 speed) (seconds-per-frame))) (f0-3 (+ (-> arg0 value) f0-2))) @@ -530,9 +531,10 @@ mistycannon-missile-idle mistycannon-missile-in-water)) -(defmethod relocate ((this mistycannon-missile) (arg0 int)) - (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0)) - (the-as mistycannon-missile ((method-of-type process-drawable relocate) this arg0))) + +(defmethod relocate ((this mistycannon-missile) (offset int)) + (if (nonzero? (-> this part2)) (&+! (-> this part2) offset)) + (the-as mistycannon-missile ((method-of-type process-drawable relocate) this offset))) (defmethod deactivate ((this mistycannon-missile)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2))) @@ -720,10 +722,7 @@ (find-overlapping-shapes (-> self root) a1-3)) (suspend) (clear-collide-with-as (-> self root)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 3)) - (spawn (-> self part2) (-> self root trans)) - (suspend))) + (suspend-for (seconds 3) (spawn (-> self part2) (-> self root trans))) (kill-and-free-particles (-> self part2)) (deactivate self)) :post ja-post) @@ -748,6 +747,7 @@ (muzzle-time float) (blast-radius float))) + (defbehavior mistycannon-missile-init-by-other mistycannon-missile ((arg0 mistycannon-init-data) (arg1 entity-actor)) (logior! (-> self mask) (process-mask projectile)) (logclear! (-> self mask) (process-mask actor-pause)) @@ -829,6 +829,7 @@ mistycannon-waiting-for-player mistycannon-waiting-for-player-to-fuck-off)) + (defbehavior mistycannon-pick-random-target-point mistycannon () (let ((f30-0 (* (sqrtf (rand-vu)) (-> self center-point w))) (f28-1 (* 65536.0 (rand-vu)))) @@ -965,6 +966,7 @@ ((s1 float) (s2 float))) + (defun solve-missile-tilt ((arg0 quadratic-solution) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) (let* ((f1-3 (* 0.5 arg2 arg2 arg4)) (f0-3 f1-3) @@ -986,6 +988,7 @@ (speed float) (time float))) + (defun solve-missile-velocity ((arg0 trajectory-params) (arg1 float)) (set! (-> arg0 theta) arg1) (let ((f0-4 (* (- (* (-> arg0 x) (tan arg1)) (-> arg0 y)) (/ 2.0 (-> arg0 gravity))))) diff --git a/goal_src/jak1/levels/ogre/flying-lurker.gc b/goal_src/jak1/levels/ogre/flying-lurker.gc index 9e3528c249..f6185b2034 100644 --- a/goal_src/jak1/levels/ogre/flying-lurker.gc +++ b/goal_src/jak1/levels/ogre/flying-lurker.gc @@ -24,6 +24,7 @@ plunger-lurker-idle plunger-lurker-plunge)) + (defskelgroup *plunger-lurker-sg* plunger-lurker plunger-lurker-lod0-jg @@ -235,6 +236,7 @@ flying-lurker-sleep flying-lurker-start)) + (defskelgroup *flying-lurker-sg* flying-lurker flying-lurker-lod0-jg @@ -607,7 +609,7 @@ (process-release? *target*) (process-spawn-function process (lambda :behavior process () - (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 0.1)) (suspend))) + (suspend-for (seconds 0.1)) (level-hint-spawn (text-id ogre-race-hint) "asstvb24" (the-as entity #f) *entity-pool* (game-task none)) (none)) :to @@ -761,7 +763,7 @@ (if (= (get-task-status (game-task plunger-lurker-hit)) (task-status invalid)) (go flying-lurker-die)) (when (and *target* (>= 172032.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (process-grab? *target*) - (let ((s5-0 (current-time))) (until (time-elapsed? s5-0 (seconds 1)) (suspend))) + (suspend-for (seconds 1)) (process-release? *target*) (send-event self 'saw-player)) (suspend) diff --git a/goal_src/jak1/levels/ogre/ogreboss.gc b/goal_src/jak1/levels/ogre/ogreboss.gc index 4df1790955..142c6928ab 100644 --- a/goal_src/jak1/levels/ogre/ogreboss.gc +++ b/goal_src/jak1/levels/ogre/ogreboss.gc @@ -106,6 +106,7 @@ ogreboss-missile-impact ogreboss-missile-seek)) + (defstate ogreboss-missile-idle (ogreboss-missile) :enter (behavior () @@ -272,6 +273,7 @@ (blast-radius float) (pickup-type pickup-type))) + (defbehavior ogreboss-missile-init-by-other ogreboss-missile ((arg0 ogreboss-missile-init-data) (arg1 entity-actor)) (set! (-> self entity) arg1) (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) @@ -338,6 +340,7 @@ ogreboss-super-boulder-roll ogreboss-super-boulder-throw)) + (defbehavior ogreboss-super-boulder-event-handler ogreboss-super-boulder ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 ;; og:preserve-this PAL patch here @@ -532,9 +535,9 @@ (transform-post) 0)) -(defmethod relocate ((this ogreboss-super-boulder) (arg0 int)) - (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0)) - (call-parent-method this arg0)) +(defmethod relocate ((this ogreboss-super-boulder) (offset int)) + (if (nonzero? (-> this joint)) (&+! (-> this joint) offset)) + (call-parent-method this offset)) (defstate ogreboss-super-boulder-killed-player (ogreboss-super-boulder) :code @@ -594,6 +597,7 @@ (:states ogreboss-bounce-boulder-idle)) + (defbehavior ogreboss-bounce-boulder-event-handler ogreboss-bounce-boulder ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) @@ -722,6 +726,7 @@ ogreboss-stage3-throw ogreboss-wait-for-player)) + (defbehavior ogreboss-inc-try-count ogreboss () (when (not (-> self try-counted)) (set! (-> self try-counted) #t) @@ -757,7 +762,7 @@ (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe (the-as float 140.0) 0)))) - (let ((gp-2 (current-time))) (until (time-elapsed? gp-2 (seconds 0.167)) (suspend))) + (suspend-for (seconds 0.167)) (ja-no-eval :group! ogreboss-idle-ja :num! @@ -767,7 +772,7 @@ (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe (the-as float 168.0) 0)))) - (let ((gp-5 (current-time))) (until (time-elapsed? gp-5 (seconds 0.167)) (suspend))) + (suspend-for (seconds 0.167)) (ja-no-eval :group! ogreboss-idle-ja :num! (seek!) :frame-num (ja-aframe (the-as float 168.0) 0)) (until (ja-done? 0) (suspend) @@ -945,7 +950,7 @@ (ja :num! (seek! max arg1))))) (logior! (-> self draw status) (draw-status hidden)) (set! (-> self submerged) #t) - (let ((s5-1 (current-time))) (until (time-elapsed? s5-1 arg0) (suspend)))) + (suspend-for arg0)) 0 (none)) diff --git a/goal_src/jak1/levels/racer_common/racer-states.gc b/goal_src/jak1/levels/racer_common/racer-states.gc index bf8e93c85d..da70f948d9 100644 --- a/goal_src/jak1/levels/racer_common/racer-states.gc +++ b/goal_src/jak1/levels/racer_common/racer-states.gc @@ -718,7 +718,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((gp-6 (current-time))) (until (time-elapsed? gp-6 (seconds 2)) (suspend)))) + (suspend-for (seconds 2))) (('endlessfall) (sound-play "death-fall") (camera-change-to (the-as string cam-endlessfall) 30 #f) @@ -734,21 +734,19 @@ (vector+! (-> self control transv) (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2) (vector-float*! gp-8 gp-8 (/ f0-29 f1-9))))) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 0.75)) - (vector-seek! (-> self draw color-mult) *zero-vector* (* 1.5 (seconds-per-frame))) - (set-forward-vel (* 0.96 (-> self control unknown-float01))) - (let ((s5-3 (new-stack-vector0)) - (f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - 0.0 - (vector-! s5-3 (-> self control transv) (vector-float*! s5-3 (-> self control dynam gravity-normal) f28-0)) - (let* ((f0-38 (vector-length s5-3)) - (f1-12 f0-38)) - (if (< f30-0 f28-0) (set! f28-0 f30-0)) - (vector+! (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f28-0) - (vector-float*! s5-3 s5-3 (/ f0-38 f1-12))))) - (suspend)))) + (suspend-for (seconds 0.75) + (vector-seek! (-> self draw color-mult) *zero-vector* (* 1.5 (seconds-per-frame))) + (set-forward-vel (* 0.96 (-> self control unknown-float01))) + (let ((s5-3 (new-stack-vector0)) + (f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! s5-3 (-> self control transv) (vector-float*! s5-3 (-> self control dynam gravity-normal) f28-0)) + (let* ((f0-38 (vector-length s5-3)) + (f1-12 f0-38)) + (if (< f30-0 f28-0) (set! f28-0 f30-0)) + (vector+! (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f28-0) + (vector-float*! s5-3 s5-3 (/ f0-38 f1-12))))))) (camera-change-to (the-as string 'base) 0 #f))) (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self control unknown-float01) 0.0) @@ -871,15 +869,13 @@ (ja :chan 1 :group! eichar-racer-turn2-ja :num! (chan 0)) (ja :chan 2 :group! eichar-racer-dig-ja :num! (chan 0)) (ja :chan 3 :group! eichar-racer-dig2-ja :num! (chan 0))) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.5)) - (set! (-> self racer stick-lock) #t) - (set-forward-vel (* 0.9 (-> self control unknown-float01))) - (set! (-> self racer turn-anim-targ) 0.0) - (set! (-> self racer turn-anim-targ) 0.0) - (target-racing-turn-anim) - (seek! (-> self control unknown-vector11 y) 6144.0 (* 3.0 (seconds-per-frame))) - (suspend))) + (suspend-for (seconds 0.5) + (set! (-> self racer stick-lock) #t) + (set-forward-vel (* 0.9 (-> self control unknown-float01))) + (set! (-> self racer turn-anim-targ) 0.0) + (set! (-> self racer turn-anim-targ) 0.0) + (target-racing-turn-anim) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 3.0 (seconds-per-frame)))) (go target-racing-get-off-jump arg0)) :post target-racing-post) diff --git a/goal_src/jak1/levels/racer_common/racer.gc b/goal_src/jak1/levels/racer_common/racer.gc index 6fcdf7a54d..058737139a 100644 --- a/goal_src/jak1/levels/racer_common/racer.gc +++ b/goal_src/jak1/levels/racer_common/racer.gc @@ -30,10 +30,11 @@ (pickup (state collectable)) wait-for-return)) -(defmethod relocate ((this racer) (arg0 int)) + +(defmethod relocate ((this racer) (offset int)) (countdown (v1-0 2) - (if (-> this path-data v1-0) (&+! (-> this path-data v1-0) arg0))) - (the-as racer ((method-of-type process-drawable relocate) this arg0))) + (if (-> this path-data v1-0) (&+! (-> this path-data v1-0) offset))) + (the-as racer ((method-of-type process-drawable relocate) this offset))) (defskelgroup *racer-sg* racer @@ -219,7 +220,7 @@ (while (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) (racer-effect) (suspend)) - (let ((s5-0 (current-time))) (until (time-elapsed? s5-0 (seconds 1)) (racer-effect) (suspend))) + (suspend-for (seconds 1) (racer-effect)) (go arg0))) (defstate wait-for-return (racer) diff --git a/goal_src/jak1/levels/snow/snow-obs.gc b/goal_src/jak1/levels/snow/snow-obs.gc index 8c86148af1..f3d3bf3c56 100644 --- a/goal_src/jak1/levels/snow/snow-obs.gc +++ b/goal_src/jak1/levels/snow/snow-obs.gc @@ -12,6 +12,7 @@ (deftype snowcam (pov-camera) ((seq uint64))) + (defskelgroup *snowcam-sg* snowcam snowcam-lod0-jg @@ -42,7 +43,7 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 4.5)) (suspend)))) + (suspend-for (seconds 4.5))) ((= v1-0 1) (let ((gp-2 (ppointer->handle (process-spawn fuel-cell :init @@ -82,6 +83,7 @@ snow-eggtop-idle-down snow-eggtop-idle-up)) + (defskelgroup *snow-eggtop-sg* snow-eggtop snow-eggtop-lod0-jg @@ -370,6 +372,7 @@ (:states snowpusher-idle)) + (defskelgroup *snowpusher-sg* snowpusher snowpusher-lod0-jg @@ -451,6 +454,7 @@ (:states snow-spatula-idle)) + (defskelgroup *snow-spatula-sg* snow-spatula snow-spatula-lod0-jg @@ -525,6 +529,7 @@ snow-fort-gate-idle-closed snow-fort-gate-idle-open)) + (defskelgroup *snow-fort-gate-sg* snow-fort-gate snow-fort-gate-lod0-jg @@ -768,10 +773,10 @@ ((method-of-type process-drawable deactivate) this) (none)) -(defmethod relocate ((this snow-fort-gate) (arg0 int)) - (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0)) - (if (nonzero? (-> this part3)) (&+! (-> this part3) arg0)) - (call-parent-method this arg0)) +(defmethod relocate ((this snow-fort-gate) (offset int)) + (if (nonzero? (-> this part2)) (&+! (-> this part2) offset)) + (if (nonzero? (-> this part3)) (&+! (-> this part3) offset)) + (call-parent-method this offset)) (defmethod init-from-entity! ((this snow-fort-gate) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) @@ -817,6 +822,7 @@ snow-gears-idle snow-gears-stopped)) + (defskelgroup *snow-gears-sg* snow-gears snow-gears-lod0-jg @@ -981,6 +987,7 @@ snow-switch-idle-down snow-switch-idle-up)) + (defskelgroup *snow-switch-sg* snow-switch snow-switch-lod0-jg @@ -1120,6 +1127,7 @@ snow-log-hidden snow-log-wait-for-master)) + (defskelgroup *snow-log-sg* snow-log snow-log-lod0-jg @@ -1258,6 +1266,7 @@ snow-log-button-idle-down snow-log-button-idle-up)) + (defbehavior snow-log-button-event-handler snow-log-button ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-2 basic)) (case arg2 diff --git a/goal_src/jak1/levels/swamp/billy.gc b/goal_src/jak1/levels/swamp/billy.gc index 49db5ee9e7..6541815595 100644 --- a/goal_src/jak1/levels/swamp/billy.gc +++ b/goal_src/jak1/levels/swamp/billy.gc @@ -26,10 +26,11 @@ billy-done billy-playing)) -(defmethod relocate ((this billy) (arg0 int)) + +(defmethod relocate ((this billy) (offset int)) (countdown (v1-0 3) - (if (nonzero? (-> this path-data v1-0)) (&+! (-> this path-data v1-0) arg0))) - (call-parent-method this arg0)) + (if (nonzero? (-> this path-data v1-0)) (&+! (-> this path-data v1-0) offset))) + (call-parent-method this offset)) (deftype billy-snack (process-drawable) ((num-rats int32)) @@ -37,6 +38,7 @@ billy-snack-eat billy-snack-idle)) + (defskelgroup *farthy-snack-sg* farthy-snack farthy-snack-lod0-jg @@ -88,6 +90,7 @@ billy-rat-eat billy-rat-salivate)) + (defun rat-about-to-eat? ((arg0 billy-rat) (arg1 billy)) (the-as symbol (and (= (-> arg0 dest-type) 2) (> (-> arg1 num-snacks) 0) (handle->process (-> arg0 snack))))) @@ -152,7 +155,7 @@ :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 (t9-1))) + (call-parent-state-handler enter) (when (logtest? (nav-control-flags navcf19) (-> self nav flags)) (logclear! (-> self nav flags) (nav-control-flags navcf19)) (if (rat-about-to-eat? self (-> self billy 0)) diff --git a/goal_src/jak1/levels/swamp/swamp-rat.gc b/goal_src/jak1/levels/swamp/swamp-rat.gc index dfdbefb7a0..e0ed3f87c2 100644 --- a/goal_src/jak1/levels/swamp/swamp-rat.gc +++ b/goal_src/jak1/levels/swamp/swamp-rat.gc @@ -26,6 +26,7 @@ (:states swamp-rat-spawn)) + (defskelgroup *swamp-rat-sg* swamp-rat swamp-rat-lod0-jg @@ -183,13 +184,8 @@ swamp-rat-default-event-handler (ja :num! (seek! max f30-0))) (ja-no-eval :num! (loop!)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) - (let ((gp-0 (rand-vu-int-range 300 600)) - (s5-0 (current-time))) - (until (time-elapsed? s5-0 gp-0) - (ja :num-func num-func-identity :frame-num 0.0) - (ja-blend-eval) - (suspend) - (suspend))))))) + (let ((gp-0 (rand-vu-int-range 300 600))) + (suspend-for gp-0 (ja :num-func num-func-identity :frame-num 0.0) (ja-blend-eval) (suspend))))))) (defstate nav-enemy-give-up (swamp-rat) :virtual #t diff --git a/goal_src/jak1/levels/title/title-obs.gc b/goal_src/jak1/levels/title/title-obs.gc index aea57628e7..c9bfa92d81 100644 --- a/goal_src/jak1/levels/title/title-obs.gc +++ b/goal_src/jak1/levels/title/title-obs.gc @@ -24,9 +24,10 @@ hidden ndi)) -(defmethod relocate ((this logo) (arg0 int)) - (if (nonzero? (-> this main-joint)) (&+! (-> this main-joint) arg0)) - (the-as logo ((method-of-type process-drawable relocate) this arg0))) + +(defmethod relocate ((this logo) (offset int)) + (if (nonzero? (-> this main-joint)) (&+! (-> this main-joint) offset)) + (the-as logo ((method-of-type process-drawable relocate) this offset))) (deftype logo-slave (process-drawable) ((parent-process (pointer logo) :overlay-at parent) @@ -34,9 +35,10 @@ (:state-methods idle)) -(defmethod relocate ((this logo-slave) (arg0 int)) - (if (nonzero? (-> this main-joint)) (&+! (-> this main-joint) arg0)) - (the-as logo-slave ((method-of-type process-drawable relocate) this arg0))) + +(defmethod relocate ((this logo-slave) (offset int)) + (if (nonzero? (-> this main-joint)) (&+! (-> this main-joint) offset)) + (the-as logo-slave ((method-of-type process-drawable relocate) this offset))) (defskelgroup *logo-sg* logo @@ -324,7 +326,7 @@ (let ((gp-0 *master-mode*)) (set! *master-mode* 'game) (clear-rec *art-control*) (set! *master-mode* gp-0)) (loop (when (and (none-reserved? *art-control*) (not (paused?))) - (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 0.1)) (set! *camera-look-through-other* 2) (suspend))) + (suspend-for (seconds 0.1) (set! *camera-look-through-other* 2)) (go-virtual idle)) (set! *camera-look-through-other* 2) (suspend)))) @@ -534,7 +536,7 @@ (while (!= (file-status *art-control* "ndi-intro" 0) 'active) (set-blackout-frames (seconds 0.05)) (suspend)) - (let ((s5-1 (current-time))) (until (time-elapsed? s5-1 (seconds 0.25)) (set-blackout-frames (seconds 0.05)) (suspend))))) + (suspend-for (seconds 0.25) (set-blackout-frames (seconds 0.05))))) (label cfg-8) (let ((s5-2 (new 'stack-no-clear 'mc-slot-info))) (mc-get-slot-info 0 s5-2) @@ -560,7 +562,7 @@ (apply-settings *setting-control*) (while *progress-process* (suspend)) - (let ((gp-2 (current-time))) (until (time-elapsed? gp-2 (seconds 0.01)) (suspend))) + (suspend-for (seconds 0.01)) (goto cfg-41)))) (label cfg-41) (let ((gp-3 (entity-by-name "logo-1"))) diff --git a/goal_src/jak1/levels/training/training-obs.gc b/goal_src/jak1/levels/training/training-obs.gc index f762c7f3aa..c073fe525a 100644 --- a/goal_src/jak1/levels/training/training-obs.gc +++ b/goal_src/jak1/levels/training/training-obs.gc @@ -12,6 +12,7 @@ (deftype training-water (water-anim) ()) + (define ripple-for-training-water (new 'static 'ripple-wave-set @@ -54,9 +55,10 @@ (:state-methods idle)) -(defmethod relocate ((this training-cam) (arg0 int)) - (if (nonzero? (-> this root)) (&+! (-> this root) arg0)) - (the-as training-cam ((method-of-type process relocate) this arg0))) + +(defmethod relocate ((this training-cam) (offset int)) + (if (nonzero? (-> this root)) (&+! (-> this root) offset)) + (the-as training-cam ((method-of-type process relocate) this offset))) (defstate idle (training-cam) :virtual #t @@ -125,7 +127,7 @@ (when (not (task-complete? *game-info* (game-task training-climb))) (clear-text-seen! *game-info* (text-id training-double-jump)) (level-hint-spawn (text-id training-double-jump) "sagevb27" (the-as entity #f) *entity-pool* (game-task none)) - (let ((gp-8 (current-time))) (until (time-elapsed? gp-8 (seconds 30)) (suspend))) + (suspend-for (seconds 30)) (process-entity-status! self (entity-perm-status bit-3) #f) (go-virtual idle))))) (while (-> self child) @@ -154,6 +156,7 @@ (deftype tra-pontoon (rigid-body-platform) ((anchor-point vector :inline))) + (defmethod init-from-entity! ((this tra-pontoon) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (rigid-body-platform-method-30 this) @@ -254,6 +257,7 @@ (deftype tra-iris-door (eco-door) ()) + (defskelgroup *tra-iris-door-sg* jng-iris-door jng-iris-door-lod0-jg @@ -440,6 +444,7 @@ idle (hit float vector symbol))) + (deftype scarecrow-b (process-drawable) ((root collide-shape :override) (incomming-attack-id uint64) @@ -448,6 +453,7 @@ idle (hit float vector symbol))) + (defskelgroup *scarecrow-a-sg* scarecrow-a scarecrow-a-lod0-jg diff --git a/goal_src/jak1/levels/village1/fishermans-boat.gc b/goal_src/jak1/levels/village1/fishermans-boat.gc index e1cc6515ec..384971aeb2 100644 --- a/goal_src/jak1/levels/village1/fishermans-boat.gc +++ b/goal_src/jak1/levels/village1/fishermans-boat.gc @@ -42,6 +42,7 @@ ((local-pos vector :inline) (normal vector :inline))) + (deftype vehicle-path (structure) ((point-array vector 10 :inline) (point-count int32)) @@ -52,6 +53,7 @@ (add-point! (_type_ float float float float) none) (debug-draw (_type_) symbol))) + (defmethod get-point-count ((this vehicle-path)) (-> this point-count)) @@ -215,8 +217,9 @@ (vehicle-controller-method-15 (_type_ collide-shape-moving) none) (vehicle-controller-method-16 (_type_) none))) -(defmethod relocate ((this vehicle-controller) (arg0 int)) - (if (nonzero? (-> this path)) (&+! (-> this path) arg0)) + +(defmethod relocate ((this vehicle-controller) (offset int)) + (if (nonzero? (-> this path)) (&+! (-> this path) offset)) (the-as vehicle-controller 0)) (defmethod vehicle-controller-method-12 ((this vehicle-controller) (arg0 int) (arg1 vector)) @@ -398,6 +401,7 @@ fishermans-boat-ride-to-misty fishermans-boat-ride-to-village1)) + (defskelgroup *fishermans-boat-sg* fishermans-boat fishermans-boat-lod0-jg @@ -924,21 +928,17 @@ (suspend)) (vector-z-quaternion! gp-0 (-> self root-overlay quat)) (vehicle-controller-method-10 (-> self controller) gp-0 (-> self controller throttle) s5-0) - (let ((s3-0 (current-time))) - (until (time-elapsed? s3-0 (seconds 1)) - (fishermans-boat-set-throttle-by-speed f30-0) - (suspend) - (suspend)))) + (suspend-for (seconds 1) (fishermans-boat-set-throttle-by-speed f30-0) (suspend))) (vector-z-quaternion! gp-0 (-> self root-overlay quat)) (vehicle-controller-method-10 (-> self controller) gp-0 (-> self controller throttle) s5-0) (+! s5-0 1))) (go fishermans-boat-player-control)) :post fishermans-boat-post) -(defmethod relocate ((this fishermans-boat) (arg0 int)) - (relocate (-> this controller) arg0) - (if (nonzero? (-> this propeller)) (&+! (-> this propeller) arg0)) - (call-parent-method this arg0)) +(defmethod relocate ((this fishermans-boat) (offset int)) + (relocate (-> this controller) offset) + (if (nonzero? (-> this propeller)) (&+! (-> this propeller) offset)) + (call-parent-method this offset)) (defmethod rigid-body-platform-method-30 ((this fishermans-boat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) @@ -1115,7 +1115,7 @@ (apply-settings *setting-control*) (process-spawn-function process (lambda :behavior fishermans-boat () - (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 1)) (suspend))) + (suspend-for (seconds 1)) (while (or (-> *setting-control* current ambient) (-> *setting-control* current hint) (-> *setting-control* current movie)) (suspend)) (suspend) diff --git a/goal_src/jak1/levels/village2/sunken-elevator.gc b/goal_src/jak1/levels/village2/sunken-elevator.gc index b00ea0f2a0..e6c99a6054 100644 --- a/goal_src/jak1/levels/village2/sunken-elevator.gc +++ b/goal_src/jak1/levels/village2/sunken-elevator.gc @@ -11,6 +11,7 @@ (teleport-if-below-y float) (teleport-if-above-y float))) + (defskelgroup *sunken-elevator-sg* sunken-elevator sunken-elevator-lod0-jg @@ -99,7 +100,7 @@ (gp-0 (new 'stack-no-clear 'vector))) (set! *teleport* #t) (set! (-> s5-0 quad) (-> self root trans quad)) - (let ((t9-1 (-> (find-parent-state) trans))) (if t9-1 (t9-1))) + (call-parent-state-handler trans) (vector-! gp-0 (-> self root trans) s5-0) (when (< (-> self path-pos) 0.9) (move-by-vector! (-> *target* control) gp-0) diff --git a/goal_src/jak1/levels/village2/village2-obs.gc b/goal_src/jak1/levels/village2/village2-obs.gc index b8831fea79..413a305ea9 100644 --- a/goal_src/jak1/levels/village2/village2-obs.gc +++ b/goal_src/jak1/levels/village2/village2-obs.gc @@ -10,6 +10,7 @@ (deftype village2cam (pov-camera) ((seq uint64))) + (defskelgroup *village2cam-sg* village2cam village2cam-lod0-jg @@ -76,6 +77,7 @@ pontoon-die pontoon-hidden)) + (defstate pontoon-hidden (pontoon) :enter (behavior () @@ -193,8 +195,10 @@ (deftype pontoonfive (pontoon) ()) + (deftype pontoonten (pontoon) ()) + (defskelgroup *pontoonfive-sg* pontoonfive pontoonfive-lod0-jg @@ -375,6 +379,7 @@ (:states (allpontoons-be-clone handle) allpontoons-idle)) + (defskelgroup *allpontoons-sg* allpontoons allpontoons-lod0-jg @@ -443,6 +448,7 @@ fireboulder-hover fireboulder-idle)) + (defskelgroup *fireboulder-sg* fireboulder fireboulder-lod0-jg @@ -621,6 +627,7 @@ (:states ceilingflag-idle)) + (defskelgroup *ceilingflag-sg* ceilingflag ceilingflag-geo-jg @@ -654,6 +661,7 @@ exit-chamber-dummy-idle exit-chamber-dummy-wait-to-appear)) + (defskelgroup *exit-chamber-dummy-sg* exit-chamber-dummy exit-chamber-dummy-lod0-jg @@ -723,6 +731,7 @@ ogreboss-village2-idle ogreboss-village2-throw)) + (defskelgroup *ogreboss-village2-sg* ogreboss-village2 ogreboss-village2-lod0-jg @@ -1054,12 +1063,12 @@ (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe 140.0 0)))) - (let ((gp-2 (current-time))) (until (time-elapsed? gp-2 (seconds 0.167)) (suspend))) + (suspend-for (seconds 0.167)) (ja-no-eval :group! ogreboss-village2-idle-ja :num! (seek! (ja-aframe 168.0 0)) :frame-num (ja-aframe 140.0 0)) (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe 168.0 0)))) - (let ((gp-5 (current-time))) (until (time-elapsed? gp-5 (seconds 0.167)) (suspend))) + (suspend-for (seconds 0.167)) (ja-no-eval :group! ogreboss-village2-idle-ja :num! (seek!) :frame-num (ja-aframe 168.0 0)) (until (ja-done? 0) (suspend) @@ -1116,8 +1125,10 @@ (deftype villageb-ogreboss (ogreboss-village2) ()) + (deftype villageb-water (water-anim) ()) + (define ripple-for-villageb-water (new 'static 'ripple-wave-set diff --git a/goal_src/jak1/levels/village_common/villagep-obs.gc b/goal_src/jak1/levels/village_common/villagep-obs.gc index bca52f2023..c1c14d6032 100644 --- a/goal_src/jak1/levels/village_common/villagep-obs.gc +++ b/goal_src/jak1/levels/village_common/villagep-obs.gc @@ -11,6 +11,7 @@ (deftype warpgate (process-hidden) ()) + (defstate target-warp-in (target) :event target-generic-event-handler :enter @@ -31,7 +32,7 @@ (ja-channel-set! 0) (vector-reset! (-> self control transv)) (move-to-point! (-> self control) (-> self control unknown-vector102)) - (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 1)) (suspend))) + (suspend-for (seconds 1)) (let ((gp-1 (new-stack-vector0))) (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) 0.0 @@ -270,6 +271,7 @@ (:methods (pressable? (_type_) symbol))) + (defskelgroup *warp-gate-switch-sg* warp-gate-switch warp-gate-switch-lod0-jg @@ -484,9 +486,10 @@ (:state-methods idle)) -(defmethod relocate ((this village-cam) (arg0 int)) - (if (nonzero? (-> this root-override)) (&+! (-> this root-override) arg0)) - (the-as village-cam ((method-of-type process relocate) this arg0))) + +(defmethod relocate ((this village-cam) (offset int)) + (if (nonzero? (-> this root-override)) (&+! (-> this root-override) offset)) + (the-as village-cam ((method-of-type process relocate) this offset))) (defstate idle (village-cam) :virtual #t @@ -627,7 +630,7 @@ (let ((a0-70 (-> self entity extra perm))) (when (= (-> a0-70 user-uint8 0) 1) (remove-setting! 'allow-progress) - (let ((gp-3 (current-time))) (until (time-elapsed? gp-3 (seconds 300)) (suspend))) + (suspend-for (seconds 300)) (go-virtual idle)))) (process-entity-status! self (entity-perm-status bit-3) #f) (process-entity-status! self (entity-perm-status dead) #t) diff --git a/goal_src/jak2/engine/ambient/ambient.gc b/goal_src/jak2/engine/ambient/ambient.gc index ce996c5ff1..2c79157a32 100644 --- a/goal_src/jak2/engine/ambient/ambient.gc +++ b/goal_src/jak2/engine/ambient/ambient.gc @@ -121,7 +121,7 @@ (defmethod play-communicator-speech! ((this talker-speech-class)) "Plays the provided [[talker-speech-class]] -@TODO - understand the array from [[game-info]] better" + @TODO - understand the array from [[game-info]] better" (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) (the-as uint #xffff)) 0 (none) @@ -258,6 +258,7 @@ ) (defmethod deactivate ((this talker)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (send-event (handle->process (-> this voicebox)) 'die) (call-parent-method this) (none) @@ -346,11 +347,7 @@ (defstate idle (talker) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (the-as time-frame (-> self message delay))) - (suspend) - ) - ) + (suspend-for (the-as time-frame (-> self message delay))) (case (-> self message channel) (((gui-channel voicebox)) (if *target* @@ -477,7 +474,10 @@ (and (nonzero? (-> self message-id)) (= (get-status *gui-control* (-> self message-id)) (gui-status active)) (or (not (time-elapsed? (-> self state-time) (the-as time-frame (-> self message text-duration)))) - (and (logtest? (-> self message flags) 16) (-> self region) (point-in-region-debug! (-> self region) (target-pos 0))) + (and (logtest? (-> self message flags) 16) + (-> self region) + (point-in-region-debug! (-> self region) (target-pos 0)) + ) ) ) (not (time-elapsed? (-> self state-time) (seconds 0.05))) @@ -512,11 +512,7 @@ ) ) (when (and (logtest? (-> self message flags) 8) (not (-> self save?))) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (set! (-> self save?) #t) (auto-save-user) ) diff --git a/goal_src/jak2/engine/common_objs/crates.gc b/goal_src/jak2/engine/common_objs/crates.gc index b8b5d2bc4a..47ba40fb96 100644 --- a/goal_src/jak2/engine/common_objs/crates.gc +++ b/goal_src/jak2/engine/common_objs/crates.gc @@ -841,11 +841,7 @@ ) ) (when (not arg0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.04)) - (suspend) - ) - ) + (suspend-for (seconds 0.04)) (logior! (-> self draw status) (draw-control-status no-draw)) (case (-> self look) (('iron) @@ -996,17 +992,9 @@ (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) arg1) (process-entity-status! self (entity-perm-status dead) #t) (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 5)) - (suspend) - ) - ) + (suspend-for (seconds 5)) (when (logtest? (actor-option cond-respawn) (-> self fact options)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 15)) - (suspend) - ) - ) + (suspend-for (seconds 15)) (go-virtual hide) ) ) @@ -1104,11 +1092,11 @@ (defmethod init-from-entity! ((this crate) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (crate-init! this arg0) (skel-init! this) (crate-method-38 this) diff --git a/goal_src/jak2/engine/common_objs/generic-obs.gc b/goal_src/jak2/engine/common_objs/generic-obs.gc index 3b371cdc8f..7ac5e5c882 100644 --- a/goal_src/jak2/engine/common_objs/generic-obs.gc +++ b/goal_src/jak2/engine/common_objs/generic-obs.gc @@ -229,12 +229,7 @@ (move-along-path self) (suspend) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (move-along-path self) - (suspend) - ) - ) + (suspend-for (seconds 0.5) (move-along-path self)) (go-virtual idle) ) ) @@ -242,11 +237,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this swingpole) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" "Copy defaults from the entity." (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) @@ -339,11 +334,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this process-hidden) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" "Copy defaults from the entity." (process-entity-status! this (entity-perm-status dead) #t) (go (method-of-object this die)) @@ -1020,6 +1015,7 @@ This commonly includes things such as: ) (defmethod deactivate ((this part-tracker)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) @@ -1091,28 +1087,26 @@ This commonly includes things such as: ) (suspend) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (the-as time-frame (-> self linger-duration))) - (if (-> self linger-callback) - ((-> self linger-callback) self) - ) - (let* ((s5-0 (handle->process (-> self target))) - (v1-30 (if (type? s5-0 process-drawable) - s5-0 - ) - ) - ) - (if (and v1-30 - (nonzero? (-> (the-as process-drawable v1-30) root)) - (nonzero? (-> (the-as process-drawable v1-30) node-list)) - ) - (vector<-cspace! - (-> self root trans) - (-> (the-as process-drawable v1-30) node-list data (-> self target-joint)) - ) - ) + (suspend-for + (the-as time-frame (-> self linger-duration)) + (if (-> self linger-callback) + ((-> self linger-callback) self) ) - (suspend) + (let* ((s5-0 (handle->process (-> self target))) + (v1-30 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (if (and v1-30 + (nonzero? (-> (the-as process-drawable v1-30) root)) + (nonzero? (-> (the-as process-drawable v1-30) node-list)) + ) + (vector<-cspace! + (-> self root trans) + (-> (the-as process-drawable v1-30) node-list data (-> self target-joint)) + ) + ) ) ) (if (-> self linger-callback) @@ -1736,11 +1730,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this med-res-level) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (res-lump-struct arg0 'art-name structure)) (s3-0 (res-lump-struct (-> this entity) 'level structure)) @@ -1763,6 +1757,7 @@ This commonly includes things such as: ) (defmethod deactivate ((this part-spawner)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) @@ -1817,11 +1812,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this part-spawner) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 string)) (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask ambient)) @@ -2422,11 +2417,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this launcher) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) diff --git a/goal_src/jak2/engine/common_objs/powerups.gc b/goal_src/jak2/engine/common_objs/powerups.gc index c9117b70f8..c415c8a0de 100644 --- a/goal_src/jak2/engine/common_objs/powerups.gc +++ b/goal_src/jak2/engine/common_objs/powerups.gc @@ -20,25 +20,23 @@ (let ((s1-1 (process->handle arg0)) (s2-1 (process->handle arg1)) ) - (let ((s0-0 (current-time))) - (until (time-elapsed? s0-0 (+ arg3 arg4)) - (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) - (if v1-8 - (deactivate self) - ) - ) - (let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) s0-0)) (the float arg3)) (the float arg4))))) - (a0-18 (process-drawable-pair-random-point! - (the-as process-drawable (-> s1-1 process 0)) - (the-as process-drawable (-> s2-1 process 0)) - (new-stack-vector0) - f0-1 - ) + (suspend-for + (+ arg3 arg4) + (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) + (if v1-8 + (deactivate self) + ) + ) + (let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) time)) (the float arg3)) (the float arg4))))) + (a0-18 (process-drawable-pair-random-point! + (the-as process-drawable (-> s1-1 process 0)) + (the-as process-drawable (-> s2-1 process 0)) + (new-stack-vector0) + f0-1 ) - ) - (arg2 a0-18) - ) - (suspend) + ) + ) + (arg2 a0-18) ) ) (cond @@ -49,12 +47,10 @@ #f ) (else - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 arg5) - (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) - (arg2 a0-21) - ) - (suspend) + (suspend-for + arg5 + (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) + (arg2 a0-21) ) ) ) diff --git a/goal_src/jak2/engine/game/task/task-control.gc b/goal_src/jak2/engine/game/task/task-control.gc index 300fce410e..62fa1873a4 100644 --- a/goal_src/jak2/engine/game/task/task-control.gc +++ b/goal_src/jak2/engine/game/task/task-control.gc @@ -1481,6 +1481,7 @@ (defmethod run-logic? ((this fail-mission)) + "Should this process be run? Checked by execute-process-tree." #t ) @@ -1676,6 +1677,7 @@ ) (defmethod deactivate ((this fail-mission)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (set-filter-color! 1.0 1.0 1.0) (sound-group-continue (sound-group sfx music dialog sog3 ambient dialog2 sog6 sog7)) (update-rates! (-> *display* bg-clock) 1.0) @@ -1713,27 +1715,25 @@ ) :code (behavior () (local-vars (a1-10 string)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (let ((f30-0 (lerp-scale 1.0 0.0 (the float (- (current-time) gp-0)) 0.0 270.0))) - (when *sound-player-enable* - (let ((v1-6 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) - (set! (-> v1-6 command) (sound-command set-param)) - (set! (-> v1-6 id) (-> self stinger)) - (set! (-> v1-6 params volume) (the int (* 1024.0 f30-0))) - (set! (-> v1-6 params mask) (the-as uint 1)) - (-> v1-6 id) - ) + (suspend-for + (seconds 1) + (let ((f30-0 (lerp-scale 1.0 0.0 (the float (- (current-time) time)) 0.0 270.0))) + (when *sound-player-enable* + (let ((v1-6 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-6 command) (sound-command set-param)) + (set! (-> v1-6 id) (-> self stinger)) + (set! (-> v1-6 params volume) (the int (* 1024.0 f30-0))) + (set! (-> v1-6 params mask) (the-as uint 1)) + (-> v1-6 id) ) ) - (let ((f30-1 (lerp-scale 1.0 0.0 (the float (- (current-time) gp-0)) 0.0 300.0))) - (set-filter-color! - (lerp-scale 1.0 1.25 f30-1 0.0 1.0) - (lerp-scale 1.0 0.875 f30-1 0.0 1.0) - (lerp-scale 1.0 0.25 f30-1 0.0 1.0) - ) + ) + (let ((f30-1 (lerp-scale 1.0 0.0 (the float (- (current-time) time)) 0.0 300.0))) + (set-filter-color! + (lerp-scale 1.0 1.25 f30-1 0.0 1.0) + (lerp-scale 1.0 0.875 f30-1 0.0 1.0) + (lerp-scale 1.0 0.25 f30-1 0.0 1.0) ) - (suspend) ) ) (case (-> self message) @@ -1866,15 +1866,16 @@ ) ;; WARN: Return type mismatch process vs task-manager. -(defmethod relocate ((this task-manager) (arg0 int)) +(defmethod relocate ((this task-manager) (offset int)) (if (nonzero? (-> this link)) - (+! (-> this link) arg0) + (+! (-> this link) offset) ) - (the-as task-manager ((method-of-type process relocate) this arg0)) + (the-as task-manager ((method-of-type process relocate) this offset)) ) (defbehavior task-manager-init-by-other task-manager ((arg0 game-task-node-info) (arg1 symbol)) - (stack-size-set! (-> self main-thread) 3072) ;; increased from 1024 + ;; og:preserve-this increased from 1024 + (stack-size-set! (-> self main-thread) 3072) (add-connection *task-manager-engine* self nothing self arg0 #f) (set! (-> self node-info) arg0) (set! (-> self lev-name) arg1) @@ -1951,6 +1952,7 @@ ) (defmethod deactivate ((this task-manager)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (with-pp (let ((s5-0 pp)) (set! pp this) diff --git a/goal_src/jak2/engine/process-drawable/process-taskable.gc b/goal_src/jak2/engine/process-drawable/process-taskable.gc index 0bdacc82eb..05e1d8baea 100644 --- a/goal_src/jak2/engine/process-drawable/process-taskable.gc +++ b/goal_src/jak2/engine/process-drawable/process-taskable.gc @@ -8,17 +8,17 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch process-focusable vs process-taskable. -(defmethod relocate ((this process-taskable) (arg0 int)) +(defmethod relocate ((this process-taskable) (offset int)) (if (nonzero? (-> this task)) - (&+! (-> this task) arg0) + (&+! (-> this task) offset) ) - (the-as process-taskable ((method-of-type process-focusable relocate) this arg0)) + (the-as process-taskable ((method-of-type process-focusable relocate) this offset)) ) (defbehavior process-taskable-anim-loop process-taskable ((arg0 (function process-taskable object))) "Takes in a function and loops as long as it's return value is truthy -Seen take in - `true-func` which takes no args TODO - seems fishy -- a `(process-taskable process) lambda" + Seen take in - `true-func` which takes no args TODO - seems fishy + - a `(process-taskable process) lambda" (while (arg0 self) (let ((s5-0 (get-art-elem self))) (when (!= (ja-group) s5-0) @@ -43,7 +43,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ;; WARN: Return type mismatch art-joint-anim vs art-element. (defmethod get-art-elem ((this process-taskable)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use -@returns the appropriate [[art-element]] for the given NPC" + @returns the appropriate [[art-element]] for the given NPC" (the-as art-element (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) ) @@ -329,11 +329,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy :enter (-> (method-of-type process-taskable active) enter) :exit (-> (method-of-type process-taskable active) exit) :code (behavior ((arg0 game-task-event)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (go-virtual hide) ) :post (-> (method-of-type process-taskable idle) post) @@ -418,11 +414,11 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this process-taskable) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (stack-size-set! (-> this main-thread) 512) (process-taskable-method-31 this) (process-drawable-from-entity! this arg0) diff --git a/goal_src/jak2/engine/target/board/board-states.gc b/goal_src/jak2/engine/target/board/board-states.gc index 019aeab673..86c17d80dc 100644 --- a/goal_src/jak2/engine/target/board/board-states.gc +++ b/goal_src/jak2/engine/target/board/board-states.gc @@ -2973,11 +2973,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (move-to-point! (-> self control) s4-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) 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 89f19bb40d..41a36a67c2 100644 --- a/goal_src/jak2/engine/target/gun/gun-dark-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-dark-shot.gc @@ -642,15 +642,19 @@ (set! (-> gp-1 penetrate-using) (penetrate explode)) (explosion-spawn (the-as process-drawable *default-pool*) explosion gp-1) ) - ;; og:preserve-this stack array -> pointer - (let (;(s3-0 (the-as (array collide-shape) (new 'stack 'array collide-shape 16))) - (s3-0 (the-as (pointer collide-shape) (new 'stack-no-clear 'array 'collide-shape 16))) + (let ((s3-0 (the-as (array collide-shape) ((method-of-type array new) + (the-as symbol (new 'stack-no-clear 'array 'collide-shape 16)) + array + collide-shape + 16 + ) + ) + ) (a1-8 (new 'stack-no-clear 'sphere)) ) (set! (-> a1-8 quad) (-> self root trans quad)) (set! (-> a1-8 r) (-> self blast-radius)) - ;; og:preserve-this stack array -> pointer - (let ((gp-2 (fill-actor-list-for-sphere *actor-hash* a1-8 s3-0 16))) + (let ((gp-2 (fill-actor-list-for-sphere *actor-hash* a1-8 (-> s3-0 data) (-> s3-0 allocated-length)))) (let ((s1-0 (the-as process-drawable #f)) (f30-0 4096000.0) (s4-0 0) @@ -816,11 +820,7 @@ (-> self result-array (+ gp-2 -1)) :to s4-1 ) - (let ((s4-2 (current-time))) - (until (time-elapsed? s4-2 (seconds 0.1)) - (suspend) - ) - ) + (suspend-for (seconds 0.1)) ) ) ) diff --git a/goal_src/jak2/engine/target/mech/mech-states.gc b/goal_src/jak2/engine/target/mech/mech-states.gc index 54fae7e6b7..58119ea312 100644 --- a/goal_src/jak2/engine/target/mech/mech-states.gc +++ b/goal_src/jak2/engine/target/mech/mech-states.gc @@ -1002,11 +1002,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (move-to-point! (-> self control) s4-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) @@ -1141,12 +1137,7 @@ ) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-mech-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.8)) - (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.8) (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5))) (remove-setting! 'mode-name) ) (else @@ -1266,11 +1257,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) ) (set! (-> self control transv quad) (the-as uint128 0)) diff --git a/goal_src/jak2/engine/target/mech/mech.gc b/goal_src/jak2/engine/target/mech/mech.gc index a9b77cfe67..eca8b3f4bf 100644 --- a/goal_src/jak2/engine/target/mech/mech.gc +++ b/goal_src/jak2/engine/target/mech/mech.gc @@ -237,12 +237,7 @@ (mech-method-24 self) (suspend) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (mech-method-24 self) - (suspend) - ) - ) + (suspend-for (seconds 1) (mech-method-24 self)) (go arg0) ) ) @@ -351,11 +346,11 @@ (defmethod init-from-entity! ((this mech) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (mech-init arg0 (the-as matrix3 #f) (the-as handle #f) 100.0) (none) ) diff --git a/goal_src/jak2/engine/target/target-death.gc b/goal_src/jak2/engine/target/target-death.gc index d3225d1ef1..73756f24a2 100644 --- a/goal_src/jak2/engine/target/target-death.gc +++ b/goal_src/jak2/engine/target/target-death.gc @@ -310,11 +310,7 @@ ) ) ) - (let ((s5-6 (current-time))) - (until (time-elapsed? s5-6 (seconds 0.05)) - (suspend) - ) - ) + (suspend-for (seconds 0.05)) ) ((logtest? (-> arg0 flags) (continue-flags title)) (go target-title #t) @@ -337,11 +333,7 @@ (intro-play) ) ((logtest? (-> arg0 flags) (continue-flags warp-gate)) - (let ((s5-7 (current-time))) - (until (time-elapsed? s5-7 (seconds 0.05)) - (suspend) - ) - ) + (suspend-for (seconds 0.05)) (let ((s5-8 (new 'static 'vector)) (a2-26 (find-nearest-entity (-> arg0 trans) warp-gate)) ) @@ -370,11 +362,7 @@ (go target-grab 'stance) ) (else - (let ((s5-9 (current-time))) - (until (time-elapsed? s5-9 (seconds 0.05)) - (suspend) - ) - ) + (suspend-for (seconds 0.05)) ) ) (let* ((a0-122 *game-info*) @@ -1025,11 +1013,7 @@ (let ((gp-1 (new-stack-vector0))) (set! (-> gp-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (move-to-point! (-> self control) gp-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) @@ -1644,11 +1628,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((s5-3 (current-time))) - (until (time-elapsed? s5-3 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (b! #t cfg-131 :delay (nop!)) (label cfg-79) (b! (not (or (= v1-63 'grenade) (= v1-63 'big-explosion) (= v1-63 'explode))) cfg-122 :delay (empty-form)) @@ -1759,11 +1739,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((s5-7 (current-time))) - (until (time-elapsed? s5-7 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) (b! #t cfg-131 :delay (nop!)) (label cfg-122) @@ -1812,11 +1788,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((s5-10 (current-time))) - (until (time-elapsed? s5-10 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) ) (label cfg-131) @@ -1832,11 +1804,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((s5-11 (current-time))) - (until (time-elapsed? s5-11 (seconds 1.2)) - (suspend) - ) - ) + (suspend-for (seconds 1.2)) ) ((= v1-50 'endlessfall) ((lambda :behavior target @@ -1874,38 +1842,36 @@ (target-falling-anim 30 (seconds 0.33)) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.8)) - (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) - (set! v1-24 'target-hit-ground-hard) - (goto cfg-17) - ) - (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) - (let ((v1-49 (new-stack-vector0)) - (f0-7 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - ) - 0.0 - (vector-! - v1-49 - (-> self control transv) - (vector-float*! v1-49 (-> self control dynam gravity-normal) (the-as float f0-7)) - ) - (let* ((f1-7 (vector-length v1-49)) - (f2-2 f1-7) - ) - (if (< (the-as float (-> self control unknown-word04)) (the-as float f0-7)) - (set! f0-7 (-> self control unknown-word04)) - ) - (vector+! - (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f0-7)) - (vector-float*! v1-49 v1-49 (/ f1-7 f2-2)) - ) - ) - ) - (ja :group! jakb-launch-jump-loop-ja :num! (loop! 0.5)) - (suspend) + (suspend-for + (seconds 0.8) + (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) + (set! v1-24 'target-hit-ground-hard) + (goto cfg-17) ) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) + (let ((v1-49 (new-stack-vector0)) + (f0-7 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + ) + 0.0 + (vector-! + v1-49 + (-> self control transv) + (vector-float*! v1-49 (-> self control dynam gravity-normal) (the-as float f0-7)) + ) + (let* ((f1-7 (vector-length v1-49)) + (f2-2 f1-7) + ) + (if (< (the-as float (-> self control unknown-word04)) (the-as float f0-7)) + (set! f0-7 (-> self control unknown-word04)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f0-7)) + (vector-float*! v1-49 v1-49 (/ f1-7 f2-2)) + ) + ) + ) + (ja :group! jakb-launch-jump-loop-ja :num! (loop! 0.5)) ) (set! v1-24 #f) (label cfg-17) @@ -1920,11 +1886,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) (remove-setting! 'mode-name) (none) @@ -2013,11 +1975,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((s5-13 (current-time))) - (until (time-elapsed? s5-13 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) ((= v1-50 'centipede) (set! (-> self trans-hook) #f) diff --git a/goal_src/jak2/engine/target/target-turret.gc b/goal_src/jak2/engine/target/target-turret.gc index 7dd3d86b8c..ac3aa17b76 100644 --- a/goal_src/jak2/engine/target/target-turret.gc +++ b/goal_src/jak2/engine/target/target-turret.gc @@ -714,13 +714,13 @@ ;; WARN: Return type mismatch process-drawable vs base-turret. -(defmethod relocate ((this base-turret) (arg0 int)) +(defmethod relocate ((this base-turret) (offset int)) (countdown (v1-0 4) (if (-> this gun-recoil-jmod v1-0) - (&+! (-> this gun-recoil-jmod v1-0) arg0) + (&+! (-> this gun-recoil-jmod v1-0) offset) ) ) - (the-as base-turret ((method-of-type process-drawable relocate) this arg0)) + (the-as base-turret ((method-of-type process-drawable relocate) this offset)) ) (defmethod base-turret-method-34 ((this base-turret) (arg0 process)) @@ -1457,11 +1457,7 @@ (sound-stop (-> self sound-id 1)) (sound-stop (-> self sound-id 2)) (set! (-> self focus-status) (focus-status disable ignore inactive)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.8)) - (suspend) - ) - ) + (suspend-for (seconds 0.8)) (send-event (handle->process (-> self rider)) 'attack @@ -1979,6 +1975,7 @@ ) (defmethod deactivate ((this base-turret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (valid? (-> this hud) (the-as type #f) "" #t 0) (send-event (handle->process (-> this hud)) 'hide-and-die) ) @@ -1992,11 +1989,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this base-turret) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (turret-init! this arg0 (the-as matrix #f)) (go (method-of-object this idle)) (none) diff --git a/goal_src/jak2/engine/target/target2.gc b/goal_src/jak2/engine/target/target2.gc index c8d777a003..13f2b540ac 100644 --- a/goal_src/jak2/engine/target/target2.gc +++ b/goal_src/jak2/engine/target/target2.gc @@ -50,13 +50,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.3)) - (suspend) - (ja :num! (seek! (ja-aframe 19.0 0) 0.05)) - (suspend) - ) - ) + (suspend-for (seconds 0.3) (suspend) (ja :num! (seek! (ja-aframe 19.0 0) 0.05))) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-painful-land-ja :num! (seek!) :frame-num (ja-aframe 40.0 0)) (until (ja-done? 0) @@ -1202,12 +1196,7 @@ (until #f (let ((s5-0 (rand-vu-int-range 30 600))) (ja :group! jakb-wall-hide-head-ja) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 s5-0) - (gp-0) - (suspend) - ) - ) + (suspend-for s5-0 (gp-0)) ) (let ((f30-0 (rand-vu-float-range 0.5 1.5))) (cond @@ -1244,13 +1233,8 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (let ((s5-2 (rand-vu-int-range 60 300)) - (s4-2 (current-time)) - ) - (until (time-elapsed? s4-2 s5-2) - (gp-0) - (suspend) - ) + (let ((s5-2 (rand-vu-int-range 60 300))) + (suspend-for s5-2 (gp-0)) ) (ja-no-eval :group! jakb-wall-hide-head-left-ja :num! (seek! 0.0 f30-0) :frame-num max) (until (ja-done? 0) @@ -1266,13 +1250,8 @@ (suspend) (ja :num! (seek! 0.0 f30-0)) ) - (let ((s5-3 (rand-vu-int-range 60 300)) - (s4-3 (current-time)) - ) - (until (time-elapsed? s4-3 s5-3) - (gp-0) - (suspend) - ) + (let ((s5-3 (rand-vu-int-range 60 300))) + (suspend-for s5-3 (gp-0)) ) (ja-no-eval :group! jakb-wall-hide-head-right-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak2/kernel/gkernel-h.gc b/goal_src/jak2/kernel/gkernel-h.gc index 75bae685cd..6fa57f50ff 100644 --- a/goal_src/jak2/kernel/gkernel-h.gc +++ b/goal_src/jak2/kernel/gkernel-h.gc @@ -724,3 +724,6 @@ (defmacro time-elapsed? (time duration) `(>= (- (current-time) ,time) ,duration) ) + +(defmacro suspend-for (time &rest body) + `(let ((time (current-time))) (until (time-elapsed? time ,time) ,@body (suspend)))) \ No newline at end of file diff --git a/goal_src/jak2/kernel/gstate.gc b/goal_src/jak2/kernel/gstate.gc index 811b74ce6c..db94c4fb61 100644 --- a/goal_src/jak2/kernel/gstate.gc +++ b/goal_src/jak2/kernel/gstate.gc @@ -252,6 +252,12 @@ It type checks the arguments for the entry function. ) ) +(defmacro call-parent-state-handler (handler &key (type (function none)) &rest args) + "Call the parent handler for this state." + `(let ((handler (-> (find-parent-state) ,handler))) + (if handler ((the ,type handler) ,@args)) + ) + ) (defmacro behavior (bindings &rest body) "Define an anonymous behavior for a process state. This may only be used inside a defstate!" diff --git a/goal_src/jak2/levels/atoll/atoll-obs.gc b/goal_src/jak2/levels/atoll/atoll-obs.gc index 6f309b865b..f1b0e376c0 100644 --- a/goal_src/jak2/levels/atoll/atoll-obs.gc +++ b/goal_src/jak2/levels/atoll/atoll-obs.gc @@ -112,6 +112,7 @@ ) (defmethod deactivate ((this piston)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this looping-id)) ((method-of-type process-focusable deactivate) this) (none) @@ -120,11 +121,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this piston) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-64 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -281,11 +282,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this turbine) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag) (sv-32 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -433,11 +434,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this liftcat) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag) (sv-32 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -556,42 +557,24 @@ This commonly includes things such as: ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (the int (-> self cycle-offset))) - (suspend) - ) - ) + (suspend-for (the int (-> self cycle-offset))) (until #f - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (the int (-> self cycle-time))) - (suspend) - ) - ) + (suspend-for (the int (-> self cycle-time))) (activate! (-> self smush) -1.0 60 225 1.0 1.0 (-> self clock)) (sound-play "rot-pipe-wiggle" :position (-> self root trans)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.75)) - (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush)))) - (suspend) - ) - ) + (suspend-for (seconds 0.75) (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush))))) (set! (-> self shudder-angle) 0.0) (set-zero! (-> self smush)) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 0.25)) (sound-play "rot-pipe-turn" :position (-> self root trans)) (let* ((f0-7 2.0) (f30-1 (* 16384.0 f0-7)) - (gp-6 (current-time)) ) - (until (time-elapsed? gp-6 (seconds 0.5)) + (suspend-for + (seconds 0.5) (set! (-> self rot-angle) (the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48)) ) - (suspend) ) ) (let ((v1-42 #x4000)) @@ -615,11 +598,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this atollrotpipe) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -780,32 +763,34 @@ This commonly includes things such as: ) (defmethod run-logic? ((this slider)) + "Should this process be run? Checked by execute-process-tree." #t ) (defmethod deactivate ((this slider)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (the-as sound-id (-> this sound-id))) (call-parent-method this) (none) ) -(defmethod relocate ((this slider) (arg0 int)) +(defmethod relocate ((this slider) (offset int)) (dotimes (v1-0 4) (if (nonzero? (-> this l-bolts v1-0)) - (&+! (-> this l-bolts v1-0) arg0) + (&+! (-> this l-bolts v1-0) offset) ) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this slider) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -963,11 +948,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this atoll-windmill) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (logior! (-> this mask) (process-mask ambient)) (let ((a1-1 (new 'stack-no-clear 'sync-info-params))) (let ((v1-2 0)) @@ -1032,11 +1017,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this atoll-valve) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (logior! (-> this mask) (process-mask ambient)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -1073,11 +1058,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this atoll-hatch) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (logior! (-> this mask) (process-mask ambient)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -1140,11 +1125,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this atoll-hellcat) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -1201,11 +1186,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this atoll-mar-symbol) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak2/levels/atoll/juicer.gc b/goal_src/jak2/levels/atoll/juicer.gc index ba3df807a1..50057f47b7 100644 --- a/goal_src/jak2/levels/atoll/juicer.gc +++ b/goal_src/jak2/levels/atoll/juicer.gc @@ -334,13 +334,13 @@ ) ;; WARN: Return type mismatch projectile vs juicer-shot. -(defmethod relocate ((this juicer-shot) (arg0 int)) +(defmethod relocate ((this juicer-shot) (offset int)) (dotimes (v1-0 5) (if (nonzero? (-> this lightning v1-0)) - (&+! (-> this lightning v1-0) arg0) + (&+! (-> this lightning v1-0) offset) ) ) - (the-as juicer-shot ((method-of-type projectile relocate) this arg0)) + (the-as juicer-shot ((method-of-type projectile relocate) this offset)) ) (defmethod init-proj-settings! ((this juicer-shot)) @@ -679,9 +679,9 @@ (defmethod common-post ((this juicer)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy common-post))) (t9-0 this) ) @@ -713,7 +713,7 @@ (defmethod general-event-handler ((this juicer) (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" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit-flinch) (cond @@ -1275,57 +1275,56 @@ (s5-0 (+ (-> v1-29 attack-id) 1)) ) (set! (-> v1-29 attack-id) s5-0) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 (seconds 0.25)) - (ja-no-eval :group! juicer-attack0-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (let ((s3-0 (handle->process (-> self focus handle)))) - (when s3-0 - (when (< 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable s3-0) 0))) - (fire-projectile self (the-as process-focusable s3-0) s5-0) - (current-time) - (if (not gp-0) - (set! gp-0 #t) + (suspend-for + (seconds 0.25) + (ja-no-eval :group! juicer-attack0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((s3-0 (handle->process (-> self focus handle)))) + (when s3-0 + (when (< 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable s3-0) 0))) + (fire-projectile self (the-as process-focusable s3-0) s5-0) + (current-time) + (if (not gp-0) + (set! gp-0 #t) + ) + ) + ) + ) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (b! + (not (and (-> self using-turn-anim) (let ((v1-73 (ja-group))) + (not (and v1-73 (= v1-73 juicer-attack-turn-ja))) + ) ) - ) - ) - ) - (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) - (go-virtual victory) - ) - (b! - (not (and (-> self using-turn-anim) (let ((v1-73 (ja-group))) - (not (and v1-73 (= v1-73 juicer-attack-turn-ja))) - ) - ) - ) - cfg-31 - :delay (empty-form) - ) + ) + cfg-31 + :delay (empty-form) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! juicer-attack-turn-ja) + (b! #t cfg-42 :delay (nop!)) + (label cfg-31) + (when (and (not (-> self using-turn-anim)) (let ((v1-84 (ja-group))) + (not (and v1-84 (= v1-84 juicer-attack0-ja))) + ) + ) (ja-channel-push! 1 (seconds 0.05)) - (ja :group! juicer-attack-turn-ja) - (b! #t cfg-42 :delay (nop!)) - (label cfg-31) - (when (and (not (-> self using-turn-anim)) (let ((v1-84 (ja-group))) - (not (and v1-84 (= v1-84 juicer-attack0-ja))) - ) - ) - (ja-channel-push! 1 (seconds 0.05)) - (ja :group! juicer-attack0-ja) - ) - (label cfg-42) - (suspend) - (ja :num! (seek!)) - ) - (send-event (handle->process (-> self current-projectile)) 'die) - (let ((a0-37 (handle->process (-> self focus handle)))) - (when a0-37 - (if (>= 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable a0-37) 0))) - (go-virtual circling) - ) - ) + (ja :group! juicer-attack0-ja) ) + (label cfg-42) (suspend) + (ja :num! (seek!)) + ) + (empty-form) + (send-event (handle->process (-> self current-projectile)) 'die) + (let ((a0-37 (handle->process (-> self focus handle)))) + (when a0-37 + (if (>= 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable a0-37) 0))) + (go-virtual circling) + ) + ) ) ) ) @@ -1730,14 +1729,14 @@ (none) ) -(defmethod relocate ((this juicer) (arg0 int)) +(defmethod relocate ((this juicer) (offset int)) (if (nonzero? (-> this intro-path)) - (&+! (-> this intro-path) arg0) + (&+! (-> this intro-path) offset) ) (if (nonzero? (-> this joint)) - (&+! (-> this joint) arg0) + (&+! (-> this joint) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod init-enemy! ((this juicer)) diff --git a/goal_src/jak2/levels/castle/castle-obs.gc b/goal_src/jak2/levels/castle/castle-obs.gc index 4ce33c0385..1a6e6a8b28 100644 --- a/goal_src/jak2/levels/castle/castle-obs.gc +++ b/goal_src/jak2/levels/castle/castle-obs.gc @@ -39,11 +39,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this cas-conveyor) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (reset-root! this) (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) @@ -74,6 +74,7 @@ This commonly includes things such as: ) (defmethod deactivate ((this cas-conveyor)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -344,11 +345,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this cas-conveyor-switch) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -479,11 +480,7 @@ This commonly includes things such as: (sound-play "lightning-node") (suspend) (logior! (-> self entity extra perm status) (entity-perm-status dead)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 4)) - (suspend) - ) - ) + (suspend-for (seconds 4)) (cleanup-for-death self) ) ) @@ -624,11 +621,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this cas-electric-fence) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -803,10 +800,10 @@ This commonly includes things such as: (defmethod move-between-points ((this cas-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path -@param vec TODO not sure -@param point-a The first point fetched from the elevator's path -@param point-b The second point fetched from the path -@see [[path-control]] and [[elevator]]" + @param vec TODO not sure + @param point-a The first point fetched from the elevator's path + @param point-b The second point fetched from the path + @see [[path-control]] and [[elevator]]" (let ((s5-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) (v1-3 (-> this root trans)) @@ -914,6 +911,7 @@ This commonly includes things such as: ) (defmethod deactivate ((this cas-elevator)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -921,7 +919,7 @@ This commonly includes things such as: (defmethod init-plat! ((this cas-elevator)) "Does any necessary initial platform setup. -For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." + For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this sound-id) (new-sound-id)) (cas-elevator-method-49 this) (none) @@ -1229,11 +1227,11 @@ For example for an elevator pre-compute the distance between the first and last ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this cas-rot-bridge) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) (set! (-> s4-0 total-prims) (the-as uint 6)) @@ -1456,11 +1454,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this cas-switch) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) @@ -1649,11 +1647,7 @@ This commonly includes things such as: (sound-play "trapdoor") (suspend) (ja-channel-set! 0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event self 'death-end) (while (-> self child) (suspend) @@ -1666,11 +1660,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this cas-trapdoor) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -1761,11 +1755,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this cas-chain-plat) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -1875,11 +1869,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this cas-rot-blade) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -1946,6 +1940,7 @@ This commonly includes things such as: ) (defmethod deactivate ((this cas-rot-blade)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -1982,11 +1977,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this cas-flag-a) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2029,11 +2024,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this cas-flag-b) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2136,11 +2131,7 @@ This commonly includes things such as: (suspend) (ja :num! (seek!)) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (while (or (= (-> self spawn-total) -1) (< (-> self spawn-count-total) (-> self spawn-total))) (when (and (< (-> self player-dist) (+ 81920.0 (-> self notice-dist))) (and (< (-> self spawn-count) (-> self spawn-max)) @@ -2176,18 +2167,10 @@ This commonly includes things such as: ) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (the int (* 300.0 (rand-vu-float-range 0.5 1.0)))) - (suspend) - ) - ) + (suspend-for (the int (* 300.0 (rand-vu-float-range 0.5 1.0)))) ) (while (> (-> self spawn-count) 0) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.43)) - (suspend) - ) - ) + (suspend-for (seconds 0.43)) ) (process-entity-status! self (entity-perm-status subtask-complete) #t) (cond @@ -2205,11 +2188,7 @@ This commonly includes things such as: (set-setting! 'entity-name a3-4 0.0 0) ) ) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (dotimes (gp-6 (-> self actor-group 1 length)) (let ((a1-17 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-17 from) (process->ppointer self)) @@ -2239,11 +2218,7 @@ This commonly includes things such as: (set-setting! 'entity-name a3-6 0.0 0) ) ) - (let ((gp-7 (current-time))) - (until (time-elapsed? gp-7 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (let ((gp-8 (-> self actor-group 0))) (dotimes (s5-3 (-> gp-8 length)) (let ((a1-21 (new 'stack-no-clear 'event-message-block))) @@ -2273,11 +2248,7 @@ This commonly includes things such as: (suspend) (ja :num! (seek! 0.0)) ) - (let ((gp-10 (current-time))) - (until (time-elapsed? gp-10 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (remove-setting! 'entity-name) (until (process-release? *target*) (suspend) @@ -2313,11 +2284,7 @@ This commonly includes things such as: (label cfg-14) (not v1-28) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.51)) - (suspend) - ) - ) + (suspend-for (seconds 0.51)) ) (until (process-grab? *target* #f) (suspend) @@ -2327,11 +2294,7 @@ This commonly includes things such as: (set-setting! 'entity-name a3-2 0.0 0) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (task-node-close! (game-task-node castle-break-in-resolution)) (let ((a1-7 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-7 from) (process->ppointer self)) @@ -2367,11 +2330,7 @@ This commonly includes things such as: ) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 2.5)) - (suspend) - ) - ) + (suspend-for (seconds 2.5)) (remove-setting! 'entity-name) (until (process-release? *target*) (suspend) @@ -2383,11 +2342,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this cas-robot-door) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" ;; og:preserve-this added (stack-size-set! (-> this main-thread) 512) (local-vars (sv-16 res-tag) (sv-32 res-tag)) @@ -2535,11 +2494,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this lightning-ball) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) diff --git a/goal_src/jak2/levels/castle/pad/caspad-obs.gc b/goal_src/jak2/levels/castle/pad/caspad-obs.gc index 4933ee6a69..a6fb2d2e9b 100644 --- a/goal_src/jak2/levels/castle/pad/caspad-obs.gc +++ b/goal_src/jak2/levels/castle/pad/caspad-obs.gc @@ -28,10 +28,10 @@ (defmethod move-between-points ((this cpad-elevator) (vec vector) (point-a float) (point-b float)) "Move between two points on the elevator's path -@param vec TODO not sure -@param point-a The first point fetched from the elevator's path -@param point-b The second point fetched from the path -@see [[path-control]] and [[elevator]]" + @param vec TODO not sure + @param point-a The first point fetched from the elevator's path + @param point-b The second point fetched from the path + @see [[path-control]] and [[elevator]]" (let ((path-point-a (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) point-a 'interp)) (path-point-b (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) point-b 'interp)) (elevator-trans (-> this root trans)) @@ -66,7 +66,7 @@ (defmethod configure-collision ((this cpad-elevator) (collide-with-jak? symbol)) "Appropriately sets the collision on the elevator -@param collide-with-jak? If set, the elevator will collide with Jak" + @param collide-with-jak? If set, the elevator will collide with Jak" (let ((prim (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (collide-with-jak? @@ -106,11 +106,7 @@ ) ) :code (behavior () - (let ((frame-counter (current-time))) - (until (time-elapsed? frame-counter (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) (until #f (sound-play "dig-elevate" :id (-> self sound-id)) @@ -147,6 +143,7 @@ ) (defmethod deactivate ((this cpad-elevator)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -164,7 +161,7 @@ ;; WARN: Return type mismatch sound-id vs none. (defmethod init-plat! ((this cpad-elevator)) "Does any necessary initial platform setup. -For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." + For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (let ((last-path-index (+ (-> this path curve num-cverts) -1))) (calc-dist-between-points! this 0 last-path-index) (calc-dist-between-points! this last-path-index 0) diff --git a/goal_src/jak2/levels/castle/pad/castle-tasks.gc b/goal_src/jak2/levels/castle/pad/castle-tasks.gc index 68b3f5fcd7..dc47e3c2c5 100644 --- a/goal_src/jak2/levels/castle/pad/castle-tasks.gc +++ b/goal_src/jak2/levels/castle/pad/castle-tasks.gc @@ -23,11 +23,7 @@ (until #f (when (< (vector-vector-distance (target-pos 0) (-> self info end-sphere)) (-> self info end-sphere r)) (send-event (handle->process (-> self arrow)) 'leave) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.007)) - (suspend) - ) - ) + (suspend-for (seconds 0.007)) (go-virtual complete) ) (suspend) diff --git a/goal_src/jak2/levels/castle/roboguard-level.gc b/goal_src/jak2/levels/castle/roboguard-level.gc index 7f6fb9959b..428feb2271 100644 --- a/goal_src/jak2/levels/castle/roboguard-level.gc +++ b/goal_src/jak2/levels/castle/roboguard-level.gc @@ -332,11 +332,7 @@ (defstate ambush (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (logand! (-> self flags) -9) (logior! (-> self flags) 4) (logior! (-> self nav flags) (nav-control-flag output-sphere-hash)) @@ -398,11 +394,7 @@ (defstate idle (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (roboguard-level-method-185 self (the-as symbol 0)) ) :code (behavior () @@ -468,11 +460,7 @@ (defstate stare (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (roboguard-level-method-185 self (the-as symbol 0)) ) :code (behavior () @@ -731,11 +719,7 @@ (defstate die (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (roboguard-level-method-185 self (the-as symbol 0)) ) :code (behavior () @@ -935,7 +919,7 @@ (defmethod general-event-handler ((this roboguard-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" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) (cond 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 24a8d0123f..859cae9221 100644 --- a/goal_src/jak2/levels/city/burning-bush/ctywide-bbush.gc +++ b/goal_src/jak2/levels/city/burning-bush/ctywide-bbush.gc @@ -1740,11 +1740,11 @@ ;; WARN: Return type mismatch entity-perm-status vs none. (defmethod init-from-entity! ((this bush-collect) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -2901,11 +2901,7 @@ This commonly includes things such as: ) (send-event *camera* 'teleport-to-transformq gp-0) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 3)) - (suspend) - ) - ) + (suspend-for (seconds 3)) (remove-setting! 'minimap) (set! (-> *ACTOR-bank* birth-max) 1000) (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) diff --git a/goal_src/jak2/levels/city/common/pilot-states.gc b/goal_src/jak2/levels/city/common/pilot-states.gc index d1e5237c02..b8e3a81ddd 100644 --- a/goal_src/jak2/levels/city/common/pilot-states.gc +++ b/goal_src/jak2/levels/city/common/pilot-states.gc @@ -823,11 +823,7 @@ (logior! (-> self focus-status) (focus-status dead)) (case arg0 (('melt 'grenade 'explode) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (case arg0 (('dark-eco-pool) (sound-play "death-darkeco") @@ -950,11 +946,7 @@ ) 0 (ja-channel-set! 0) - (let ((s5-7 (current-time))) - (until (time-elapsed? s5-7 (seconds 1.8)) - (suspend) - ) - ) + (suspend-for (seconds 1.8)) ) (('endlessfall) (sound-play "death-fall") @@ -983,11 +975,7 @@ ) ) ) - (let ((s5-9 (current-time))) - (until (time-elapsed? s5-9 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) ) (('bot) (set! (-> self trans-hook) #f) diff --git a/goal_src/jak2/levels/city/ctywide-obs.gc b/goal_src/jak2/levels/city/ctywide-obs.gc index b9e88cc724..c9de9fd6d0 100644 --- a/goal_src/jak2/levels/city/ctywide-obs.gc +++ b/goal_src/jak2/levels/city/ctywide-obs.gc @@ -530,11 +530,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this security-wall) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (ctywide-entity-hack) (set! (-> this breach) #f) (set! (-> this pass) (res-lump-value arg0 'pickup-type int :time -1000000000.0)) @@ -985,11 +985,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this fruit-stand) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (fruit-stand-method-28 this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1523,16 +1523,12 @@ This commonly includes things such as: ) ) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> self root trans quad)) - (+! (-> a1-1 y) 10240.0) - (spawn (-> self part) a1-1) - ) - (suspend) - ) - ) + (suspend-for (seconds 2) (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> self root trans quad)) + (+! (-> a1-1 y) 10240.0) + (spawn (-> self part) a1-1) + ) + ) (while (not (-> self button-down?)) (suspend) ) @@ -1567,11 +1563,7 @@ This commonly includes things such as: (suspend) (ja :num! (seek! 32.0 0.5)) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 3)) - (suspend) - ) - ) + (suspend-for (seconds 3)) ) ) (set! (-> self root root-prim specific 0) (-> self root root-prim specific 1)) @@ -1715,11 +1707,7 @@ This commonly includes things such as: (suspend) (ja :num! (seek! (ja-aframe 32.0 0))) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 5)) - (suspend) - ) - ) + (suspend-for (seconds 5)) (set! (-> self root root-prim specific 0) (-> self root root-prim specific 1)) (setup-masks (-> self draw) 2 0) (go-virtual idle) @@ -2009,17 +1997,17 @@ This commonly includes things such as: ) ) -(defmethod relocate ((this cty-guard-turret) (arg0 int)) +(defmethod relocate ((this cty-guard-turret) (offset int)) (if (nonzero? (-> this jm-turret)) - (&+! (-> this jm-turret) arg0) + (&+! (-> this jm-turret) offset) ) (if (nonzero? (-> this jm-gunsL)) - (&+! (-> this jm-gunsL) arg0) + (&+! (-> this jm-gunsL) offset) ) (if (nonzero? (-> this jm-gunsR)) - (&+! (-> this jm-gunsR) arg0) + (&+! (-> this jm-gunsR) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod cty-guard-turret-method-32 ((this cty-guard-turret)) @@ -2103,11 +2091,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this cty-guard-turret) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (v1-23 handle)) (with-pp (cty-guard-turret-method-32 this) @@ -2315,11 +2303,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this parking-spot) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (set! (-> this minimap) #f) (set! (-> this vehicle) (the-as handle #f)) @@ -2834,11 +2822,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this propa) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (propa-method-29 this) (process-drawable-from-entity! this arg0) (ctywide-entity-hack) @@ -2871,6 +2859,7 @@ This commonly includes things such as: ) (defmethod run-logic? ((this baron-statue)) + "Should this process be run? Checked by execute-process-tree." #t ) @@ -2882,11 +2871,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this baron-statue) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -3770,20 +3759,21 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-focusable vs burning-bush. -(defmethod relocate ((this burning-bush) (arg0 int)) +(defmethod relocate ((this burning-bush) (offset int)) (if (nonzero? (-> this task)) - (&+! (-> this task) arg0) + (&+! (-> this task) offset) ) (if (nonzero? (-> this part-off)) - (&+! (-> this part-off) arg0) + (&+! (-> this part-off) offset) ) (if (nonzero? (-> this part-alert)) - (&+! (-> this part-alert) arg0) + (&+! (-> this part-alert) offset) ) - (the-as burning-bush ((method-of-type process-focusable relocate) this arg0)) + (the-as burning-bush ((method-of-type process-focusable relocate) this offset)) ) (defmethod run-logic? ((this burning-bush)) + "Should this process be run? Checked by execute-process-tree." (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen)) @@ -3800,11 +3790,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this burning-bush) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (burning-bush-method-30 this) (process-drawable-from-entity! this arg0) (ctywide-entity-hack) @@ -3849,11 +3839,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this barons-ship-lores) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (when (demo?) (process-entity-status! this (entity-perm-status dead) #t) (go empty-state) @@ -3896,17 +3886,17 @@ This commonly includes things such as: (none) ) -(defmethod relocate ((this barons-ship-lores) (arg0 int)) +(defmethod relocate ((this barons-ship-lores) (offset int)) (if (nonzero? (-> this paths 0)) - (&+! (-> this paths 0) arg0) + (&+! (-> this paths 0) offset) ) (if (nonzero? (-> this paths 1)) - (&+! (-> this paths 1) arg0) + (&+! (-> this paths 1) offset) ) (if (nonzero? (-> this paths 2)) - (&+! (-> this paths 2) arg0) + (&+! (-> this paths 2) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defstate idle (barons-ship-lores) @@ -4093,11 +4083,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this lurker-pipe-lid) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (lurker-pipe-lid-method-28 this) (process-drawable-from-entity! this arg0) (ctywide-entity-hack) @@ -4251,11 +4241,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this ctyn-lamp) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (ctyn-lamp-method-29 this) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak2/levels/city/ctywide-tasks.gc b/goal_src/jak2/levels/city/ctywide-tasks.gc index 9798b84bc5..e54ebf22f1 100644 --- a/goal_src/jak2/levels/city/ctywide-tasks.gc +++ b/goal_src/jak2/levels/city/ctywide-tasks.gc @@ -181,11 +181,7 @@ (talker-spawn-func (-> *talker-speech* 38) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self sound-id 0)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) @@ -234,11 +230,7 @@ (talker-spawn-func (-> *talker-speech* 31) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self sound-id 0)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) @@ -246,11 +238,7 @@ (talker-spawn-func (-> *talker-speech* 35) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self sound-id 0)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) @@ -271,11 +259,7 @@ ) (wait-for-speech-end (-> self sound-id 0)) (set! (-> self sub-state) (the-as uint 2)) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (go-virtual complete) (none) ) @@ -348,11 +332,7 @@ (talker-spawn-func (-> *talker-speech* 35) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self sound-id 0)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (set! (-> self sound-id 0) (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f)) ) @@ -366,11 +346,7 @@ (talker-spawn-func (-> *talker-speech* 37) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self sound-id 0)) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 3)) - (suspend) - ) - ) + (suspend-for (seconds 3)) (go-virtual complete) (none) ) diff --git a/goal_src/jak2/levels/city/market/ctymark-obs.gc b/goal_src/jak2/levels/city/market/ctymark-obs.gc index b5cc1a642a..ee500bd237 100644 --- a/goal_src/jak2/levels/city/market/ctymark-obs.gc +++ b/goal_src/jak2/levels/city/market/ctymark-obs.gc @@ -1042,11 +1042,7 @@ :to self ) (process-entity-status! self (entity-perm-status dead) #t) - (let ((frame (current-time))) - (until (time-elapsed? frame (seconds 5)) - (suspend) - ) - ) + (suspend-for (seconds 5)) ) ) @@ -1070,11 +1066,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this market-basket-a) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) @@ -1146,11 +1142,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this market-basket-b) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) @@ -1222,11 +1218,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this market-crate) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) @@ -1298,11 +1294,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this market-sack-a) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) @@ -1374,11 +1370,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this market-sack-b) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) diff --git a/goal_src/jak2/levels/city/onintent/onin-game.gc b/goal_src/jak2/levels/city/onintent/onin-game.gc index 7cb4373fd7..81e7e3655d 100644 --- a/goal_src/jak2/levels/city/onintent/onin-game.gc +++ b/goal_src/jak2/levels/city/onintent/onin-game.gc @@ -1836,11 +1836,7 @@ (-> gp-0 ppointer) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 0.25)) (go-virtual fall) ) ) @@ -2536,11 +2532,7 @@ ) :code (behavior ((arg0 symbol)) (ja-channel-set! 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (talker-spawn-func (-> *talker-speech* 145) *entity-pool* (target-pos 0) (the-as region #f)) (sleep-code) ) @@ -2662,11 +2654,7 @@ (while (nonzero? (get-status *gui-control* s5-1)) (suspend) ) - (let ((s5-3 (current-time))) - (until (time-elapsed? s5-3 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (set-blackout-frames (seconds 0.1)) (send-event (handle->process gp-4) 'complete) ) diff --git a/goal_src/jak2/levels/city/port/portrun/portrun.gc b/goal_src/jak2/levels/city/port/portrun/portrun.gc index 8b47a3f200..09a14cd016 100644 --- a/goal_src/jak2/levels/city/port/portrun/portrun.gc +++ b/goal_src/jak2/levels/city/port/portrun/portrun.gc @@ -968,11 +968,7 @@ 0 ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 3)) - (suspend) - ) - ) + (suspend-for (seconds 3)) (cleanup-for-death self) ) :post (behavior () @@ -1476,11 +1472,7 @@ (defstate die (ctyport-cargo) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (cleanup-for-death self) ) ) @@ -1864,11 +1856,7 @@ ) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) (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 4a85053059..b2c51bf45e 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc @@ -382,18 +382,10 @@ ) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.6)) - (suspend) - ) - ) + (suspend-for (seconds 0.6)) (+! (-> self root trans y) -8192.0) (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) ) diff --git a/goal_src/jak2/levels/common/enemy/flitter.gc b/goal_src/jak2/levels/common/enemy/flitter.gc index cddbf21b14..ddd247f907 100644 --- a/goal_src/jak2/levels/common/enemy/flitter.gc +++ b/goal_src/jak2/levels/common/enemy/flitter.gc @@ -672,11 +672,7 @@ (-> gp-0 ppointer) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.6)) - (suspend) - ) - ) + (suspend-for (seconds 0.6)) (+! (-> self root trans y) -8192.0) (enemy-method-129 self) (let ((a0-5 (handle->process (-> self focus handle)))) @@ -694,11 +690,7 @@ ) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) ) diff --git a/goal_src/jak2/levels/common/enemy/grunt.gc b/goal_src/jak2/levels/common/enemy/grunt.gc index 2bbf7170b5..c65731c059 100644 --- a/goal_src/jak2/levels/common/enemy/grunt.gc +++ b/goal_src/jak2/levels/common/enemy/grunt.gc @@ -331,7 +331,7 @@ (defmethod general-event-handler ((this grunt) (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" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -450,11 +450,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-6 prim-core collide-with) (-> self root backup-collide-with)) @@ -1411,11 +1407,11 @@ ) ;; WARN: Return type mismatch nav-enemy vs grunt. -(defmethod relocate ((this grunt) (arg0 int)) +(defmethod relocate ((this grunt) (offset int)) (if (nonzero? (-> this intro-path)) - (&+! (-> this intro-path) arg0) + (&+! (-> this intro-path) offset) ) - (the-as grunt ((method-of-type nav-enemy relocate) this arg0)) + (the-as grunt ((method-of-type nav-enemy relocate) this offset)) ) (defmethod init-enemy-collision! ((this grunt)) 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 8300c8a5d9..3e1580ffe5 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 @@ -1105,7 +1105,7 @@ (defmethod general-event-handler ((this 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" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('event-death) (when (<= (-> this hit-points) 0) @@ -1459,9 +1459,9 @@ ;; WARN: Return type mismatch object vs none. (defmethod common-post ((this crimson-guard-level)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy common-post))) (t9-0 this) ) @@ -2131,11 +2131,7 @@ (suspend) ) (when (logtest? (-> self flags) 4) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (until (crimson-guard-level-method-194 self) (suspend) ) @@ -2705,22 +2701,21 @@ (suspend) (ja :num! (seek! (ja-aframe 12.0 0))) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (the int (* 900.0 (you-suck-scale *game-info* #f)))) - (ja-no-eval :group! crimson-guard-grenade-attack-ja - :num! (seek! (ja-aframe 12.0 0)) - :frame-num (ja-aframe 12.0 0) - ) - (until (ja-done? 0) - (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) - (suspend) - (ja :num! (seek! (ja-aframe 12.0 0))) - ) - (if (and (< (-> self target-self-xz-dist) 81920.0) (= (-> self focus aware) (enemy-aware enemy-aware-3))) - (go-hostile self) - ) + (suspend-for + (the int (* 900.0 (you-suck-scale *game-info* #f))) + (ja-no-eval :group! crimson-guard-grenade-attack-ja + :num! (seek! (ja-aframe 12.0 0)) + :frame-num (ja-aframe 12.0 0) + ) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) (suspend) + (ja :num! (seek! (ja-aframe 12.0 0))) ) + (empty-form) + (if (and (< (-> self target-self-xz-dist) 81920.0) (= (-> self focus aware) (enemy-aware enemy-aware-3))) + (go-hostile self) + ) ) (crimson-guard-level-method-192 self) (ja-no-eval :group! crimson-guard-grenade-attack-ja @@ -4118,14 +4113,14 @@ (none) ) -(defmethod relocate ((this crimson-guard-level) (arg0 int)) +(defmethod relocate ((this crimson-guard-level) (offset int)) (if (nonzero? (-> this joint)) - (&+! (-> this joint) arg0) + (&+! (-> this joint) offset) ) (if (nonzero? (-> this l-control)) - (&+! (-> this l-control) arg0) + (&+! (-> this l-control) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) ;; WARN: Return type mismatch float vs 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 7e21fe1237..a85a4ecfba 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 @@ -907,11 +907,7 @@ (defstate knocked (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) ) @@ -967,11 +963,7 @@ 0 (set! (-> self hit-points) 0) (do-effect (-> self skel effect) 'death-default 0.0 -1) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event self 'death-end) (cleanup-for-death self) ) @@ -981,11 +973,7 @@ (defstate flying-death (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 (let ((t9-3 (method-of-type part-tracker activate))) @@ -1042,11 +1030,7 @@ (defstate flying-death-explode (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (sound-play "hover-explode") (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-1 @@ -1094,7 +1078,7 @@ (defmethod general-event-handler ((this crimson-guard-hover) (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" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v1-15 enemy-flag)) (case arg2 (('attack-invinc) @@ -1317,9 +1301,9 @@ (defmethod common-post ((this crimson-guard-hover)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (seek! (-> this gun-x-angle) (-> this gun-x-angle-final) (* 21845.334 (seconds-per-frame))) (let* ((s5-0 (hover-nav-control-method-16 (-> this hover) (new 'stack-no-clear 'vector))) (s4-0 @@ -1693,23 +1677,24 @@ ) ;; WARN: Return type mismatch hover-enemy vs crimson-guard-hover. -(defmethod relocate ((this crimson-guard-hover) (arg0 int)) +(defmethod relocate ((this crimson-guard-hover) (offset int)) (if (nonzero? (-> this gun-jmod)) - (&+! (-> this gun-jmod) arg0) + (&+! (-> this gun-jmod) offset) ) (if (nonzero? (-> this hips-jmod)) - (&+! (-> this hips-jmod) arg0) + (&+! (-> this hips-jmod) offset) ) (if (nonzero? (-> this smoke-part)) - (&+! (-> this smoke-part) arg0) + (&+! (-> this smoke-part) offset) ) (if (nonzero? (-> this engine-part)) - (&+! (-> this engine-part) arg0) + (&+! (-> this engine-part) offset) ) - (the-as crimson-guard-hover ((method-of-type hover-enemy relocate) this arg0)) + (the-as crimson-guard-hover ((method-of-type hover-enemy relocate) this offset)) ) (defmethod deactivate ((this crimson-guard-hover)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (nonzero? (-> this smoke-part)) (kill-and-free-particles (-> this smoke-part)) ) 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 ebcff71007..f442d600b3 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 @@ -180,21 +180,13 @@ (('wait) ) ) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 (-> gp-0 s5-0 time)) - (suspend) - ) - ) + (suspend-for (-> gp-0 s5-0 time)) (while (< (-> gp-0 s5-0 alive-count) (-> self alive-count)) (suspend) ) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (go-virtual die) ) :post hover-enemy-manager-post @@ -242,16 +234,16 @@ (none) ) -(defmethod relocate ((this hover-enemy-manager) (arg0 int)) +(defmethod relocate ((this hover-enemy-manager) (offset int)) (when (-> this formation) (if (nonzero? (-> this formation)) - (&+! (-> this formation) arg0) + (&+! (-> this formation) offset) ) ) (if (nonzero? (-> this path)) - (&+! (-> this path) arg0) + (&+! (-> this path) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod hover-enemy-manager-init! ((this hover-enemy-manager) (arg0 (array hover-enemy-battle-command))) diff --git a/goal_src/jak2/levels/common/enemy/hover/wasp.gc b/goal_src/jak2/levels/common/enemy/hover/wasp.gc index 63502f9977..3202b17b45 100644 --- a/goal_src/jak2/levels/common/enemy/hover/wasp.gc +++ b/goal_src/jak2/levels/common/enemy/hover/wasp.gc @@ -438,7 +438,7 @@ (defmethod general-event-handler ((this wasp) (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" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -539,9 +539,9 @@ (defmethod common-post ((this wasp)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (seek! (-> this gun-x-angle) (-> this gun-x-angle-final) (* 21845.334 (seconds-per-frame))) ((method-of-type hover-enemy common-post) this) (none) @@ -1053,11 +1053,7 @@ 0 (set! (-> self hit-points) 0) (do-effect (-> self skel effect) 'death-default 0.0 -1) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event self 'death-end) (cleanup-for-death self) ) @@ -1401,6 +1397,7 @@ ) (defmethod deactivate ((this wasp)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (nonzero? (-> this smoke-part)) (kill-and-free-particles (-> this smoke-part)) ) @@ -1413,17 +1410,17 @@ ) ;; WARN: Return type mismatch hover-enemy vs wasp. -(defmethod relocate ((this wasp) (arg0 int)) +(defmethod relocate ((this wasp) (offset int)) (if (nonzero? (-> this gun-jmod)) - (&+! (-> this gun-jmod) arg0) + (&+! (-> this gun-jmod) offset) ) (if (nonzero? (-> this smoke-part)) - (&+! (-> this smoke-part) arg0) + (&+! (-> this smoke-part) offset) ) (if (nonzero? (-> this engine-part)) - (&+! (-> this engine-part) arg0) + (&+! (-> this engine-part) offset) ) - (the-as wasp ((method-of-type hover-enemy relocate) this arg0)) + (the-as wasp ((method-of-type hover-enemy relocate) this offset)) ) (defmethod hover-enemy-method-149 ((this wasp)) diff --git a/goal_src/jak2/levels/common/enemy/spyder.gc b/goal_src/jak2/levels/common/enemy/spyder.gc index 290b978b7b..7c02f83a71 100644 --- a/goal_src/jak2/levels/common/enemy/spyder.gc +++ b/goal_src/jak2/levels/common/enemy/spyder.gc @@ -267,7 +267,7 @@ (defmethod general-event-handler ((this spyder) (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" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -661,9 +661,9 @@ (defmethod common-post ((this spyder)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (spyder-method-185 this) (spyder-method-184 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (update-trans! (-> this sound) (-> this root trans)) @@ -1067,13 +1067,11 @@ (set! (-> self fire-info 0 quad) (-> s3-0 quad)) (set! (-> self fire-info 1 quad) (-> s2-1 quad)) ) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 0.2)) - (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) - (ja :num! (loop!)) - (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) - (suspend) - ) + (suspend-for + (seconds 0.2) + (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) + (ja :num! (loop!)) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) ) (let ((f28-1 (+ 12288.0 f28-0))) (set! (-> gp-0 quad) (-> s5-0 quad)) diff --git a/goal_src/jak2/levels/common/entities/com-elevator.gc b/goal_src/jak2/levels/common/entities/com-elevator.gc index 36ab2d3771..cd404c42df 100644 --- a/goal_src/jak2/levels/common/entities/com-elevator.gc +++ b/goal_src/jak2/levels/common/entities/com-elevator.gc @@ -30,10 +30,10 @@ (defmethod move-between-points ((this com-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path -@param vec TODO not sure -@param point-a The first point fetched from the elevator's path -@param point-b The second point fetched from the path -@see [[path-control]] and [[elevator]]" + @param vec TODO not sure + @param point-a The first point fetched from the elevator's path + @param point-b The second point fetched from the path + @see [[path-control]] and [[elevator]]" (let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) (v1-3 (-> this root trans)) @@ -93,11 +93,7 @@ (defstate dormant (com-elevator) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (process-entity-status! self (entity-perm-status subtask-complete) #t) ) ) @@ -127,11 +123,7 @@ (remove-setting! 'allow-look-around) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (sound-play "com-elevator-s") (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) (until #f @@ -174,6 +166,7 @@ ) (defmethod deactivate ((this com-elevator)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -182,7 +175,7 @@ ;; WARN: Return type mismatch sound-id vs none. (defmethod init-plat! ((this com-elevator)) "Does any necessary initial platform setup. -For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." + For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (dotimes (s5-0 (-> this path curve num-cverts)) (let ((a1-1 (res-lump-struct (-> this entity) 'string-startup-vector structure :time (the float s5-0)))) (cond @@ -272,11 +265,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) (until #f (sound-play "tmb-elevator-lp" :id (-> self sound-id)) @@ -303,6 +292,7 @@ For example for an elevator pre-compute the distance between the first and last ) (defmethod deactivate ((this tomb-trans-elevator)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -311,7 +301,7 @@ For example for an elevator pre-compute the distance between the first and last ;; WARN: Return type mismatch sound-id vs none. (defmethod init-plat! ((this tomb-trans-elevator)) "Does any necessary initial platform setup. -For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." + For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (call-parent-method this) (set! (-> this sound-id) (new-sound-id)) (none) diff --git a/goal_src/jak2/levels/common/entities/gun-buoy.gc b/goal_src/jak2/levels/common/entities/gun-buoy.gc index 763ed906a5..6c91ae73c5 100644 --- a/goal_src/jak2/levels/common/entities/gun-buoy.gc +++ b/goal_src/jak2/levels/common/entities/gun-buoy.gc @@ -826,11 +826,7 @@ (gun-buoy-method-183 self a1-1) ) ) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.75)) - (suspend) - ) - ) + (suspend-for (seconds 0.75)) ) (go-virtual hostile) ) @@ -856,11 +852,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (go-virtual exit-ambush) ) :post gun-buoy-chase-post @@ -875,7 +867,7 @@ (defmethod general-event-handler ((this gun-buoy) (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" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('jump) #f @@ -888,9 +880,9 @@ (defmethod common-post ((this gun-buoy)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (-> this root) (let* ((s4-0 *target*) (s5-0 (if (type? s4-0 process-focusable) @@ -973,10 +965,10 @@ ;; WARN: disable def twice: 40. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod in-aggro-range? ((this gun-buoy) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. -- if `activate-distance` is `0.0`, always true -- otherwise, check if the provided process is close enough -@param proc The process used to distance check -@returns true/false" + - if `activate-distance` is `0.0`, always true + - otherwise, check if the provided process is close enough + @param proc The process used to distance check + @returns true/false" (local-vars (v1-19 process-focusable) (f30-1 meters)) (if (and arg0 (not arg1)) (set! arg1 (get-trans arg0 0)) @@ -1142,11 +1134,11 @@ ) ;; WARN: Return type mismatch nav-enemy vs gun-buoy. -(defmethod relocate ((this gun-buoy) (arg0 int)) +(defmethod relocate ((this gun-buoy) (offset int)) (if (nonzero? (-> this gun-elev-jmod)) - (&+! (-> this gun-elev-jmod) arg0) + (&+! (-> this gun-elev-jmod) offset) ) - (the-as gun-buoy ((method-of-type nav-enemy relocate) this arg0)) + (the-as gun-buoy ((method-of-type nav-enemy relocate) this offset)) ) ;; WARN: Return type mismatch collide-shape-moving vs none. diff --git a/goal_src/jak2/levels/common/entities/spydroid.gc b/goal_src/jak2/levels/common/entities/spydroid.gc index 7798355517..9dc7012212 100644 --- a/goal_src/jak2/levels/common/entities/spydroid.gc +++ b/goal_src/jak2/levels/common/entities/spydroid.gc @@ -622,9 +622,9 @@ (defmethod common-post ((this spydroid)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy common-post))) (t9-0 this) ) @@ -720,7 +720,7 @@ (defmethod general-event-handler ((this spydroid) (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" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v1-6 vector) (sv-144 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -868,11 +868,7 @@ ) (suspend) (ja-channel-set! 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event self 'death-end) (while (-> self child) (suspend) @@ -1299,6 +1295,7 @@ ) (defmethod deactivate ((this spydroid)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (nonzero? (-> this explode-part)) (kill-and-free-particles (-> this explode-part)) ) @@ -1307,18 +1304,18 @@ ) ;; WARN: Return type mismatch nav-enemy vs spydroid. -(defmethod relocate ((this spydroid) (arg0 int)) +(defmethod relocate ((this spydroid) (offset int)) (dotimes (v1-0 4) (if (nonzero? (-> this lightning v1-0)) - (&+! (-> this lightning v1-0) arg0) + (&+! (-> this lightning v1-0) offset) ) ) (when (nonzero? (-> this explode-part)) (if (nonzero? (-> this explode-part)) - (&+! (-> this explode-part) arg0) + (&+! (-> this explode-part) offset) ) ) - (the-as spydroid ((method-of-type nav-enemy relocate) this arg0)) + (the-as spydroid ((method-of-type nav-enemy relocate) this offset)) ) (defmethod init-enemy! ((this spydroid)) diff --git a/goal_src/jak2/levels/common/race/race-obs.gc b/goal_src/jak2/levels/common/race/race-obs.gc index b3554fc68f..e030ed99dd 100644 --- a/goal_src/jak2/levels/common/race/race-obs.gc +++ b/goal_src/jak2/levels/common/race/race-obs.gc @@ -283,50 +283,30 @@ :code (behavior () (until #f (ja :num-func num-func-identity :frame-num (ja-aframe 0.0 0)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 2.0 0)) :frame-num (ja-aframe 0.0 0)) (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe 2.0 0))) ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 196) 600 #f #f self 5 :to self) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 4.0 0)) :frame-num (ja-aframe 2.0 0)) (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe 4.0 0))) ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 195) 300 #f #f self 7 :to self) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 6.0 0)) :frame-num (ja-aframe 4.0 0)) (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe 6.0 0))) ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 194) 300 #f #f self 9 :to self) - (let ((gp-13 (current-time))) - (until (time-elapsed? gp-13 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 197) 300 #f #f self 10 :to self) - (let ((gp-15 (current-time))) - (until (time-elapsed? gp-15 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) ) #f ) diff --git a/goal_src/jak2/levels/common/warp-gate.gc b/goal_src/jak2/levels/common/warp-gate.gc index 0731f8386e..d924ad25ec 100644 --- a/goal_src/jak2/levels/common/warp-gate.gc +++ b/goal_src/jak2/levels/common/warp-gate.gc @@ -696,11 +696,7 @@ (set-blackout-frames (seconds 0.05)) ) (start 'play arg0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (while (and *target* (and (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) @@ -789,11 +785,11 @@ (defmethod init-from-entity! ((this warp-gate) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (warp-gate-init arg0 (the-as vector #f)) (none) ) @@ -1104,20 +1100,21 @@ This commonly includes things such as: ;; WARN: Return type mismatch warp-gate vs air-train. -(defmethod relocate ((this air-train) (arg0 int)) +(defmethod relocate ((this air-train) (offset int)) (if (nonzero? (-> this part-exhaust-left)) - (&+! (-> this part-exhaust-left) arg0) + (&+! (-> this part-exhaust-left) offset) ) (if (nonzero? (-> this part-exhaust-right)) - (&+! (-> this part-exhaust-right) arg0) + (&+! (-> this part-exhaust-right) offset) ) (if (nonzero? (-> this part-dust)) - (&+! (-> this part-dust) arg0) + (&+! (-> this part-dust) offset) ) - (the-as air-train ((method-of-type warp-gate relocate) this arg0)) + (the-as air-train ((method-of-type warp-gate relocate) this offset)) ) (defmethod deactivate ((this air-train)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this hover-sound)) (if (nonzero? (-> this part-exhaust-left)) (kill-and-free-particles (-> this part-exhaust-left)) diff --git a/goal_src/jak2/levels/demo/demo-obs.gc b/goal_src/jak2/levels/demo/demo-obs.gc index 9038f72802..5a4aa77f44 100644 --- a/goal_src/jak2/levels/demo/demo-obs.gc +++ b/goal_src/jak2/levels/demo/demo-obs.gc @@ -30,16 +30,17 @@ ;; WARN: Return type mismatch process vs demo-control. -(defmethod relocate ((this demo-control) (arg0 int)) +(defmethod relocate ((this demo-control) (offset int)) (dotimes (v1-0 2) (if (nonzero? (-> this buffer v1-0)) - (&+! (-> this buffer v1-0) arg0) + (&+! (-> this buffer v1-0) offset) ) ) - (the-as demo-control ((method-of-type process relocate) this arg0)) + (the-as demo-control ((method-of-type process relocate) this offset)) ) (defmethod deactivate ((this demo-control)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (dotimes (s5-0 2) (set-pending-file (-> this buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) @@ -634,59 +635,41 @@ ) (set! (-> self sprite-draw) (the-as uint 3)) (set-vector! (-> self sprite-pos) -512.0 40.0 0.0 1.0) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.25)) - (set! (-> self sprite-pos x) - (lerp-scale -512.0 0.0 (sin (* 218.45334 (the float (- (current-time) gp-4)))) 0.0 1.0) - ) - (suspend) - ) + (suspend-for + (seconds 0.25) + (set! (-> self sprite-pos x) + (lerp-scale -512.0 0.0 (sin (* 218.45334 (the float (- (current-time) time)))) 0.0 1.0) + ) ) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 2)) - (suspend) - ) - ) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 0.25)) - (set! (-> self sprite-pos x) - (lerp-scale 0.0 512.0 (sin (* 218.45334 (the float (- (current-time) gp-6)))) 0.0 1.0) - ) - (suspend) - ) + (suspend-for (seconds 2)) + (suspend-for + (seconds 0.25) + (set! (-> self sprite-pos x) + (lerp-scale 0.0 512.0 (sin (* 218.45334 (the float (- (current-time) time)))) 0.0 1.0) + ) ) (set! (-> self sprite-draw) (the-as uint 1)) (set-vector! (-> self sprite-pos) 30.0 -240.0 0.0 1.0) - (let ((gp-7 (current-time))) - (until (time-elapsed? gp-7 (seconds 0.25)) - (set! (-> self sprite-pos y) - (lerp-scale -240.0 270.0 (sin (* 218.45334 (the float (- (current-time) gp-7)))) 0.0 1.0) - ) - (suspend) - ) + (suspend-for + (seconds 0.25) + (set! (-> self sprite-pos y) + (lerp-scale -240.0 270.0 (sin (* 218.45334 (the float (- (current-time) time)))) 0.0 1.0) + ) ) - (let ((gp-8 (current-time))) - (until (time-elapsed? gp-8 (seconds 2)) - (suspend) - ) - ) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 0.25)) - (set! (-> self sprite-pos y) - (lerp-scale 270.0 720.0 (sin (* 218.45334 (the float (- (current-time) gp-9)))) 0.0 1.0) - ) - (suspend) - ) + (suspend-for (seconds 2)) + (suspend-for + (seconds 0.25) + (set! (-> self sprite-pos y) + (lerp-scale 270.0 720.0 (sin (* 218.45334 (the float (- (current-time) time)))) 0.0 1.0) + ) ) (set! (-> self sprite-draw) (the-as uint 2)) (set-vector! (-> self sprite-pos) 20.0 40.0 0.0 1.0) - (let ((gp-10 (current-time))) - (until (time-elapsed? gp-10 (seconds 0.25)) - (set! (-> self sprite-pos y) - (lerp-scale 720.0 20.0 (sin (* 218.45334 (the float (- (current-time) gp-10)))) 0.0 1.0) - ) - (suspend) - ) + (suspend-for + (seconds 0.25) + (set! (-> self sprite-pos y) + (lerp-scale 720.0 20.0 (sin (* 218.45334 (the float (- (current-time) time)))) 0.0 1.0) + ) ) (let ((a1-21 (new 'stack-no-clear 'array 'symbol 6))) (set! (-> a1-21 5) #f) @@ -697,73 +680,27 @@ (set! (-> a1-21 0) 'demo) (want-levels *load-state* a1-21) ) - (let ((gp-11 (current-time))) - (until (time-elapsed? gp-11 (seconds 2)) - (suspend) - ) - ) - (let ((gp-12 (current-time))) - (until (time-elapsed? gp-12 (seconds 0.25)) - (set! (-> self sprite-pos y) - (lerp-scale 20.0 -720.0 (sin (* 218.45334 (the float (- (current-time) gp-12)))) 0.0 1.0) - ) - (suspend) - ) + (suspend-for (seconds 2)) + (suspend-for + (seconds 0.25) + (set! (-> self sprite-pos y) + (lerp-scale 20.0 -720.0 (sin (* 218.45334 (the float (- (current-time) time)))) 0.0 1.0) + ) ) ) (else - (let ((gp-13 (current-time))) - (until (time-elapsed? gp-13 (seconds 0.38)) - (suspend) - ) - ) - (let ((gp-14 (current-time))) - (until (time-elapsed? gp-14 (seconds 2)) - (suspend) - ) - ) - (let ((gp-15 (current-time))) - (until (time-elapsed? gp-15 (seconds 0.25)) - (suspend) - ) - ) - (let ((gp-16 (current-time))) - (until (time-elapsed? gp-16 (seconds 0.25)) - (suspend) - ) - ) - (let ((gp-17 (current-time))) - (until (time-elapsed? gp-17 (seconds 2)) - (suspend) - ) - ) - (let ((gp-18 (current-time))) - (until (time-elapsed? gp-18 (seconds 0.25)) - (suspend) - ) - ) - (let ((gp-19 (current-time))) - (until (time-elapsed? gp-19 (seconds 0.25)) - (suspend) - ) - ) - (let ((gp-20 (current-time))) - (until (time-elapsed? gp-20 (seconds 2)) - (suspend) - ) - ) - (let ((gp-21 (current-time))) - (until (time-elapsed? gp-21 (seconds 0.25)) - (suspend) - ) - ) - ) - ) - (let ((gp-22 (current-time))) - (until (time-elapsed? gp-22 (seconds 3)) - (suspend) + (suspend-for (seconds 0.38)) + (suspend-for (seconds 2)) + (suspend-for (seconds 0.25)) + (suspend-for (seconds 0.25)) + (suspend-for (seconds 2)) + (suspend-for (seconds 0.25)) + (suspend-for (seconds 0.25)) + (suspend-for (seconds 2)) + (suspend-for (seconds 0.25)) ) ) + (suspend-for (seconds 3)) (demo-screen-change -1 -1 #f #t) (set! (-> *game-info* demo-state) (the-as uint 1)) (start 'play (get-continue-by-name *game-info* "demo-start")) diff --git a/goal_src/jak2/levels/dig/dig1-obs.gc b/goal_src/jak2/levels/dig/dig1-obs.gc index fc9ea23ce7..4f95188e4c 100644 --- a/goal_src/jak2/levels/dig/dig1-obs.gc +++ b/goal_src/jak2/levels/dig/dig1-obs.gc @@ -440,22 +440,14 @@ (ja :num! (seek! max f30-0)) ) (ja-no-eval :group! dig-bomb-crate-cylinder-idle-ja :num! (seek!) :frame-num 0.0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (ja-no-eval :group! dig-bomb-crate-cylinder-pulse-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max f30-0)) ) (ja-no-eval :group! dig-bomb-crate-cylinder-idle-ja :num! (seek!) :frame-num 0.0) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (ja-no-eval :group! dig-bomb-crate-cylinder-pulse-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -463,33 +455,21 @@ ) ) (ja-no-eval :group! dig-bomb-crate-cylinder-idle-ja :num! (seek!) :frame-num 0.0) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (ja-no-eval :group! dig-bomb-crate-cylinder-pulse-ja :num! (seek! max 0.375) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max 0.375)) ) (ja-no-eval :group! dig-bomb-crate-cylinder-idle-ja :num! (seek!) :frame-num 0.0) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 0.25)) (ja-no-eval :group! dig-bomb-crate-cylinder-pulse-ja :num! (seek! max 0.4375) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max 0.4375)) ) (ja-no-eval :group! dig-bomb-crate-cylinder-idle-ja :num! (seek!) :frame-num 0.0) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 0.125)) - (suspend) - ) - ) + (suspend-for (seconds 0.125)) (dotimes (gp-6 12) (ja-no-eval :group! dig-bomb-crate-cylinder-pulse-ja :num! (seek! max 0.437) :frame-num 0.0) (until (ja-done? 0) @@ -497,11 +477,7 @@ (ja :num! (seek! max 0.437)) ) (ja-no-eval :group! dig-bomb-crate-cylinder-idle-ja :num! (seek!) :frame-num 0.0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.05)) - (suspend) - ) - ) + (suspend-for (seconds 0.05)) ) (go-virtual die) ) @@ -876,11 +852,7 @@ ) ) (suspend) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 4)) - (suspend) - ) - ) + (suspend-for (seconds 4)) (cleanup-for-death self) ) ) @@ -888,11 +860,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this dig-bomb-crate) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate diff --git a/goal_src/jak2/levels/dig/dig3-obs.gc b/goal_src/jak2/levels/dig/dig3-obs.gc index 717e656d1f..e0beb76e56 100644 --- a/goal_src/jak2/levels/dig/dig3-obs.gc +++ b/goal_src/jak2/levels/dig/dig3-obs.gc @@ -261,42 +261,24 @@ :virtual #t :trans rider-trans :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (the int (-> self cycle-offset))) - (suspend) - ) - ) + (suspend-for (the int (-> self cycle-offset))) (until #f - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (the int (-> self cycle-time))) - (suspend) - ) - ) + (suspend-for (the int (-> self cycle-time))) (activate! (-> self smush) -1.0 60 225 1.0 1.0 (-> self clock)) (sound-play "spikey-shake" :position (-> self root trans)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.75)) - (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush)))) - (suspend) - ) - ) + (suspend-for (seconds 0.75) (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush))))) (set! (-> self shudder-angle) 0.0) (set-zero! (-> self smush)) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 0.25)) (sound-play "spikey-turn" :position (-> self root trans)) (let* ((f0-7 1.0) (f30-1 (* 65536.0 f0-7)) - (gp-6 (current-time)) ) - (until (time-elapsed? gp-6 (seconds 1)) + (suspend-for + (seconds 1) (set! (-> self rot-angle) (the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48)) ) - (suspend) ) ) (let ((v1-42 #x10000)) @@ -329,11 +311,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this dig-spikey-step) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 int)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -438,11 +420,7 @@ This commonly includes things such as: ) (sound-play "spikey-break") (suspend) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 4)) - (suspend) - ) - ) + (suspend-for (seconds 4)) (let ((t9-7 (-> (method-of-type projectile-bounce die) code))) (if t9-7 ((the-as (function none) t9-7)) @@ -672,11 +650,7 @@ This commonly includes things such as: :virtual #t :code (behavior () (sound-play "spikey-door") - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.1)) - (suspend) - ) - ) + (suspend-for (seconds 0.1)) (let ((gp-2 (new 'stack-no-clear 'vector)) (s5-1 (new 'static 'vector :x -16384.0 :y -16384.0)) ) @@ -718,11 +692,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this dig-spikey-sphere-door) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -942,11 +916,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this dig-balloon-lurker) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) @@ -1046,6 +1020,7 @@ This commonly includes things such as: ) (defmethod deactivate ((this dig-balloon-lurker)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this pedal-sound-id)) ((method-of-type process-drawable deactivate) this) (none) @@ -1198,6 +1173,7 @@ This commonly includes things such as: ) (defmethod deactivate ((this dig-wheel-step)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this wheel-sound-id)) ((method-of-type process-drawable deactivate) this) (none) @@ -1206,11 +1182,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this dig-wheel-step) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) @@ -1895,11 +1871,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this dig-stomp-block-controller) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this played-fall?) #f) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -1921,6 +1897,7 @@ This commonly includes things such as: ) (defmethod run-logic? ((this dig-totem)) + "Should this process be run? Checked by execute-process-tree." #t ) @@ -1932,11 +1909,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this dig-totem) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) diff --git a/goal_src/jak2/levels/drill/drill-obs2.gc b/goal_src/jak2/levels/drill/drill-obs2.gc index 17985079e2..ae9e0ad7c9 100644 --- a/goal_src/jak2/levels/drill/drill-obs2.gc +++ b/goal_src/jak2/levels/drill/drill-obs2.gc @@ -192,11 +192,11 @@ (defmethod init-from-entity! ((this drill-flip-step) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-plat-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) @@ -345,11 +345,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this drill-falling-door) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -449,11 +449,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this drill-sliding-door) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -604,11 +604,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this drill-breakable-barrel) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -788,11 +788,7 @@ This commonly includes things such as: ) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (cleanup-for-death self) ) ) @@ -818,11 +814,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this drill-metalhead-eggs) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -1145,11 +1141,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this drill-bridge-shot) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) @@ -1233,11 +1229,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this drill-drill) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak2/levels/forest/forest-obs.gc b/goal_src/jak2/levels/forest/forest-obs.gc index e3521ea059..18a9cadfd7 100644 --- a/goal_src/jak2/levels/forest/forest-obs.gc +++ b/goal_src/jak2/levels/forest/forest-obs.gc @@ -26,11 +26,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this forest-hover-manager) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this entity) arg0) (hover-enemy-manager-init! this *forest-protect-battle*) (set! (-> this transport-actor 0) (entity-actor-lookup arg0 'alt-actor 0)) @@ -343,11 +343,7 @@ This commonly includes things such as: ) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (send-event *camera* 'change-target #f) (cleanup-for-death self) ) @@ -381,6 +377,7 @@ This commonly includes things such as: ) (defmethod deactivate ((this forest-youngsamos)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (valid? (-> this hud) (the-as type #f) "" #t 0) (send-event (handle->process (-> this hud)) 'hide-and-die) ) @@ -392,12 +389,13 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this forest-youngsamos) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" - (stack-size-set! (-> this main-thread) 384) ;; og:preserve-this + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" + ;; og:preserve-this + (stack-size-set! (-> this main-thread) 384) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) forest-youngsamos-bounce-reaction) @@ -596,11 +594,7 @@ This commonly includes things such as: (lambda :behavior task-manager () (set-time! (-> self start-time)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (let ((s5-0 (entity-by-name "transport-level-1")) (gp-1 (entity-by-name "transport-level-2")) ) @@ -669,11 +663,7 @@ This commonly includes things such as: ) ) ) - (let ((s3-0 (current-time))) - (until (time-elapsed? s3-0 (seconds 15)) - (suspend) - ) - ) + (suspend-for (seconds 15)) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) (process->ppointer self)) (set! (-> a1-4 num-params) 1) @@ -707,11 +697,7 @@ This commonly includes things such as: ) ) (dotimes (s3-1 3) - (let ((s2-0 (current-time))) - (until (time-elapsed? s2-0 (seconds 10)) - (suspend) - ) - ) + (suspend-for (seconds 10)) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) (process->ppointer self)) (set! (-> a1-6 num-params) 1) @@ -744,11 +730,7 @@ This commonly includes things such as: ) ) ) - (let ((s2-1 (current-time))) - (until (time-elapsed? s2-1 (seconds 10)) - (suspend) - ) - ) + (suspend-for (seconds 10)) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-8 from) (process->ppointer self)) (set! (-> a1-8 num-params) 1) @@ -782,11 +764,7 @@ This commonly includes things such as: ) ) ) - (let ((s3-2 (current-time))) - (until (time-elapsed? s3-2 (seconds 10)) - (suspend) - ) - ) + (suspend-for (seconds 10)) (let ((a1-10 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-10 from) (process->ppointer self)) (set! (-> a1-10 num-params) 1) @@ -819,11 +797,7 @@ This commonly includes things such as: ) ) ) - (let ((s3-3 (current-time))) - (until (time-elapsed? s3-3 (seconds 10)) - (suspend) - ) - ) + (suspend-for (seconds 10)) (dotimes (s3-4 10) (let ((v1-114 s4-0)) (if (not (if v1-114 @@ -833,11 +807,7 @@ This commonly includes things such as: (goto cfg-74) ) ) - (let ((s2-2 (current-time))) - (until (time-elapsed? s2-2 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) ) (label cfg-74) (let ((a1-12 (new 'stack-no-clear 'event-message-block))) @@ -912,37 +882,21 @@ This commonly includes things such as: ) ) ) - (let ((s3-5 (current-time))) - (until (time-elapsed? s3-5 (seconds 1)) - (suspend) - ) - ) - ) - ) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.5)) - (suspend) + (suspend-for (seconds 1)) ) ) + (suspend-for (seconds 0.5)) (set-setting! 'entity-name "camera-260" 0.0 0) (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (process-grab? *target* #f) - (let ((s4-2 (current-time))) - (until (time-elapsed? s4-2 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (send-event (if s5-0 (-> s5-0 extra process) ) 'leave ) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (send-event (if gp-1 (-> gp-1 extra process) @@ -950,19 +904,11 @@ This commonly includes things such as: 'leave ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 3)) - (suspend) - ) - ) + (suspend-for (seconds 3)) (remove-setting! 'entity-name) (remove-setting! 'process-mask) (process-release? *target*) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 3)) - (suspend) - ) - ) + (suspend-for (seconds 3)) (go-virtual complete) (while *target* (suspend) diff --git a/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc b/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc index 731baf8c6a..0f9a9ee3b0 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc @@ -48,19 +48,11 @@ :virtual #t :event (-> (method-of-type fort-elec-switch idle) event) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 16)) - (suspend) - ) - ) + (suspend-for (seconds 16)) (until (logtest? (-> self draw status) (draw-control-status on-screen)) (suspend) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.4)) - (suspend) - ) - ) + (suspend-for (seconds 0.4)) (talker-spawn-func (-> *talker-speech* 86) *entity-pool* (target-pos 0) (the-as region #f)) (sleep-code) ) @@ -137,11 +129,7 @@ ) ) (sound-play "elec-switch") - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (let ((v1-22 #t)) (when (-> self switch-group) (dotimes (a0-11 (-> self switch-group-count)) @@ -173,11 +161,7 @@ ) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.75)) - (suspend) - ) - ) + (suspend-for (seconds 0.75)) (let ((a1-14 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-14 from) (process->ppointer self)) (set! (-> a1-14 num-params) 0) @@ -193,11 +177,7 @@ ) ) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 1.5)) - (suspend) - ) - ) + (suspend-for (seconds 1.5)) (remove-setting! 'entity-name) (remove-setting! 'process-mask) (process-release? *target*) @@ -223,21 +203,21 @@ ) ;; WARN: Return type mismatch process-drawable vs fort-elec-switch. -(defmethod relocate ((this fort-elec-switch) (arg0 int)) +(defmethod relocate ((this fort-elec-switch) (offset int)) (if (nonzero? (-> this l-bolt)) - (&+! (-> this l-bolt) arg0) + (&+! (-> this l-bolt) offset) ) - (the-as fort-elec-switch ((method-of-type process-drawable relocate) this arg0)) + (the-as fort-elec-switch ((method-of-type process-drawable relocate) this offset)) ) ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this fort-elec-switch) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) ;; og:preserve-this added (stack-size-set! (-> this top-thread) 512) @@ -447,11 +427,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this fort-fence) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (stack-size-set! (-> this main-thread) 512) (fort-fence-method-23 this) (process-drawable-from-entity! this arg0) diff --git a/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc b/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc index d16272ad63..25d3b42d36 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc @@ -134,11 +134,7 @@ ) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (cleanup-for-death self) ) ) @@ -146,11 +142,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this fort-dump-bomb-a) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec bot)) @@ -355,11 +351,7 @@ This commonly includes things such as: (-> gp-2 ppointer) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event (ppointer->process (-> self parent)) 'died) (sleep-code) ) @@ -371,6 +363,7 @@ This commonly includes things such as: ) (defmethod deactivate ((this fort-missile-target)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (the-as sound-id (-> this sound-id))) (call-parent-method this) (none) @@ -521,42 +514,22 @@ This commonly includes things such as: ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 8)) - (suspend) - ) - ) + (suspend-for (seconds 8)) (until (logtest? (-> self draw status) (draw-control-status on-screen)) (suspend) ) (when (= (-> self bomb-count) 4) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.4)) - (suspend) - ) - ) + (suspend-for (seconds 0.4)) (add-process *gui-control* self (gui-channel daxter) (gui-action play) "ds017" -99.0 0) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 20)) - (suspend) - ) - ) + (suspend-for (seconds 20)) (if (= (-> self bomb-count) 4) (add-process *gui-control* self (gui-channel daxter) (gui-action play) "ds018" -99.0 0) ) (while (> (-> self bomb-count) 0) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.2)) - (suspend) - ) - ) - ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.8)) - (suspend) - ) + (suspend-for (seconds 0.2)) ) + (suspend-for (seconds 0.8)) (go-virtual missile-countdown) ) :post (behavior () @@ -599,22 +572,14 @@ This commonly includes things such as: ) ) (set-fordumpc-light-flag! #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (while (not (process-grab? *target* #f)) (suspend) ) (set-setting! 'entity-name "camera-182" 0.0 0) (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (task-node-close! (game-task-node fortress-dump-missile)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.75)) - (suspend) - ) - ) + (suspend-for (seconds 0.75)) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) (process->ppointer self)) (set! (-> a1-5 num-params) 0) @@ -645,11 +610,7 @@ This commonly includes things such as: ) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1.5)) - (suspend) - ) - ) + (suspend-for (seconds 1.5)) (remove-setting! 'entity-name) (remove-setting! 'process-mask) (process-release? *target*) @@ -672,21 +633,13 @@ This commonly includes things such as: (set! (-> *game-info* timer) 0) (set! (-> self hud) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.4)) - (suspend) - ) - ) + (suspend-for (seconds 0.4)) (set! (-> self explosion-sound-id) (add-process *gui-control* self (gui-channel background) (gui-action queue) "big-xplo" -99.0 0) ) (dotimes (gp-5 10) (set! (-> *game-info* timer) (the-as time-frame (- 3000 (the int (* 300.0 (the float gp-5)))))) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) ) (go-virtual die) ) @@ -722,11 +675,7 @@ This commonly includes things such as: (remove-setting! 'allow-progress) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.4)) - (suspend) - ) - ) + (suspend-for (seconds 0.4)) (logior! (-> self draw status) (draw-control-status no-draw)) (when *scene-player* (cleanup-for-death self) @@ -884,11 +833,7 @@ This commonly includes things such as: (suspend) ) ) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 10)) - (suspend) - ) - ) + (suspend-for (seconds 10)) (cleanup-for-death self) ) ) @@ -899,6 +844,7 @@ This commonly includes things such as: ) (defmethod deactivate ((this fort-missile)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (set-fordumpc-light-flag! #f) (send-event (handle->process (-> this hud)) 'hide-and-die) (if (nonzero? (-> this part-doom)) @@ -909,21 +855,21 @@ This commonly includes things such as: (none) ) -(defmethod relocate ((this fort-missile) (arg0 int)) +(defmethod relocate ((this fort-missile) (offset int)) (if (nonzero? (-> this part-doom)) - (&+! (-> this part-doom) arg0) + (&+! (-> this part-doom) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this fort-missile) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) 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 df38111f81..7ec3ad10f9 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc @@ -240,12 +240,10 @@ (defstate die (fort-roboscreen) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (seek! (-> self transition) 0.0 (seconds-per-frame)) - (set-roboscreen-alpha! (-> self transition)) - (suspend) - ) + (suspend-for + (seconds 1) + (seek! (-> self transition) 0.0 (seconds-per-frame)) + (set-roboscreen-alpha! (-> self transition)) ) ) ) @@ -316,6 +314,7 @@ ) (defmethod deactivate ((this fort-roboscreen)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (disable *screen-filter*) (set-roboscreen-alpha! 0.0) (call-parent-method this) @@ -537,19 +536,19 @@ ) ;; WARN: Return type mismatch process-drawable vs fort-robotank-reticle. -(defmethod relocate ((this fort-robotank-reticle) (arg0 int)) +(defmethod relocate ((this fort-robotank-reticle) (offset int)) (if (nonzero? (-> this shadow-jmod)) - (&+! (-> this shadow-jmod) arg0) + (&+! (-> this shadow-jmod) offset) ) (if (nonzero? (-> this sight-jmod)) - (&+! (-> this sight-jmod) arg0) + (&+! (-> this sight-jmod) offset) ) (dotimes (v1-8 3) (if (nonzero? (-> this ring-jmod v1-8)) - (&+! (-> this ring-jmod v1-8) arg0) + (&+! (-> this ring-jmod v1-8) offset) ) ) - (the-as fort-robotank-reticle ((method-of-type process-drawable relocate) this arg0)) + (the-as fort-robotank-reticle ((method-of-type process-drawable relocate) this offset)) ) ;; WARN: Return type mismatch object vs none. @@ -1185,11 +1184,7 @@ (logior! (-> self flags) (robotank-turret-flags rotflags-3)) (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) (send-event (handle->process (-> self reticle)) 'lock) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (let ((gp-2 (max 2 (min 3 (rand-vu-int-range 0 3))))) 0 (dotimes (s5-2 gp-2) @@ -1215,12 +1210,8 @@ ) ) ) - (let ((f30-0 (rand-vu-float-range 0.05 0.43)) - (s4-2 (current-time)) - ) - (until (time-elapsed? s4-2 (the int (* 300.0 f30-0))) - (suspend) - ) + (let ((f30-0 (rand-vu-float-range 0.05 0.43))) + (suspend-for (the int (* 300.0 f30-0))) ) ) ) @@ -1238,11 +1229,8 @@ 2.11 ) ) - (gp-3 (current-time)) ) - (until (time-elapsed? gp-3 (the int (* 300.0 f30-1))) - (suspend) - ) + (suspend-for (the int (* 300.0 f30-1))) ) ) #f @@ -1255,11 +1243,7 @@ :code (behavior () (send-event (handle->process (-> self reticle)) 'die) (send-event (handle->process (-> self screen)) 'die) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (while (-> self child) (suspend) ) @@ -1267,6 +1251,7 @@ ) (defmethod deactivate ((this fort-robotank-turret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (logclear! (-> this flags) (robotank-turret-flags rotflags-6)) (sound-stop (-> this turn-sound-id)) (let ((a0-4 (handle->process (-> this screen)))) @@ -1279,11 +1264,11 @@ ) ;; WARN: Return type mismatch process-focusable vs fort-robotank-turret. -(defmethod relocate ((this fort-robotank-turret) (arg0 int)) +(defmethod relocate ((this fort-robotank-turret) (offset int)) (if (nonzero? (-> this gun-elev-jmod)) - (&+! (-> this gun-elev-jmod) arg0) + (&+! (-> this gun-elev-jmod) offset) ) - (the-as fort-robotank-turret ((method-of-type process-focusable relocate) this arg0)) + (the-as fort-robotank-turret ((method-of-type process-focusable relocate) this offset)) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc index bd0f136b89..4730f4e446 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc @@ -769,11 +769,7 @@ ) :code (behavior () (logclear! (-> self flags) (robotank-flags roflags-2)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) - ) + (suspend-for (seconds 0.1)) (logior! (-> self flags) (robotank-flags roflags-2)) (sleep-code) ) @@ -901,11 +897,7 @@ (remove-setting! 'process-mask) (remove-setting! 'target-height) (send-event (handle->process (-> self turret)) 'die) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (while (-> self child) (suspend) ) @@ -914,36 +906,37 @@ ) (defmethod deactivate ((this fort-robotank)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (stop! (-> this idle-sound)) (stop! (-> this barrel-sound)) ((method-of-type process-drawable deactivate) this) (none) ) -(defmethod relocate ((this fort-robotank) (arg0 int)) +(defmethod relocate ((this fort-robotank) (offset int)) (if (nonzero? (-> this barrel-part)) - (&+! (-> this barrel-part) arg0) + (&+! (-> this barrel-part) offset) ) (if (nonzero? (-> this roller-jmod)) - (&+! (-> this roller-jmod) arg0) + (&+! (-> this roller-jmod) offset) ) (if (nonzero? (-> this vibe-jmod)) - (&+! (-> this vibe-jmod) arg0) + (&+! (-> this vibe-jmod) offset) ) (if (nonzero? (-> this idle-sound)) - (&+! (-> this idle-sound) arg0) + (&+! (-> this idle-sound) offset) ) (if (nonzero? (-> this barrel-sound)) - (&+! (-> this barrel-sound) arg0) + (&+! (-> this barrel-sound) offset) ) (let ((v1-20 (-> this path-info))) (when (nonzero? v1-20) (dotimes (a0-2 (-> this path-count)) (if (nonzero? (-> v1-20 data a0-2 path)) - (&+! (-> v1-20 data a0-2 path) arg0) + (&+! (-> v1-20 data a0-2 path) offset) ) ) - (&+! (-> this path-info) arg0) + (&+! (-> this path-info) offset) ) ) (dotimes (v1-24 2) @@ -961,24 +954,24 @@ joint-mod (-> (the-as (pointer uint32) (&+ (&+ (the-as (pointer uint32) this) (* 144 v1-24)) (* a0-4 16))) 55) ) - arg0 + offset ) ) ) ) ) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this fort-robotank) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) diff --git a/goal_src/jak2/levels/fortress/exit/forexita-obs.gc b/goal_src/jak2/levels/fortress/exit/forexita-obs.gc index 41e7082f35..1172ec62e3 100644 --- a/goal_src/jak2/levels/fortress/exit/forexita-obs.gc +++ b/goal_src/jak2/levels/fortress/exit/forexita-obs.gc @@ -191,13 +191,14 @@ ;; WARN: Return type mismatch sound-id vs none. (defmethod init-plat! ((this fort-lift-plat)) "Does any necessary initial platform setup. -For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." + For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this root pause-adjust-distance) 327680.0) (set! (-> this sound-id) (new-sound-id)) (none) ) (defmethod deactivate ((this fort-lift-plat)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this sound-id)) ((method-of-type plat deactivate) this) (none) @@ -205,9 +206,9 @@ For example for an elevator pre-compute the distance between the first and last (defmethod plat-path-sync ((this fort-lift-plat)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] -otherwise, [[plat::34]] + otherwise, [[plat::34]] -@see [[sync-eased]]" + @see [[sync-eased]]" (cond ((logtest? (-> this path flags) (path-control-flag not-found)) (go (method-of-object this plat-idle)) @@ -281,11 +282,11 @@ otherwise, [[plat::34]] ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this fort-claw) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -316,11 +317,7 @@ This commonly includes things such as: () (until #f (sound-play "fortress-alarm") - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) ) #f ) diff --git a/goal_src/jak2/levels/fortress/fort-turret.gc b/goal_src/jak2/levels/fortress/fort-turret.gc index f38ed07eae..f05c45b5e1 100644 --- a/goal_src/jak2/levels/fortress/fort-turret.gc +++ b/goal_src/jak2/levels/fortress/fort-turret.gc @@ -505,9 +505,9 @@ (defmethod common-post ((this fort-turret)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type enemy common-post))) (t9-0 this) ) @@ -732,11 +732,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (until #f (let ((gp-2 7)) (sound-play "gturret") @@ -753,11 +749,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.33)) - (suspend) - ) - ) + (suspend-for (seconds 0.33)) (if (= gp-2 7) (set! gp-2 8) (set! gp-2 9) @@ -765,11 +757,7 @@ ) ) (set! (-> self flash-state) #f) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 1.5)) - (suspend) - ) - ) + (suspend-for (seconds 1.5)) ) #f ) @@ -855,7 +843,7 @@ (defmethod general-event-handler ((this fort-turret) (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" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (if (and (= arg2 'notify) (< 1 arg1) (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) *target*)) (set-time! (-> this last-hit-time)) ) @@ -916,19 +904,10 @@ (sound-play "turret-explode") (suspend) (ja-channel-set! 0) - (let ((gp-2 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node fort-turret-lod0-jg headrotate))) - (s5-2 (current-time)) - ) - (until (time-elapsed? s5-2 (seconds 2)) - (spawn (-> self part) gp-2) - (suspend) - ) - ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 1)) - (suspend) - ) + (let ((gp-2 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node fort-turret-lod0-jg headrotate)))) + (suspend-for (seconds 2) (spawn (-> self part) gp-2)) ) + (suspend-for (seconds 1)) (send-event self 'death-end) (while (-> self child) (suspend) @@ -948,7 +927,7 @@ ;; WARN: Return type mismatch int vs penetrate. (defmethod get-penetrate-info ((this fort-turret)) "@returns the allowed way(s) this enemy can take damage -@see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" + @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (the-as penetrate 0) ) @@ -1011,14 +990,14 @@ ;; ) ;; WARN: Return type mismatch enemy vs fort-turret. -(defmethod relocate ((this fort-turret) (arg0 int)) +(defmethod relocate ((this fort-turret) (offset int)) (if (nonzero? (-> this gun-tilt-jm)) - (&+! (-> this gun-tilt-jm) arg0) + (&+! (-> this gun-tilt-jm) offset) ) (if (nonzero? (-> this gun-shadow-jm)) - (&+! (-> this gun-shadow-jm) arg0) + (&+! (-> this gun-shadow-jm) offset) ) - (the-as fort-turret ((method-of-type enemy relocate) this arg0)) + (the-as fort-turret ((method-of-type enemy relocate) this offset)) ) (defmethod init-enemy! ((this fort-turret)) diff --git a/goal_src/jak2/levels/fortress/fortress-obs.gc b/goal_src/jak2/levels/fortress/fortress-obs.gc index ae1d3ab44e..252483649c 100644 --- a/goal_src/jak2/levels/fortress/fortress-obs.gc +++ b/goal_src/jak2/levels/fortress/fortress-obs.gc @@ -127,11 +127,7 @@ ) (suspend) (ja-channel-set! 0) - (let ((frame-counter (current-time))) - (until (time-elapsed? frame-counter (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event self 'death-end) (while (-> self child) (suspend) @@ -144,11 +140,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this fort-trap-door) (entity 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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec obstacle)) diff --git a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc index 61ae287dcc..c077453825 100644 --- a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc @@ -161,11 +161,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this fort-led) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -220,20 +220,12 @@ This commonly includes things such as: (let ((a0-0 *target*)) (when (and a0-0 (< 81920.0 (vector-vector-distance (get-trans a0-0 0) (-> self root trans)))) (set! (-> self quality-enabled?) #f) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (hide-hud-quick #f) (set-setting! 'entity-name "camera-243" 0.0 0) (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (process-grab? *target* #f) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) ) (go-virtual shutdown) @@ -326,11 +318,7 @@ This commonly includes things such as: ) :code (behavior () (until (-> self all-gone?) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) ) (set-setting! 'interp-time 'abs 0.0 0) (remove-setting! 'entity-name) @@ -368,9 +356,9 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod set-state! ((this elec-lock-gate)) "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed -make the gate `idle`. + make the gate `idle`. -Otherwise, the gate will be `active`." + Otherwise, the gate will be `active`." (if (elec-lock-gate-method-31 this #f) (go (method-of-object this shutdown)) ((method-of-type fort-elec-gate set-state!) this) diff --git a/goal_src/jak2/levels/gungame/gungame-obs.gc b/goal_src/jak2/levels/gungame/gungame-obs.gc index 4596f924c4..5afc0708d8 100644 --- a/goal_src/jak2/levels/gungame/gungame-obs.gc +++ b/goal_src/jak2/levels/gungame/gungame-obs.gc @@ -138,6 +138,7 @@ ) (defmethod deactivate ((this training-manager)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (handle->process (-> this voicebox)) (send-event (handle->process (-> this voicebox)) 'die) ) @@ -150,11 +151,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this training-path) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s5-0 (length "training-path-")) (a0-3 (length (-> this name))) (v1-2 0) @@ -2142,11 +2143,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this training-manager) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (set-setting! 'darkjak #f 0.0 0) (set! sv-16 (new 'static 'res-tag)) @@ -2265,12 +2266,7 @@ This commonly includes things such as: ) :code (behavior () (sound-play "gungame-door") - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.2)) - (suspend) - (suspend) - ) - ) + (suspend-for (seconds 0.2) (suspend)) (ja-no-eval :group! fort-entry-gate-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -2412,11 +2408,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this gungame-door) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) diff --git a/goal_src/jak2/levels/intro/intro-obs.gc b/goal_src/jak2/levels/intro/intro-obs.gc index ef53a2f8e9..4d829fcded 100644 --- a/goal_src/jak2/levels/intro/intro-obs.gc +++ b/goal_src/jak2/levels/intro/intro-obs.gc @@ -201,11 +201,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this intro-flamer) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -307,12 +307,8 @@ This commonly includes things such as: (-> s5-0 ppointer) ) ) - (let ((s5-1 (the int (* 300.0 (rand-vu-float-range 0.03 0.08)))) - (s4-0 (current-time)) - ) - (until (time-elapsed? s4-0 s5-1) - (suspend) - ) + (let ((s5-1 (the int (* 300.0 (rand-vu-float-range 0.03 0.08))))) + (suspend-for s5-1) ) ) ) @@ -341,23 +337,23 @@ This commonly includes things such as: ) ) -(defmethod relocate ((this metalhead-spawner) (arg0 int)) +(defmethod relocate ((this metalhead-spawner) (offset int)) (dotimes (v1-0 19) (if (nonzero? (-> this path-tbl v1-0)) - (&+! (-> this path-tbl v1-0) arg0) + (&+! (-> this path-tbl v1-0) offset) ) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this metalhead-spawner) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this init-pos quad) (-> arg0 extra trans quad)) (vector-reset! (-> this average-dir)) (dotimes (s5-0 19) @@ -409,11 +405,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this vil-windmill-sail) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak2/levels/intro/intro-scenes.gc b/goal_src/jak2/levels/intro/intro-scenes.gc index 08b8fd0c1f..b6b904d95e 100644 --- a/goal_src/jak2/levels/intro/intro-scenes.gc +++ b/goal_src/jak2/levels/intro/intro-scenes.gc @@ -2171,14 +2171,10 @@ (lambda :behavior scene-player () (talker-spawn-func (-> *talker-speech* 123) self (target-pos 0) (the-as region #f)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 5)) - (if (cpad-pressed? 0 square) - (return #f) - ) - (suspend) - ) - ) + (suspend-for (seconds 5) (if (cpad-pressed? 0 square) + (return #f) + ) + ) #f ) :to self @@ -2236,43 +2232,41 @@ (set! (-> gp-0 scale-x) 1.0) (set! (-> gp-0 scale-y) 1.0) (when (and s5-0 (-> gp-0 tex)) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 (seconds 5)) - (let ((f0-2 1.0)) - (cond - ((< f30-0 2.0) - (set! f0-2 (* 0.5 f30-0)) - ) - ((< 3.0 f30-0) - (set! f0-2 (* 0.5 (- 5.0 f30-0))) - ) - ) - (set! (-> gp-0 color w) (the int (* 128.0 f0-2))) + (suspend-for + (seconds 5) + (let ((f0-2 1.0)) + (cond + ((< f30-0 2.0) + (set! f0-2 (* 0.5 f30-0)) + ) + ((< 3.0 f30-0) + (set! f0-2 (* 0.5 (- 5.0 f30-0))) + ) ) - (let* ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf)) - (s3-0 (-> s2-0 base)) - ) - (draw gp-0 s2-0 s5-0) - (let ((a3-0 (-> s2-0 base))) - (let ((v1-31 (the-as object (-> s2-0 base)))) - (set! (-> (the-as dma-packet v1-31) dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> (the-as dma-packet v1-31) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-31) vif1) (new 'static 'vif-tag)) - (set! (-> s2-0 base) (&+ (the-as pointer v1-31) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) bucket-group) - (bucket-id subtitle) - s3-0 - (the-as (pointer dma-tag) a3-0) - ) - ) - ) - (if (not (paused?)) - (+! f30-0 (seconds-per-frame)) - ) - (suspend) + (set! (-> gp-0 color w) (the int (* 128.0 f0-2))) ) + (let* ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s3-0 (-> s2-0 base)) + ) + (draw gp-0 s2-0 s5-0) + (let ((a3-0 (-> s2-0 base))) + (let ((v1-31 (the-as object (-> s2-0 base)))) + (set! (-> (the-as dma-packet v1-31) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-31) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-31) vif1) (new 'static 'vif-tag)) + (set! (-> s2-0 base) (&+ (the-as pointer v1-31) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id subtitle) + s3-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + (if (not (paused?)) + (+! f30-0 (seconds-per-frame)) + ) ) #f ) @@ -2361,47 +2355,45 @@ ) ) (when (and s4-0 (-> gp-0 tex)) - (let ((s3-0 (current-time))) - (until (time-elapsed? s3-0 (seconds 8)) - (let ((f0-6 1.0)) - (cond - ((< f30-0 2.0) - (set! f0-6 (* 0.5 f30-0)) - ) - ((< 6.0 f30-0) - (set! f0-6 (* 0.5 (- 8.0 f30-0))) - ) - ) - (set! (-> gp-0 color w) (the int (* 128.0 f0-6))) - (set! (-> s5-0 color w) (the int (* 128.0 f0-6))) + (suspend-for + (seconds 8) + (let ((f0-6 1.0)) + (cond + ((< f30-0 2.0) + (set! f0-6 (* 0.5 f30-0)) + ) + ((< 6.0 f30-0) + (set! f0-6 (* 0.5 (- 8.0 f30-0))) + ) ) - (let* ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf)) - (s2-0 (-> s1-0 base)) - ) - (draw gp-0 s1-0 s4-0) - (if (-> s5-0 tex) - (draw s5-0 s1-0 s4-0) - ) - (let ((a3-0 (-> s1-0 base))) - (let ((v1-59 (the-as object (-> s1-0 base)))) - (set! (-> (the-as dma-packet v1-59) dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> (the-as dma-packet v1-59) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-59) vif1) (new 'static 'vif-tag)) - (set! (-> s1-0 base) (&+ (the-as pointer v1-59) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) bucket-group) - (bucket-id subtitle) - s2-0 - (the-as (pointer dma-tag) a3-0) - ) - ) - ) - (if (not (paused?)) - (+! f30-0 (seconds-per-frame)) - ) - (suspend) + (set! (-> gp-0 color w) (the int (* 128.0 f0-6))) + (set! (-> s5-0 color w) (the int (* 128.0 f0-6))) ) + (let* ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-0 (-> s1-0 base)) + ) + (draw gp-0 s1-0 s4-0) + (if (-> s5-0 tex) + (draw s5-0 s1-0 s4-0) + ) + (let ((a3-0 (-> s1-0 base))) + (let ((v1-59 (the-as object (-> s1-0 base)))) + (set! (-> (the-as dma-packet v1-59) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-59) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-59) vif1) (new 'static 'vif-tag)) + (set! (-> s1-0 base) (&+ (the-as pointer v1-59) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id subtitle) + s2-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + (if (not (paused?)) + (+! f30-0 (seconds-per-frame)) + ) ) #f ) diff --git a/goal_src/jak2/levels/mountain/mountain-obs.gc b/goal_src/jak2/levels/mountain/mountain-obs.gc index 11e8a25633..037cd8921f 100644 --- a/goal_src/jak2/levels/mountain/mountain-obs.gc +++ b/goal_src/jak2/levels/mountain/mountain-obs.gc @@ -1287,11 +1287,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this mtn-dice) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 6) 0))) (set! (-> s4-0 total-prims) (the-as uint 7)) @@ -1457,10 +1457,10 @@ This commonly includes things such as: (defmethod move-between-points ((this mtn-plat-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path -@param vec TODO not sure -@param point-a The first point fetched from the elevator's path -@param point-b The second point fetched from the path -@see [[path-control]] and [[elevator]]" + @param vec TODO not sure + @param point-a The first point fetched from the elevator's path + @param point-b The second point fetched from the path + @see [[path-control]] and [[elevator]]" (let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) ) @@ -1565,11 +1565,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this mtn-plat-updown) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-plat-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1701,11 +1701,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this mtn-plat-eject) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (mtn-plat-eject-method-22 this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1793,11 +1793,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this mtn-plat-long) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-plat-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1861,21 +1861,13 @@ This commonly includes things such as: (suspend) ) (set-setting! 'entity-name "camera-259" 0.0 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (until (process-release? *target*) (suspend) ) @@ -1887,11 +1879,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this mtn-gate) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -1956,11 +1948,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch process-drawable vs mtn-aval-rocks. -(defmethod relocate ((this mtn-aval-rocks) (arg0 int)) +(defmethod relocate ((this mtn-aval-rocks) (offset int)) (if (nonzero? (-> this rock-data)) - (&+! (-> this rock-data) arg0) + (&+! (-> this rock-data) offset) ) - (the-as mtn-aval-rocks ((method-of-type process-drawable relocate) this arg0)) + (the-as mtn-aval-rocks ((method-of-type process-drawable relocate) this offset)) ) (deftype mtn-aval-rocks-shadow (process-drawable) @@ -2339,11 +2331,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this mtn-aval-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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 collide-shape-prim-sphere) (sv-48 collide-shape-prim-sphere) (sv-64 vector)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) @@ -2644,11 +2636,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this mtn-plat-return) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-plat-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2811,11 +2803,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this mtn-button) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -2914,11 +2906,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this mtn-gear-device) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (cond ((task-complete? *game-info* (game-task mountain-gear)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) @@ -3210,7 +3202,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch float vs none. (defmethod init-plat! ((this trans-plat)) "Does any necessary initial platform setup. -For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." + For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (logior! (-> this flags) (mtn-plat-flags mtpflags-1)) (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) diff --git a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc index e29ad32473..fd3e34bb3e 100644 --- a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc +++ b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc @@ -20,17 +20,9 @@ (set! (-> a1-0 message) 'test-pickup) (set! (-> a1-0 param 0) (the-as uint 7)) (let ((f30-0 (send-event-function *target* a1-0))) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) - ) + (suspend-for (seconds 0.1)) (send-event *target* 'change-mode 'darkjak #f (darkjak-stage no-anim)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.1)) - (suspend) - ) - ) + (suspend-for (seconds 0.1)) (send-event *target* 'get-pickup (pickup-type eco-pill-dark) f30-0) ) ) @@ -1638,11 +1630,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this nest-gun-parts) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1687,11 +1679,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this 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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak2/levels/nest/mantis.gc b/goal_src/jak2/levels/nest/mantis.gc index 135935ce91..a826283f8a 100644 --- a/goal_src/jak2/levels/nest/mantis.gc +++ b/goal_src/jak2/levels/nest/mantis.gc @@ -523,17 +523,9 @@ ) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.6)) - (suspend) - ) - ) + (suspend-for (seconds 0.6)) (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) (logclear! (-> self draw status) (draw-control-status no-draw)) (if (rnd-percent? self 0.5) (go-virtual ambush-jumping) @@ -637,14 +629,10 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (if (logtest? (-> self root status) (collide-status on-ground)) - (goto cfg-32) - ) - (suspend) - ) - ) + (suspend-for (seconds 1) (if (logtest? (-> self root status) (collide-status on-ground)) + (goto cfg-32) + ) + ) (label cfg-32) (go-virtual hostile) ) @@ -1188,7 +1176,7 @@ (defmethod general-event-handler ((this mantis) (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" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('track) (if (and (-> arg3 param 0) (time-elapsed? (-> this track-timer) (seconds 0.5))) @@ -1437,9 +1425,9 @@ ;; WARN: Return type mismatch vector vs none. (defmethod common-post ((this mantis)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (local-vars (s5-0 vector)) (let ((t9-0 (method-of-type nav-enemy common-post))) (t9-0 this) diff --git a/goal_src/jak2/levels/nest/nest-obs.gc b/goal_src/jak2/levels/nest/nest-obs.gc index 6c904eecdc..da8a0c51d9 100644 --- a/goal_src/jak2/levels/nest/nest-obs.gc +++ b/goal_src/jak2/levels/nest/nest-obs.gc @@ -90,22 +90,16 @@ (set! (-> self root trans y) (+ (-> self y-start) (-> self y-delta))) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (seek! (-> self y-rot-rate) 0.0 (* 4000.0 (seconds-per-frame))) - (quaternion-rotate-y! - (-> self root quat) - (-> self root quat) - (* 182.04445 (seconds-per-frame) (-> self y-rot-rate)) - ) - (suspend) - ) - ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) + (suspend-for + (seconds 1) + (seek! (-> self y-rot-rate) 0.0 (* 4000.0 (seconds-per-frame))) + (quaternion-rotate-y! + (-> self root quat) + (-> self root quat) + (* 182.04445 (seconds-per-frame) (-> self y-rot-rate)) ) ) + (suspend-for (seconds 1)) (remove-setting! 'entity-name) (remove-setting! 'process-mask) (process-release? *target*) @@ -118,11 +112,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this nest-switch) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) @@ -204,11 +198,7 @@ This commonly includes things such as: :virtual #t :trans rider-trans :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (while (< (-> self y-offset) 16384.0) (seek! (-> self y-offset) 16384.0 (* 8192.0 (seconds-per-frame))) (set! (-> self root trans y) (+ (-> self y-level) (-> self y-offset))) @@ -223,11 +213,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this nest-piston) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) diff --git a/goal_src/jak2/levels/sewer/sew-gunturret.gc b/goal_src/jak2/levels/sewer/sew-gunturret.gc index eb4431966e..dc2355a9b2 100644 --- a/goal_src/jak2/levels/sewer/sew-gunturret.gc +++ b/goal_src/jak2/levels/sewer/sew-gunturret.gc @@ -520,7 +520,7 @@ (defmethod aim-turret! ((this sew-gunturret) (aim-at-target? symbol)) "Calculates the angle and tilt for the turret to either aim at the target, or it's default direction -@param aim-at-target? Whether or not the turret should aim at the target, will ignore the target if #f" + @param aim-at-target? Whether or not the turret should aim at the target, will ignore the target if #f" (cond ((and aim-at-target? (-> this los-clear)) (let ((target-proc (handle->process (-> this focus handle)))) @@ -642,7 +642,7 @@ (defmethod fire-turret! ((this sew-gunturret) (fire-sound? symbol)) "Actually fires the turret, sets `flash-state` to [[#t]] -@param fire-sound? Whether to play the fire sound effect or not" + @param fire-sound? Whether to play the fire sound effect or not" (let ((v1-4 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params gun-joint)))) (proj-params (new 'stack-no-clear 'projectile-init-by-other-params)) ) @@ -722,51 +722,42 @@ ) (update-collision! self) (sound-play "sew-gun-lock") - (let ((frame-counter (current-time))) - (until (time-elapsed? frame-counter (seconds 0.75)) - (aim-turret! self #t) - (suspend) - ) - ) + (suspend-for (seconds 0.75) (aim-turret! self #t)) (ja :group! (-> self draw art-group data (-> self params shoot-anim))) (let ((frames 0) (fire-sound? #t) ) (sound-play "gturret") - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.125)) - (cond - ((not (-> self can-shoot)) - ) - ((time-elapsed? (the-as time-frame frames) (seconds 0.05)) - (fire-turret! self fire-sound?) - (set! frames (the-as int (current-time))) - (set! fire-sound? (not fire-sound?)) - ) - (else - (set! (-> self flash-state) #f) - ) + (suspend-for + (seconds 0.125) + (cond + ((not (-> self can-shoot)) + ) + ((time-elapsed? (the-as time-frame frames) (seconds 0.05)) + (fire-turret! self fire-sound?) + (set! frames (the-as int (current-time))) + (set! fire-sound? (not fire-sound?)) + ) + (else + (set! (-> self flash-state) #f) ) - (ja :num! (loop!)) - (suspend) ) + (ja :num! (loop!)) ) ) (set! (-> self flash-state) #f) (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data (-> self params idle-anim))) - (let ((_frame-counter (current-time))) - (until (time-elapsed? _frame-counter (seconds 0.5)) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 0))) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 1))) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 2))) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 3))) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 4))) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 5))) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 6))) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 7))) - (suspend) - ) + (suspend-for + (seconds 0.5) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 0))) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 1))) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 2))) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 3))) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 4))) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 5))) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 6))) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 7))) ) ) #f @@ -789,7 +780,7 @@ (defmethod general-event-handler ((this sew-gunturret) (proc process) (arg2 int) (event-type symbol) (event 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" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (if (and (= event-type 'notify) (< 1 arg2) (= (-> event param 0) 'attack) (= (-> event param 1) *target*)) (set-time! (-> this last-hit-time)) ) @@ -854,18 +845,9 @@ (let ((vec (new 'stack-no-clear 'vector))) (set! (-> vec quad) (-> self root trans quad)) (+! (-> vec y) 10240.0) - (let ((frame-counter (current-time))) - (until (time-elapsed? frame-counter (seconds 2)) - (spawn (-> self part) vec) - (suspend) - ) - ) - ) - (let ((_frame-counter (current-time))) - (until (time-elapsed? _frame-counter (seconds 1)) - (suspend) - ) + (suspend-for (seconds 2) (spawn (-> self part) vec)) ) + (suspend-for (seconds 1)) (send-event self 'death-end) (while (-> self child) (suspend) @@ -938,10 +920,10 @@ (defmethod in-aggro-range? ((this sew-gunturret) (proc process-focusable) (arg1 vector)) "Should the enemy activate. -- if `activate-distance` is `0.0`, always true -- otherwise, check if the provided process is close enough -@param proc The process used to distance check -@returns true/false" + - if `activate-distance` is `0.0`, always true + - otherwise, check if the provided process is close enough + @param proc The process used to distance check + @returns true/false" (cond ((= (-> this activate-distance) 0.0) (return #t) @@ -961,6 +943,7 @@ ) (defmethod deactivate ((this sew-gunturret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (nonzero? (-> this smoke-part)) (kill-and-free-particles (-> this smoke-part)) ) @@ -977,17 +960,17 @@ ) ;; WARN: Return type mismatch enemy vs sew-gunturret. -(defmethod relocate ((this sew-gunturret) (arg0 int)) +(defmethod relocate ((this sew-gunturret) (offset int)) (if (nonzero? (-> this gun-tilt-jm)) - (&+! (-> this gun-tilt-jm) arg0) + (&+! (-> this gun-tilt-jm) offset) ) (if (nonzero? (-> this smoke-part)) - (&+! (-> this smoke-part) arg0) + (&+! (-> this smoke-part) offset) ) (if (nonzero? (-> this casing-part)) - (&+! (-> this casing-part) arg0) + (&+! (-> this casing-part) offset) ) - (the-as sew-gunturret ((method-of-type enemy relocate) this arg0)) + (the-as sew-gunturret ((method-of-type enemy relocate) this offset)) ) (defmethod init-turret-params! ((this sew-gunturret)) diff --git a/goal_src/jak2/levels/sewer/sewer-obs2.gc b/goal_src/jak2/levels/sewer/sewer-obs2.gc index 1add5309a2..03c16aed46 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs2.gc @@ -28,10 +28,10 @@ (defmethod move-between-points ((this sew-elevator) (arg1 vector) (point-a float) (point-b float)) "Move between two points on the elevator's path -@param vec TODO not sure -@param point-a The first point fetched from the elevator's path -@param point-b The second point fetched from the path -@see [[path-control]] and [[elevator]]" + @param vec TODO not sure + @param point-a The first point fetched from the elevator's path + @param point-b The second point fetched from the path + @see [[path-control]] and [[elevator]]" (let ((path-point-a (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) point-a 'interp)) (path-point-b (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) point-b 'interp)) (elevator-pos (-> this root trans)) @@ -69,7 +69,7 @@ (defmethod configure-collision ((this sew-elevator) (collide-with-jak? symbol)) "Appropriately sets the collision on the elevator -@param collide-with-jak? If set, the elevator will collide with Jak" + @param collide-with-jak? If set, the elevator will collide with Jak" (let ((prim-group (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (collide-with-jak? @@ -131,6 +131,7 @@ ) (defmethod deactivate ((this sew-elevator)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -138,7 +139,7 @@ (defmethod init-plat! ((this sew-elevator)) "Does any necessary initial platform setup. -For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." + For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this sound-id) (new-sound-id)) 0 (none) @@ -146,11 +147,11 @@ For example for an elevator pre-compute the distance between the first and last (defmethod init-defaults! ((this sew-elevator)) "Initializes default settings related to the [[elevator]]: -- `elevator-xz-threshold` -- `elevator-y-threshold` -- `elevator-start-pos` -- `elevator-move-rate` -- `elevator-flags`" + - `elevator-xz-threshold` + - `elevator-y-threshold` + - `elevator-start-pos` + - `elevator-move-rate` + - `elevator-flags`" (let ((func (method-of-type elevator init-defaults!))) (func this) ) @@ -305,21 +306,21 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod relocate ((this sew-valve) (arg0 int)) +(defmethod relocate ((this sew-valve) (offset int)) (if (nonzero? (-> this joint)) - (&+! (-> this joint) arg0) + (&+! (-> this joint) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this sew-valve) (entity 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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (tag-1 res-tag) (tag-2 res-tag)) (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) @@ -526,6 +527,7 @@ This commonly includes things such as: ) (defmethod run-logic? ((this sew-mar-statue)) + "Should this process be run? Checked by execute-process-tree." #t ) @@ -558,11 +560,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this sew-mar-statue) (entity 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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this spawned-debris?) #f) (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) @@ -616,8 +618,8 @@ This commonly includes things such as: (defmethod start-bouncing! ((this sew-catwalk)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce -and translate the platform via the `smush` -@see [[smush-control]]" + and translate the platform via the `smush` + @see [[smush-control]]" (logclear! (-> this mask) (process-mask sleep)) (logclear! (-> this mask) (process-mask sleep-code)) 0 @@ -660,11 +662,11 @@ and translate the platform via the `smush` ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this sew-catwalk) (entity 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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape-moving)) (stack-size-set! (-> this main-thread) 512) (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -859,11 +861,7 @@ This commonly includes things such as: ) ) (cleanup-for-death self) - (let ((frame-counter (current-time))) - (until (time-elapsed? frame-counter (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) ) @@ -888,11 +886,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this sew-mine-a) (entity 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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec pusher)) @@ -968,11 +966,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this sew-mine-b) (entity 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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec pusher)) @@ -1192,11 +1190,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this sew-wall) (entity 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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (stack-size-set! (-> this main-thread) 512) (logior! (-> this mask) (process-mask collectable)) (let ((data ((method-of-type res-lump get-property-struct) @@ -1336,11 +1334,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this sew-grill) (entity 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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this entity) (initialize-skeleton diff --git a/goal_src/jak2/levels/stadium/skate/skatea-obs.gc b/goal_src/jak2/levels/stadium/skate/skatea-obs.gc index 7f43097cff..51b9d596aa 100644 --- a/goal_src/jak2/levels/stadium/skate/skatea-obs.gc +++ b/goal_src/jak2/levels/stadium/skate/skatea-obs.gc @@ -339,11 +339,7 @@ (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event (handle->process (-> self voicebox)) 'speak-effect #t) (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei006" -99.0 0) @@ -379,11 +375,7 @@ (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event (handle->process (-> self voicebox)) 'speak-effect #t) (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei008" -99.0 0) @@ -452,11 +444,7 @@ (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei013" -99.0 0) ) @@ -517,11 +505,7 @@ (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event (handle->process (-> self voicebox)) 'speak-effect #t) (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei010" -99.0 0) @@ -557,11 +541,7 @@ (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event (handle->process (-> self voicebox)) 'speak-effect #t) (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei016" -99.0 0) @@ -594,11 +574,7 @@ (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event (handle->process (-> self voicebox)) 'speak-effect #t) (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei017" -99.0 0) @@ -1081,11 +1057,7 @@ ) ) ) - (let ((s5-2 (current-time))) - (until (time-elapsed? s5-2 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event (handle->process gp-3) 'die) ) ) @@ -1289,11 +1261,7 @@ ) ) ) - (let ((s5-2 (current-time))) - (until (time-elapsed? s5-2 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event (handle->process gp-2) 'die) ) ) @@ -1310,6 +1278,7 @@ ) (defmethod deactivate ((this hoverboard-training-manager)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (send-event *traffic-manager* 'restore-default-settings) (call-parent-method this) (none) @@ -1318,11 +1287,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this hoverboard-training-manager) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" ;; og:preserve-this added (stack-size-set! (-> this main-thread) 1024) (local-vars (sv-16 res-tag)) @@ -1490,11 +1459,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this skate-training-ramp) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (skate-training-ramp-method-28 this) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1611,11 +1580,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this skate-gate) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (skate-gate-method-29 this) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1853,11 +1822,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this skatea-floating-ring) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (skatea-floating-ring-method-28 this) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak2/levels/stadium/stadium-obs.gc b/goal_src/jak2/levels/stadium/stadium-obs.gc index cb706754c3..f26ca34e10 100644 --- a/goal_src/jak2/levels/stadium/stadium-obs.gc +++ b/goal_src/jak2/levels/stadium/stadium-obs.gc @@ -66,11 +66,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this dummy-vehicle) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -174,11 +174,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this gar-curtain) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 8) 0))) @@ -857,11 +857,7 @@ This commonly includes things such as: ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1.2)) - (suspend) - ) - ) + (suspend-for (seconds 1.2)) (rigid-body-object-method-39 self) (sleep-code) ) @@ -1062,11 +1058,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this spotlight) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1092,11 +1088,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this gar-door) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" ;; og:preserve-this added (stack-size-set! (-> this main-thread) 560) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -1454,11 +1450,7 @@ This commonly includes things such as: ) ) (set! (-> self rift-rider-actor) (entity-actor-lookup (-> self entity) 'alt-actor 0)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.31)) - (suspend) - ) - ) + (suspend-for (seconds 0.31)) ) (ja-no-eval :group! (-> self draw art-group data (-> self stand-anim)) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -1878,11 +1870,7 @@ This commonly includes things such as: ) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (send-event *camera* 'change-target #f) (cleanup-for-death self) ) @@ -1948,11 +1936,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this stad-samos) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" ;; og:preserve-this added (stack-size-set! (-> this main-thread) #x180) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) @@ -2232,11 +2220,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch entity-perm-status vs none. (defmethod init-from-entity! ((this stadium-barrier) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -2568,11 +2556,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this stad-force-field) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (stad-force-field-method-28 this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2601,11 +2589,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this stad-c-force-field) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (stad-force-field-method-28 this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2634,11 +2622,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this stad-d-force-field) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (stad-force-field-method-28 this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2858,11 +2846,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this brutter-balloon) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) diff --git a/goal_src/jak2/levels/title/title-obs.gc b/goal_src/jak2/levels/title/title-obs.gc index 3a4ce493a7..fcf28b96bf 100644 --- a/goal_src/jak2/levels/title/title-obs.gc +++ b/goal_src/jak2/levels/title/title-obs.gc @@ -35,16 +35,17 @@ ;; WARN: Return type mismatch process vs title-control. -(defmethod relocate ((this title-control) (arg0 int)) +(defmethod relocate ((this title-control) (offset int)) (dotimes (v1-0 2) (if (nonzero? (-> this buffer v1-0)) - (&+! (-> this buffer v1-0) arg0) + (&+! (-> this buffer v1-0) offset) ) ) - (the-as title-control ((method-of-type process relocate) this arg0)) + (the-as title-control ((method-of-type process relocate) this offset)) ) (defmethod deactivate ((this title-control)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (dotimes (s5-0 2) (set-pending-file (-> this buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) @@ -555,11 +556,7 @@ (defun title-fade-out ((arg0 float)) (setup *screen-filter* (new 'static 'vector) (new 'static 'vector :w 128.0) arg0 (bucket-id screen-filter)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.4)) - (suspend) - ) - ) + (suspend-for (seconds 0.4)) (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) (set! (-> *setting-control* user-current bg-a) 0.0) (while (or (-> *setting-control* user-current movie) diff --git a/goal_src/jak2/levels/tomb/target-indax.gc b/goal_src/jak2/levels/tomb/target-indax.gc index ebf847a611..b28a0ab668 100644 --- a/goal_src/jak2/levels/tomb/target-indax.gc +++ b/goal_src/jak2/levels/tomb/target-indax.gc @@ -1234,11 +1234,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (move-to-point! (-> self control) s4-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) diff --git a/goal_src/jak2/levels/tomb/tomb-beetle.gc b/goal_src/jak2/levels/tomb/tomb-beetle.gc index 53e0cdd4a1..f083dce4cb 100644 --- a/goal_src/jak2/levels/tomb/tomb-beetle.gc +++ b/goal_src/jak2/levels/tomb/tomb-beetle.gc @@ -187,7 +187,7 @@ (defmethod general-event-handler ((this tomb-beetle) (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" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (let ((v1-0 (new 'static 'array int64 2 -1 0))) (case arg2 (('cue-chase) @@ -730,11 +730,7 @@ (-> gp-1 ppointer) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) :post nav-enemy-simple-post ) diff --git a/goal_src/jak2/levels/tomb/tomb-water.gc b/goal_src/jak2/levels/tomb/tomb-water.gc index 49325adb8a..c283b902e1 100644 --- a/goal_src/jak2/levels/tomb/tomb-water.gc +++ b/goal_src/jak2/levels/tomb/tomb-water.gc @@ -123,11 +123,7 @@ ) ) :code (behavior ((arg0 time-frame)) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 arg0) - (suspend) - ) - ) + (suspend-for arg0) (ja-no-eval :group! tomb-door-open-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (-> self root quat) @@ -142,11 +138,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this tomb-door) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -311,11 +307,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this tomb-beetle-door) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) @@ -642,9 +638,9 @@ This commonly includes things such as: ;; WARN: Return type mismatch symbol vs none. (defmethod send-event! ((this tomb-beetle-button) (arg0 symbol)) "Prepares an [[event-message-block]] using the provided type to send an event to: -- the `notify-actor` -- every [[entity-actor]] in the `actor-group` array -@see [[entity-actor]]" + - the `notify-actor` + - every [[entity-actor]] in the `actor-group` array + @see [[entity-actor]]" (when arg0 (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer self)) @@ -942,11 +938,7 @@ This commonly includes things such as: ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (go-virtual show-sequence) ) ) @@ -1012,21 +1004,21 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs tomb-plat-simon. -(defmethod relocate ((this tomb-plat-simon) (arg0 int)) +(defmethod relocate ((this tomb-plat-simon) (offset int)) (if (nonzero? (-> this plat)) - (&+! (-> this plat) arg0) + (&+! (-> this plat) offset) ) - (the-as tomb-plat-simon ((method-of-type process-drawable relocate) this arg0)) + (the-as tomb-plat-simon ((method-of-type process-drawable relocate) this offset)) ) ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this tomb-plat-simon) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -1403,17 +1395,9 @@ This commonly includes things such as: :virtual #t :code (behavior () (set! (-> self move-rate) (* 4096.0 (rand-vu-float-range 0.5 1.5))) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 0.25)) (logclear! (-> self root root-prim prim-core action) (collide-action rideable)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (cleanup-for-death self) ) :post (behavior () @@ -1644,11 +1628,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this tomb-simon-button) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) (set! (-> s4-0 total-prims) (the-as uint 6)) @@ -1805,11 +1789,7 @@ This commonly includes things such as: ) ) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.45)) - (suspend) - ) - ) + (suspend-for (seconds 0.45)) ) #f ) @@ -1947,11 +1927,7 @@ This commonly includes things such as: 0 ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (persist-with-delay *setting-control* (the-as symbol (process->ppointer self)) @@ -1961,11 +1937,7 @@ This commonly includes things such as: 0.0 (+ (-> self pat-tbl (-> self pat-index)) 18) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (process-grab? *target* #f) (let ((gp-2 (current-time)) (s5-0 540) @@ -2052,11 +2024,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this tomb-vibe) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag) (sv-32 res-tag)) (with-pp (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) @@ -2254,10 +2226,9 @@ This commonly includes things such as: :code (behavior () (until #f (set! (-> self can-exit-running?) #f) - (let ((gp-0 0) - (s5-0 (current-time)) - ) - (until (time-elapsed? s5-0 (-> self on-duration)) + (let ((gp-0 0)) + (suspend-for + (-> self on-duration) (when (< (-> self harmless-time) (current-time)) (tomb-water-trap-method-22 self) (dotimes (s4-0 (+ (-> self path curve num-cverts) -1)) @@ -2295,29 +2266,19 @@ This commonly includes things such as: (+! gp-0 1) ) ) - (suspend) ) ) (set! (-> self can-exit-running?) #t) (let ((gp-1 90)) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 gp-1) - (suspend) - ) - ) - (let ((s5-2 #f) - (s4-2 (current-time)) - ) - (until (time-elapsed? - s4-2 - (the-as time-frame (- (- (-> self sync period) (the-as uint (-> self on-duration))) (the-as uint gp-1))) - ) - (when (and (not s5-2) (time-elapsed? s4-2 (seconds 0.3))) + (suspend-for gp-1) + (let ((s5-2 #f)) + (suspend-for + (the-as time-frame (- (- (-> self sync period) (the-as uint (-> self on-duration))) (the-as uint gp-1))) + (when (and (not s5-2) (time-elapsed? time (seconds 0.3))) (set! s5-2 #t) (set-tombc-electricity-scale! 0.0) ) (seek! (-> self volume) 0.0 (* 2.0 (seconds-per-frame))) - (suspend) ) ) ) @@ -2424,21 +2385,21 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs tomb-water-trap. -(defmethod relocate ((this tomb-water-trap) (arg0 int)) +(defmethod relocate ((this tomb-water-trap) (offset int)) (if (nonzero? (-> this l-index)) - (&+! (-> this l-index) arg0) + (&+! (-> this l-index) offset) ) - (the-as tomb-water-trap ((method-of-type process-drawable relocate) this arg0)) + (the-as tomb-water-trap ((method-of-type process-drawable relocate) this offset)) ) ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this tomb-water-trap) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (let ((a1-3 (new 'stack-no-clear 'sync-info-params))) @@ -2617,11 +2578,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this tomb-smash-door) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) diff --git a/goal_src/jak2/levels/under/under-sig-obs.gc b/goal_src/jak2/levels/under/under-sig-obs.gc index 7b050b7057..9170f834b2 100644 --- a/goal_src/jak2/levels/under/under-sig-obs.gc +++ b/goal_src/jak2/levels/under/under-sig-obs.gc @@ -107,7 +107,7 @@ (defmethod init-plat! ((this under-plat-shoot)) "Does any necessary initial platform setup. -For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." + For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (logclear! (-> this mask) (process-mask actor-pause)) (logior! (-> this mask) (process-mask enemy)) (set-vector! (-> this axe-flip) 1.0 0.0 0.0 1.0) @@ -403,9 +403,9 @@ For example for an elevator pre-compute the distance between the first and last (defmethod plat-path-sync ((this under-plat-shoot)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] -otherwise, [[plat::34]] + otherwise, [[plat::34]] -@see [[sync-eased]]" + @see [[sync-eased]]" (cond ((and (script-eval (the-as pair (-> this draw-test-script))) (= *bot-record-path* -1)) (go (method-of-object this dormant)) @@ -505,11 +505,7 @@ otherwise, [[plat::34]] ) (suspend) (ja-channel-set! 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event self 'death-end) (while (-> self child) (suspend) @@ -529,11 +525,11 @@ otherwise, [[plat::34]] ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this under-break-floor) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -620,11 +616,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this under-break-wall) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -738,11 +734,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this under-break-bridge) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (set! (-> this bridge-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -867,11 +863,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this under-int-door) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) @@ -1014,11 +1010,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this under-plat-long) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (init-plat-collision! this) (process-drawable-from-entity! this arg0) @@ -1150,11 +1146,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this under-plat-wall) (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: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this extended-amount) 0.0) (logior! (-> this mask) (process-mask platform)) (set! (-> this clock) (-> *display* user0-clock)) diff --git a/goal_src/jak3/engine/ambient/ambient.gc b/goal_src/jak3/engine/ambient/ambient.gc index 51d96ffd91..c38ebe4c9a 100644 --- a/goal_src/jak3/engine/ambient/ambient.gc +++ b/goal_src/jak3/engine/ambient/ambient.gc @@ -382,11 +382,7 @@ (defstate idle (talker) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (the-as time-frame (-> self message delay))) - (suspend) - ) - ) + (suspend-for (the-as time-frame (-> self message delay))) (while (or (not (time-elapsed? (-> self start-time) (the-as time-frame (+ (-> self message delay) 300)))) (and (logtest? (-> self message flags) (talker-flags tf8)) (not (time-elapsed? (-> self start-time) (seconds 180))) @@ -567,11 +563,7 @@ ) ) (when (and (logtest? (-> self message flags) (talker-flags tf3)) (not (-> self save?))) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (set! (-> self save?) #t) (auto-save-user) ) diff --git a/goal_src/jak3/engine/common-obs/collectables.gc b/goal_src/jak3/engine/common-obs/collectables.gc index 119b912b36..5da58d9c62 100644 --- a/goal_src/jak3/engine/common-obs/collectables.gc +++ b/goal_src/jak3/engine/common-obs/collectables.gc @@ -1270,11 +1270,7 @@ (if (not (logtest? (-> self fact options) (actor-option no-reaction))) (send-event (handle->process arg1) 'powerup (-> self fact pickup-type) (-> self fact pickup-amount)) ) - (let ((t9-2 (-> (find-parent-state) code))) - (if t9-2 - ((the-as (function none) t9-2)) - ) - ) + (call-parent-state-handler code) ) ) diff --git a/goal_src/jak3/engine/common-obs/crates.gc b/goal_src/jak3/engine/common-obs/crates.gc index 6350aca3db..baa3b14e7c 100644 --- a/goal_src/jak3/engine/common-obs/crates.gc +++ b/goal_src/jak3/engine/common-obs/crates.gc @@ -920,11 +920,7 @@ ) ) (when (not arg0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.04)) - (suspend) - ) - ) + (suspend-for (seconds 0.04)) (case (-> self look) (('iron) (sound-play "icrate-break") @@ -1016,17 +1012,9 @@ (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) arg1 #t) (process-entity-status! self (entity-perm-status dead) #t) (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 5)) - (suspend) - ) - ) + (suspend-for (seconds 5)) (when (logtest? (actor-option cond-respawn) (-> self fact options)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 15)) - (suspend) - ) - ) + (suspend-for (seconds 15)) (go-virtual hide) ) ) diff --git a/goal_src/jak3/engine/common-obs/enemy-states.gc b/goal_src/jak3/engine/common-obs/enemy-states.gc index f7045f66c2..9d3d07f1ab 100644 --- a/goal_src/jak3/engine/common-obs/enemy-states.gc +++ b/goal_src/jak3/engine/common-obs/enemy-states.gc @@ -669,11 +669,7 @@ :code (behavior () (cond ((handle->process (-> self ragdoll-proc)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (until (ragdoll-settled? self) (if (or (time-elapsed? (-> self state-time) (seconds 4)) (enemy-method-109 self)) (go-die self) @@ -979,19 +975,11 @@ :code (behavior () (cond ((handle->process (-> self ragdoll-proc)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (if (-> self skel effect) (do-effect (-> self skel effect) "death-default" 0.0 -1) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.8)) - (suspend) - ) - ) + (suspend-for (seconds 0.8)) ) (else (ja-channel-push! 1 (seconds 0.075)) @@ -1073,19 +1061,11 @@ :code (behavior () (cond ((handle->process (-> self ragdoll-proc)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (if (-> self skel effect) (do-effect (-> self skel effect) "death-default" 0.0 -1) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (deactivate-ragdoll! self) ) (else diff --git a/goal_src/jak3/engine/common-obs/generic-obs.gc b/goal_src/jak3/engine/common-obs/generic-obs.gc index bd6da47eec..a6247e9f57 100644 --- a/goal_src/jak3/engine/common-obs/generic-obs.gc +++ b/goal_src/jak3/engine/common-obs/generic-obs.gc @@ -290,12 +290,7 @@ (swingpole-method-22 self) (suspend) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (swingpole-method-22 self) - (suspend) - ) - ) + (suspend-for (seconds 0.5) (swingpole-method-22 self)) (go-virtual idle) ) ) @@ -3983,31 +3978,19 @@ (set-setting! 'mode-name 'cam-fixed 0.0 0) (set-setting! 'interp-time 'abs 450.0 0) (set-setting! 'entity-name (res-lump-struct (-> self entity) 'camera-name structure) 0.0 0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (-> self pause-time)) - (suspend) - ) - ) + (suspend-for (-> self pause-time)) (if (-> self blur) (set-setting! 'blur-a 'abs 0.5 0) ) (remove-setting! 'mode-name) (remove-setting! 'entity-name) (remove-setting! 'interp-time) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (while (not (process-release? *target*)) (suspend) ) (remove-setting! 'interp-time) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (remove-setting! 'blur-a) (process-entity-status! self (entity-perm-status no-kill) #f) ) diff --git a/goal_src/jak3/engine/common-obs/powerups.gc b/goal_src/jak3/engine/common-obs/powerups.gc index 9ce4666697..ab925e655e 100644 --- a/goal_src/jak3/engine/common-obs/powerups.gc +++ b/goal_src/jak3/engine/common-obs/powerups.gc @@ -20,25 +20,23 @@ (let ((s1-1 (process->handle arg0)) (s2-1 (process->handle arg1)) ) - (let ((s0-0 (current-time))) - (until (time-elapsed? s0-0 (+ arg3 arg4)) - (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) - (if v1-8 - (deactivate self) - ) - ) - (let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) s0-0)) (the float arg3)) (the float arg4))))) - (a0-18 (process-drawable-pair-random-point! - (the-as process-drawable (-> s1-1 process 0)) - (the-as process-drawable (-> s2-1 process 0)) - (new-stack-vector0) - f0-1 - ) + (suspend-for + (+ arg3 arg4) + (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) + (if v1-8 + (deactivate self) + ) + ) + (let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) time)) (the float arg3)) (the float arg4))))) + (a0-18 (process-drawable-pair-random-point! + (the-as process-drawable (-> s1-1 process 0)) + (the-as process-drawable (-> s2-1 process 0)) + (new-stack-vector0) + f0-1 ) - ) - (arg2 a0-18) - ) - (suspend) + ) + ) + (arg2 a0-18) ) ) (cond @@ -49,12 +47,10 @@ #f ) (else - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 arg5) - (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) - (arg2 a0-21) - ) - (suspend) + (suspend-for + arg5 + (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) + (arg2 a0-21) ) ) ) diff --git a/goal_src/jak3/engine/common-obs/warp-gate.gc b/goal_src/jak3/engine/common-obs/warp-gate.gc index f90fa4d8d7..45cfef14ce 100644 --- a/goal_src/jak3/engine/common-obs/warp-gate.gc +++ b/goal_src/jak3/engine/common-obs/warp-gate.gc @@ -688,11 +688,7 @@ (set-blackout-frames (seconds 0.05)) ) (start 'play arg0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (while (and *target* (and (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) diff --git a/goal_src/jak3/engine/game/game-info.gc b/goal_src/jak3/engine/game/game-info.gc index f806579f0b..e869b1ebbe 100644 --- a/goal_src/jak3/engine/game/game-info.gc +++ b/goal_src/jak3/engine/game/game-info.gc @@ -1089,42 +1089,39 @@ (let ((s3-0 (new 'stack-no-clear 'vector4w))) (set! (-> s3-0 quad) (the-as uint128 0)) (when (transform-point-qword! s3-0 (the-as vector arg0)) - (let ((s5-0 (new - 'stack - 'font-context - *font-default-matrix* - (+ (the int (/ (the float (+ (/ (-> s3-0 x) 16) -1792)) (-> *video-params* relative-x-scale))) -48) - (+ (/ (-> s3-0 y) 16) -1855) - 0.0 - (font-color orange) - (font-flags shadow kerning) - ) - ) + (let ((s5-0 + (new + 'stack + 'font-context + *font-default-matrix* + (+ (the int (/ (the float (+ (/ (-> s3-0 x) 16) -1792)) (-> *video-params* relative-x-scale))) -48) + (+ (/ (-> s3-0 y) 16) -1855) + 0.0 + (font-color orange) + (font-flags shadow kerning) + ) + ) ) (set! (-> s5-0 scale) (lerp-scale 0.6 1.0 (the-as float arg1) 50.0 8000.0)) (let ((v1-9 s5-0)) (set! (-> v1-9 origin z) (the float (/ (-> s3-0 z) 16))) ) (set! (-> s5-0 flags) (font-flags shadow kerning large)) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (+ arg2 -75)) - (+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame))) - (let ((s2-0 print-game-text)) - (format (clear *temp-string*) "~4,,0f" arg1) - (s2-0 *temp-string* s5-0 #f 44 (bucket-id debug-no-zbuf1)) - ) - (suspend) + (suspend-for + (+ arg2 -75) + (+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame))) + (let ((s2-0 print-game-text)) + (format (clear *temp-string*) "~4,,0f" arg1) + (s2-0 *temp-string* s5-0 #f 44 (bucket-id debug-no-zbuf1)) ) ) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.25)) - (set! (-> s5-0 alpha) (lerp-scale 1.0 0.0 (the float (- (current-time) s4-1)) 0.0 150.0)) - (+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame))) - (let ((s3-2 print-game-text)) - (format (clear *temp-string*) "~4,,0f" arg1) - (s3-2 *temp-string* s5-0 #f 44 (bucket-id debug-no-zbuf1)) - ) - (suspend) + (suspend-for + (seconds 0.25) + (set! (-> s5-0 alpha) (lerp-scale 1.0 0.0 (the float (- (current-time) time)) 0.0 150.0)) + (+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame))) + (let ((s3-2 print-game-text)) + (format (clear *temp-string*) "~4,,0f" arg1) + (s3-2 *temp-string* s5-0 #f 44 (bucket-id debug-no-zbuf1)) ) ) ) @@ -1592,16 +1589,7 @@ (position->stream s5-0 arg0 #t) (process-spawn-function process - (lambda :behavior process - ((arg0 string)) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 10)) - (format *stdcon* "~S~%" arg0) - (suspend) - ) - ) - (none) - ) + (lambda :behavior process ((arg0 string)) (suspend-for (seconds 10) (format *stdcon* "~S~%" arg0)) (none)) s5-0 ) ) diff --git a/goal_src/jak3/engine/game/task/task-control.gc b/goal_src/jak3/engine/game/task/task-control.gc index 8d65547680..33c517d775 100644 --- a/goal_src/jak3/engine/game/task/task-control.gc +++ b/goal_src/jak3/engine/game/task/task-control.gc @@ -2537,18 +2537,14 @@ (process-release? *target*) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (let ((f30-0 (lerp-scale 1.0 0.0 (the float (- (current-time) gp-0)) 0.0 300.0))) - (set-filter-color! - (lerp-scale 1.0 1.25 f30-0 0.0 1.0) - (lerp-scale 1.0 0.875 f30-0 0.0 1.0) - (lerp-scale 1.0 0.25 f30-0 0.0 1.0) - ) - ) - (suspend) - ) - ) + (suspend-for (seconds 1) (let ((f30-0 (lerp-scale 1.0 0.0 (the float (- (current-time) time)) 0.0 300.0))) + (set-filter-color! + (lerp-scale 1.0 1.25 f30-0 0.0 1.0) + (lerp-scale 1.0 0.875 f30-0 0.0 1.0) + (lerp-scale 1.0 0.25 f30-0 0.0 1.0) + ) + ) + ) (let ((gp-1 (if (-> self retry?) (-> self params retry) (-> self params fail) diff --git a/goal_src/jak3/engine/process-drawable/process-taskable.gc b/goal_src/jak3/engine/process-drawable/process-taskable.gc index 7e2ffee9a4..e004ee2afa 100644 --- a/goal_src/jak3/engine/process-drawable/process-taskable.gc +++ b/goal_src/jak3/engine/process-drawable/process-taskable.gc @@ -377,11 +377,7 @@ (if (-> self skel effect) (do-effect (-> self skel effect) "death-default" 0.0 -1) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (if (logtest? (-> self flags) (process-taskable-flags ptf5)) (restart-mission) ) @@ -395,11 +391,7 @@ :enter (-> (method-of-type process-taskable active) enter) :exit (-> (method-of-type process-taskable active) exit) :code (behavior ((arg0 game-task-event)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (go-virtual hide) ) :post (-> (method-of-type process-taskable idle) post) diff --git a/goal_src/jak3/engine/scene/scene.gc b/goal_src/jak3/engine/scene/scene.gc index b61d1ec1cf..cb4a0540a3 100644 --- a/goal_src/jak3/engine/scene/scene.gc +++ b/goal_src/jak3/engine/scene/scene.gc @@ -1201,11 +1201,7 @@ #x33001 #t ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.05)) - (suspend) - ) - ) + (suspend-for (seconds 0.05)) (set! (-> *setting-control* user-current bg-a) 0.0) (remove-setting! 'movie) (remove-setting! 'movie-name) @@ -1538,15 +1534,13 @@ (the-as (function process-drawable symbol) (if (logtest? (-> self scene scene-flags) (scene-flags scf1)) - (lambda :behavior scene-player - () - (when (cpad-pressed? 0 triangle) - (set! (-> self aborted?) #t) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - #t - ) - ) + (lambda :behavior scene-player () (when (cpad-pressed? 0 triangle) + (set! (-> self aborted?) #t) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + #t + ) + ) false-func ) ) diff --git a/goal_src/jak3/engine/sound/gsound.gc b/goal_src/jak3/engine/sound/gsound.gc index 3ad7bcfae2..bc6e1c5506 100644 --- a/goal_src/jak3/engine/sound/gsound.gc +++ b/goal_src/jak3/engine/sound/gsound.gc @@ -1291,11 +1291,7 @@ (set! (-> a1-3 0) 'empty0) (want-sound-banks *load-state* a1-3) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (let ((a1-4 (new 'stack-no-clear 'array 'symbol 4))) (set! (-> a1-4 2) (-> gp-0 4)) (set! (-> a1-4 1) (-> gp-0 2)) diff --git a/goal_src/jak3/engine/target/board/board-states.gc b/goal_src/jak3/engine/target/board/board-states.gc index de454dff1a..5bb52ebe41 100644 --- a/goal_src/jak3/engine/target/board/board-states.gc +++ b/goal_src/jak3/engine/target/board/board-states.gc @@ -3373,11 +3373,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s3-2 (current-time))) - (until (time-elapsed? s3-2 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (move-to-point! (-> self control) s4-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) diff --git a/goal_src/jak3/engine/target/flut/flut.gc b/goal_src/jak3/engine/target/flut/flut.gc index ad755f3162..979e7615ec 100644 --- a/goal_src/jak3/engine/target/flut/flut.gc +++ b/goal_src/jak3/engine/target/flut/flut.gc @@ -352,12 +352,7 @@ (ja-channel-set! 0) (ja-post) (when (not (and (-> self entity) (= (-> self entity extra process) self))) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.1)) - (spawn-part-and-sound! self) - (suspend) - ) - ) + (suspend-for (seconds 0.1) (spawn-part-and-sound! self)) (deactivate self) ) (while (zero? (ja-group-size)) @@ -374,12 +369,7 @@ (spawn-part-and-sound! self) (suspend) ) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 1)) - (spawn-part-and-sound! self) - (suspend) - ) - ) + (suspend-for (seconds 1) (spawn-part-and-sound! self)) (go arg0) ) ) diff --git a/goal_src/jak3/engine/target/flut/target-flut.gc b/goal_src/jak3/engine/target/flut/target-flut.gc index 70904335c7..4bff0c3618 100644 --- a/goal_src/jak3/engine/target/flut/target-flut.gc +++ b/goal_src/jak3/engine/target/flut/target-flut.gc @@ -2859,11 +2859,7 @@ (let ((s3-2 (new-stack-vector0))) (set! (-> s3-2 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s2-0 (current-time))) - (until (time-elapsed? s2-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (move-to-point! (-> self control) s3-2) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) @@ -3046,33 +3042,31 @@ ) ) ) - (let ((s5-3 (current-time))) - (until (time-elapsed? s5-3 (seconds 1)) - (target-flut-falling-anim-trans) - (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) - (let ((v1-39 (new-stack-vector0)) - (f0-6 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - ) - 0.0 - (vector-! - v1-39 - (-> self control transv) - (vector-float*! v1-39 (-> self control dynam gravity-normal) (the-as float f0-6)) + (suspend-for + (seconds 1) + (target-flut-falling-anim-trans) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) + (let ((v1-39 (new-stack-vector0)) + (f0-6 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) ) - (let* ((f1-7 (vector-length v1-39)) - (f2-2 f1-7) - ) - (if (< (the-as float (-> self control unknown-word04)) (the-as float f0-6)) - (set! f0-6 (-> self control unknown-word04)) - ) - (vector+! - (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f0-6)) - (vector-float*! v1-39 v1-39 (/ f1-7 f2-2)) + 0.0 + (vector-! + v1-39 + (-> self control transv) + (vector-float*! v1-39 (-> self control dynam gravity-normal) (the-as float f0-6)) + ) + (let* ((f1-7 (vector-length v1-39)) + (f2-2 f1-7) + ) + (if (< (the-as float (-> self control unknown-word04)) (the-as float f0-6)) + (set! f0-6 (-> self control unknown-word04)) ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f0-6)) + (vector-float*! v1-39 v1-39 (/ f1-7 f2-2)) ) ) - (suspend) ) ) (remove-setting! 'mode-name) @@ -3108,11 +3102,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((s5-8 (current-time))) - (until (time-elapsed? s5-8 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) (('lava 'melt 'fry 'slime) (sound-play "death-melt") @@ -3134,11 +3124,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((s5-12 (current-time))) - (until (time-elapsed? s5-12 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) ) ) diff --git a/goal_src/jak3/engine/target/gun/gun-blue-shot.gc b/goal_src/jak3/engine/target/gun/gun-blue-shot.gc index d366c28f3b..1d13854152 100644 --- a/goal_src/jak3/engine/target/gun/gun-blue-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-blue-shot.gc @@ -2668,11 +2668,7 @@ (defstate dissipate (gun-blue-shot-3) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (go-virtual die) ) ) @@ -2680,11 +2676,7 @@ (defstate impact (gun-blue-shot-3) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (go-virtual die) ) ) diff --git a/goal_src/jak3/engine/target/gun/gun-dark-shot.gc b/goal_src/jak3/engine/target/gun/gun-dark-shot.gc index d203d33968..1ea761d534 100644 --- a/goal_src/jak3/engine/target/gun/gun-dark-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-dark-shot.gc @@ -2915,64 +2915,62 @@ ;; WARN: Return type mismatch int vs object. (defbehavior zero-g-wait-for-land gravity-spinner () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1.5)) - (let* ((s4-0 (handle->process (-> self parent-hand))) - (s5-0 (if (type? s4-0 process-focusable) - s4-0 - ) - ) - ) - (cond - ((and s5-0 - (not (logtest? (-> (the-as process-focusable s5-0) focus-status) (focus-status disable dead inactive))) - ) - (if (or (< (- (-> (get-trans (the-as process-focusable s5-0) 3) y) - (-> (the-as process-focusable s5-0) root root-prim local-sphere w) - ) - (-> self ground-height) - ) - (let ((s4-1 (-> (the-as process-focusable s5-0) root))) - (and (if (type? s4-1 collide-shape-moving) - s4-1 - ) - (logtest? (-> (the-as collide-shape-moving (-> (the-as process-focusable s5-0) root)) status) - (collide-status on-surface touch-surface) - ) - ) + (suspend-for + (seconds 1.5) + (let* ((s4-0 (handle->process (-> self parent-hand))) + (s5-0 (if (type? s4-0 process-focusable) + s4-0 ) - ) - (return (the-as object 0)) - ) - (when (not (logtest? (process-mask vehicle) (-> (the-as process-focusable s5-0) mask))) - (let ((s4-2 (new 'stack 'sphere))) - (vector-lerp! - s4-2 - (-> (the-as process-focusable s5-0) root root-prim local-sphere) - (-> self original-sphere-offset) - (* 3.0 (seconds-per-frame)) ) - (set! (-> s4-2 r) (lerp - (-> (the-as process-focusable s5-0) root root-prim local-sphere w) - (-> self original-sphere-offset r) - (* 3.0 (seconds-per-frame)) - ) - ) - (set! (-> (the-as process-focusable s5-0) root root-prim local-sphere quad) (-> s4-2 quad)) - ) - (if (>= (+ (current-time) (seconds -1)) gp-0) - (set! (-> (the-as process-focusable s5-0) root root-prim local-sphere quad) - (-> self original-sphere-offset quad) - ) - ) - ) ) - (else - (return (the-as object 0)) - ) + (cond + ((and s5-0 + (not (logtest? (-> (the-as process-focusable s5-0) focus-status) (focus-status disable dead inactive))) + ) + (if (or (< (- (-> (get-trans (the-as process-focusable s5-0) 3) y) + (-> (the-as process-focusable s5-0) root root-prim local-sphere w) + ) + (-> self ground-height) + ) + (let ((s4-1 (-> (the-as process-focusable s5-0) root))) + (and (if (type? s4-1 collide-shape-moving) + s4-1 + ) + (logtest? (-> (the-as collide-shape-moving (-> (the-as process-focusable s5-0) root)) status) + (collide-status on-surface touch-surface) + ) + ) + ) + ) + (return (the-as object 0)) + ) + (when (not (logtest? (process-mask vehicle) (-> (the-as process-focusable s5-0) mask))) + (let ((s4-2 (new 'stack 'sphere))) + (vector-lerp! + s4-2 + (-> (the-as process-focusable s5-0) root root-prim local-sphere) + (-> self original-sphere-offset) + (* 3.0 (seconds-per-frame)) + ) + (set! (-> s4-2 r) (lerp + (-> (the-as process-focusable s5-0) root root-prim local-sphere w) + (-> self original-sphere-offset r) + (* 3.0 (seconds-per-frame)) + ) + ) + (set! (-> (the-as process-focusable s5-0) root root-prim local-sphere quad) (-> s4-2 quad)) + ) + (if (>= (+ (current-time) (seconds -1)) time) + (set! (-> (the-as process-focusable s5-0) root root-prim local-sphere quad) + (-> self original-sphere-offset quad) + ) + ) + ) + ) + (else + (return (the-as object 0)) ) ) - (suspend) ) ) (the-as int #f) @@ -3615,17 +3613,9 @@ ) ) (set! f30-0 (+ -0.6 f30-0)) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.15)) - (suspend) - ) - ) - ) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 13.5)) - (suspend) - ) + (suspend-for (seconds 0.15)) ) + (suspend-for (seconds 13.5)) (go empty-state) (set! f30-0 4.0) ) diff --git a/goal_src/jak3/engine/target/gun/gun-red-shot.gc b/goal_src/jak3/engine/target/gun/gun-red-shot.gc index 0d7f4c3a39..938c476b95 100644 --- a/goal_src/jak3/engine/target/gun/gun-red-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-red-shot.gc @@ -1840,11 +1840,7 @@ :virtual #t :trans (behavior () (go-impact self) - (let ((t9-2 (-> (find-parent-state) trans))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler trans) ) ) @@ -1852,11 +1848,7 @@ :virtual #t :trans (behavior () (go-impact self) - (let ((t9-2 (-> (find-parent-state) trans))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler trans) ) ) diff --git a/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc b/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc index 86e95cd852..b615be1126 100644 --- a/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc @@ -566,11 +566,7 @@ process (lambda :behavior process ((arg0 handle)) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (send-event (handle->process arg0) 'die) ) gp-4 @@ -600,11 +596,7 @@ ) (logior! (-> self draw status) (draw-control-status no-draw)) (transform-post) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (deactivate self) ) :post ja-post @@ -742,11 +734,7 @@ ) ) ) - (let ((t9-5 (-> (find-parent-state) trans))) - (if t9-5 - (t9-5) - ) - ) + (call-parent-state-handler trans) (ja-post) ) ) @@ -1713,7 +1701,7 @@ (set! (-> s5-1 track-immediately?) #t) (let* ((v1-34 (estimate-light-trail-mem-usage (the-as uint (-> s5-1 max-num-crumbs)) - (the-as uint (= (-> s5-1 appearance lie-mode) 3)) + (the-as uint (= (-> s5-1 appearance lie-mode) (lie-mode use-two-strips))) ) ) (gp-1 (get-process *default-dead-pool* light-trail-tracker-projectile (+ v1-34 8192) 1)) @@ -1870,11 +1858,7 @@ :virtual #t :enter (behavior () (sound-stop (-> self snd-trail)) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) ) diff --git a/goal_src/jak3/engine/target/indax/target-indax.gc b/goal_src/jak3/engine/target/indax/target-indax.gc index caaad0c6d7..ed4b9e6853 100644 --- a/goal_src/jak3/engine/target/indax/target-indax.gc +++ b/goal_src/jak3/engine/target/indax/target-indax.gc @@ -702,7 +702,7 @@ #f ) :post target-indax-post -) + ) (defstate target-indax-walk (target) :event target-indax-handler @@ -1510,11 +1510,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (move-to-point! (-> self control) s4-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) @@ -1743,11 +1739,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) ((= arg0 'bot) (set! (-> self post-hook) target-no-move-post) diff --git a/goal_src/jak3/engine/target/mech/mech-states.gc b/goal_src/jak3/engine/target/mech/mech-states.gc index 52081a50dd..08899e3c23 100644 --- a/goal_src/jak3/engine/target/mech/mech-states.gc +++ b/goal_src/jak3/engine/target/mech/mech-states.gc @@ -1002,11 +1002,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (move-to-point! (-> self control) s4-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) @@ -1146,12 +1142,7 @@ ) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-mech-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.8)) - (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.8) (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5))) (remove-setting! 'mode-name) ) (else @@ -1253,11 +1244,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-10 (current-time))) - (until (time-elapsed? gp-10 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) ) (set! (-> self control transv quad) (the-as uint128 0)) diff --git a/goal_src/jak3/engine/target/mech/mech.gc b/goal_src/jak3/engine/target/mech/mech.gc index 9a22c4cb4b..64d010b24e 100644 --- a/goal_src/jak3/engine/target/mech/mech.gc +++ b/goal_src/jak3/engine/target/mech/mech.gc @@ -251,12 +251,7 @@ (mech-method-24 self) (suspend) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (mech-method-24 self) - (suspend) - ) - ) + (suspend-for (seconds 1) (mech-method-24 self)) (go arg0) ) ) diff --git a/goal_src/jak3/engine/target/pilot-states.gc b/goal_src/jak3/engine/target/pilot-states.gc index a42298f041..a88a2ee252 100644 --- a/goal_src/jak3/engine/target/pilot-states.gc +++ b/goal_src/jak3/engine/target/pilot-states.gc @@ -1016,11 +1016,7 @@ (logior! (-> self focus-status) (focus-status dead)) (case arg0 (('melt 'grenade 'explode) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (case arg0 (('dark-eco-pool) (sound-play "death-darkeco") @@ -1068,11 +1064,7 @@ ) 0 (ja-channel-set! 0) - (let ((s5-11 (current-time))) - (until (time-elapsed? s5-11 (seconds 1.8)) - (suspend) - ) - ) + (suspend-for (seconds 1.8)) ) (('endlessfall) (sound-play "death-fall") @@ -1101,11 +1093,7 @@ ) ) ) - (let ((s5-13 (current-time))) - (until (time-elapsed? s5-13 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) ) (('drown-death) (logclear! (-> self water flags) (water-flag swim-ground)) @@ -1127,11 +1115,7 @@ ) ) ) - (let ((s5-14 (current-time))) - (until (time-elapsed? s5-14 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) (('bot) (set! (-> self trans-hook) #f) @@ -1141,11 +1125,7 @@ ) ) (('big-explosion) - (let ((s5-15 (current-time))) - (until (time-elapsed? s5-15 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) (else ) diff --git a/goal_src/jak3/engine/target/target-darkjak.gc b/goal_src/jak3/engine/target/target-darkjak.gc index 6902ea0aaa..7f48ca9341 100644 --- a/goal_src/jak3/engine/target/target-darkjak.gc +++ b/goal_src/jak3/engine/target/target-darkjak.gc @@ -292,11 +292,7 @@ (set! (-> self part) (the-as sparticle-launch-control 0)) 0 ) - (let ((t9-5 (-> (find-parent-state) enter))) - (if t9-5 - (t9-5) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () (dotimes (gp-0 (-> self bolts length)) diff --git a/goal_src/jak3/engine/target/target-death.gc b/goal_src/jak3/engine/target/target-death.gc index 944b8253af..24c68da7b5 100644 --- a/goal_src/jak3/engine/target/target-death.gc +++ b/goal_src/jak3/engine/target/target-death.gc @@ -57,11 +57,7 @@ (intro-play) ) ((logtest? (-> arg0 flags) (continue-flags warp-gate)) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.05)) - (suspend) - ) - ) + (suspend-for (seconds 0.05)) (let ((s5-1 (new 'static 'vector)) (a2-0 (find-nearest-entity (-> arg0 trans) warp-gate)) ) @@ -220,11 +216,7 @@ (go target-grab 'stance) ) (else - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.05)) - (suspend) - ) - ) + (suspend-for (seconds 0.05)) ) ) 0 @@ -1458,11 +1450,7 @@ (let ((gp-1 (new-stack-vector0))) (set! (-> gp-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (move-to-point! (-> self control) gp-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) @@ -2290,11 +2278,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((s5-5 (current-time))) - (until (time-elapsed? s5-5 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) (('grenade 'big-explosion 'explode) (set! (-> self post-hook) target-no-stick-post) @@ -2373,11 +2357,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((s5-10 (current-time))) - (until (time-elapsed? s5-10 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) ) ) @@ -2393,11 +2373,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((s5-11 (current-time))) - (until (time-elapsed? s5-11 (seconds 1.2)) - (suspend) - ) - ) + (suspend-for (seconds 1.2)) ) ((= v1-61 'endlessfall) ((lambda :behavior target @@ -2435,38 +2411,36 @@ (target-falling-anim 30 (seconds 0.33)) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.8)) - (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) - (set! v1-24 'target-hit-ground-hard) - (goto cfg-17) - ) - (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) - (let ((v1-49 (new-stack-vector0)) - (f0-7 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - ) - 0.0 - (vector-! - v1-49 - (-> self control transv) - (vector-float*! v1-49 (-> self control dynam gravity-normal) (the-as float f0-7)) - ) - (let* ((f1-7 (vector-length v1-49)) - (f2-2 f1-7) - ) - (if (< (the-as float (-> self control unknown-word04)) (the-as float f0-7)) - (set! f0-7 (-> self control unknown-word04)) - ) - (vector+! - (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f0-7)) - (vector-float*! v1-49 v1-49 (/ f1-7 f2-2)) - ) - ) - ) - (ja :group! jakb-launch-jump-loop-ja :num! (loop! 0.5)) - (suspend) + (suspend-for + (seconds 0.8) + (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) + (set! v1-24 'target-hit-ground-hard) + (goto cfg-17) ) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) + (let ((v1-49 (new-stack-vector0)) + (f0-7 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + ) + 0.0 + (vector-! + v1-49 + (-> self control transv) + (vector-float*! v1-49 (-> self control dynam gravity-normal) (the-as float f0-7)) + ) + (let* ((f1-7 (vector-length v1-49)) + (f2-2 f1-7) + ) + (if (< (the-as float (-> self control unknown-word04)) (the-as float f0-7)) + (set! f0-7 (-> self control unknown-word04)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f0-7)) + (vector-float*! v1-49 v1-49 (/ f1-7 f2-2)) + ) + ) + ) + (ja :group! jakb-launch-jump-loop-ja :num! (loop! 0.5)) ) (set! v1-24 #f) (label cfg-17) @@ -2491,11 +2465,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) (remove-setting! 'mode-name) ) @@ -2660,11 +2630,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((s5-14 (current-time))) - (until (time-elapsed? s5-14 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) ((= v1-61 'centipede) (set! (-> self trans-hook) #f) diff --git a/goal_src/jak3/engine/target/target-handler.gc b/goal_src/jak3/engine/target/target-handler.gc index d0a4571d1a..653348400f 100644 --- a/goal_src/jak3/engine/target/target-handler.gc +++ b/goal_src/jak3/engine/target/target-handler.gc @@ -204,24 +204,20 @@ process (lambda :behavior target () - (let ((gp-0 (current-time)) - (s5-0 (current-time)) - ) - (until (time-elapsed? s5-0 (seconds 1)) - (when (time-elapsed? gp-0 (seconds 0.03)) - (set! gp-0 (current-time)) - (process-drawable-shock-effect - *target* - (-> *lightning-spec-id-table* 1) - lightning-probe-callback - (-> *part-id-table* 160) - 0 - 0 - 40960.0 - ) - ) - (suspend) - ) + (let ((gp-0 (current-time))) + (suspend-for (seconds 1) (when (time-elapsed? gp-0 (seconds 0.03)) + (set! gp-0 (current-time)) + (process-drawable-shock-effect + *target* + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + ) + ) ) (none) ) diff --git a/goal_src/jak3/engine/target/target-invisible.gc b/goal_src/jak3/engine/target/target-invisible.gc index cfcbbbe32b..468be4ddda 100644 --- a/goal_src/jak3/engine/target/target-invisible.gc +++ b/goal_src/jak3/engine/target/target-invisible.gc @@ -442,11 +442,7 @@ (set-time! (-> self state-time)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.66)) - (suspend) - ) - ) + (suspend-for (seconds 0.66)) (cond ((logtest? (-> *part-group-id-table* 182 flags) (sp-group-flag sp13)) (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) @@ -473,11 +469,7 @@ ) ) (sound-play "dark-maker") - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (go-virtual idle) ) :post (behavior () diff --git a/goal_src/jak3/engine/target/target-lightjak.gc b/goal_src/jak3/engine/target/target-lightjak.gc index 2e5ac14176..ea44a1702d 100644 --- a/goal_src/jak3/engine/target/target-lightjak.gc +++ b/goal_src/jak3/engine/target/target-lightjak.gc @@ -2275,12 +2275,7 @@ (defstate die (freeze-screen) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (seek! (-> self transition) 0.0 (seconds-per-frame)) - (suspend) - ) - ) + (suspend-for (seconds 1) (seek! (-> self transition) 0.0 (seconds-per-frame))) ) ) diff --git a/goal_src/jak3/engine/target/target-turret.gc b/goal_src/jak3/engine/target/target-turret.gc index d3ef6d4fe2..fb6af882c6 100644 --- a/goal_src/jak3/engine/target/target-turret.gc +++ b/goal_src/jak3/engine/target/target-turret.gc @@ -1018,11 +1018,7 @@ (sound-stop (-> self sound-id 1)) (sound-stop (-> self sound-id 2)) (logior! (-> self focus-status) (focus-status disable ignore inactive)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.8)) - (suspend) - ) - ) + (suspend-for (seconds 0.8)) (send-event (handle->process (-> self rider)) 'attack diff --git a/goal_src/jak3/engine/target/target2.gc b/goal_src/jak3/engine/target/target2.gc index c8dfaea6f7..1fc5ab716c 100644 --- a/goal_src/jak3/engine/target/target2.gc +++ b/goal_src/jak3/engine/target/target2.gc @@ -47,13 +47,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.3)) - (suspend) - (ja :num! (seek! (ja-aframe 19.0 0) 0.05)) - (suspend) - ) - ) + (suspend-for (seconds 0.3) (suspend) (ja :num! (seek! (ja-aframe 19.0 0) 0.05))) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-painful-land-ja :num! (seek!) :frame-num (ja-aframe 40.0 0)) (until (ja-done? 0) @@ -1545,12 +1539,7 @@ (until #f (let ((s5-0 (rand-vu-int-range 30 600))) (ja :group! jakb-wall-hide-head-ja) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 s5-0) - (gp-0) - (suspend) - ) - ) + (suspend-for s5-0 (gp-0)) ) (let ((f30-0 (rand-vu-float-range 0.5 1.5))) (cond @@ -1587,13 +1576,8 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (let ((s5-2 (rand-vu-int-range 60 300)) - (s4-2 (current-time)) - ) - (until (time-elapsed? s4-2 s5-2) - (gp-0) - (suspend) - ) + (let ((s5-2 (rand-vu-int-range 60 300))) + (suspend-for s5-2 (gp-0)) ) (ja-no-eval :group! jakb-wall-hide-head-left-ja :num! (seek! 0.0 f30-0) :frame-num max) (until (ja-done? 0) @@ -1609,13 +1593,8 @@ (suspend) (ja :num! (seek! 0.0 f30-0)) ) - (let ((s5-3 (rand-vu-int-range 60 300)) - (s4-3 (current-time)) - ) - (until (time-elapsed? s4-3 s5-3) - (gp-0) - (suspend) - ) + (let ((s5-3 (rand-vu-int-range 60 300))) + (suspend-for s5-3 (gp-0)) ) (ja-no-eval :group! jakb-wall-hide-head-right-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -1962,14 +1941,14 @@ (suspend) (ja :num! (seek!)) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (the-as time-frame arg0)) - (ja-no-eval :group! jakb-blast-recover-loop-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!)) - ) + (suspend-for + (the-as time-frame arg0) + (ja-no-eval :group! jakb-blast-recover-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) ) + (empty-form) ) (ja-no-eval :group! jakb-blast-recover-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak3/engine/ui/progress/progress.gc b/goal_src/jak3/engine/ui/progress/progress.gc index c5ccf5dba1..0d905cd641 100644 --- a/goal_src/jak3/engine/ui/progress/progress.gc +++ b/goal_src/jak3/engine/ui/progress/progress.gc @@ -4049,11 +4049,7 @@ process (lambda :behavior process ((arg0 int)) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 2.5)) - (suspend) - ) - ) + (suspend-for (seconds 2.5)) (while (or (not (handle-command-list *gui-control* (gui-channel alert) (the-as gui-connection #f))) (= (status-of-level-and-borrows *level* 'title #f) 'active) ) diff --git a/goal_src/jak3/kernel/gkernel-h.gc b/goal_src/jak3/kernel/gkernel-h.gc index b097fa93bb..45e2f85ec1 100644 --- a/goal_src/jak3/kernel/gkernel-h.gc +++ b/goal_src/jak3/kernel/gkernel-h.gc @@ -688,4 +688,7 @@ (defmacro time-elapsed? (time duration) `(>= (- (current-time) ,time) ,duration) - ) \ No newline at end of file + ) + +(defmacro suspend-for (time &rest body) + `(let ((time (current-time))) (until (time-elapsed? time ,time) ,@body (suspend)))) \ No newline at end of file diff --git a/goal_src/jak3/kernel/gstate.gc b/goal_src/jak3/kernel/gstate.gc index 8c1feaa580..ae8fbf9b05 100644 --- a/goal_src/jak3/kernel/gstate.gc +++ b/goal_src/jak3/kernel/gstate.gc @@ -235,6 +235,12 @@ ) ) +(defmacro call-parent-state-handler (handler &key (type (function none)) &rest args) + "Call the parent handler for this state." + `(let ((handler (-> (find-parent-state) ,handler))) + (if handler ((the ,type handler) ,@args)) + ) + ) (defmacro behavior (bindings &rest body) "Define an anonymous behavior for a process state. This may only be used inside a defstate!" diff --git a/goal_src/jak3/levels/city/blow-tower/blow-tower-obs.gc b/goal_src/jak3/levels/city/blow-tower/blow-tower-obs.gc index 194eeb87d2..f96c9260c1 100644 --- a/goal_src/jak3/levels/city/blow-tower/blow-tower-obs.gc +++ b/goal_src/jak3/levels/city/blow-tower/blow-tower-obs.gc @@ -1514,11 +1514,7 @@ (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.1)) - (suspend) - ) - ) + (suspend-for (seconds 0.1)) (let ((v1-46 (-> self root root-prim))) (set! (-> v1-46 prim-core collide-as) (collide-spec)) (set! (-> v1-46 prim-core collide-with) (collide-spec)) @@ -1879,11 +1875,7 @@ :code (behavior () (until #f (attempt-barrel-spawn) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.3)) - (suspend) - ) - ) + (suspend-for (seconds 0.3)) ) #f ) diff --git a/goal_src/jak3/levels/city/blow-tower/blow-tower-obs2.gc b/goal_src/jak3/levels/city/blow-tower/blow-tower-obs2.gc index c72446819d..c6032d6111 100644 --- a/goal_src/jak3/levels/city/blow-tower/blow-tower-obs2.gc +++ b/goal_src/jak3/levels/city/blow-tower/blow-tower-obs2.gc @@ -366,11 +366,7 @@ (defbehavior bt-roboguard-turret-code bt-roboguard () (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! bt-roboguard-idle-shoot0-loop-ja :num! zero) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (let ((gp-1 (lambda ((arg0 bt-roboguard) (arg1 symbol)) (quaternion-rotate-y! (-> arg0 root quat) (-> arg0 root quat) (* 20480.0 (seconds-per-frame) (if arg1 @@ -385,11 +381,7 @@ ) (until #f (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) ) @@ -410,11 +402,7 @@ ) ) (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (let ((s5-2 (current-time))) - (until (time-elapsed? s5-2 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) ) @@ -783,11 +771,7 @@ (defstate hovering (bt-mh-flyer) :virtual #t :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (bt-mh-flyer-method-51 self) ) :code (behavior () @@ -818,11 +802,7 @@ (bt-mh-flyer-flight-code) ) :post (behavior () - (let ((t9-1 (-> (find-parent-state) post))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (call-parent-state-handler post) (bt-mh-flyer-method-52 self) ) ) @@ -831,11 +811,7 @@ :virtual #t :trans (behavior () (sound-play "charge-loop" :id (-> self charge-sound) :position (-> self root trans)) - (let ((t9-2 (-> (find-parent-state) trans))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler trans) ) ) @@ -843,20 +819,12 @@ :virtual #t :trans (behavior () (sound-play "charge-loop" :id (-> self charge-sound) :position (-> self root trans)) - (let ((t9-2 (-> (find-parent-state) trans))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler trans) (bt-mh-flyer-method-51 self) ) :code bt-mh-flyer-flight-code :post (behavior () - (let ((t9-1 (-> (find-parent-state) post))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (call-parent-state-handler post) (bt-mh-flyer-method-52 self) ) ) @@ -864,20 +832,12 @@ (defstate fleeing (bt-mh-flyer) :virtual #t :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (bt-mh-flyer-method-51 self) ) :code bt-mh-flyer-flight-code :post (behavior () - (let ((t9-1 (-> (find-parent-state) post))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (call-parent-state-handler post) (bt-mh-flyer-method-52 self) ) ) @@ -885,11 +845,7 @@ (defstate firing (bt-mh-flyer) :virtual #t :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (bt-mh-flyer-method-51 self) ) :code (behavior () @@ -903,11 +859,7 @@ (bt-mh-flyer-flight-code) ) :post (behavior () - (let ((t9-1 (-> (find-parent-state) post))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (call-parent-state-handler post) (bt-mh-flyer-method-52 self) ) ) @@ -916,11 +868,7 @@ :virtual #t :enter (behavior () (sound-play "charge-fire") - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) ) @@ -2194,11 +2142,7 @@ (defstate dormant (bt-grunt) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set! (-> self root trans quad) (-> self start-pos quad)) (set! (-> self entity extra vis-dist) 819200.0) ) @@ -2234,11 +2178,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.3)) - (suspend) - ) - ) + (suspend-for (seconds 0.3)) (until #f (suspend) (when (ragdoll-settled? self) @@ -2246,17 +2186,9 @@ (logior! (-> self skel effect flags) (effect-control-flag ecf1)) ) (do-effect (-> self skel effect) "death-default" 0.0 -1) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.3)) - (suspend) - ) - ) + (suspend-for (seconds 0.3)) (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.8)) - (suspend) - ) - ) + (suspend-for (seconds 0.8)) (go-virtual dormant) ) ) @@ -3042,11 +2974,7 @@ :virtual #t :enter (behavior () (set! (-> self hit-points) 10.0) - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) ) diff --git a/goal_src/jak3/levels/city/blow-tower/cty-blow-tower.gc b/goal_src/jak3/levels/city/blow-tower/cty-blow-tower.gc index 9ea4cca237..e494f2fa97 100644 --- a/goal_src/jak3/levels/city/blow-tower/cty-blow-tower.gc +++ b/goal_src/jak3/levels/city/blow-tower/cty-blow-tower.gc @@ -4588,11 +4588,7 @@ (defstate die (bt-pickup) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (dotimes (gp-0 2) (send-event (handle->process (-> self pickup-barrels gp-0)) 'die) ) diff --git a/goal_src/jak3/levels/city/common/mh-squad-member.gc b/goal_src/jak3/levels/city/common/mh-squad-member.gc index 4428e34d96..18d894ccb0 100644 --- a/goal_src/jak3/levels/city/common/mh-squad-member.gc +++ b/goal_src/jak3/levels/city/common/mh-squad-member.gc @@ -280,10 +280,6 @@ ) ) ) - (let ((t9-3 (-> (find-parent-state) trans))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler trans) ) ) diff --git a/goal_src/jak3/levels/city/ctywide-obs.gc b/goal_src/jak3/levels/city/ctywide-obs.gc index ab331cec3c..8e335bebf2 100644 --- a/goal_src/jak3/levels/city/ctywide-obs.gc +++ b/goal_src/jak3/levels/city/ctywide-obs.gc @@ -2456,11 +2456,9 @@ ) (send-event *camera* 'teleport-to-transformq s4-0) ) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 3)) - (set! (-> *camera* slave 0 fov) (-> *city-burning-bush-get-on-info* (-> self info index) fov)) - (suspend) - ) + (suspend-for + (seconds 3) + (set! (-> *camera* slave 0 fov) (-> *city-burning-bush-get-on-info* (-> self info index) fov)) ) (set! (-> *camera-combiner* trans quad) (-> s5-0 quad)) (let ((a2-15 (-> *camera-combiner* inv-camera-rot)) diff --git a/goal_src/jak3/levels/city/ctywide-tasks.gc b/goal_src/jak3/levels/city/ctywide-tasks.gc index 135da9d8b3..a6b9f22fa9 100644 --- a/goal_src/jak3/levels/city/ctywide-tasks.gc +++ b/goal_src/jak3/levels/city/ctywide-tasks.gc @@ -50,11 +50,7 @@ (talker-spawn-func (-> *talker-speech* 26) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self speech-id)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) @@ -62,11 +58,7 @@ (talker-spawn-func (-> *talker-speech* 27) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self speech-id)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) @@ -87,17 +79,9 @@ ) (wait-for-speech-end (-> self speech-id)) (set! (-> self player-vehicle) (the-as handle #f)) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event self 'complete) - (let ((t9-14 (-> (find-parent-state) code))) - (if t9-14 - ((the-as (function none) t9-14)) - ) - ) + (call-parent-state-handler code) ) ) @@ -106,11 +90,7 @@ :code (behavior ((arg0 resetter-params)) (task-node-close! (game-task-node city-vehicle-training-hover-zone-1) 'event) (sleep-code) - (let ((t9-3 (-> (find-parent-state) code))) - (if t9-3 - ((the-as (function none) t9-3)) - ) - ) + (call-parent-state-handler code) ) ) @@ -118,11 +98,7 @@ :virtual #t :code (behavior () (task-node-close! (game-task-node city-vehicle-training-hover-zone-2) 'event) - (let ((t9-2 (-> (find-parent-state) code))) - (if t9-2 - ((the-as (function none) t9-2)) - ) - ) + (call-parent-state-handler code) ) ) @@ -168,11 +144,7 @@ (talker-spawn-func (-> *talker-speech* 27) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self speech-id)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (set! (-> self speech-id) (talker-spawn-func (-> *talker-speech* 28) *entity-pool* (target-pos 0) (the-as region #f)) ) @@ -191,11 +163,7 @@ (talker-spawn-func (-> *talker-speech* 29) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self speech-id)) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 3)) - (suspend) - ) - ) + (suspend-for (seconds 3)) (go-virtual complete) ) ) @@ -211,11 +179,7 @@ ((-> (method-of-object self wait) trans)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 5)) - (suspend) - ) - ) + (suspend-for (seconds 5)) (until (< 327680.0 (vector-vector-xz-distance (target-pos 0) (new 'static 'vector :x -285696.0 :y 36044.8 :z 5443625.0 :w 1.0)) ) @@ -223,11 +187,7 @@ ) (set-setting! 'airlock-command '(("hip-door-a-6" close)) 0.0 0) (talker-spawn-func (-> *talker-speech* 162) *entity-pool* (target-pos 0) (the-as region #f)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 5)) - (suspend) - ) - ) + (suspend-for (seconds 5)) (until (handle-command-list *gui-control* (gui-channel voicebox) (the-as gui-connection #f)) (suspend) ) diff --git a/goal_src/jak3/levels/city/destroy-grid/cty-destroy-grid.gc b/goal_src/jak3/levels/city/destroy-grid/cty-destroy-grid.gc index 6fbfb41c86..53d078c39a 100644 --- a/goal_src/jak3/levels/city/destroy-grid/cty-destroy-grid.gc +++ b/goal_src/jak3/levels/city/destroy-grid/cty-destroy-grid.gc @@ -392,11 +392,7 @@ ) ) ) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) :exit #f :trans (behavior () @@ -465,11 +461,7 @@ (put-rider-in-seat gp-0 (-> self seat) self) ) ) - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -1618,11 +1610,7 @@ :virtual #t :enter (behavior () (logior! (-> self jinx-flags) (jinx-flag j0)) - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) :code (behavior () (until (process-grab? *target* #f) @@ -1657,11 +1645,7 @@ ) :post (behavior () (move-cam-to-jinx self) - (let ((t9-2 (-> (find-parent-state) post))) - (if t9-2 - ((the-as (function none) t9-2)) - ) - ) + (call-parent-state-handler post) ) ) @@ -1910,11 +1894,7 @@ ) (suspend) ) - (let ((t9-4 (-> (find-parent-state) code))) - (if t9-4 - ((the-as (function none) t9-4)) - ) - ) + (call-parent-state-handler code) ) ) @@ -2141,11 +2121,7 @@ (process-entity-status! self (entity-perm-status dead) #t) (sound-play "bomb-set") (set! (-> self sound-id) (sound-play "time-tick-loop")) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 5)) - (suspend) - ) - ) + (suspend-for (seconds 5)) (sound-stop (-> self sound-id)) (sound-play "bomb-explode") (setup-masks (-> self draw) 0 -1) diff --git a/goal_src/jak3/levels/city/hijack/cty-hijack.gc b/goal_src/jak3/levels/city/hijack/cty-hijack.gc index 0829b26b14..a89210c00f 100644 --- a/goal_src/jak3/levels/city/hijack/cty-hijack.gc +++ b/goal_src/jak3/levels/city/hijack/cty-hijack.gc @@ -1360,11 +1360,7 @@ :virtual #t :enter (behavior () (set! (-> self vehicle-is-visible?) #f) - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (task-node-close! (game-task-node city-vehicle-training-hover-zone-1) 'event) (set-setting! 'kg-difficulty #f 1.5 0) (set-setting! 'exclusive-load '((ignore lctyhijk)) 0.0 0) @@ -1485,11 +1481,7 @@ (task-node-close! (game-task-node city-hijack-vehicle-infiltrate) 'event) (go-virtual show-missile-launch) ) - (let ((t9-18 (-> (find-parent-state) trans))) - (if t9-18 - (t9-18) - ) - ) + (call-parent-state-handler trans) ) ) @@ -1689,11 +1681,7 @@ (until (process-grab? *target* #f) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1.5)) - (suspend) - ) - ) + (suspend-for (seconds 1.5)) (send-event (handle->process (-> self hpickup)) 'flight-up) (let ((gp-1 (-> self missiles allocated-length)) (s5-0 0) @@ -1741,11 +1729,7 @@ ) ) (sound-play "hj-missile" :id (-> self missile-sound)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (dotimes (gp-3 (-> self missiles length)) (send-event (handle->process (-> self missiles gp-3)) 'begin-moving) ) @@ -1754,17 +1738,9 @@ (send-event (handle->process (-> self missiles gp-4)) 'begin-moving) ) (cty-hijack-manager-method-39 self 1) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (remove-setting! 'entity-name) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (until (process-release? *target*) (suspend) ) diff --git a/goal_src/jak3/levels/city/port/attack/ctyport-attack-bbush.gc b/goal_src/jak3/levels/city/port/attack/ctyport-attack-bbush.gc index 55ebec0b10..4869d38288 100644 --- a/goal_src/jak3/levels/city/port/attack/ctyport-attack-bbush.gc +++ b/goal_src/jak3/levels/city/port/attack/ctyport-attack-bbush.gc @@ -496,19 +496,11 @@ (defstate pickup-nukes (ctyport-attack-manager-bbush) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set! (-> self countdown-timer) (the-as handle (current-time))) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (if (< (vector-vector-xz-distance (target-pos 0) *port-attack-bbush-fail-sphere*) *port-attack-bbush-fail-radius*) (send-event self 'fail) ) diff --git a/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc b/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc index e1335da4e1..9e47281360 100644 --- a/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc +++ b/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc @@ -1837,11 +1837,7 @@ process (lambda :behavior process () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.75)) - (suspend) - ) - ) + (suspend-for (seconds 0.75)) (let ((a0-0 (ppointer->process (-> self parent)))) (if a0-0 (play-speech (the-as ctyport-attack-manager a0-0) 13) @@ -1991,11 +1987,7 @@ :virtual #t :code (behavior () (sound-stop (-> self hum-sound)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (disable *screen-filter*) (deactivate self) ) @@ -2181,11 +2173,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (let ((gp-1 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-1 from) (process->ppointer self)) (set! (-> gp-1 num-params) 0) diff --git a/goal_src/jak3/levels/city/port/attack/h-torpedo.gc b/goal_src/jak3/levels/city/port/attack/h-torpedo.gc index f4a8ea0a87..d5a92e95ef 100644 --- a/goal_src/jak3/levels/city/port/attack/h-torpedo.gc +++ b/goal_src/jak3/levels/city/port/attack/h-torpedo.gc @@ -1052,22 +1052,14 @@ ) ) :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set! (-> self speed) 0.0) (set! (-> self jump-state) (the-as uint 2)) (set! (-> self jump-time) 0.0) (set! (-> *target* pilot jumping?) #f) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) ) :post (behavior () (control-hook-player self) diff --git a/goal_src/jak3/levels/city/protect/assault-enemies.gc b/goal_src/jak3/levels/city/protect/assault-enemies.gc index 8b5020cec4..53a8fa7aaa 100644 --- a/goal_src/jak3/levels/city/protect/assault-enemies.gc +++ b/goal_src/jak3/levels/city/protect/assault-enemies.gc @@ -188,11 +188,7 @@ (defstate knocked-recover (assault-citizen-norm) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (logclear! (-> self enemy-flags) (enemy-flag vulnerable)) (if (< (vector-vector-xz-distance (-> self root trans) (-> self center-pos)) 16384.0) (go-virtual cower-ground) @@ -356,11 +352,7 @@ (defstate cower-ground (assault-citizen-norm) :virtual #t :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (if (enemy-method-109 self) (go-virtual die) ) @@ -754,11 +746,7 @@ (defstate tracking (assault-cleanup) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 5)) - (suspend) - ) - ) + (suspend-for (seconds 5)) (set-time! (-> self offscreen-time)) (until #f (suspend) @@ -1337,11 +1325,7 @@ ) ) ) - (let ((t9-11 (-> (find-parent-state) enter))) - (if t9-11 - (t9-11) - ) - ) + (call-parent-state-handler enter) ) ) @@ -1836,11 +1820,7 @@ (defstate drop-bombs (assault-bombbot) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set! (-> self drop-num) (the-as uint 3)) ) ) @@ -1868,11 +1848,7 @@ (set! (-> self next-node) (the-as int (-> self current-node))) (set-time! (-> self state-time)) (set-time! (-> self stop-shoot)) - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (remove-attacker *cty-attack-controller* (-> self attacker-info)) diff --git a/goal_src/jak3/levels/city/protect/assault-task.gc b/goal_src/jak3/levels/city/protect/assault-task.gc index 8b27286ee4..aa89205bed 100644 --- a/goal_src/jak3/levels/city/protect/assault-task.gc +++ b/goal_src/jak3/levels/city/protect/assault-task.gc @@ -283,11 +283,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (send-event self 'ammo-special 15 29) (sleep-code) ) @@ -430,11 +426,7 @@ (set! (-> v1-4 notify-proc) (process->handle self)) (send-event (handle->process (-> self h-player-controller)) 'set-params v1-4) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) - ) + (suspend-for (seconds 0.1)) (if *target* (logclear! (-> *target* focus-status) (focus-status teleporting)) ) @@ -729,11 +721,7 @@ ) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (spawn-enemies *assault-squad* self) ) :code (behavior () @@ -1380,11 +1368,7 @@ process (lambda :behavior process () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (dotimes (gp-1 (-> *assault-squad* spawn-records 1 records length)) (send-event (handle->process (-> *assault-squad* spawn-records 1 records data gp-1 proc)) 'traffic-off-force) ) @@ -1486,11 +1470,7 @@ (defstate clip-to-nav-mesh (assault-player-controller) :virtual #t :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (assault-player-controller-method-36 self) ) ) diff --git a/goal_src/jak3/levels/city/protect/cty-protect.gc b/goal_src/jak3/levels/city/protect/cty-protect.gc index b36cf6bde6..6c2ca2030e 100644 --- a/goal_src/jak3/levels/city/protect/cty-protect.gc +++ b/goal_src/jak3/levels/city/protect/cty-protect.gc @@ -144,11 +144,7 @@ :virtual #t :enter (behavior () (set-blackout-frames (seconds 10)) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) ) @@ -315,17 +311,9 @@ ((-> (method-of-type task-manager active) trans)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (talker-spawn-func (-> *talker-speech* 337) *entity-pool* (target-pos 0) (the-as region #f)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2.5)) - (suspend) - ) - ) + (suspend-for (seconds 2.5)) (talker-spawn-func (-> *talker-speech* 336) *entity-pool* (target-pos 0) (the-as region #f)) (send-event self 'complete) (sleep-code) @@ -367,11 +355,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (talker-spawn-func (-> *talker-speech* 334) *entity-pool* (target-pos 0) (the-as region #f)) (sleep-code) ) diff --git a/goal_src/jak3/levels/city/protect/flying-turret.gc b/goal_src/jak3/levels/city/protect/flying-turret.gc index ca7bc7e83b..24336d4815 100644 --- a/goal_src/jak3/levels/city/protect/flying-turret.gc +++ b/goal_src/jak3/levels/city/protect/flying-turret.gc @@ -649,11 +649,7 @@ :enter (behavior () (set! (-> self chase-mode) (the-as uint 3)) (flying-turret-method-230 self (the-as uint 0)) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () (when (handle->process (-> self current-enemy)) diff --git a/goal_src/jak3/levels/city/protect/protect-gunship.gc b/goal_src/jak3/levels/city/protect/protect-gunship.gc index c86f93589a..76617f3da5 100644 --- a/goal_src/jak3/levels/city/protect/protect-gunship.gc +++ b/goal_src/jak3/levels/city/protect/protect-gunship.gc @@ -1616,11 +1616,7 @@ (set! (-> gp-1 pickup-amount) 2.0) (drop-pickup gp-1 #t *entity-pool* gp-1 0 #t) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 5)) - (suspend) - ) - ) + (suspend-for (seconds 5)) ) ) diff --git a/goal_src/jak3/levels/city/protect/roboguard-city.gc b/goal_src/jak3/levels/city/protect/roboguard-city.gc index 18f049d485..b419386711 100644 --- a/goal_src/jak3/levels/city/protect/roboguard-city.gc +++ b/goal_src/jak3/levels/city/protect/roboguard-city.gc @@ -439,11 +439,7 @@ (defbehavior roboguard-city-turret-code roboguard-city () (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! roboguard-city-idle-shoot0-loop-ja :num! zero) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (let ((gp-1 (lambda :behavior process ((arg0 roboguard-city) (arg1 symbol)) @@ -459,11 +455,7 @@ ) (until #f (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) ) @@ -484,11 +476,7 @@ ) ) (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (let ((s5-2 (current-time))) - (until (time-elapsed? s5-2 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) ) @@ -578,11 +566,7 @@ :virtual #t :trans (behavior () (nav-enemy-method-181 self) - (let ((t9-2 (-> (find-parent-state) trans))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler trans) (let ((gp-0 (get-current-enemy self))) (when gp-0 (let* ((s5-0 self) @@ -1643,11 +1627,7 @@ (defstate knocked-recover (roboguard-city) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () (let ((t9-0 (-> (method-of-type kg-squad-member knocked-recover) trans))) diff --git a/goal_src/jak3/levels/city/sniper/cty-sniper-battery.gc b/goal_src/jak3/levels/city/sniper/cty-sniper-battery.gc index b59746e4d2..360641ed88 100644 --- a/goal_src/jak3/levels/city/sniper/cty-sniper-battery.gc +++ b/goal_src/jak3/levels/city/sniper/cty-sniper-battery.gc @@ -304,11 +304,7 @@ (ja-channel-set! 1) (ja :group! cty-sniper-button-pushdown-ja :num! (identity (the float (ja-num-frames 0)))) (ja-post) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (-> self stay-down-time)) - (suspend) - ) - ) + (suspend-for (-> self stay-down-time)) (send-event (handle->process (-> self lid)) 'up #x3e800000) (ja-no-eval :group! cty-sniper-button-popup-ja :num! (seek! max 0.25) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc b/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc index 12794ed25a..63841c0674 100644 --- a/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc +++ b/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc @@ -2627,11 +2627,7 @@ ) :code (behavior () (logior! (-> self flags) (cty-sniper-turret-flag cst3)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.49)) - (suspend) - ) - ) + (suspend-for (seconds 0.49)) (let ((gp-1 (rand-vu-int-range 3 6))) (dotimes (s5-0 gp-1) (fire-shot self) @@ -2763,29 +2759,27 @@ (when (and (< f30-0 0.0) (not (-> *setting-control* user-current freeze-screen))) (set-setting! 'mode-name 'cam-no-trans 0.0 0) (suspend) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.5)) - (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (the-as uint128 0)) - (cond - ((< (* (-> s5-2 x) (-> gp-1 z)) (* (-> s5-2 z) (-> gp-1 x))) - (set! (-> s3-0 z) (- (-> s5-2 x))) - (set! (-> s3-0 x) (-> s5-2 z)) - ) - (else - (set! (-> s3-0 z) (-> s5-2 x)) - (set! (-> s3-0 x) (- (-> s5-2 z))) - ) + (suspend-for + (seconds 0.5) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (the-as uint128 0)) + (cond + ((< (* (-> s5-2 x) (-> gp-1 z)) (* (-> s5-2 z) (-> gp-1 x))) + (set! (-> s3-0 z) (- (-> s5-2 x))) + (set! (-> s3-0 x) (-> s5-2 z)) + ) + (else + (set! (-> s3-0 z) (-> s5-2 x)) + (set! (-> s3-0 x) (- (-> s5-2 z))) ) - (vector+! s3-0 s3-0 (target-pos 0)) - (+! (-> s3-0 y) 20480.0) - (set! (-> *camera* slave 0 trans quad) (-> s3-0 quad)) ) - (vector-! gp-1 (-> self root trans) (target-pos 0)) - (vector-! s5-2 (camera-pos) (target-pos 0)) - (set-setting! 'interp-time 'abs 300.0 0) - (suspend) + (vector+! s3-0 s3-0 (target-pos 0)) + (+! (-> s3-0 y) 20480.0) + (set! (-> *camera* slave 0 trans quad) (-> s3-0 quad)) ) + (vector-! gp-1 (-> self root trans) (target-pos 0)) + (vector-! s5-2 (camera-pos) (target-pos 0)) + (set-setting! 'interp-time 'abs 300.0 0) ) ) (set-setting! 'mode-name 'cam-pov-track 0.0 0) @@ -2823,11 +2817,7 @@ #t ) (logior! (-> *target* focus-status) (focus-status ignore)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.08)) - (suspend) - ) - ) + (suspend-for (seconds 0.08)) (send-event self 'pov-cam-on) (send-event (handle->process (-> self reticle)) 'on) (setup @@ -2840,11 +2830,7 @@ #x33001 #t ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.08)) - (suspend) - ) - ) + (suspend-for (seconds 0.08)) (disable *screen-filter*) ) (else @@ -2885,16 +2871,12 @@ ) ) ) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 1.5)) - (when (focus-test? *target* grabbed) - (logclear! (-> self flags) (cty-sniper-turret-flag cst11)) - (send-event (handle->process (-> self reticle)) 'unlock) - (goto cfg-44) - ) - (suspend) - ) - ) + (suspend-for (seconds 1.5) (when (focus-test? *target* grabbed) + (logclear! (-> self flags) (cty-sniper-turret-flag cst11)) + (send-event (handle->process (-> self reticle)) 'unlock) + (goto cfg-44) + ) + ) (if (and (logtest? (-> self flags) (cty-sniper-turret-flag cst7)) (not (cty-sniper-turret-method-39 self))) (go-virtual locked-on) ) @@ -2947,11 +2929,7 @@ (suspend) (set-setting! 'interp-time 'abs 600.0 0) (remove-setting! 'mode-name) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 0.25)) (send-event (handle->process (-> self reticle)) 'die) (let ((v1-71 (-> self root root-prim))) (set! (-> v1-71 prim-core collide-as) (collide-spec)) diff --git a/goal_src/jak3/levels/city/traffic/citizen/civilian.gc b/goal_src/jak3/levels/city/traffic/citizen/civilian.gc index 69c475d667..24b25a4330 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/civilian.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/civilian.gc @@ -1178,11 +1178,7 @@ (defstate knocked-recover (civilian) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef38)))) ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc b/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc index c5a7e37a84..caf7d0abc9 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc @@ -337,18 +337,10 @@ ) ) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.6)) - (suspend) - ) - ) + (suspend-for (seconds 0.6)) (+! (-> self root trans y) -8192.0) (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) ) diff --git a/goal_src/jak3/levels/comb/comb-obs.gc b/goal_src/jak3/levels/comb/comb-obs.gc index 2679bdcf03..9320e25dc6 100644 --- a/goal_src/jak3/levels/comb/comb-obs.gc +++ b/goal_src/jak3/levels/comb/comb-obs.gc @@ -355,11 +355,7 @@ :unk 0 ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (cleanup-for-death self) ) :post #f @@ -676,11 +672,7 @@ :unk 0 ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (cleanup-for-death self) ) :post #f @@ -1145,12 +1137,7 @@ (print-text self (text-id text-05f8)) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 6)) - (print-text self (text-id light-jak-shield-how-to)) - (suspend) - ) - ) + (suspend-for (seconds 6) (print-text self (text-id light-jak-shield-how-to))) (send-event *target* 'end-mode 'lightjak) (go-virtual complete) ) diff --git a/goal_src/jak3/levels/comb/comb-sentry.gc b/goal_src/jak3/levels/comb/comb-sentry.gc index 8ad096ee02..c98ea8d07d 100644 --- a/goal_src/jak3/levels/comb/comb-sentry.gc +++ b/goal_src/jak3/levels/comb/comb-sentry.gc @@ -727,11 +727,7 @@ :unk 0 ) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (cleanup-for-death self) ) :post #f diff --git a/goal_src/jak3/levels/comb/comb-travel.gc b/goal_src/jak3/levels/comb/comb-travel.gc index 7f657723b7..3f29de29b1 100644 --- a/goal_src/jak3/levels/comb/comb-travel.gc +++ b/goal_src/jak3/levels/comb/comb-travel.gc @@ -232,11 +232,7 @@ (suspend) ) #f - (let ((t9-29 (-> (find-parent-state) code))) - (if t9-29 - ((the-as (function none) t9-29)) - ) - ) + (call-parent-state-handler code) ) ) @@ -245,11 +241,7 @@ :code (behavior () (remove-setting! 'pilot-exit) (set-setting! 'pilot #f 0.0 0) - (let ((t9-3 (-> (find-parent-state) code))) - (if t9-3 - ((the-as (function none) t9-3)) - ) - ) + (call-parent-state-handler code) ) ) @@ -291,16 +283,8 @@ :code (behavior () (send-event *target* 'end-mode 'pilot) (send-event (handle->process (-> self player-vehicle)) 'sled-disable) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) - ) - (let ((t9-3 (-> (find-parent-state) code))) - (if t9-3 - ((the-as (function none) t9-3)) - ) - ) + (suspend-for (seconds 2)) + (call-parent-state-handler code) ) ) diff --git a/goal_src/jak3/levels/comb/h-sled.gc b/goal_src/jak3/levels/comb/h-sled.gc index 3f81ce14f1..9896d10477 100644 --- a/goal_src/jak3/levels/comb/h-sled.gc +++ b/goal_src/jak3/levels/comb/h-sled.gc @@ -1842,11 +1842,7 @@ :virtual #t :enter (behavior () (set! (-> self health-hud) (process->handle (hud-sled-health-spawn self))) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (let ((t9-1 (-> (find-parent-state) exit))) diff --git a/goal_src/jak3/levels/common/elec-gate.gc b/goal_src/jak3/levels/common/elec-gate.gc index db416c1488..89fab2c02c 100644 --- a/goal_src/jak3/levels/common/elec-gate.gc +++ b/goal_src/jak3/levels/common/elec-gate.gc @@ -643,11 +643,7 @@ (defstate shutdown-camera (elec-gate) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (format 0 "~s~%" (-> self name)) (if (res-lump-struct (-> self entity) 'camera-name structure) (process-spawn @@ -659,11 +655,7 @@ :to *entity-pool* ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (go-virtual shutdown) ) :post (behavior () diff --git a/goal_src/jak3/levels/common/enemy/darkprec/neo-wasp.gc b/goal_src/jak3/levels/common/enemy/darkprec/neo-wasp.gc index 05d5703fd5..2a943e80ce 100644 --- a/goal_src/jak3/levels/common/enemy/darkprec/neo-wasp.gc +++ b/goal_src/jak3/levels/common/enemy/darkprec/neo-wasp.gc @@ -657,11 +657,7 @@ 0 (set! (-> self hit-points) 0.0) (do-effect (-> self skel effect) "death-default" 0.0 -1) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event self 'death-end) (cleanup-for-death self) ) diff --git a/goal_src/jak3/levels/common/enemy/flitter.gc b/goal_src/jak3/levels/common/enemy/flitter.gc index 539700132f..414c5cf6c6 100644 --- a/goal_src/jak3/levels/common/enemy/flitter.gc +++ b/goal_src/jak3/levels/common/enemy/flitter.gc @@ -699,11 +699,7 @@ (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1412)) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.6)) - (suspend) - ) - ) + (suspend-for (seconds 0.6)) (+! (-> self root trans y) -8192.0) (update-focus self) (let ((a0-14 (handle->process (-> self focus handle)))) @@ -721,11 +717,7 @@ ) ) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) ) diff --git a/goal_src/jak3/levels/common/enemy/grunt.gc b/goal_src/jak3/levels/common/enemy/grunt.gc index 3880431288..91977d8355 100644 --- a/goal_src/jak3/levels/common/enemy/grunt.gc +++ b/goal_src/jak3/levels/common/enemy/grunt.gc @@ -985,11 +985,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-6 prim-core collide-with) (-> self root backup-collide-with)) diff --git a/goal_src/jak3/levels/common/enemy/hover/robo-hover.gc b/goal_src/jak3/levels/common/enemy/hover/robo-hover.gc index 56dca2bbf3..fc1369c57d 100644 --- a/goal_src/jak3/levels/common/enemy/hover/robo-hover.gc +++ b/goal_src/jak3/levels/common/enemy/hover/robo-hover.gc @@ -995,11 +995,7 @@ ) ) :post (behavior () - (let ((t9-1 (-> (find-parent-state) post))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (call-parent-state-handler post) (seek! (-> self gun-blend) 0.0 (* 5.0 (seconds-per-frame))) ) ) diff --git a/goal_src/jak3/levels/common/enemy/kg-grunt.gc b/goal_src/jak3/levels/common/enemy/kg-grunt.gc index 41e0146b17..5a58a4f840 100644 --- a/goal_src/jak3/levels/common/enemy/kg-grunt.gc +++ b/goal_src/jak3/levels/common/enemy/kg-grunt.gc @@ -832,11 +832,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-6 prim-core collide-with) (-> self root backup-collide-with)) diff --git a/goal_src/jak3/levels/common/enemy/mantis.gc b/goal_src/jak3/levels/common/enemy/mantis.gc index fc8c26195e..d56fb3add5 100644 --- a/goal_src/jak3/levels/common/enemy/mantis.gc +++ b/goal_src/jak3/levels/common/enemy/mantis.gc @@ -669,11 +669,7 @@ (defstate active (mantis) :virtual #t :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (if (logtest? (-> self flags) (mantis-flag tracked)) (mantis-method-199 self) ) @@ -762,17 +758,9 @@ ) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.3)) - (suspend) - ) - ) + (suspend-for (seconds 0.3)) (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) (logclear! (-> self draw status) (draw-control-status no-draw)) (let* ((v1-45 (-> self nav)) (a1-7 (-> self root trans)) @@ -904,14 +892,10 @@ (suspend) (ja :num! (seek! max 1.2)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (if (logtest? (-> self root status) (collide-status on-ground)) - (goto cfg-35) - ) - (suspend) - ) - ) + (suspend-for (seconds 1) (if (logtest? (-> self root status) (collide-status on-ground)) + (goto cfg-35) + ) + ) (label cfg-35) (go-virtual hostile) ) diff --git a/goal_src/jak3/levels/common/enemy/roboguard.gc b/goal_src/jak3/levels/common/enemy/roboguard.gc index 3501e78f61..3d3bf9a9fb 100644 --- a/goal_src/jak3/levels/common/enemy/roboguard.gc +++ b/goal_src/jak3/levels/common/enemy/roboguard.gc @@ -521,11 +521,7 @@ (defbehavior roboguard-turret-code roboguard () (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! roboguard-idle-shoot0-loop-ja :num! zero) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (let ((gp-1 (lambda ((arg0 roboguard) (arg1 symbol)) (quaternion-rotate-y! (-> arg0 root quat) (-> arg0 root quat) (* 20480.0 (seconds-per-frame) (if arg1 @@ -540,11 +536,7 @@ ) (until #f (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) ) @@ -565,11 +557,7 @@ ) ) (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (let ((s5-2 (current-time))) - (until (time-elapsed? s5-2 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) ) diff --git a/goal_src/jak3/levels/common/enemy/spyder.gc b/goal_src/jak3/levels/common/enemy/spyder.gc index 19d6795e2c..c7efca2945 100644 --- a/goal_src/jak3/levels/common/enemy/spyder.gc +++ b/goal_src/jak3/levels/common/enemy/spyder.gc @@ -1068,13 +1068,11 @@ (set! (-> self fire-info 0 quad) (-> s3-0 quad)) (set! (-> self fire-info 1 quad) (-> s2-1 quad)) ) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 0.2)) - (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) - (ja :num! (loop!)) - (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) - (suspend) - ) + (suspend-for + (seconds 0.2) + (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) + (ja :num! (loop!)) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) ) (let ((f28-1 (+ 12288.0 f28-0))) (set! (-> gp-0 quad) (-> s5-0 quad)) diff --git a/goal_src/jak3/levels/common/enemy/spydroid-orig.gc b/goal_src/jak3/levels/common/enemy/spydroid-orig.gc index 556d2b5893..d353525ca9 100644 --- a/goal_src/jak3/levels/common/enemy/spydroid-orig.gc +++ b/goal_src/jak3/levels/common/enemy/spydroid-orig.gc @@ -1123,11 +1123,7 @@ ) (suspend) (ja-channel-set! 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event self 'death-end) (let ((gp-1 (-> self child))) (while gp-1 diff --git a/goal_src/jak3/levels/common/enemy/spydroid.gc b/goal_src/jak3/levels/common/enemy/spydroid.gc index 8c8fb23de7..3cb59b5d70 100644 --- a/goal_src/jak3/levels/common/enemy/spydroid.gc +++ b/goal_src/jak3/levels/common/enemy/spydroid.gc @@ -1423,21 +1423,13 @@ ) ) :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (spydroid-method-231 self (the-as uint 0)) (set-time! (-> self state-time)) (logior! (-> self flags) (citizen-flag neck-no-auto-look-at)) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (when (or (!= (-> self faction-mode) 0) (logtest? (-> self flags) (citizen-flag in-mission))) (spydroid-method-236 self) (go-virtual hostile) diff --git a/goal_src/jak3/levels/desert/artifact-race/artifact-race.gc b/goal_src/jak3/levels/desert/artifact-race/artifact-race.gc index 7dcbe11bc3..e6aae62615 100644 --- a/goal_src/jak3/levels/desert/artifact-race/artifact-race.gc +++ b/goal_src/jak3/levels/desert/artifact-race/artifact-race.gc @@ -904,22 +904,10 @@ 0 (when (= (-> self node-info task) (game-task desert-artifact-race-1)) (send-event *target* 'end-mode 'pilot) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) - ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) - ) - (let ((t9-3 (-> (find-parent-state) code))) - (if t9-3 - ((the-as (function none) t9-3)) - ) + (suspend-for (seconds 0.5)) ) + (suspend-for (seconds 0.5)) + (call-parent-state-handler code) ) ) diff --git a/goal_src/jak3/levels/desert/chase/desert-chase.gc b/goal_src/jak3/levels/desert/chase/desert-chase.gc index df69feffd6..228039e857 100644 --- a/goal_src/jak3/levels/desert/chase/desert-chase.gc +++ b/goal_src/jak3/levels/desert/chase/desert-chase.gc @@ -122,17 +122,13 @@ ) :code (behavior () (suspend) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 3)) - (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) - (set! (-> a1-0 options) (overlaps-others-options)) - (set! (-> a1-0 collide-with-filter) (the-as collide-spec -1)) - (set! (-> a1-0 tlist) *touching-list*) - (find-overlapping-shapes (-> self root) a1-0) - ) - (suspend) - ) - ) + (suspend-for (seconds 3) (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> self root) a1-0) + ) + ) (let ((v1-10 (-> self root root-prim))) (set! (-> v1-10 prim-core collide-as) (collide-spec)) (set! (-> v1-10 prim-core collide-with) (collide-spec)) @@ -507,17 +503,9 @@ (let ((v1-137 (-> self vehicle 3 handle process))) (set-setting! 'sound-ear v1-137 0.0 (-> v1-137 0 pid)) ) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 1.5)) - (suspend) - ) - ) + (suspend-for (seconds 1.5)) (desert-chase-ambush-manager-method-35 self 3) - (let ((gp-10 (current-time))) - (until (time-elapsed? gp-10 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) (set! (-> *display* force-sync) (the-as uint 240)) (sound-play "camera-pan-3" :position #f) @@ -525,17 +513,9 @@ (set-setting! 'sound-ear v1-157 0.0 (-> v1-157 0 pid)) ) (set-setting! 'entity-name "camera-400" 0.0 0) - (let ((gp-12 (current-time))) - (until (time-elapsed? gp-12 (seconds 1.5)) - (suspend) - ) - ) + (suspend-for (seconds 1.5)) (desert-chase-ambush-manager-method-35 self 2) - (let ((gp-13 (current-time))) - (until (time-elapsed? gp-13 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (desert-chase-ambush-manager-method-35 self 1) (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) (set! (-> *display* force-sync) (the-as uint 240)) @@ -544,17 +524,9 @@ (set-setting! 'sound-ear v1-181 0.0 (-> v1-181 0 pid)) ) (set-setting! 'entity-name "camera-402" 0.0 0) - (let ((gp-15 (current-time))) - (until (time-elapsed? gp-15 (seconds 1.5)) - (suspend) - ) - ) + (suspend-for (seconds 1.5)) (desert-chase-ambush-manager-method-35 self 0) - (let ((gp-16 (current-time))) - (until (time-elapsed? gp-16 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (remove-setting! 'sound-ear) (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) (set! (-> *display* force-sync) (the-as uint 240)) @@ -593,11 +565,7 @@ (if *target* (logclear! (-> *target* focus-status) (focus-status teleporting)) ) - (let ((gp-19 (current-time))) - (until (time-elapsed? gp-19 (seconds 2.5)) - (suspend) - ) - ) + (suspend-for (seconds 2.5)) (remove-setting! 'entity-name) (dotimes (gp-20 4) (let ((s5-7 (-> self vehicle gp-20)) @@ -704,11 +672,7 @@ (ppointer->handle (process-spawn hud-marauder :init hud-init-by-other :name "hud-marauder" :to self)) ) (set! (-> *game-info* counter) (the float (- (+ (-> self marauder-count) 60) (-> self total-spawned)))) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 3)) - (suspend) - ) - ) + (suspend-for (seconds 3)) (until (and (>= (-> self total-spawned) (the-as uint 60)) (zero? (-> self marauder-count))) (when (>= (+ (current-time) (seconds -0.5)) (-> self check-timer)) (let* ((gp-5 (length *stronghold-marauder-start*)) @@ -1650,11 +1614,7 @@ 0 ) ) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (let ((gp-7 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-7 from) (process->ppointer self)) (set! (-> gp-7 num-params) 0) @@ -1677,11 +1637,7 @@ (set! (-> gp-8 i-node) 48) ) ) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (let ((gp-10 (-> self control-array 2))) (when (not (handle->process (-> gp-10 vehicle))) (spawn-chase-vehicle self (the-as deschase-vehicle gp-10) (-> *stronghold-vehicle-start* 0)) @@ -1690,11 +1646,7 @@ 0 ) ) - (let ((gp-11 (current-time))) - (until (time-elapsed? gp-11 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (let ((gp-12 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-12 from) (process->ppointer self)) (set! (-> gp-12 num-params) 0) @@ -1717,11 +1669,7 @@ (set! (-> gp-13 i-node) 48) ) ) - (let ((gp-14 (current-time))) - (until (time-elapsed? gp-14 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (let ((gp-15 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-15 from) (process->ppointer self)) (set! (-> gp-15 num-params) 0) @@ -1737,16 +1685,8 @@ ) ) ) - (let ((gp-16 (current-time))) - (until (time-elapsed? gp-16 (seconds 1)) - (suspend) - ) - ) - (let ((gp-17 (current-time))) - (until (time-elapsed? gp-17 (seconds 4)) - (suspend) - ) - ) + (suspend-for (seconds 1)) + (suspend-for (seconds 4)) (send-event (handle->process (-> self h-player-controller)) 'change-mode 'idle) (dotimes (gp-18 4) (let ((s5-7 (-> self control-array gp-18))) @@ -1839,11 +1779,7 @@ ) ) ) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (was-squad-manager-start self) (let ((v1-66 *was-squad-control*)) (set! (-> v1-66 target-count) 2) @@ -1982,11 +1918,7 @@ (if (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) ) - (let ((s5-5 (current-time))) - (until (time-elapsed? s5-5 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (+! gp-6 -1) (if (= gp-6 -1) (goto cfg-176) @@ -2029,15 +1961,7 @@ (defstate complete (desert-chase-chase-manager) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 4)) - (suspend) - ) - ) - (let ((t9-1 (-> (find-parent-state) code))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (suspend-for (seconds 4)) + (call-parent-state-handler code) ) ) diff --git a/goal_src/jak3/levels/desert/chase/desert-jump.gc b/goal_src/jak3/levels/desert/chase/desert-jump.gc index d60ac10808..8ad1389c65 100644 --- a/goal_src/jak3/levels/desert/chase/desert-jump.gc +++ b/goal_src/jak3/levels/desert/chase/desert-jump.gc @@ -870,11 +870,7 @@ ) ) ) - (let ((gp-7 (current-time))) - (until (time-elapsed? gp-7 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (send-event self 'complete) ) :post (behavior () diff --git a/goal_src/jak3/levels/desert/chase/wcar-marauder-b.gc b/goal_src/jak3/levels/desert/chase/wcar-marauder-b.gc index a883190b4f..4305cf42bd 100644 --- a/goal_src/jak3/levels/desert/chase/wcar-marauder-b.gc +++ b/goal_src/jak3/levels/desert/chase/wcar-marauder-b.gc @@ -347,10 +347,6 @@ (if (and *target* (focus-test? *target* pilot-riding) (not (logtest? (vehicle-flag vf55) (-> self v-flags)))) (turbo-pickup-spawn (-> self root trans)) ) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) ) diff --git a/goal_src/jak3/levels/desert/des-bbush-tasks.gc b/goal_src/jak3/levels/desert/des-bbush-tasks.gc index 73cc7aba84..5ce1efb559 100644 --- a/goal_src/jak3/levels/desert/des-bbush-tasks.gc +++ b/goal_src/jak3/levels/desert/des-bbush-tasks.gc @@ -538,11 +538,7 @@ (script-eval gp-0) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (while (not (-> *setting-control* user-current speech-control)) (suspend) ) diff --git a/goal_src/jak3/levels/desert/des-burning-bush.gc b/goal_src/jak3/levels/desert/des-burning-bush.gc index 5073f2521c..b49b511da4 100644 --- a/goal_src/jak3/levels/desert/des-burning-bush.gc +++ b/goal_src/jak3/levels/desert/des-burning-bush.gc @@ -932,11 +932,7 @@ ) ) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 0.25)) (set-time! (-> self state-time)) (while (and (nonzero? (get-status *gui-control* (the-as sound-id (-> self message-id)))) (not (time-elapsed? (-> self state-time) (seconds 60))) @@ -1494,11 +1490,9 @@ (send-event *camera* 'teleport-to-transformq s4-0) ) (set! (-> self update-fov?) #t) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 3)) - (set! (-> *camera* slave 0 fov) (-> *burning-bush-get-on-info* (-> self info index) fov)) - (suspend) - ) + (suspend-for + (seconds 3) + (set! (-> *camera* slave 0 fov) (-> *burning-bush-get-on-info* (-> self info index) fov)) ) (set! (-> self update-fov?) #f) (set! (-> *camera-combiner* trans quad) (-> s5-0 quad)) diff --git a/goal_src/jak3/levels/desert/des-bush.gc b/goal_src/jak3/levels/desert/des-bush.gc index 2ce7cfad50..0327dc9870 100644 --- a/goal_src/jak3/levels/desert/des-bush.gc +++ b/goal_src/jak3/levels/desert/des-bush.gc @@ -782,11 +782,7 @@ 0 ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (hud-timer-handler self) ) :code (behavior () diff --git a/goal_src/jak3/levels/desert/des-cactus.gc b/goal_src/jak3/levels/desert/des-cactus.gc index c2b70c525b..851fda2bf8 100644 --- a/goal_src/jak3/levels/desert/des-cactus.gc +++ b/goal_src/jak3/levels/desert/des-cactus.gc @@ -361,11 +361,7 @@ ) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (cleanup-for-death self) ) :post #f diff --git a/goal_src/jak3/levels/desert/hover/des-beast-2.gc b/goal_src/jak3/levels/desert/hover/des-beast-2.gc index 66bcb9bb9e..8f8c1cdd5c 100644 --- a/goal_src/jak3/levels/desert/hover/des-beast-2.gc +++ b/goal_src/jak3/levels/desert/hover/des-beast-2.gc @@ -267,11 +267,7 @@ (defstate impact (beast-grenade-2) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) @@ -336,11 +332,7 @@ (defstate dissipate (beast-grenade-2) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) @@ -466,7 +458,7 @@ (set! (-> s5-1 track-immediately?) #t) (let* ((v1-28 (estimate-light-trail-mem-usage (the-as uint (-> s5-1 max-num-crumbs)) - (the-as uint (= (-> s5-1 appearance lie-mode) 3)) + (the-as uint (= (-> s5-1 appearance lie-mode) (lie-mode use-two-strips))) ) ) (s4-1 (get-process *default-dead-pool* light-trail-tracker-projectile (+ v1-28 8192) 1)) @@ -826,21 +818,13 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) - ) + (suspend-for (seconds 0.1)) (until (ja-done? 0) (suspend) ) (logior! (-> self skel effect flags) (effect-control-flag ecf1)) (do-effect (-> self skel effect) "death-default" 0.0 -1) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 3)) - (suspend) - ) - ) + (suspend-for (seconds 3)) (go-virtual die) ) :post (behavior () diff --git a/goal_src/jak3/levels/desert/hover/mh-flyer.gc b/goal_src/jak3/levels/desert/hover/mh-flyer.gc index 07b0f3b810..0f0a1d2e71 100644 --- a/goal_src/jak3/levels/desert/hover/mh-flyer.gc +++ b/goal_src/jak3/levels/desert/hover/mh-flyer.gc @@ -166,11 +166,7 @@ ) ) :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) @@ -213,11 +209,7 @@ (defstate dissipate (mh-flyer-shot) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) @@ -1229,11 +1221,7 @@ (if (-> self skel effect) (do-effect (-> self skel effect) "death-default" 0.0 -1) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (cleanup-for-death self) ) ) diff --git a/goal_src/jak3/levels/desert/hover/scorpion-gun.gc b/goal_src/jak3/levels/desert/hover/scorpion-gun.gc index 0e43e01b82..e0e368147d 100644 --- a/goal_src/jak3/levels/desert/hover/scorpion-gun.gc +++ b/goal_src/jak3/levels/desert/hover/scorpion-gun.gc @@ -1939,17 +1939,9 @@ (send-event self 'use-camera #f) (send-event (handle->process (-> self gun)) 'shutdown) (send-event *camera* 'change-target (handle->process (-> self last-beast))) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (send-event (handle->process (-> self scorp)) 'set-control-hook-player) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 4)) - (suspend) - ) - ) + (suspend-for (seconds 4)) (until (process-release? *target*) (suspend) ) @@ -1988,11 +1980,7 @@ (send-event *camera* 'change-target (handle->process (-> self scorp))) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (let* ((v1-7 (-> *game-info* sub-task-list (game-task-node desert-beast-battle-kill-last-beast))) (v1-9 (if (-> v1-7 manager) (-> v1-7 manager manager) diff --git a/goal_src/jak3/levels/desert/lizard/desert-lizard-task.gc b/goal_src/jak3/levels/desert/lizard/desert-lizard-task.gc index cd96d29606..26815951f2 100644 --- a/goal_src/jak3/levels/desert/lizard/desert-lizard-task.gc +++ b/goal_src/jak3/levels/desert/lizard/desert-lizard-task.gc @@ -234,13 +234,11 @@ ) ) (when (time-elapsed? (-> self state-time) (seconds 5)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (set! (-> self sound-id) - (add-process *gui-control* self (gui-channel background) (gui-action queue) "hudchime" -99.0 0) - ) - (suspend) - ) + (suspend-for + (seconds 1) + (set! (-> self sound-id) + (add-process *gui-control* self (gui-channel background) (gui-action queue) "hudchime" -99.0 0) + ) ) (sound-params-set! *gui-control* (-> self sound-id) #f -1 -1 -1 1.0) (set-action! @@ -572,11 +570,7 @@ :virtual #t :code (behavior () (send-event (handle->process (-> self vehicle-handle)) 'go-die) - (let ((t9-2 (-> (find-parent-state) code))) - (if t9-2 - ((the-as (function none) t9-2)) - ) - ) + (call-parent-state-handler code) ) ) diff --git a/goal_src/jak3/levels/desert/race/course-race.gc b/goal_src/jak3/levels/desert/race/course-race.gc index 596beabfc8..11111548e4 100644 --- a/goal_src/jak3/levels/desert/race/course-race.gc +++ b/goal_src/jak3/levels/desert/race/course-race.gc @@ -266,26 +266,14 @@ ) (suspend) (speech-control-method-12 *speech-control* *target* (speech-type race-errol-start)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (set! (-> self race-started?) #t) (task-manager-race-method-38 self) (remove-setting! 'allow-progress) (send-event (ppointer->process *race-manager*) 'force-start) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (send-event (handle->process (-> self player-vehicle)) 'set-control-hook-player) - (let ((t9-20 (-> (find-parent-state) code))) - (if t9-20 - ((the-as (function none) t9-20)) - ) - ) + (call-parent-state-handler code) ) ) @@ -310,11 +298,7 @@ :virtual #t :code (behavior () (task-manager-race-method-36 self) - (let ((t9-2 (-> (find-parent-state) code))) - (if t9-2 - ((the-as (function none) t9-2)) - ) - ) + (call-parent-state-handler code) ) ) @@ -607,11 +591,7 @@ ) #f (label cfg-123) - (let ((gp-7 (current-time))) - (until (time-elapsed? gp-7 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event (handle->process (-> self player-vehicle)) 'go-die) (remove-setting! 'entity-name) (send-event *target* 'continue (get-continue-by-name *game-info* "desertb-race-start")) @@ -670,11 +650,7 @@ (set-setting! 'vehicles 'set (shr t1-0 32) t1-0) ) (set! (-> self start-continue) (the-as continue-point "desertb-race-start")) - (let ((t9-2 (-> (find-parent-state) code))) - (if t9-2 - ((the-as (function none) t9-2)) - ) - ) + (call-parent-state-handler code) ) ) @@ -689,20 +665,12 @@ ) (task-node-close! (game-task-node desert-course-race-win) 'event) (send-event (ppointer->process *race-manager*) 'kill-npc-racers) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (while (handle->process (-> self scene-player)) (suspend) ) ) - (let ((t9-6 (-> (find-parent-state) code))) - (if t9-6 - ((the-as (function none) t9-6)) - ) - ) + (call-parent-state-handler code) ) ) @@ -828,11 +796,7 @@ (process-spawn hud-wasbbv-goal-time :init hud-init-by-other :name "hud-wasbbv-goal-time" :to self) ) ) - (let ((t9-7 (-> (find-parent-state) code))) - (if t9-7 - ((the-as (function none) t9-7)) - ) - ) + (call-parent-state-handler code) ) ) @@ -978,10 +942,6 @@ (process-spawn hud-wasbbv-goal-time :init hud-init-by-other :name "hud-wasbbv-goal-time" :to self) ) ) - (let ((t9-6 (-> (find-parent-state) code))) - (if t9-6 - ((the-as (function none) t9-6)) - ) - ) + (call-parent-state-handler code) ) ) diff --git a/goal_src/jak3/levels/desert/race/turtle-training.gc b/goal_src/jak3/levels/desert/race/turtle-training.gc index e5d120cf56..53359bf023 100644 --- a/goal_src/jak3/levels/desert/race/turtle-training.gc +++ b/goal_src/jak3/levels/desert/race/turtle-training.gc @@ -289,17 +289,8 @@ (set! (-> gp-0 map-icon) (the-as uint 12)) (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 self))) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 4)) - (print-training-text self (text-id text-05e6)) - (suspend) - ) - ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 4) (print-training-text self (text-id text-05e6))) + (suspend-for (seconds 0.25)) (set! (-> self time-limit) (seconds 30)) (set-time! (-> self start-time)) (until #f @@ -324,11 +315,7 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 0.25)) (set! (-> self show-message?) #f) (set! (-> self goal-pos quad) (-> self goal-array 1 pos quad)) (let ((gp-5 (new 'stack-no-clear 'task-arrow-params))) @@ -359,11 +346,7 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (let ((gp-7 (current-time))) - (until (time-elapsed? gp-7 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 0.25)) (set! (-> self time-limit) (seconds 28)) (set-time! (-> self start-time)) (set-time! (-> self test-time)) @@ -382,11 +365,7 @@ (sound-play "special-pickup") (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 0.25)) (set! (-> self show-message?) #f) (set! (-> self goal-pos quad) (-> self goal-array 2 pos quad)) (let ((gp-10 (new 'stack-no-clear 'task-arrow-params))) @@ -434,11 +413,7 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (let ((gp-12 (current-time))) - (until (time-elapsed? gp-12 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 0.25)) (set! (-> self goal-pos quad) (-> self goal-array 3 pos quad)) (let ((gp-13 (new 'stack-no-clear 'task-arrow-params))) (set! (-> gp-13 pos quad) (-> self goal-pos quad)) @@ -467,11 +442,7 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (let ((gp-15 (current-time))) - (until (time-elapsed? gp-15 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 0.25)) (set! (-> self goal-pos quad) (-> self goal-array 4 pos quad)) (let ((gp-16 (new 'stack-no-clear 'task-arrow-params))) (set! (-> gp-16 pos quad) (-> self goal-pos quad)) @@ -504,11 +475,7 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (let ((gp-18 (current-time))) - (until (time-elapsed? gp-18 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 0.25)) (set! (-> self goal-pos quad) (-> self goal-array 5 pos quad)) (let ((gp-19 (new 'stack-no-clear 'task-arrow-params))) (set! (-> gp-19 pos quad) (-> self goal-pos quad)) diff --git a/goal_src/jak3/levels/desert/rescue/desert-rescue.gc b/goal_src/jak3/levels/desert/rescue/desert-rescue.gc index 1765dbb0d7..114d01d13c 100644 --- a/goal_src/jak3/levels/desert/rescue/desert-rescue.gc +++ b/goal_src/jak3/levels/desert/rescue/desert-rescue.gc @@ -1795,11 +1795,7 @@ :virtual #t :event task-manager-event-handler :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set! (-> self entity) #f) (dotimes (v1-2 (-> self passenger-pos length)) (if (-> self passenger-pos v1-2 is-final?) @@ -2566,11 +2562,7 @@ ((-> (method-of-type task-manager active) trans)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event self 'fail) (sleep-code) ) diff --git a/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc b/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc index 0f11c6562f..e062438ebd 100644 --- a/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc +++ b/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc @@ -244,11 +244,7 @@ (w-parking-spot-method-23 self) ) (until #f - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.25)) - (suspend) - ) - ) + (suspend-for (seconds 0.25)) (w-parking-spot-method-21 self) (when (-> self should-spawn?) (let ((f0-0 (vector-vector-distance-squared (camera-pos) (-> self test-sphere))) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-marauder.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-marauder.gc index eb8bafc667..4b52e79288 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-marauder.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-marauder.gc @@ -491,10 +491,6 @@ (if (and *target* (focus-test? *target* pilot-riding)) (turbo-pickup-spawn (-> self root trans)) ) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc index d9bbe553bf..f2fff7a603 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc @@ -229,11 +229,7 @@ (defstate waiting (wvehicle) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (when (-> self minimap) diff --git a/goal_src/jak3/levels/factory/car/hvehicle.gc b/goal_src/jak3/levels/factory/car/hvehicle.gc index 40f54ae6ae..6913fca869 100644 --- a/goal_src/jak3/levels/factory/car/hvehicle.gc +++ b/goal_src/jak3/levels/factory/car/hvehicle.gc @@ -1208,11 +1208,7 @@ :enter (behavior () (rlet ((vf0 :class vf)) (init-vf0-vector) - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (let ((gp-0 (-> self child))) (while gp-0 (send-event (ppointer->process gp-0) 'traffic-off) diff --git a/goal_src/jak3/levels/factory/car/wcar-faccar.gc b/goal_src/jak3/levels/factory/car/wcar-faccar.gc index 71953fc443..f30f980cb8 100644 --- a/goal_src/jak3/levels/factory/car/wcar-faccar.gc +++ b/goal_src/jak3/levels/factory/car/wcar-faccar.gc @@ -158,35 +158,31 @@ process (lambda :behavior process ((arg0 handle)) - (let ((s5-0 (current-time)) - (s4-0 (current-time)) - ) - (until (time-elapsed? s4-0 (seconds 0.65)) - (when (time-elapsed? s5-0 (seconds 0.06)) - (set! s5-0 (current-time)) - (let ((s3-0 (handle->process arg0))) - (process-drawable-shock-effect - (the-as process-drawable s3-0) - (-> *lightning-spec-id-table* 1) - lightning-probe-callback - (-> *part-id-table* 160) - 0 - 0 - 40960.0 - ) - (process-drawable-shock-effect - (the-as process-drawable s3-0) - (-> *lightning-spec-id-table* 1) - lightning-probe-callback - (-> *part-id-table* 160) - 0 - 0 - 40960.0 - ) - ) - ) - (suspend) - ) + (let ((s5-0 (current-time))) + (suspend-for (seconds 0.65) (when (time-elapsed? s5-0 (seconds 0.06)) + (set! s5-0 (current-time)) + (let ((s3-0 (handle->process arg0))) + (process-drawable-shock-effect + (the-as process-drawable s3-0) + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + (process-drawable-shock-effect + (the-as process-drawable s3-0) + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + ) + ) + ) ) #f ) diff --git a/goal_src/jak3/levels/factory/fac-gunturret.gc b/goal_src/jak3/levels/factory/fac-gunturret.gc index e56f0b95a0..f63af294ff 100644 --- a/goal_src/jak3/levels/factory/fac-gunturret.gc +++ b/goal_src/jak3/levels/factory/fac-gunturret.gc @@ -626,28 +626,26 @@ (sound-group) (-> self root trans) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.75)) - (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> self aim-pos quad)) - (track-target self #t) - (vector-! s5-2 (-> self aim-pos) s5-2) - (when (time-elapsed? (-> self snd-cmd-time) (seconds 0.12)) - 0.0 - (vector-length s5-2) - (sound-play-by-name - (static-sound-name "smallturret-rot") - (-> self rotate-sound) - 1024 - (the int (* 1524.0 (* 0.5 (doppler-pitch-shift (-> self root trans) (-> self root transv))))) - 0 - (sound-group) - (-> self root trans) - ) - (set-time! (-> self snd-cmd-time)) + (suspend-for + (seconds 0.75) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (set! (-> s5-2 quad) (-> self aim-pos quad)) + (track-target self #t) + (vector-! s5-2 (-> self aim-pos) s5-2) + (when (time-elapsed? (-> self snd-cmd-time) (seconds 0.12)) + 0.0 + (vector-length s5-2) + (sound-play-by-name + (static-sound-name "smallturret-rot") + (-> self rotate-sound) + 1024 + (the int (* 1524.0 (* 0.5 (doppler-pitch-shift (-> self root trans) (-> self root transv))))) + 0 + (sound-group) + (-> self root trans) ) + (set-time! (-> self snd-cmd-time)) ) - (suspend) ) ) (when (-> self rotate-sound-playing) @@ -830,18 +828,9 @@ (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root trans quad)) (+! (-> gp-1 y) 12288.0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 2)) - (spawn (-> self part) gp-1) - (suspend) - ) - ) - ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 2) (spawn (-> self part) gp-1)) ) + (suspend-for (seconds 1)) (send-event self 'death-end) (while (-> self child) (suspend) diff --git a/goal_src/jak3/levels/factory/fac-robotank-turret.gc b/goal_src/jak3/levels/factory/fac-robotank-turret.gc index 58fe1b4af3..f97b970f94 100644 --- a/goal_src/jak3/levels/factory/fac-robotank-turret.gc +++ b/goal_src/jak3/levels/factory/fac-robotank-turret.gc @@ -714,11 +714,7 @@ ) (logior! (-> self flags) (fac-robotank-turret-flag frt3)) (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (let ((gp-2 (max 2 (min 3 (rand-vu-int-range 0 3))))) 0 (dotimes (s5-2 gp-2) @@ -744,12 +740,8 @@ ) ) ) - (let ((f30-0 (rand-vu-float-range 0.05 0.43)) - (s4-2 (current-time)) - ) - (until (time-elapsed? s4-2 (the int (* 300.0 f30-0))) - (suspend) - ) + (let ((f30-0 (rand-vu-float-range 0.05 0.43))) + (suspend-for (the int (* 300.0 f30-0))) ) ) ) @@ -766,11 +758,8 @@ 2.11 ) ) - (gp-3 (current-time)) ) - (until (time-elapsed? gp-3 (the int (* 300.0 f30-1))) - (suspend) - ) + (suspend-for (the int (* 300.0 f30-1))) ) ) #f @@ -787,11 +776,7 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (while (-> self child) (suspend) ) diff --git a/goal_src/jak3/levels/factory/fac-robotank.gc b/goal_src/jak3/levels/factory/fac-robotank.gc index 47f7acc43d..5c1948eebc 100644 --- a/goal_src/jak3/levels/factory/fac-robotank.gc +++ b/goal_src/jak3/levels/factory/fac-robotank.gc @@ -492,11 +492,7 @@ ) :code (behavior () (logclear! (-> self flags) (robotank-flag r2)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) - ) + (suspend-for (seconds 0.1)) (logior! (-> self flags) (robotank-flag r2)) (sleep-code) ) @@ -660,11 +656,7 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (while (-> self child) (suspend) ) diff --git a/goal_src/jak3/levels/factory/fac-tower.gc b/goal_src/jak3/levels/factory/fac-tower.gc index ef82ac1a65..caefb816b0 100644 --- a/goal_src/jak3/levels/factory/fac-tower.gc +++ b/goal_src/jak3/levels/factory/fac-tower.gc @@ -263,11 +263,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) ) :post ja-post ) diff --git a/goal_src/jak3/levels/factory/factory-manager.gc b/goal_src/jak3/levels/factory/factory-manager.gc index 30233164f4..ff38a23a21 100644 --- a/goal_src/jak3/levels/factory/factory-manager.gc +++ b/goal_src/jak3/levels/factory/factory-manager.gc @@ -1782,11 +1782,7 @@ :virtual #t :enter (behavior () (send-event (handle->process (-> self hud-damage)) 'hide-and-die) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) ) diff --git a/goal_src/jak3/levels/factory/factoryc-obs.gc b/goal_src/jak3/levels/factory/factoryc-obs.gc index 17a2cf18a5..e7f618dcc6 100644 --- a/goal_src/jak3/levels/factory/factoryc-obs.gc +++ b/goal_src/jak3/levels/factory/factoryc-obs.gc @@ -1062,78 +1062,75 @@ (defstate flickering (factory-elec-gate) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 3)) - (let ((s5-0 (the-as int (rand-uint31-gen *random-generator*)))) - (let ((s4-0 0) - (s3-0 3) - ) - (while (>= s3-0 s4-0) - (cond - ((logtest? s5-0 1) - (when (not (-> self beams-on s4-0)) - (let ((v1-8 (-> self beams s4-0)) - (a0-1 1) - ) - (let ((a1-1 (!= a0-1 (-> v1-8 state mode)))) - (case a0-1 - ((3) - (if a1-1 - (set! (-> v1-8 state counter) 0.0) - ) - ) - ((1) - (set! (-> v1-8 state start-color) (-> v1-8 spec start-color)) - (set! (-> v1-8 state end-color) (-> v1-8 spec end-color)) - ) - ) + (suspend-for + (seconds 3) + (let ((s5-0 (the-as int (rand-uint31-gen *random-generator*)))) + (let ((s4-0 0) + (s3-0 3) + ) + (while (>= s3-0 s4-0) + (cond + ((logtest? s5-0 1) + (when (not (-> self beams-on s4-0)) + (let ((v1-8 (-> self beams s4-0)) + (a0-1 1) ) - (set! (-> v1-8 state mode) (the-as uint a0-1)) - ) - (set! (-> self beams-on s4-0) #t) - (set-factoryc-light! 1.0 1) - ) - ) - (else - (when (-> self beams-on s4-0) - (let ((v1-17 (-> self beams s4-0)) - (a0-5 3) - ) - (let ((a1-12 (!= a0-5 (-> v1-17 state mode)))) - (case a0-5 - ((3) - (if a1-12 - (set! (-> v1-17 state counter) 0.0) - ) - ) - ((1) - (set! (-> v1-17 state start-color) (-> v1-17 spec start-color)) - (set! (-> v1-17 state end-color) (-> v1-17 spec end-color)) - ) - ) + (let ((a1-1 (!= a0-1 (-> v1-8 state mode)))) + (case a0-1 + ((3) + (if a1-1 + (set! (-> v1-8 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-8 state start-color) (-> v1-8 spec start-color)) + (set! (-> v1-8 state end-color) (-> v1-8 spec end-color)) + ) + ) + ) + (set! (-> v1-8 state mode) (the-as uint a0-1)) + ) + (set! (-> self beams-on s4-0) #t) + (set-factoryc-light! 1.0 1) + ) + ) + (else + (when (-> self beams-on s4-0) + (let ((v1-17 (-> self beams s4-0)) + (a0-5 3) + ) + (let ((a1-12 (!= a0-5 (-> v1-17 state mode)))) + (case a0-5 + ((3) + (if a1-12 + (set! (-> v1-17 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-17 state start-color) (-> v1-17 spec start-color)) + (set! (-> v1-17 state end-color) (-> v1-17 spec end-color)) + ) ) - (set! (-> v1-17 state mode) (the-as uint a0-5)) ) - (set! (-> self beams-on s4-0) #f) - (set-factoryc-light! 0.0 1) + (set! (-> v1-17 state mode) (the-as uint a0-5)) ) + (set! (-> self beams-on s4-0) #f) + (set-factoryc-light! 0.0 1) ) ) - (set! s5-0 (/ s5-0 2)) - (+! s4-0 1) - ) - ) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.1)) - (if (logand s5-0 1) - (sound-play "laser-loop" :id (-> self bzzt-sound) :position (-> self entity trans)) - ) - (suspend) ) + (set! s5-0 (/ s5-0 2)) + (+! s4-0 1) ) ) - (suspend) + (suspend-for + (seconds 0.1) + (if (logand s5-0 1) + (sound-play "laser-loop" :id (-> self bzzt-sound) :position (-> self entity trans)) + ) + ) ) + (empty-form) ) (process-entity-status! self (entity-perm-status subtask-complete) #t) (process-entity-status! self (entity-perm-status dead) #t) diff --git a/goal_src/jak3/levels/factory/factoryc-obs2.gc b/goal_src/jak3/levels/factory/factoryc-obs2.gc index d150f2594b..43f24c7559 100644 --- a/goal_src/jak3/levels/factory/factoryc-obs2.gc +++ b/goal_src/jak3/levels/factory/factoryc-obs2.gc @@ -836,15 +836,13 @@ (process-entity-status! self (entity-perm-status subtask-complete) #t) (cond ((not arg0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.3)) - (let* ((f28-0 (lerp-clamp 0.0 3640.889 (* 0.011111111 (the float (- (current-time) (-> self state-time)))))) - (f30-0 (cos f28-0)) - (f0-2 (sin f28-0)) - ) - (quaternion-set! (-> self lever-jmod rotation) f0-2 0.0 0.0 f30-0) - ) - (suspend) + (suspend-for + (seconds 0.3) + (let* ((f28-0 (lerp-clamp 0.0 3640.889 (* 0.011111111 (the float (- (current-time) (-> self state-time)))))) + (f30-0 (cos f28-0)) + (f0-2 (sin f28-0)) + ) + (quaternion-set! (-> self lever-jmod rotation) f0-2 0.0 0.0 f30-0) ) ) (let ((gp-2 (res-lump-struct (-> self entity) 'cutaway-camera structure))) @@ -853,12 +851,7 @@ (suspend) ) (set-setting! 'entity-name gp-2 0.0 0) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 3)) - '() - (suspend) - ) - ) + (suspend-for (seconds 3) '()) (remove-setting! 'entity-name) (while (not (process-release? *target*)) (suspend) @@ -1027,18 +1020,10 @@ :virtual #t :event plat-event :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) ) :code (behavior () - (let ((t9-1 (-> (find-parent-state) code))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (call-parent-state-handler code) ) ) @@ -1094,14 +1079,12 @@ :trans plat-trans :code (behavior () (let ((f30-0 (-> self dead-set-time))) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 3)) - (set! (-> self path-pos) - (lerp-clamp (get-norm! (-> self sync) 0) f30-0 (* 0.0011111111 (the float (- (current-time) gp-0)))) - ) - (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) - (suspend) - ) + (suspend-for + (seconds 3) + (set! (-> self path-pos) + (lerp-clamp (get-norm! (-> self sync) 0) f30-0 (* 0.0011111111 (the float (- (current-time) time)))) + ) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) ) (suspend) (set! (-> self path-pos) f30-0) @@ -1183,18 +1166,10 @@ ) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) ) :code (behavior () - (let ((t9-1 (-> (find-parent-state) code))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (call-parent-state-handler code) ) ) diff --git a/goal_src/jak3/levels/factory/lfacrm2-mood.gc b/goal_src/jak3/levels/factory/lfacrm2-mood.gc index 481bdbc1b1..848e7fceb4 100644 --- a/goal_src/jak3/levels/factory/lfacrm2-mood.gc +++ b/goal_src/jak3/levels/factory/lfacrm2-mood.gc @@ -22,11 +22,7 @@ :virtual #t :enter (behavior () (set! (-> self mysound) (sound-play "elevator-a")) - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (sound-stop (-> self mysound)) @@ -57,11 +53,7 @@ (-> gp-0 id) ) ) - (let ((t9-5 (-> (find-parent-state) trans))) - (if t9-5 - (t9-5) - ) - ) + (call-parent-state-handler trans) ) :code (behavior () (when (not (nonzero? (res-lump-value (-> self entity) 'start-gate-up uint128 :time -1000000000.0))) @@ -71,11 +63,7 @@ (ja :num! (seek! max 1.333)) ) ) - (let ((t9-5 (-> (find-parent-state) code))) - (if t9-5 - ((the-as (function none) t9-5)) - ) - ) + (call-parent-state-handler code) ) ) @@ -101,12 +89,7 @@ (defstate dormant (fac-elevator-a) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1.5)) - '() - (suspend) - ) - ) + (suspend-for (seconds 1.5) '()) (ja-no-eval :group! fac-elevator-a-gate_down-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) diff --git a/goal_src/jak3/levels/factory/warf-projectile.gc b/goal_src/jak3/levels/factory/warf-projectile.gc index 0c21658eda..97f3945447 100644 --- a/goal_src/jak3/levels/factory/warf-projectile.gc +++ b/goal_src/jak3/levels/factory/warf-projectile.gc @@ -627,11 +627,7 @@ ) (process-spawn warf-explosion-sphere gp-0 :name "warf-explosion-sphere" :to self) ) - (let ((t9-8 (-> (find-parent-state) enter))) - (if t9-8 - (t9-8) - ) - ) + (call-parent-state-handler enter) ) :code (behavior () (while (< (-> self hit-pos w) 245760.0) diff --git a/goal_src/jak3/levels/forest/forest-ring-chase.gc b/goal_src/jak3/levels/forest/forest-ring-chase.gc index 76e73f549b..5d8856fdac 100644 --- a/goal_src/jak3/levels/forest/forest-ring-chase.gc +++ b/goal_src/jak3/levels/forest/forest-ring-chase.gc @@ -525,11 +525,7 @@ (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 8)) - (suspend) - ) - ) + (suspend-for (seconds 8)) ) ) @@ -1037,14 +1033,10 @@ (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 584) :duration (seconds 1)) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (if (nonzero? (-> self sound-id)) - (sound-play "statue-expl-bu" :id (-> self sound-id)) - ) - (suspend) - ) - ) + (suspend-for (seconds 1) (if (nonzero? (-> self sound-id)) + (sound-play "statue-expl-bu" :id (-> self sound-id)) + ) + ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) @@ -1079,11 +1071,7 @@ (transform-post) (sound-play "statue-explode") (for-statue-method-28 self) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 3)) - (suspend) - ) - ) + (suspend-for (seconds 3)) (cleanup-for-death self) (let ((a1-15 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-15 from) (process->ppointer self)) @@ -2304,12 +2292,7 @@ ) (suspend) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 3)) - (format *stdebug* "task-manager-forest-ring-chase: done!~%") - (suspend) - ) - ) + (suspend-for (seconds 3) (format *stdebug* "task-manager-forest-ring-chase: done!~%")) (while (-> self use-camera?) (suspend) ) diff --git a/goal_src/jak3/levels/forest/forest-tasks.gc b/goal_src/jak3/levels/forest/forest-tasks.gc index 1f079ebbd5..726e4be2c6 100644 --- a/goal_src/jak3/levels/forest/forest-tasks.gc +++ b/goal_src/jak3/levels/forest/forest-tasks.gc @@ -67,11 +67,7 @@ :virtual #t :code (behavior () (local-vars (a1-12 event-message-block) (gp-3 symbol)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (until (and (-> self manager-entity) (= (-> *game-info* counter) 0.0)) (suspend) (if (not (-> self manager-entity)) @@ -147,11 +143,7 @@ (until (process-grab? *target* #f) (suspend) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.1)) - (suspend) - ) - ) + (suspend-for (seconds 0.1)) (let ((a1-14 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-14 from) (process->ppointer self)) (set! (-> a1-14 num-params) 0) @@ -281,11 +273,7 @@ (suspend) (set! (-> self manager-entity) (entity-by-name "for-machine-manager-1")) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (let ((gp-1 (-> self entity extra perm))) (logior! (-> gp-1 status) (entity-perm-status bit-5)) (when (zero? (-> gp-1 user-object 0)) @@ -303,11 +291,7 @@ ) (set! (-> gp-1 user-object 0) (+ (the-as int (-> gp-1 user-object 0)) 1)) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-33 (res-lump-data (-> self manager-entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond diff --git a/goal_src/jak3/levels/gungame/gun-dummy.gc b/goal_src/jak3/levels/gungame/gun-dummy.gc index 714921cda8..2db67101b0 100644 --- a/goal_src/jak3/levels/gungame/gun-dummy.gc +++ b/goal_src/jak3/levels/gungame/gun-dummy.gc @@ -1058,11 +1058,7 @@ ((time-elapsed? (-> self arm-start-time) (seconds 2)) ) ) - (let ((t9-5 (-> (find-parent-state) trans))) - (if t9-5 - (t9-5) - ) - ) + (call-parent-state-handler trans) ) ) diff --git a/goal_src/jak3/levels/gungame/gungame-manager.gc b/goal_src/jak3/levels/gungame/gungame-manager.gc index 74777eeccc..5602ca0f23 100644 --- a/goal_src/jak3/levels/gungame/gungame-manager.gc +++ b/goal_src/jak3/levels/gungame/gungame-manager.gc @@ -1476,11 +1476,7 @@ '() ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (if (search-process-tree *active-pool* (lambda ((arg0 process)) (type? arg0 gungame-manager))) (return 0) ) @@ -1614,22 +1610,10 @@ ) (set-setting! 'features 'clear (shr t1-0 32) t1-0) ) - (cond - ((>= 1 (-> self course-list length)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) - ) - (else - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) - ) + (if (>= 1 (-> self course-list length)) + (suspend-for (seconds 1)) + (suspend-for (seconds 0.5)) ) - ) (let ((gp-2 (get-process *default-dead-pool* (-> self activated-course etype) #x4000 1))) (when gp-2 (let ((t9-3 (method-of-type process activate))) diff --git a/goal_src/jak3/levels/gungame/gungame-obs.gc b/goal_src/jak3/levels/gungame/gungame-obs.gc index 84f30bd37d..59f9056009 100644 --- a/goal_src/jak3/levels/gungame/gungame-obs.gc +++ b/goal_src/jak3/levels/gungame/gungame-obs.gc @@ -135,12 +135,7 @@ :event gungame-door-handler :code (behavior () (sound-play "gungame-door") - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.2)) - (suspend) - (suspend) - ) - ) + (suspend-for (seconds 0.2) (suspend)) (ja-no-eval :group! fort-entry-gate-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) diff --git a/goal_src/jak3/levels/intro/intro-scenes.gc b/goal_src/jak3/levels/intro/intro-scenes.gc index 59d88f73c8..c3eb9731f8 100644 --- a/goal_src/jak3/levels/intro/intro-scenes.gc +++ b/goal_src/jak3/levels/intro/intro-scenes.gc @@ -225,9 +225,9 @@ ) (set! (-> gp-0 scale-x) 1.0) (set! (-> gp-0 scale-y) 1.0) - (when (and s5-0 (-> gp-0 tid)) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 (seconds 3)) + (if (and s5-0 (-> gp-0 tid)) + (suspend-for + (seconds 3) (let ((f0-2 1.0)) (cond ((< f30-0 1.0) @@ -247,10 +247,8 @@ (if (not (paused?)) (+! f30-0 (seconds-per-frame)) ) - (suspend) ) ) - ) ) (none) ) @@ -301,9 +299,9 @@ (set-vector! (-> gp-0 pos) 256 188 #xffffff 0) (set! (-> gp-0 tid) (the-as texture-id (get-texture JakIII inttitle-minimap))) (set! (-> s5-0 tid) (the-as texture-id #f)) - (when (and s4-0 (-> gp-0 tid)) - (let ((s3-0 (current-time))) - (until (time-elapsed? s3-0 (seconds 4.33)) + (if (and s4-0 (-> gp-0 tid)) + (suspend-for + (seconds 4.33) (let ((f0-2 1.0)) (cond ((< f30-0 0.5) @@ -327,10 +325,8 @@ (if (not (paused?)) (+! f30-0 (seconds-per-frame)) ) - (suspend) ) ) - ) ) (none) ) @@ -349,14 +345,10 @@ (lambda :behavior scene-player () (talker-spawn-func (-> *talker-speech* 61) self (target-pos 0) (the-as region #f)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 5)) - (if (cpad-pressed? 0 square) - (return #f) - ) - (suspend) - ) - ) + (suspend-for (seconds 5) (if (cpad-pressed? 0 square) + (return #f) + ) + ) (none) ) :to self diff --git a/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc b/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc index 15b986e7fa..9c7991e8f7 100644 --- a/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc +++ b/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc @@ -237,11 +237,7 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (while *scene-player* (suspend) ) @@ -278,11 +274,7 @@ (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 325) :mat-joint gp-1) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.1)) - (suspend) - ) - ) + (suspend-for (seconds 0.1)) (logior! (-> self draw status) (draw-control-status no-draw)) (let ((t0-2 (res-lump-struct (-> self entity) 'camera-name structure))) (if t0-2 @@ -1215,11 +1207,7 @@ ) (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active)) ) - (let ((t9-3 (-> (find-parent-state) trans))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler trans) ) ) diff --git a/goal_src/jak3/levels/mhcity/mhcity-obs.gc b/goal_src/jak3/levels/mhcity/mhcity-obs.gc index ed882605f0..10269b2ad9 100644 --- a/goal_src/jak3/levels/mhcity/mhcity-obs.gc +++ b/goal_src/jak3/levels/mhcity/mhcity-obs.gc @@ -862,11 +862,7 @@ (ja :num! (seek!)) ) (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (task-node-close! (game-task-node city-destroy-darkeco-resolution) 'event) (sleep-code) ) @@ -919,11 +915,7 @@ (label cfg-9) (ja-channel-push! 1 (seconds 0.5)) (ja :group! mhcity-dark-eco-door-idle-ja :num! (seek! 15.0) :frame-num 15.0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (go-virtual cracked) ) #f @@ -1093,11 +1085,7 @@ (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 326)) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.1)) - (suspend) - ) - ) + (suspend-for (seconds 0.1)) (process-entity-status! self (entity-perm-status dead) #t) ) :post ja-post diff --git a/goal_src/jak3/levels/mhcity/mhcity-obs2.gc b/goal_src/jak3/levels/mhcity/mhcity-obs2.gc index 401db8bdc0..2fa10c25b0 100644 --- a/goal_src/jak3/levels/mhcity/mhcity-obs2.gc +++ b/goal_src/jak3/levels/mhcity/mhcity-obs2.gc @@ -374,11 +374,7 @@ :virtual #t :parent (mhcity-puffer-large puffer-active-base-state) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -397,11 +393,7 @@ :virtual #t :parent (mhcity-puffer-large puffer-active-base-state) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) diff --git a/goal_src/jak3/levels/mine/gekko.gc b/goal_src/jak3/levels/mine/gekko.gc index ce7400ec98..5da6f47688 100644 --- a/goal_src/jak3/levels/mine/gekko.gc +++ b/goal_src/jak3/levels/mine/gekko.gc @@ -1948,11 +1948,7 @@ (ja-channel-push! 1 (seconds 0.4)) (ja-no-eval :group! gekko-run0-a-ja :num! (seek!) :frame-num 0.0) (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.4)) - (suspend) - ) - ) + (suspend-for (seconds 0.4)) (if (enemy-method-109 self) (go-die self) (go-hostile self) diff --git a/goal_src/jak3/levels/mine/mine-obs.gc b/goal_src/jak3/levels/mine/mine-obs.gc index a967ad9a83..89bfeef6ec 100644 --- a/goal_src/jak3/levels/mine/mine-obs.gc +++ b/goal_src/jak3/levels/mine/mine-obs.gc @@ -569,11 +569,7 @@ (suspend) (ja :num! (seek! max 0.03)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (go-virtual inactive) ) :post (behavior () @@ -1322,11 +1318,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (let ((a1-0 (new 'stack-no-clear 'array 'symbol 3))) (set! (-> a1-0 2) 'mine6) (set! (-> a1-0 1) 'mine5) @@ -1642,11 +1634,7 @@ :virtual #t :code (behavior () (sound-play "floor-switch") - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (when (not (task-node-closed? (game-task-node mine-blow-introduction))) (let ((a1-1 (new 'stack-no-clear 'array 'symbol 3))) (set! (-> a1-1 2) 'mine6) diff --git a/goal_src/jak3/levels/mine/mine-platforms.gc b/goal_src/jak3/levels/mine/mine-platforms.gc index e20f5509f2..fe008cb64c 100644 --- a/goal_src/jak3/levels/mine/mine-platforms.gc +++ b/goal_src/jak3/levels/mine/mine-platforms.gc @@ -437,11 +437,7 @@ ) :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (let ((gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (s5-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (s4-0 #t) @@ -614,11 +610,7 @@ :trans plat-trans :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (ja-channel-push! 1 0) (ja-no-eval :group! min-rotating-plat-idle-ja :num! min) (sync-now! (-> self sync) 0.0) @@ -1233,11 +1225,7 @@ ) :trans rider-trans :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1.5)) - (suspend) - ) - ) + (suspend-for (seconds 1.5)) (when (-> self stop-sound) (set! (-> self stop-sound) #f) (sound-params-set! *gui-control* (-> self sound-id) #t -1 -1 -1 -1.0) @@ -1432,11 +1420,7 @@ ) :code (behavior () (when (-> self play-ramp-sound?) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 3)) - (suspend) - ) - ) + (suspend-for (seconds 3)) (until (= (get-status *gui-control* (-> self ramp-sound)) (gui-status ready)) (suspend) ) @@ -1598,11 +1582,7 @@ :trans rider-trans :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1.5)) - (suspend) - ) - ) + (suspend-for (seconds 1.5)) (when (-> self stop-bridge-sound) (set! (-> self stop-bridge-sound) #f) (sound-params-set! *gui-control* (-> self bridge-sound) #t -1 150 2 -1.0) diff --git a/goal_src/jak3/levels/mine/mine-train.gc b/goal_src/jak3/levels/mine/mine-train.gc index e3404eb0b1..222832304d 100644 --- a/goal_src/jak3/levels/mine/mine-train.gc +++ b/goal_src/jak3/levels/mine/mine-train.gc @@ -483,11 +483,7 @@ (quaternion-normalize! (-> self root quat)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (when (type? (-> self root) collide-shape) (let ((v1-7 (-> self root root-prim))) (set! (-> v1-7 prim-core collide-as) (collide-spec)) diff --git a/goal_src/jak3/levels/mine/rat.gc b/goal_src/jak3/levels/mine/rat.gc index 7c4a954c9b..259301b9d4 100644 --- a/goal_src/jak3/levels/mine/rat.gc +++ b/goal_src/jak3/levels/mine/rat.gc @@ -737,11 +737,7 @@ (if (enemy-method-109 self) (go-virtual die) ) - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) ) @@ -2000,11 +1996,7 @@ (logior! (-> self entity extra perm status) (entity-perm-status subtask-complete)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (while (-> self child) (suspend) ) diff --git a/goal_src/jak3/levels/nest/egg-spider.gc b/goal_src/jak3/levels/nest/egg-spider.gc index 0f5e8fd4d7..bacb680b75 100644 --- a/goal_src/jak3/levels/nest/egg-spider.gc +++ b/goal_src/jak3/levels/nest/egg-spider.gc @@ -1330,11 +1330,7 @@ (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 639)) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.6)) - (suspend) - ) - ) + (suspend-for (seconds 0.6)) (let ((v1-38 (-> self root root-prim))) (set! (-> v1-38 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-38 prim-core collide-with) (-> self root backup-collide-with)) @@ -1357,11 +1353,7 @@ ) ) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) (ja-channel-push! 1 0) (ja-no-eval :group! egg-spider-crawl-from-ground-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak3/levels/nest/mh-bat.gc b/goal_src/jak3/levels/nest/mh-bat.gc index c9278b55a7..3aa7442cd8 100644 --- a/goal_src/jak3/levels/nest/mh-bat.gc +++ b/goal_src/jak3/levels/nest/mh-bat.gc @@ -1172,11 +1172,7 @@ (defstate ambush (mh-bat) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set-time! (-> self state-time)) (set! (-> self start-pos quad) (-> self root trans quad)) (set-vector! (-> self root transv) 0.0 -81920.0 0.0 0.0) @@ -1298,11 +1294,7 @@ (defstate hostile (mh-bat) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set! (-> self bank-angle) 0.0) (set! (-> self pitch-angle) 0.0) (set! (-> self orbit-distance) (* 4096.0 (rnd-float-range self 17.0 30.0))) diff --git a/goal_src/jak3/levels/nest/nst-obs.gc b/goal_src/jak3/levels/nest/nst-obs.gc index 4830f53e52..be735a089c 100644 --- a/goal_src/jak3/levels/nest/nst-obs.gc +++ b/goal_src/jak3/levels/nest/nst-obs.gc @@ -140,11 +140,7 @@ ) ) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (cleanup-for-death self) ) ) @@ -713,11 +709,7 @@ (when (-> self actor-group) (let ((f30-0 (* 0.0005 (the float (-> self actor-group length))))) (dotimes (gp-8 (-> self actor-group length)) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (the int (* 300.0 f30-0))) - (suspend) - ) - ) + (suspend-for (the int (* 300.0 f30-0))) (let ((a1-24 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-24 from) (process->ppointer self)) (set! (-> a1-24 num-params) 0) @@ -1190,11 +1182,7 @@ ) :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) (when (-> self anim) (-> self draw bounds w) (set! (-> self draw bounds w) 737280.0) @@ -1727,19 +1715,9 @@ (set! (-> self cycling?) #t) (spawn (-> self charge-up-part) (-> self node-list data 12 bone transform trans)) (set! (-> self cycle-rot) -1820.4445) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (ja :num! (loop!)) - (suspend) - ) - ) + (suspend-for (seconds 0.5) (ja :num! (loop!))) (set! (-> self cycle-rot) 1820.4445) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (ja :num! (loop!)) - (suspend) - ) - ) + (suspend-for (seconds 0.5) (ja :num! (loop!))) (set! (-> self cycling?) #f) (set! (-> self shots-left) (the-as uint 4)) (set! (-> self can-shoot?) #f) @@ -1918,19 +1896,11 @@ (if (>= (-> self palette-id) 0) (set-nstb-lights! (-> self palette-id) 4.0 8.0 #f) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (if (>= (-> self palette-id) 0) (set-nstb-lights! (-> self palette-id) 0.0 6.0 #f) ) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 0.35)) - (suspend) - ) - ) + (suspend-for (seconds 0.35)) (let ((gp-6 (-> self child))) (while gp-6 (send-event (ppointer->process gp-6) 'notice 'die) diff --git a/goal_src/jak3/levels/precursor/precura-obs.gc b/goal_src/jak3/levels/precursor/precura-obs.gc index 738a3f1256..90f344dfa2 100644 --- a/goal_src/jak3/levels/precursor/precura-obs.gc +++ b/goal_src/jak3/levels/precursor/precura-obs.gc @@ -22,24 +22,20 @@ process (lambda :behavior process () - (let ((gp-0 (current-time)) - (s5-0 (current-time)) - ) - (until (time-elapsed? s5-0 (seconds 1)) - (when (time-elapsed? gp-0 (seconds 0.03)) - (set! gp-0 (current-time)) - (process-drawable-shock-effect - *target* - (-> *lightning-spec-id-table* 1) - lightning-probe-callback - (-> *part-id-table* 160) - 0 - 0 - 40960.0 - ) - ) - (suspend) - ) + (let ((gp-0 (current-time))) + (suspend-for (seconds 1) (when (time-elapsed? gp-0 (seconds 0.03)) + (set! gp-0 (current-time)) + (process-drawable-shock-effect + *target* + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + ) + ) ) #f ) @@ -1046,27 +1042,15 @@ ) (logior! (-> self draw status) (draw-control-status no-draw)) (transform-post) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1.2)) - (suspend) - ) - ) + (suspend-for (seconds 1.2)) (when (res-lump-struct (-> self entity) 'art-name structure) (logclear! (-> self mask) (process-mask actor-pause)) (process-grab? *target* #f) (set-setting! 'entity-name "camera-359" 0.0 0) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (task-close! "precursor-tour-generator-trigger") (send-event (process-by-name "precur-door-b-4" *active-pool*) 'open) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (set-setting! 'interp-time 'abs 450.0 0) (remove-setting! 'entity-name) (process-release? *target*) @@ -2510,11 +2494,7 @@ (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) ) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1.5)) - (suspend) - ) - ) + (suspend-for (seconds 1.5)) (set-setting! 'entity-name "camera-420" 0.0 0) (process-grab? *target* #f) (process-entity-status! self (entity-perm-status subtask-complete) #t) @@ -2588,11 +2568,7 @@ ) :code (behavior () (when (-> self precur-tour?) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2.5)) - (suspend) - ) - ) + (suspend-for (seconds 2.5)) (remove-setting! 'entity-name) (process-release? *target*) ) diff --git a/goal_src/jak3/levels/precursor/precura-obs2.gc b/goal_src/jak3/levels/precursor/precura-obs2.gc index cca8cd359d..adfe87a2e2 100644 --- a/goal_src/jak3/levels/precursor/precura-obs2.gc +++ b/goal_src/jak3/levels/precursor/precura-obs2.gc @@ -1658,11 +1658,7 @@ (let ((gp-0 (res-lump-data (-> self entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and gp-0 (nonzero? (-> sv-16 elt-count))) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (set! (-> self actor-group-count) (the-as int (-> sv-16 elt-count))) (set! (-> self actor-group) (the-as (pointer actor-group) gp-0)) (dotimes (gp-1 (length (-> self actor-group 0))) diff --git a/goal_src/jak3/levels/sewer/mh-wasp.gc b/goal_src/jak3/levels/sewer/mh-wasp.gc index 8d0ed61432..4f7cde4335 100644 --- a/goal_src/jak3/levels/sewer/mh-wasp.gc +++ b/goal_src/jak3/levels/sewer/mh-wasp.gc @@ -830,11 +830,7 @@ 0 (set! (-> self hit-points) 0.0) (do-effect (-> self skel effect) (the-as string 'death-default) 0.0 -1) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event self 'death-end) (cleanup-for-death self) ) diff --git a/goal_src/jak3/levels/sewer/neo-juicer.gc b/goal_src/jak3/levels/sewer/neo-juicer.gc index adf9776699..a088860bab 100644 --- a/goal_src/jak3/levels/sewer/neo-juicer.gc +++ b/goal_src/jak3/levels/sewer/neo-juicer.gc @@ -1219,57 +1219,56 @@ (s5-0 (+ (-> v1-29 attack-id) 1)) ) (set! (-> v1-29 attack-id) s5-0) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 (seconds 0.25)) - (ja-no-eval :group! neo-juicer-attack0-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (let ((s3-0 (handle->process (-> self focus handle)))) - (when s3-0 - (when (< 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable s3-0) 0))) - (spawn-proj! self (the-as process-focusable s3-0) s5-0) - (current-time) - (if (not gp-0) - (set! gp-0 #t) + (suspend-for + (seconds 0.25) + (ja-no-eval :group! neo-juicer-attack0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((s3-0 (handle->process (-> self focus handle)))) + (when s3-0 + (when (< 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable s3-0) 0))) + (spawn-proj! self (the-as process-focusable s3-0) s5-0) + (current-time) + (if (not gp-0) + (set! gp-0 #t) + ) + ) + ) + ) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (b! + (not (and (-> self using-turn-anim) (let ((v1-73 (ja-group))) + (not (and v1-73 (= v1-73 neo-juicer-attack-turn-ja))) + ) ) - ) - ) - ) - (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) - (go-virtual victory) - ) - (b! - (not (and (-> self using-turn-anim) (let ((v1-73 (ja-group))) - (not (and v1-73 (= v1-73 neo-juicer-attack-turn-ja))) - ) - ) - ) - cfg-31 - :delay (empty-form) - ) + ) + cfg-31 + :delay (empty-form) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! neo-juicer-attack-turn-ja) + (b! #t cfg-42 :delay (nop!)) + (label cfg-31) + (when (and (not (-> self using-turn-anim)) (let ((v1-84 (ja-group))) + (not (and v1-84 (= v1-84 neo-juicer-attack0-ja))) + ) + ) (ja-channel-push! 1 (seconds 0.05)) - (ja :group! neo-juicer-attack-turn-ja) - (b! #t cfg-42 :delay (nop!)) - (label cfg-31) - (when (and (not (-> self using-turn-anim)) (let ((v1-84 (ja-group))) - (not (and v1-84 (= v1-84 neo-juicer-attack0-ja))) - ) - ) - (ja-channel-push! 1 (seconds 0.05)) - (ja :group! neo-juicer-attack0-ja) - ) - (label cfg-42) - (suspend) - (ja :num! (seek!)) - ) - (send-event (handle->process (-> self current-projectile)) 'die) - (let ((a0-37 (handle->process (-> self focus handle)))) - (when a0-37 - (if (>= 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable a0-37) 0))) - (go-virtual circling) - ) - ) + (ja :group! neo-juicer-attack0-ja) ) + (label cfg-42) (suspend) + (ja :num! (seek!)) + ) + (empty-form) + (send-event (handle->process (-> self current-projectile)) 'die) + (let ((a0-37 (handle->process (-> self focus handle)))) + (when a0-37 + (if (>= 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable a0-37) 0))) + (go-virtual circling) + ) + ) ) ) ) diff --git a/goal_src/jak3/levels/sewer/saberfish.gc b/goal_src/jak3/levels/sewer/saberfish.gc index c875528628..40018d8bb2 100644 --- a/goal_src/jak3/levels/sewer/saberfish.gc +++ b/goal_src/jak3/levels/sewer/saberfish.gc @@ -1010,11 +1010,7 @@ :virtual #t :enter (behavior () (sound-play "sabfish-gethit") - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) ) @@ -1024,11 +1020,7 @@ (if (saberfish-method-243 self) (go-virtual swimming-hostile) ) - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -1041,11 +1033,7 @@ (handle-cmd self a1-2) ) ) - (let ((t9-4 (-> (find-parent-state) trans))) - (if t9-4 - (t9-4) - ) - ) + (call-parent-state-handler trans) ) :post saberfish-chase-post ) @@ -2954,11 +2942,7 @@ (set! (-> self swim-travel-anim) 0) 0 ) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (set! (-> self scare-time) 0) @@ -2997,13 +2981,9 @@ ) ) (saberfish-swim-travel-trans) - (when (>= (the-as int (-> self focus aware)) 2) - (let ((t9-9 (-> (find-parent-state) trans))) - (if t9-9 - (t9-9) - ) + (if (>= (the-as int (-> self focus aware)) 2) + (call-parent-state-handler trans) ) - ) ) :code (behavior () (saberfish-swim-code) @@ -3135,18 +3115,10 @@ :enter (behavior () (set! (-> self knocked-under-water?) #f) (set! (-> self move-to-ground?) #f) - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) ) ) @@ -3186,11 +3158,7 @@ (if (saberfish-method-243 self) (go-virtual knocked-recover-water) ) - (let ((t9-4 (-> (find-parent-state) enter))) - (if t9-4 - (t9-4) - ) - ) + (call-parent-state-handler enter) ) :code (behavior () (if (handle->process (-> self ragdoll-proc)) @@ -3198,11 +3166,7 @@ ) (ja-channel-push! 1 0) (ja-no-eval :group! saberfish-flip-up-start-ja :num! (seek!) :frame-num 0.0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.4)) - (suspend) - ) - ) + (suspend-for (seconds 0.4)) (ja-channel-push! 1 0) (ja-no-eval :group! saberfish-flip-up-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak3/levels/sewer/sew-laser-guard.gc b/goal_src/jak3/levels/sewer/sew-laser-guard.gc index 607e2eaf8f..9a632bd393 100644 --- a/goal_src/jak3/levels/sewer/sew-laser-guard.gc +++ b/goal_src/jak3/levels/sewer/sew-laser-guard.gc @@ -578,18 +578,9 @@ (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root trans quad)) (+! (-> gp-1 y) 10240.0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 2)) - (spawn (-> self part) gp-1) - (suspend) - ) - ) - ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 2) (spawn (-> self part) gp-1)) ) + (suspend-for (seconds 1)) (send-event self 'death-end) (while (-> self child) (suspend) diff --git a/goal_src/jak3/levels/sewer/sew-laser-turret.gc b/goal_src/jak3/levels/sewer/sew-laser-turret.gc index 6f47ac3be7..9d7dbdcc0a 100644 --- a/goal_src/jak3/levels/sewer/sew-laser-turret.gc +++ b/goal_src/jak3/levels/sewer/sew-laser-turret.gc @@ -640,7 +640,7 @@ (let ((dist (-> turret target-distance))) (and (-> turret target-on-ground) (>= dist (+ radius (meters -0.1))) - (>= dist (+ radius (meters 0.1))) + (>= (+ radius (meters 0.1)) dist) ) ) ) @@ -1054,18 +1054,9 @@ (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root trans quad)) (+! (-> gp-1 y) 10240.0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 2)) - (spawn (-> self part) gp-1) - (suspend) - ) - ) - ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 2) (spawn (-> self part) gp-1)) ) + (suspend-for (seconds 1)) (send-event self 'death-end) (while (-> self child) (suspend) diff --git a/goal_src/jak3/levels/sewer/sew-platforms.gc b/goal_src/jak3/levels/sewer/sew-platforms.gc index 9873ec4afd..698f1c00eb 100644 --- a/goal_src/jak3/levels/sewer/sew-platforms.gc +++ b/goal_src/jak3/levels/sewer/sew-platforms.gc @@ -131,18 +131,10 @@ :virtual #t :enter (behavior () (set! (-> self last-played-start?) #f) - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (cond ((and (-> self last-played-start?) (< 0.9 (-> self path-pos))) (sound-play "moving-step-out") @@ -207,19 +199,11 @@ :virtual #t :enter (behavior () (set! (-> self last-played-start?) #f) - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set! (-> self last-val) -1.0) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (when (< (-> self path-pos) 0.5) (new 'stack-no-clear 'vector) (let ((gp-0 (new 'stack-no-clear 'matrix))) diff --git a/goal_src/jak3/levels/sewer/sewer-obs.gc b/goal_src/jak3/levels/sewer/sewer-obs.gc index 24bf17519c..f0ca75067f 100644 --- a/goal_src/jak3/levels/sewer/sewer-obs.gc +++ b/goal_src/jak3/levels/sewer/sewer-obs.gc @@ -203,11 +203,7 @@ (defstate active (sew-cam-sequencer) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (until (process-grab? *target* #f) (suspend) ) @@ -216,21 +212,13 @@ (sew-cam-eval-script a0-1) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (-> self timeout)) - (suspend) - ) - ) + (suspend-for (-> self timeout)) (let ((a0-3 (-> self activate-script))) (if a0-3 (sew-cam-eval-script a0-3) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (the-as time-frame (-> self offset))) - (suspend) - ) - ) + (suspend-for (the-as time-frame (-> self offset))) (let ((a0-5 (-> self exit-script))) (if a0-5 (sew-cam-eval-script a0-5) @@ -1304,20 +1292,12 @@ ) (let ((v1-25 (res-lump-value (-> self entity) 'extra-id uint128 :time -1000000000.0))) (when (= (the-as uint v1-25) 1) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (set-setting! 'mode-name 'cam-fixed 0.0 0) (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'entity-name "camera-300" 0.0 0) (process-grab? *target* #f) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (let ((gp-2 (-> self actor-group 1))) (dotimes (s5-0 (-> gp-2 length)) (let ((a1-7 (new 'stack-no-clear 'event-message-block))) @@ -1337,19 +1317,11 @@ ) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (remove-setting! 'mode-name) (remove-setting! 'interp-time) (remove-setting! 'entity-name) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (process-release? *target*) (go-virtual opened) ) @@ -1756,11 +1728,7 @@ (set-setting! 'entity-name "camera-224" 0.0 0) (set-setting! 'allow-progress #f 0.0 0) (process-grab? *target* #f) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (task-node-close! (game-task-node sewer-hum-kg-switch-off) 'event) (script-eval '(send-event "ctyinda-vingate-1" 'shutdown)) (set-action! @@ -1774,11 +1742,7 @@ (the-as process #f) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 2.4)) - (suspend) - ) - ) + (suspend-for (seconds 2.4)) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) (set! (-> *ACTOR-bank* birth-max) 1000) diff --git a/goal_src/jak3/levels/sewer/sewer-obs2.gc b/goal_src/jak3/levels/sewer/sewer-obs2.gc index 08db43d3bd..977985896c 100644 --- a/goal_src/jak3/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak3/levels/sewer/sewer-obs2.gc @@ -217,20 +217,12 @@ :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (set-setting! 'mode-name 'cam-fixed 0.0 0) (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'entity-name "camera-353" 0.0 0) (process-grab? *target* #f) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (sound-play "gate-open") (ja-no-eval :group! sew-m-gate-gate-open-ja :num! (seek! max 0.1) :frame-num 0.0) (until (ja-done? 0) @@ -241,11 +233,7 @@ (remove-setting! 'mode-name) (remove-setting! 'interp-time) (remove-setting! 'entity-name) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (process-release? *target*) (go-virtual raised) ) @@ -369,20 +357,12 @@ :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (set-setting! 'mode-name 'cam-fixed 0.0 0) (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'entity-name "camera-352" 0.0 0) (process-grab? *target* #f) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (sound-play "pipe-lower") (set-time! (-> self state-time)) (ja-no-eval :group! sew-pipe-down-ja :num! (seek! max 0.1) :frame-num 0.0) @@ -397,11 +377,7 @@ (remove-setting! 'mode-name) (remove-setting! 'interp-time) (remove-setting! 'entity-name) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (process-release? *target*) (go-virtual down) ) diff --git a/goal_src/jak3/levels/stadium/dm-mine-spider.gc b/goal_src/jak3/levels/stadium/dm-mine-spider.gc index fcb83fad16..8504fa710b 100644 --- a/goal_src/jak3/levels/stadium/dm-mine-spider.gc +++ b/goal_src/jak3/levels/stadium/dm-mine-spider.gc @@ -1055,22 +1055,14 @@ (set-time! (-> self state-time)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.6)) - (suspend) - ) - ) + (suspend-for (seconds 0.6)) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-6 prim-core collide-with) (-> self root backup-collide-with)) ) (logclear! (-> self draw status) (draw-control-status no-draw)) (update-focus self) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) (ja-channel-push! 1 0) (ja-no-eval :group! dm-mine-spider-climb-start-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak3/levels/temple/hover-training.gc b/goal_src/jak3/levels/temple/hover-training.gc index 861af18549..d74565290e 100644 --- a/goal_src/jak3/levels/temple/hover-training.gc +++ b/goal_src/jak3/levels/temple/hover-training.gc @@ -827,18 +827,10 @@ (until (process-grab? *target* #f) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (persist-with-delay *setting-control* 'interp-time (seconds 4) 'interp-time 'abs 0.0 0) (set-setting! 'entity-name "camera-354" 0.0 0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 3)) - (suspend) - ) - ) + (suspend-for (seconds 3)) (task-node-close! (game-task-node temple-tests-hover-training) 'event) (until (process-release? *target*) (suspend) diff --git a/goal_src/jak3/levels/temple/temple-obs.gc b/goal_src/jak3/levels/temple/temple-obs.gc index 805b2640ed..4ac33ae7d8 100644 --- a/goal_src/jak3/levels/temple/temple-obs.gc +++ b/goal_src/jak3/levels/temple/temple-obs.gc @@ -392,18 +392,10 @@ (set! (-> gp-0 map-icon) (the-as uint 13)) (set! (-> self arrow-h) (process->handle (task-arrow-spawn gp-0 self))) ) - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (when (-> self arrow-h) (let ((gp-0 (-> self arrow-h process 0))) (when (and (< (vector-vector-distance (-> (the-as process-drawable gp-0) root trans) (target-pos 0)) 20480.0) @@ -471,11 +463,7 @@ (if (and *target* (focus-test? *target* light)) (send-event self 'complete) ) - (let ((t9-3 (-> (find-parent-state) trans))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler trans) ) ) @@ -933,11 +921,7 @@ (until (process-grab? *target* #f) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) ) ) (set-time! (-> self state-time)) @@ -958,11 +942,7 @@ (set! (-> self root scale z) (-> self root scale x)) (when (= (-> self root scale x) 0.0) (send-event (handle->process (-> self perm-part)) 'die) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (until (process-release? *target*) (suspend) ) @@ -1753,44 +1733,27 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (the int (-> self cycle-offset))) - (suspend) - ) - ) + (suspend-for (the int (-> self cycle-offset))) (until #f - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (the int (-> self cycle-time))) - (suspend) - ) - ) + (suspend-for (the int (-> self cycle-time))) (sound-play "fan-shake" :position (-> self root trans)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.01)) - (let ((f0-5 (* 36408.89 (the float (- (current-time) gp-3)))) - (f1-3 (* 0.33333334 (- 3.0 (the float (- (current-time) gp-3))))) - ) - (set! (-> self shudder-angle) (* 0.0018204444 f1-3 (sin f0-5))) - ) - (suspend) - ) - ) + (suspend-for (seconds 0.01) (let ((f0-5 (* 36408.89 (the float (- (current-time) time)))) + (f1-3 (* 0.33333334 (- 3.0 (the float (- (current-time) time))))) + ) + (set! (-> self shudder-angle) (* 0.0018204444 f1-3 (sin f0-5))) + ) + ) (set! (-> self shudder-angle) 0.0) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.04)) - (suspend) - ) - ) + (suspend-for (seconds 0.04)) (sound-play "fan-turn" :position (-> self root trans)) (let* ((f0-9 100.0) (f30-1 (* 16384.0 f0-9)) - (gp-6 (current-time)) ) - (until (time-elapsed? gp-6 (seconds 0.01)) + (suspend-for + (seconds 0.01) (set! (-> self rot-angle) (the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48)) ) - (suspend) ) ) (let ((v1-47 #x4000)) @@ -2159,11 +2122,7 @@ (script-eval (the-as pair gp-0)) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (cleanup-for-death self) (deactivate self) ) @@ -2324,11 +2283,7 @@ (script-eval (the-as pair gp-0)) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (cleanup-for-death self) (deactivate self) ) diff --git a/goal_src/jak3/levels/temple/temple-obs2.gc b/goal_src/jak3/levels/temple/temple-obs2.gc index 0a2cbaeb60..1aa66a0a5b 100644 --- a/goal_src/jak3/levels/temple/temple-obs2.gc +++ b/goal_src/jak3/levels/temple/temple-obs2.gc @@ -99,11 +99,7 @@ (suspend) ) (set-setting! 'entity-name "camera-356" 0.0 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) ) (sound-play "gate-raise") (ja-no-eval :group! tpl-gate-close-ja :num! (seek!) :frame-num 0.0) @@ -112,11 +108,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.1)) - (suspend) - ) - ) + (suspend-for (seconds 0.1)) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) (process->ppointer self)) (set! (-> a1-6 num-params) 0) @@ -133,17 +125,9 @@ ) ) (when (= (-> self extra-id) 1) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (remove-setting! 'entity-name) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 2.5)) - (suspend) - ) - ) + (suspend-for (seconds 2.5)) (until (process-release? *target*) (suspend) ) @@ -421,11 +405,7 @@ :event tpl-watcher-manager-ehandler :trans watcher-man-trans :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (while (and *target* (focus-test? *target* dead)) (suspend) ) @@ -448,11 +428,7 @@ (suspend) ) (process-entity-status! self (entity-perm-status no-kill) #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2.5)) - (suspend) - ) - ) + (suspend-for (seconds 2.5)) (while (not (process-release? *target*)) (suspend) ) @@ -934,12 +910,7 @@ ) ) (sound-play "wtcher-fire") - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - '() - (suspend) - ) - ) + (suspend-for (seconds 1) '()) ) ) ) @@ -1007,11 +978,7 @@ ) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 4)) - (suspend) - ) - ) + (suspend-for (seconds 4)) (while (-> self child) (suspend) ) @@ -1045,17 +1012,14 @@ :code (behavior () (let ((gp-0 (-> self root quat)) (s5-0 (-> self entity quat)) - (s4-0 (current-time)) ) - (until (time-elapsed? s4-0 (seconds 1.5)) - (quaternion-slerp! - (-> self root quat) - gp-0 - s5-0 - (* 0.0022222223 (the float (- (current-time) (-> self state-time)))) - ) - (suspend) - ) + (suspend-for (seconds 1.5) (quaternion-slerp! + (-> self root quat) + gp-0 + s5-0 + (* 0.0022222223 (the float (- (current-time) (-> self state-time)))) + ) + ) ) (go-virtual idle) ) @@ -1665,10 +1629,9 @@ ) (quaternion-normalize! s5-2) (set-time! (-> self state-time)) - (let ((f30-1 (lerp-scale 45.0 9.0 (-> self clock clock-ratio) 1.0 0.05)) - (s4-2 (current-time)) - ) - (until (time-elapsed? s4-2 (the int f30-1)) + (let ((f30-1 (lerp-scale 45.0 9.0 (-> self clock clock-ratio) 1.0 0.05))) + (suspend-for + (the int f30-1) (quaternion-slerp! (-> self root quat) gp-3 @@ -1676,7 +1639,6 @@ (/ (the float (- (current-time) (-> self state-time))) f30-1) ) (quaternion-normalize! (-> self root quat)) - (suspend) ) ) (quaternion-copy! (-> self root quat) s5-2) @@ -1694,13 +1656,8 @@ :virtual #t :trans rider-trans :code (behavior () - (let ((f30-0 (res-lump-float (-> self entity) 'tpl-platform-predelay)) - (gp-0 (current-time)) - ) - (until (time-elapsed? gp-0 (the int (* 300.0 f30-0))) - '() - (suspend) - ) + (let ((f30-0 (res-lump-float (-> self entity) 'tpl-platform-predelay))) + (suspend-for (the int (* 300.0 f30-0)) '()) ) (go-virtual flip) ) @@ -1754,12 +1711,7 @@ :code (behavior () (set-time! (-> self state-time)) (set! (-> self state-time) (-> *display* real-clock frame-counter)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.25)) - '() - (suspend) - ) - ) + (suspend-for (seconds 0.25) '()) (while (< (+ (-> *display* real-clock frame-counter) (seconds -1)) (-> self last-ridden)) (suspend) ) @@ -1920,11 +1872,7 @@ :virtual #t :enter (behavior () (setup-masks (-> self draw) 3 0) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (setup-masks (-> self draw) 1 2) diff --git a/goal_src/jak3/levels/title/title-obs.gc b/goal_src/jak3/levels/title/title-obs.gc index 3e899e8df5..b1f0b5e940 100644 --- a/goal_src/jak3/levels/title/title-obs.gc +++ b/goal_src/jak3/levels/title/title-obs.gc @@ -192,11 +192,7 @@ (cond ((and (kiosk?) (or (cpad-pressed? 0 square) (time-elapsed? s5-1 (seconds 60)))) (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) - (let ((s5-2 (current-time))) - (until (time-elapsed? s5-2 (seconds 5)) - (suspend) - ) - ) + (suspend-for (seconds 5)) (set! s5-1 (current-time)) ) ((and (cpad-pressed? 0 up l-analog-up) (> (-> self selected) 0)) @@ -256,11 +252,7 @@ #x33001 #t ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.4)) - (suspend) - ) - ) + (suspend-for (seconds 0.4)) (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) (set! (-> *setting-control* user-current bg-a) 0.0) (while (or (-> *setting-control* user-current movie) @@ -568,11 +560,7 @@ :code (behavior () (remove-setting! 'allow-timeout) (remove-setting! 'dialog-volume) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event (ppointer->process (-> self logo)) 'trans-hook @@ -601,11 +589,7 @@ ) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (remove-setting! 'dust-storm-fog-scalar) (if (zero? (title-menu)) (go-virtual idle) @@ -628,11 +612,7 @@ ) ) (until (= (-> *game-info* current-continue level) 'title) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) ) (go-virtual wait) ) @@ -972,11 +952,7 @@ ) ) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.6)) - (suspend) - ) - ) + (suspend-for (seconds 0.6)) (process-spawn-function process (lambda ((arg0 game-task)) diff --git a/goal_src/jak3/levels/tower/tower-obs.gc b/goal_src/jak3/levels/tower/tower-obs.gc index 97fc52c7bf..1b02b9b18c 100644 --- a/goal_src/jak3/levels/tower/tower-obs.gc +++ b/goal_src/jak3/levels/tower/tower-obs.gc @@ -347,11 +347,7 @@ :virtual #t :code (behavior () (logclear! (-> self draw status) (draw-control-status force-fade)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (process-spawn scene-player :init scene-player-init @@ -524,11 +520,7 @@ (set-time! (-> self state-time)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.75)) - (suspend) - ) - ) + (suspend-for (seconds 0.75)) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-6 prim-core collide-with) (-> self root backup-collide-with)) @@ -537,15 +529,13 @@ (logclear! (-> self draw status) (draw-control-status no-draw)) (let ((f30-0 1.0)) 0.0 - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (the int (* 300.0 f30-0))) - (let ((f0-2 (fmax 0.0 (fmin 1.0 (/ (the float (- (current-time) gp-2)) (* 300.0 f30-0)))))) - (set-vector! (-> self draw color-mult) f0-2 f0-2 f0-2 1.0) - ) - (spawn-from-cspace (-> self part) (joint-node tow-energy-bridge-lod0-jg main)) - (ja-post) - (suspend) + (suspend-for + (the int (* 300.0 f30-0)) + (let ((f0-2 (fmax 0.0 (fmin 1.0 (/ (the float (- (current-time) time)) (* 300.0 f30-0)))))) + (set-vector! (-> self draw color-mult) f0-2 f0-2 f0-2 1.0) ) + (spawn-from-cspace (-> self part) (joint-node tow-energy-bridge-lod0-jg main)) + (ja-post) ) ) (process-entity-status! self (entity-perm-status subtask-complete) #t) diff --git a/goal_src/jak3/levels/volcano/spiky-frog.gc b/goal_src/jak3/levels/volcano/spiky-frog.gc index 3dd82d20ea..9beedb79f0 100644 --- a/goal_src/jak3/levels/volcano/spiky-frog.gc +++ b/goal_src/jak3/levels/volcano/spiky-frog.gc @@ -919,13 +919,11 @@ :num! (identity (the float (+ (-> (the-as art-joint-anim spiky-frog-ball0-end-ja) frames num-frames) -1))) ) (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.411)) - (if (!= (-> self root gspot-pos y) -40959590.0) - (seek! (-> self root trans y) (-> self root gspot-pos y) (* 409600.0 (seconds-per-frame))) - ) - (suspend) - ) + (suspend-for + (seconds 0.411) + (if (!= (-> self root gspot-pos y) -40959590.0) + (seek! (-> self root trans y) (-> self root gspot-pos y) (* 409600.0 (seconds-per-frame))) + ) ) ) (else diff --git a/goal_src/jak3/levels/volcano/volcano-obs.gc b/goal_src/jak3/levels/volcano/volcano-obs.gc index 5e2fb36691..dc76babc0f 100644 --- a/goal_src/jak3/levels/volcano/volcano-obs.gc +++ b/goal_src/jak3/levels/volcano/volcano-obs.gc @@ -925,11 +925,7 @@ (set! (-> self stopped-up-by) (the-as handle #f)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer self)) (set! (-> a1-0 num-params) 0) diff --git a/goal_src/jak3/levels/volcano/volcano-obs2.gc b/goal_src/jak3/levels/volcano/volcano-obs2.gc index 039763985a..597b85dae1 100644 --- a/goal_src/jak3/levels/volcano/volcano-obs2.gc +++ b/goal_src/jak3/levels/volcano/volcano-obs2.gc @@ -59,11 +59,7 @@ :virtual #t :event rigid-body-object-event-handler :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (get-point-at-percent-along-path! (-> self path) (-> self rbody position) (-> self path-u) 'interp) (ja-no-eval :group! vol-lava-plat-idle-ja :num! zero) (logclear! (-> self mask) (process-mask actor-pause)) diff --git a/goal_src/jak3/levels/volcano/volcanox-obs.gc b/goal_src/jak3/levels/volcano/volcanox-obs.gc index 52dba41f2d..2679466204 100644 --- a/goal_src/jak3/levels/volcano/volcanox-obs.gc +++ b/goal_src/jak3/levels/volcano/volcanox-obs.gc @@ -360,11 +360,7 @@ (until (process-grab? *target* #f) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) ) ) (set-time! (-> self state-time)) @@ -385,11 +381,7 @@ (set! (-> self root scale z) (-> self root scale x)) (when (= (-> self root scale x) 0.0) (send-event (handle->process (-> self perm-part)) 'die) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (until (process-release? *target*) (suspend) ) diff --git a/goal_src/jak3/levels/wascity/defend/was-pre-game.gc b/goal_src/jak3/levels/wascity/defend/was-pre-game.gc index e86243dd8d..b62b89a1a9 100644 --- a/goal_src/jak3/levels/wascity/defend/was-pre-game.gc +++ b/goal_src/jak3/levels/wascity/defend/was-pre-game.gc @@ -1807,11 +1807,7 @@ ) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (-> self start-delay)) - (suspend) - ) - ) + (suspend-for (-> self start-delay)) (go-virtual fall) ) :post (behavior () @@ -2077,11 +2073,7 @@ (sound-play "lose-icon") (send-event (ppointer->process (-> self parent)) 'done) (set! (-> self post-hook) #f) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.2)) - (suspend) - ) - ) + (suspend-for (seconds 0.2)) ) :post (behavior () (vector-normalize! diff --git a/goal_src/jak3/levels/wascity/dm-flyer.gc b/goal_src/jak3/levels/wascity/dm-flyer.gc index 4be6c1f2f4..af71a88ae0 100644 --- a/goal_src/jak3/levels/wascity/dm-flyer.gc +++ b/goal_src/jak3/levels/wascity/dm-flyer.gc @@ -169,11 +169,7 @@ ) ) :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) @@ -251,11 +247,7 @@ (defstate dissipate (dm-flyer-shot) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) diff --git a/goal_src/jak3/levels/wascity/maker-projectile.gc b/goal_src/jak3/levels/wascity/maker-projectile.gc index 4fc10fb159..d49c592d54 100644 --- a/goal_src/jak3/levels/wascity/maker-projectile.gc +++ b/goal_src/jak3/levels/wascity/maker-projectile.gc @@ -697,11 +697,7 @@ ) ) :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) @@ -769,12 +765,7 @@ (set! (-> v1-85 prim-core collide-with) (collide-spec)) ) 0 - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 3)) - (suspend) - (suspend) - ) - ) + (suspend-for (seconds 3) (suspend)) ) ) diff --git a/goal_src/jak3/levels/wascity/palace/waspala-obs.gc b/goal_src/jak3/levels/wascity/palace/waspala-obs.gc index fc183a3fcb..7b44323875 100644 --- a/goal_src/jak3/levels/wascity/palace/waspala-obs.gc +++ b/goal_src/jak3/levels/wascity/palace/waspala-obs.gc @@ -205,11 +205,7 @@ ) (let ((gp-0 27)) (set-setting! 'change-gun #t 0.0 0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 5)) - (suspend) - ) - ) + (suspend-for (seconds 5)) (set! (-> self gui-id) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) diff --git a/goal_src/jak3/levels/wascity/tizard.gc b/goal_src/jak3/levels/wascity/tizard.gc index dde0eeaa56..3d6406435e 100644 --- a/goal_src/jak3/levels/wascity/tizard.gc +++ b/goal_src/jak3/levels/wascity/tizard.gc @@ -72,12 +72,8 @@ ) :code (behavior () (when (-> self first-run?) - (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 0.05 0.12)))) - (s5-0 (current-time)) - ) - (until (time-elapsed? s5-0 gp-0) - (suspend) - ) + (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 0.05 0.12))))) + (suspend-for gp-0) ) (set! (-> self path-base-u) (the float (rand-vu-int-count (-> self path curve num-cverts)))) (get-point-in-path! (-> self path) (-> self root trans) (-> self path-base-u) 'interp) @@ -157,12 +153,8 @@ :virtual #t :event tizard-event-handler :code (behavior () - (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 1.0 2.0)))) - (s5-0 (current-time)) - ) - (until (time-elapsed? s5-0 gp-0) - (suspend) - ) + (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 1.0 2.0))))) + (suspend-for gp-0) ) (if (< 17294.223 (acos (vector-dot (-> self rotation-matrix fvec) (-> self path-dir)))) (go-virtual turning) diff --git a/goal_src/jak3/levels/wascity/wasall-tasks.gc b/goal_src/jak3/levels/wascity/wasall-tasks.gc index 9669e4c923..a13d3e5857 100644 --- a/goal_src/jak3/levels/wascity/wasall-tasks.gc +++ b/goal_src/jak3/levels/wascity/wasall-tasks.gc @@ -42,11 +42,7 @@ ) (set-setting! 'fog-special-interp-targ #f f0-0 0) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 15)) - (suspend) - ) - ) + (suspend-for (seconds 15)) ) #f ) @@ -389,11 +385,7 @@ ) #f (label cfg-22) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (talker-spawn-func (-> *talker-speech* 88) *entity-pool* (target-pos 0) (the-as region #f)) (send-event self 'complete) ) @@ -475,11 +467,7 @@ (defstate active (oasis-defense-intro-manager) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (open! (-> self node-info) 'event) (talker-spawn-func (-> *talker-speech* 83) *entity-pool* (target-pos 0) (the-as region #f)) (sleep-code) @@ -600,11 +588,7 @@ (defstate active (task-manager-lock-wasdoors) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set-setting! 'airlock #f 0.0 0) ) :trans (behavior () diff --git a/goal_src/jak3/levels/wascity/wascity-turret.gc b/goal_src/jak3/levels/wascity/wascity-turret.gc index 909de81199..bf015c6b78 100644 --- a/goal_src/jak3/levels/wascity/wascity-turret.gc +++ b/goal_src/jak3/levels/wascity/wascity-turret.gc @@ -696,11 +696,7 @@ (set! (-> self facing-ocean) #t) (set! (-> self facing-city) #f) (set! (-> self reset-facing) #f) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (sound-play "jump-in-turret") (let* ((v1-9 (-> *game-info* sub-task-list (game-task-node wascity-gungame-resolution))) (a0-4 (handle->process (if (-> v1-9 manager) @@ -769,11 +765,7 @@ (defstate shutdown (wascity-turret) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (wct-show-flut self #t) @@ -807,11 +799,7 @@ (setup-masks (-> self draw) 0 2) (set-setting! 'matrix-blend-turret-rot 'abs 5.0 0) (set-setting! 'lock-sound-camera-to-target #t 0.0 0) - (let ((t9-4 (-> (find-parent-state) enter))) - (if t9-4 - (t9-4) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (setup-masks (-> self draw) 2 0) @@ -824,11 +812,7 @@ ) :trans (behavior () (wascity-turret-method-59 self) - (let ((t9-2 (-> (find-parent-state) trans))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler trans) ) ) diff --git a/goal_src/jak3/levels/wascity/wasdef-manager.gc b/goal_src/jak3/levels/wascity/wasdef-manager.gc index e8947f495f..9f67723fcd 100644 --- a/goal_src/jak3/levels/wascity/wasdef-manager.gc +++ b/goal_src/jak3/levels/wascity/wasdef-manager.gc @@ -1629,11 +1629,7 @@ (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 4)) - (suspend) - ) - ) + (suspend-for (seconds 4)) ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -2051,11 +2047,7 @@ :code (behavior () (maker-method-38 self) (set! *maker-num-visible* (+ *maker-num-visible* -1)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 3)) - (suspend) - ) - ) + (suspend-for (seconds 3)) (if (nonzero? (-> self explosion-sound-id)) (set-action! *gui-control* diff --git a/goal_src/jak3/levels/wascity/wasgun-manager.gc b/goal_src/jak3/levels/wascity/wasgun-manager.gc index c42407c9cb..38c31cb4ec 100644 --- a/goal_src/jak3/levels/wascity/wasgun-manager.gc +++ b/goal_src/jak3/levels/wascity/wasgun-manager.gc @@ -1278,11 +1278,7 @@ (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (sound-play "point-missed" :position (wascity-turret-gun-pos)) (let ((v1-49 (handle->process (-> self mgr)))) (when v1-49 diff --git a/goal_src/jak3/levels/wascity/wasstadium/nst-tasks.gc b/goal_src/jak3/levels/wascity/wasstadium/nst-tasks.gc index de47169a8f..5e628858f6 100644 --- a/goal_src/jak3/levels/wascity/wasstadium/nst-tasks.gc +++ b/goal_src/jak3/levels/wascity/wasstadium/nst-tasks.gc @@ -273,28 +273,19 @@ ) :code (behavior () (local-vars (a0-15 vector) (a1-7 vector) (gp-6 (function vector vector float))) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) - ) + (suspend-for (seconds 0.1)) (when (not (task-node-closed? (game-task-node nest-eggs-wall))) (until (level-get *level* 'wasdoors) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (format *stdebug* "wait for player to get to garage~%") - (b! (task-node-closed? (game-task-node nest-eggs-wall)) cfg-34 :delay (nop!)) - (suspend) - ) + (suspend-for + (seconds 1) + (format *stdebug* "wait for player to get to garage~%") + (b! (task-node-closed? (game-task-node nest-eggs-wall)) cfg-34 :delay (nop!)) + (empty-form) ) ) (setup-scorpion) (task-node-close! (game-task-node nest-eggs-get-to-scorpion) 'event) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) (let ((v1-20 (rand-vu-int-range 0 1))) (b! (nonzero? v1-20) cfg-11 :delay (empty-form)) (talker-spawn-func (-> *nest-eggs-speech-list* 8) *entity-pool* (target-pos 0) (the-as region #f)) @@ -305,11 +296,7 @@ ) ) (label cfg-13) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 4)) - (suspend) - ) - ) + (suspend-for (seconds 4)) (until (< (gp-6 a0-15 a1-7) 491520.0) (format *stdebug* "wait for player to drive to eggwall~%") (b! (task-node-closed? (game-task-node nest-eggs-wall)) cfg-34 :delay (nop!)) @@ -335,20 +322,12 @@ (label cfg-25) (b! (handle->process (the-as handle gp-8)) cfg-24 :delay (nop!)) ) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 0.5)) - (suspend) - ) - ) + (suspend-for (seconds 0.5)) ) (label cfg-34) (setup-scorpion) (set-setting! 'music 'nesteggs 0.0 0) - (let ((gp-10 (current-time))) - (until (time-elapsed? gp-10 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (let ((v1-57 (rand-vu-int-range 0 6))) (cond ((zero? v1-57) @@ -391,11 +370,7 @@ ) :code (behavior () (task-node-close! (-> self info final-node) 'event) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.6)) - (suspend) - ) - ) + (suspend-for (seconds 0.6)) (let ((v1-6 (rand-vu-int-range 0 3))) (cond ((zero? v1-6) @@ -412,17 +387,8 @@ ) ) ) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 3)) - (format *stdebug* "task-manager-nest-cocoons: done!~%") - (suspend) - ) - ) - (let ((t9-12 (-> (find-parent-state) code))) - (if t9-12 - ((the-as (function none) t9-12)) - ) - ) + (suspend-for (seconds 3) (format *stdebug* "task-manager-nest-cocoons: done!~%")) + (call-parent-state-handler code) ) ) diff --git a/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc b/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc index 5b0e8c0e74..8957996575 100644 --- a/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc +++ b/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc @@ -1081,11 +1081,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (set! *arena-trainer-checkpoint-valid* #t) (copy-string<-string (-> *training-fail* fail continue) "wasstada-checkpoint-3") (set-setting! 'death-info *training-fail* 0.0 0) @@ -1303,11 +1299,7 @@ ) (suspend) (ja-channel-set! 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (send-event self 'death-end) (while (-> self child) (suspend) diff --git a/goal_src/jak3/levels/wascity/wasstadium/wasstadc-obs.gc b/goal_src/jak3/levels/wascity/wasstadium/wasstadc-obs.gc index 9e136388b6..636137a3d7 100644 --- a/goal_src/jak3/levels/wascity/wasstadium/wasstadc-obs.gc +++ b/goal_src/jak3/levels/wascity/wasstadium/wasstadc-obs.gc @@ -43,18 +43,10 @@ (set! (-> gp-0 map-icon) (the-as uint 13)) (set! (-> self arrow-h) (process->handle (task-arrow-spawn gp-0 self))) ) - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (when (-> self arrow-h) (let ((gp-0 (-> self arrow-h process 0))) (when (or (< (vector-vector-distance (-> (the-as process-drawable gp-0) root trans) (target-pos 0)) 12288.0) @@ -386,11 +378,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) - ) + (suspend-for (seconds 1)) (ja-no-eval :group! wstd-fight-house-a-open-ja :num! (seek! 0.0) :frame-num 5.0) (until (ja-done? 0) (suspend) @@ -2153,11 +2141,7 @@ ) (let ((gp-1 (-> *game-info* gun-type))) (set-setting! 'change-gun #t 0.0 0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 5)) - (suspend) - ) - ) + (suspend-for (seconds 5)) (set! (-> self gui-id) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) @@ -2172,12 +2156,7 @@ (send-event (-> v1-33 extra process) 'off) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (print-text self (-> self text-id)) - (suspend) - ) - ) + (suspend-for (seconds 2) (print-text self (-> self text-id))) (send-event self 'complete) (until #f (suspend) @@ -2231,11 +2210,7 @@ ) (let ((gp-2 32)) (set-setting! 'change-gun #t 0.0 0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 5)) - (suspend) - ) - ) + (suspend-for (seconds 5)) (set! (-> self gui-id) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) @@ -2249,12 +2224,7 @@ (send-event (-> v1-38 extra process) 'off) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 2)) - (print-text self (-> self text-id)) - (suspend) - ) - ) + (suspend-for (seconds 2) (print-text self (-> self text-id))) (send-event self 'complete) (until #f (suspend) @@ -2457,11 +2427,7 @@ (send-event (handle->process (-> self arrow-h)) 'leave) (send-event *target* 'end-mode 'darkjak) (send-event *target* 'end-mode 'grab) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) - ) + (suspend-for (seconds 2)) (go-virtual complete) ) ) diff --git a/goal_src/jak3/levels/wascity/wlander-male.gc b/goal_src/jak3/levels/wascity/wlander-male.gc index 149f8ab576..80d61a5ead 100644 --- a/goal_src/jak3/levels/wascity/wlander-male.gc +++ b/goal_src/jak3/levels/wascity/wlander-male.gc @@ -232,11 +232,7 @@ (defstate knocked-recover (wlander) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (nav-enemy-method-184 self) (let ((a0-2 (-> self nav state)) (v1-5 *null-vector*) diff --git a/test/decompiler/reference/jak1/decompiler-macros.gc b/test/decompiler/reference/jak1/decompiler-macros.gc index b8edeecb9b..928e8f7302 100644 --- a/test/decompiler/reference/jak1/decompiler-macros.gc +++ b/test/decompiler/reference/jak1/decompiler-macros.gc @@ -523,6 +523,13 @@ ) ) +(defmacro call-parent-state-handler (handler &key (type (function none)) &rest args) + "Call the parent handler for this state." + `(let ((handler (-> (find-parent-state) ,handler))) + (if handler ((the ,type handler) ,@args)) + ) + ) + (defmacro call-parent-method (&rest args) "Find the first different implementation of the current method in a parent type and call it with these arguments." `((the (current-method-function-type) (find-parent-method (current-method-type) (current-method-id))) @@ -1699,4 +1706,7 @@ (defmacro time-elapsed? (time duration) `(>= (- (current-time) ,time) ,duration) - ) \ No newline at end of file + ) + +(defmacro suspend-for (time &rest body) + `(let ((time (current-time))) (until (time-elapsed? time ,time) ,@body (suspend)))) \ No newline at end of file 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 b637bc02bb..297e3103b1 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc @@ -855,10 +855,7 @@ (logior! (-> self fact options) (fact-options instant-collect)) ) (when (not arg0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.04)) - (suspend) - ) + (suspend-for (seconds 0.04) ) (logior! (-> self draw status) (draw-status hidden)) (case (-> self look) @@ -946,10 +943,7 @@ (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) arg1) (process-entity-status! self (entity-perm-status dead) #t) (process-entity-status! self (entity-perm-status complete) #t) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) ) ) 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 e0185e847c..91210935ad 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 @@ -115,10 +115,7 @@ (while (and *target* (= (handle->process (-> *target* control unknown-handle10)) self)) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (go swingpole-stance) ) @@ -641,13 +638,10 @@ ) (suspend) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (-> self linger-duration)) - (if (-> self linger-callback) - ((-> self linger-callback) self) - ) - (suspend) - ) + (suspend-for (-> self linger-duration) + (if (-> self linger-callback) + ((-> self linger-callback) self) + ) ) (if (-> self linger-callback) ((-> self linger-callback) self) @@ -1016,11 +1010,8 @@ (set! gp-0 (not (eval this (the-as pair (car s4-0))))) ) (('wait-for 'wait 'suspend) - (let ((s5-1 (command-get-time (car s4-0) 1)) - (s4-1 (current-time)) - ) - (until (time-elapsed? s4-1 s5-1) - (suspend) + (let ((s5-1 (command-get-time (car s4-0) 1))) + (suspend-for s5-1 ) ) ) 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 233b60f365..3fc108d66d 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 @@ -1697,12 +1697,9 @@ nav-enemy-default-event-handler ) (ja-channel-push! 1 (seconds 0.1)) (nav-enemy-turn-to-face-point (-> self event-param-point) 910.2222) - (let ((gp-0 (nav-enemy-rnd-int-range 0 150)) - (s5-0 (current-time)) - ) - (until (time-elapsed? s5-0 gp-0) + (let ((gp-0 (nav-enemy-rnd-int-range 0 150))) + (suspend-for gp-0 (ja :num! (loop! f30-0)) - (suspend) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc b/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc index 4cc0f82d22..ebe3eeebc9 100644 --- a/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc @@ -596,27 +596,24 @@ :event (-> level-hint-normal event) :code (behavior ((arg0 string) (arg1 string)) (remove-setting! 'hint) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 (seconds 1)) - (when (and *debug-segment* (not (paused?)) (not (str-is-playing?)) (bottom-hud-hidden?)) - (let ((s3-0 - (new 'stack 'font-context *font-default-matrix* 56 160 0.0 (font-color default) (font-flags shadow kerning)) - ) + (suspend-for (seconds 1) + (when (and *debug-segment* (not (paused?)) (not (str-is-playing?)) (bottom-hud-hidden?)) + (let ((s3-0 + (new 'stack 'font-context *font-default-matrix* 56 160 0.0 (font-color default) (font-flags shadow kerning)) ) - (let ((v1-7 s3-0)) - (set! (-> v1-7 width) (the float 400)) - ) - (let ((v1-8 s3-0)) - (set! (-> v1-8 height) (the float 96)) - ) - (set! (-> s3-0 flags) (font-flags shadow kerning middle)) - (let ((s2-0 print-game-text)) - (format (clear *temp-string*) "~S~S" arg0 arg1) - (s2-0 *temp-string* s3-0 #f 128 22) ) + (let ((v1-7 s3-0)) + (set! (-> v1-7 width) (the float 400)) + ) + (let ((v1-8 s3-0)) + (set! (-> v1-8 height) (the float 96)) + ) + (set! (-> s3-0 flags) (font-flags shadow kerning middle)) + (let ((s2-0 print-game-text)) + (format (clear *temp-string*) "~S~S" arg0 arg1) + (s2-0 *temp-string* s3-0 #f 128 22) ) ) - (suspend) ) ) (go level-hint-exit) diff --git a/test/decompiler/reference/jak1/engine/game/game-info_REF.gc b/test/decompiler/reference/jak1/engine/game/game-info_REF.gc index 6691a674ed..f2883a572f 100644 --- a/test/decompiler/reference/jak1/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/game-info_REF.gc @@ -637,11 +637,8 @@ (process-spawn-function process (lambda ((arg0 process-drawable)) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.6)) - (send-event arg0 'effect 'eco-blue) - (suspend) - ) + (suspend-for (seconds 0.6) + (send-event arg0 'effect 'eco-blue) ) (none) ) diff --git a/test/decompiler/reference/jak1/engine/game/main_REF.gc b/test/decompiler/reference/jak1/engine/game/main_REF.gc index e065c4fc34..50385940ae 100644 --- a/test/decompiler/reference/jak1/engine/game/main_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/main_REF.gc @@ -912,10 +912,7 @@ (set! (-> *setting-control* default music-volume) 0.0) (set! (-> *setting-control* default dialog-volume) 0.0) (set! (-> *setting-control* default ambient-volume) 0.0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (kernel-shutdown) (none) diff --git a/test/decompiler/reference/jak1/engine/game/powerups_REF.gc b/test/decompiler/reference/jak1/engine/game/powerups_REF.gc index 7f3e8e7135..0f4f1f6800 100644 --- a/test/decompiler/reference/jak1/engine/game/powerups_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/powerups_REF.gc @@ -15,25 +15,22 @@ (let ((s1-1 (process->handle arg0)) (s2-1 (process->handle arg1)) ) - (let ((s0-0 (current-time))) - (until (time-elapsed? s0-0 (+ arg3 arg4)) - (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) - (if v1-8 - (deactivate self) - ) - ) - (let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) s0-0)) (the float arg3)) (the float arg4))))) - (a0-18 (process-drawable-pair-random-point! - (the-as process-drawable (-> s1-1 process 0)) - (the-as process-drawable (-> s2-1 process 0)) - (new-stack-vector0) - f0-1 - ) + (suspend-for (+ arg3 arg4) + (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) + (if v1-8 + (deactivate self) + ) + ) + (let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) time)) (the float arg3)) (the float arg4))))) + (a0-18 (process-drawable-pair-random-point! + (the-as process-drawable (-> s1-1 process 0)) + (the-as process-drawable (-> s2-1 process 0)) + (new-stack-vector0) + f0-1 ) - ) - (arg2 a0-18) - ) - (suspend) + ) + ) + (arg2 a0-18) ) ) (cond @@ -43,12 +40,9 @@ ) ) (else - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 arg5) - (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) - (arg2 a0-21) - ) - (suspend) + (suspend-for arg5 + (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) + (arg2 a0-21) ) ) ) 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 8f1fc0ea5b..c3b94327da 100644 --- a/test/decompiler/reference/jak1/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-death_REF.gc @@ -251,10 +251,7 @@ ) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (until (not v1-10) (suspend) @@ -427,10 +424,7 @@ ) ) (else - (let ((s5-7 (current-time))) - (until (time-elapsed? s5-7 (seconds 0.05)) - (suspend) - ) + (suspend-for (seconds 0.05) ) ) ) @@ -887,10 +881,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-known-safe-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (move-to-point! (-> self control) s4-1) ) @@ -1040,10 +1031,7 @@ (-> self attack-info attacker) (ja-channel-set! 0) (ja-post) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) ) (('drown 'drown-death) @@ -1118,10 +1106,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) (('endlessfall) @@ -1180,11 +1165,8 @@ (target-falling-anim (seconds 0.1) (seconds 0.33)) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! eichar-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (let ((gp-12 (current-time))) - (until (time-elapsed? gp-12 (seconds 0.8)) - (ja :group! eichar-launch-jump-loop-ja :num! (loop! 0.5)) - (suspend) - ) + (suspend-for (seconds 0.8) + (ja :group! eichar-launch-jump-loop-ja :num! (loop! 0.5)) ) (camera-change-to (the-as string 'base) 0 #f) ) diff --git a/test/decompiler/reference/jak1/engine/target/target2_REF.gc b/test/decompiler/reference/jak1/engine/target/target2_REF.gc index 6bfab8884e..4d3f80d24c 100644 --- a/test/decompiler/reference/jak1/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target2_REF.gc @@ -28,12 +28,9 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.3)) - (suspend) - (ja :num! (seek! (ja-aframe (the-as float 19.0) 0) 0.05)) - (suspend) - ) + (suspend-for (seconds 0.3) + (suspend) + (ja :num! (seek! (ja-aframe (the-as float 19.0) 0) 0.05)) ) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! eichar-painful-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 40.0) 0)) @@ -1527,10 +1524,7 @@ :to self ) (set-time! (-> self control unknown-dword82)) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (ja-no-eval :group! eichar-yellow-jumping-blast-ja :num! (seek!) :frame-num (ja-frame-num 0)) (until (ja-done? 0) 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 48ab1cd374..b2e6be20d9 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc @@ -663,10 +663,7 @@ (set! sv-128 (the-as symbol #f)) (apply-all (-> self link) actor-link-subtask-complete-hook (& sv-128)) (when sv-128 - (let ((s5-2 (current-time))) - (until (time-elapsed? s5-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (let ((gp-1 (cond (arg0 @@ -1224,10 +1221,7 @@ ) (camera-change-to "camera-135" 0 #f) (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 9)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 4)) - (suspend) - ) + (suspend-for (seconds 4) ) (while (not (process-release? (handle->process (-> self grab-target)))) (suspend) diff --git a/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc b/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc index d27440c6c5..ea88172391 100644 --- a/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc @@ -222,10 +222,7 @@ nav-enemy-default-event-handler (ja-channel-push! 1 (seconds 0.075)) (loop (ja :group! lurkercrab-idle-ja :num! (identity (ja-aframe 1.0 0))) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (ja-no-eval :group! lurkercrab-idle-ja :num! (seek! (ja-aframe 19.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) @@ -233,10 +230,7 @@ nav-enemy-default-event-handler (ja :num! (seek! (ja-aframe 19.0 0))) ) (ja :num-func num-func-identity :frame-num (ja-aframe 19.0 0)) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (ja-no-eval :group! lurkercrab-idle-ja :num! (seek! (ja-aframe 1.0 0)) :frame-num (ja-aframe 19.0 0)) (until (ja-done? 0) @@ -306,10 +300,7 @@ nav-enemy-default-event-handler (nav-enemy-rnd-int-range 2 6) (until (not (nav-enemy-rnd-go-idle? 0.2)) (ja :group! lurkercrab-idle-ja :num! (identity (ja-aframe 1.0 0))) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) @@ -472,15 +463,9 @@ nav-enemy-default-event-handler (suspend) (ja :num! (seek! (ja-aframe 18.0 0) 0.75)) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (go-virtual nav-enemy-chase) ) diff --git a/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc b/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc index 0745f1a0e5..69e990fe26 100644 --- a/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc @@ -105,13 +105,10 @@ nav-enemy-default-event-handler (ja-channel-push! 1 (seconds 0.1)) (ja :group! lurkerpuppy-idle-ja) (ja :num-func num-func-identity :frame-num 0.0) - (let ((gp-2 (rand-vu-int-range 750 900)) - (s5-0 (current-time)) - ) - (until (time-elapsed? s5-0 gp-2) + (let ((gp-2 (rand-vu-int-range 750 900))) + (suspend-for gp-2 (ja :num! (loop!)) (ja-blend-eval) - (suspend) ) ) ) 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 4a40ed1d05..cc072689b4 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc @@ -1781,11 +1781,7 @@ :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (let ((t9-2 (-> (find-parent-state) code))) - (if t9-2 - ((the-as (function none :behavior battlecontroller) t9-2)) - ) - ) + (call-parent-state-handler code) ) ) 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 bc869fa9ec..58f3f6ec8e 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 @@ -448,10 +448,7 @@ ) ) ) - (let ((s2-1 (current-time))) - (until (time-elapsed? s2-1 (seconds 0.12)) - (suspend) - ) + (suspend-for (seconds 0.12) ) (+! s5-0 s4-0) ) diff --git a/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc b/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc index 32219a2df9..0219ba6896 100644 --- a/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc @@ -531,10 +531,7 @@ battlecontroller-default-event-handler (go-virtual battlecontroller-die) ) (when (< gp-0 (-> self target-count)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (-> self spawn-period)) - (suspend) - ) + (suspend-for (-> self spawn-period) ) (battlecontroller-spawn-creature-random-spawner) ) 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 00bf4a2b5e..15ba3b2c14 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc @@ -409,10 +409,7 @@ ) ) ) - (let ((s1-1 (current-time))) - (until (time-elapsed? s1-1 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (when (handle->process arg1) (let ((s1-2 (handle->process arg1)) @@ -431,17 +428,11 @@ ) ) ) - (let ((s1-3 (current-time))) - (until (time-elapsed? s1-3 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (let ((v0-22 (entity-by-name "sage-finalboss-1")) (a1-26 (new 'stack-no-clear 'event-message-block)) 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 b96cb68097..0b06890ba2 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss_REF.gc @@ -973,10 +973,7 @@ (remove-setting! 'music) (apply-settings *setting-control*) (set-blackout-frames (seconds 0.05)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.05)) - (suspend) - ) + (suspend-for (seconds 0.05) ) (go-virtual hidden) ) 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 0b77c47f3d..e467321a17 100644 --- a/test/decompiler/reference/jak1/levels/flut_common/flutflut_REF.gc +++ b/test/decompiler/reference/jak1/levels/flut_common/flutflut_REF.gc @@ -274,11 +274,8 @@ (flutflut-effect) (suspend) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (flutflut-effect) - (suspend) - ) + (suspend-for (seconds 1) + (flutflut-effect) ) (go arg0) ) 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 768cb5101b..e704258d9e 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 @@ -1661,10 +1661,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-known-safe-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (move-to-point! (-> self control) s4-1) ) @@ -1774,35 +1771,32 @@ ) ) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 1)) - (target-flut-falling-anim-trans) - (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) - (let ((s5-2 (new-stack-vector0)) - (f30-1 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - ) - 0.0 - (vector-! - s5-2 - (-> self control transv) - (vector-float*! s5-2 (-> self control dynam gravity-normal) (the-as float f30-1)) + (suspend-for (seconds 1) + (target-flut-falling-anim-trans) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) + (let ((s5-2 (new-stack-vector0)) + (f30-1 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) ) - (let* ((f0-10 (vector-length s5-2)) - (f1-4 f0-10) - ) - (if (< (the-as float (-> self control unknown-uint20)) (the-as float f30-1)) - (set! f30-1 (-> self control unknown-uint20)) - ) - (vector+! - (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f30-1)) - (vector-float*! s5-2 s5-2 (/ f0-10 f1-4)) + 0.0 + (vector-! + s5-2 + (-> self control transv) + (vector-float*! s5-2 (-> self control dynam gravity-normal) (the-as float f30-1)) + ) + (let* ((f0-10 (vector-length s5-2)) + (f1-4 f0-10) + ) + (if (< (the-as float (-> self control unknown-uint20)) (the-as float f30-1)) + (set! f30-1 (-> self control unknown-uint20)) ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f30-1)) + (vector-float*! s5-2 s5-2 (/ f0-10 f1-4)) ) ) - (target-flut-post-post) - (suspend) ) + (target-flut-post-post) ) (camera-change-to (the-as string 'base) 0 #f) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc b/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc index 220bf176b5..e3c9a80a69 100644 --- a/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc @@ -221,10 +221,7 @@ (ja :num! (seek!)) ) (ja-channel-set! 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (process-spawn part-tracker @@ -237,10 +234,7 @@ (-> self root trans) :to *entity-pool* ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (set! (-> self dangerous) #t) (logior! (-> self mask) (process-mask actor-pause)) diff --git a/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc b/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc index 53e5912428..8da3a8e270 100644 --- a/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc @@ -1392,10 +1392,7 @@ ) (process-spawn-function process (lambda :behavior process () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (ambient-hint-spawn "st-lose" (the-as vector #f) *entity-pool* 'stinger) (none) @@ -1812,11 +1809,7 @@ (fisher-fish-water gp-0 (+ 32768.0 (vector-y-angle (-> self node-list data 80 bone transform vector 1)))) ) ) - (let ((t9-14 (-> (find-parent-state) trans))) - (if t9-14 - (t9-14) - ) - ) + (call-parent-state-handler trans) ) ) @@ -1824,11 +1817,7 @@ (defstate idle (fisher) :virtual #t :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (when (task-complete? *game-info* (-> self entity extra perm task)) (when (nonzero? (-> *cpad-list* cpads 0 button0-rel 0)) (let ((v1-9 (-> self cheat-temp))) 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 c27c2f916a..56e5cf099f 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc @@ -52,11 +52,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> s5-0 quad) (-> self root trans quad)) - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (vector-! gp-0 (-> self root trans) s5-0) (when (< (-> self path-pos) 0.9) (move-by-vector! (-> *target* control) gp-0) 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 4fa5501cad..5ff757bc31 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc @@ -1964,10 +1964,7 @@ (let ((v1-11 (manipy-spawn (-> self root trans) (-> self entity) *reflector-mirror-break-sg* #f :to self))) (send-event (ppointer->process v1-11) 'anim-mode 'play1) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (process-grab? *target*) (while (or (-> self child) (-> *setting-control* current ambient)) 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 896ba313c3..4e9bce5b92 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc @@ -246,18 +246,12 @@ (while (not (process-grab? *target*)) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event *camera* 'blend-from-as-fixed) (camera-look-at (the-as pair "ecovent-171") (the-as uint 0)) (camera-change-to "camera-223" 0 #f) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (while (not (process-release? (handle->process (-> self grab-target)))) (suspend) 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 c6b5b07bf3..634135c0c3 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc @@ -528,12 +528,9 @@ (defstate plant-boss-vine-die (plant-boss-arm) :code (behavior ((arg0 symbol)) (when (not arg0) - (let ((f30-0 (rand-vu-float-range (the-as float 0.0) (the-as float 1.0))) - (gp-0 (current-time)) - ) - (until (time-elapsed? gp-0 (the int (* 300.0 f30-0))) + (let ((f30-0 (rand-vu-float-range (the-as float 0.0) (the-as float 1.0)))) + (suspend-for (the int (* 300.0 f30-0)) (ja :num! (loop!)) - (suspend) ) ) (ja-channel-push! 1 (seconds 0.25)) @@ -574,14 +571,11 @@ ;; failed to figure out what this is: (defstate plant-boss-root-die (plant-boss-arm) :code (behavior ((arg0 symbol)) - (when (not arg0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 4)) + (if (not arg0) + (suspend-for (seconds 4) (+! (-> self root trans z) (* -4096.0 (seconds-per-frame))) - (suspend) ) ) - ) ) :post ja-post ) @@ -1059,10 +1053,7 @@ (suspend) ) (camera-change-to "camera-222" 600 #f) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (while (not (process-release? (handle->process (-> self grab-target)))) (suspend) @@ -1744,12 +1735,9 @@ :code (behavior () (ja-channel-set! 1) (ja :group! plant-boss-main-die-ja :num! max) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 5)) - (transform-post) - (do-push-aways! (-> self root)) - (suspend) - ) + (suspend-for (seconds 5) + (transform-post) + (do-push-aways! (-> self root)) ) (loop (logior! (-> self mask) (process-mask sleep)) 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 617886fc1b..443d8d1709 100644 --- a/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc @@ -554,14 +554,11 @@ baby-spider-default-event-handler ) (ja-no-eval :num! (loop!)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) - (let ((gp-0 (rand-vu-int-range 300 600)) - (s5-0 (current-time)) - ) - (until (time-elapsed? s5-0 gp-0) + (let ((gp-0 (rand-vu-int-range 300 600))) + (suspend-for gp-0 (ja :num-func num-func-identity :frame-num 0.0) (ja-blend-eval) (suspend) - (suspend) ) ) ) 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 cfb87e9399..3f07948525 100644 --- a/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc @@ -529,10 +529,7 @@ (-> self root trans) :to *entity-pool* ) - (let ((s5-4 (current-time))) - (until (time-elapsed? s5-4 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (if gp-1 (go dark-crystal-spawn-fuel-cell) 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 b14bbbb339..0487bfbf32 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 @@ -320,11 +320,7 @@ nav-enemy-default-event-handler (if (and *target* (= (-> *target* current-level name) 'misty)) (spool-push *art-control* "mistycam-cannon" 0 self -1.0) ) - (let ((t9-3 (-> (find-parent-state) trans))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler trans) ) ) diff --git a/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc index d5801a2522..0cbeb53c77 100644 --- a/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc @@ -839,10 +839,7 @@ (apply-all (-> self link) actor-link-dead-hook (& sv-16)) (when (and sv-16 sv-24) (process-grab? *target*) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (process-release? *target*) (while (let ((a1-4 (new 'stack-no-clear 'event-message-block))) 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 ff2f770907..a40d5b34da 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-warehouse_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-warehouse_REF.gc @@ -64,10 +64,7 @@ (suspend) ) (camera-change-to "camera-160" 150 #f) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (while (not (process-release? (handle->process (-> self grab-target)))) (suspend) @@ -92,10 +89,7 @@ (save-reminder gp-0 (logior v1-1 2) 0) ) (set-time! (-> self state-time)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (sound-play "arena-steps") (send-to-all-after (-> self link) 'trigger-rise) diff --git a/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc b/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc index 84bf8a6f30..bedfb1492d 100644 --- a/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc @@ -938,11 +938,8 @@ ) (suspend) (clear-collide-with-as (-> self root)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 3)) - (spawn (-> self part2) (-> self root trans)) - (suspend) - ) + (suspend-for (seconds 3) + (spawn (-> self part2) (-> self root trans)) ) (kill-and-free-particles (-> self part2)) (deactivate self) 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 8ed835d553..42305d13dd 100644 --- a/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc @@ -950,10 +950,7 @@ process (lambda :behavior process () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (level-hint-spawn (text-id ogre-race-hint) "asstvb24" (the-as entity #f) *entity-pool* (game-task none)) (none) @@ -1202,10 +1199,7 @@ ) (when (and *target* (>= 172032.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (process-grab? *target*) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (process-release? *target*) (send-event self 'saw-player) diff --git a/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc b/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc index e7dbf2e5f7..26a28259a7 100644 --- a/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc @@ -1107,10 +1107,7 @@ (suspend) (ja :num! (seek! (ja-aframe (the-as float 140.0) 0))) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.167)) - (suspend) - ) + (suspend-for (seconds 0.167) ) (ja-no-eval :group! ogreboss-idle-ja :num! (seek! (ja-aframe (the-as float 168.0) 0)) @@ -1120,10 +1117,7 @@ (suspend) (ja :num! (seek! (ja-aframe (the-as float 168.0) 0))) ) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 0.167)) - (suspend) - ) + (suspend-for (seconds 0.167) ) (ja-no-eval :group! ogreboss-idle-ja :num! (seek!) :frame-num (ja-aframe (the-as float 168.0) 0)) (until (ja-done? 0) @@ -1405,10 +1399,7 @@ ) (logior! (-> self draw status) (draw-status hidden)) (set! (-> self submerged) #t) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 arg0) - (suspend) - ) + (suspend-for arg0 ) ) 0 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 5113f101ff..afe015bb5c 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 @@ -969,10 +969,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) (('endlessfall) @@ -996,29 +993,26 @@ ) ) ) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 0.75)) - (vector-seek! (-> self draw color-mult) *zero-vector* (* 1.5 (seconds-per-frame))) - (set-forward-vel (* 0.96 (-> self control unknown-float01))) - (let ((s5-3 (new-stack-vector0)) - (f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - ) - 0.0 - (vector-! s5-3 (-> self control transv) (vector-float*! s5-3 (-> self control dynam gravity-normal) f28-0)) - (let* ((f0-38 (vector-length s5-3)) - (f1-12 f0-38) - ) - (if (< f30-0 f28-0) - (set! f28-0 f30-0) - ) - (vector+! - (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f28-0) - (vector-float*! s5-3 s5-3 (/ f0-38 f1-12)) + (suspend-for (seconds 0.75) + (vector-seek! (-> self draw color-mult) *zero-vector* (* 1.5 (seconds-per-frame))) + (set-forward-vel (* 0.96 (-> self control unknown-float01))) + (let ((s5-3 (new-stack-vector0)) + (f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! s5-3 (-> self control transv) (vector-float*! s5-3 (-> self control dynam gravity-normal) f28-0)) + (let* ((f0-38 (vector-length s5-3)) + (f1-12 f0-38) + ) + (if (< f30-0 f28-0) + (set! f28-0 f30-0) ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f28-0) + (vector-float*! s5-3 s5-3 (/ f0-38 f1-12)) ) ) - (suspend) ) ) ) @@ -1191,16 +1185,13 @@ (ja :chan 2 :group! eichar-racer-dig-ja :num! (chan 0)) (ja :chan 3 :group! eichar-racer-dig2-ja :num! (chan 0)) ) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.5)) - (set! (-> self racer stick-lock) #t) - (set-forward-vel (* 0.9 (-> self control unknown-float01))) - (set! (-> self racer turn-anim-targ) 0.0) - (set! (-> self racer turn-anim-targ) 0.0) - (target-racing-turn-anim) - (seek! (-> self control unknown-vector11 y) 6144.0 (* 3.0 (seconds-per-frame))) - (suspend) - ) + (suspend-for (seconds 0.5) + (set! (-> self racer stick-lock) #t) + (set-forward-vel (* 0.9 (-> self control unknown-float01))) + (set! (-> self racer turn-anim-targ) 0.0) + (set! (-> self racer turn-anim-targ) 0.0) + (target-racing-turn-anim) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 3.0 (seconds-per-frame))) ) (go target-racing-get-off-jump arg0) ) 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 7e4717d416..bde276a61b 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc @@ -328,11 +328,8 @@ (racer-effect) (suspend) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (racer-effect) - (suspend) - ) + (suspend-for (seconds 1) + (racer-effect) ) (go arg0) ) 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 ceea651367..7332702349 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc @@ -464,11 +464,9 @@ :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) ) (loop - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 2.52)) - (suspend) - (ja :num! (loop!)) - ) + (suspend-for (seconds 2.52) + (suspend) + (ja :num! (loop!)) ) (cond ((zero? gp-2) 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 668ed5e0e7..d126bd8075 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc @@ -50,10 +50,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 4.5)) - (suspend) - ) + (suspend-for (seconds 4.5) ) ) ((= v1-0 1) diff --git a/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc b/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc index d4d769f5df..bf247c440a 100644 --- a/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc @@ -241,11 +241,7 @@ (defstate nav-enemy-victory (billy-rat) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (logtest? (nav-control-flags navcf19) (-> self nav flags)) (logclear! (-> self nav flags) (nav-control-flags navcf19)) (if (rat-about-to-eat? self (-> self billy 0)) 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 5f56a46cc3..5eb8328a28 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc @@ -262,14 +262,11 @@ swamp-rat-default-event-handler ) (ja-no-eval :num! (loop!)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) - (let ((gp-0 (rand-vu-int-range 300 600)) - (s5-0 (current-time)) - ) - (until (time-elapsed? s5-0 gp-0) + (let ((gp-0 (rand-vu-int-range 300 600))) + (suspend-for gp-0 (ja :num-func num-func-identity :frame-num 0.0) (ja-blend-eval) (suspend) - (suspend) ) ) ) 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 c29b8ef3c7..1e80437b8f 100644 --- a/test/decompiler/reference/jak1/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/title/title-obs_REF.gc @@ -448,11 +448,8 @@ ) (loop (when (and (none-reserved? *art-control*) (not (paused?))) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.1)) - (set! *camera-look-through-other* 2) - (suspend) - ) + (suspend-for (seconds 0.1) + (set! *camera-look-through-other* 2) ) (go-virtual idle) ) @@ -703,11 +700,8 @@ (set-blackout-frames (seconds 0.05)) (suspend) ) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.25)) - (set-blackout-frames (seconds 0.05)) - (suspend) - ) + (suspend-for (seconds 0.25) + (set-blackout-frames (seconds 0.05)) ) ) ) @@ -744,10 +738,7 @@ (while *progress-process* (suspend) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.01)) - (suspend) - ) + (suspend-for (seconds 0.01) ) (goto cfg-41) ) 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 bbfa9124ea..3823ecce49 100644 --- a/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc @@ -186,10 +186,7 @@ (when (not (task-complete? *game-info* (game-task training-climb))) (clear-text-seen! *game-info* (text-id training-double-jump)) (level-hint-spawn (text-id training-double-jump) "sagevb27" (the-as entity #f) *entity-pool* (game-task none)) - (let ((gp-8 (current-time))) - (until (time-elapsed? gp-8 (seconds 30)) - (suspend) - ) + (suspend-for (seconds 30) ) (process-entity-status! self (entity-perm-status bit-3) #f) (go-virtual idle) 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 622ba778a0..b473010341 100644 --- a/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc @@ -1315,12 +1315,9 @@ ) (vector-z-quaternion! gp-0 (-> self root-overlay quat)) (vehicle-controller-method-10 (-> self controller) gp-0 (-> self controller throttle) s5-0) - (let ((s3-0 (current-time))) - (until (time-elapsed? s3-0 (seconds 1)) - (fishermans-boat-set-throttle-by-speed f30-0) - (suspend) - (suspend) - ) + (suspend-for (seconds 1) + (fishermans-boat-set-throttle-by-speed f30-0) + (suspend) ) ) (vector-z-quaternion! gp-0 (-> self root-overlay quat)) @@ -1572,10 +1569,7 @@ process (lambda :behavior fishermans-boat () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while (or (-> *setting-control* current ambient) (-> *setting-control* current hint) 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 500a447c32..2922b70d2b 100644 --- a/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc @@ -154,11 +154,7 @@ ) (set! *teleport* #t) (set! (-> s5-0 quad) (-> self root trans quad)) - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (vector-! gp-0 (-> self root trans) s5-0) (when (< (-> self path-pos) 0.9) (move-by-vector! (-> *target* control) gp-0) 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 96a8c33973..c7c16883c3 100644 --- a/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc @@ -1547,10 +1547,7 @@ (suspend) (ja :num! (seek! (ja-aframe 140.0 0))) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.167)) - (suspend) - ) + (suspend-for (seconds 0.167) ) (ja-no-eval :group! ogreboss-village2-idle-ja :num! (seek! (ja-aframe 168.0 0)) @@ -1560,10 +1557,7 @@ (suspend) (ja :num! (seek! (ja-aframe 168.0 0))) ) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 0.167)) - (suspend) - ) + (suspend-for (seconds 0.167) ) (ja-no-eval :group! ogreboss-village2-idle-ja :num! (seek!) :frame-num (ja-aframe 168.0 0)) (until (ja-done? 0) 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 9ffb59f48e..bfc1a1a43f 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 @@ -60,10 +60,7 @@ (ja-channel-set! 0) (vector-reset! (-> self control transv)) (move-to-point! (-> self control) (-> self control unknown-vector102)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((gp-1 (new-stack-vector0))) (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) @@ -1150,10 +1147,7 @@ (let ((a0-70 (-> self entity extra perm))) (when (= (-> a0-70 user-uint8 0) 1) (remove-setting! 'allow-progress) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 300)) - (suspend) - ) + (suspend-for (seconds 300) ) (go-virtual idle) ) diff --git a/test/decompiler/reference/jak2/decompiler-macros.gc b/test/decompiler/reference/jak2/decompiler-macros.gc index add3b04af4..5b9e10632e 100644 --- a/test/decompiler/reference/jak2/decompiler-macros.gc +++ b/test/decompiler/reference/jak2/decompiler-macros.gc @@ -572,6 +572,13 @@ ) ) +(defmacro call-parent-state-handler (handler &key (type (function none)) &rest args) + "Call the parent handler for this state." + `(let ((handler (-> (find-parent-state) ,handler))) + (if handler ((the ,type handler) ,@args)) + ) + ) + (defmacro call-parent-method (&rest args) "Find the first different implementation of the current method in a parent type and call it with these arguments." `((the (current-method-function-type) (find-parent-method (current-method-type) (current-method-id))) @@ -1710,4 +1717,7 @@ (defmacro time-elapsed? (time duration) `(>= (- (current-time) ,time) ,duration) - ) \ No newline at end of file + ) + +(defmacro suspend-for (time &rest body) + `(let ((time (current-time))) (until (time-elapsed? time ,time) ,@body (suspend)))) \ No newline at end of file diff --git a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc index 92204347f7..b23a499fa4 100644 --- a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc @@ -363,10 +363,7 @@ (defstate idle (talker) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (the-as time-frame (-> self message delay))) - (suspend) - ) + (suspend-for (the-as time-frame (-> self message delay)) ) (case (-> self message channel) (((gui-channel voicebox)) @@ -533,10 +530,7 @@ ) ) (when (and (logtest? (-> self message flags) 8) (not (-> self save?))) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (set! (-> self save?) #t) (auto-save-user) 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 f00cadff9e..a7b25d6607 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc @@ -901,10 +901,7 @@ ) ) (when (not arg0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.04)) - (suspend) - ) + (suspend-for (seconds 0.04) ) (logior! (-> self draw status) (draw-control-status no-draw)) (case (-> self look) @@ -1056,16 +1053,10 @@ (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) arg1) (process-entity-status! self (entity-perm-status dead) #t) (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) (when (logtest? (actor-option cond-respawn) (-> self fact options)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 15)) - (suspend) - ) + (suspend-for (seconds 15) ) (go-virtual hide) ) 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 7f9fe7fd25..4fbd1f980b 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 @@ -227,11 +227,8 @@ (move-along-path self) (suspend) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (move-along-path self) - (suspend) - ) + (suspend-for (seconds 0.5) + (move-along-path self) ) (go-virtual idle) ) @@ -1380,28 +1377,25 @@ ) (suspend) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (the-as time-frame (-> self linger-duration))) - (if (-> self linger-callback) - ((-> self linger-callback) self) - ) - (let* ((s5-0 (handle->process (-> self target))) - (v1-30 (if (type? s5-0 process-drawable) - s5-0 - ) - ) - ) - (if (and v1-30 - (nonzero? (-> (the-as process-drawable v1-30) root)) - (nonzero? (-> (the-as process-drawable v1-30) node-list)) - ) - (vector<-cspace! - (-> self root trans) - (-> (the-as process-drawable v1-30) node-list data (-> self target-joint)) - ) - ) + (suspend-for (the-as time-frame (-> self linger-duration)) + (if (-> self linger-callback) + ((-> self linger-callback) self) ) - (suspend) + (let* ((s5-0 (handle->process (-> self target))) + (v1-30 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (if (and v1-30 + (nonzero? (-> (the-as process-drawable v1-30) root)) + (nonzero? (-> (the-as process-drawable v1-30) node-list)) + ) + (vector<-cspace! + (-> self root trans) + (-> (the-as process-drawable v1-30) node-list data (-> self target-joint)) + ) + ) ) ) (if (-> self linger-callback) diff --git a/test/decompiler/reference/jak2/engine/common_objs/powerups_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/powerups_REF.gc index 236c577d9e..3d37bcb08c 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/powerups_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/powerups_REF.gc @@ -16,25 +16,22 @@ (let ((s1-1 (process->handle arg0)) (s2-1 (process->handle arg1)) ) - (let ((s0-0 (current-time))) - (until (time-elapsed? s0-0 (+ arg3 arg4)) - (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) - (if v1-8 - (deactivate self) - ) - ) - (let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) s0-0)) (the float arg3)) (the float arg4))))) - (a0-18 (process-drawable-pair-random-point! - (the-as process-drawable (-> s1-1 process 0)) - (the-as process-drawable (-> s2-1 process 0)) - (new-stack-vector0) - f0-1 - ) + (suspend-for (+ arg3 arg4) + (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) + (if v1-8 + (deactivate self) + ) + ) + (let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) time)) (the float arg3)) (the float arg4))))) + (a0-18 (process-drawable-pair-random-point! + (the-as process-drawable (-> s1-1 process 0)) + (the-as process-drawable (-> s2-1 process 0)) + (new-stack-vector0) + f0-1 ) - ) - (arg2 a0-18) - ) - (suspend) + ) + ) + (arg2 a0-18) ) ) (cond @@ -45,12 +42,9 @@ #f ) (else - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 arg5) - (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) - (arg2 a0-21) - ) - (suspend) + (suspend-for arg5 + (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) + (arg2 a0-21) ) ) ) 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 111b1dba74..c3c71c6239 100644 --- a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc @@ -4369,10 +4369,7 @@ ,(lambda () (let ((v1-1 (process-spawn-function process (lambda () (set-master-mode 'game) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.3)) - (suspend) - ) + (suspend-for (seconds 0.3) ) (until #f (format *stdcon* "press x clear map, press circle cancel~%") 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 2429b5e499..2b0bd850d2 100644 --- a/test/decompiler/reference/jak2/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-info_REF.gc @@ -788,25 +788,19 @@ (set! (-> v1-9 origin z) (the float (/ (-> s3-0 z) 16))) ) (set! (-> s5-0 flags) (font-flags shadow kerning large)) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (+ arg2 -75)) - (+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame))) - (let ((s2-0 print-game-text)) - (format (clear *temp-string*) "~4,,0f" arg1) - (s2-0 *temp-string* s5-0 #f 44 (bucket-id debug-no-zbuf1)) - ) - (suspend) + (suspend-for (+ arg2 -75) + (+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame))) + (let ((s2-0 print-game-text)) + (format (clear *temp-string*) "~4,,0f" arg1) + (s2-0 *temp-string* s5-0 #f 44 (bucket-id debug-no-zbuf1)) ) ) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.25)) - (set! (-> s5-0 alpha) (lerp-scale 1.0 0.0 (the float (- (current-time) s4-1)) 0.0 150.0)) - (+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame))) - (let ((s3-2 print-game-text)) - (format (clear *temp-string*) "~4,,0f" arg1) - (s3-2 *temp-string* s5-0 #f 44 (bucket-id debug-no-zbuf1)) - ) - (suspend) + (suspend-for (seconds 0.25) + (set! (-> s5-0 alpha) (lerp-scale 1.0 0.0 (the float (- (current-time) time)) 0.0 150.0)) + (+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame))) + (let ((s3-2 print-game-text)) + (format (clear *temp-string*) "~4,,0f" arg1) + (s3-2 *temp-string* s5-0 #f 44 (bucket-id debug-no-zbuf1)) ) ) ) @@ -1237,11 +1231,8 @@ process (lambda :behavior process ((arg0 string)) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 10)) - (format *stdcon* "~S~%" arg0) - (suspend) - ) + (suspend-for (seconds 10) + (format *stdcon* "~S~%" arg0) ) (none) ) diff --git a/test/decompiler/reference/jak2/engine/game/main_REF.gc b/test/decompiler/reference/jak2/engine/game/main_REF.gc index e9d905a565..371b8c98e4 100644 --- a/test/decompiler/reference/jak2/engine/game/main_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/main_REF.gc @@ -1173,10 +1173,7 @@ (set! (-> *setting-control* user-default music-volume) 0.0) (set! (-> *setting-control* user-default dialog-volume) 0.0) (set! (-> *setting-control* user-default ambient-volume) 0.0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (kernel-shutdown (the-as runtime-exit-status arg0)) (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 d386a108ad..0aa59df5c1 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 @@ -1680,27 +1680,24 @@ ) :code (behavior () (local-vars (a1-10 string)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (let ((f30-0 (lerp-scale 1.0 0.0 (the float (- (current-time) gp-0)) 0.0 270.0))) - (when *sound-player-enable* - (let ((v1-6 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) - (set! (-> v1-6 command) (sound-command set-param)) - (set! (-> v1-6 id) (-> self stinger)) - (set! (-> v1-6 params volume) (the int (* 1024.0 f30-0))) - (set! (-> v1-6 params mask) (the-as uint 1)) - (-> v1-6 id) - ) + (suspend-for (seconds 1) + (let ((f30-0 (lerp-scale 1.0 0.0 (the float (- (current-time) time)) 0.0 270.0))) + (when *sound-player-enable* + (let ((v1-6 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-6 command) (sound-command set-param)) + (set! (-> v1-6 id) (-> self stinger)) + (set! (-> v1-6 params volume) (the int (* 1024.0 f30-0))) + (set! (-> v1-6 params mask) (the-as uint 1)) + (-> v1-6 id) ) ) - (let ((f30-1 (lerp-scale 1.0 0.0 (the float (- (current-time) gp-0)) 0.0 300.0))) - (set-filter-color! - (lerp-scale 1.0 1.25 f30-1 0.0 1.0) - (lerp-scale 1.0 0.875 f30-1 0.0 1.0) - (lerp-scale 1.0 0.25 f30-1 0.0 1.0) - ) + ) + (let ((f30-1 (lerp-scale 1.0 0.0 (the float (- (current-time) time)) 0.0 300.0))) + (set-filter-color! + (lerp-scale 1.0 1.25 f30-1 0.0 1.0) + (lerp-scale 1.0 0.875 f30-1 0.0 1.0) + (lerp-scale 1.0 0.25 f30-1 0.0 1.0) ) - (suspend) ) ) (case (-> self message) 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 941626a37a..dd5d2c3031 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 @@ -334,10 +334,7 @@ :enter (-> (method-of-type process-taskable active) enter) :exit (-> (method-of-type process-taskable active) exit) :code (behavior ((arg0 game-task-event)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (go-virtual hide) ) diff --git a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc index 1614d9b329..996bb43b84 100644 --- a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc +++ b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc @@ -1144,10 +1144,7 @@ (* 30.0 (seconds-per-frame)) (bucket-id screen-filter) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.05)) - (suspend) - ) + (suspend-for (seconds 0.05) ) (set! (-> *setting-control* user-current bg-a) 0.0) (remove-setting! 'movie) diff --git a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc index 8c2f46c545..b08b71fc59 100644 --- a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc @@ -1362,10 +1362,7 @@ (set! (-> a1-3 0) 'empty0) (want-sound-banks *load-state* a1-3) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((a1-4 (new 'stack-no-clear 'array 'symbol 4))) (set! (-> a1-4 2) (-> gp-0 2)) 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 7f5b0b2340..c3e50488ab 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 @@ -3003,10 +3003,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (move-to-point! (-> self control) s4-1) ) 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 9f62be6dd0..f3578da133 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 @@ -855,10 +855,7 @@ (-> self result-array (+ gp-2 -1)) :to s4-1 ) - (let ((s4-2 (current-time))) - (until (time-elapsed? s4-2 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) ) ) 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 1b52e3583e..0c56e56825 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 @@ -1037,10 +1037,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (move-to-point! (-> self control) s4-1) ) @@ -1177,11 +1174,8 @@ ) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-mech-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.8)) - (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5)) - (suspend) - ) + (suspend-for (seconds 0.8) + (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5)) ) (remove-setting! 'mode-name) ) @@ -1302,10 +1296,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) ) 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 4b14800bbb..140b01a824 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/mech_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/mech_REF.gc @@ -264,11 +264,8 @@ (mech-method-24 self) (suspend) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (mech-method-24 self) - (suspend) - ) + (suspend-for (seconds 1) + (mech-method-24 self) ) (go arg0) ) 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 75d9a8e44c..b155054831 100644 --- a/test/decompiler/reference/jak2/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-death_REF.gc @@ -292,10 +292,7 @@ ) ) ) - (let ((s5-6 (current-time))) - (until (time-elapsed? s5-6 (seconds 0.05)) - (suspend) - ) + (suspend-for (seconds 0.05) ) ) ((logtest? (-> arg0 flags) (continue-flags title)) @@ -319,10 +316,7 @@ (intro-play) ) ((logtest? (-> arg0 flags) (continue-flags warp-gate)) - (let ((s5-7 (current-time))) - (until (time-elapsed? s5-7 (seconds 0.05)) - (suspend) - ) + (suspend-for (seconds 0.05) ) (let ((s5-8 (new 'static 'vector)) (a2-26 (find-nearest-entity (-> arg0 trans) warp-gate)) @@ -352,10 +346,7 @@ (go target-grab 'stance) ) (else - (let ((s5-9 (current-time))) - (until (time-elapsed? s5-9 (seconds 0.05)) - (suspend) - ) + (suspend-for (seconds 0.05) ) ) ) @@ -1022,10 +1013,7 @@ (let ((gp-1 (new-stack-vector0))) (set! (-> gp-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (move-to-point! (-> self control) gp-1) ) @@ -1669,10 +1657,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((s5-3 (current-time))) - (until (time-elapsed? s5-3 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (b! #t cfg-131 :delay (nop!)) (label cfg-79) @@ -1784,10 +1769,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((s5-7 (current-time))) - (until (time-elapsed? s5-7 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) (b! #t cfg-131 :delay (nop!)) @@ -1837,10 +1819,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((s5-10 (current-time))) - (until (time-elapsed? s5-10 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) ) @@ -1857,10 +1836,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((s5-11 (current-time))) - (until (time-elapsed? s5-11 (seconds 1.2)) - (suspend) - ) + (suspend-for (seconds 1.2) ) ) ((= v1-50 'endlessfall) @@ -1899,38 +1875,35 @@ (target-falling-anim 30 (seconds 0.33)) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.8)) - (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) - (set! v1-24 'target-hit-ground-hard) - (goto cfg-17) - ) - (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) - (let ((v1-49 (new-stack-vector0)) - (f0-7 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - ) - 0.0 - (vector-! - v1-49 - (-> self control transv) - (vector-float*! v1-49 (-> self control dynam gravity-normal) (the-as float f0-7)) - ) - (let* ((f1-7 (vector-length v1-49)) - (f2-2 f1-7) - ) - (if (< (the-as float (-> self control unknown-word04)) (the-as float f0-7)) - (set! f0-7 (-> self control unknown-word04)) - ) - (vector+! - (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f0-7)) - (vector-float*! v1-49 v1-49 (/ f1-7 f2-2)) - ) - ) - ) - (ja :group! jakb-launch-jump-loop-ja :num! (loop! 0.5)) - (suspend) + (suspend-for (seconds 0.8) + (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) + (set! v1-24 'target-hit-ground-hard) + (goto cfg-17) ) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) + (let ((v1-49 (new-stack-vector0)) + (f0-7 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + ) + 0.0 + (vector-! + v1-49 + (-> self control transv) + (vector-float*! v1-49 (-> self control dynam gravity-normal) (the-as float f0-7)) + ) + (let* ((f1-7 (vector-length v1-49)) + (f2-2 f1-7) + ) + (if (< (the-as float (-> self control unknown-word04)) (the-as float f0-7)) + (set! f0-7 (-> self control unknown-word04)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f0-7)) + (vector-float*! v1-49 v1-49 (/ f1-7 f2-2)) + ) + ) + ) + (ja :group! jakb-launch-jump-loop-ja :num! (loop! 0.5)) ) (set! v1-24 #f) (label cfg-17) @@ -1945,10 +1918,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) (remove-setting! 'mode-name) @@ -2038,10 +2008,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((s5-13 (current-time))) - (until (time-elapsed? s5-13 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) ((= v1-50 'centipede) 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 0e15215485..1e90c6e77b 100644 --- a/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc @@ -1670,10 +1670,7 @@ (sound-stop (-> self sound-id 1)) (sound-stop (-> self sound-id 2)) (set! (-> self focus-status) (focus-status disable ignore inactive)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.8)) - (suspend) - ) + (suspend-for (seconds 0.8) ) (send-event (handle->process (-> self rider)) diff --git a/test/decompiler/reference/jak2/engine/target/target2_REF.gc b/test/decompiler/reference/jak2/engine/target/target2_REF.gc index a976c2cc7c..9634b554da 100644 --- a/test/decompiler/reference/jak2/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target2_REF.gc @@ -43,12 +43,9 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.3)) - (suspend) - (ja :num! (seek! (ja-aframe 19.0 0) 0.05)) - (suspend) - ) + (suspend-for (seconds 0.3) + (suspend) + (ja :num! (seek! (ja-aframe 19.0 0) 0.05)) ) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-painful-land-ja :num! (seek!) :frame-num (ja-aframe 40.0 0)) @@ -1242,11 +1239,8 @@ (until #f (let ((s5-0 (rand-vu-int-range 30 600))) (ja :group! jakb-wall-hide-head-ja) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 s5-0) - (gp-0) - (suspend) - ) + (suspend-for s5-0 + (gp-0) ) ) (let ((f30-0 (rand-vu-float-range 0.5 1.5))) @@ -1284,12 +1278,9 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (let ((s5-2 (rand-vu-int-range 60 300)) - (s4-2 (current-time)) - ) - (until (time-elapsed? s4-2 s5-2) + (let ((s5-2 (rand-vu-int-range 60 300))) + (suspend-for s5-2 (gp-0) - (suspend) ) ) (ja-no-eval :group! jakb-wall-hide-head-left-ja :num! (seek! 0.0 f30-0) :frame-num max) @@ -1306,12 +1297,9 @@ (suspend) (ja :num! (seek! 0.0 f30-0)) ) - (let ((s5-3 (rand-vu-int-range 60 300)) - (s4-3 (current-time)) - ) - (until (time-elapsed? s4-3 s5-3) + (let ((s5-3 (rand-vu-int-range 60 300))) + (suspend-for s5-3 (gp-0) - (suspend) ) ) (ja-no-eval :group! jakb-wall-hide-head-right-ja :num! (seek! max f30-0) :frame-num 0.0) 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 b3f565023a..7736d4adc8 100644 --- a/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc @@ -644,42 +644,28 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (the int (-> self cycle-offset))) - (suspend) - ) + (suspend-for (the int (-> self cycle-offset)) ) (until #f - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (the int (-> self cycle-time))) - (suspend) - ) + (suspend-for (the int (-> self cycle-time)) ) (activate! (-> self smush) -1.0 60 225 1.0 1.0 (-> self clock)) (sound-play "rot-pipe-wiggle" :position (-> self root trans)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.75)) - (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush)))) - (suspend) - ) + (suspend-for (seconds 0.75) + (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush)))) ) (set! (-> self shudder-angle) 0.0) (set-zero! (-> self smush)) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (sound-play "rot-pipe-turn" :position (-> self root trans)) (let* ((f0-7 2.0) (f30-1 (* 16384.0 f0-7)) - (gp-6 (current-time)) ) - (until (time-elapsed? gp-6 (seconds 0.5)) + (suspend-for (seconds 0.5) (set! (-> self rot-angle) (the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48)) ) - (suspend) ) ) (let ((v1-42 #x4000)) diff --git a/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc b/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc index a0526ce55e..6fe7fd6fc5 100644 --- a/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc @@ -1395,57 +1395,55 @@ (s5-0 (+ (-> v1-29 attack-id) 1)) ) (set! (-> v1-29 attack-id) s5-0) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 (seconds 0.25)) - (ja-no-eval :group! juicer-attack0-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (let ((s3-0 (handle->process (-> self focus handle)))) - (when s3-0 - (when (< 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable s3-0) 0))) - (fire-projectile self (the-as process-focusable s3-0) s5-0) - (current-time) - (if (not gp-0) - (set! gp-0 #t) + (suspend-for (seconds 0.25) + (ja-no-eval :group! juicer-attack0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((s3-0 (handle->process (-> self focus handle)))) + (when s3-0 + (when (< 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable s3-0) 0))) + (fire-projectile self (the-as process-focusable s3-0) s5-0) + (current-time) + (if (not gp-0) + (set! gp-0 #t) + ) + ) + ) + ) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (b! + (not (and (-> self using-turn-anim) (let ((v1-73 (ja-group))) + (not (and v1-73 (= v1-73 juicer-attack-turn-ja))) + ) ) - ) - ) - ) - (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) - (go-virtual victory) - ) - (b! - (not (and (-> self using-turn-anim) (let ((v1-73 (ja-group))) - (not (and v1-73 (= v1-73 juicer-attack-turn-ja))) - ) - ) - ) - cfg-31 - :delay (empty-form) - ) + ) + cfg-31 + :delay (empty-form) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! juicer-attack-turn-ja) + (b! #t cfg-42 :delay (nop!)) + (label cfg-31) + (when (and (not (-> self using-turn-anim)) (let ((v1-84 (ja-group))) + (not (and v1-84 (= v1-84 juicer-attack0-ja))) + ) + ) (ja-channel-push! 1 (seconds 0.05)) - (ja :group! juicer-attack-turn-ja) - (b! #t cfg-42 :delay (nop!)) - (label cfg-31) - (when (and (not (-> self using-turn-anim)) (let ((v1-84 (ja-group))) - (not (and v1-84 (= v1-84 juicer-attack0-ja))) - ) - ) - (ja-channel-push! 1 (seconds 0.05)) - (ja :group! juicer-attack0-ja) - ) - (label cfg-42) - (suspend) - (ja :num! (seek!)) - ) - (send-event (handle->process (-> self current-projectile)) 'die) - (let ((a0-37 (handle->process (-> self focus handle)))) - (when a0-37 - (if (>= 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable a0-37) 0))) - (go-virtual circling) - ) - ) + (ja :group! juicer-attack0-ja) ) + (label cfg-42) (suspend) + (ja :num! (seek!)) + ) + (empty-form) + (send-event (handle->process (-> self current-projectile)) 'die) + (let ((a0-37 (handle->process (-> self focus handle)))) + (when a0-37 + (if (>= 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable a0-37) 0))) + (go-virtual circling) + ) + ) ) ) ) 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 1e59001b78..79fc0b653f 100644 --- a/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc @@ -555,10 +555,7 @@ (sound-play "lightning-node") (suspend) (logior! (-> self entity extra perm status) (entity-perm-status dead)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 4)) - (suspend) - ) + (suspend-for (seconds 4) ) (cleanup-for-death self) ) @@ -1846,10 +1843,7 @@ (sound-play "trapdoor") (suspend) (ja-channel-set! 0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (while (-> self child) @@ -2440,10 +2434,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (while (or (= (-> self spawn-total) -1) (< (-> self spawn-count-total) (-> self spawn-total))) (when (and (< (-> self player-dist) (+ 81920.0 (-> self notice-dist))) @@ -2480,17 +2471,11 @@ ) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (the int (* 300.0 (rand-vu-float-range 0.5 1.0)))) - (suspend) - ) + (suspend-for (the int (* 300.0 (rand-vu-float-range 0.5 1.0))) ) ) (while (> (-> self spawn-count) 0) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.43)) - (suspend) - ) + (suspend-for (seconds 0.43) ) ) (process-entity-status! self (entity-perm-status subtask-complete) #t) @@ -2509,10 +2494,7 @@ (set-setting! 'entity-name a3-4 0.0 0) ) ) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (dotimes (gp-6 (-> self actor-group 1 length)) (let ((a1-17 (new 'stack-no-clear 'event-message-block))) @@ -2543,10 +2525,7 @@ (set-setting! 'entity-name a3-6 0.0 0) ) ) - (let ((gp-7 (current-time))) - (until (time-elapsed? gp-7 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((gp-8 (-> self actor-group 0))) (dotimes (s5-3 (-> gp-8 length)) @@ -2577,10 +2556,7 @@ (suspend) (ja :num! (seek! 0.0)) ) - (let ((gp-10 (current-time))) - (until (time-elapsed? gp-10 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (remove-setting! 'entity-name) (until (process-release? *target*) @@ -2618,10 +2594,7 @@ (label cfg-14) (not v1-28) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.51)) - (suspend) - ) + (suspend-for (seconds 0.51) ) ) (until (process-grab? *target* #f) @@ -2632,10 +2605,7 @@ (set-setting! 'entity-name a3-2 0.0 0) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (task-node-close! (game-task-node castle-break-in-resolution)) (let ((a1-7 (new 'stack-no-clear 'event-message-block))) @@ -2672,10 +2642,7 @@ ) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 2.5)) - (suspend) - ) + (suspend-for (seconds 2.5) ) (remove-setting! 'entity-name) (until (process-release? *target*) 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 17cfa08fc7..3e5af06492 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 @@ -121,10 +121,7 @@ ) ) :code (behavior () - (let ((frame-counter (current-time))) - (until (time-elapsed? frame-counter (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) (until #f diff --git a/test/decompiler/reference/jak2/levels/castle/pad/castle-tasks_REF.gc b/test/decompiler/reference/jak2/levels/castle/pad/castle-tasks_REF.gc index 6a65b09e0f..e67eb2deba 100644 --- a/test/decompiler/reference/jak2/levels/castle/pad/castle-tasks_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/pad/castle-tasks_REF.gc @@ -18,10 +18,7 @@ (until #f (when (< (vector-vector-distance (target-pos 0) (-> self info end-sphere)) (-> self info end-sphere r)) (send-event (handle->process (-> self arrow)) 'leave) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.007)) - (suspend) - ) + (suspend-for (seconds 0.007) ) (go-virtual complete) ) 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 e8d9ef027c..3198f564b3 100644 --- a/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc @@ -360,11 +360,7 @@ (defstate ambush (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (logand! (-> self flags) -9) (logior! (-> self flags) 4) (logior! (-> self nav flags) (nav-control-flag output-sphere-hash)) @@ -425,11 +421,7 @@ (defstate idle (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (roboguard-level-method-185 self (the-as symbol 0)) ) :code (behavior () @@ -496,11 +488,7 @@ (defstate stare (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (roboguard-level-method-185 self (the-as symbol 0)) ) :code (behavior () @@ -765,11 +753,7 @@ (defstate die (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (roboguard-level-method-185 self (the-as symbol 0)) ) :code (behavior () 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 9c4db27a33..87e98e54df 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 @@ -3053,10 +3053,7 @@ ) (send-event *camera* 'teleport-to-transformq gp-0) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (remove-setting! 'minimap) (set! (-> *ACTOR-bank* birth-max) 1000) 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 2db49db634..07059da2de 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 @@ -809,10 +809,7 @@ (logior! (-> self focus-status) (focus-status dead)) (case arg0 (('melt 'grenade 'explode) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (case arg0 (('dark-eco-pool) @@ -936,10 +933,7 @@ ) 0 (ja-channel-set! 0) - (let ((s5-7 (current-time))) - (until (time-elapsed? s5-7 (seconds 1.8)) - (suspend) - ) + (suspend-for (seconds 1.8) ) ) (('endlessfall) @@ -969,10 +963,7 @@ ) ) ) - (let ((s5-9 (current-time))) - (until (time-elapsed? s5-9 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) ) (('bot) 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 6e6782df10..cd9e5e5ff2 100644 --- a/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc @@ -1746,10 +1746,7 @@ (suspend) (ja :num! (seek! (ja-aframe 32.0 0))) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) (set! (-> self root root-prim specific 0) (-> self root root-prim specific 1)) (setup-masks (-> self draw) 2 0) diff --git a/test/decompiler/reference/jak2/levels/city/ctywide-tasks_REF.gc b/test/decompiler/reference/jak2/levels/city/ctywide-tasks_REF.gc index 59c95c89f0..cb32053b68 100644 --- a/test/decompiler/reference/jak2/levels/city/ctywide-tasks_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctywide-tasks_REF.gc @@ -185,10 +185,7 @@ (talker-spawn-func (-> *talker-speech* 38) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self sound-id 0)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) @@ -240,10 +237,7 @@ (talker-spawn-func (-> *talker-speech* 31) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self sound-id 0)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) @@ -252,10 +246,7 @@ (talker-spawn-func (-> *talker-speech* 35) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self sound-id 0)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) @@ -277,10 +268,7 @@ ) (wait-for-speech-end (-> self sound-id 0)) (set! (-> self sub-state) (the-as uint 2)) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (go-virtual complete) (none) @@ -358,10 +346,7 @@ (talker-spawn-func (-> *talker-speech* 35) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self sound-id 0)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (set! (-> self sound-id 0) (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f)) @@ -376,10 +361,7 @@ (talker-spawn-func (-> *talker-speech* 37) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self sound-id 0)) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (go-virtual complete) (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 0978aea0aa..1a0b61e201 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 @@ -1095,10 +1095,7 @@ :to self ) (process-entity-status! self (entity-perm-status dead) #t) - (let ((frame (current-time))) - (until (time-elapsed? frame (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) ) ) 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 e7d07943d4..948c5f92fc 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 @@ -1955,10 +1955,7 @@ (-> gp-0 ppointer) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (go-virtual fall) ) @@ -2701,10 +2698,7 @@ ) :code (behavior ((arg0 symbol)) (ja-channel-set! 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (talker-spawn-func (-> *talker-speech* 145) *entity-pool* (target-pos 0) (the-as region #f)) (sleep-code) @@ -2799,10 +2793,7 @@ (when (and (task-node-closed? (game-task-node city-play-onin-game-resolution)) (not (task-node-closed? (game-task-node city-play-onin-game-skill))) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (script-eval '(birth-pickup ("pecker-npc-1" "head") skill FACT_SUPER_SKILL_INC flags (suck-in))) (task-node-close! (game-task-node city-play-onin-game-skill)) @@ -2825,10 +2816,7 @@ (while (nonzero? (get-status *gui-control* s5-1)) (suspend) ) - (let ((s5-3 (current-time))) - (until (time-elapsed? s5-3 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (set-blackout-frames (seconds 0.1)) (send-event (handle->process gp-4) 'complete) 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 66e82a03bf..a1ee113ead 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 @@ -1032,10 +1032,7 @@ 0 ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (cleanup-for-death self) ) @@ -1589,10 +1586,7 @@ (defstate die (ctyport-cargo) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (cleanup-for-death self) ) @@ -1999,10 +1993,7 @@ ) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) (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 ee2379276e..98d8022a85 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 @@ -406,17 +406,11 @@ ) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.6)) - (suspend) - ) + (suspend-for (seconds 0.6) ) (+! (-> self root trans y) -8192.0) (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) ) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) 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 f895c3a754..afed2ea0bf 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc @@ -712,10 +712,7 @@ (-> gp-0 ppointer) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.6)) - (suspend) - ) + (suspend-for (seconds 0.6) ) (+! (-> self root trans y) -8192.0) (enemy-method-129 self) @@ -734,10 +731,7 @@ ) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) ) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) 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 682ea04831..ec9ff8994b 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc @@ -515,10 +515,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) 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 fd6d9fbd9d..9a33906ff8 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 @@ -2261,10 +2261,7 @@ (suspend) ) (when (logtest? (-> self flags) 4) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (until (crimson-guard-level-method-194 self) (suspend) @@ -2844,22 +2841,20 @@ (suspend) (ja :num! (seek! (ja-aframe 12.0 0))) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (the int (* 900.0 (you-suck-scale *game-info* #f)))) - (ja-no-eval :group! crimson-guard-grenade-attack-ja - :num! (seek! (ja-aframe 12.0 0)) - :frame-num (ja-aframe 12.0 0) - ) - (until (ja-done? 0) - (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) - (suspend) - (ja :num! (seek! (ja-aframe 12.0 0))) - ) - (if (and (< (-> self target-self-xz-dist) 81920.0) (= (-> self focus aware) (enemy-aware enemy-aware-3))) - (go-hostile self) - ) + (suspend-for (the int (* 900.0 (you-suck-scale *game-info* #f))) + (ja-no-eval :group! crimson-guard-grenade-attack-ja + :num! (seek! (ja-aframe 12.0 0)) + :frame-num (ja-aframe 12.0 0) + ) + (until (ja-done? 0) + (seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02)) (suspend) + (ja :num! (seek! (ja-aframe 12.0 0))) ) + (empty-form) + (if (and (< (-> self target-self-xz-dist) 81920.0) (= (-> self focus aware) (enemy-aware enemy-aware-3))) + (go-hostile self) + ) ) (crimson-guard-level-method-192 self) (ja-no-eval :group! crimson-guard-grenade-attack-ja 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 beafef09be..e4f695984c 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 @@ -989,11 +989,7 @@ (defstate knocked (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) ) @@ -1051,10 +1047,7 @@ 0 (set! (-> self hit-points) 0) (do-effect (-> self skel effect) 'death-default 0.0 -1) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (cleanup-for-death self) @@ -1066,11 +1059,7 @@ (defstate flying-death (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 (let ((t9-3 (method-of-type part-tracker activate))) @@ -1128,11 +1117,7 @@ (defstate flying-death-explode (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (sound-play "hover-explode") (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-1 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 92b9fe9a2e..49b94de027 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 @@ -215,20 +215,14 @@ (('wait) ) ) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 (-> gp-0 s5-0 time)) - (suspend) - ) + (suspend-for (-> gp-0 s5-0 time) ) (while (< (-> gp-0 s5-0 alive-count) (-> self alive-count)) (suspend) ) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (go-virtual die) ) 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 101bb5ea71..3da9d22f1c 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 @@ -1111,10 +1111,7 @@ 0 (set! (-> self hit-points) 0) (do-effect (-> self skel effect) 'death-default 0.0 -1) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (cleanup-for-death self) 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 b5b7f2e4f2..119fb94d8a 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc @@ -1142,13 +1142,10 @@ (set! (-> self fire-info 0 quad) (-> s3-0 quad)) (set! (-> self fire-info 1 quad) (-> s2-1 quad)) ) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 0.2)) - (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) - (ja :num! (loop!)) - (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) - (suspend) - ) + (suspend-for (seconds 0.2) + (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) + (ja :num! (loop!)) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) ) (let ((f28-1 (+ 12288.0 f28-0))) (set! (-> gp-0 quad) (-> s5-0 quad)) 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 837e4ab50b..ec99d77fcb 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 @@ -110,11 +110,7 @@ (defstate dormant (com-elevator) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (process-entity-status! self (entity-perm-status subtask-complete) #t) ) ) @@ -145,10 +141,7 @@ (remove-setting! 'allow-look-around) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (sound-play "com-elevator-s") (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) @@ -310,10 +303,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) (until #f 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 c21a2530d6..988526aca1 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 @@ -880,10 +880,7 @@ (gun-buoy-method-183 self a1-1) ) ) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.75)) - (suspend) - ) + (suspend-for (seconds 0.75) ) ) (go-virtual hostile) @@ -911,10 +908,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (go-virtual exit-ambush) ) 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 9ef9220332..d559fa7d10 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc @@ -920,10 +920,7 @@ ) (suspend) (ja-channel-set! 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (while (-> self child) 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 20a6fdf7a1..75a116ae51 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 @@ -328,10 +328,7 @@ :code (behavior () (until #f (ja :num-func num-func-identity :frame-num (ja-aframe 0.0 0)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 2.0 0)) :frame-num (ja-aframe 0.0 0)) (until (ja-done? 0) @@ -339,10 +336,7 @@ (ja :num! (seek! (ja-aframe 2.0 0))) ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 196) 600 #f #f self 5 :to self) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 4.0 0)) :frame-num (ja-aframe 2.0 0)) (until (ja-done? 0) @@ -350,10 +344,7 @@ (ja :num! (seek! (ja-aframe 4.0 0))) ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 195) 300 #f #f self 7 :to self) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 6.0 0)) :frame-num (ja-aframe 4.0 0)) (until (ja-done? 0) @@ -361,16 +352,10 @@ (ja :num! (seek! (ja-aframe 6.0 0))) ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 194) 300 #f #f self 9 :to self) - (let ((gp-13 (current-time))) - (until (time-elapsed? gp-13 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 197) 300 #f #f self 10 :to self) - (let ((gp-15 (current-time))) - (until (time-elapsed? gp-15 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) ) #f 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 0768231e80..773894464c 100644 --- a/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc @@ -736,10 +736,7 @@ (set-blackout-frames (seconds 0.05)) ) (start 'play arg0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while (and *target* (and (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) (not (logtest? (focus-status teleporting) (-> *target* focus-status))) 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 2bff1bcc3f..db3ad1eb94 100644 --- a/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc @@ -651,66 +651,42 @@ ) (cond ((zero? (scf-get-territory)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.38)) - (suspend) - ) + (suspend-for (seconds 0.38) ) (set! (-> self sprite-draw) (the-as uint 3)) (set-vector! (-> self sprite-pos) -512.0 40.0 0.0 1.0) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.25)) - (set! (-> self sprite-pos x) - (lerp-scale -512.0 0.0 (sin (* 218.45334 (the float (- (current-time) gp-4)))) 0.0 1.0) - ) - (suspend) - ) + (suspend-for (seconds 0.25) + (set! (-> self sprite-pos x) + (lerp-scale -512.0 0.0 (sin (* 218.45334 (the float (- (current-time) time)))) 0.0 1.0) + ) ) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 0.25)) - (set! (-> self sprite-pos x) - (lerp-scale 0.0 512.0 (sin (* 218.45334 (the float (- (current-time) gp-6)))) 0.0 1.0) - ) - (suspend) - ) + (suspend-for (seconds 0.25) + (set! (-> self sprite-pos x) + (lerp-scale 0.0 512.0 (sin (* 218.45334 (the float (- (current-time) time)))) 0.0 1.0) + ) ) (set! (-> self sprite-draw) (the-as uint 1)) (set-vector! (-> self sprite-pos) 30.0 -240.0 0.0 1.0) - (let ((gp-7 (current-time))) - (until (time-elapsed? gp-7 (seconds 0.25)) - (set! (-> self sprite-pos y) - (lerp-scale -240.0 270.0 (sin (* 218.45334 (the float (- (current-time) gp-7)))) 0.0 1.0) - ) - (suspend) - ) + (suspend-for (seconds 0.25) + (set! (-> self sprite-pos y) + (lerp-scale -240.0 270.0 (sin (* 218.45334 (the float (- (current-time) time)))) 0.0 1.0) + ) ) - (let ((gp-8 (current-time))) - (until (time-elapsed? gp-8 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 0.25)) - (set! (-> self sprite-pos y) - (lerp-scale 270.0 720.0 (sin (* 218.45334 (the float (- (current-time) gp-9)))) 0.0 1.0) - ) - (suspend) - ) + (suspend-for (seconds 0.25) + (set! (-> self sprite-pos y) + (lerp-scale 270.0 720.0 (sin (* 218.45334 (the float (- (current-time) time)))) 0.0 1.0) + ) ) (set! (-> self sprite-draw) (the-as uint 2)) (set-vector! (-> self sprite-pos) 20.0 40.0 0.0 1.0) - (let ((gp-10 (current-time))) - (until (time-elapsed? gp-10 (seconds 0.25)) - (set! (-> self sprite-pos y) - (lerp-scale 720.0 20.0 (sin (* 218.45334 (the float (- (current-time) gp-10)))) 0.0 1.0) - ) - (suspend) - ) + (suspend-for (seconds 0.25) + (set! (-> self sprite-pos y) + (lerp-scale 720.0 20.0 (sin (* 218.45334 (the float (- (current-time) time)))) 0.0 1.0) + ) ) (let ((a1-21 (new 'stack-no-clear 'array 'symbol 6))) (set! (-> a1-21 5) #f) @@ -721,72 +697,36 @@ (set! (-> a1-21 0) 'demo) (want-levels *load-state* a1-21) ) - (let ((gp-11 (current-time))) - (until (time-elapsed? gp-11 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) - (let ((gp-12 (current-time))) - (until (time-elapsed? gp-12 (seconds 0.25)) - (set! (-> self sprite-pos y) - (lerp-scale 20.0 -720.0 (sin (* 218.45334 (the float (- (current-time) gp-12)))) 0.0 1.0) - ) - (suspend) - ) + (suspend-for (seconds 0.25) + (set! (-> self sprite-pos y) + (lerp-scale 20.0 -720.0 (sin (* 218.45334 (the float (- (current-time) time)))) 0.0 1.0) + ) ) ) (else - (let ((gp-13 (current-time))) - (until (time-elapsed? gp-13 (seconds 0.38)) - (suspend) - ) + (suspend-for (seconds 0.38) ) - (let ((gp-14 (current-time))) - (until (time-elapsed? gp-14 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) - (let ((gp-15 (current-time))) - (until (time-elapsed? gp-15 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) - (let ((gp-16 (current-time))) - (until (time-elapsed? gp-16 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) - (let ((gp-17 (current-time))) - (until (time-elapsed? gp-17 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) - (let ((gp-18 (current-time))) - (until (time-elapsed? gp-18 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) - (let ((gp-19 (current-time))) - (until (time-elapsed? gp-19 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) - (let ((gp-20 (current-time))) - (until (time-elapsed? gp-20 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) - (let ((gp-21 (current-time))) - (until (time-elapsed? gp-21 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) ) ) - (let ((gp-22 (current-time))) - (until (time-elapsed? gp-22 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (demo-screen-change -1 -1 #f #t) (set! (-> *game-info* demo-state) (the-as uint 1)) 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 a9ecce2a61..f1dd062b81 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc @@ -505,10 +505,7 @@ (ja :num! (seek! max f30-0)) ) (ja-no-eval :group! dig-bomb-crate-cylinder-idle-ja :num! (seek!) :frame-num 0.0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (ja-no-eval :group! dig-bomb-crate-cylinder-pulse-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -516,10 +513,7 @@ (ja :num! (seek! max f30-0)) ) (ja-no-eval :group! dig-bomb-crate-cylinder-idle-ja :num! (seek!) :frame-num 0.0) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (ja-no-eval :group! dig-bomb-crate-cylinder-pulse-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -528,10 +522,7 @@ ) ) (ja-no-eval :group! dig-bomb-crate-cylinder-idle-ja :num! (seek!) :frame-num 0.0) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (ja-no-eval :group! dig-bomb-crate-cylinder-pulse-ja :num! (seek! max 0.375) :frame-num 0.0) (until (ja-done? 0) @@ -539,10 +530,7 @@ (ja :num! (seek! max 0.375)) ) (ja-no-eval :group! dig-bomb-crate-cylinder-idle-ja :num! (seek!) :frame-num 0.0) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (ja-no-eval :group! dig-bomb-crate-cylinder-pulse-ja :num! (seek! max 0.4375) :frame-num 0.0) (until (ja-done? 0) @@ -550,10 +538,7 @@ (ja :num! (seek! max 0.4375)) ) (ja-no-eval :group! dig-bomb-crate-cylinder-idle-ja :num! (seek!) :frame-num 0.0) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 0.125)) - (suspend) - ) + (suspend-for (seconds 0.125) ) (dotimes (gp-6 12) (ja-no-eval :group! dig-bomb-crate-cylinder-pulse-ja :num! (seek! max 0.437) :frame-num 0.0) @@ -562,10 +547,7 @@ (ja :num! (seek! max 0.437)) ) (ja-no-eval :group! dig-bomb-crate-cylinder-idle-ja :num! (seek!) :frame-num 0.0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.05)) - (suspend) - ) + (suspend-for (seconds 0.05) ) ) (go-virtual die) @@ -977,10 +959,7 @@ ) ) (suspend) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 4)) - (suspend) - ) + (suspend-for (seconds 4) ) (cleanup-for-death self) ) 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 dd74b034db..f398e34e65 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc @@ -285,42 +285,28 @@ :virtual #t :trans rider-trans :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (the int (-> self cycle-offset))) - (suspend) - ) + (suspend-for (the int (-> self cycle-offset)) ) (until #f - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (the int (-> self cycle-time))) - (suspend) - ) + (suspend-for (the int (-> self cycle-time)) ) (activate! (-> self smush) -1.0 60 225 1.0 1.0 (-> self clock)) (sound-play "spikey-shake" :position (-> self root trans)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.75)) - (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush)))) - (suspend) - ) + (suspend-for (seconds 0.75) + (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush)))) ) (set! (-> self shudder-angle) 0.0) (set-zero! (-> self smush)) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (sound-play "spikey-turn" :position (-> self root trans)) (let* ((f0-7 1.0) (f30-1 (* 65536.0 f0-7)) - (gp-6 (current-time)) ) - (until (time-elapsed? gp-6 (seconds 1)) + (suspend-for (seconds 1) (set! (-> self rot-angle) (the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48)) ) - (suspend) ) ) (let ((v1-42 #x10000)) @@ -483,10 +469,7 @@ ) (sound-play "spikey-break") (suspend) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 4)) - (suspend) - ) + (suspend-for (seconds 4) ) (let ((t9-7 (-> (method-of-type projectile-bounce die) code))) (if t9-7 @@ -745,10 +728,7 @@ :virtual #t :code (behavior () (sound-play "spikey-door") - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (let ((gp-2 (new 'stack-no-clear 'vector)) (s5-1 (new 'static 'vector :x -16384.0 :y -16384.0)) 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 96ce9c50d5..8d87b512ae 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-obs2_REF.gc @@ -898,10 +898,7 @@ ) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (cleanup-for-death self) ) 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 8995b54faa..3d7f2d920d 100644 --- a/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc @@ -382,10 +382,7 @@ ) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (send-event *camera* 'change-target #f) (cleanup-for-death self) @@ -649,10 +646,7 @@ (lambda :behavior task-manager () (set-time! (-> self start-time)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (let ((s5-0 (entity-by-name "transport-level-1")) (gp-1 (entity-by-name "transport-level-2")) @@ -722,10 +716,7 @@ ) ) ) - (let ((s3-0 (current-time))) - (until (time-elapsed? s3-0 (seconds 15)) - (suspend) - ) + (suspend-for (seconds 15) ) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) (process->ppointer self)) @@ -760,10 +751,7 @@ ) ) (dotimes (s3-1 3) - (let ((s2-0 (current-time))) - (until (time-elapsed? s2-0 (seconds 10)) - (suspend) - ) + (suspend-for (seconds 10) ) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) (process->ppointer self)) @@ -797,10 +785,7 @@ ) ) ) - (let ((s2-1 (current-time))) - (until (time-elapsed? s2-1 (seconds 10)) - (suspend) - ) + (suspend-for (seconds 10) ) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-8 from) (process->ppointer self)) @@ -835,10 +820,7 @@ ) ) ) - (let ((s3-2 (current-time))) - (until (time-elapsed? s3-2 (seconds 10)) - (suspend) - ) + (suspend-for (seconds 10) ) (let ((a1-10 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-10 from) (process->ppointer self)) @@ -872,10 +854,7 @@ ) ) ) - (let ((s3-3 (current-time))) - (until (time-elapsed? s3-3 (seconds 10)) - (suspend) - ) + (suspend-for (seconds 10) ) (dotimes (s3-4 10) (let ((v1-114 s4-0)) @@ -886,10 +865,7 @@ (goto cfg-74) ) ) - (let ((s2-2 (current-time))) - (until (time-elapsed? s2-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) ) (label cfg-74) @@ -965,25 +941,16 @@ ) ) ) - (let ((s3-5 (current-time))) - (until (time-elapsed? s3-5 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) ) ) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (set-setting! 'entity-name "camera-260" 0.0 0) (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (process-grab? *target* #f) - (let ((s4-2 (current-time))) - (until (time-elapsed? s4-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (send-event (if s5-0 @@ -991,10 +958,7 @@ ) 'leave ) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (send-event (if gp-1 @@ -1003,18 +967,12 @@ 'leave ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (remove-setting! 'entity-name) (remove-setting! 'process-mask) (process-release? *target*) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (go-virtual complete) (while *target* 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 59e2e1fff8..99d747a551 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 @@ -66,18 +66,12 @@ :virtual #t :event (-> (method-of-type fort-elec-switch idle) event) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 16)) - (suspend) - ) + (suspend-for (seconds 16) ) (until (logtest? (-> self draw status) (draw-control-status on-screen)) (suspend) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.4)) - (suspend) - ) + (suspend-for (seconds 0.4) ) (talker-spawn-func (-> *talker-speech* 86) *entity-pool* (target-pos 0) (the-as region #f)) (sleep-code) @@ -156,10 +150,7 @@ ) ) (sound-play "elec-switch") - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (let ((v1-22 #t)) (when (-> self switch-group) @@ -192,10 +183,7 @@ ) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.75)) - (suspend) - ) + (suspend-for (seconds 0.75) ) (let ((a1-14 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-14 from) (process->ppointer self)) @@ -212,10 +200,7 @@ ) ) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 1.5)) - (suspend) - ) + (suspend-for (seconds 1.5) ) (remove-setting! 'entity-name) (remove-setting! 'process-mask) 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 4354599c59..b14c1c4845 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 @@ -150,10 +150,7 @@ ) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (cleanup-for-death self) ) @@ -392,10 +389,7 @@ (-> gp-2 ppointer) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event (ppointer->process (-> self parent)) 'died) (sleep-code) @@ -587,41 +581,26 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 8)) - (suspend) - ) + (suspend-for (seconds 8) ) (until (logtest? (-> self draw status) (draw-control-status on-screen)) (suspend) ) (when (= (-> self bomb-count) 4) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.4)) - (suspend) - ) + (suspend-for (seconds 0.4) ) (add-process *gui-control* self (gui-channel daxter) (gui-action play) "ds017" -99.0 0) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 20)) - (suspend) - ) + (suspend-for (seconds 20) ) (if (= (-> self bomb-count) 4) (add-process *gui-control* self (gui-channel daxter) (gui-action play) "ds018" -99.0 0) ) (while (> (-> self bomb-count) 0) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.8)) - (suspend) - ) + (suspend-for (seconds 0.8) ) (go-virtual missile-countdown) ) @@ -666,10 +645,7 @@ ) ) (set-fordumpc-light-flag! #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (while (not (process-grab? *target* #f)) (suspend) @@ -677,10 +653,7 @@ (set-setting! 'entity-name "camera-182" 0.0 0) (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (task-node-close! (game-task-node fortress-dump-missile)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.75)) - (suspend) - ) + (suspend-for (seconds 0.75) ) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) (process->ppointer self)) @@ -712,10 +685,7 @@ ) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1.5)) - (suspend) - ) + (suspend-for (seconds 1.5) ) (remove-setting! 'entity-name) (remove-setting! 'process-mask) @@ -739,20 +709,14 @@ (set! (-> *game-info* timer) 0) (set! (-> self hud) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.4)) - (suspend) - ) + (suspend-for (seconds 0.4) ) (set! (-> self explosion-sound-id) (add-process *gui-control* self (gui-channel background) (gui-action queue) "big-xplo" -99.0 0) ) (dotimes (gp-5 10) (set! (-> *game-info* timer) (the-as time-frame (- 3000 (the int (* 300.0 (the float gp-5)))))) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) ) (go-virtual die) @@ -790,10 +754,7 @@ (remove-setting! 'allow-progress) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.4)) - (suspend) - ) + (suspend-for (seconds 0.4) ) (logior! (-> self draw status) (draw-control-status no-draw)) (when *scene-player* @@ -952,10 +913,7 @@ (suspend) ) ) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 10)) - (suspend) - ) + (suspend-for (seconds 10) ) (cleanup-for-death self) ) 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 0ca2f15017..c8bd781860 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 @@ -289,12 +289,9 @@ (defstate die (fort-roboscreen) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (seek! (-> self transition) 0.0 (seconds-per-frame)) - (set-roboscreen-alpha! (-> self transition)) - (suspend) - ) + (suspend-for (seconds 1) + (seek! (-> self transition) 0.0 (seconds-per-frame)) + (set-roboscreen-alpha! (-> self transition)) ) ) ) @@ -1453,10 +1450,7 @@ (logior! (-> self flags) (robotank-turret-flags rotflags-3)) (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) (send-event (handle->process (-> self reticle)) 'lock) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (let ((gp-2 (max 2 (min 3 (rand-vu-int-range 0 3))))) 0 @@ -1483,11 +1477,8 @@ ) ) ) - (let ((f30-0 (rand-vu-float-range 0.05 0.43)) - (s4-2 (current-time)) - ) - (until (time-elapsed? s4-2 (the int (* 300.0 f30-0))) - (suspend) + (let ((f30-0 (rand-vu-float-range 0.05 0.43))) + (suspend-for (the int (* 300.0 f30-0)) ) ) ) @@ -1506,10 +1497,8 @@ 2.11 ) ) - (gp-3 (current-time)) ) - (until (time-elapsed? gp-3 (the int (* 300.0 f30-1))) - (suspend) + (suspend-for (the int (* 300.0 f30-1)) ) ) ) @@ -1524,10 +1513,7 @@ :code (behavior () (send-event (handle->process (-> self reticle)) 'die) (send-event (handle->process (-> self screen)) 'die) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while (-> self child) (suspend) 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 57d7168fc8..2dca4913b3 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 @@ -889,10 +889,7 @@ ) :code (behavior () (logclear! (-> self flags) (robotank-flags roflags-2)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (logior! (-> self flags) (robotank-flags roflags-2)) (sleep-code) @@ -1023,10 +1020,7 @@ (remove-setting! 'process-mask) (remove-setting! 'target-height) (send-event (handle->process (-> self turret)) 'die) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (while (-> self child) (suspend) 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 52210fd05a..c5e68ab322 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 @@ -362,10 +362,7 @@ () (until #f (sound-play "fortress-alarm") - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) ) #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 4e13026b48..f7d06a3326 100644 --- a/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc @@ -795,10 +795,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (until #f (let ((gp-2 7)) @@ -816,10 +813,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.33)) - (suspend) - ) + (suspend-for (seconds 0.33) ) (if (= gp-2 7) (set! gp-2 8) @@ -828,10 +822,7 @@ ) ) (set! (-> self flash-state) #f) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 1.5)) - (suspend) - ) + (suspend-for (seconds 1.5) ) ) #f @@ -983,18 +974,12 @@ (sound-play "turret-explode") (suspend) (ja-channel-set! 0) - (let ((gp-2 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node fort-turret-lod0-jg headrotate))) - (s5-2 (current-time)) - ) - (until (time-elapsed? s5-2 (seconds 2)) + (let ((gp-2 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node fort-turret-lod0-jg headrotate)))) + (suspend-for (seconds 2) (spawn (-> self part) gp-2) - (suspend) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (while (-> self child) 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 f37bd1ab21..0d83f19545 100644 --- a/test/decompiler/reference/jak2/levels/fortress/fortress-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/fortress-obs_REF.gc @@ -140,10 +140,7 @@ ) (suspend) (ja-channel-set! 0) - (let ((frame-counter (current-time))) - (until (time-elapsed? frame-counter (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (while (-> self child) 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 96f2046f2c..fceb62d45e 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 @@ -278,19 +278,13 @@ (let ((a0-0 *target*)) (when (and a0-0 (< 81920.0 (vector-vector-distance (get-trans a0-0 0) (-> self root trans)))) (set! (-> self quality-enabled?) #f) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (hide-hud-quick #f) (set-setting! 'entity-name "camera-243" 0.0 0) (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (process-grab? *target* #f) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) ) @@ -385,10 +379,7 @@ ) :code (behavior () (until (-> self all-gone?) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) ) (set-setting! 'interp-time 'abs 0.0 0) 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 6510189e83..d3cf898bd3 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc @@ -1891,10 +1891,7 @@ t1-0 ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (auto-save-user) ) @@ -2369,11 +2366,8 @@ ) :code (behavior () (sound-play "gungame-door") - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.2)) - (suspend) - (suspend) - ) + (suspend-for (seconds 0.2) + (suspend) ) (ja-no-eval :group! fort-entry-gate-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) 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 82746da2c0..84f7ecc603 100644 --- a/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc @@ -348,11 +348,8 @@ (-> s5-0 ppointer) ) ) - (let ((s5-1 (the int (* 300.0 (rand-vu-float-range 0.03 0.08)))) - (s4-0 (current-time)) - ) - (until (time-elapsed? s4-0 s5-1) - (suspend) + (let ((s5-1 (the int (* 300.0 (rand-vu-float-range 0.03 0.08))))) + (suspend-for s5-1 ) ) ) diff --git a/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc b/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc index 8c38a5d0ec..bde33466fe 100644 --- a/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc @@ -2312,13 +2312,10 @@ (lambda :behavior scene-player () (talker-spawn-func (-> *talker-speech* 123) self (target-pos 0) (the-as region #f)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 5)) - (if (cpad-pressed? 0 square) - (return #f) - ) - (suspend) - ) + (suspend-for (seconds 5) + (if (cpad-pressed? 0 square) + (return #f) + ) ) #f ) @@ -2376,43 +2373,40 @@ (set! (-> gp-0 scale-x) 1.0) (set! (-> gp-0 scale-y) 1.0) (when (and s5-0 (-> gp-0 tex)) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 (seconds 5)) - (let ((f0-2 1.0)) - (cond - ((< f30-0 2.0) - (set! f0-2 (* 0.5 f30-0)) - ) - ((< 3.0 f30-0) - (set! f0-2 (* 0.5 (- 5.0 f30-0))) - ) - ) - (set! (-> gp-0 color w) (the int (* 128.0 f0-2))) + (suspend-for (seconds 5) + (let ((f0-2 1.0)) + (cond + ((< f30-0 2.0) + (set! f0-2 (* 0.5 f30-0)) + ) + ((< 3.0 f30-0) + (set! f0-2 (* 0.5 (- 5.0 f30-0))) + ) ) - (let* ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf)) - (s3-0 (-> s2-0 base)) - ) - (draw gp-0 s2-0 s5-0) - (let ((a3-0 (-> s2-0 base))) - (let ((v1-31 (the-as object (-> s2-0 base)))) - (set! (-> (the-as dma-packet v1-31) dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> (the-as dma-packet v1-31) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-31) vif1) (new 'static 'vif-tag)) - (set! (-> s2-0 base) (&+ (the-as pointer v1-31) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) bucket-group) - (bucket-id subtitle) - s3-0 - (the-as (pointer dma-tag) a3-0) - ) - ) - ) - (if (not (paused?)) - (+! f30-0 (seconds-per-frame)) - ) - (suspend) + (set! (-> gp-0 color w) (the int (* 128.0 f0-2))) ) + (let* ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s3-0 (-> s2-0 base)) + ) + (draw gp-0 s2-0 s5-0) + (let ((a3-0 (-> s2-0 base))) + (let ((v1-31 (the-as object (-> s2-0 base)))) + (set! (-> (the-as dma-packet v1-31) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-31) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-31) vif1) (new 'static 'vif-tag)) + (set! (-> s2-0 base) (&+ (the-as pointer v1-31) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id subtitle) + s3-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + (if (not (paused?)) + (+! f30-0 (seconds-per-frame)) + ) ) #f ) @@ -2499,47 +2493,44 @@ ) ) (when (and s4-0 (-> gp-0 tex)) - (let ((s3-0 (current-time))) - (until (time-elapsed? s3-0 (seconds 8)) - (let ((f0-6 1.0)) - (cond - ((< f30-0 2.0) - (set! f0-6 (* 0.5 f30-0)) - ) - ((< 6.0 f30-0) - (set! f0-6 (* 0.5 (- 8.0 f30-0))) - ) - ) - (set! (-> gp-0 color w) (the int (* 128.0 f0-6))) - (set! (-> s5-0 color w) (the int (* 128.0 f0-6))) + (suspend-for (seconds 8) + (let ((f0-6 1.0)) + (cond + ((< f30-0 2.0) + (set! f0-6 (* 0.5 f30-0)) + ) + ((< 6.0 f30-0) + (set! f0-6 (* 0.5 (- 8.0 f30-0))) + ) ) - (let* ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf)) - (s2-0 (-> s1-0 base)) - ) - (draw gp-0 s1-0 s4-0) - (if (-> s5-0 tex) - (draw s5-0 s1-0 s4-0) - ) - (let ((a3-0 (-> s1-0 base))) - (let ((v1-59 (the-as object (-> s1-0 base)))) - (set! (-> (the-as dma-packet v1-59) dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> (the-as dma-packet v1-59) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-59) vif1) (new 'static 'vif-tag)) - (set! (-> s1-0 base) (&+ (the-as pointer v1-59) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) bucket-group) - (bucket-id subtitle) - s2-0 - (the-as (pointer dma-tag) a3-0) - ) - ) - ) - (if (not (paused?)) - (+! f30-0 (seconds-per-frame)) - ) - (suspend) + (set! (-> gp-0 color w) (the int (* 128.0 f0-6))) + (set! (-> s5-0 color w) (the int (* 128.0 f0-6))) ) + (let* ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-0 (-> s1-0 base)) + ) + (draw gp-0 s1-0 s4-0) + (if (-> s5-0 tex) + (draw s5-0 s1-0 s4-0) + ) + (let ((a3-0 (-> s1-0 base))) + (let ((v1-59 (the-as object (-> s1-0 base)))) + (set! (-> (the-as dma-packet v1-59) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-59) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-59) vif1) (new 'static 'vif-tag)) + (set! (-> s1-0 base) (&+ (the-as pointer v1-59) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id subtitle) + s2-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + (if (not (paused?)) + (+! f30-0 (seconds-per-frame)) + ) ) #f ) 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 d70d801b2a..ca4520ee32 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc @@ -2038,20 +2038,14 @@ (suspend) ) (set-setting! 'entity-name "camera-259" 0.0 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (until (process-release? *target*) (suspend) 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 2176e0c748..84d2eb72ac 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 @@ -15,16 +15,10 @@ (set! (-> a1-0 message) 'test-pickup) (set! (-> a1-0 param 0) (the-as uint 7)) (let ((f30-0 (send-event-function *target* a1-0))) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (send-event *target* 'change-mode 'darkjak #f (darkjak-stage no-anim)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (send-event *target* 'get-pickup (pickup-type eco-pill-dark) f30-0) ) diff --git a/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc b/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc index 6935dfc33e..7e3488da4d 100644 --- a/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc @@ -568,16 +568,10 @@ ) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.6)) - (suspend) - ) + (suspend-for (seconds 0.6) ) (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) ) (logclear! (-> self draw status) (draw-control-status no-draw)) (if (rnd-percent? self 0.5) @@ -684,13 +678,10 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (if (logtest? (-> self root status) (collide-status on-ground)) - (goto cfg-32) - ) - (suspend) - ) + (suspend-for (seconds 1) + (if (logtest? (-> self root status) (collide-status on-ground)) + (goto cfg-32) + ) ) (label cfg-32) (go-virtual hostile) 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 fca3252915..da75a91f2b 100644 --- a/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc @@ -105,21 +105,15 @@ (set! (-> self root trans y) (+ (-> self y-start) (-> self y-delta))) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (seek! (-> self y-rot-rate) 0.0 (* 4000.0 (seconds-per-frame))) - (quaternion-rotate-y! - (-> self root quat) - (-> self root quat) - (* 182.04445 (seconds-per-frame) (-> self y-rot-rate)) - ) - (suspend) + (suspend-for (seconds 1) + (seek! (-> self y-rot-rate) 0.0 (* 4000.0 (seconds-per-frame))) + (quaternion-rotate-y! + (-> self root quat) + (-> self root quat) + (* 182.04445 (seconds-per-frame) (-> self y-rot-rate)) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (remove-setting! 'entity-name) (remove-setting! 'process-mask) @@ -238,10 +232,7 @@ :virtual #t :trans rider-trans :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while (< (-> self y-offset) 16384.0) (seek! (-> self y-offset) 16384.0 (* 8192.0 (seconds-per-frame))) 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 c39c692e47..9e3c0ef71d 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc @@ -803,51 +803,42 @@ ) (update-collision! self) (sound-play "sew-gun-lock") - (let ((frame-counter (current-time))) - (until (time-elapsed? frame-counter (seconds 0.75)) - (aim-turret! self #t) - (suspend) - ) + (suspend-for (seconds 0.75) + (aim-turret! self #t) ) (ja :group! (-> self draw art-group data (-> self params shoot-anim))) (let ((frames 0) (fire-sound? #t) ) (sound-play "gturret") - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.125)) - (cond - ((not (-> self can-shoot)) - ) - ((time-elapsed? (the-as time-frame frames) (seconds 0.05)) - (fire-turret! self fire-sound?) - (set! frames (the-as int (current-time))) - (set! fire-sound? (not fire-sound?)) - ) - (else - (set! (-> self flash-state) #f) - ) + (suspend-for (seconds 0.125) + (cond + ((not (-> self can-shoot)) + ) + ((time-elapsed? (the-as time-frame frames) (seconds 0.05)) + (fire-turret! self fire-sound?) + (set! frames (the-as int (current-time))) + (set! fire-sound? (not fire-sound?)) + ) + (else + (set! (-> self flash-state) #f) ) - (ja :num! (loop!)) - (suspend) ) + (ja :num! (loop!)) ) ) (set! (-> self flash-state) #f) (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data (-> self params idle-anim))) - (let ((_frame-counter (current-time))) - (until (time-elapsed? _frame-counter (seconds 0.5)) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 0))) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 1))) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 2))) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 3))) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 4))) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 5))) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 6))) - (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 7))) - (suspend) - ) + (suspend-for (seconds 0.5) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 0))) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 1))) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 2))) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 3))) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 4))) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 5))) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 6))) + (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 7))) ) ) #f @@ -938,17 +929,11 @@ (let ((vec (new 'stack-no-clear 'vector))) (set! (-> vec quad) (-> self root trans quad)) (+! (-> vec y) 10240.0) - (let ((frame-counter (current-time))) - (until (time-elapsed? frame-counter (seconds 2)) - (spawn (-> self part) vec) - (suspend) - ) + (suspend-for (seconds 2) + (spawn (-> self part) vec) ) ) - (let ((_frame-counter (current-time))) - (until (time-elapsed? _frame-counter (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (while (-> self child) 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 d3f3707d00..e6098c9305 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc @@ -1000,10 +1000,7 @@ ) ) (cleanup-for-death self) - (let ((frame-counter (current-time))) - (until (time-elapsed? frame-counter (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) ) 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 174dfd17f6..d091e42374 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 @@ -384,10 +384,7 @@ (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #t) (set! (-> self last-sound-id) @@ -425,10 +422,7 @@ (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #t) (set! (-> self last-sound-id) @@ -499,10 +493,7 @@ (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei013" -99.0 0) @@ -565,10 +556,7 @@ (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #t) (set! (-> self last-sound-id) @@ -606,10 +594,7 @@ (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #t) (set! (-> self last-sound-id) @@ -644,10 +629,7 @@ (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #t) (set! (-> self last-sound-id) @@ -1131,10 +1113,7 @@ t1-3 ) ) - (let ((s5-2 (current-time))) - (until (time-elapsed? s5-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event (handle->process gp-3) 'die) ) @@ -1337,10 +1316,7 @@ t1-3 ) ) - (let ((s5-2 (current-time))) - (until (time-elapsed? s5-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event (handle->process gp-2) 'die) ) 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 5007ab614d..303fb29e69 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc @@ -955,10 +955,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1.2)) - (suspend) - ) + (suspend-for (seconds 1.2) ) (rigid-body-object-method-39 self) (sleep-code) @@ -1638,10 +1635,7 @@ ) ) (set! (-> self rift-rider-actor) (entity-actor-lookup (-> self entity) 'alt-actor 0)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.31)) - (suspend) - ) + (suspend-for (seconds 0.31) ) ) (ja-no-eval :group! (-> self draw art-group data (-> self stand-anim)) :num! (seek!) :frame-num 0.0) @@ -2067,10 +2061,7 @@ ) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (send-event *camera* 'change-target #f) (cleanup-for-death self) 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 e574eead32..32435c5a59 100644 --- a/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc @@ -588,10 +588,7 @@ ;; WARN: Return type mismatch int vs none. (defun title-fade-out ((arg0 float)) (setup *screen-filter* (new 'static 'vector) (new 'static 'vector :w 128.0) arg0 (bucket-id screen-filter)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.4)) - (suspend) - ) + (suspend-for (seconds 0.4) ) (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) (set! (-> *setting-control* user-current bg-a) 0.0) 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 9d4fd1bf81..3e409150fb 100644 --- a/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc @@ -1298,10 +1298,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (move-to-point! (-> self control) s4-1) ) 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 2a5d06e90c..dc365ff0d7 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc @@ -779,10 +779,7 @@ (-> gp-1 ppointer) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) :post nav-enemy-simple-post 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 162bfe7405..be62ea8612 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc @@ -110,10 +110,7 @@ ) ) :code (behavior ((arg0 time-frame)) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 arg0) - (suspend) - ) + (suspend-for arg0 ) (ja-no-eval :group! tomb-door-open-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -1051,10 +1048,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (go-virtual show-sequence) ) @@ -1517,16 +1511,10 @@ :virtual #t :code (behavior () (set! (-> self move-rate) (* 4096.0 (rand-vu-float-range 0.5 1.5))) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (logclear! (-> self root root-prim prim-core action) (collide-action rideable)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (cleanup-for-death self) ) @@ -1976,10 +1964,7 @@ ) ) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.45)) - (suspend) - ) + (suspend-for (seconds 0.45) ) ) #f @@ -2120,10 +2105,7 @@ 0 ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (persist-with-delay *setting-control* @@ -2134,10 +2116,7 @@ 0.0 (+ (-> self pat-tbl (-> self pat-index)) 18) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (process-grab? *target* #f) (let ((gp-2 (current-time)) @@ -2456,10 +2435,8 @@ :code (behavior () (until #f (set! (-> self can-exit-running?) #f) - (let ((gp-0 0) - (s5-0 (current-time)) - ) - (until (time-elapsed? s5-0 (-> self on-duration)) + (let ((gp-0 0)) + (suspend-for (-> self on-duration) (when (< (-> self harmless-time) (current-time)) (tomb-water-trap-method-22 self) (dotimes (s4-0 (+ (-> self path curve num-cverts) -1)) @@ -2497,29 +2474,19 @@ (+! gp-0 1) ) ) - (suspend) ) ) (set! (-> self can-exit-running?) #t) (let ((gp-1 90)) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 gp-1) - (suspend) - ) + (suspend-for gp-1 ) - (let ((s5-2 #f) - (s4-2 (current-time)) - ) - (until (time-elapsed? - s4-2 - (the-as time-frame (- (- (-> self sync period) (the-as uint (-> self on-duration))) (the-as uint gp-1))) - ) - (when (and (not s5-2) (time-elapsed? s4-2 (seconds 0.3))) + (let ((s5-2 #f)) + (suspend-for (the-as time-frame (- (- (-> self sync period) (the-as uint (-> self on-duration))) (the-as uint gp-1))) + (when (and (not s5-2) (time-elapsed? time (seconds 0.3))) (set! s5-2 #t) (set-tombc-electricity-scale! 0.0) ) (seek! (-> self volume) 0.0 (* 2.0 (seconds-per-frame))) - (suspend) ) ) ) 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 8b365f37af..0aad05ccdf 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 @@ -556,10 +556,7 @@ ) (suspend) (ja-channel-set! 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (while (-> self child) diff --git a/test/decompiler/reference/jak3/decompiler-macros.gc b/test/decompiler/reference/jak3/decompiler-macros.gc index 1792400728..6fc7f55c9e 100644 --- a/test/decompiler/reference/jak3/decompiler-macros.gc +++ b/test/decompiler/reference/jak3/decompiler-macros.gc @@ -263,6 +263,13 @@ ) ) +(defmacro call-parent-state-handler (handler &key (type (function none)) &rest args) + "Call the parent handler for this state." + `(let ((handler (-> (find-parent-state) ,handler))) + (if handler ((the ,type handler) ,@args)) + ) + ) + (defmacro call-parent-method (&rest args) "Find the first different implementation of the current method in a parent type and call it with these arguments." `((the (current-method-function-type) (find-parent-method (current-method-type) (current-method-id))) @@ -945,6 +952,9 @@ `(set! ,time (current-time)) ) +(defmacro suspend-for (time &rest body) + `(let ((time (current-time))) (until (time-elapsed? time ,time) ,@body (suspend)))) + (defconstant *scratch-memory-top* (the pointer #x70004000)) (defconstant DPROCESS_STACK_SIZE #x8000) diff --git a/test/decompiler/reference/jak3/engine/ambient/ambient_REF.gc b/test/decompiler/reference/jak3/engine/ambient/ambient_REF.gc index f469836472..7183886514 100644 --- a/test/decompiler/reference/jak3/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/jak3/engine/ambient/ambient_REF.gc @@ -399,10 +399,7 @@ (defstate idle (talker) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (the-as time-frame (-> self message delay))) - (suspend) - ) + (suspend-for (the-as time-frame (-> self message delay)) ) (while (or (not (time-elapsed? (-> self start-time) (the-as time-frame (+ (-> self message delay) 300)))) (and (logtest? (-> self message flags) (talker-flags tf8)) @@ -585,10 +582,7 @@ ) ) (when (and (logtest? (-> self message flags) (talker-flags tf3)) (not (-> self save?))) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (set! (-> self save?) #t) (auto-save-user) diff --git a/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc index 7e1ca3a4a4..3a91e18c44 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc @@ -1356,11 +1356,7 @@ (if (not (logtest? (-> self fact options) (actor-option no-reaction))) (send-event (handle->process arg1) 'powerup (-> self fact pickup-type) (-> self fact pickup-amount)) ) - (let ((t9-2 (-> (find-parent-state) code))) - (if t9-2 - ((the-as (function none) t9-2)) - ) - ) + (call-parent-state-handler code) ) ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc index 191d10ac8a..144334993a 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc @@ -988,10 +988,7 @@ ) ) (when (not arg0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.04)) - (suspend) - ) + (suspend-for (seconds 0.04) ) (case (-> self look) (('iron) @@ -1084,16 +1081,10 @@ (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) arg1 #t) (process-entity-status! self (entity-perm-status dead) #t) (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) (when (logtest? (actor-option cond-respawn) (-> self fact options)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 15)) - (suspend) - ) + (suspend-for (seconds 15) ) (go-virtual hide) ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc index eba5b3c241..207cfc96ea 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc @@ -678,10 +678,7 @@ :code (behavior () (cond ((handle->process (-> self ragdoll-proc)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (until (ragdoll-settled? self) (if (or (time-elapsed? (-> self state-time) (seconds 4)) (enemy-method-109 self)) @@ -992,18 +989,12 @@ :code (behavior () (cond ((handle->process (-> self ragdoll-proc)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (if (-> self skel effect) (do-effect (-> self skel effect) "death-default" 0.0 -1) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.8)) - (suspend) - ) + (suspend-for (seconds 0.8) ) ) (else @@ -1088,18 +1079,12 @@ :code (behavior () (cond ((handle->process (-> self ragdoll-proc)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (if (-> self skel effect) (do-effect (-> self skel effect) "death-default" 0.0 -1) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (deactivate-ragdoll! self) ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc index bd12e0812b..a7b3bbb446 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc @@ -234,11 +234,8 @@ (swingpole-method-22 self) (suspend) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (swingpole-method-22 self) - (suspend) - ) + (suspend-for (seconds 0.5) + (swingpole-method-22 self) ) (go-virtual idle) ) @@ -4605,10 +4602,7 @@ (set-setting! 'mode-name 'cam-fixed 0.0 0) (set-setting! 'interp-time 'abs 450.0 0) (set-setting! 'entity-name (res-lump-struct (-> self entity) 'camera-name structure) 0.0 0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (-> self pause-time)) - (suspend) - ) + (suspend-for (-> self pause-time) ) (if (-> self blur) (set-setting! 'blur-a 'abs 0.5 0) @@ -4616,19 +4610,13 @@ (remove-setting! 'mode-name) (remove-setting! 'entity-name) (remove-setting! 'interp-time) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (while (not (process-release? *target*)) (suspend) ) (remove-setting! 'interp-time) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (remove-setting! 'blur-a) (process-entity-status! self (entity-perm-status no-kill) #f) diff --git a/test/decompiler/reference/jak3/engine/common-obs/powerups_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/powerups_REF.gc index 653a5c7adc..fa04de7863 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/powerups_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/powerups_REF.gc @@ -16,25 +16,22 @@ (let ((s1-1 (process->handle arg0)) (s2-1 (process->handle arg1)) ) - (let ((s0-0 (current-time))) - (until (time-elapsed? s0-0 (+ arg3 arg4)) - (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) - (if v1-8 - (deactivate self) - ) - ) - (let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) s0-0)) (the float arg3)) (the float arg4))))) - (a0-18 (process-drawable-pair-random-point! - (the-as process-drawable (-> s1-1 process 0)) - (the-as process-drawable (-> s2-1 process 0)) - (new-stack-vector0) - f0-1 - ) + (suspend-for (+ arg3 arg4) + (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) + (if v1-8 + (deactivate self) + ) + ) + (let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) time)) (the float arg3)) (the float arg4))))) + (a0-18 (process-drawable-pair-random-point! + (the-as process-drawable (-> s1-1 process 0)) + (the-as process-drawable (-> s2-1 process 0)) + (new-stack-vector0) + f0-1 ) - ) - (arg2 a0-18) - ) - (suspend) + ) + ) + (arg2 a0-18) ) ) (cond @@ -45,12 +42,9 @@ #f ) (else - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 arg5) - (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) - (arg2 a0-21) - ) - (suspend) + (suspend-for arg5 + (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) + (arg2 a0-21) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc index 0365032b62..7d74ee44dc 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc @@ -726,10 +726,7 @@ (set-blackout-frames (seconds 0.05)) ) (start 'play arg0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while (and *target* (and (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) (not (logtest? (focus-status teleporting) (-> *target* focus-status))) diff --git a/test/decompiler/reference/jak3/engine/game/game-info_REF.gc b/test/decompiler/reference/jak3/engine/game/game-info_REF.gc index ac7e7b1ca7..42b6cca4d0 100644 --- a/test/decompiler/reference/jak3/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-info_REF.gc @@ -1114,25 +1114,19 @@ (set! (-> v1-9 origin z) (the float (/ (-> s3-0 z) 16))) ) (set! (-> s5-0 flags) (font-flags shadow kerning large)) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (+ arg2 -75)) - (+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame))) - (let ((s2-0 print-game-text)) - (format (clear *temp-string*) "~4,,0f" arg1) - (s2-0 *temp-string* s5-0 #f 44 (bucket-id debug-no-zbuf1)) - ) - (suspend) + (suspend-for (+ arg2 -75) + (+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame))) + (let ((s2-0 print-game-text)) + (format (clear *temp-string*) "~4,,0f" arg1) + (s2-0 *temp-string* s5-0 #f 44 (bucket-id debug-no-zbuf1)) ) ) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.25)) - (set! (-> s5-0 alpha) (lerp-scale 1.0 0.0 (the float (- (current-time) s4-1)) 0.0 150.0)) - (+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame))) - (let ((s3-2 print-game-text)) - (format (clear *temp-string*) "~4,,0f" arg1) - (s3-2 *temp-string* s5-0 #f 44 (bucket-id debug-no-zbuf1)) - ) - (suspend) + (suspend-for (seconds 0.25) + (set! (-> s5-0 alpha) (lerp-scale 1.0 0.0 (the float (- (current-time) time)) 0.0 150.0)) + (+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame))) + (let ((s3-2 print-game-text)) + (format (clear *temp-string*) "~4,,0f" arg1) + (s3-2 *temp-string* s5-0 #f 44 (bucket-id debug-no-zbuf1)) ) ) ) @@ -1610,11 +1604,8 @@ process (lambda :behavior process ((arg0 string)) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 10)) - (format *stdcon* "~S~%" arg0) - (suspend) - ) + (suspend-for (seconds 10) + (format *stdcon* "~S~%" arg0) ) (none) ) @@ -2226,7 +2217,3 @@ ;; failed to figure out what this is: (kmemclose) - - - - diff --git a/test/decompiler/reference/jak3/engine/game/main_REF.gc b/test/decompiler/reference/jak3/engine/game/main_REF.gc index dc3cdea417..f7d18674ee 100644 --- a/test/decompiler/reference/jak3/engine/game/main_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/main_REF.gc @@ -475,10 +475,7 @@ (set! (-> *setting-control* user-default music-volume) 0.0) (set! (-> *setting-control* user-default dialog-volume) 0.0) (set! (-> *setting-control* user-default ambient-volume) 0.0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (kernel-shutdown arg0) (none) diff --git a/test/decompiler/reference/jak3/engine/game/task/task-control_REF.gc b/test/decompiler/reference/jak3/engine/game/task/task-control_REF.gc index 6535e93e3c..208f9163c9 100644 --- a/test/decompiler/reference/jak3/engine/game/task/task-control_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/task/task-control_REF.gc @@ -2622,16 +2622,13 @@ (process-release? *target*) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (let ((f30-0 (lerp-scale 1.0 0.0 (the float (- (current-time) gp-0)) 0.0 300.0))) - (set-filter-color! - (lerp-scale 1.0 1.25 f30-0 0.0 1.0) - (lerp-scale 1.0 0.875 f30-0 0.0 1.0) - (lerp-scale 1.0 0.25 f30-0 0.0 1.0) - ) + (suspend-for (seconds 1) + (let ((f30-0 (lerp-scale 1.0 0.0 (the float (- (current-time) time)) 0.0 300.0))) + (set-filter-color! + (lerp-scale 1.0 1.25 f30-0 0.0 1.0) + (lerp-scale 1.0 0.875 f30-0 0.0 1.0) + (lerp-scale 1.0 0.25 f30-0 0.0 1.0) ) - (suspend) ) ) (let ((gp-1 (if (-> self retry?) diff --git a/test/decompiler/reference/jak3/engine/process-drawable/process-taskable_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/process-taskable_REF.gc index 7e6f694f8c..440d4493a9 100644 --- a/test/decompiler/reference/jak3/engine/process-drawable/process-taskable_REF.gc +++ b/test/decompiler/reference/jak3/engine/process-drawable/process-taskable_REF.gc @@ -383,10 +383,7 @@ (if (-> self skel effect) (do-effect (-> self skel effect) "death-default" 0.0 -1) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (if (logtest? (-> self flags) (process-taskable-flags ptf5)) (restart-mission) @@ -402,10 +399,7 @@ :enter (-> (method-of-type process-taskable active) enter) :exit (-> (method-of-type process-taskable active) exit) :code (behavior ((arg0 game-task-event)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (go-virtual hide) ) diff --git a/test/decompiler/reference/jak3/engine/scene/scene_REF.gc b/test/decompiler/reference/jak3/engine/scene/scene_REF.gc index b11968a00d..0e0980d899 100644 --- a/test/decompiler/reference/jak3/engine/scene/scene_REF.gc +++ b/test/decompiler/reference/jak3/engine/scene/scene_REF.gc @@ -1370,10 +1370,7 @@ #x33001 #t ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.05)) - (suspend) - ) + (suspend-for (seconds 0.05) ) (set! (-> *setting-control* user-current bg-a) 0.0) (remove-setting! 'movie) diff --git a/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc index 6e37a7ad34..10bea89a44 100644 --- a/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc @@ -1461,10 +1461,7 @@ (set! (-> a1-3 0) 'empty0) (want-sound-banks *load-state* a1-3) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((a1-4 (new 'stack-no-clear 'array 'symbol 4))) (set! (-> a1-4 2) (-> gp-0 4)) diff --git a/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc b/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc index 7648b2bcaf..0878f5d2e9 100644 --- a/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc @@ -3432,10 +3432,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s3-2 (current-time))) - (until (time-elapsed? s3-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (move-to-point! (-> self control) s4-1) ) diff --git a/test/decompiler/reference/jak3/engine/target/flut/flut_REF.gc b/test/decompiler/reference/jak3/engine/target/flut/flut_REF.gc index 95d4e32942..b2b3665f87 100644 --- a/test/decompiler/reference/jak3/engine/target/flut/flut_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/flut/flut_REF.gc @@ -359,11 +359,8 @@ (ja-channel-set! 0) (ja-post) (when (not (and (-> self entity) (= (-> self entity extra process) self))) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.1)) - (spawn-part-and-sound! self) - (suspend) - ) + (suspend-for (seconds 0.1) + (spawn-part-and-sound! self) ) (deactivate self) ) @@ -381,11 +378,8 @@ (spawn-part-and-sound! self) (suspend) ) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 1)) - (spawn-part-and-sound! self) - (suspend) - ) + (suspend-for (seconds 1) + (spawn-part-and-sound! self) ) (go arg0) ) diff --git a/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc b/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc index 64e6b3cbaa..775de20fc4 100644 --- a/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc @@ -2827,10 +2827,7 @@ (let ((s3-2 (new-stack-vector0))) (set! (-> s3-2 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s2-0 (current-time))) - (until (time-elapsed? s2-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (move-to-point! (-> self control) s3-2) ) @@ -3015,33 +3012,30 @@ ) ) ) - (let ((s5-3 (current-time))) - (until (time-elapsed? s5-3 (seconds 1)) - (target-flut-falling-anim-trans) - (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) - (let ((v1-39 (new-stack-vector0)) - (f0-6 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - ) - 0.0 - (vector-! - v1-39 - (-> self control transv) - (vector-float*! v1-39 (-> self control dynam gravity-normal) (the-as float f0-6)) + (suspend-for (seconds 1) + (target-flut-falling-anim-trans) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) + (let ((v1-39 (new-stack-vector0)) + (f0-6 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) ) - (let* ((f1-7 (vector-length v1-39)) - (f2-2 f1-7) - ) - (if (< (the-as float (-> self control unknown-word04)) (the-as float f0-6)) - (set! f0-6 (-> self control unknown-word04)) - ) - (vector+! - (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f0-6)) - (vector-float*! v1-39 v1-39 (/ f1-7 f2-2)) + 0.0 + (vector-! + v1-39 + (-> self control transv) + (vector-float*! v1-39 (-> self control dynam gravity-normal) (the-as float f0-6)) + ) + (let* ((f1-7 (vector-length v1-39)) + (f2-2 f1-7) + ) + (if (< (the-as float (-> self control unknown-word04)) (the-as float f0-6)) + (set! f0-6 (-> self control unknown-word04)) ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f0-6)) + (vector-float*! v1-39 v1-39 (/ f1-7 f2-2)) ) ) - (suspend) ) ) (remove-setting! 'mode-name) @@ -3077,10 +3071,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((s5-8 (current-time))) - (until (time-elapsed? s5-8 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) (('lava 'melt 'fry 'slime) @@ -3103,10 +3094,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((s5-12 (current-time))) - (until (time-elapsed? s5-12 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc index 640356954b..f2887318d7 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc @@ -3152,10 +3152,7 @@ (defstate dissipate (gun-blue-shot-3) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (go-virtual die) ) @@ -3165,10 +3162,7 @@ (defstate impact (gun-blue-shot-3) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (go-virtual die) ) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc index 3cc1d66c93..e5116b31ee 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc @@ -3150,64 +3150,61 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs object. (defbehavior zero-g-wait-for-land gravity-spinner () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1.5)) - (let* ((s4-0 (handle->process (-> self parent-hand))) - (s5-0 (if (type? s4-0 process-focusable) - s4-0 - ) - ) - ) - (cond - ((and s5-0 - (not (logtest? (-> (the-as process-focusable s5-0) focus-status) (focus-status disable dead inactive))) - ) - (if (or (< (- (-> (get-trans (the-as process-focusable s5-0) 3) y) - (-> (the-as process-focusable s5-0) root root-prim local-sphere w) - ) - (-> self ground-height) - ) - (let ((s4-1 (-> (the-as process-focusable s5-0) root))) - (and (if (type? s4-1 collide-shape-moving) - s4-1 - ) - (logtest? (-> (the-as collide-shape-moving (-> (the-as process-focusable s5-0) root)) status) - (collide-status on-surface touch-surface) - ) - ) + (suspend-for (seconds 1.5) + (let* ((s4-0 (handle->process (-> self parent-hand))) + (s5-0 (if (type? s4-0 process-focusable) + s4-0 ) - ) - (return (the-as object 0)) - ) - (when (not (logtest? (process-mask vehicle) (-> (the-as process-focusable s5-0) mask))) - (let ((s4-2 (new 'stack 'sphere))) - (vector-lerp! - s4-2 - (-> (the-as process-focusable s5-0) root root-prim local-sphere) - (-> self original-sphere-offset) - (* 3.0 (seconds-per-frame)) ) - (set! (-> s4-2 r) (lerp - (-> (the-as process-focusable s5-0) root root-prim local-sphere w) - (-> self original-sphere-offset r) - (* 3.0 (seconds-per-frame)) - ) - ) - (set! (-> (the-as process-focusable s5-0) root root-prim local-sphere quad) (-> s4-2 quad)) - ) - (if (>= (+ (current-time) (seconds -1)) gp-0) - (set! (-> (the-as process-focusable s5-0) root root-prim local-sphere quad) - (-> self original-sphere-offset quad) - ) - ) - ) ) - (else - (return (the-as object 0)) - ) + (cond + ((and s5-0 + (not (logtest? (-> (the-as process-focusable s5-0) focus-status) (focus-status disable dead inactive))) + ) + (if (or (< (- (-> (get-trans (the-as process-focusable s5-0) 3) y) + (-> (the-as process-focusable s5-0) root root-prim local-sphere w) + ) + (-> self ground-height) + ) + (let ((s4-1 (-> (the-as process-focusable s5-0) root))) + (and (if (type? s4-1 collide-shape-moving) + s4-1 + ) + (logtest? (-> (the-as collide-shape-moving (-> (the-as process-focusable s5-0) root)) status) + (collide-status on-surface touch-surface) + ) + ) + ) + ) + (return (the-as object 0)) + ) + (when (not (logtest? (process-mask vehicle) (-> (the-as process-focusable s5-0) mask))) + (let ((s4-2 (new 'stack 'sphere))) + (vector-lerp! + s4-2 + (-> (the-as process-focusable s5-0) root root-prim local-sphere) + (-> self original-sphere-offset) + (* 3.0 (seconds-per-frame)) + ) + (set! (-> s4-2 r) (lerp + (-> (the-as process-focusable s5-0) root root-prim local-sphere w) + (-> self original-sphere-offset r) + (* 3.0 (seconds-per-frame)) + ) + ) + (set! (-> (the-as process-focusable s5-0) root root-prim local-sphere quad) (-> s4-2 quad)) + ) + (if (>= (+ (current-time) (seconds -1)) time) + (set! (-> (the-as process-focusable s5-0) root root-prim local-sphere quad) + (-> self original-sphere-offset quad) + ) + ) + ) + ) + (else + (return (the-as object 0)) ) ) - (suspend) ) ) (the-as int #f) @@ -3906,16 +3903,10 @@ ) ) (set! f30-0 (+ -0.6 f30-0)) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.15)) - (suspend) - ) + (suspend-for (seconds 0.15) ) ) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 13.5)) - (suspend) - ) + (suspend-for (seconds 13.5) ) (go empty-state) (set! f30-0 4.0) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc index 3106ae0591..a85396bf25 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc @@ -2192,11 +2192,7 @@ :virtual #t :trans (behavior () (go-impact self) - (let ((t9-2 (-> (find-parent-state) trans))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler trans) ) ) @@ -2205,11 +2201,7 @@ :virtual #t :trans (behavior () (go-impact self) - (let ((t9-2 (-> (find-parent-state) trans))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler trans) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc index 13e4a0c579..9d7bcf465e 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc @@ -757,10 +757,7 @@ process (lambda :behavior process ((arg0 handle)) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (send-event (handle->process arg0) 'die) ) @@ -791,10 +788,7 @@ ) (logior! (-> self draw status) (draw-control-status no-draw)) (transform-post) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (deactivate self) ) @@ -938,11 +932,7 @@ ) ) ) - (let ((t9-5 (-> (find-parent-state) trans))) - (if t9-5 - (t9-5) - ) - ) + (call-parent-state-handler trans) (ja-post) ) ) @@ -2117,11 +2107,7 @@ :virtual #t :enter (behavior () (sound-stop (-> self snd-trail)) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/indax/target-indax_REF.gc b/test/decompiler/reference/jak3/engine/target/indax/target-indax_REF.gc index f844958bbd..ec102a3ee7 100644 --- a/test/decompiler/reference/jak3/engine/target/indax/target-indax_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/indax/target-indax_REF.gc @@ -1594,10 +1594,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (move-to-point! (-> self control) s4-1) ) @@ -1828,10 +1825,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) ((= arg0 'bot) diff --git a/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc index 28f05368d1..3a8dc2171a 100644 --- a/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc @@ -1039,10 +1039,7 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (move-to-point! (-> self control) s4-1) ) @@ -1184,11 +1181,8 @@ ) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-mech-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.8)) - (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5)) - (suspend) - ) + (suspend-for (seconds 0.8) + (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5)) ) (remove-setting! 'mode-name) ) @@ -1291,10 +1285,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-10 (current-time))) - (until (time-elapsed? gp-10 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/mech/mech_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/mech_REF.gc index 805915a479..4129d885da 100644 --- a/test/decompiler/reference/jak3/engine/target/mech/mech_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/mech/mech_REF.gc @@ -270,11 +270,8 @@ (mech-method-24 self) (suspend) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (mech-method-24 self) - (suspend) - ) + (suspend-for (seconds 1) + (mech-method-24 self) ) (go arg0) ) diff --git a/test/decompiler/reference/jak3/engine/target/pilot-states_REF.gc b/test/decompiler/reference/jak3/engine/target/pilot-states_REF.gc index 5bd9ae8b42..a158a32d0f 100644 --- a/test/decompiler/reference/jak3/engine/target/pilot-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/pilot-states_REF.gc @@ -1034,10 +1034,7 @@ (logior! (-> self focus-status) (focus-status dead)) (case arg0 (('melt 'grenade 'explode) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (case arg0 (('dark-eco-pool) @@ -1086,10 +1083,7 @@ ) 0 (ja-channel-set! 0) - (let ((s5-11 (current-time))) - (until (time-elapsed? s5-11 (seconds 1.8)) - (suspend) - ) + (suspend-for (seconds 1.8) ) ) (('endlessfall) @@ -1119,10 +1113,7 @@ ) ) ) - (let ((s5-13 (current-time))) - (until (time-elapsed? s5-13 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) ) (('drown-death) @@ -1145,10 +1136,7 @@ ) ) ) - (let ((s5-14 (current-time))) - (until (time-elapsed? s5-14 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) (('bot) @@ -1159,10 +1147,7 @@ ) ) (('big-explosion) - (let ((s5-15 (current-time))) - (until (time-elapsed? s5-15 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) (else diff --git a/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc b/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc index e4706a25b2..fd7e1da9b9 100644 --- a/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc @@ -319,11 +319,7 @@ (set! (-> self part) (the-as sparticle-launch-control 0)) 0 ) - (let ((t9-5 (-> (find-parent-state) enter))) - (if t9-5 - (t9-5) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () (dotimes (gp-0 (-> self bolts length)) diff --git a/test/decompiler/reference/jak3/engine/target/target-death_REF.gc b/test/decompiler/reference/jak3/engine/target/target-death_REF.gc index fddb65f23a..acf55b0038 100644 --- a/test/decompiler/reference/jak3/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-death_REF.gc @@ -56,10 +56,7 @@ (intro-play) ) ((logtest? (-> arg0 flags) (continue-flags warp-gate)) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.05)) - (suspend) - ) + (suspend-for (seconds 0.05) ) (let ((s5-1 (new 'static 'vector)) (a2-0 (find-nearest-entity (-> arg0 trans) warp-gate)) @@ -219,10 +216,7 @@ (go target-grab 'stance) ) (else - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.05)) - (suspend) - ) + (suspend-for (seconds 0.05) ) ) ) @@ -1476,10 +1470,7 @@ (let ((gp-1 (new-stack-vector0))) (set! (-> gp-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (move-to-point! (-> self control) gp-1) ) @@ -2337,10 +2328,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((s5-5 (current-time))) - (until (time-elapsed? s5-5 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) (('grenade 'big-explosion 'explode) @@ -2420,10 +2408,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((s5-10 (current-time))) - (until (time-elapsed? s5-10 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) ) @@ -2440,10 +2425,7 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((s5-11 (current-time))) - (until (time-elapsed? s5-11 (seconds 1.2)) - (suspend) - ) + (suspend-for (seconds 1.2) ) ) ((= v1-61 'endlessfall) @@ -2482,38 +2464,35 @@ (target-falling-anim 30 (seconds 0.33)) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.8)) - (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) - (set! v1-24 'target-hit-ground-hard) - (goto cfg-17) - ) - (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) - (let ((v1-49 (new-stack-vector0)) - (f0-7 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - ) - 0.0 - (vector-! - v1-49 - (-> self control transv) - (vector-float*! v1-49 (-> self control dynam gravity-normal) (the-as float f0-7)) - ) - (let* ((f1-7 (vector-length v1-49)) - (f2-2 f1-7) - ) - (if (< (the-as float (-> self control unknown-word04)) (the-as float f0-7)) - (set! f0-7 (-> self control unknown-word04)) - ) - (vector+! - (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f0-7)) - (vector-float*! v1-49 v1-49 (/ f1-7 f2-2)) - ) - ) - ) - (ja :group! jakb-launch-jump-loop-ja :num! (loop! 0.5)) - (suspend) + (suspend-for (seconds 0.8) + (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) + (set! v1-24 'target-hit-ground-hard) + (goto cfg-17) ) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) + (let ((v1-49 (new-stack-vector0)) + (f0-7 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + ) + 0.0 + (vector-! + v1-49 + (-> self control transv) + (vector-float*! v1-49 (-> self control dynam gravity-normal) (the-as float f0-7)) + ) + (let* ((f1-7 (vector-length v1-49)) + (f2-2 f1-7) + ) + (if (< (the-as float (-> self control unknown-word04)) (the-as float f0-7)) + (set! f0-7 (-> self control unknown-word04)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f0-7)) + (vector-float*! v1-49 v1-49 (/ f1-7 f2-2)) + ) + ) + ) + (ja :group! jakb-launch-jump-loop-ja :num! (loop! 0.5)) ) (set! v1-24 #f) (label cfg-17) @@ -2538,10 +2517,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) (remove-setting! 'mode-name) @@ -2707,10 +2683,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((s5-14 (current-time))) - (until (time-elapsed? s5-14 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) ((= v1-61 'centipede) diff --git a/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc b/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc index e501d549c1..036e5c2827 100644 --- a/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc @@ -202,10 +202,8 @@ process (lambda :behavior target () - (let ((gp-0 (current-time)) - (s5-0 (current-time)) - ) - (until (time-elapsed? s5-0 (seconds 1)) + (let ((gp-0 (current-time))) + (suspend-for (seconds 1) (when (time-elapsed? gp-0 (seconds 0.03)) (set! gp-0 (current-time)) (process-drawable-shock-effect @@ -218,7 +216,6 @@ 40960.0 ) ) - (suspend) ) ) (none) diff --git a/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc b/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc index 5209f515c3..ce2e91ba8d 100644 --- a/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc @@ -484,10 +484,7 @@ (set-time! (-> self state-time)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.66)) - (suspend) - ) + (suspend-for (seconds 0.66) ) (cond ((logtest? (-> *part-group-id-table* 182 flags) (sp-group-flag sp13)) @@ -515,10 +512,7 @@ ) ) (sound-play "dark-maker") - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (go-virtual idle) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc b/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc index 94543b7082..2af58bda19 100644 --- a/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc @@ -2348,11 +2348,8 @@ (defstate die (freeze-screen) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (seek! (-> self transition) 0.0 (seconds-per-frame)) - (suspend) - ) + (suspend-for (seconds 1) + (seek! (-> self transition) 0.0 (seconds-per-frame)) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-turret_REF.gc b/test/decompiler/reference/jak3/engine/target/target-turret_REF.gc index 91b7992224..691eec6b85 100644 --- a/test/decompiler/reference/jak3/engine/target/target-turret_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-turret_REF.gc @@ -1169,10 +1169,7 @@ (sound-stop (-> self sound-id 1)) (sound-stop (-> self sound-id 2)) (logior! (-> self focus-status) (focus-status disable ignore inactive)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.8)) - (suspend) - ) + (suspend-for (seconds 0.8) ) (send-event (handle->process (-> self rider)) diff --git a/test/decompiler/reference/jak3/engine/target/target2_REF.gc b/test/decompiler/reference/jak3/engine/target/target2_REF.gc index dcbc86a151..9ec48cc728 100644 --- a/test/decompiler/reference/jak3/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target2_REF.gc @@ -43,12 +43,9 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.3)) - (suspend) - (ja :num! (seek! (ja-aframe 19.0 0) 0.05)) - (suspend) - ) + (suspend-for (seconds 0.3) + (suspend) + (ja :num! (seek! (ja-aframe 19.0 0) 0.05)) ) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-painful-land-ja :num! (seek!) :frame-num (ja-aframe 40.0 0)) @@ -1595,11 +1592,8 @@ (until #f (let ((s5-0 (rand-vu-int-range 30 600))) (ja :group! jakb-wall-hide-head-ja) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 s5-0) - (gp-0) - (suspend) - ) + (suspend-for s5-0 + (gp-0) ) ) (let ((f30-0 (rand-vu-float-range 0.5 1.5))) @@ -1637,12 +1631,9 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (let ((s5-2 (rand-vu-int-range 60 300)) - (s4-2 (current-time)) - ) - (until (time-elapsed? s4-2 s5-2) + (let ((s5-2 (rand-vu-int-range 60 300))) + (suspend-for s5-2 (gp-0) - (suspend) ) ) (ja-no-eval :group! jakb-wall-hide-head-left-ja :num! (seek! 0.0 f30-0) :frame-num max) @@ -1659,12 +1650,9 @@ (suspend) (ja :num! (seek! 0.0 f30-0)) ) - (let ((s5-3 (rand-vu-int-range 60 300)) - (s4-3 (current-time)) - ) - (until (time-elapsed? s4-3 s5-3) + (let ((s5-3 (rand-vu-int-range 60 300))) + (suspend-for s5-3 (gp-0) - (suspend) ) ) (ja-no-eval :group! jakb-wall-hide-head-right-ja :num! (seek! max f30-0) :frame-num 0.0) @@ -2019,14 +2007,13 @@ (suspend) (ja :num! (seek!)) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (the-as time-frame arg0)) - (ja-no-eval :group! jakb-blast-recover-loop-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!)) - ) + (suspend-for (the-as time-frame arg0) + (ja-no-eval :group! jakb-blast-recover-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) ) + (empty-form) ) (ja-no-eval :group! jakb-blast-recover-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) diff --git a/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc index 0ce1b2cf60..1c980d58ec 100644 --- a/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc @@ -4155,10 +4155,7 @@ process (lambda :behavior process ((arg0 int)) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 2.5)) - (suspend) - ) + (suspend-for (seconds 2.5) ) (while (or (not (handle-command-list *gui-control* (gui-channel alert) (the-as gui-connection #f))) (= (status-of-level-and-borrows *level* 'title #f) 'active) diff --git a/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs2_REF.gc b/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs2_REF.gc index 4747b34745..892403beb0 100644 --- a/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs2_REF.gc @@ -402,10 +402,7 @@ (defbehavior bt-roboguard-turret-code bt-roboguard () (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! bt-roboguard-idle-shoot0-loop-ja :num! zero) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (let ((gp-1 (lambda ((arg0 bt-roboguard) (arg1 symbol)) @@ -421,10 +418,7 @@ ) (until #f (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) @@ -446,10 +440,7 @@ ) ) (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (let ((s5-2 (current-time))) - (until (time-elapsed? s5-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) @@ -885,11 +876,7 @@ (defstate hovering (bt-mh-flyer) :virtual #t :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (bt-mh-flyer-method-51 self) ) :code (behavior () @@ -920,11 +907,7 @@ (bt-mh-flyer-flight-code) ) :post (behavior () - (let ((t9-1 (-> (find-parent-state) post))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (call-parent-state-handler post) (bt-mh-flyer-method-52 self) ) ) @@ -934,11 +917,7 @@ :virtual #t :trans (behavior () (sound-play "charge-loop" :id (-> self charge-sound) :position (-> self root trans)) - (let ((t9-2 (-> (find-parent-state) trans))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler trans) ) ) @@ -947,20 +926,12 @@ :virtual #t :trans (behavior () (sound-play "charge-loop" :id (-> self charge-sound) :position (-> self root trans)) - (let ((t9-2 (-> (find-parent-state) trans))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler trans) (bt-mh-flyer-method-51 self) ) :code bt-mh-flyer-flight-code :post (behavior () - (let ((t9-1 (-> (find-parent-state) post))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (call-parent-state-handler post) (bt-mh-flyer-method-52 self) ) ) @@ -969,20 +940,12 @@ (defstate fleeing (bt-mh-flyer) :virtual #t :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (bt-mh-flyer-method-51 self) ) :code bt-mh-flyer-flight-code :post (behavior () - (let ((t9-1 (-> (find-parent-state) post))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (call-parent-state-handler post) (bt-mh-flyer-method-52 self) ) ) @@ -991,11 +954,7 @@ (defstate firing (bt-mh-flyer) :virtual #t :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (bt-mh-flyer-method-51 self) ) :code (behavior () @@ -1009,11 +968,7 @@ (bt-mh-flyer-flight-code) ) :post (behavior () - (let ((t9-1 (-> (find-parent-state) post))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (call-parent-state-handler post) (bt-mh-flyer-method-52 self) ) ) @@ -1023,11 +978,7 @@ :virtual #t :enter (behavior () (sound-play "charge-fire") - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) ) @@ -2327,11 +2278,7 @@ (defstate dormant (bt-grunt) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set! (-> self root trans quad) (-> self start-pos quad)) (set! (-> self entity extra vis-dist) 819200.0) ) @@ -2369,10 +2316,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.3)) - (suspend) - ) + (suspend-for (seconds 0.3) ) (until #f (suspend) @@ -2381,16 +2325,10 @@ (logior! (-> self skel effect flags) (effect-control-flag ecf1)) ) (do-effect (-> self skel effect) "death-default" 0.0 -1) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.3)) - (suspend) - ) + (suspend-for (seconds 0.3) ) (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.8)) - (suspend) - ) + (suspend-for (seconds 0.8) ) (go-virtual dormant) ) @@ -3260,11 +3198,7 @@ :virtual #t :enter (behavior () (set! (-> self hit-points) 10.0) - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) ) diff --git a/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs_REF.gc index 24a180069d..c918a8560b 100644 --- a/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs_REF.gc @@ -1733,10 +1733,7 @@ (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (let ((v1-46 (-> self root root-prim))) (set! (-> v1-46 prim-core collide-as) (collide-spec)) @@ -2126,10 +2123,7 @@ :code (behavior () (until #f (attempt-barrel-spawn) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.3)) - (suspend) - ) + (suspend-for (seconds 0.3) ) ) #f diff --git a/test/decompiler/reference/jak3/levels/city/blow-tower/cty-blow-tower_REF.gc b/test/decompiler/reference/jak3/levels/city/blow-tower/cty-blow-tower_REF.gc index 83b68e8a07..2a9fb21eed 100644 --- a/test/decompiler/reference/jak3/levels/city/blow-tower/cty-blow-tower_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/blow-tower/cty-blow-tower_REF.gc @@ -5070,11 +5070,7 @@ (defstate die (bt-pickup) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (dotimes (gp-0 2) (send-event (handle->process (-> self pickup-barrels gp-0)) 'die) ) diff --git a/test/decompiler/reference/jak3/levels/city/common/mh-squad-member_REF.gc b/test/decompiler/reference/jak3/levels/city/common/mh-squad-member_REF.gc index bf8e13d215..1643ce380a 100644 --- a/test/decompiler/reference/jak3/levels/city/common/mh-squad-member_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/mh-squad-member_REF.gc @@ -287,10 +287,6 @@ ) ) ) - (let ((t9-3 (-> (find-parent-state) trans))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler trans) ) ) diff --git a/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc index 9a2beee39b..35c0fa4466 100644 --- a/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc @@ -2642,11 +2642,8 @@ ) (send-event *camera* 'teleport-to-transformq s4-0) ) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 3)) - (set! (-> *camera* slave 0 fov) (-> *city-burning-bush-get-on-info* (-> self info index) fov)) - (suspend) - ) + (suspend-for (seconds 3) + (set! (-> *camera* slave 0 fov) (-> *city-burning-bush-get-on-info* (-> self info index) fov)) ) (set! (-> *camera-combiner* trans quad) (-> s5-0 quad)) (let ((a2-15 (-> *camera-combiner* inv-camera-rot)) diff --git a/test/decompiler/reference/jak3/levels/city/ctywide-tasks_REF.gc b/test/decompiler/reference/jak3/levels/city/ctywide-tasks_REF.gc index 1a8823580d..96bcb8690a 100644 --- a/test/decompiler/reference/jak3/levels/city/ctywide-tasks_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/ctywide-tasks_REF.gc @@ -61,10 +61,7 @@ (talker-spawn-func (-> *talker-speech* 26) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self speech-id)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) @@ -73,10 +70,7 @@ (talker-spawn-func (-> *talker-speech* 27) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self speech-id)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) @@ -98,17 +92,10 @@ ) (wait-for-speech-end (-> self speech-id)) (set! (-> self player-vehicle) (the-as handle #f)) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'complete) - (let ((t9-14 (-> (find-parent-state) code))) - (if t9-14 - ((the-as (function none) t9-14)) - ) - ) + (call-parent-state-handler code) ) ) @@ -118,11 +105,7 @@ :code (behavior ((arg0 resetter-params)) (task-node-close! (game-task-node city-vehicle-training-hover-zone-1) 'event) (sleep-code) - (let ((t9-3 (-> (find-parent-state) code))) - (if t9-3 - ((the-as (function none) t9-3)) - ) - ) + (call-parent-state-handler code) ) ) @@ -131,11 +114,7 @@ :virtual #t :code (behavior () (task-node-close! (game-task-node city-vehicle-training-hover-zone-2) 'event) - (let ((t9-2 (-> (find-parent-state) code))) - (if t9-2 - ((the-as (function none) t9-2)) - ) - ) + (call-parent-state-handler code) ) ) @@ -197,10 +176,7 @@ (talker-spawn-func (-> *talker-speech* 27) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self speech-id)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (set! (-> self speech-id) (talker-spawn-func (-> *talker-speech* 28) *entity-pool* (target-pos 0) (the-as region #f)) @@ -220,10 +196,7 @@ (talker-spawn-func (-> *talker-speech* 29) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self speech-id)) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (go-virtual complete) ) @@ -254,10 +227,7 @@ ((-> (method-of-object self wait) trans)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) (until (< 327680.0 (vector-vector-xz-distance (target-pos 0) (new 'static 'vector :x -285696.0 :y 36044.8 :z 5443625.0 :w 1.0)) @@ -266,10 +236,7 @@ ) (set-setting! 'airlock-command '(("hip-door-a-6" close)) 0.0 0) (talker-spawn-func (-> *talker-speech* 162) *entity-pool* (target-pos 0) (the-as region #f)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) (until (handle-command-list *gui-control* (gui-channel voicebox) (the-as gui-connection #f)) (suspend) @@ -370,7 +337,3 @@ (send-event self 'complete) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/destroy-grid/cty-destroy-grid_REF.gc b/test/decompiler/reference/jak3/levels/city/destroy-grid/cty-destroy-grid_REF.gc index f33d504cb7..26f857d02d 100644 --- a/test/decompiler/reference/jak3/levels/city/destroy-grid/cty-destroy-grid_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/destroy-grid/cty-destroy-grid_REF.gc @@ -436,11 +436,7 @@ ) ) ) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) :exit #f :trans (behavior () @@ -510,11 +506,7 @@ (put-rider-in-seat gp-0 (-> self seat) self) ) ) - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -1735,11 +1727,7 @@ :virtual #t :enter (behavior () (logior! (-> self jinx-flags) (jinx-flag j0)) - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) :code (behavior () (until (process-grab? *target* #f) @@ -1774,11 +1762,7 @@ ) :post (behavior () (move-cam-to-jinx self) - (let ((t9-2 (-> (find-parent-state) post))) - (if t9-2 - ((the-as (function none) t9-2)) - ) - ) + (call-parent-state-handler post) ) ) @@ -2035,11 +2019,7 @@ ) (suspend) ) - (let ((t9-4 (-> (find-parent-state) code))) - (if t9-4 - ((the-as (function none) t9-4)) - ) - ) + (call-parent-state-handler code) ) ) @@ -2290,10 +2270,7 @@ (process-entity-status! self (entity-perm-status dead) #t) (sound-play "bomb-set") (set! (-> self sound-id) (sound-play "time-tick-loop")) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) (sound-stop (-> self sound-id)) (sound-play "bomb-explode") @@ -2454,7 +2431,3 @@ (go (method-of-object this idle)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc b/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc index ce5cf09837..020b6ffc8d 100644 --- a/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc @@ -1477,11 +1477,7 @@ :virtual #t :enter (behavior () (set! (-> self vehicle-is-visible?) #f) - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (task-node-close! (game-task-node city-vehicle-training-hover-zone-1) 'event) (set-setting! 'kg-difficulty #f 1.5 0) (set-setting! 'exclusive-load '((ignore lctyhijk)) 0.0 0) @@ -1602,11 +1598,7 @@ (task-node-close! (game-task-node city-hijack-vehicle-infiltrate) 'event) (go-virtual show-missile-launch) ) - (let ((t9-18 (-> (find-parent-state) trans))) - (if t9-18 - (t9-18) - ) - ) + (call-parent-state-handler trans) ) ) @@ -1811,10 +1803,7 @@ (until (process-grab? *target* #f) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1.5)) - (suspend) - ) + (suspend-for (seconds 1.5) ) (send-event (handle->process (-> self hpickup)) 'flight-up) (let ((gp-1 (-> self missiles allocated-length)) @@ -1863,10 +1852,7 @@ ) ) (sound-play "hj-missile" :id (-> self missile-sound)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (dotimes (gp-3 (-> self missiles length)) (send-event (handle->process (-> self missiles gp-3)) 'begin-moving) @@ -1876,16 +1862,10 @@ (send-event (handle->process (-> self missiles gp-4)) 'begin-moving) ) (cty-hijack-manager-method-39 self 1) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (remove-setting! 'entity-name) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (until (process-release? *target*) (suspend) diff --git a/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack-bbush_REF.gc b/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack-bbush_REF.gc index 61a6508fc2..139a2d0cc0 100644 --- a/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack-bbush_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack-bbush_REF.gc @@ -522,19 +522,11 @@ (defstate pickup-nukes (ctyport-attack-manager-bbush) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set! (-> self countdown-timer) (the-as handle (current-time))) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (if (< (vector-vector-xz-distance (target-pos 0) *port-attack-bbush-fail-sphere*) *port-attack-bbush-fail-radius*) (send-event self 'fail) ) @@ -634,7 +626,3 @@ (sleep-code) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc b/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc index d50e5f74e8..9e1e28445b 100644 --- a/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc @@ -1977,10 +1977,7 @@ process (lambda :behavior process () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.75)) - (suspend) - ) + (suspend-for (seconds 0.75) ) (let ((a0-0 (ppointer->process (-> self parent)))) (if a0-0 @@ -2149,10 +2146,7 @@ :virtual #t :code (behavior () (sound-stop (-> self hum-sound)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (disable *screen-filter*) (deactivate self) @@ -2348,10 +2342,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((gp-1 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-1 from) (process->ppointer self)) diff --git a/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc b/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc index 2014b4977b..40c60bd857 100644 --- a/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc @@ -1188,22 +1188,14 @@ ) ) :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set! (-> self speed) 0.0) (set! (-> self jump-state) (the-as uint 2)) (set! (-> self jump-time) 0.0) (set! (-> *target* pilot jumping?) #f) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) ) :post (behavior () (control-hook-player self) diff --git a/test/decompiler/reference/jak3/levels/city/protect/assault-enemies_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/assault-enemies_REF.gc index 6716b38faa..13ab93db06 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/assault-enemies_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/assault-enemies_REF.gc @@ -309,11 +309,7 @@ (defstate knocked-recover (assault-citizen-norm) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (logclear! (-> self enemy-flags) (enemy-flag vulnerable)) (if (< (vector-vector-xz-distance (-> self root trans) (-> self center-pos)) 16384.0) (go-virtual cower-ground) @@ -484,11 +480,7 @@ (defstate cower-ground (assault-citizen-norm) :virtual #t :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (if (enemy-method-109 self) (go-virtual die) ) @@ -917,10 +909,7 @@ (defstate tracking (assault-cleanup) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) (set-time! (-> self offscreen-time)) (until #f @@ -1572,11 +1561,7 @@ ) ) ) - (let ((t9-11 (-> (find-parent-state) enter))) - (if t9-11 - (t9-11) - ) - ) + (call-parent-state-handler enter) ) ) @@ -2176,11 +2161,7 @@ (defstate drop-bombs (assault-bombbot) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set! (-> self drop-num) (the-as uint 3)) ) ) @@ -2212,11 +2193,7 @@ (set! (-> self next-node) (the-as int (-> self current-node))) (set-time! (-> self state-time)) (set-time! (-> self stop-shoot)) - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (remove-attacker *cty-attack-controller* (-> self attacker-info)) diff --git a/test/decompiler/reference/jak3/levels/city/protect/assault-task_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/assault-task_REF.gc index da907c0458..f239a2289f 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/assault-task_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/assault-task_REF.gc @@ -362,10 +362,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (send-event self 'ammo-special 15 29) (sleep-code) @@ -511,10 +508,7 @@ (set! (-> v1-4 notify-proc) (process->handle self)) (send-event (handle->process (-> self h-player-controller)) 'set-params v1-4) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (if *target* (logclear! (-> *target* focus-status) (focus-status teleporting)) @@ -814,11 +808,7 @@ ) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (spawn-enemies *assault-squad* self) ) :code (behavior () @@ -1484,10 +1474,7 @@ process (lambda :behavior process () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (dotimes (gp-1 (-> *assault-squad* spawn-records 1 records length)) (send-event (handle->process (-> *assault-squad* spawn-records 1 records data gp-1 proc)) 'traffic-off-force) @@ -1594,11 +1581,7 @@ (defstate clip-to-nav-mesh (assault-player-controller) :virtual #t :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (assault-player-controller-method-36 self) ) ) diff --git a/test/decompiler/reference/jak3/levels/city/protect/cty-protect_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/cty-protect_REF.gc index bf9422c47d..4b870eaa8a 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/cty-protect_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/cty-protect_REF.gc @@ -163,11 +163,7 @@ :virtual #t :enter (behavior () (set-blackout-frames (seconds 10)) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) ) @@ -344,16 +340,10 @@ ((-> (method-of-type task-manager active) trans)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (talker-spawn-func (-> *talker-speech* 337) *entity-pool* (target-pos 0) (the-as region #f)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2.5)) - (suspend) - ) + (suspend-for (seconds 2.5) ) (talker-spawn-func (-> *talker-speech* 336) *entity-pool* (target-pos 0) (the-as region #f)) (send-event self 'complete) @@ -397,10 +387,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (talker-spawn-func (-> *talker-speech* 334) *entity-pool* (target-pos 0) (the-as region #f)) (sleep-code) diff --git a/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc index 720cc55607..addd88e082 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc @@ -721,11 +721,7 @@ :enter (behavior () (set! (-> self chase-mode) (the-as uint 3)) (flying-turret-method-230 self (the-as uint 0)) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () (when (handle->process (-> self current-enemy)) @@ -1542,7 +1538,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/protect/protect-gunship_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/protect-gunship_REF.gc index 0a40e486f4..060ccd5ac8 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/protect-gunship_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/protect-gunship_REF.gc @@ -1923,10 +1923,7 @@ (set! (-> gp-1 pickup-amount) 2.0) (drop-pickup gp-1 #t *entity-pool* gp-1 0 #t) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) ) ) @@ -4188,7 +4185,3 @@ (call-parent-method this) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc index f6fc601f5e..889f2f2332 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc @@ -461,10 +461,7 @@ (defbehavior roboguard-city-turret-code roboguard-city () (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! roboguard-city-idle-shoot0-loop-ja :num! zero) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (let ((gp-1 (lambda :behavior process @@ -481,10 +478,7 @@ ) (until #f (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) @@ -506,10 +500,7 @@ ) ) (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (let ((s5-2 (current-time))) - (until (time-elapsed? s5-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) @@ -603,11 +594,7 @@ :virtual #t :trans (behavior () (nav-enemy-method-181 self) - (let ((t9-2 (-> (find-parent-state) trans))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler trans) (let ((gp-0 (get-current-enemy self))) (when gp-0 (let* ((s5-0 self) @@ -1688,11 +1675,7 @@ (defstate knocked-recover (roboguard-city) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () (let ((t9-0 (-> (method-of-type kg-squad-member knocked-recover) trans))) @@ -2502,7 +2485,3 @@ (enemy-falling-post) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-battery_REF.gc b/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-battery_REF.gc index f615a608ef..64562584d9 100644 --- a/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-battery_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-battery_REF.gc @@ -345,10 +345,7 @@ (ja-channel-set! 1) (ja :group! cty-sniper-button-pushdown-ja :num! (identity (the float (ja-num-frames 0)))) (ja-post) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (-> self stay-down-time)) - (suspend) - ) + (suspend-for (-> self stay-down-time) ) (send-event (handle->process (-> self lid)) 'up #x3e800000) (ja-no-eval :group! cty-sniper-button-popup-ja :num! (seek! max 0.25) :frame-num 0.0) @@ -1051,7 +1048,3 @@ (set! (-> self during-movement-sound) (new-sound-id)) (go-virtual idle) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc b/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc index e1d5641d2f..9efc4dffa2 100644 --- a/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc @@ -3049,10 +3049,7 @@ ) :code (behavior () (logior! (-> self flags) (cty-sniper-turret-flag cst3)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.49)) - (suspend) - ) + (suspend-for (seconds 0.49) ) (let ((gp-1 (rand-vu-int-range 3 6))) (dotimes (s5-0 gp-1) @@ -3187,29 +3184,26 @@ (when (and (< f30-0 0.0) (not (-> *setting-control* user-current freeze-screen))) (set-setting! 'mode-name 'cam-no-trans 0.0 0) (suspend) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.5)) - (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (the-as uint128 0)) - (cond - ((< (* (-> s5-2 x) (-> gp-1 z)) (* (-> s5-2 z) (-> gp-1 x))) - (set! (-> s3-0 z) (- (-> s5-2 x))) - (set! (-> s3-0 x) (-> s5-2 z)) - ) - (else - (set! (-> s3-0 z) (-> s5-2 x)) - (set! (-> s3-0 x) (- (-> s5-2 z))) - ) + (suspend-for (seconds 0.5) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (the-as uint128 0)) + (cond + ((< (* (-> s5-2 x) (-> gp-1 z)) (* (-> s5-2 z) (-> gp-1 x))) + (set! (-> s3-0 z) (- (-> s5-2 x))) + (set! (-> s3-0 x) (-> s5-2 z)) + ) + (else + (set! (-> s3-0 z) (-> s5-2 x)) + (set! (-> s3-0 x) (- (-> s5-2 z))) ) - (vector+! s3-0 s3-0 (target-pos 0)) - (+! (-> s3-0 y) 20480.0) - (set! (-> *camera* slave 0 trans quad) (-> s3-0 quad)) ) - (vector-! gp-1 (-> self root trans) (target-pos 0)) - (vector-! s5-2 (camera-pos) (target-pos 0)) - (set-setting! 'interp-time 'abs 300.0 0) - (suspend) + (vector+! s3-0 s3-0 (target-pos 0)) + (+! (-> s3-0 y) 20480.0) + (set! (-> *camera* slave 0 trans quad) (-> s3-0 quad)) ) + (vector-! gp-1 (-> self root trans) (target-pos 0)) + (vector-! s5-2 (camera-pos) (target-pos 0)) + (set-setting! 'interp-time 'abs 300.0 0) ) ) (set-setting! 'mode-name 'cam-pov-track 0.0 0) @@ -3247,10 +3241,7 @@ #t ) (logior! (-> *target* focus-status) (focus-status ignore)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.08)) - (suspend) - ) + (suspend-for (seconds 0.08) ) (send-event self 'pov-cam-on) (send-event (handle->process (-> self reticle)) 'on) @@ -3264,10 +3255,7 @@ #x33001 #t ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.08)) - (suspend) - ) + (suspend-for (seconds 0.08) ) (disable *screen-filter*) ) @@ -3309,14 +3297,11 @@ ) ) ) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 1.5)) - (when (focus-test? *target* grabbed) - (logclear! (-> self flags) (cty-sniper-turret-flag cst11)) - (send-event (handle->process (-> self reticle)) 'unlock) - (goto cfg-44) - ) - (suspend) + (suspend-for (seconds 1.5) + (when (focus-test? *target* grabbed) + (logclear! (-> self flags) (cty-sniper-turret-flag cst11)) + (send-event (handle->process (-> self reticle)) 'unlock) + (goto cfg-44) ) ) (if (and (logtest? (-> self flags) (cty-sniper-turret-flag cst7)) (not (cty-sniper-turret-method-39 self))) @@ -3372,10 +3357,7 @@ (suspend) (set-setting! 'interp-time 'abs 600.0 0) (remove-setting! 'mode-name) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (send-event (handle->process (-> self reticle)) 'die) (let ((v1-71 (-> self root root-prim))) @@ -3651,7 +3633,3 @@ (t9-1 this a1-6 a2-1 a3-1 0.0) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc index 0ce09f0db9..1476b5c5ed 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc @@ -1291,11 +1291,7 @@ (defstate knocked-recover (civilian) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef38)))) ) @@ -2240,7 +2236,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc index c29147034d..353c86be74 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc @@ -363,17 +363,11 @@ ) ) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.6)) - (suspend) - ) + (suspend-for (seconds 0.6) ) (+! (-> self root trans y) -8192.0) (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) ) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) @@ -1105,7 +1099,3 @@ (go-inactive self) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/comb/comb-obs_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-obs_REF.gc index 2e0b5313e5..70cc503643 100644 --- a/test/decompiler/reference/jak3/levels/comb/comb-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/comb-obs_REF.gc @@ -403,10 +403,7 @@ :unk 0 ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (cleanup-for-death self) ) @@ -764,10 +761,7 @@ :unk 0 ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (cleanup-for-death self) ) @@ -1330,11 +1324,8 @@ (print-text self (text-id text-05f8)) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 6)) - (print-text self (text-id light-jak-shield-how-to)) - (suspend) - ) + (suspend-for (seconds 6) + (print-text self (text-id light-jak-shield-how-to)) ) (send-event *target* 'end-mode 'lightjak) (go-virtual complete) diff --git a/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc index ed45f69165..31bd020abf 100644 --- a/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc @@ -792,10 +792,7 @@ :unk 0 ) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (cleanup-for-death self) ) @@ -840,7 +837,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/comb/comb-travel_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-travel_REF.gc index ae4bca8ff3..2fe002f305 100644 --- a/test/decompiler/reference/jak3/levels/comb/comb-travel_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/comb-travel_REF.gc @@ -259,11 +259,7 @@ (suspend) ) #f - (let ((t9-29 (-> (find-parent-state) code))) - (if t9-29 - ((the-as (function none) t9-29)) - ) - ) + (call-parent-state-handler code) ) ) @@ -273,11 +269,7 @@ :code (behavior () (remove-setting! 'pilot-exit) (set-setting! 'pilot #f 0.0 0) - (let ((t9-3 (-> (find-parent-state) code))) - (if t9-3 - ((the-as (function none) t9-3)) - ) - ) + (call-parent-state-handler code) ) ) @@ -336,16 +328,9 @@ :code (behavior () (send-event *target* 'end-mode 'pilot) (send-event (handle->process (-> self player-vehicle)) 'sled-disable) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) - ) - (let ((t9-3 (-> (find-parent-state) code))) - (if t9-3 - ((the-as (function none) t9-3)) - ) + (suspend-for (seconds 2) ) + (call-parent-state-handler code) ) ) @@ -382,7 +367,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc b/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc index 18d7a3044d..8332b584c8 100644 --- a/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc @@ -2040,11 +2040,7 @@ :virtual #t :enter (behavior () (set! (-> self health-hud) (process->handle (hud-sled-health-spawn self))) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (let ((t9-1 (-> (find-parent-state) exit))) diff --git a/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc b/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc index 878d8d6a5d..b8c2d2816e 100644 --- a/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc @@ -720,10 +720,7 @@ (defstate shutdown-camera (elec-gate) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (format 0 "~s~%" (-> self name)) (if (res-lump-struct (-> self entity) 'camera-name structure) @@ -736,10 +733,7 @@ :to *entity-pool* ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (go-virtual shutdown) ) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/darkprec/neo-wasp_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/darkprec/neo-wasp_REF.gc index 0ad27a0cb7..ce67a63ddf 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/darkprec/neo-wasp_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/darkprec/neo-wasp_REF.gc @@ -730,10 +730,7 @@ 0 (set! (-> self hit-points) 0.0) (do-effect (-> self skel effect) "death-default" 0.0 -1) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (cleanup-for-death self) @@ -1404,7 +1401,3 @@ ) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common/enemy/flitter_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/flitter_REF.gc index e18aa4ea40..58544338fb 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/flitter_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/flitter_REF.gc @@ -739,10 +739,7 @@ (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1412)) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.6)) - (suspend) - ) + (suspend-for (seconds 0.6) ) (+! (-> self root trans y) -8192.0) (update-focus self) @@ -761,10 +758,7 @@ ) ) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) ) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) @@ -1415,7 +1409,3 @@ (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 108) (the-as int #f) (the-as vector #t) 0)) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common/enemy/grunt_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/grunt_REF.gc index 180b8cd0f4..a91bfed92d 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/grunt_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/grunt_REF.gc @@ -1028,10 +1028,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/hover/robo-hover_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/hover/robo-hover_REF.gc index c20571ae32..023336b663 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/hover/robo-hover_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/hover/robo-hover_REF.gc @@ -1067,11 +1067,7 @@ ) ) :post (behavior () - (let ((t9-1 (-> (find-parent-state) post))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (call-parent-state-handler post) (seek! (-> self gun-blend) 0.0 (* 5.0 (seconds-per-frame))) ) ) @@ -1875,7 +1871,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common/enemy/kg-grunt_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/kg-grunt_REF.gc index a691f467df..d4d66db38b 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/kg-grunt_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/kg-grunt_REF.gc @@ -908,10 +908,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) @@ -2028,7 +2025,3 @@ ) 0 ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common/enemy/mantis_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/mantis_REF.gc index 18685e4fab..bebca2d00d 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/mantis_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/mantis_REF.gc @@ -713,11 +713,7 @@ (defstate active (mantis) :virtual #t :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (if (logtest? (-> self flags) (mantis-flag tracked)) (mantis-method-199 self) ) @@ -807,16 +803,10 @@ ) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.3)) - (suspend) - ) + (suspend-for (seconds 0.3) ) (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) ) (logclear! (-> self draw status) (draw-control-status no-draw)) (let* ((v1-45 (-> self nav)) @@ -948,13 +938,10 @@ (suspend) (ja :num! (seek! max 1.2)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (if (logtest? (-> self root status) (collide-status on-ground)) - (goto cfg-35) - ) - (suspend) - ) + (suspend-for (seconds 1) + (if (logtest? (-> self root status) (collide-status on-ground)) + (goto cfg-35) + ) ) (label cfg-35) (go-virtual hostile) @@ -2192,7 +2179,3 @@ (set! (-> this draw light-index) (the-as uint 30)) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common/enemy/roboguard_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/roboguard_REF.gc index 08ba1bfe15..58bb68928c 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/roboguard_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/roboguard_REF.gc @@ -560,10 +560,7 @@ (defbehavior roboguard-turret-code roboguard () (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! roboguard-idle-shoot0-loop-ja :num! zero) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (let ((gp-1 (lambda ((arg0 roboguard) (arg1 symbol)) @@ -579,10 +576,7 @@ ) (until #f (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) @@ -604,10 +598,7 @@ ) ) (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (let ((s5-2 (current-time))) - (until (time-elapsed? s5-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/spyder_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/spyder_REF.gc index 08957b0a4d..84da69deaa 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/spyder_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/spyder_REF.gc @@ -1126,13 +1126,10 @@ (set! (-> self fire-info 0 quad) (-> s3-0 quad)) (set! (-> self fire-info 1 quad) (-> s2-1 quad)) ) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 0.2)) - (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) - (ja :num! (loop!)) - (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) - (suspend) - ) + (suspend-for (seconds 0.2) + (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) + (ja :num! (loop!)) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) ) (let ((f28-1 (+ 12288.0 f28-0))) (set! (-> gp-0 quad) (-> s5-0 quad)) @@ -1446,7 +1443,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc index e7d37a742d..4259908006 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc @@ -1165,10 +1165,7 @@ ) (suspend) (ja-channel-set! 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (let ((gp-1 (-> self child))) @@ -1766,7 +1763,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc index 4bde6a4db9..fb3fbd6f91 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc @@ -1475,21 +1475,13 @@ ) ) :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (spydroid-method-231 self (the-as uint 0)) (set-time! (-> self state-time)) (logior! (-> self flags) (citizen-flag neck-no-auto-look-at)) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (when (or (!= (-> self faction-mode) 0) (logtest? (-> self flags) (citizen-flag in-mission))) (spydroid-method-236 self) (go-virtual hostile) diff --git a/test/decompiler/reference/jak3/levels/desert/artifact-race/artifact-race_REF.gc b/test/decompiler/reference/jak3/levels/desert/artifact-race/artifact-race_REF.gc index c5b8c283e7..98da47392f 100644 --- a/test/decompiler/reference/jak3/levels/desert/artifact-race/artifact-race_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/artifact-race/artifact-race_REF.gc @@ -982,22 +982,12 @@ 0 (when (= (-> self node-info task) (game-task desert-artifact-race-1)) (send-event *target* 'end-mode 'pilot) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) - ) - (let ((t9-3 (-> (find-parent-state) code))) - (if t9-3 - ((the-as (function none) t9-3)) - ) + (suspend-for (seconds 0.5) ) + (call-parent-state-handler code) ) ) @@ -1018,7 +1008,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/chase/desert-chase_REF.gc b/test/decompiler/reference/jak3/levels/desert/chase/desert-chase_REF.gc index dfb06392e7..900bd4ff6b 100644 --- a/test/decompiler/reference/jak3/levels/desert/chase/desert-chase_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/chase/desert-chase_REF.gc @@ -152,15 +152,12 @@ ) :code (behavior () (suspend) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 3)) - (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) - (set! (-> a1-0 options) (overlaps-others-options)) - (set! (-> a1-0 collide-with-filter) (the-as collide-spec -1)) - (set! (-> a1-0 tlist) *touching-list*) - (find-overlapping-shapes (-> self root) a1-0) - ) - (suspend) + (suspend-for (seconds 3) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> self root) a1-0) ) ) (let ((v1-10 (-> self root root-prim))) @@ -615,16 +612,10 @@ (let ((v1-137 (-> self vehicle 3 handle process))) (set-setting! 'sound-ear v1-137 0.0 (-> v1-137 0 pid)) ) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 1.5)) - (suspend) - ) + (suspend-for (seconds 1.5) ) (desert-chase-ambush-manager-method-35 self 3) - (let ((gp-10 (current-time))) - (until (time-elapsed? gp-10 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) (set! (-> *display* force-sync) (the-as uint 240)) @@ -633,16 +624,10 @@ (set-setting! 'sound-ear v1-157 0.0 (-> v1-157 0 pid)) ) (set-setting! 'entity-name "camera-400" 0.0 0) - (let ((gp-12 (current-time))) - (until (time-elapsed? gp-12 (seconds 1.5)) - (suspend) - ) + (suspend-for (seconds 1.5) ) (desert-chase-ambush-manager-method-35 self 2) - (let ((gp-13 (current-time))) - (until (time-elapsed? gp-13 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (desert-chase-ambush-manager-method-35 self 1) (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) @@ -652,16 +637,10 @@ (set-setting! 'sound-ear v1-181 0.0 (-> v1-181 0 pid)) ) (set-setting! 'entity-name "camera-402" 0.0 0) - (let ((gp-15 (current-time))) - (until (time-elapsed? gp-15 (seconds 1.5)) - (suspend) - ) + (suspend-for (seconds 1.5) ) (desert-chase-ambush-manager-method-35 self 0) - (let ((gp-16 (current-time))) - (until (time-elapsed? gp-16 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (remove-setting! 'sound-ear) (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) @@ -701,10 +680,7 @@ (if *target* (logclear! (-> *target* focus-status) (focus-status teleporting)) ) - (let ((gp-19 (current-time))) - (until (time-elapsed? gp-19 (seconds 2.5)) - (suspend) - ) + (suspend-for (seconds 2.5) ) (remove-setting! 'entity-name) (dotimes (gp-20 4) @@ -1742,10 +1718,7 @@ 0 ) ) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((gp-7 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-7 from) (process->ppointer self)) @@ -1769,10 +1742,7 @@ (set! (-> gp-8 i-node) 48) ) ) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((gp-10 (-> self control-array 2))) (when (not (handle->process (-> gp-10 vehicle))) @@ -1782,10 +1752,7 @@ 0 ) ) - (let ((gp-11 (current-time))) - (until (time-elapsed? gp-11 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((gp-12 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-12 from) (process->ppointer self)) @@ -1809,10 +1776,7 @@ (set! (-> gp-13 i-node) 48) ) ) - (let ((gp-14 (current-time))) - (until (time-elapsed? gp-14 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((gp-15 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-15 from) (process->ppointer self)) @@ -1829,15 +1793,9 @@ ) ) ) - (let ((gp-16 (current-time))) - (until (time-elapsed? gp-16 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) - (let ((gp-17 (current-time))) - (until (time-elapsed? gp-17 (seconds 4)) - (suspend) - ) + (suspend-for (seconds 4) ) (send-event (handle->process (-> self h-player-controller)) 'change-mode 'idle) (dotimes (gp-18 4) @@ -1932,10 +1890,7 @@ ) ) ) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (was-squad-manager-start self) (let ((v1-66 *was-squad-control*)) @@ -2075,10 +2030,7 @@ (if (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) ) - (let ((s5-5 (current-time))) - (until (time-elapsed? s5-5 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (+! gp-6 -1) (if (= gp-6 -1) @@ -2123,15 +2075,8 @@ (defstate complete (desert-chase-chase-manager) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 4)) - (suspend) - ) - ) - (let ((t9-1 (-> (find-parent-state) code))) - (if t9-1 - ((the-as (function none) t9-1)) - ) + (suspend-for (seconds 4) ) + (call-parent-state-handler code) ) ) diff --git a/test/decompiler/reference/jak3/levels/desert/chase/desert-jump_REF.gc b/test/decompiler/reference/jak3/levels/desert/chase/desert-jump_REF.gc index 86862e3ec7..1640d40142 100644 --- a/test/decompiler/reference/jak3/levels/desert/chase/desert-jump_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/chase/desert-jump_REF.gc @@ -1020,10 +1020,7 @@ ) ) ) - (let ((gp-7 (current-time))) - (until (time-elapsed? gp-7 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (send-event self 'complete) ) diff --git a/test/decompiler/reference/jak3/levels/desert/chase/wcar-marauder-b_REF.gc b/test/decompiler/reference/jak3/levels/desert/chase/wcar-marauder-b_REF.gc index 176291683e..4cb9857bae 100644 --- a/test/decompiler/reference/jak3/levels/desert/chase/wcar-marauder-b_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/chase/wcar-marauder-b_REF.gc @@ -381,10 +381,6 @@ (if (and *target* (focus-test? *target* pilot-riding) (not (logtest? (vehicle-flag vf55) (-> self v-flags)))) (turbo-pickup-spawn (-> self root trans)) ) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) ) diff --git a/test/decompiler/reference/jak3/levels/desert/des-bbush-tasks_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-bbush-tasks_REF.gc index 889ceaa2ab..61906b80ad 100644 --- a/test/decompiler/reference/jak3/levels/desert/des-bbush-tasks_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/des-bbush-tasks_REF.gc @@ -653,10 +653,7 @@ (script-eval gp-0) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (while (not (-> *setting-control* user-current speech-control)) (suspend) diff --git a/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc index 2873b6f0fa..d40693c562 100644 --- a/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc @@ -972,10 +972,7 @@ ) ) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (set-time! (-> self state-time)) (while (and (nonzero? (get-status *gui-control* (the-as sound-id (-> self message-id)))) @@ -1582,11 +1579,8 @@ (send-event *camera* 'teleport-to-transformq s4-0) ) (set! (-> self update-fov?) #t) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 3)) - (set! (-> *camera* slave 0 fov) (-> *burning-bush-get-on-info* (-> self info index) fov)) - (suspend) - ) + (suspend-for (seconds 3) + (set! (-> *camera* slave 0 fov) (-> *burning-bush-get-on-info* (-> self info index) fov)) ) (set! (-> self update-fov?) #f) (set! (-> *camera-combiner* trans quad) (-> s5-0 quad)) diff --git a/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc index e5b4822ae3..8d990e515c 100644 --- a/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc @@ -816,11 +816,7 @@ 0 ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (hud-timer-handler self) ) :code (behavior () @@ -3213,7 +3209,3 @@ #f ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/des-cactus_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-cactus_REF.gc index c5258801d7..f68134502d 100644 --- a/test/decompiler/reference/jak3/levels/desert/des-cactus_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/des-cactus_REF.gc @@ -392,10 +392,7 @@ ) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (cleanup-for-death self) ) @@ -707,7 +704,3 @@ (:rotate-y (degrees 0) (degrees 3600)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/hover/des-beast-2_REF.gc b/test/decompiler/reference/jak3/levels/desert/hover/des-beast-2_REF.gc index 60134e87d2..231241b26a 100644 --- a/test/decompiler/reference/jak3/levels/desert/hover/des-beast-2_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/hover/des-beast-2_REF.gc @@ -305,11 +305,7 @@ (defstate impact (beast-grenade-2) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) @@ -375,11 +371,7 @@ (defstate dissipate (beast-grenade-2) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) @@ -893,20 +885,14 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (until (ja-done? 0) (suspend) ) (logior! (-> self skel effect flags) (effect-control-flag ecf1)) (do-effect (-> self skel effect) "death-default" 0.0 -1) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (go-virtual die) ) diff --git a/test/decompiler/reference/jak3/levels/desert/hover/mh-flyer_REF.gc b/test/decompiler/reference/jak3/levels/desert/hover/mh-flyer_REF.gc index f4d9be8ab0..51e7ba4171 100644 --- a/test/decompiler/reference/jak3/levels/desert/hover/mh-flyer_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/hover/mh-flyer_REF.gc @@ -211,11 +211,7 @@ ) ) :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) @@ -259,11 +255,7 @@ (defstate dissipate (mh-flyer-shot) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) @@ -1334,10 +1326,7 @@ (if (-> self skel effect) (do-effect (-> self skel effect) "death-default" 0.0 -1) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (cleanup-for-death self) ) diff --git a/test/decompiler/reference/jak3/levels/desert/hover/scorpion-gun_REF.gc b/test/decompiler/reference/jak3/levels/desert/hover/scorpion-gun_REF.gc index 10ddf8473c..ee3424e611 100644 --- a/test/decompiler/reference/jak3/levels/desert/hover/scorpion-gun_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/hover/scorpion-gun_REF.gc @@ -2135,16 +2135,10 @@ (send-event self 'use-camera #f) (send-event (handle->process (-> self gun)) 'shutdown) (send-event *camera* 'change-target (handle->process (-> self last-beast))) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (send-event (handle->process (-> self scorp)) 'set-control-hook-player) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 4)) - (suspend) - ) + (suspend-for (seconds 4) ) (until (process-release? *target*) (suspend) @@ -2185,10 +2179,7 @@ (send-event *camera* 'change-target (handle->process (-> self scorp))) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (let* ((v1-7 (-> *game-info* sub-task-list (game-task-node desert-beast-battle-kill-last-beast))) (v1-9 (if (-> v1-7 manager) diff --git a/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard-task_REF.gc b/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard-task_REF.gc index 899b613b3d..bc1561a529 100644 --- a/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard-task_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard-task_REF.gc @@ -294,13 +294,10 @@ ) ) (when (time-elapsed? (-> self state-time) (seconds 5)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (set! (-> self sound-id) - (add-process *gui-control* self (gui-channel background) (gui-action queue) "hudchime" -99.0 0) - ) - (suspend) - ) + (suspend-for (seconds 1) + (set! (-> self sound-id) + (add-process *gui-control* self (gui-channel background) (gui-action queue) "hudchime" -99.0 0) + ) ) (sound-params-set! *gui-control* (-> self sound-id) #f -1 -1 -1 1.0) (set-action! @@ -634,11 +631,7 @@ :virtual #t :code (behavior () (send-event (handle->process (-> self vehicle-handle)) 'go-die) - (let ((t9-2 (-> (find-parent-state) code))) - (if t9-2 - ((the-as (function none) t9-2)) - ) - ) + (call-parent-state-handler code) ) ) diff --git a/test/decompiler/reference/jak3/levels/desert/race/course-race_REF.gc b/test/decompiler/reference/jak3/levels/desert/race/course-race_REF.gc index 01c0022f35..291ce54bf7 100644 --- a/test/decompiler/reference/jak3/levels/desert/race/course-race_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/race/course-race_REF.gc @@ -284,11 +284,7 @@ :virtual #t :code (behavior () (task-manager-race-method-36 self) - (let ((t9-2 (-> (find-parent-state) code))) - (if t9-2 - ((the-as (function none) t9-2)) - ) - ) + (call-parent-state-handler code) ) ) @@ -604,10 +600,7 @@ ) #f (label cfg-123) - (let ((gp-7 (current-time))) - (until (time-elapsed? gp-7 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event (handle->process (-> self player-vehicle)) 'go-die) (remove-setting! 'entity-name) @@ -676,11 +669,7 @@ (set-setting! 'vehicles 'set (shr t1-0 32) t1-0) ) (set! (-> self start-continue) (the-as continue-point "desertb-race-start")) - (let ((t9-2 (-> (find-parent-state) code))) - (if t9-2 - ((the-as (function none) t9-2)) - ) - ) + (call-parent-state-handler code) ) ) @@ -696,20 +685,13 @@ ) (task-node-close! (game-task-node desert-course-race-win) 'event) (send-event (ppointer->process *race-manager*) 'kill-npc-racers) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while (handle->process (-> self scene-player)) (suspend) ) ) - (let ((t9-6 (-> (find-parent-state) code))) - (if t9-6 - ((the-as (function none) t9-6)) - ) - ) + (call-parent-state-handler code) ) ) @@ -887,11 +869,7 @@ (process-spawn hud-wasbbv-goal-time :init hud-init-by-other :name "hud-wasbbv-goal-time" :to self) ) ) - (let ((t9-7 (-> (find-parent-state) code))) - (if t9-7 - ((the-as (function none) t9-7)) - ) - ) + (call-parent-state-handler code) ) ) @@ -1073,10 +1051,6 @@ (process-spawn hud-wasbbv-goal-time :init hud-init-by-other :name "hud-wasbbv-goal-time" :to self) ) ) - (let ((t9-6 (-> (find-parent-state) code))) - (if t9-6 - ((the-as (function none) t9-6)) - ) - ) + (call-parent-state-handler code) ) ) diff --git a/test/decompiler/reference/jak3/levels/desert/race/turtle-training_REF.gc b/test/decompiler/reference/jak3/levels/desert/race/turtle-training_REF.gc index d319ee1ebd..918c05d479 100644 --- a/test/decompiler/reference/jak3/levels/desert/race/turtle-training_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/race/turtle-training_REF.gc @@ -374,16 +374,10 @@ (set! (-> gp-0 map-icon) (the-as uint 12)) (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 self))) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 4)) - (print-training-text self (text-id text-05e6)) - (suspend) - ) + (suspend-for (seconds 4) + (print-training-text self (text-id text-05e6)) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (set! (-> self time-limit) (seconds 30)) (set-time! (-> self start-time)) @@ -409,10 +403,7 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (set! (-> self show-message?) #f) (set! (-> self goal-pos quad) (-> self goal-array 1 pos quad)) @@ -444,10 +435,7 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (let ((gp-7 (current-time))) - (until (time-elapsed? gp-7 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (set! (-> self time-limit) (seconds 28)) (set-time! (-> self start-time)) @@ -467,10 +455,7 @@ (sound-play "special-pickup") (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (set! (-> self show-message?) #f) (set! (-> self goal-pos quad) (-> self goal-array 2 pos quad)) @@ -519,10 +504,7 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (let ((gp-12 (current-time))) - (until (time-elapsed? gp-12 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (set! (-> self goal-pos quad) (-> self goal-array 3 pos quad)) (let ((gp-13 (new 'stack-no-clear 'task-arrow-params))) @@ -552,10 +534,7 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (let ((gp-15 (current-time))) - (until (time-elapsed? gp-15 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (set! (-> self goal-pos quad) (-> self goal-array 4 pos quad)) (let ((gp-16 (new 'stack-no-clear 'task-arrow-params))) @@ -589,10 +568,7 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (let ((gp-18 (current-time))) - (until (time-elapsed? gp-18 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (set! (-> self goal-pos quad) (-> self goal-array 5 pos quad)) (let ((gp-19 (new 'stack-no-clear 'task-arrow-params))) @@ -634,7 +610,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc index 51374c488f..3606006b4c 100644 --- a/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc @@ -1992,11 +1992,7 @@ :virtual #t :event task-manager-event-handler :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set! (-> self entity) #f) (dotimes (v1-2 (-> self passenger-pos length)) (if (-> self passenger-pos v1-2 is-final?) @@ -2786,10 +2782,7 @@ ((-> (method-of-type task-manager active) trans)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'fail) (sleep-code) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc index 89afaa23c2..e1c3c9b8d8 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc @@ -272,10 +272,7 @@ (w-parking-spot-method-23 self) ) (until #f - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.25)) - (suspend) - ) + (suspend-for (seconds 0.25) ) (w-parking-spot-method-21 self) (when (-> self should-spawn?) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-marauder_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-marauder_REF.gc index f4e45728c4..558a8223fe 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-marauder_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-marauder_REF.gc @@ -523,10 +523,6 @@ (if (and *target* (focus-test? *target* pilot-riding)) (turbo-pickup-spawn (-> self root trans)) ) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) ) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc index c66c64151b..4c189d7090 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc @@ -229,11 +229,7 @@ (defstate waiting (wvehicle) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (when (-> self minimap) @@ -419,7 +415,3 @@ (cleanup-for-death self) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc b/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc index 0c292e9fce..6f3453383a 100644 --- a/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc @@ -1257,11 +1257,7 @@ :enter (behavior () (rlet ((vf0 :class vf)) (init-vf0-vector) - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (let ((gp-0 (-> self child))) (while gp-0 (send-event (ppointer->process gp-0) 'traffic-off) diff --git a/test/decompiler/reference/jak3/levels/factory/car/wcar-faccar_REF.gc b/test/decompiler/reference/jak3/levels/factory/car/wcar-faccar_REF.gc index 902b4f5696..0187ad5aab 100644 --- a/test/decompiler/reference/jak3/levels/factory/car/wcar-faccar_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/car/wcar-faccar_REF.gc @@ -173,10 +173,8 @@ process (lambda :behavior process ((arg0 handle)) - (let ((s5-0 (current-time)) - (s4-0 (current-time)) - ) - (until (time-elapsed? s4-0 (seconds 0.65)) + (let ((s5-0 (current-time))) + (suspend-for (seconds 0.65) (when (time-elapsed? s5-0 (seconds 0.06)) (set! s5-0 (current-time)) (let ((s3-0 (handle->process arg0))) @@ -200,7 +198,6 @@ ) ) ) - (suspend) ) ) #f @@ -440,7 +437,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/fac-gunturret_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-gunturret_REF.gc index 5d6f6f9d80..f2dc03c255 100644 --- a/test/decompiler/reference/jak3/levels/factory/fac-gunturret_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/fac-gunturret_REF.gc @@ -704,28 +704,25 @@ (sound-group) (-> self root trans) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.75)) - (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> self aim-pos quad)) - (track-target self #t) - (vector-! s5-2 (-> self aim-pos) s5-2) - (when (time-elapsed? (-> self snd-cmd-time) (seconds 0.12)) - 0.0 - (vector-length s5-2) - (sound-play-by-name - (static-sound-name "smallturret-rot") - (-> self rotate-sound) - 1024 - (the int (* 1524.0 (* 0.5 (doppler-pitch-shift (-> self root trans) (-> self root transv))))) - 0 - (sound-group) - (-> self root trans) - ) - (set-time! (-> self snd-cmd-time)) + (suspend-for (seconds 0.75) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (set! (-> s5-2 quad) (-> self aim-pos quad)) + (track-target self #t) + (vector-! s5-2 (-> self aim-pos) s5-2) + (when (time-elapsed? (-> self snd-cmd-time) (seconds 0.12)) + 0.0 + (vector-length s5-2) + (sound-play-by-name + (static-sound-name "smallturret-rot") + (-> self rotate-sound) + 1024 + (the int (* 1524.0 (* 0.5 (doppler-pitch-shift (-> self root trans) (-> self root transv))))) + 0 + (sound-group) + (-> self root trans) ) + (set-time! (-> self snd-cmd-time)) ) - (suspend) ) ) (when (-> self rotate-sound-playing) @@ -912,17 +909,11 @@ (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root trans quad)) (+! (-> gp-1 y) 12288.0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 2)) - (spawn (-> self part) gp-1) - (suspend) - ) + (suspend-for (seconds 2) + (spawn (-> self part) gp-1) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (while (-> self child) @@ -1151,7 +1142,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc index 0454e12305..51c62ed625 100644 --- a/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc @@ -930,10 +930,7 @@ ) (logior! (-> self flags) (fac-robotank-turret-flag frt3)) (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (let ((gp-2 (max 2 (min 3 (rand-vu-int-range 0 3))))) 0 @@ -960,11 +957,8 @@ ) ) ) - (let ((f30-0 (rand-vu-float-range 0.05 0.43)) - (s4-2 (current-time)) - ) - (until (time-elapsed? s4-2 (the int (* 300.0 f30-0))) - (suspend) + (let ((f30-0 (rand-vu-float-range 0.05 0.43))) + (suspend-for (the int (* 300.0 f30-0)) ) ) ) @@ -982,10 +976,8 @@ 2.11 ) ) - (gp-3 (current-time)) ) - (until (time-elapsed? gp-3 (the int (* 300.0 f30-1))) - (suspend) + (suspend-for (the int (* 300.0 f30-1)) ) ) ) @@ -1004,10 +996,7 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while (-> self child) (suspend) @@ -1126,7 +1115,3 @@ (set! (-> self turn-sound-id) (new-sound-id)) (go-virtual ready) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc index 33963db970..391ebd0e4e 100644 --- a/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc @@ -604,10 +604,7 @@ ) :code (behavior () (logclear! (-> self flags) (robotank-flag r2)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (logior! (-> self flags) (robotank-flag r2)) (sleep-code) @@ -776,10 +773,7 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (while (-> self child) (suspend) @@ -1016,7 +1010,3 @@ (the-as fac-robotank gp-0) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc index e6b4b39c56..f77749884f 100644 --- a/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc @@ -273,10 +273,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) ) :post ja-post @@ -1087,7 +1084,3 @@ ) :post transform-post ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc index 0da4978651..aa143346e8 100644 --- a/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc @@ -1929,11 +1929,7 @@ :virtual #t :enter (behavior () (send-event (handle->process (-> self hud-damage)) 'hide-and-die) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) ) diff --git a/test/decompiler/reference/jak3/levels/factory/factoryc-obs2_REF.gc b/test/decompiler/reference/jak3/levels/factory/factoryc-obs2_REF.gc index fcb4cc4768..a414a62b06 100644 --- a/test/decompiler/reference/jak3/levels/factory/factoryc-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/factoryc-obs2_REF.gc @@ -952,15 +952,12 @@ (process-entity-status! self (entity-perm-status subtask-complete) #t) (cond ((not arg0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.3)) - (let* ((f28-0 (lerp-clamp 0.0 3640.889 (* 0.011111111 (the float (- (current-time) (-> self state-time)))))) - (f30-0 (cos f28-0)) - (f0-2 (sin f28-0)) - ) - (quaternion-set! (-> self lever-jmod rotation) f0-2 0.0 0.0 f30-0) - ) - (suspend) + (suspend-for (seconds 0.3) + (let* ((f28-0 (lerp-clamp 0.0 3640.889 (* 0.011111111 (the float (- (current-time) (-> self state-time)))))) + (f30-0 (cos f28-0)) + (f0-2 (sin f28-0)) + ) + (quaternion-set! (-> self lever-jmod rotation) f0-2 0.0 0.0 f30-0) ) ) (let ((gp-2 (res-lump-struct (-> self entity) 'cutaway-camera structure))) @@ -969,11 +966,8 @@ (suspend) ) (set-setting! 'entity-name gp-2 0.0 0) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 3)) - '() - (suspend) - ) + (suspend-for (seconds 3) + '() ) (remove-setting! 'entity-name) (while (not (process-release? *target*)) @@ -1168,18 +1162,10 @@ :virtual #t :event plat-event :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) ) :code (behavior () - (let ((t9-1 (-> (find-parent-state) code))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (call-parent-state-handler code) ) ) @@ -1237,14 +1223,11 @@ :trans plat-trans :code (behavior () (let ((f30-0 (-> self dead-set-time))) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 3)) - (set! (-> self path-pos) - (lerp-clamp (get-norm! (-> self sync) 0) f30-0 (* 0.0011111111 (the float (- (current-time) gp-0)))) - ) - (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) - (suspend) - ) + (suspend-for (seconds 3) + (set! (-> self path-pos) + (lerp-clamp (get-norm! (-> self sync) 0) f30-0 (* 0.0011111111 (the float (- (current-time) time)))) + ) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) ) (suspend) (set! (-> self path-pos) f30-0) @@ -1345,18 +1328,10 @@ ) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) ) :code (behavior () - (let ((t9-1 (-> (find-parent-state) code))) - (if t9-1 - ((the-as (function none) t9-1)) - ) - ) + (call-parent-state-handler code) ) ) @@ -2147,7 +2122,3 @@ (go perish-immediately) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/factoryc-obs_REF.gc b/test/decompiler/reference/jak3/levels/factory/factoryc-obs_REF.gc index 1bd1f9d7f2..0bccf52e9b 100644 --- a/test/decompiler/reference/jak3/levels/factory/factoryc-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/factoryc-obs_REF.gc @@ -1204,78 +1204,73 @@ (defstate flickering (factory-elec-gate) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 3)) - (let ((s5-0 (the-as int (rand-uint31-gen *random-generator*)))) - (let ((s4-0 0) - (s3-0 3) - ) - (while (>= s3-0 s4-0) - (cond - ((logtest? s5-0 1) - (when (not (-> self beams-on s4-0)) - (let ((v1-8 (-> self beams s4-0)) - (a0-1 1) - ) - (let ((a1-1 (!= a0-1 (-> v1-8 state mode)))) - (case a0-1 - ((3) - (if a1-1 - (set! (-> v1-8 state counter) 0.0) - ) - ) - ((1) - (set! (-> v1-8 state start-color) (-> v1-8 spec start-color)) - (set! (-> v1-8 state end-color) (-> v1-8 spec end-color)) - ) - ) + (suspend-for (seconds 3) + (let ((s5-0 (the-as int (rand-uint31-gen *random-generator*)))) + (let ((s4-0 0) + (s3-0 3) + ) + (while (>= s3-0 s4-0) + (cond + ((logtest? s5-0 1) + (when (not (-> self beams-on s4-0)) + (let ((v1-8 (-> self beams s4-0)) + (a0-1 1) ) - (set! (-> v1-8 state mode) (the-as uint a0-1)) - ) - (set! (-> self beams-on s4-0) #t) - (set-factoryc-light! 1.0 1) - ) - ) - (else - (when (-> self beams-on s4-0) - (let ((v1-17 (-> self beams s4-0)) - (a0-5 3) - ) - (let ((a1-12 (!= a0-5 (-> v1-17 state mode)))) - (case a0-5 - ((3) - (if a1-12 - (set! (-> v1-17 state counter) 0.0) - ) - ) - ((1) - (set! (-> v1-17 state start-color) (-> v1-17 spec start-color)) - (set! (-> v1-17 state end-color) (-> v1-17 spec end-color)) - ) - ) + (let ((a1-1 (!= a0-1 (-> v1-8 state mode)))) + (case a0-1 + ((3) + (if a1-1 + (set! (-> v1-8 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-8 state start-color) (-> v1-8 spec start-color)) + (set! (-> v1-8 state end-color) (-> v1-8 spec end-color)) + ) + ) + ) + (set! (-> v1-8 state mode) (the-as uint a0-1)) + ) + (set! (-> self beams-on s4-0) #t) + (set-factoryc-light! 1.0 1) + ) + ) + (else + (when (-> self beams-on s4-0) + (let ((v1-17 (-> self beams s4-0)) + (a0-5 3) + ) + (let ((a1-12 (!= a0-5 (-> v1-17 state mode)))) + (case a0-5 + ((3) + (if a1-12 + (set! (-> v1-17 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-17 state start-color) (-> v1-17 spec start-color)) + (set! (-> v1-17 state end-color) (-> v1-17 spec end-color)) + ) ) - (set! (-> v1-17 state mode) (the-as uint a0-5)) ) - (set! (-> self beams-on s4-0) #f) - (set-factoryc-light! 0.0 1) + (set! (-> v1-17 state mode) (the-as uint a0-5)) ) + (set! (-> self beams-on s4-0) #f) + (set-factoryc-light! 0.0 1) ) ) - (set! s5-0 (/ s5-0 2)) - (+! s4-0 1) - ) - ) - (let ((s4-1 (current-time))) - (until (time-elapsed? s4-1 (seconds 0.1)) - (if (logand s5-0 1) - (sound-play "laser-loop" :id (-> self bzzt-sound) :position (-> self entity trans)) - ) - (suspend) ) + (set! s5-0 (/ s5-0 2)) + (+! s4-0 1) ) ) - (suspend) + (suspend-for (seconds 0.1) + (if (logand s5-0 1) + (sound-play "laser-loop" :id (-> self bzzt-sound) :position (-> self entity trans)) + ) + ) ) + (empty-form) ) (process-entity-status! self (entity-perm-status subtask-complete) #t) (process-entity-status! self (entity-perm-status dead) #t) @@ -1363,7 +1358,3 @@ (go (method-of-object this flickering)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/lfacrm2-mood_REF.gc b/test/decompiler/reference/jak3/levels/factory/lfacrm2-mood_REF.gc index 9f30d7c421..430cc0ad48 100644 --- a/test/decompiler/reference/jak3/levels/factory/lfacrm2-mood_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/lfacrm2-mood_REF.gc @@ -32,11 +32,7 @@ :virtual #t :enter (behavior () (set! (-> self mysound) (sound-play "elevator-a")) - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (sound-stop (-> self mysound)) @@ -67,11 +63,7 @@ (-> gp-0 id) ) ) - (let ((t9-5 (-> (find-parent-state) trans))) - (if t9-5 - (t9-5) - ) - ) + (call-parent-state-handler trans) ) :code (behavior () (when (not (nonzero? (res-lump-value (-> self entity) 'start-gate-up uint128 :time -1000000000.0))) @@ -81,11 +73,7 @@ (ja :num! (seek! max 1.333)) ) ) - (let ((t9-5 (-> (find-parent-state) code))) - (if t9-5 - ((the-as (function none) t9-5)) - ) - ) + (call-parent-state-handler code) ) ) @@ -114,11 +102,8 @@ (defstate dormant (fac-elevator-a) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1.5)) - '() - (suspend) - ) + (suspend-for (seconds 1.5) + '() ) (ja-no-eval :group! fac-elevator-a-gate_down-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -238,7 +223,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc b/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc index 5d9f546f5a..9109d5d16d 100644 --- a/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc @@ -720,11 +720,7 @@ ) (process-spawn warf-explosion-sphere gp-0 :name "warf-explosion-sphere" :to self) ) - (let ((t9-8 (-> (find-parent-state) enter))) - (if t9-8 - (t9-8) - ) - ) + (call-parent-state-handler enter) ) :code (behavior () (while (< (-> self hit-pos w) 245760.0) @@ -1651,7 +1647,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/forest/forest-ring-chase_REF.gc b/test/decompiler/reference/jak3/levels/forest/forest-ring-chase_REF.gc index 43f4261bbd..12457ce49a 100644 --- a/test/decompiler/reference/jak3/levels/forest/forest-ring-chase_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/forest-ring-chase_REF.gc @@ -561,10 +561,7 @@ (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 8)) - (suspend) - ) + (suspend-for (seconds 8) ) ) ) @@ -1137,13 +1134,10 @@ (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 584) :duration (seconds 1)) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (if (nonzero? (-> self sound-id)) - (sound-play "statue-expl-bu" :id (-> self sound-id)) - ) - (suspend) - ) + (suspend-for (seconds 1) + (if (nonzero? (-> self sound-id)) + (sound-play "statue-expl-bu" :id (-> self sound-id)) + ) ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) @@ -1179,10 +1173,7 @@ (transform-post) (sound-play "statue-explode") (for-statue-method-28 self) - (let ((gp-6 (current-time))) - (until (time-elapsed? gp-6 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (cleanup-for-death self) (let ((a1-15 (new 'stack-no-clear 'event-message-block))) @@ -2520,11 +2511,8 @@ ) (suspend) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 3)) - (format *stdebug* "task-manager-forest-ring-chase: done!~%") - (suspend) - ) + (suspend-for (seconds 3) + (format *stdebug* "task-manager-forest-ring-chase: done!~%") ) (while (-> self use-camera?) (suspend) @@ -2696,7 +2684,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/forest/forest-tasks_REF.gc b/test/decompiler/reference/jak3/levels/forest/forest-tasks_REF.gc index fdef21c44c..e05b12a804 100644 --- a/test/decompiler/reference/jak3/levels/forest/forest-tasks_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/forest-tasks_REF.gc @@ -88,10 +88,7 @@ :virtual #t :code (behavior () (local-vars (a1-12 event-message-block) (gp-3 symbol)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (until (and (-> self manager-entity) (= (-> *game-info* counter) 0.0)) (suspend) @@ -168,10 +165,7 @@ (until (process-grab? *target* #f) (suspend) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (let ((a1-14 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-14 from) (process->ppointer self)) @@ -328,10 +322,7 @@ (suspend) (set! (-> self manager-entity) (entity-by-name "for-machine-manager-1")) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((gp-1 (-> self entity extra perm))) (logior! (-> gp-1 status) (entity-perm-status bit-5)) @@ -350,10 +341,7 @@ ) (set! (-> gp-1 user-object 0) (+ (the-as int (-> gp-1 user-object 0)) 1)) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (set! sv-16 (new 'static 'res-tag)) (let ((v1-33 (res-lump-data (-> self manager-entity) 'actor-groups pointer :tag-ptr (& sv-16)))) diff --git a/test/decompiler/reference/jak3/levels/gungame/gun-dummy_REF.gc b/test/decompiler/reference/jak3/levels/gungame/gun-dummy_REF.gc index 3b6414f06c..75821f27c4 100644 --- a/test/decompiler/reference/jak3/levels/gungame/gun-dummy_REF.gc +++ b/test/decompiler/reference/jak3/levels/gungame/gun-dummy_REF.gc @@ -1195,11 +1195,7 @@ ((time-elapsed? (-> self arm-start-time) (seconds 2)) ) ) - (let ((t9-5 (-> (find-parent-state) trans))) - (if t9-5 - (t9-5) - ) - ) + (call-parent-state-handler trans) ) ) @@ -2310,7 +2306,3 @@ (defmethod gun-dummy-method-35 ((this gun-dummy-cit-clank)) 1 ) - - - - diff --git a/test/decompiler/reference/jak3/levels/gungame/gungame-manager_REF.gc b/test/decompiler/reference/jak3/levels/gungame/gungame-manager_REF.gc index bcac763312..6618eb9aaf 100644 --- a/test/decompiler/reference/jak3/levels/gungame/gungame-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/gungame/gungame-manager_REF.gc @@ -1822,11 +1822,7 @@ '() ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (if (search-process-tree *active-pool* (lambda ((arg0 process)) (type? arg0 gungame-manager))) (return 0) ) @@ -1961,22 +1957,12 @@ ) (set-setting! 'features 'clear (shr t1-0 32) t1-0) ) - (cond - ((>= 1 (-> self course-list length)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) - ) - ) - (else - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) + (if (>= 1 (-> self course-list length)) + (suspend-for (seconds 1) + ) + (suspend-for (seconds 0.5) ) ) - ) (let ((gp-2 (get-process *default-dead-pool* (-> self activated-course etype) #x4000 1))) (when gp-2 (let ((t9-3 (method-of-type process activate))) diff --git a/test/decompiler/reference/jak3/levels/gungame/gungame-obs_REF.gc b/test/decompiler/reference/jak3/levels/gungame/gungame-obs_REF.gc index 0a1e9f2952..db629001b8 100644 --- a/test/decompiler/reference/jak3/levels/gungame/gungame-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/gungame/gungame-obs_REF.gc @@ -153,11 +153,8 @@ :event gungame-door-handler :code (behavior () (sound-play "gungame-door") - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.2)) - (suspend) - (suspend) - ) + (suspend-for (seconds 0.2) + (suspend) ) (ja-no-eval :group! fort-entry-gate-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -335,7 +332,3 @@ (transform-post) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/intro/intro-scenes_REF.gc b/test/decompiler/reference/jak3/levels/intro/intro-scenes_REF.gc index 17eae2e73c..c9cc2dbe6a 100644 --- a/test/decompiler/reference/jak3/levels/intro/intro-scenes_REF.gc +++ b/test/decompiler/reference/jak3/levels/intro/intro-scenes_REF.gc @@ -234,9 +234,8 @@ ) (set! (-> gp-0 scale-x) 1.0) (set! (-> gp-0 scale-y) 1.0) - (when (and s5-0 (-> gp-0 tid)) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 (seconds 3)) + (if (and s5-0 (-> gp-0 tid)) + (suspend-for (seconds 3) (let ((f0-2 1.0)) (cond ((< f30-0 1.0) @@ -256,10 +255,8 @@ (if (not (paused?)) (+! f30-0 (seconds-per-frame)) ) - (suspend) ) ) - ) ) (none) ) @@ -310,9 +307,8 @@ (set-vector! (-> gp-0 pos) 256 188 #xffffff 0) (set! (-> gp-0 tid) (the-as texture-id (get-texture JakIII inttitle-minimap))) (set! (-> s5-0 tid) (the-as texture-id #f)) - (when (and s4-0 (-> gp-0 tid)) - (let ((s3-0 (current-time))) - (until (time-elapsed? s3-0 (seconds 4.33)) + (if (and s4-0 (-> gp-0 tid)) + (suspend-for (seconds 4.33) (let ((f0-2 1.0)) (cond ((< f30-0 0.5) @@ -336,10 +332,8 @@ (if (not (paused?)) (+! f30-0 (seconds-per-frame)) ) - (suspend) ) ) - ) ) (none) ) @@ -358,13 +352,10 @@ (lambda :behavior scene-player () (talker-spawn-func (-> *talker-speech* 61) self (target-pos 0) (the-as region #f)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 5)) - (if (cpad-pressed? 0 square) - (return #f) - ) - (suspend) - ) + (suspend-for (seconds 5) + (if (cpad-pressed? 0 square) + (return #f) + ) ) (none) ) @@ -6186,7 +6177,3 @@ :on-complete #f ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc b/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc index 895ff07d18..a927ca337e 100644 --- a/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc +++ b/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc @@ -330,10 +330,7 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while *scene-player* (suspend) @@ -372,10 +369,7 @@ (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 325) :mat-joint gp-1) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (logior! (-> self draw status) (draw-control-status no-draw)) (let ((t0-2 (res-lump-struct (-> self entity) 'camera-name structure))) @@ -1433,11 +1427,7 @@ ) (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active)) ) - (let ((t9-3 (-> (find-parent-state) trans))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler trans) ) ) diff --git a/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs2_REF.gc b/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs2_REF.gc index 44841a9827..3f5a1e6414 100644 --- a/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs2_REF.gc @@ -437,11 +437,7 @@ :virtual #t :parent (mhcity-puffer-large puffer-active-base-state) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -461,11 +457,7 @@ :virtual #t :parent (mhcity-puffer-large puffer-active-base-state) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -479,7 +471,3 @@ #f ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs_REF.gc b/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs_REF.gc index 452bec635a..8e63eb5945 100644 --- a/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs_REF.gc @@ -924,10 +924,7 @@ (ja :num! (seek!)) ) (logior! (-> self draw status) (draw-control-status no-draw)) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (task-node-close! (game-task-node city-destroy-darkeco-resolution) 'event) (sleep-code) @@ -981,10 +978,7 @@ (label cfg-9) (ja-channel-push! 1 (seconds 0.5)) (ja :group! mhcity-dark-eco-door-idle-ja :num! (seek! 15.0) :frame-num 15.0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (go-virtual cracked) ) @@ -1318,10 +1312,7 @@ (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 326)) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (process-entity-status! self (entity-perm-status dead) #t) ) @@ -2452,7 +2443,3 @@ ) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc b/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc index bf82e546bf..55220c6335 100644 --- a/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc @@ -2055,10 +2055,7 @@ (ja-channel-push! 1 (seconds 0.4)) (ja-no-eval :group! gekko-run0-a-ja :num! (seek!) :frame-num 0.0) (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.4)) - (suspend) - ) + (suspend-for (seconds 0.4) ) (if (enemy-method-109 self) (go-die self) diff --git a/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc index 4e0ec94c8a..be59ef7f02 100644 --- a/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc @@ -633,10 +633,7 @@ (suspend) (ja :num! (seek! max 0.03)) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (go-virtual inactive) ) @@ -1467,10 +1464,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((a1-0 (new 'stack-no-clear 'array 'symbol 3))) (set! (-> a1-0 2) 'mine6) @@ -1829,10 +1823,7 @@ :virtual #t :code (behavior () (sound-play "floor-switch") - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (when (not (task-node-closed? (game-task-node mine-blow-introduction))) (let ((a1-1 (new 'stack-no-clear 'array 'symbol 3))) diff --git a/test/decompiler/reference/jak3/levels/mine/mine-platforms_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-platforms_REF.gc index 2349de605e..4dfbd2be4f 100644 --- a/test/decompiler/reference/jak3/levels/mine/mine-platforms_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/mine-platforms_REF.gc @@ -503,10 +503,7 @@ ) :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (let ((gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (s5-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) @@ -703,10 +700,7 @@ :trans plat-trans :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (ja-channel-push! 1 0) (ja-no-eval :group! min-rotating-plat-idle-ja :num! min) @@ -1417,10 +1411,7 @@ ) :trans rider-trans :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1.5)) - (suspend) - ) + (suspend-for (seconds 1.5) ) (when (-> self stop-sound) (set! (-> self stop-sound) #f) @@ -1641,10 +1632,7 @@ ) :code (behavior () (when (-> self play-ramp-sound?) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (until (= (get-status *gui-control* (-> self ramp-sound)) (gui-status ready)) (suspend) @@ -1829,10 +1817,7 @@ :trans rider-trans :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1.5)) - (suspend) - ) + (suspend-for (seconds 1.5) ) (when (-> self stop-bridge-sound) (set! (-> self stop-bridge-sound) #f) diff --git a/test/decompiler/reference/jak3/levels/mine/mine-train_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-train_REF.gc index ae7c27ff1f..8bbdb04575 100644 --- a/test/decompiler/reference/jak3/levels/mine/mine-train_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/mine-train_REF.gc @@ -528,10 +528,7 @@ (quaternion-normalize! (-> self root quat)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (when (type? (-> self root) collide-shape) (let ((v1-7 (-> self root root-prim))) @@ -989,7 +986,3 @@ ) (go (method-of-object this active)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/mine/rat_REF.gc b/test/decompiler/reference/jak3/levels/mine/rat_REF.gc index 1ffc9e541a..12c960d875 100644 --- a/test/decompiler/reference/jak3/levels/mine/rat_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/rat_REF.gc @@ -763,11 +763,7 @@ (if (enemy-method-109 self) (go-virtual die) ) - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) ) @@ -2086,10 +2082,7 @@ (logior! (-> self entity extra perm status) (entity-perm-status subtask-complete)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while (-> self child) (suspend) diff --git a/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc b/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc index 9420d018b1..2b15e4ee76 100644 --- a/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc +++ b/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc @@ -1432,10 +1432,7 @@ (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 639)) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.6)) - (suspend) - ) + (suspend-for (seconds 0.6) ) (let ((v1-38 (-> self root root-prim))) (set! (-> v1-38 prim-core collide-as) (-> self root backup-collide-as)) @@ -1459,10 +1456,7 @@ ) ) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) ) (ja-channel-push! 1 0) (ja-no-eval :group! egg-spider-crawl-from-ground-ja :num! (seek!) :frame-num 0.0) diff --git a/test/decompiler/reference/jak3/levels/nest/mh-bat_REF.gc b/test/decompiler/reference/jak3/levels/nest/mh-bat_REF.gc index 07b5a2b1d1..93314b1d80 100644 --- a/test/decompiler/reference/jak3/levels/nest/mh-bat_REF.gc +++ b/test/decompiler/reference/jak3/levels/nest/mh-bat_REF.gc @@ -1237,11 +1237,7 @@ (defstate ambush (mh-bat) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set-time! (-> self state-time)) (set! (-> self start-pos quad) (-> self root trans quad)) (set-vector! (-> self root transv) 0.0 -81920.0 0.0 0.0) @@ -1366,11 +1362,7 @@ (defstate hostile (mh-bat) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set! (-> self bank-angle) 0.0) (set! (-> self pitch-angle) 0.0) (set! (-> self orbit-distance) (* 4096.0 (rnd-float-range self 17.0 30.0))) @@ -1925,7 +1917,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/nest/nst-obs_REF.gc b/test/decompiler/reference/jak3/levels/nest/nst-obs_REF.gc index 5bc2aa3f32..aa2e360c9e 100644 --- a/test/decompiler/reference/jak3/levels/nest/nst-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/nest/nst-obs_REF.gc @@ -167,10 +167,7 @@ ) ) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (cleanup-for-death self) ) @@ -859,10 +856,7 @@ (when (-> self actor-group) (let ((f30-0 (* 0.0005 (the float (-> self actor-group length))))) (dotimes (gp-8 (-> self actor-group length)) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (the int (* 300.0 f30-0))) - (suspend) - ) + (suspend-for (the int (* 300.0 f30-0)) ) (let ((a1-24 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-24 from) (process->ppointer self)) @@ -1368,10 +1362,7 @@ ) :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) (when (-> self anim) (-> self draw bounds w) @@ -1968,18 +1959,12 @@ (set! (-> self cycling?) #t) (spawn (-> self charge-up-part) (-> self node-list data 12 bone transform trans)) (set! (-> self cycle-rot) -1820.4445) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (ja :num! (loop!)) - (suspend) - ) + (suspend-for (seconds 0.5) + (ja :num! (loop!)) ) (set! (-> self cycle-rot) 1820.4445) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 0.5)) - (ja :num! (loop!)) - (suspend) - ) + (suspend-for (seconds 0.5) + (ja :num! (loop!)) ) (set! (-> self cycling?) #f) (set! (-> self shots-left) (the-as uint 4)) @@ -2162,18 +2147,12 @@ (if (>= (-> self palette-id) 0) (set-nstb-lights! (-> self palette-id) 4.0 8.0 #f) ) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (if (>= (-> self palette-id) 0) (set-nstb-lights! (-> self palette-id) 0.0 6.0 #f) ) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 0.35)) - (suspend) - ) + (suspend-for (seconds 0.35) ) (let ((gp-6 (-> self child))) (while gp-6 @@ -2778,7 +2757,3 @@ (ja-post) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/precursor/precura-obs2_REF.gc b/test/decompiler/reference/jak3/levels/precursor/precura-obs2_REF.gc index d104361125..35da5d3d35 100644 --- a/test/decompiler/reference/jak3/levels/precursor/precura-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/precursor/precura-obs2_REF.gc @@ -1793,10 +1793,7 @@ (let ((gp-0 (res-lump-data (-> self entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and gp-0 (nonzero? (-> sv-16 elt-count))) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (set! (-> self actor-group-count) (the-as int (-> sv-16 elt-count))) (set! (-> self actor-group) (the-as (pointer actor-group) gp-0)) diff --git a/test/decompiler/reference/jak3/levels/precursor/precura-obs_REF.gc b/test/decompiler/reference/jak3/levels/precursor/precura-obs_REF.gc index c0c6d2b2fb..9a04e27431 100644 --- a/test/decompiler/reference/jak3/levels/precursor/precura-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/precursor/precura-obs_REF.gc @@ -8,10 +8,8 @@ process (lambda :behavior process () - (let ((gp-0 (current-time)) - (s5-0 (current-time)) - ) - (until (time-elapsed? s5-0 (seconds 1)) + (let ((gp-0 (current-time))) + (suspend-for (seconds 1) (when (time-elapsed? gp-0 (seconds 0.03)) (set! gp-0 (current-time)) (process-drawable-shock-effect @@ -24,7 +22,6 @@ 40960.0 ) ) - (suspend) ) ) #f @@ -1165,26 +1162,17 @@ ) (logior! (-> self draw status) (draw-control-status no-draw)) (transform-post) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1.2)) - (suspend) - ) + (suspend-for (seconds 1.2) ) (when (res-lump-struct (-> self entity) 'art-name structure) (logclear! (-> self mask) (process-mask actor-pause)) (process-grab? *target* #f) (set-setting! 'entity-name "camera-359" 0.0 0) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (task-close! "precursor-tour-generator-trigger") (send-event (process-by-name "precur-door-b-4" *active-pool*) 'open) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (set-setting! 'interp-time 'abs 450.0 0) (remove-setting! 'entity-name) @@ -2796,10 +2784,7 @@ (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) ) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1.5)) - (suspend) - ) + (suspend-for (seconds 1.5) ) (set-setting! 'entity-name "camera-420" 0.0 0) (process-grab? *target* #f) @@ -2877,10 +2862,7 @@ ) :code (behavior () (when (-> self precur-tour?) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2.5)) - (suspend) - ) + (suspend-for (seconds 2.5) ) (remove-setting! 'entity-name) (process-release? *target*) diff --git a/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc b/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc index 943c2ce01e..e6c8543e9a 100644 --- a/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc @@ -914,10 +914,7 @@ 0 (set! (-> self hit-points) 0.0) (do-effect (-> self skel effect) (the-as string 'death-default) 0.0 -1) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (cleanup-for-death self) @@ -1421,7 +1418,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/sewer/neo-juicer_REF.gc b/test/decompiler/reference/jak3/levels/sewer/neo-juicer_REF.gc index f64e9aa327..c6f294da5d 100644 --- a/test/decompiler/reference/jak3/levels/sewer/neo-juicer_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/neo-juicer_REF.gc @@ -1343,57 +1343,55 @@ (s5-0 (+ (-> v1-29 attack-id) 1)) ) (set! (-> v1-29 attack-id) s5-0) - (let ((s4-0 (current-time))) - (until (time-elapsed? s4-0 (seconds 0.25)) - (ja-no-eval :group! neo-juicer-attack0-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (let ((s3-0 (handle->process (-> self focus handle)))) - (when s3-0 - (when (< 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable s3-0) 0))) - (spawn-proj! self (the-as process-focusable s3-0) s5-0) - (current-time) - (if (not gp-0) - (set! gp-0 #t) + (suspend-for (seconds 0.25) + (ja-no-eval :group! neo-juicer-attack0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((s3-0 (handle->process (-> self focus handle)))) + (when s3-0 + (when (< 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable s3-0) 0))) + (spawn-proj! self (the-as process-focusable s3-0) s5-0) + (current-time) + (if (not gp-0) + (set! gp-0 #t) + ) + ) + ) + ) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (b! + (not (and (-> self using-turn-anim) (let ((v1-73 (ja-group))) + (not (and v1-73 (= v1-73 neo-juicer-attack-turn-ja))) + ) ) - ) - ) - ) - (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) - (go-virtual victory) - ) - (b! - (not (and (-> self using-turn-anim) (let ((v1-73 (ja-group))) - (not (and v1-73 (= v1-73 neo-juicer-attack-turn-ja))) - ) - ) - ) - cfg-31 - :delay (empty-form) - ) + ) + cfg-31 + :delay (empty-form) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! neo-juicer-attack-turn-ja) + (b! #t cfg-42 :delay (nop!)) + (label cfg-31) + (when (and (not (-> self using-turn-anim)) (let ((v1-84 (ja-group))) + (not (and v1-84 (= v1-84 neo-juicer-attack0-ja))) + ) + ) (ja-channel-push! 1 (seconds 0.05)) - (ja :group! neo-juicer-attack-turn-ja) - (b! #t cfg-42 :delay (nop!)) - (label cfg-31) - (when (and (not (-> self using-turn-anim)) (let ((v1-84 (ja-group))) - (not (and v1-84 (= v1-84 neo-juicer-attack0-ja))) - ) - ) - (ja-channel-push! 1 (seconds 0.05)) - (ja :group! neo-juicer-attack0-ja) - ) - (label cfg-42) - (suspend) - (ja :num! (seek!)) - ) - (send-event (handle->process (-> self current-projectile)) 'die) - (let ((a0-37 (handle->process (-> self focus handle)))) - (when a0-37 - (if (>= 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable a0-37) 0))) - (go-virtual circling) - ) - ) + (ja :group! neo-juicer-attack0-ja) ) + (label cfg-42) (suspend) + (ja :num! (seek!)) + ) + (empty-form) + (send-event (handle->process (-> self current-projectile)) 'die) + (let ((a0-37 (handle->process (-> self focus handle)))) + (when a0-37 + (if (>= 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable a0-37) 0))) + (go-virtual circling) + ) + ) ) ) ) @@ -1863,7 +1861,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc b/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc index 05823a74a4..e14f9f4a5e 100644 --- a/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc @@ -1100,11 +1100,7 @@ :virtual #t :enter (behavior () (sound-play "sabfish-gethit") - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) ) @@ -1115,11 +1111,7 @@ (if (saberfish-method-243 self) (go-virtual swimming-hostile) ) - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -1132,11 +1124,7 @@ (handle-cmd self a1-2) ) ) - (let ((t9-4 (-> (find-parent-state) trans))) - (if t9-4 - (t9-4) - ) - ) + (call-parent-state-handler trans) ) :post saberfish-chase-post ) @@ -3118,11 +3106,7 @@ (set! (-> self swim-travel-anim) 0) 0 ) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (set! (-> self scare-time) 0) @@ -3161,13 +3145,9 @@ ) ) (saberfish-swim-travel-trans) - (when (>= (the-as int (-> self focus aware)) 2) - (let ((t9-9 (-> (find-parent-state) trans))) - (if t9-9 - (t9-9) - ) + (if (>= (the-as int (-> self focus aware)) 2) + (call-parent-state-handler trans) ) - ) ) :code (behavior () (saberfish-swim-code) @@ -3308,18 +3288,10 @@ :enter (behavior () (set! (-> self knocked-under-water?) #f) (set! (-> self move-to-ground?) #f) - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) ) ) @@ -3361,11 +3333,7 @@ (if (saberfish-method-243 self) (go-virtual knocked-recover-water) ) - (let ((t9-4 (-> (find-parent-state) enter))) - (if t9-4 - (t9-4) - ) - ) + (call-parent-state-handler enter) ) :code (behavior () (if (handle->process (-> self ragdoll-proc)) @@ -3373,10 +3341,7 @@ ) (ja-channel-push! 1 0) (ja-no-eval :group! saberfish-flip-up-start-ja :num! (seek!) :frame-num 0.0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.4)) - (suspend) - ) + (suspend-for (seconds 0.4) ) (ja-channel-push! 1 0) (ja-no-eval :group! saberfish-flip-up-ja :num! (seek!) :frame-num 0.0) @@ -3899,7 +3864,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/sewer/sew-laser-guard_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sew-laser-guard_REF.gc index 4c6d723674..95b2b2c2f5 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sew-laser-guard_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sew-laser-guard_REF.gc @@ -16,7 +16,6 @@ ) ;; definition for method 3 of type gun-turret-params -;; INFO: this function exists in multiple non-identical object files (defmethod inspect ((this gun-turret-params)) (when (not this) (set! this this) @@ -655,17 +654,11 @@ (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root trans quad)) (+! (-> gp-1 y) 10240.0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 2)) - (spawn (-> self part) gp-1) - (suspend) - ) + (suspend-for (seconds 2) + (spawn (-> self part) gp-1) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (while (-> self child) @@ -813,7 +806,3 @@ ) :code sleep-code ) - - - - diff --git a/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc index 4173b60447..4acd27d7bd 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc @@ -16,7 +16,6 @@ ) ;; definition for method 3 of type gun-turret-params -;; INFO: this function exists in multiple non-identical object files (defmethod inspect ((this gun-turret-params)) (when (not this) (set! this this) @@ -1149,17 +1148,11 @@ (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root trans quad)) (+! (-> gp-1 y) 10240.0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 2)) - (spawn (-> self part) gp-1) - (suspend) - ) + (suspend-for (seconds 2) + (spawn (-> self part) gp-1) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (while (-> self child) diff --git a/test/decompiler/reference/jak3/levels/sewer/sew-platforms_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sew-platforms_REF.gc index 4f1075ba0a..8e18111d04 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sew-platforms_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sew-platforms_REF.gc @@ -162,18 +162,10 @@ :virtual #t :enter (behavior () (set! (-> self last-played-start?) #f) - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (cond ((and (-> self last-played-start?) (< 0.9 (-> self path-pos))) (sound-play "moving-step-out") @@ -260,19 +252,11 @@ :virtual #t :enter (behavior () (set! (-> self last-played-start?) #f) - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set! (-> self last-val) -1.0) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (when (< (-> self path-pos) 0.5) (new 'stack-no-clear 'vector) (let ((gp-0 (new 'stack-no-clear 'matrix))) @@ -1016,7 +1000,3 @@ "Should this process be run? Checked by execute-process-tree." #t ) - - - - diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-obs2_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-obs2_REF.gc index 8f8e3baf30..000b148d19 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sewer-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-obs2_REF.gc @@ -254,19 +254,13 @@ :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (set-setting! 'mode-name 'cam-fixed 0.0 0) (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'entity-name "camera-353" 0.0 0) (process-grab? *target* #f) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (sound-play "gate-open") (ja-no-eval :group! sew-m-gate-gate-open-ja :num! (seek! max 0.1) :frame-num 0.0) @@ -278,10 +272,7 @@ (remove-setting! 'mode-name) (remove-setting! 'interp-time) (remove-setting! 'entity-name) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (process-release? *target*) (go-virtual raised) @@ -430,19 +421,13 @@ :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (set-setting! 'mode-name 'cam-fixed 0.0 0) (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'entity-name "camera-352" 0.0 0) (process-grab? *target* #f) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (sound-play "pipe-lower") (set-time! (-> self state-time)) @@ -458,10 +443,7 @@ (remove-setting! 'mode-name) (remove-setting! 'interp-time) (remove-setting! 'entity-name) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (process-release? *target*) (go-virtual down) @@ -660,7 +642,3 @@ (set! (-> this opened-x) (+ -32768.0 (-> this root trans x))) (go (method-of-object this closed)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc index 69144bbd1f..49496114c1 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc @@ -269,10 +269,7 @@ (defstate active (sew-cam-sequencer) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (until (process-grab? *target* #f) (suspend) @@ -282,20 +279,14 @@ (sew-cam-eval-script a0-1) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (-> self timeout)) - (suspend) - ) + (suspend-for (-> self timeout) ) (let ((a0-3 (-> self activate-script))) (if a0-3 (sew-cam-eval-script a0-3) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (the-as time-frame (-> self offset))) - (suspend) - ) + (suspend-for (the-as time-frame (-> self offset)) ) (let ((a0-5 (-> self exit-script))) (if a0-5 @@ -1527,19 +1518,13 @@ ) (let ((v1-25 (res-lump-value (-> self entity) 'extra-id uint128 :time -1000000000.0))) (when (= (the-as uint v1-25) 1) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (set-setting! 'mode-name 'cam-fixed 0.0 0) (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'entity-name "camera-300" 0.0 0) (process-grab? *target* #f) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((gp-2 (-> self actor-group 1))) (dotimes (s5-0 (-> gp-2 length)) @@ -1560,18 +1545,12 @@ ) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (remove-setting! 'mode-name) (remove-setting! 'interp-time) (remove-setting! 'entity-name) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (process-release? *target*) (go-virtual opened) @@ -2037,10 +2016,7 @@ (set-setting! 'entity-name "camera-224" 0.0 0) (set-setting! 'allow-progress #f 0.0 0) (process-grab? *target* #f) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (task-node-close! (game-task-node sewer-hum-kg-switch-off) 'event) (script-eval '(send-event "ctyinda-vingate-1" 'shutdown)) @@ -2055,10 +2031,7 @@ (the-as process #f) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 2.4)) - (suspend) - ) + (suspend-for (seconds 2.4) ) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) diff --git a/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc b/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc index f3f1cee5a6..7ff400e7d3 100644 --- a/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc +++ b/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc @@ -1122,10 +1122,7 @@ (set-time! (-> self state-time)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.6)) - (suspend) - ) + (suspend-for (seconds 0.6) ) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) @@ -1133,10 +1130,7 @@ ) (logclear! (-> self draw status) (draw-control-status no-draw)) (update-focus self) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) - (suspend) - ) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) ) (ja-channel-push! 1 0) (ja-no-eval :group! dm-mine-spider-climb-start-ja :num! (seek!) :frame-num 0.0) diff --git a/test/decompiler/reference/jak3/levels/temple/hover-training_REF.gc b/test/decompiler/reference/jak3/levels/temple/hover-training_REF.gc index bca2484f81..1b1cca6a88 100644 --- a/test/decompiler/reference/jak3/levels/temple/hover-training_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/hover-training_REF.gc @@ -915,17 +915,11 @@ (until (process-grab? *target* #f) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (persist-with-delay *setting-control* 'interp-time (seconds 4) 'interp-time 'abs 0.0 0) (set-setting! 'entity-name "camera-354" 0.0 0) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (task-node-close! (game-task-node temple-tests-hover-training) 'event) (until (process-release? *target*) @@ -1341,7 +1335,3 @@ (logclear! (-> this mask) (process-mask actor-pause)) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/temple/temple-obs2_REF.gc b/test/decompiler/reference/jak3/levels/temple/temple-obs2_REF.gc index 08a49474de..930bd076f1 100644 --- a/test/decompiler/reference/jak3/levels/temple/temple-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/temple-obs2_REF.gc @@ -111,10 +111,7 @@ (suspend) ) (set-setting! 'entity-name "camera-356" 0.0 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) ) (sound-play "gate-raise") @@ -124,10 +121,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) (process->ppointer self)) @@ -145,16 +139,10 @@ ) ) (when (= (-> self extra-id) 1) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (remove-setting! 'entity-name) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 2.5)) - (suspend) - ) + (suspend-for (seconds 2.5) ) (until (process-release? *target*) (suspend) @@ -468,10 +456,7 @@ :event tpl-watcher-manager-ehandler :trans watcher-man-trans :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (while (and *target* (focus-test? *target* dead)) (suspend) @@ -496,10 +481,7 @@ (suspend) ) (process-entity-status! self (entity-perm-status no-kill) #t) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2.5)) - (suspend) - ) + (suspend-for (seconds 2.5) ) (while (not (process-release? *target*)) (suspend) @@ -1014,11 +996,8 @@ ) ) (sound-play "wtcher-fire") - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - '() - (suspend) - ) + (suspend-for (seconds 1) + '() ) ) ) @@ -1088,10 +1067,7 @@ ) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 4)) - (suspend) - ) + (suspend-for (seconds 4) ) (while (-> self child) (suspend) @@ -1127,16 +1103,14 @@ :code (behavior () (let ((gp-0 (-> self root quat)) (s5-0 (-> self entity quat)) - (s4-0 (current-time)) ) - (until (time-elapsed? s4-0 (seconds 1.5)) + (suspend-for (seconds 1.5) (quaternion-slerp! (-> self root quat) gp-0 s5-0 (* 0.0022222223 (the float (- (current-time) (-> self state-time)))) ) - (suspend) ) ) (go-virtual idle) @@ -1820,10 +1794,8 @@ ) (quaternion-normalize! s5-2) (set-time! (-> self state-time)) - (let ((f30-1 (lerp-scale 45.0 9.0 (-> self clock clock-ratio) 1.0 0.05)) - (s4-2 (current-time)) - ) - (until (time-elapsed? s4-2 (the int f30-1)) + (let ((f30-1 (lerp-scale 45.0 9.0 (-> self clock clock-ratio) 1.0 0.05))) + (suspend-for (the int f30-1) (quaternion-slerp! (-> self root quat) gp-3 @@ -1831,7 +1803,6 @@ (/ (the float (- (current-time) (-> self state-time))) f30-1) ) (quaternion-normalize! (-> self root quat)) - (suspend) ) ) (quaternion-copy! (-> self root quat) s5-2) @@ -1850,12 +1821,9 @@ :virtual #t :trans rider-trans :code (behavior () - (let ((f30-0 (res-lump-float (-> self entity) 'tpl-platform-predelay)) - (gp-0 (current-time)) - ) - (until (time-elapsed? gp-0 (the int (* 300.0 f30-0))) + (let ((f30-0 (res-lump-float (-> self entity) 'tpl-platform-predelay))) + (suspend-for (the int (* 300.0 f30-0)) '() - (suspend) ) ) (go-virtual flip) @@ -1912,11 +1880,8 @@ :code (behavior () (set-time! (-> self state-time)) (set! (-> self state-time) (-> *display* real-clock frame-counter)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.25)) - '() - (suspend) - ) + (suspend-for (seconds 0.25) + '() ) (while (< (+ (-> *display* real-clock frame-counter) (seconds -1)) (-> self last-ridden)) (suspend) @@ -2131,11 +2096,7 @@ :virtual #t :enter (behavior () (setup-masks (-> self draw) 3 0) - (let ((t9-2 (-> (find-parent-state) enter))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (setup-masks (-> self draw) 1 2) diff --git a/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc b/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc index dd4b1c3e45..d892fd1a57 100644 --- a/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc @@ -486,18 +486,10 @@ (set! (-> gp-0 map-icon) (the-as uint 13)) (set! (-> self arrow-h) (process->handle (task-arrow-spawn gp-0 self))) ) - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (when (-> self arrow-h) (let ((gp-0 (-> self arrow-h process 0))) (when (and (< (vector-vector-distance (-> (the-as process-drawable gp-0) root trans) (target-pos 0)) 20480.0) @@ -581,11 +573,7 @@ (if (and *target* (focus-test? *target* light)) (send-event self 'complete) ) - (let ((t9-3 (-> (find-parent-state) trans))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler trans) ) ) @@ -1114,10 +1102,7 @@ (until (process-grab? *target* #f) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) ) ) @@ -1139,10 +1124,7 @@ (set! (-> self root scale z) (-> self root scale x)) (when (= (-> self root scale x) 0.0) (send-event (handle->process (-> self perm-part)) 'die) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (until (process-release? *target*) (suspend) @@ -2014,44 +1996,30 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (the int (-> self cycle-offset))) - (suspend) - ) + (suspend-for (the int (-> self cycle-offset)) ) (until #f - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (the int (-> self cycle-time))) - (suspend) - ) + (suspend-for (the int (-> self cycle-time)) ) (sound-play "fan-shake" :position (-> self root trans)) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.01)) - (let ((f0-5 (* 36408.89 (the float (- (current-time) gp-3)))) - (f1-3 (* 0.33333334 (- 3.0 (the float (- (current-time) gp-3))))) - ) - (set! (-> self shudder-angle) (* 0.0018204444 f1-3 (sin f0-5))) - ) - (suspend) + (suspend-for (seconds 0.01) + (let ((f0-5 (* 36408.89 (the float (- (current-time) time)))) + (f1-3 (* 0.33333334 (- 3.0 (the float (- (current-time) time))))) + ) + (set! (-> self shudder-angle) (* 0.0018204444 f1-3 (sin f0-5))) ) ) (set! (-> self shudder-angle) 0.0) - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 0.04)) - (suspend) - ) + (suspend-for (seconds 0.04) ) (sound-play "fan-turn" :position (-> self root trans)) (let* ((f0-9 100.0) (f30-1 (* 16384.0 f0-9)) - (gp-6 (current-time)) ) - (until (time-elapsed? gp-6 (seconds 0.01)) + (suspend-for (seconds 0.01) (set! (-> self rot-angle) (the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48)) ) - (suspend) ) ) (let ((v1-47 #x4000)) @@ -2488,10 +2456,7 @@ (script-eval (the-as pair gp-0)) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (cleanup-for-death self) (deactivate self) @@ -2678,10 +2643,7 @@ (script-eval (the-as pair gp-0)) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (cleanup-for-death self) (deactivate self) diff --git a/test/decompiler/reference/jak3/levels/title/title-obs_REF.gc b/test/decompiler/reference/jak3/levels/title/title-obs_REF.gc index 58c8a3dafb..1918397286 100644 --- a/test/decompiler/reference/jak3/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/title/title-obs_REF.gc @@ -220,10 +220,7 @@ (cond ((and (kiosk?) (or (cpad-pressed? 0 square) (time-elapsed? s5-1 (seconds 60)))) (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) - (let ((s5-2 (current-time))) - (until (time-elapsed? s5-2 (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) (set! s5-1 (current-time)) ) @@ -285,10 +282,7 @@ #x33001 #t ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.4)) - (suspend) - ) + (suspend-for (seconds 0.4) ) (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) (set! (-> *setting-control* user-current bg-a) 0.0) @@ -599,10 +593,7 @@ :code (behavior () (remove-setting! 'allow-timeout) (remove-setting! 'dialog-volume) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event (ppointer->process (-> self logo)) @@ -632,10 +623,7 @@ ) ) ) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (remove-setting! 'dust-storm-fog-scalar) (if (zero? (title-menu)) @@ -660,10 +648,7 @@ ) ) (until (= (-> *game-info* current-continue level) 'title) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) ) (go-virtual wait) @@ -1008,10 +993,7 @@ ) ) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 0.6)) - (suspend) - ) + (suspend-for (seconds 0.6) ) (process-spawn-function process diff --git a/test/decompiler/reference/jak3/levels/tower/tower-obs_REF.gc b/test/decompiler/reference/jak3/levels/tower/tower-obs_REF.gc index fddcb36a67..4f81400e14 100644 --- a/test/decompiler/reference/jak3/levels/tower/tower-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/tower/tower-obs_REF.gc @@ -396,10 +396,7 @@ :virtual #t :code (behavior () (logclear! (-> self draw status) (draw-control-status force-fade)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (process-spawn scene-player @@ -593,10 +590,7 @@ (set-time! (-> self state-time)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.75)) - (suspend) - ) + (suspend-for (seconds 0.75) ) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) @@ -606,15 +600,12 @@ (logclear! (-> self draw status) (draw-control-status no-draw)) (let ((f30-0 1.0)) 0.0 - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (the int (* 300.0 f30-0))) - (let ((f0-2 (fmax 0.0 (fmin 1.0 (/ (the float (- (current-time) gp-2)) (* 300.0 f30-0)))))) - (set-vector! (-> self draw color-mult) f0-2 f0-2 f0-2 1.0) - ) - (spawn-from-cspace (-> self part) (joint-node tow-energy-bridge-lod0-jg main)) - (ja-post) - (suspend) + (suspend-for (the int (* 300.0 f30-0)) + (let ((f0-2 (fmax 0.0 (fmin 1.0 (/ (the float (- (current-time) time)) (* 300.0 f30-0)))))) + (set-vector! (-> self draw color-mult) f0-2 f0-2 f0-2 1.0) ) + (spawn-from-cspace (-> self part) (joint-node tow-energy-bridge-lod0-jg main)) + (ja-post) ) ) (process-entity-status! self (entity-perm-status subtask-complete) #t) diff --git a/test/decompiler/reference/jak3/levels/volcano/spiky-frog_REF.gc b/test/decompiler/reference/jak3/levels/volcano/spiky-frog_REF.gc index aa82bba473..aba9167ab0 100644 --- a/test/decompiler/reference/jak3/levels/volcano/spiky-frog_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/spiky-frog_REF.gc @@ -950,13 +950,10 @@ :num! (identity (the float (+ (-> (the-as art-joint-anim spiky-frog-ball0-end-ja) frames num-frames) -1))) ) (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.411)) - (if (!= (-> self root gspot-pos y) -40959590.0) - (seek! (-> self root trans y) (-> self root gspot-pos y) (* 409600.0 (seconds-per-frame))) - ) - (suspend) - ) + (suspend-for (seconds 0.411) + (if (!= (-> self root gspot-pos y) -40959590.0) + (seek! (-> self root trans y) (-> self root gspot-pos y) (* 409600.0 (seconds-per-frame))) + ) ) ) (else @@ -1180,7 +1177,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/volcano/volcano-obs2_REF.gc b/test/decompiler/reference/jak3/levels/volcano/volcano-obs2_REF.gc index 7b39e48e6a..fec736909d 100644 --- a/test/decompiler/reference/jak3/levels/volcano/volcano-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/volcano-obs2_REF.gc @@ -68,11 +68,7 @@ :virtual #t :event rigid-body-object-event-handler :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (get-point-at-percent-along-path! (-> self path) (-> self rbody position) (-> self path-u) 'interp) (ja-no-eval :group! vol-lava-plat-idle-ja :num! zero) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1239,7 +1235,3 @@ (go-idle self) self ) - - - - diff --git a/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc b/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc index 367221fc1f..df0bab4b8a 100644 --- a/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc @@ -1132,10 +1132,7 @@ (set! (-> self stopped-up-by) (the-as handle #f)) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer self)) diff --git a/test/decompiler/reference/jak3/levels/volcano/volcanox-obs_REF.gc b/test/decompiler/reference/jak3/levels/volcano/volcanox-obs_REF.gc index 703922746a..c79643097a 100644 --- a/test/decompiler/reference/jak3/levels/volcano/volcanox-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/volcanox-obs_REF.gc @@ -397,10 +397,7 @@ (until (process-grab? *target* #f) (suspend) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) ) ) @@ -422,10 +419,7 @@ (set! (-> self root scale z) (-> self root scale x)) (when (= (-> self root scale x) 0.0) (send-event (handle->process (-> self perm-part)) 'die) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (until (process-release? *target*) (suspend) diff --git a/test/decompiler/reference/jak3/levels/wascity/defend/was-pre-game_REF.gc b/test/decompiler/reference/jak3/levels/wascity/defend/was-pre-game_REF.gc index cd9106ec79..9712e171b1 100644 --- a/test/decompiler/reference/jak3/levels/wascity/defend/was-pre-game_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/defend/was-pre-game_REF.gc @@ -2021,10 +2021,7 @@ ) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (-> self start-delay)) - (suspend) - ) + (suspend-for (-> self start-delay) ) (go-virtual fall) ) @@ -2292,10 +2289,7 @@ (sound-play "lose-icon") (send-event (ppointer->process (-> self parent)) 'done) (set! (-> self post-hook) #f) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 0.2)) - (suspend) - ) + (suspend-for (seconds 0.2) ) ) :post (behavior () @@ -3492,7 +3486,3 @@ (set-vector! (-> self draw color-emissive) 1.0 1.0 1.0 1.0) (go-virtual idle) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/dm-flyer_REF.gc b/test/decompiler/reference/jak3/levels/wascity/dm-flyer_REF.gc index fe99ce0a9c..40a17d7735 100644 --- a/test/decompiler/reference/jak3/levels/wascity/dm-flyer_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/dm-flyer_REF.gc @@ -213,11 +213,7 @@ ) ) :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) @@ -296,11 +292,7 @@ (defstate dissipate (dm-flyer-shot) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) diff --git a/test/decompiler/reference/jak3/levels/wascity/maker-projectile_REF.gc b/test/decompiler/reference/jak3/levels/wascity/maker-projectile_REF.gc index 5c40e5ffb8..47e02ce8e9 100644 --- a/test/decompiler/reference/jak3/levels/wascity/maker-projectile_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/maker-projectile_REF.gc @@ -766,11 +766,7 @@ ) ) :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (when (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) @@ -838,11 +834,8 @@ (set! (-> v1-85 prim-core collide-with) (collide-spec)) ) 0 - (let ((gp-4 (current-time))) - (until (time-elapsed? gp-4 (seconds 3)) - (suspend) - (suspend) - ) + (suspend-for (seconds 3) + (suspend) ) ) ) diff --git a/test/decompiler/reference/jak3/levels/wascity/palace/waspala-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/palace/waspala-obs_REF.gc index 5da0f85be4..7302e83a44 100644 --- a/test/decompiler/reference/jak3/levels/wascity/palace/waspala-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/palace/waspala-obs_REF.gc @@ -291,10 +291,7 @@ ) (let ((gp-0 27)) (set-setting! 'change-gun #t 0.0 0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) (set! (-> self gui-id) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) diff --git a/test/decompiler/reference/jak3/levels/wascity/tizard_REF.gc b/test/decompiler/reference/jak3/levels/wascity/tizard_REF.gc index 299343104a..76fca82e39 100644 --- a/test/decompiler/reference/jak3/levels/wascity/tizard_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/tizard_REF.gc @@ -89,11 +89,8 @@ ) :code (behavior () (when (-> self first-run?) - (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 0.05 0.12)))) - (s5-0 (current-time)) - ) - (until (time-elapsed? s5-0 gp-0) - (suspend) + (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 0.05 0.12))))) + (suspend-for gp-0 ) ) (set! (-> self path-base-u) (the float (rand-vu-int-count (-> self path curve num-cverts)))) @@ -176,11 +173,8 @@ :virtual #t :event tizard-event-handler :code (behavior () - (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 1.0 2.0)))) - (s5-0 (current-time)) - ) - (until (time-elapsed? s5-0 gp-0) - (suspend) + (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 1.0 2.0))))) + (suspend-for gp-0 ) ) (if (< 17294.223 (acos (vector-dot (-> self rotation-matrix fvec) (-> self path-dir)))) @@ -500,7 +494,3 @@ (set! (-> this first-run?) #t) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/wasall-tasks_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasall-tasks_REF.gc index 1fb33ca566..12555c013b 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasall-tasks_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasall-tasks_REF.gc @@ -175,10 +175,7 @@ ) (set-setting! 'fog-special-interp-targ #f f0-0 0) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 15)) - (suspend) - ) + (suspend-for (seconds 15) ) ) #f @@ -611,10 +608,7 @@ ) #f (label cfg-22) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (talker-spawn-func (-> *talker-speech* 88) *entity-pool* (target-pos 0) (the-as region #f)) (send-event self 'complete) @@ -740,10 +734,7 @@ (defstate active (oasis-defense-intro-manager) :virtual #t :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (open! (-> self node-info) 'event) (talker-spawn-func (-> *talker-speech* 83) *entity-pool* (target-pos 0) (the-as region #f)) @@ -910,11 +901,7 @@ (defstate active (task-manager-lock-wasdoors) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (set-setting! 'airlock #f 0.0 0) ) :trans (behavior () @@ -1282,7 +1269,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/wascity-turret_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wascity-turret_REF.gc index 9f68318c27..1733b3d662 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wascity-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wascity-turret_REF.gc @@ -726,11 +726,7 @@ (defstate shutdown (wascity-turret) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (wct-show-flut self #t) @@ -765,11 +761,7 @@ (setup-masks (-> self draw) 0 2) (set-setting! 'matrix-blend-turret-rot 'abs 5.0 0) (set-setting! 'lock-sound-camera-to-target #t 0.0 0) - (let ((t9-4 (-> (find-parent-state) enter))) - (if t9-4 - (t9-4) - ) - ) + (call-parent-state-handler enter) ) :exit (behavior () (setup-masks (-> self draw) 2 0) @@ -782,11 +774,7 @@ ) :trans (behavior () (wascity-turret-method-59 self) - (let ((t9-2 (-> (find-parent-state) trans))) - (if t9-2 - (t9-2) - ) - ) + (call-parent-state-handler trans) ) ) diff --git a/test/decompiler/reference/jak3/levels/wascity/wasdef-manager_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasdef-manager_REF.gc index 3bbc7fc02d..cf67ac9478 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasdef-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasdef-manager_REF.gc @@ -1819,10 +1819,7 @@ (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 4)) - (suspend) - ) + (suspend-for (seconds 4) ) ) :post (behavior () @@ -2248,10 +2245,7 @@ :code (behavior () (maker-method-38 self) (set! *maker-num-visible* (+ *maker-num-visible* -1)) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 3)) - (suspend) - ) + (suspend-for (seconds 3) ) (if (nonzero? (-> self explosion-sound-id)) (set-action! diff --git a/test/decompiler/reference/jak3/levels/wascity/wasgun-manager_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasgun-manager_REF.gc index c541d3dbff..a33215d7ab 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasgun-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasgun-manager_REF.gc @@ -1369,10 +1369,7 @@ (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (sound-play "point-missed" :position (wascity-turret-gun-pos)) (let ((v1-49 (handle->process (-> self mgr)))) diff --git a/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-tasks_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-tasks_REF.gc index 0cf4e62f92..5a5c8c67f8 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-tasks_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-tasks_REF.gc @@ -304,27 +304,19 @@ ) :code (behavior () (local-vars (a0-15 vector) (a1-7 vector) (gp-6 (function vector vector float))) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.1)) - (suspend) - ) + (suspend-for (seconds 0.1) ) (when (not (task-node-closed? (game-task-node nest-eggs-wall))) (until (level-get *level* 'wasdoors) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 1)) - (format *stdebug* "wait for player to get to garage~%") - (b! (task-node-closed? (game-task-node nest-eggs-wall)) cfg-34 :delay (nop!)) - (suspend) - ) + (suspend-for (seconds 1) + (format *stdebug* "wait for player to get to garage~%") + (b! (task-node-closed? (game-task-node nest-eggs-wall)) cfg-34 :delay (nop!)) + (empty-form) ) ) (setup-scorpion) (task-node-close! (game-task-node nest-eggs-get-to-scorpion) 'event) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) (let ((v1-20 (rand-vu-int-range 0 1))) (b! (nonzero? v1-20) cfg-11 :delay (empty-form)) @@ -336,10 +328,7 @@ ) ) (label cfg-13) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 4)) - (suspend) - ) + (suspend-for (seconds 4) ) (until (< (gp-6 a0-15 a1-7) 491520.0) (format *stdebug* "wait for player to drive to eggwall~%") @@ -366,19 +355,13 @@ (label cfg-25) (b! (handle->process (the-as handle gp-8)) cfg-24 :delay (nop!)) ) - (let ((gp-9 (current-time))) - (until (time-elapsed? gp-9 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) ) (label cfg-34) (setup-scorpion) (set-setting! 'music 'nesteggs 0.0 0) - (let ((gp-10 (current-time))) - (until (time-elapsed? gp-10 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((v1-57 (rand-vu-int-range 0 6))) (cond @@ -423,10 +406,7 @@ ) :code (behavior () (task-node-close! (-> self info final-node) 'event) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.6)) - (suspend) - ) + (suspend-for (seconds 0.6) ) (let ((v1-6 (rand-vu-int-range 0 3))) (cond @@ -444,17 +424,10 @@ ) ) ) - (let ((gp-5 (current-time))) - (until (time-elapsed? gp-5 (seconds 3)) - (format *stdebug* "task-manager-nest-cocoons: done!~%") - (suspend) - ) - ) - (let ((t9-12 (-> (find-parent-state) code))) - (if t9-12 - ((the-as (function none) t9-12)) - ) + (suspend-for (seconds 3) + (format *stdebug* "task-manager-nest-cocoons: done!~%") ) + (call-parent-state-handler code) ) ) @@ -523,7 +496,3 @@ (spawn-dust-storm-randomizer this) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadb-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadb-obs_REF.gc index 4d80ee3931..0b2f333689 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadb-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadb-obs_REF.gc @@ -1222,10 +1222,7 @@ ) ) :code (behavior () - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (set! *arena-trainer-checkpoint-valid* #t) (copy-string<-string (-> *training-fail* fail continue) "wasstada-checkpoint-3") @@ -1471,10 +1468,7 @@ ) (suspend) (ja-channel-set! 0) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (send-event self 'death-end) (while (-> self child) @@ -1576,7 +1570,3 @@ (logclear! (-> this mask) (process-mask actor-pause)) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadc-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadc-obs_REF.gc index c4efc9eb70..fd701b5880 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadc-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadc-obs_REF.gc @@ -34,18 +34,10 @@ (set! (-> gp-0 map-icon) (the-as uint 13)) (set! (-> self arrow-h) (process->handle (task-arrow-spawn gp-0 self))) ) - (let ((t9-3 (-> (find-parent-state) enter))) - (if t9-3 - (t9-3) - ) - ) + (call-parent-state-handler enter) ) :trans (behavior () - (let ((t9-1 (-> (find-parent-state) trans))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler trans) (when (-> self arrow-h) (let ((gp-0 (-> self arrow-h process 0))) (when (or (< (vector-vector-distance (-> (the-as process-drawable gp-0) root trans) (target-pos 0)) 12288.0) @@ -398,10 +390,7 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (ja-no-eval :group! wstd-fight-house-a-open-ja :num! (seek! 0.0) :frame-num 5.0) (until (ja-done? 0) @@ -2356,10 +2345,7 @@ ) (let ((gp-1 (-> *game-info* gun-type))) (set-setting! 'change-gun #t 0.0 0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) (set! (-> self gui-id) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) @@ -2375,11 +2361,8 @@ (send-event (-> v1-33 extra process) 'off) ) ) - (let ((gp-2 (current-time))) - (until (time-elapsed? gp-2 (seconds 2)) - (print-text self (-> self text-id)) - (suspend) - ) + (suspend-for (seconds 2) + (print-text self (-> self text-id)) ) (send-event self 'complete) (until #f @@ -2452,10 +2435,7 @@ ) (let ((gp-2 32)) (set-setting! 'change-gun #t 0.0 0) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) (set! (-> self gui-id) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) @@ -2470,11 +2450,8 @@ (send-event (-> v1-38 extra process) 'off) ) ) - (let ((gp-3 (current-time))) - (until (time-elapsed? gp-3 (seconds 2)) - (print-text self (-> self text-id)) - (suspend) - ) + (suspend-for (seconds 2) + (print-text self (-> self text-id)) ) (send-event self 'complete) (until #f @@ -2698,10 +2675,7 @@ (send-event (handle->process (-> self arrow-h)) 'leave) (send-event *target* 'end-mode 'darkjak) (send-event *target* 'end-mode 'grab) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (go-virtual complete) ) diff --git a/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc index ced7600953..28a6b37cf6 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc @@ -267,11 +267,7 @@ (defstate knocked-recover (wlander) :virtual #t :enter (behavior () - (let ((t9-1 (-> (find-parent-state) enter))) - (if t9-1 - (t9-1) - ) - ) + (call-parent-state-handler enter) (nav-enemy-method-184 self) (let ((a0-2 (-> self nav state)) (v1-5 *null-vector*) @@ -2859,7 +2855,3 @@ 0 (none) ) - - - -