From 0dccd048ef988770e5d5ff2cad2995e83882f139 Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Tue, 16 May 2023 23:08:35 +0100 Subject: [PATCH] better decomp of `set-subtask-hook!`, `sub-task-list` array and `*-setting!` macros (#2654) Improves code readability considerably. --- decompiler/IR2/Form.h | 1 + decompiler/IR2/FormExpressionAnalysis.cpp | 107 +- decompiler/config/jak2/all-types.gc | 10 +- .../underground_fighters/shuttle.gc | 393 +++-- goal_src/jak2/engine/ambient/ambient.gc | 4 +- goal_src/jak2/engine/camera/cam-layout.gc | 17 +- goal_src/jak2/engine/camera/cam-states.gc | 4 +- goal_src/jak2/engine/common_objs/elevator.gc | 6 +- goal_src/jak2/engine/common_objs/powerups.gc | 4 +- goal_src/jak2/engine/debug/editable-player.gc | 4 +- goal_src/jak2/engine/game/game-info-h.gc | 2 +- goal_src/jak2/engine/game/game-info.gc | 8 +- goal_src/jak2/engine/game/game-save.gc | 9 +- goal_src/jak2/engine/game/settings-h.gc | 2 +- goal_src/jak2/engine/game/settings.gc | 8 +- .../jak2/engine/game/task/task-control-h.gc | 599 +------- .../jak2/engine/game/task/task-control.gc | 30 +- goal_src/jak2/engine/load/loader.gc | 61 +- .../process-drawable/process-taskable.gc | 16 +- goal_src/jak2/engine/scene/scene.gc | 43 +- goal_src/jak2/engine/sound/gsound.gc | 77 +- .../jak2/engine/target/board/board-states.gc | 4 +- .../jak2/engine/target/board/target-board.gc | 12 +- goal_src/jak2/engine/target/logic-target.gc | 4 +- .../engine/target/mech_suit/mech-states.gc | 6 +- .../engine/target/mech_suit/target-mech.gc | 16 +- goal_src/jak2/engine/target/target-darkjak.gc | 32 +- goal_src/jak2/engine/target/target-death.gc | 40 +- goal_src/jak2/engine/target/target-gun.gc | 6 +- goal_src/jak2/engine/target/target-tube.gc | 4 +- goal_src/jak2/engine/target/target-turret.gc | 2 +- goal_src/jak2/engine/target/target2.gc | 2 +- goal_src/jak2/engine/ui/credits.gc | 8 +- .../jak2/engine/ui/progress/progress-draw.gc | 175 ++- goal_src/jak2/engine/ui/progress/progress.gc | 3 +- goal_src/jak2/levels/atoll/ash1-course.gc | 4 +- goal_src/jak2/levels/atoll/atoll-obs.gc | 4 +- goal_src/jak2/levels/atoll/sig0-course.gc | 22 +- .../jak2/levels/castle/boss/castle-baron.gc | 4 +- goal_src/jak2/levels/castle/pad/caspad-obs.gc | 2 +- .../jak2/levels/castle/pad/castle-tasks.gc | 51 +- .../jak2/levels/city/common/ctywide-obs.gc | 28 +- .../jak2/levels/city/common/ctywide-tasks.gc | 1262 ++++++++-------- .../jak2/levels/city/common/pilot-states.gc | 10 +- .../jak2/levels/city/common/traffic-engine.gc | 6 +- .../levels/city/common/traffic-manager.gc | 2 +- .../jak2/levels/city/common/vehicle-states.gc | 2 +- .../jak2/levels/city/common/vehicle-util.gc | 20 +- goal_src/jak2/levels/city/common/vehicle.gc | 4 +- .../levels/city/kid_escort/hal4-course.gc | 20 +- .../city/market/east/ashelin/ash4-course.gc | 6 +- .../market/west/brutter_kiosk/meet-brutter.gc | 1213 ++++++++-------- .../misc/collection_task/collection-task.gc | 245 ++-- .../city/misc/delivery/delivery-task.gc | 461 +++--- .../jak2/levels/city/onin_tent/onin-game.gc | 29 +- .../levels/city/oracle/oracle-training.gc | 631 ++++---- .../jak2/levels/city/port/mines/portrun.gc | 556 ++++--- .../jak2/levels/city/port/race/errol-chal.gc | 505 ++++--- .../city/side_missions/ctywide-bbush.gc | 665 +++++---- goal_src/jak2/levels/common/ai/bot.gc | 2 +- goal_src/jak2/levels/common/battle.gc | 4 +- .../levels/common/enemy/bombots/bombbot.gc | 532 ++++--- .../levels/common/enemy/hellcat/helldog.gc | 30 +- .../levels/common/entities/com-elevator.gc | 4 +- .../jak2/levels/common/races/race-manager.gc | 18 +- goal_src/jak2/levels/common/scene-actor.gc | 15 +- goal_src/jak2/levels/common/warp-gate.gc | 10 +- goal_src/jak2/levels/demo/demo-obs.gc | 30 +- goal_src/jak2/levels/dig/dig-obs.gc | 4 +- goal_src/jak2/levels/dig/dig3-obs.gc | 4 +- .../jak2/levels/drill_platform/drill-baron.gc | 2 +- .../drill_platform/drill-mech-master.gc | 60 +- .../jak2/levels/drill_platform/drill-obs.gc | 15 +- goal_src/jak2/levels/forest/forest-obs.gc | 1030 +++++++------ .../jak2/levels/forest/lifeseed/protect.gc | 641 ++++----- goal_src/jak2/levels/forest/pegasus.gc | 74 +- .../levels/fortress/ammo_dump/fordumpa-obs.gc | 4 +- .../levels/fortress/ammo_dump/fordumpc-obs.gc | 8 +- .../ammo_dump/fort-robotank-turret.gc | 4 +- .../fortress/ammo_dump/fort-robotank.gc | 18 +- .../jak2/levels/fortress/exit/forexita-obs.gc | 31 +- .../levels/fortress/rescue/forresca-obs.gc | 6 +- .../levels/fortress/rescue/forrescb-obs.gc | 218 ++- goal_src/jak2/levels/gungame/gungame-obs.gc | 50 +- goal_src/jak2/levels/hideout/hideout-obs.gc | 2 +- goal_src/jak2/levels/hiphog/hiphog-scenes.gc | 2 +- goal_src/jak2/levels/hiphog/whack.gc | 16 +- goal_src/jak2/levels/intro/intro-scenes.gc | 11 +- .../jak2/levels/landing_pad/castle-obs.gc | 6 +- .../mars_tomb/left/chase/target-indax.gc | 2 +- goal_src/jak2/levels/mars_tomb/tomb-obs.gc | 8 +- goal_src/jak2/levels/mars_tomb/tomb-water.gc | 6 +- .../jak2/levels/nest/boss/metalkor-states.gc | 22 +- .../jak2/levels/nest/boss/nestb-scenes.gc | 55 +- goal_src/jak2/levels/nest/nest-obs.gc | 4 +- goal_src/jak2/levels/outro/outro-scenes.gc | 2 +- .../jak2/levels/palace/boss/squid-states.gc | 4 +- .../palace/throne_room/palace-scenes.gc | 4 +- .../power_station/power_switches/ctypower.gc | 391 +++-- goal_src/jak2/levels/ruins/ruins-obs.gc | 21 +- goal_src/jak2/levels/ruins/ruins-scenes.gc | 2 +- goal_src/jak2/levels/sewer/hal2-course.gc | 2 +- goal_src/jak2/levels/sewer/sewer-obs2.gc | 2 +- goal_src/jak2/levels/sewer/sewer-scenes.gc | 8 +- .../levels/stadium/jetboard/skatea-obs.gc | 61 +- goal_src/jak2/levels/stadium/stadium-obs.gc | 303 ++-- goal_src/jak2/levels/strip/strip-obs.gc | 94 +- goal_src/jak2/levels/temple/mountain-obs.gc | 2 +- goal_src/jak2/levels/temple/mountain-obs2.gc | 4 +- goal_src/jak2/levels/temple/rhino.gc | 10 +- goal_src/jak2/levels/title/title-obs.gc | 30 +- goal_src/jak2/levels/underport/centipede.gc | 6 +- goal_src/jak2/levels/underport/sig5-course.gc | 14 +- goal_src/jak2/levels/underport/under-obs.gc | 2 +- .../jak2/levels/underport/underb-master.gc | 12 +- goal_src/jak2/pc/debug/default-menu-pc.gc | 8 +- goal_src/jak2/pc/util/font-encode-test.gc | 2 +- .../underground_fighters/shuttle_REF.gc | 405 +++--- .../reference/jak2/decompiler-macros.gc | 13 +- .../jak2/engine/ambient/ambient_REF.gc | 4 +- .../jak2/engine/camera/cam-layout_REF.gc | 17 +- .../jak2/engine/camera/cam-states_REF.gc | 4 +- .../jak2/engine/common_objs/elevator_REF.gc | 6 +- .../jak2/engine/common_objs/powerups_REF.gc | 4 +- .../jak2/engine/debug/editable-player_REF.gc | 8 +- .../jak2/engine/game/game-info-h_REF.gc | 2 +- .../jak2/engine/game/game-info_REF.gc | 8 +- .../jak2/engine/game/game-save_REF.gc | 9 +- .../jak2/engine/game/settings-h_REF.gc | 4 +- .../jak2/engine/game/settings_REF.gc | 8 +- .../engine/game/task/task-control-h_REF.gc | 4 +- .../jak2/engine/game/task/task-control_REF.gc | 18 +- .../reference/jak2/engine/load/loader_REF.gc | 4 +- .../process-drawable/process-taskable_REF.gc | 2 +- .../reference/jak2/engine/scene/scene_REF.gc | 41 +- .../reference/jak2/engine/sound/gsound_REF.gc | 6 +- .../engine/target/board/board-states_REF.gc | 4 +- .../engine/target/board/target-board_REF.gc | 16 +- .../jak2/engine/target/logic-target_REF.gc | 4 +- .../target/mech_suit/mech-states_REF.gc | 6 +- .../target/mech_suit/target-mech_REF.gc | 20 +- .../jak2/engine/target/target-darkjak_REF.gc | 32 +- .../jak2/engine/target/target-death_REF.gc | 40 +- .../jak2/engine/target/target-gun_REF.gc | 6 +- .../jak2/engine/target/target-tube_REF.gc | 4 +- .../jak2/engine/target/target-turret_REF.gc | 2 +- .../jak2/engine/target/target2_REF.gc | 2 +- .../reference/jak2/engine/ui/credits_REF.gc | 8 +- .../engine/ui/progress/progress-draw_REF.gc | 175 ++- .../jak2/engine/ui/progress/progress_REF.gc | 2 +- .../jak2/levels/atoll/ash1-course_REF.gc | 4 +- .../jak2/levels/atoll/atoll-obs_REF.gc | 4 +- .../jak2/levels/atoll/sig0-course_REF.gc | 22 +- .../levels/castle/boss/castle-baron_REF.gc | 4 +- .../jak2/levels/castle/pad/caspad-obs_REF.gc | 2 +- .../levels/castle/pad/castle-tasks_REF.gc | 55 +- .../levels/city/common/ctywide-obs_REF.gc | 24 +- .../levels/city/common/ctywide-tasks_REF.gc | 1282 ++++++++--------- .../levels/city/common/pilot-states_REF.gc | 10 +- .../levels/city/common/traffic-engine_REF.gc | 2 +- .../levels/city/common/traffic-manager_REF.gc | 6 +- .../levels/city/common/vehicle-states_REF.gc | 2 +- .../levels/city/common/vehicle-util_REF.gc | 6 +- .../jak2/levels/city/common/vehicle_REF.gc | 4 +- .../levels/city/kid_escort/hal4-course_REF.gc | 20 +- .../market/east/ashelin/ash4-course_REF.gc | 6 +- .../west/brutter_kiosk/meet-brutter_REF.gc | 1223 ++++++++-------- .../collection_task/collection-task_REF.gc | 245 ++-- .../city/misc/delivery/delivery-task_REF.gc | 463 +++--- .../levels/city/onin_tent/onin-game_REF.gc | 29 +- .../levels/city/oracle/oracle-training_REF.gc | 617 ++++---- .../levels/city/port/mines/portrun_REF.gc | 562 ++++---- .../levels/city/port/race/errol-chal_REF.gc | 519 ++++--- .../city/side_missions/ctywide-bbush_REF.gc | 673 +++++---- .../jak2/levels/common/ai/bot_REF.gc | 6 +- .../jak2/levels/common/battle_REF.gc | 4 +- .../common/enemy/bombots/bombbot_REF.gc | 548 ++++--- .../common/entities/com-elevator_REF.gc | 4 +- .../levels/common/races/race-manager_REF.gc | 16 +- .../jak2/levels/common/scene-actor_REF.gc | 15 +- .../jak2/levels/common/warp-gate_REF.gc | 10 +- .../jak2/levels/demo/demo-obs_REF.gc | 30 +- .../reference/jak2/levels/dig/dig-obs_REF.gc | 4 +- .../reference/jak2/levels/dig/dig3-obs_REF.gc | 4 +- .../levels/drill_platform/drill-baron_REF.gc | 2 +- .../drill_platform/drill-mech-master_REF.gc | 63 +- .../levels/drill_platform/drill-obs_REF.gc | 15 +- .../jak2/levels/forest/forest-obs_REF.gc | 1030 +++++++------ .../levels/forest/lifeseed/protect_REF.gc | 653 +++++---- .../jak2/levels/forest/pegasus_REF.gc | 72 +- .../fortress/ammo_dump/fordumpa-obs_REF.gc | 4 +- .../fortress/ammo_dump/fordumpc-obs_REF.gc | 8 +- .../ammo_dump/fort-robotank-turret_REF.gc | 4 +- .../fortress/ammo_dump/fort-robotank_REF.gc | 18 +- .../levels/fortress/exit/forexita-obs_REF.gc | 30 +- .../fortress/rescue/forresca-obs_REF.gc | 6 +- .../fortress/rescue/forrescb-obs_REF.gc | 223 ++- .../jak2/levels/gungame/gungame-obs_REF.gc | 54 +- .../jak2/levels/hideout/hideout-obs_REF.gc | 2 +- .../jak2/levels/hiphog/hiphog-scenes_REF.gc | 2 +- .../reference/jak2/levels/hiphog/whack_REF.gc | 16 +- .../jak2/levels/intro/intro-scenes_REF.gc | 11 +- .../jak2/levels/landing_pad/castle-obs_REF.gc | 6 +- .../mars_tomb/left/chase/target-indax_REF.gc | 2 +- .../jak2/levels/mars_tomb/tomb-obs_REF.gc | 8 +- .../jak2/levels/mars_tomb/tomb-water_REF.gc | 6 +- .../levels/nest/boss/metalkor-states_REF.gc | 22 +- .../jak2/levels/nest/boss/nestb-scenes_REF.gc | 55 +- .../jak2/levels/nest/nest-obs_REF.gc | 4 +- .../jak2/levels/outro/outro-scenes_REF.gc | 2 +- .../levels/palace/boss/squid-states_REF.gc | 4 +- .../palace/throne_room/palace-scenes_REF.gc | 4 +- .../power_switches/ctypower_REF.gc | 403 +++--- .../jak2/levels/ruins/ruins-obs_REF.gc | 21 +- .../jak2/levels/ruins/ruins-scenes_REF.gc | 2 +- .../jak2/levels/sewer/hal2-course_REF.gc | 2 +- .../jak2/levels/sewer/sewer-obs2_REF.gc | 2 +- .../jak2/levels/sewer/sewer-scenes_REF.gc | 8 +- .../levels/stadium/jetboard/skatea-obs_REF.gc | 17 +- .../jak2/levels/stadium/stadium-obs_REF.gc | 275 ++-- .../jak2/levels/strip/strip-obs_REF.gc | 94 +- .../jak2/levels/temple/mountain-obs2_REF.gc | 4 +- .../jak2/levels/temple/mountain-obs_REF.gc | 2 +- .../reference/jak2/levels/temple/rhino_REF.gc | 10 +- .../jak2/levels/title/title-obs_REF.gc | 30 +- .../jak2/levels/underport/centipede_REF.gc | 6 +- .../jak2/levels/underport/sig5-course_REF.gc | 14 +- .../jak2/levels/underport/under-obs_REF.gc | 2 +- .../levels/underport/underb-master_REF.gc | 12 +- 229 files changed, 10526 insertions(+), 11420 deletions(-) diff --git a/decompiler/IR2/Form.h b/decompiler/IR2/Form.h index f13118a006..1338926512 100644 --- a/decompiler/IR2/Form.h +++ b/decompiler/IR2/Form.h @@ -1240,6 +1240,7 @@ class DerefToken { return m_kind == Kind::FIELD_NAME && m_name == name; } + bool is_int() const { return m_kind == Kind::INTEGER_CONSTANT; } bool is_int(int x) const { return m_kind == Kind::INTEGER_CONSTANT && m_int_constant == x; } bool is_expr() const { return m_kind == Kind::INTEGER_EXPRESSION; } diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 267bdf4550..cf07c6be50 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -1,3 +1,6 @@ +#include +#include + #include "Form.h" #include "FormStack.h" #include "GenericElementMatcher.h" @@ -3307,11 +3310,27 @@ void FunctionCallElement::update_from_stack(const Env& env, ASSERT(head_obj.is_symbol("get-art-by-name-method")); head = pool.form("get-art-by-name"); } else { - if (head_obj.is_symbol() && - tp_type.method_from_type().base_type() == "setting-control" && - arg_forms.at(0)->to_form(env).is_symbol("*setting-control*") && - arg_forms.size() > 1) { + if (head_obj.is_symbol("set-subtask-hook!")) { + // change the integer argument to a constant. + auto arg2o = arg_forms.at(2)->to_form(env); + if (arg2o.is_int()) { + int hook = arg2o.as_int(); + static const std::vector hook_names = { + "TASK_MANAGER_INIT_HOOK", "TASK_MANAGER_CLEANUP_HOOK", + "TASK_MANAGER_UPDATE_HOOK", "TASK_MANAGER_CODE_HOOK", + "TASK_MANAGER_COMPLETE_HOOK", "TASK_MANAGER_FAIL_HOOK", + "TASK_MANAGER_EVENT_HOOK"}; + if (hook >= 0 && hook < hook_names.size()) { + arg_forms.at(2) = pool.alloc_single_element_form( + arg_forms.at(2)->parent_element, hook_names.at(hook)); + } + } + } else if (head_obj.is_symbol() && + tp_type.method_from_type().base_type() == "setting-control" && + arg_forms.at(0)->to_form(env).is_symbol("*setting-control*") && + arg_forms.size() > 1) { auto arg1_reg = get_form_reg_acc(arg_forms.at(1)); + bool has_params = true; if (arg1_reg && arg1_reg->reg().is_s6()) { std::string new_head; if (head_obj.is_symbol("add-setting")) { @@ -3320,6 +3339,7 @@ void FunctionCallElement::update_from_stack(const Env& env, new_head = "set-setting!"; } else if (head_obj.is_symbol("remove-setting")) { new_head = "remove-setting!"; + has_params = false; } if (!new_head.empty()) { auto oldp = head->parent_element; @@ -3327,24 +3347,70 @@ void FunctionCallElement::update_from_stack(const Env& env, head->parent_element = oldp; arg_forms.erase(arg_forms.begin()); arg_forms.erase(arg_forms.begin()); - if (arg_forms.size() > 3) { + if (has_params) { + auto argset = arg_forms.at(0)->to_string(env); + argset = argset.substr(1); + auto argsym = arg_forms.at(1)->to_string(env); + // convert the float param + if (env.version == GameVersion::Jak2) { + static const std::unordered_set use_degrees_settings = { + "matrix-blend-max-angle", + "fov", + }; + static const std::unordered_set use_meters_settings = { + "string-spline-max-move", + "string-spline-max-move-player", + "string-spline-accel", + "string-spline-accel-player", + "string-max-length", + "string-min-length", + "string-max-height", + "string-min-height", + "gun-max-height", + "gun-min-height", + "head-offset", + "foot-offset", + "extra-follow-height", + "target-height", + }; + auto argf = arg_forms.at(2); + arg_forms.at(2) = try_cast_simplify(argf, TypeSpec("float"), pool, env, true); + if (argsym != "'rel") { + if (use_degrees_settings.find(argset) != use_degrees_settings.end()) { + arg_forms.at(2) = try_cast_simplify(arg_forms.at(2), TypeSpec("degrees"), + pool, env, true); + } else if (use_meters_settings.find(argset) != use_meters_settings.end()) { + arg_forms.at(2) = try_cast_simplify(arg_forms.at(2), TypeSpec("meters"), + pool, env, true); + } + } + arg_forms.at(2)->parent_element = argf->parent_element; + } + // convert the int param + static const std::unordered_map use_bitenum_settings = + { + {"process-mask", "process-mask"}, + {"features", "game-feature"}, + {"slave-options", "cam-slave-options"}, + {"minimap", "minimap-flag"}, + {"task-mask", "task-mask"}, + }; + static const std::unordered_map use_enum_settings = { + {"sound-flava", "music-flava"}, + {"exclusive-task", "game-task"}, + }; auto argi = arg_forms.at(3); auto argi_o = argi->to_form(env); if (argi_o.is_int()) { - auto argset = arg_forms.at(0)->to_string(env); - if (argset == "'process-mask") { - auto en = env.dts->ts.try_enum_lookup("process-mask"); + if (use_bitenum_settings.find(argset) != use_bitenum_settings.end()) { + auto en = env.dts->ts.try_enum_lookup(use_bitenum_settings.at(argset)); if (en) { - arg_forms.at(3) = - cast_to_bitfield_enum(env.dts->ts.try_enum_lookup("process-mask"), - pool, env, argi_o.as_int()); + arg_forms.at(3) = cast_to_bitfield_enum(en, pool, env, argi_o.as_int()); } - } else if (argset == "'sound-flava") { - auto en = env.dts->ts.try_enum_lookup("music-flava"); + } else if (use_enum_settings.find(argset) != use_enum_settings.end()) { + auto en = env.dts->ts.try_enum_lookup(use_enum_settings.at(argset)); if (en) { - arg_forms.at(3) = - cast_to_int_enum(env.dts->ts.try_enum_lookup("music-flava"), pool, - env, argi_o.as_int()); + arg_forms.at(3) = cast_to_int_enum(en, pool, env, argi_o.as_int()); } } } @@ -3836,6 +3902,15 @@ void DerefElement::update_from_stack(const Env& env, return; } + auto as_simple_expr = m_base->try_as_element(); + if (env.version == GameVersion::Jak2 && as_simple_expr && as_simple_expr->expr().is_identity() && + as_simple_expr->expr().get_arg(0).is_sym_val() && + as_simple_expr->expr().get_arg(0).get_str() == "*game-info*" && m_tokens.size() >= 2 && + m_tokens.at(0).is_field_name("sub-task-list") && m_tokens.at(1).is_int()) { + m_tokens.at(1) = DerefToken::make_int_expr(cast_to_int_enum( + env.dts->ts.try_enum_lookup("game-task-node"), pool, env, m_tokens.at(1).int_constant())); + } + result->push_back(this); } diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index 2c55bd1520..757d998cd5 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -7800,7 +7800,7 @@ (subtitle symbol :offset-assert 276) (borrow pair) (doorway symbol) - (gen symbol) + (gem symbol) (half-speed symbol) (gun-buoy symbol) (double-jump symbol) @@ -9647,7 +9647,7 @@ (say 2) (talk 3) (show 4) - (shade 5) + (trade 5) (play 6) (menu 7) ) @@ -9833,7 +9833,7 @@ (complete-hook (function object)) (fail-hook (function object)) (event-hook (function process int symbol event-message-block object)) - (hooks (function object) 7 :overlay-at init-hook) ;; added, likely hidden + (hooks function 7 :overlay-at init-hook) ;; added, likely hidden (final-node game-task-node) (time-limit int32) (sphere-count int8) @@ -13107,7 +13107,7 @@ (give (_type_ symbol float handle) float 10) (task-complete? (_type_ game-task) symbol 11) (subtask-index-by-name (_type_ string) int 12) - (set-subtask-hook! (_type_ int int (function object :behavior task-manager)) (function object :behavior task-manager) 13) + (set-subtask-hook! (_type_ game-task-node int function) function 13) (actor-perm (_type_ actor-id) entity-perm 14) (task-perm-by-index (_type_ int) entity-perm 15) (copy-perms-from-level! (_type_ level) int 16) @@ -30888,7 +30888,7 @@ (define-extern draw-decoration-load-save (function menu-option font-context float int pointer)) (define-extern sort-task-node-result (function int none)) (define-extern find-mission-text-at-index (function int game-task-node-info)) -(define-extern draw-secret-list (function secret-item-option progress font-context int symbol float pointer)) +(define-extern draw-secret-list (function secret-item-option progress font-context int symbol float none)) (define-extern draw-highscore-icon (function menu-highscores-option uint int int float pointer)) (define-extern draw-highscore-cup "First int is an enum" (function texture-page int int int float float pointer)) (define-extern get-highscore-score "TODO - takes and returns an enum?" (function int int)) diff --git a/goal_src/jak2/characters/underground_fighters/shuttle.gc b/goal_src/jak2/characters/underground_fighters/shuttle.gc index 3fed939bcd..ffc992ef1d 100644 --- a/goal_src/jak2/characters/underground_fighters/shuttle.gc +++ b/goal_src/jak2/characters/underground_fighters/shuttle.gc @@ -1016,7 +1016,7 @@ ;; WARN: Return type mismatch float vs none. (defun shuttle-init ((arg0 task-manager) (arg1 (array city-shuttle-info))) - (set-setting! 'minimap 'clear 0 32) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) (let ((s3-0 *traffic-manager*) (s4-0 (new 'stack 'traffic-object-spawn-params)) ) @@ -1090,7 +1090,7 @@ (else (set! (-> arg0 start-time) (-> pp clock frame-counter)) (when (< (vector-vector-xz-distance (target-pos 0) (-> arg0 begin-pos)) 102400.0) - (set-setting! 'airlock #f 0 0) + (set-setting! 'airlock #f 0.0 0) (set! (-> arg0 data-int32 9) 1) ) ) @@ -1502,142 +1502,125 @@ (set-subtask-hook! *game-info* - 95 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 citizen-rebel) (arg1 object) (arg2 symbol)) - (case arg2 - (('task-done) - (format #t "task-done~%") - (set! (-> self sub-state) (+ (-> arg0 index) 2)) - (set! (-> *game-info* counter) (+ -1.0 (-> *game-info* counter))) - ) - ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 95 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) - (let ((v1-4 (entity-by-name "parking-spot-8"))) - (if v1-4 - (logior! (-> v1-4 extra perm status) (entity-perm-status bit-9)) - ) - ) - (shuttle-init self *city-shuttle-info*) - (none) + (game-task-node city-shuttle-shuttle) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 citizen-rebel) (arg1 object) (arg2 symbol)) + (case arg2 + (('task-done) + (format #t "task-done~%") + (set! (-> self sub-state) (+ (-> arg0 index) 2)) + (set! (-> *game-info* counter) (+ -1.0 (-> *game-info* counter))) + ) ) + (none) ) ) (set-subtask-hook! *game-info* - 95 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (let ((t9-0 shuttle-cleanup) - (a0-0 self) - ) - *city-shuttle-info* - (t9-0 a0-0) - ) - (send-event *traffic-manager* 'restore-default-settings) - (none) - ) + (game-task-node city-shuttle-shuttle) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) + (let ((v1-4 (entity-by-name "parking-spot-8"))) + (if v1-4 + (logior! (-> v1-4 extra perm status) (entity-perm-status bit-9)) ) - ) - -(set-subtask-hook! - *game-info* - 95 - 2 - (the-as - (function object) - (lambda :behavior task-manager () (shuttle-update self *city-shuttle-info* (the-as uint 95)) (none)) - ) - ) - -(set-subtask-hook! - *game-info* - 95 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-citizen :init hud-init-by-other :to self))) - (send-event *traffic-manager* 'set-target-level #x3f400000) - (send-event *traffic-manager* 'set-guard-target-count-range 4 0 1) - (send-event *traffic-manager* 'set-guard-target-count-range 5 0 1) - (send-event *traffic-manager* 'set-guard-target-count-range 0 0 2) - (send-event *traffic-manager* 'set-guard-target-count-range 1 0 3) - (while (zero? (-> self sub-state)) - (suspend) - ) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) - (suspend) - ) - (send-event *traffic-manager* 'set-alert-level 2) - (send-event *traffic-manager* 'set-alert-duration #xa4cb80) - (none) ) + (shuttle-init self *city-shuttle-info*) + (none) ) ) (set-subtask-hook! *game-info* - 95 - 5 - (the-as - (function object) - (lambda :behavior task-manager () (send-event (handle->process (-> self arrow)) 'die) (none)) + (game-task-node city-shuttle-shuttle) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (let ((t9-0 shuttle-cleanup) + (a0-0 self) + ) + *city-shuttle-info* + (t9-0 a0-0) + ) + (send-event *traffic-manager* 'restore-default-settings) + (none) ) ) (set-subtask-hook! *game-info* - 95 - 4 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (talker-spawn-func (-> *talker-speech* 97) *entity-pool* (target-pos 0) (the-as region #f)) - (let ((gp-1 (-> self clock frame-counter))) - (until #f - (let ((v1-4 0)) - (dotimes (a0-2 4) - (let ((a1-5 (handle->process (-> self slave (* a0-2 2))))) - (if (or (not a1-5) (and (-> a1-5 next-state) (= (-> a1-5 next-state name) 'inactive))) - (+! v1-4 1) - ) - ) + (game-task-node city-shuttle-shuttle) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager () (shuttle-update self *city-shuttle-info* (the-as uint 95)) (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-shuttle-shuttle) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-citizen :init hud-init-by-other :to self))) + (send-event *traffic-manager* 'set-target-level #x3f400000) + (send-event *traffic-manager* 'set-guard-target-count-range 4 0 1) + (send-event *traffic-manager* 'set-guard-target-count-range 5 0 1) + (send-event *traffic-manager* 'set-guard-target-count-range 0 0 2) + (send-event *traffic-manager* 'set-guard-target-count-range 1 0 3) + (while (zero? (-> self sub-state)) + (suspend) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (send-event *traffic-manager* 'set-alert-level 2) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-shuttle-shuttle) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager () (send-event (handle->process (-> self arrow)) 'die) (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-shuttle-shuttle) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (talker-spawn-func (-> *talker-speech* 97) *entity-pool* (target-pos 0) (the-as region #f)) + (let ((gp-1 (-> self clock frame-counter))) + (until #f + (let ((v1-4 0)) + (dotimes (a0-2 4) + (let ((a1-5 (handle->process (-> self slave (* a0-2 2))))) + (if (or (not a1-5) (and (-> a1-5 next-state) (= (-> a1-5 next-state name) 'inactive))) + (+! v1-4 1) + ) ) - (if (or (>= v1-4 4) (>= (- (-> self clock frame-counter) gp-1) (seconds 10))) - (goto cfg-23) - ) ) - (suspend) - 0 + (if (or (>= v1-4 4) (>= (- (-> self clock frame-counter) gp-1) (seconds 10))) + (goto cfg-23) + ) ) + (suspend) + 0 ) - #f - (label cfg-23) - (task-node-close! (game-task-node city-shuttle-resolution)) - (none) ) + #f + (label cfg-23) + (task-node-close! (game-task-node city-shuttle-resolution)) + (none) ) ) @@ -1696,61 +1679,56 @@ (set-subtask-hook! *game-info* - 279 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 citizen-rebel) (arg1 object) (arg2 symbol)) - (case arg2 - (('task-done) - (format #t "task-done~%") - (set! (-> self sub-state) (+ (-> arg0 index) 2)) - (set! (-> *game-info* counter) (+ -1.0 (-> *game-info* counter))) - ) - ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 279 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'airlock #f 0 0) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -687390.75 :y 40960.0 :z 3479224.2 :w 1.0) quad)) - (shuttle-init self *city-burning-bush-shuttle-1-info*) - (none) + (game-task-node city-burning-bush-shuttle-1-resolution) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 citizen-rebel) (arg1 object) (arg2 symbol)) + (case arg2 + (('task-done) + (format #t "task-done~%") + (set! (-> self sub-state) (+ (-> arg0 index) 2)) + (set! (-> *game-info* counter) (+ -1.0 (-> *game-info* counter))) + ) ) + (none) ) ) (set-subtask-hook! *game-info* - 279 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (let ((t9-0 shuttle-cleanup) - (a0-0 self) - ) - *city-burning-bush-shuttle-1-info* - (t9-0 a0-0) - ) - (send-event *traffic-manager* 'restore-default-settings) - (none) - ) - ) + (game-task-node city-burning-bush-shuttle-1-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -687390.75 :y 40960.0 :z 3479224.2 :w 1.0) quad)) + (shuttle-init self *city-burning-bush-shuttle-1-info*) + (none) + ) ) (set-subtask-hook! *game-info* - 279 - 2 + (game-task-node city-burning-bush-shuttle-1-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (let ((t9-0 shuttle-cleanup) + (a0-0 self) + ) + *city-burning-bush-shuttle-1-info* + (t9-0 a0-0) + ) + (send-event *traffic-manager* 'restore-default-settings) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-shuttle-1-resolution) + TASK_MANAGER_UPDATE_HOOK (lambda :behavior task-manager () (the-as symbol (shuttle-update self *city-burning-bush-shuttle-1-info* (the-as uint 279))) @@ -1759,71 +1737,62 @@ (set-subtask-hook! *game-info* - 279 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-citizen :init hud-init-by-other :to self))) - (send-event *traffic-manager* 'set-target-level #x3f400000) - (send-event *traffic-manager* 'set-guard-target-count-range 4 0 1) - (send-event *traffic-manager* 'set-guard-target-count-range 5 0 1) - (send-event *traffic-manager* 'set-guard-target-count-range 0 0 2) - (send-event *traffic-manager* 'set-guard-target-count-range 1 0 3) - (while (zero? (-> self sub-state)) - (suspend) - ) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) - (suspend) - ) - (send-event *traffic-manager* 'set-alert-level 2) - (send-event *traffic-manager* 'set-alert-duration #xa4cb80) - (none) + (game-task-node city-burning-bush-shuttle-1-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-citizen :init hud-init-by-other :to self))) + (send-event *traffic-manager* 'set-target-level #x3f400000) + (send-event *traffic-manager* 'set-guard-target-count-range 4 0 1) + (send-event *traffic-manager* 'set-guard-target-count-range 5 0 1) + (send-event *traffic-manager* 'set-guard-target-count-range 0 0 2) + (send-event *traffic-manager* 'set-guard-target-count-range 1 0 3) + (while (zero? (-> self sub-state)) + (suspend) ) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (send-event *traffic-manager* 'set-alert-level 2) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (none) ) ) (set-subtask-hook! *game-info* - 279 - 5 - (the-as - (function object) - (lambda :behavior task-manager () (send-event (handle->process (-> self arrow)) 'die) (none)) - ) + (game-task-node city-burning-bush-shuttle-1-resolution) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager () (send-event (handle->process (-> self arrow)) 'die) (none)) ) (set-subtask-hook! *game-info* - 279 - 4 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (until #f - (let ((v1-2 0)) - (dotimes (a0-0 4) - (let ((a1-4 (handle->process (-> self slave (* a0-0 2))))) - (if (and a1-4 (-> a1-4 next-state) (= (-> a1-4 next-state name) 'inactive)) - (+! v1-2 1) - ) - ) + (game-task-node city-burning-bush-shuttle-1-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (until #f + (let ((v1-2 0)) + (dotimes (a0-0 4) + (let ((a1-4 (handle->process (-> self slave (* a0-0 2))))) + (if (and a1-4 (-> a1-4 next-state) (= (-> a1-4 next-state name) 'inactive)) + (+! v1-2 1) + ) ) - (if (= v1-2 4) - (goto cfg-20) - ) ) - (suspend) - 0 + (if (= v1-2 4) + (goto cfg-20) + ) ) - #f - (label cfg-20) - (task-node-close! (game-task-node city-burning-bush-shuttle-1-resolution)) - (none) + (suspend) + 0 ) + #f + (label cfg-20) + (task-node-close! (game-task-node city-burning-bush-shuttle-1-resolution)) + (none) ) ) diff --git a/goal_src/jak2/engine/ambient/ambient.gc b/goal_src/jak2/engine/ambient/ambient.gc index d42952674f..41f53dc497 100644 --- a/goal_src/jak2/engine/ambient/ambient.gc +++ b/goal_src/jak2/engine/ambient/ambient.gc @@ -375,8 +375,8 @@ (if (logtest? (-> self message flags) 1) (play-communicator-speech! (-> self message)) ) - (set-setting! 'hint (process->ppointer self) 0 0) - (set-setting! 'speech-control #f 0 0) + (set-setting! 'hint (process->ppointer self) 0.0 0) + (set-setting! 'speech-control #f 0.0 0) (if (nonzero? (-> self voice-id)) (set-action! *gui-control* diff --git a/goal_src/jak2/engine/camera/cam-layout.gc b/goal_src/jak2/engine/camera/cam-layout.gc index e09b67e595..0d9d80604d 100644 --- a/goal_src/jak2/engine/camera/cam-layout.gc +++ b/goal_src/jak2/engine/camera/cam-layout.gc @@ -163,7 +163,6 @@ ) -;; ERROR: Failed store: (s.w! (+ v1-6 8) 0) at op 22 (defun cam-layout-print ((arg0 int) (arg1 int) (arg2 string)) (with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) debug-buf)) (bucket-id debug2) @@ -755,7 +754,7 @@ "Displays the message `button test`" (cam-layout-print 16 *camera-layout-message-ypos* "button test") (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) - (set-setting! 'master-options 'set 0 32) + (set-setting! 'master-options 'set 0.0 32) #f ) @@ -763,7 +762,7 @@ "Displays the message `button not available`" (cam-layout-print 16 *camera-layout-message-ypos* "button not applicable") (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) - (set-setting! 'master-options 'set 0 32) + (set-setting! 'master-options 'set 0.0 32) #t ) @@ -771,7 +770,7 @@ "Displays the message `button not implemented yet`" (cam-layout-print 16 *camera-layout-message-ypos* "button not implemented yet") (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) - (set-setting! 'master-options 'set 0 32) + (set-setting! 'master-options 'set 0.0 32) #t ) @@ -925,7 +924,7 @@ ) ) ) - (set-setting! 'master-options 'set 0 32) + (set-setting! 'master-options 'set 0.0 32) #t ) @@ -962,7 +961,7 @@ ) ) (clmf-next-volume a0-1) - (set-setting! 'master-options 'set 0 32) + (set-setting! 'master-options 'set 0.0 32) #t ) @@ -1066,7 +1065,7 @@ (set! (-> *camera-other-root* quad) (-> *camera-other-trans* quad)) (cam-slave-get-rot (the-as entity-actor (-> self cam-entity)) *camera-other-matrix*) (set! *camera-look-through-other* 10) - (set-setting! 'master-options 'set 0 32) + (set-setting! 'master-options 'set 0.0 32) #f ) @@ -2247,7 +2246,7 @@ ) ) ) - (set-setting! 'master-options 'set 0 32) + (set-setting! 'master-options 'set 0.0 32) #t ) @@ -3148,7 +3147,7 @@ ) (let ((s5-0 30)) (let ((s4-0 (cam-state-from-entity (-> self cam-entity)))) - (set-setting! 'master-options 'clear 0 32) + (set-setting! 'master-options 'clear 0.0 32) (let ((s3-0 (-> self cam-entity))) (clear *temp-string*) (if s3-0 diff --git a/goal_src/jak2/engine/camera/cam-states.gc b/goal_src/jak2/engine/camera/cam-states.gc index cabb5ec9fa..94eb2f478f 100644 --- a/goal_src/jak2/engine/camera/cam-states.gc +++ b/goal_src/jak2/engine/camera/cam-states.gc @@ -3619,8 +3619,8 @@ ) :enter (behavior () (when (not (-> self enter-has-run)) - (set-setting! 'head-offset 'abs #x46800000 0) - (set-setting! 'foot-offset 'abs #x45800000 0) + (set-setting! 'head-offset 'abs (meters 4) 0) + (set-setting! 'foot-offset 'abs (meters 1) 0) (set! (-> self view-off x) 0.0) (set! (-> self view-off y) (-> *CAM_BIKE-bank* max-y)) (set! (-> self view-off z) (-> *CAM_BIKE-bank* max-z)) diff --git a/goal_src/jak2/engine/common_objs/elevator.gc b/goal_src/jak2/engine/common_objs/elevator.gc index c2931122db..59b6057c03 100644 --- a/goal_src/jak2/engine/common_objs/elevator.gc +++ b/goal_src/jak2/engine/common_objs/elevator.gc @@ -301,7 +301,7 @@ which is obviously useful for an elevator." ) ((= evt-type 'use-camera) (if (-> event param 0) - (set-setting! 'entity-name (-> event param 0) 0 0) + (set-setting! 'entity-name (-> event param 0) 0.0 0) (remove-setting! 'entity-name) ) ) @@ -632,7 +632,7 @@ do so. ) ) (logclear! (-> self mask) (process-mask actor-pause)) - (set-setting! 'board #f 0 0) + (set-setting! 'board #f 0.0 0) (let ((gp-0 (-> self on-activate))) (if gp-0 (script-eval gp-0 :key (* (the int (-> self move-pos 0)) 8) :vector (-> self root-override trans)) @@ -643,7 +643,7 @@ do so. (update-vol! (-> self sound) 0.0) ) (when (logtest? (-> self params flags) (elevator-flags prevent-jump)) - (set-setting! 'jump #f 0 0) + (set-setting! 'jump #f 0.0 0) (apply-settings *setting-control*) ) (none) diff --git a/goal_src/jak2/engine/common_objs/powerups.gc b/goal_src/jak2/engine/common_objs/powerups.gc index fc2c5135f7..8fd5758b16 100644 --- a/goal_src/jak2/engine/common_objs/powerups.gc +++ b/goal_src/jak2/engine/common_objs/powerups.gc @@ -968,8 +968,8 @@ ((logtest? (-> self game features) (game-feature unk-game-feature-01)) (cond ((< (-> self clock frame-counter) (-> (the-as fact-info-target (-> self fact-override)) stop-time-timeout)) - (set-setting! 'bg-a 'abs #x3e99999a 0) - (set-setting! 'bg-r 'abs #x3f800000 0) + (set-setting! 'bg-a 'abs 0.3 0) + (set-setting! 'bg-r 'abs 1.0 0) (update-rates! (-> *display* entity-clock) 0.0) (if (zero? (mod (the-as int (-> *display* base-clock integral-frame-counter)) 60)) (sound-play "stopwatch") diff --git a/goal_src/jak2/engine/debug/editable-player.gc b/goal_src/jak2/engine/debug/editable-player.gc index 546f785dd6..abd92e9e15 100644 --- a/goal_src/jak2/engine/debug/editable-player.gc +++ b/goal_src/jak2/engine/debug/editable-player.gc @@ -2077,8 +2077,8 @@ (logclear! (-> self mask) (process-mask freeze pause menu)) (set! (-> self clock) (-> *display* real-clock)) (set! (-> self current) (new 'debug 'editable-array 4096)) - (add-setting! 'mouse #t 0 0) - (add-setting! 'cursor #t 0 0) + (add-setting! 'mouse #t 0.0 0) + (add-setting! 'cursor #t 0.0 0) (set! (-> self select-command) (the-as function 3)) (set! (-> self move-command) (the-as function 18)) (set! (-> self extra-command) (the-as function 23)) diff --git a/goal_src/jak2/engine/game/game-info-h.gc b/goal_src/jak2/engine/game/game-info-h.gc index 5e7c864b31..37f8023382 100644 --- a/goal_src/jak2/engine/game/game-info-h.gc +++ b/goal_src/jak2/engine/game/game-info-h.gc @@ -341,7 +341,7 @@ (give (_type_ symbol float handle) float 10) (task-complete? (_type_ game-task) symbol 11) (subtask-index-by-name (_type_ string) int 12) - (set-subtask-hook! (_type_ int int (function object :behavior task-manager)) (function object :behavior task-manager) 13) + (set-subtask-hook! (_type_ game-task-node int function) function 13) (actor-perm (_type_ actor-id) entity-perm 14) (task-perm-by-index (_type_ int) entity-perm 15) (copy-perms-from-level! (_type_ level) int 16) diff --git a/goal_src/jak2/engine/game/game-info.gc b/goal_src/jak2/engine/game/game-info.gc index f084846b89..e5298b78ed 100644 --- a/goal_src/jak2/engine/game/game-info.gc +++ b/goal_src/jak2/engine/game/game-info.gc @@ -66,7 +66,7 @@ 0 ) -(defmethod set-subtask-hook! game-info ((obj game-info) (arg0 int) (arg1 int) (arg2 (function object))) +(defmethod set-subtask-hook! game-info ((obj game-info) (arg0 game-task-node) (arg1 int) (arg2 function)) (let ((subtask (-> obj sub-task-list arg0))) (if (and subtask (-> subtask info)) (set! (-> subtask info hooks arg1) arg2) @@ -532,7 +532,7 @@ (set! (-> self mask) (process-mask)) (stop arg0) (reset-actors arg1) - (close! (-> *game-info* sub-task-list 1) 'event) + (close! (-> *game-info* sub-task-list (game-task-node fortress-escape-start)) 'event) (set-continue! *game-info* arg2 #f) (when arg3 (load-game *game-info* arg3) @@ -680,7 +680,7 @@ (set! (-> a1-13 num-params) 0) (set! (-> a1-13 message) 'complete) (let ((t9-12 send-event-function) - (v1-71 (-> *game-info* sub-task-list 43)) + (v1-71 (-> *game-info* sub-task-list (game-task-node sewer-enemy-resolution))) ) (t9-12 (handle->process (if (-> v1-71 info) @@ -703,7 +703,7 @@ (set! (-> a1-14 num-params) 0) (set! (-> a1-14 message) 'complete) (let ((t9-13 send-event-function) - (v1-85 (-> *game-info* sub-task-list 177)) + (v1-85 (-> *game-info* sub-task-list (game-task-node sewer-escort-get-gun))) ) (t9-13 (handle->process (if (-> v1-85 info) diff --git a/goal_src/jak2/engine/game/game-save.gc b/goal_src/jak2/engine/game/game-save.gc index 4063724d56..74bc3aafcb 100644 --- a/goal_src/jak2/engine/game/game-save.gc +++ b/goal_src/jak2/engine/game/game-save.gc @@ -1644,7 +1644,6 @@ ) -;; ERROR: Failed store: (s.w! (+ v1-45 8) 0) at op 192 (defbehavior auto-save-post auto-save () (when (and (= *cheat-mode* 'debug) (cpad-hold? 0 l3)) (let ((gp-0 @@ -1731,7 +1730,7 @@ auto-save-post (set! (-> self card) (-> *game-info* auto-save-card)) (set! (-> self which) (-> *game-info* auto-save-which)) ) - (set-setting! 'allow-pause #f 0 0) + (set-setting! 'allow-pause #f 0.0 0) (apply-settings *setting-control*) ) ((= arg0 'error) @@ -2131,12 +2130,12 @@ auto-save-post (go-virtual error (mc-status-code bad-version)) ) ) - (set-setting! 'music-volume 'abs 0 0) - (set-setting! 'sfx-volume 'abs 0 0) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (-> self save) (the-as string #f)) (set-master-mode 'game) - (add-setting! 'process-mask 'set 0 (process-mask progress)) + (add-setting! 'process-mask 'set 0.0 (process-mask progress)) (apply-settings *setting-control*) (sleep-code) (go-virtual done) diff --git a/goal_src/jak2/engine/game/settings-h.gc b/goal_src/jak2/engine/game/settings-h.gc index e063278857..a5b0a0c9ae 100644 --- a/goal_src/jak2/engine/game/settings-h.gc +++ b/goal_src/jak2/engine/game/settings-h.gc @@ -189,7 +189,7 @@ (subtitle symbol :offset-assert 276) (borrow pair :offset-assert 280) (doorway symbol :offset-assert 284) - (gen symbol :offset-assert 288) + (gem symbol :offset-assert 288) (half-speed symbol :offset-assert 292) (gun-buoy symbol :offset-assert 296) (double-jump symbol :offset-assert 300) diff --git a/goal_src/jak2/engine/game/settings.gc b/goal_src/jak2/engine/game/settings.gc index 4e0a6292b6..ba9f44a470 100644 --- a/goal_src/jak2/engine/game/settings.gc +++ b/goal_src/jak2/engine/game/settings.gc @@ -451,7 +451,7 @@ ) ) (('gem) - (set! (-> obj gen) arg1) + (set! (-> obj gem) arg1) ) (('minimap) (case arg1 @@ -988,7 +988,7 @@ (set! (-> s5-0 features) (-> s4-0 features)) (set! (-> s5-0 rain) (-> s4-0 rain)) (set! (-> s5-0 snow) (-> s4-0 snow)) - (set! (-> s5-0 gen) (-> s4-0 gen)) + (set! (-> s5-0 gem) (-> s4-0 gem)) (set! (-> s5-0 minimap) (-> s4-0 minimap)) (set! (-> s5-0 race-minimap) (-> s4-0 race-minimap)) (set! (-> s5-0 half-speed) (-> s4-0 half-speed)) @@ -1461,7 +1461,7 @@ (set! (-> gp-0 speech-control) #t) (set! (-> gp-0 vehicle-hijacking) #t) (set! (-> gp-0 ignore-target) #f) - (set! (-> gp-0 gen) #t) + (set! (-> gp-0 gem) #t) (set! (-> gp-0 half-speed) #f) (set! (-> gp-0 render) #t) (set! (-> gp-0 speed-mult) 1.0) @@ -1551,7 +1551,7 @@ (set! (-> s5-0 gun) (-> gp-0 gun)) (set! (-> s5-0 doorway) (-> gp-0 doorway)) (set! (-> s5-0 board) (-> gp-0 board)) - (set! (-> s5-0 gen) (-> gp-0 gen)) + (set! (-> s5-0 gem) (-> gp-0 gem)) (set! (-> s5-0 half-speed) (-> gp-0 half-speed)) (set! (-> s5-0 render) (-> gp-0 render)) (set! (-> s5-0 speed-mult) (-> gp-0 speed-mult)) diff --git a/goal_src/jak2/engine/game/task/task-control-h.gc b/goal_src/jak2/engine/game/task/task-control-h.gc index 0c8c28434b..aa69d1f9c4 100644 --- a/goal_src/jak2/engine/game/task/task-control-h.gc +++ b/goal_src/jak2/engine/game/task/task-control-h.gc @@ -90,7 +90,7 @@ (say 2) (talk 3) (show 4) - (shade 5) + (trade 5) (play 6) (menu 7) ) @@ -263,344 +263,7 @@ ;; DECOMP BEGINS (defun-debug game-task->string ((arg0 game-task)) - (case arg0 - (((game-task forest-protect)) - "forest-protect" - ) - (((game-task strip-drop)) - "strip-drop" - ) - (((game-task fortress-dump)) - "fortress-dump" - ) - (((game-task ruins-tower)) - "ruins-tower" - ) - (((game-task city-burning-bush-race-errol)) - "city-burning-bush-race-errol" - ) - (((game-task canyon-insert-items)) - "canyon-insert-items" - ) - (((game-task city-win)) - "city-win" - ) - (((game-task city-burning-bush-get-to-5)) - "city-burning-bush-get-to-5" - ) - (((game-task tomb-water)) - "tomb-water" - ) - (((game-task stadium-race-class3)) - "stadium-race-class3" - ) - (((game-task city-burning-bush-ring-2)) - "city-burning-bush-ring-2" - ) - (((game-task eco-blue-button)) - "eco-blue-button" - ) - (((game-task stadium-burning-bush-race-class1-r)) - "stadium-burning-bush-race-class1-r" - ) - (((game-task ruins-enemy)) - "ruins-enemy" - ) - (((game-task city-burning-bush-shuttle-1)) - "city-burning-bush-shuttle-1" - ) - (((game-task eco-red-button)) - "eco-red-button" - ) - (((game-task city-burning-bush-ring-1)) - "city-burning-bush-ring-1" - ) - (((game-task city-krew-delivery)) - "city-krew-delivery" - ) - (((game-task stadium-burning-bush-race-class3-r)) - "stadium-burning-bush-race-class3-r" - ) - (((game-task stadium-burning-bush-race-class3)) - "stadium-burning-bush-race-class3" - ) - (((game-task city-burning-bush-get-to-15)) - "city-burning-bush-get-to-15" - ) - (((game-task city-help-kid)) - "city-help-kid" - ) - (((game-task under-mech)) - "under-mech" - ) - (((game-task city-escort-kid)) - "city-escort-kid" - ) - (((game-task mountain-gear)) - "mountain-gear" - ) - (((game-task max)) - "max" - ) - (((game-task city-defend-stadium)) - "city-defend-stadium" - ) - (((game-task city-burning-bush-get-to-12)) - "city-burning-bush-get-to-12" - ) - (((game-task city-burning-bush-bombbot-1)) - "city-burning-bush-bombbot-1" - ) - (((game-task drill-ship)) - "drill-ship" - ) - (((game-task city-yellow-gun-training)) - "city-yellow-gun-training" - ) - (((game-task sewer-enemy)) - "sewer-enemy" - ) - (((game-task palace-cable)) - "palace-cable" - ) - (((game-task city-burning-bush-get-to-10)) - "city-burning-bush-get-to-10" - ) - (((game-task castle-break-in)) - "castle-break-in" - ) - (((game-task tomb-poles)) - "tomb-poles" - ) - (((game-task city-vehicle-training)) - "city-vehicle-training" - ) - (((game-task sewer-escort)) - "sewer-escort" - ) - (((game-task city-errol-challenge)) - "city-errol-challenge" - ) - (((game-task strip-grenade)) - "strip-grenade" - ) - (((game-task atoll-sig)) - "atoll-sig" - ) - (((game-task stadium-burning-bush-race-class1)) - "stadium-burning-bush-race-class1" - ) - (((game-task nest-boss)) - "nest-boss" - ) - (((game-task forest-hunt)) - "forest-hunt" - ) - (((game-task stadium-race-class2)) - "stadium-race-class2" - ) - (((game-task city-play-onin-game)) - "city-play-onin-game" - ) - (((game-task city-burning-bush-collection-2)) - "city-burning-bush-collection-2" - ) - (((game-task none)) - "none" - ) - (((game-task eco-yellow-button)) - "eco-yellow-button" - ) - (((game-task drill-eggs)) - "drill-eggs" - ) - (((game-task city-burning-bush-get-to-2)) - "city-burning-bush-get-to-2" - ) - (((game-task city-burning-bush-racepoint-1)) - "city-burning-bush-racepoint-1" - ) - (((game-task city-burning-bush-get-to-11)) - "city-burning-bush-get-to-11" - ) - (((game-task under-sig)) - "under-sig" - ) - (((game-task stadium-burning-bush-race-class2)) - "stadium-burning-bush-race-class2" - ) - (((game-task stadium-burning-bush-race-board)) - "stadium-burning-bush-race-board" - ) - (((game-task city-burning-bush-race-port)) - "city-burning-bush-race-port" - ) - (((game-task city-burning-bush-get-to-7)) - "city-burning-bush-get-to-7" - ) - (((game-task atoll-battle)) - "atoll-battle" - ) - (((game-task drill-mech)) - "drill-mech" - ) - (((game-task ruins-mech)) - "ruins-mech" - ) - (((game-task city-burning-bush-get-to-13)) - "city-burning-bush-get-to-13" - ) - (((game-task city-destroy-guard-vehicles)) - "city-destroy-guard-vehicles" - ) - (((game-task tomb-boss)) - "tomb-boss" - ) - (((game-task dummy0)) - "dummy0" - ) - (((game-task dig-find-totem)) - "dig-find-totem" - ) - (((game-task dig-knock-down)) - "dig-knock-down" - ) - (((game-task city-protect-water-slums)) - "city-protect-water-slums" - ) - (((game-task city-whack)) - "city-whack" - ) - (((game-task city-burning-bush-ring-3)) - "city-burning-bush-ring-3" - ) - (((game-task city-shuttle)) - "city-shuttle" - ) - (((game-task fortress-save-friends)) - "fortress-save-friends" - ) - (((game-task city-intercept-tanker)) - "city-intercept-tanker" - ) - (((game-task forest-scouts)) - "forest-scouts" - ) - (((game-task nest-get-to-gun)) - "nest-get-to-gun" - ) - (((game-task stadium-race-class)) - "stadium-race-class1" - ) - (((game-task stadium-burning-bush-race-class2-r)) - "stadium-burning-bush-race-class2-r" - ) - (((game-task palace-sneak-in)) - "palace-sneak-in" - ) - (((game-task strip-rescue)) - "strip-rescue" - ) - (((game-task city-burning-bush-get-to-1)) - "city-burning-bush-get-to-1" - ) - (((game-task consite-find-baron)) - "consite-find-baron" - ) - (((game-task city-burning-bush-get-to-3)) - "city-burning-bush-get-to-3" - ) - (((game-task stadium-board1)) - "stadium-board1" - ) - (((game-task city-burning-bush-get-to-4)) - "city-burning-bush-get-to-4" - ) - (((game-task city-burning-bush-collection-3)) - "city-burning-bush-collection-3" - ) - (((game-task city-port-run)) - "city-port-run" - ) - (((game-task sewer-board)) - "sewer-board" - ) - (((game-task city-dark-gun-training)) - "city-dark-gun-training" - ) - (((game-task city-oracle)) - "city-oracle" - ) - (((game-task city-burning-bush-collection-1)) - "city-burning-bush-collection-1" - ) - (((game-task city-keira-delivery)) - "city-keira-delivery" - ) - (((game-task city-burning-bush-get-to-6)) - "city-burning-bush-get-to-6" - ) - (((game-task mountain-lens)) - "mountain-lens" - ) - (((game-task atoll-water)) - "atoll-water" - ) - (((game-task city-stop-bomb-bots)) - "city-stop-bomb-bots" - ) - (((game-task mountain-collection)) - "mountain-collection" - ) - (((game-task nest-enter)) - "nest-enter" - ) - (((game-task city-burning-bush-get-to-9)) - "city-burning-bush-get-to-9" - ) - (((game-task mountain-shard)) - "mountain-shard" - ) - (((game-task city-power)) - "city-power" - ) - (((game-task complete)) - "complete" - ) - (((game-task palace-boss)) - "palace-boss" - ) - (((game-task castle-boss)) - "castle-boss" - ) - (((game-task city-burning-bush-get-to-8)) - "city-burning-bush-get-to-8" - ) - (((game-task city-blue-gun-training)) - "city-blue-gun-training" - ) - (((game-task fortress-escape)) - "fortress-escape" - ) - (((game-task city-red-gun-training)) - "city-red-gun-training" - ) - (((game-task city-save-lurkers)) - "city-save-lurkers" - ) - (((game-task city-krew-collection)) - "city-krew-collection" - ) - (((game-task city-burning-bush-get-to-14)) - "city-burning-bush-get-to-14" - ) - (((game-task city-meet-brutter)) - "city-meet-brutter" - ) - (else - "*unknown*" - ) - ) + (enum->string game-task arg0) ) ;; WARN: Return type mismatch int vs game-task. @@ -947,247 +610,11 @@ ) (defun-debug game-task-actor->string ((arg0 game-task-actor)) - (case arg0 - (((game-task-actor burning-bush-genc)) - "burning-bush-genc" - ) - (((game-task-actor minimap)) - "minimap" - ) - (((game-task-actor youngsamos-tomb)) - "youngsamos-tomb" - ) - (((game-task-actor youngsamos-onintent)) - "youngsamos-onintent" - ) - (((game-task-actor baron-consite)) - "baron-consite" - ) - (((game-task-actor burning-bush-markb)) - "burning-bush-markb" - ) - (((game-task-actor keira-garage)) - "keira-garage" - ) - (((game-task-actor burning-bush-genc-2)) - "burning-bush-genc-2" - ) - (((game-task-actor samos-garage)) - "samos-garage" - ) - (((game-task-actor kid-hideout)) - "kid-hideout" - ) - (((game-task-actor krew-hiphog)) - "krew-hiphog" - ) - (((game-task-actor burning-bush-port-2)) - "burning-bush-port-2" - ) - (((game-task-actor none)) - "none" - ) - (((game-task-actor burning-bush-port-3)) - "burning-bush-port-3" - ) - (((game-task-actor brutter-kiosk)) - "brutter-kiosk" - ) - (((game-task-actor tess-alley)) - "tess-alley" - ) - (((game-task-actor whack-a-metal-hiphog)) - "whack-a-metal-hiphog" - ) - (((game-task-actor burning-bush-gena)) - "burning-bush-gena" - ) - (((game-task-actor vin-vinroom)) - "vin-vinroom" - ) - (((game-task-actor kor-hideout)) - "kor-hideout" - ) - (((game-task-actor burning-bush-pal-2)) - "burning-bush-pal-2" - ) - (((game-task-actor kid-alley)) - "kid-alley" - ) - (((game-task-actor burning-bush-stadium)) - "burning-bush-stadium" - ) - (((game-task-actor ashelin-market)) - "ashelin-market" - ) - (((game-task-actor kid-tomb)) - "kid-tomb" - ) - (((game-task-actor burning-bush-farma)) - "burning-bush-farma" - ) - (((game-task-actor baron-tomb)) - "baron-tomb" - ) - (((game-task-actor burning-bush-slumc)) - "burning-bush-slumc" - ) - (((game-task-actor burning-bush-slumb-2)) - "burning-bush-slumb-2" - ) - (((game-task-actor baron-palace)) - "baron-palace" - ) - (((game-task-actor crocadog-alley)) - "crocadog-alley" - ) - (((game-task-actor baron-castle)) - "baron-castle" - ) - (((game-task-actor crocadog-vinroom)) - "crocadog-vinroom" - ) - (((game-task-actor burning-bush-gena-2)) - "burning-bush-gena-2" - ) - (((game-task-actor daxter-tomb)) - "daxter-tomb" - ) - (((game-task-actor burning-bush-port)) - "burning-bush-port" - ) - (((game-task-actor burning-bush-marka)) - "burning-bush-marka" - ) - (((game-task-actor crocadog-tomb)) - "crocadog-tomb" - ) - (((game-task-actor keira-stadium)) - "keira-stadium" - ) - (((game-task-actor sig-hiphog)) - "sig-hiphog" - ) - (((game-task-actor youngsamos-hideout)) - "youngsamos-hideout" - ) - (((game-task-actor burning-bush-genb-2)) - "burning-bush-genb-2" - ) - (((game-task-actor burning-bush-inda)) - "burning-bush-inda" - ) - (((game-task-actor kor-tomb)) - "kor-tomb" - ) - (((game-task-actor kor-consite)) - "kor-consite" - ) - (((game-task-actor torn-hideout)) - "torn-hideout" - ) - (((game-task-actor onin-onintent)) - "onin-onintent" - ) - (((game-task-actor kor-alley)) - "kor-alley" - ) - (((game-task-actor kid-vinroom)) - "kid-vinroom" - ) - (((game-task-actor ashelin-atoll)) - "ashelin-atoll" - ) - (((game-task-actor burning-bush-sluma)) - "burning-bush-sluma" - ) - (((game-task-actor burning-bush-slumb)) - "burning-bush-slumb" - ) - (((game-task-actor youngsamos-alley)) - "youngsamos-alley" - ) - (((game-task-actor youngsamos-forest)) - "youngsamos-forest" - ) - (((game-task-actor samos-hideout)) - "samos-hideout" - ) - (((game-task-actor burning-bush-genb)) - "burning-bush-genb" - ) - (((game-task-actor oracle-oracle)) - "oracle-oracle" - ) - (((game-task-actor torn-alley)) - "torn-alley" - ) - (((game-task-actor kor-onintent)) - "kor-onintent" - ) - (((game-task-actor tess-hiphog)) - "tess-hiphog" - ) - (((game-task-actor burning-bush-markb-2)) - "burning-bush-markb-2" - ) - (((game-task-actor ashelin-throne)) - "ashelin-throne" - ) - (((game-task-actor burning-bush-indb)) - "burning-bush-indb" - ) - (((game-task-actor pecker-onintent)) - "pecker-onintent" - ) - (((game-task-actor kor-vinroom)) - "kor-vinroom" - ) - (((game-task-actor sig-atoll)) - "sig-atoll" - ) - (((game-task-actor burning-bush-pal)) - "burning-bush-pal" - ) - (((game-task-actor burning-bush-farmb)) - "burning-bush-farmb" - ) - (else - "*unknown*" - ) - ) + (enum->string game-task-actor arg0) ) (defun-debug game-task-action->string ((arg0 game-task-action)) - (case arg0 - (((game-task-action idle)) - "idle" - ) - (((game-task-action play)) - "play" - ) - (((game-task-action show)) - "show" - ) - (((game-task-action talk)) - "talk" - ) - (((game-task-action hide)) - "hide" - ) - (((game-task-action say)) - "say" - ) - (((game-task-action shade)) - "trade" - ) - (((game-task-action menu)) - "menu" - ) - (else - "*unknown*" - ) - ) + (enum->string game-task-action arg0) ) (deftype game-task-event (basic) @@ -1204,13 +631,21 @@ :flag-assert #x900000010 ) +;; the decompiler uses these! +(defconstant TASK_MANAGER_INIT_HOOK 0) +(defconstant TASK_MANAGER_CLEANUP_HOOK 1) +(defconstant TASK_MANAGER_UPDATE_HOOK 2) +(defconstant TASK_MANAGER_CODE_HOOK 3) +(defconstant TASK_MANAGER_COMPLETE_HOOK 4) +(defconstant TASK_MANAGER_FAIL_HOOK 5) +(defconstant TASK_MANAGER_EVENT_HOOK 6) (deftype task-manager-info (structure) ((mask task-manager-mask :offset-assert 0) (level symbol :offset-assert 4) (manager handle :offset-assert 8) - (fail-message text-id :offset-assert 16) - (retry-message text-id :offset-assert 20) + (fail-message text-id :offset-assert 16) + (retry-message text-id :offset-assert 20) (intro-scene string :offset-assert 24) (resolution-scene string :offset-assert 28) (resolution-scene-continue string :offset-assert 32) @@ -1223,7 +658,7 @@ (complete-hook (function object) :offset-assert 60) (fail-hook (function object) :offset-assert 64) (event-hook (function process int symbol event-message-block object) :offset-assert 68) - (hooks (function object) 7 :offset 44) + (hooks function 7 :offset 44) (final-node game-task-node :offset-assert 72) (time-limit int32 :offset-assert 76) (sphere-count int8 :offset-assert 80) @@ -1400,7 +835,7 @@ (skill-count uint16 :offset-assert 68) (suck-death-count uint8 :offset-assert 70) (add game-task-node-command :offset-assert 71) - (description text-id :offset-assert 72) + (description text-id :offset-assert 72) ) :method-count-assert 14 :size-assert #x4c @@ -1417,7 +852,7 @@ (deftype game-task-info (basic) ((name string :offset-assert 4) - (text-name text-id :offset-assert 8) + (text-name text-id :offset-assert 8) (pre-play-node game-task-node :offset-assert 12) (kiosk-play-node game-task-node :offset-assert 14) (pre-play-continue string :offset-assert 16) diff --git a/goal_src/jak2/engine/game/task/task-control.gc b/goal_src/jak2/engine/game/task/task-control.gc index 541d2042eb..7c2a66fb4d 100644 --- a/goal_src/jak2/engine/game/task/task-control.gc +++ b/goal_src/jak2/engine/game/task/task-control.gc @@ -39,7 +39,7 @@ (fail-continue basic :offset-assert 8) (reset-delay uint32 :offset-assert 12) (task game-task :offset-assert 16) - (fail-message text-id :offset-assert 20) + (fail-message text-id :offset-assert 20) ) :method-count-assert 9 :size-assert #x18 @@ -122,7 +122,7 @@ ) ) ) - (borrow-eval (-> *game-info* sub-task-list 1 borrow)) + (borrow-eval (-> *game-info* sub-task-list (game-task-node fortress-escape-start) borrow)) (let ((game-nodes (-> *game-info* sub-task-list))) (dotimes (i (-> game-nodes length)) (when (nonzero? i) @@ -1279,7 +1279,7 @@ ((= v1-1 (game-task-action say)) "say" ) - ((= v1-1 (game-task-action shade)) + ((= v1-1 (game-task-action trade)) "trade" ) ((= v1-1 (game-task-action menu)) @@ -1732,8 +1732,8 @@ (set! (-> self reset-delay) (-> arg0 reset-delay)) (set! (-> self task) (-> arg0 task)) (set! (-> self fail-message) (the-as uint (-> arg0 fail-message))) - (set-setting! 'allow-continue #f 0 0) - (set-setting! 'minimap 'clear 0 128) + (set-setting! 'allow-continue #f 0.0 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set-action! *gui-control* (gui-action stop) @@ -1761,9 +1761,9 @@ ) ) ) - (set-setting! 'music-volume 'abs 0 0) - (set-setting! 'sfx-volume 'abs 0 0) - (set-setting! 'speech-control #f 0 0) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'speech-control #f 0.0 0) (set! (-> self clock) (-> *display* base-clock)) (apply-settings *setting-control*) (if (or (not (logtest? (-> self flags) (fail-mission-flags famflags-2))) @@ -1820,12 +1820,12 @@ ) (defbehavior task-manager-init-by-other task-manager ((arg0 game-task-node-info) (arg1 symbol)) - (stack-size-set! (-> self main-thread) 4096) ;; increased from 1024 + (stack-size-set! (-> self main-thread) 2048) ;; increased from 1024 (add-connection *task-manager-engine* self nothing self arg0 #f) (set! (-> self node-info) arg0) (set! (-> self lev-name) arg1) - (add-setting! 'task arg0 0 0) - (add-setting! 'task-manager (process->ppointer self) 0 0) + (add-setting! 'task arg0 0.0 0) + (add-setting! 'task-manager (process->ppointer self) 0.0 0) (set! (-> self intro-time) (-> self clock frame-counter)) (set! (-> self fail-on-death?) (not (logtest? (-> arg0 flags) (game-task-node-flag no-fail-on-death)))) (when arg1 @@ -2118,6 +2118,8 @@ (t9-0) ) ) + (#when PC_PORT + (set! (-> self post-hook) #f)) (until #f (if *debug-segment* (format *stdcon* "task-manager: alive task ~A~%" (game-task->string (-> self node-info task))) @@ -2127,6 +2129,12 @@ #f (none) ) + ;; PC port note : added this so we can see it during the code-hook + :post (behavior () + (if *debug-segment* + (format *stdcon* "task-manager: alive in code-hook task ~A~%" (game-task->string (-> self node-info task))) + ) + ) ) (defstate complete (task-manager) diff --git a/goal_src/jak2/engine/load/loader.gc b/goal_src/jak2/engine/load/loader.gc index fb8d983358..bdf3bd3fb2 100644 --- a/goal_src/jak2/engine/load/loader.gc +++ b/goal_src/jak2/engine/load/loader.gc @@ -522,9 +522,7 @@ (let ((s3-0 (-> obj rec s4-0))) (when (-> s3-0 name) (dotimes (s2-0 2) - (when (and (file-status (-> obj buffer s2-0) (-> s3-0 name) (the-as int (-> s3-0 parts))) - (not (-> obj buffer s2-0 frame-lock)) - ) + (when (and (file-status (-> obj buffer s2-0) (-> s3-0 name) (-> s3-0 parts)) (not (-> obj buffer s2-0 frame-lock))) (set! (-> obj buffer s2-0 frame-lock) #t) (set! (-> s3-0 anim-name) (-> obj buffer s2-0)) (set! (-> obj buffer s2-0 pending-load-file-owner) (-> s3-0 owner)) @@ -547,13 +545,7 @@ (dotimes (s2-1 2) (when (not (-> obj buffer s2-1 frame-lock)) (set! (-> obj buffer s2-1 frame-lock) #t) - (set-pending-file - (-> obj buffer s2-1) - (-> s3-1 name) - (the-as int (-> s3-1 parts)) - (-> s3-1 owner) - (-> s3-1 priority) - ) + (set-pending-file (-> obj buffer s2-1) (-> s3-1 name) (-> s3-1 parts) (-> s3-1 owner) (-> s3-1 priority)) (set! (-> s3-1 anim-name) (-> obj buffer s2-1)) (goto cfg-46) ) @@ -783,43 +775,6 @@ ) ) -;; to allow streaming animations to play without overload VAG streaming, set STREAM_PLAY_HACK. -;; in the ja-play-spooled-anim function below, we use the get-current-str-pos/get-str-id-is-playing? -;; instead of the usual current-str-pos/str-id-is-playing? functions. The #cond below remaps those -;; to point to hacked versions if STREAM_PLAY_HACK is true, otherwise it just maps to the original -;; version. - -(defglobalconstant STREAM_PLAY_HACK #f) -(#cond - (STREAM_PLAY_HACK - (define *hack-pos-buffer-id* (new 'static 'array int 4)) ;; 4 channels? - (define *hack-pos-buffer-pos* (new 'static 'array float 4)) ;; 4 channels? - (define *hack-pos-next-idx* 0) ;; new channel, if none is found. - (define *hack-pos-speed* 8.5) - (defun get-current-str-pos ((obj sound-id)) - (dotimes (i 4) - (when (= (-> *hack-pos-buffer-id* i) obj) - (return (the int (+! (-> *hack-pos-buffer-pos* i) *hack-pos-speed*))) - ) - ) - (set! (-> *hack-pos-buffer-id* *hack-pos-next-idx*) (the-as int obj)) - (set! (-> *hack-pos-buffer-pos* *hack-pos-next-idx*) 0.0) - (+! *hack-pos-next-idx* 1) - (if (= *hack-pos-next-idx* 4) - (set! *hack-pos-next-idx* 0) - ) - (the int *hack-pos-speed*) - ) - (defun get-str-id-is-playing? ((obj int)) - #t - ) - ) - (#t - (define get-current-str-pos current-str-pos) - (define get-str-id-is-playing? str-id-is-playing?) - ) - ) - (defbehavior ja-play-spooled-anim process-drawable ((arg0 spool-anim) (arg1 art-joint-anim) (arg2 art-joint-anim) (arg3 (function process-drawable symbol))) (local-vars (v0-59 int) (sv-176 int)) @@ -900,8 +855,8 @@ ) ) ) - (set-setting! 'spooling (process->ppointer self) 0 0) - (set-setting! 'spool-anim (-> gp-0 anim) 0 0) + (set-setting! 'spooling (process->ppointer self) 0.0 0) + (set-setting! 'spool-anim (-> gp-0 anim) 0.0 0) (apply-settings *setting-control*) (set! (-> gp-0 old-time) (-> self clock frame-counter)) (while (< (-> gp-0 part) (-> gp-0 anim parts)) @@ -1048,7 +1003,7 @@ (let* ((f30-0 (* 0.05859375 (-> s5-8 speed))) (f28-0 (+ (-> gp-0 part-audio-start) (/ (the float (+ (-> s5-8 frames num-frames) -1)) f30-0))) ) - (set! sv-176 (get-current-str-pos (-> gp-0 sid))) ;; modified + (set! sv-176 (current-str-pos (-> gp-0 sid))) (set! (-> gp-0 good-time) (-> self clock frame-counter)) (until (>= (the float v0-59) f28-0) (if (= (-> self skel root-channel 0) (-> self skel channel)) @@ -1096,8 +1051,8 @@ (set! (-> gp-0 old-pos) sv-176) (set! (-> gp-0 old-time) (-> self clock frame-counter)) (suspend) - (let* ((f26-0 (* (- (the float (get-current-str-pos (-> gp-0 sid))) (-> gp-0 part-audio-start)) f30-0)) - (f0-16 (if (get-str-id-is-playing? (the-as int (-> gp-0 sid))) + (let* ((f26-0 (* (- (the float (current-str-pos (-> gp-0 sid))) (-> gp-0 part-audio-start)) f30-0)) + (f0-16 (if (str-id-is-playing? (the-as int (-> gp-0 sid))) (fmax 0.0 (fmin f26-0 (the float (+ (-> (ja-group) frames num-frames) -1)))) (fmax 0.0 (fmin (ja-frame-num 0) (the float (+ (-> (ja-group) frames num-frames) -1)))) ) @@ -1105,7 +1060,7 @@ ) (ja-no-eval :num! (seek!) :frame-num f0-16) ) - (set! v0-59 (get-current-str-pos (-> gp-0 sid))) + (set! v0-59 (current-str-pos (-> gp-0 sid))) (set! sv-176 v0-59) ) (set! (-> gp-0 part-audio-start) f28-0) diff --git a/goal_src/jak2/engine/process-drawable/process-taskable.gc b/goal_src/jak2/engine/process-drawable/process-taskable.gc index 7074745697..5ae0e6727a 100644 --- a/goal_src/jak2/engine/process-drawable/process-taskable.gc +++ b/goal_src/jak2/engine/process-drawable/process-taskable.gc @@ -236,7 +236,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) (when (and (or (= (-> gp-0 action) (game-task-action say)) (= (-> gp-0 action) (game-task-action talk)) - (= (-> gp-0 action) (game-task-action shade)) + (= (-> gp-0 action) (game-task-action trade)) (= (-> gp-0 action) (game-task-action play)) ) (process-taskable-method-34 self) @@ -256,17 +256,9 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (kill-current-talker (the-as symbol '()) '(daxter voicebox ambient) 'exit) (talker-surpress!) (when (can-display-query? self (the-as string #f) -99.0) - (let ((s5-1 (new - 'stack - 'font-context - *font-default-matrix* - 32 - 280 - 0.0 - (font-color default) - (font-flags shadow kerning) - ) - ) + (let ((s5-1 + (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) + ) ) (let ((v1-84 s5-1)) (set! (-> v1-84 width) (the float 340)) diff --git a/goal_src/jak2/engine/scene/scene.gc b/goal_src/jak2/engine/scene/scene.gc index 7c02b12d58..a13372c9e7 100644 --- a/goal_src/jak2/engine/scene/scene.gc +++ b/goal_src/jak2/engine/scene/scene.gc @@ -503,11 +503,11 @@ ) (process-entity-status! obj (entity-perm-status no-kill) #t) (when arg1 - (set-setting! 'region-mode #f 0 0) - (set-setting! 'process-mask 'set 0 (-> gp-0 mask-to-clear)) - (set-setting! 'sound-bank-load #f 0 0) - (set-setting! 'movie (process->ppointer obj) 0 0) - (set-setting! 'movie-name (-> gp-0 name) 0 0) + (set-setting! 'region-mode #f 0.0 0) + (set-setting! 'process-mask 'set 0.0 (-> gp-0 mask-to-clear)) + (set-setting! 'sound-bank-load #f 0.0 0) + (set-setting! 'movie (process->ppointer obj) 0.0 0) + (set-setting! 'movie-name (-> gp-0 name) 0.0 0) (set-setting! 'music-volume 'rel @@ -536,9 +536,9 @@ 0 ) (if (nonzero? (the int (-> gp-0 music-delay))) - (set-setting! 'sound-mode #f 0 2) + (set-setting! 'sound-mode #f 0.0 2) ) - (set-setting! 'gem #f 0 0) + (set-setting! 'gem #f 0.0 0) (apply-settings *setting-control*) ) ) @@ -584,6 +584,7 @@ ) ) +;; WARN: Return type mismatch pointer vs none. (defun draw-subtitle-image ((arg0 subtitle-image) (arg1 font-context)) (local-vars (sv-16 pointer) (sv-32 int)) (let ((gp-0 (-> arg0 width)) @@ -767,7 +768,7 @@ ) (when gp-0 (when (-> self scene) - (set-setting! 'borrow (-> self scene borrow) 0 0) + (set-setting! 'borrow (-> self scene borrow) 0.0 0) (apply-settings *setting-control*) ) (cond @@ -820,8 +821,8 @@ (while *progress-process* (suspend) ) - (set-setting! 'allow-progress #f 0 0) - (set-setting! 'bg-a-force 'abs #x3f800000 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'bg-a-force 'abs 1.0 0) (apply-settings *setting-control*) ) (if (or (not *target*) (or (focus-test? *target* grabbed) @@ -866,7 +867,7 @@ (-> *setting-control* user-current ambient) ) ) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-progress #f 0.0 0) (apply-settings *setting-control*) (dotimes (s4-0 2) (while (or (-> *setting-control* user-current talking) @@ -929,7 +930,7 @@ (when (and (zero? s5-1) (< (-> self scene-index) (-> self scene-list length))) (scene-player-method-24 self (-> self scene-list (-> self scene-index)) #t) (when (-> self scene) - (set-setting! 'borrow (-> self scene borrow) 0 0) + (set-setting! 'borrow (-> self scene borrow) 0.0 0) (apply-settings *setting-control*) ) ) @@ -974,11 +975,11 @@ (when (= (-> *game-info* demo-state) 100) (logclear! (-> self mask) (process-mask pause progress)) (set-blackout-frames (seconds 0.05)) - (set-setting! 'music-volume 'abs 0 0) - (set-setting! 'sfx-volume 'abs 0 0) - (set-setting! 'ambient-volume 'abs 0 0) - (set-setting! 'allow-pause #f 0 0) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (setup *screen-filter* (new 'static 'vector) @@ -1003,7 +1004,7 @@ (set! (-> *game-info* blackout-time) 0) (set! (-> *game-info* demo-state) (the-as uint 1)) (set! (-> *setting-control* user-current bg-a-force) 0.0) - (set-setting! 'allow-progress #t 0 0) + (set-setting! 'allow-progress #t 0.0 0) (remove-setting! 'process-mask) (apply-settings *setting-control*) (send-event *target* 'draw #t) @@ -1487,7 +1488,7 @@ (defbehavior scene-player-init scene-player ((arg0 object) (arg1 symbol) (arg2 string)) "`object` arg can be an `(array scene)`, `pair of scene` or a `scene`" (process-entity-set! self (the-as entity #f)) - (stack-size-set! (-> self main-thread) 1024) + (stack-size-set! (-> self main-thread) 1024) ;; changed from 512 (set! (-> self root) (new 'process 'trsqv)) (case (rtype-of arg0) ((array) @@ -1566,8 +1567,8 @@ ) (set! *scene-player* (the-as (pointer scene-player) (process->ppointer self))) (set! *display-entity-errors* #f) - (set-setting! 'speech-control #f 0 0) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'speech-control #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (apply-settings *setting-control*) (go-virtual wait arg1) (none) diff --git a/goal_src/jak2/engine/sound/gsound.gc b/goal_src/jak2/engine/sound/gsound.gc index ed014058a2..4f784a41eb 100644 --- a/goal_src/jak2/engine/sound/gsound.gc +++ b/goal_src/jak2/engine/sound/gsound.gc @@ -42,40 +42,41 @@ ) (deftype sound-iop-info (structure) - ((frame uint32 :offset-assert 0) - (strpos int32 :offset-assert 4) - (str-id uint32 :offset-assert 8) - (str-id-sign int32 :offset 8) - (freemem uint32 :offset-assert 12) - (chinfo uint8 48 :offset-assert 16) - (freemem2 uint32 :offset-assert 64) - (nocd uint32 :offset-assert 68) - (dirtycd uint32 :offset-assert 72) - (diskspeed uint32 2 :offset-assert 76) - (lastspeed uint32 :offset-assert 84) - (dupseg int32 :offset-assert 88) - (times int32 41 :offset-assert 92) - (times-seq uint32 :offset-assert 256) - (iop-ticks uint32 :offset-assert 260) - (stream-position uint32 4 :offset 272) - (stream-status stream-status 4 :offset-assert 288) + ((frame uint32 :offset-assert 0) + (strpos int32 :offset-assert 4) + (str-id uint32 :offset-assert 8) + (str-id-sign int32 :offset 8) + (freemem uint32 :offset-assert 12) + (chinfo uint8 48 :offset-assert 16) + (freemem2 uint32 :offset-assert 64) + (nocd uint32 :offset-assert 68) + (dirtycd uint32 :offset-assert 72) + (diskspeed uint32 2 :offset-assert 76) + (lastspeed uint32 :offset-assert 84) + (dupseg int32 :offset-assert 88) + (times int32 41 :offset-assert 92) + (times-seq uint32 :offset-assert 256) + (iop-ticks uint32 :offset-assert 260) + (stream-position uint32 4 :offset 272) + (stream-status stream-status 4 :offset-assert 288) (stream-name sound-stream-name 4 :inline :offset-assert 304) - (stream-id sound-id 4 :offset-assert 496) - (stream-id-int32 int32 4 :overlay-at stream-id) - (music-register uint8 17 :offset-assert 512) - (music-excite int8 :offset 528) - (ramdisk-name uint8 48 :offset-assert 529) + (stream-id sound-id 4 :offset-assert 496) + (stream-id-int32 int32 4 :offset 496) + (music-register uint8 17 :offset-assert 512) + (music-excite int8 :offset 528) + (ramdisk-name uint8 48 :offset-assert 529) ) :method-count-assert 9 :size-assert #x241 :flag-assert #x900000241 ) + (define *sound-iop-info* (new 'global 'sound-iop-info)) (defun str-is-playing? () (countdown (v1-0 4) - (if (and (>= (-> *sound-iop-info* stream-id v1-0) 0) + (if (and (>= (the-as uint (-> *sound-iop-info* stream-id v1-0)) 0) (logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status ststatus-four)) ) (return #t) @@ -361,6 +362,7 @@ ) ) +;; WARN: Return type mismatch uint128 vs sound-name. (defun string->sound-name ((arg0 string)) (let ((v1-0 (new 'stack-no-clear 'qword))) (set! (-> v1-0 quad) (the-as uint128 0)) @@ -408,17 +410,10 @@ 0 ) -(defmacro sound-play (name &key (id (new-sound-id)) - &key (vol 100.0) &key (pitch 0) &key (bend 0) - &key (group sfx) - &key (position #t)) - `(sound-play-by-name (static-sound-name ,name) ,id (the int (* (/ 1024.0 100.0) ,vol)) (the int (* 1524.0 ,pitch)) ,bend (sound-group ,group) ,position) - ) - (defbehavior sound-play-by-name process-drawable ((arg0 sound-name) (arg1 sound-id) (arg2 int) (arg3 int) (arg4 int) (arg5 sound-group) (arg6 object)) - (local-vars (sv-16 sound-group)) "Last arg can by a symbol with value [[#t]], in which case it will pull `trans` [[vector]] off the current [[process-drawable]] - otherwise, an explicit [[vector]] can be provided" +otherwise, an explicit [[vector]] can be provided" + (local-vars (sv-16 sound-group)) (set! sv-16 arg5) (let ((s4-0 arg6)) (when *sound-player-enable* @@ -556,14 +551,15 @@ ) (defun sound-volume-off () - (set-setting! 'music-volume 'abs 0 0) - (set-setting! 'sfx-volume 'abs 0 0) - (set-setting! 'ambient-volume 'abs 0 0) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) 0 ) (define *ambient-spec* (new 'static 'sound-spec)) +;; WARN: Return type mismatch object vs ambient-sound. (defmethod new ambient-sound ((allocation symbol) (type-to-make type) (arg0 basic) (arg1 vector)) (local-vars (sv-16 sound-spec) @@ -911,7 +907,6 @@ 0 ) -;; definition for function ear-trans (defun ear-trans ((arg0 int)) (cond ((or (movie?) *external-cam-mode*) @@ -929,7 +924,11 @@ (defun-debug make-sqrt-table () (format #t "static int sqrt_table[256] =~%{~%") (dotimes (gp-0 256) - (let* ((f0-2 (sqrtf (* 16777216.0 (the float gp-0)))) (a2-0 (the int (+ 0.5 f0-2)))) (format #t "~D,~%" a2-0)) + (let* ((f0-2 (sqrtf (* 16777216.0 (the float gp-0)))) + (a2-0 (the int (+ 0.5 f0-2))) + ) + (format #t "~D,~%" a2-0) + ) ) (format #t "};~%") 0 @@ -956,8 +955,6 @@ ) ) - - (defun loader-test-command ((arg0 sound-command) (arg1 uint)) (let ((v1-1 (the-as sound-rpc-test-cmd (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) arg0) @@ -974,7 +971,7 @@ (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 2))) (vector-! (-> gp-0 0) (target-pos 0) arg0) (if *target* - (vector-! (-> gp-0 1) arg1 (-> *target* root transv)) + (vector-! (-> gp-0 1) arg1 (-> *target* control transv)) (set! (-> gp-0 1 quad) (-> arg1 quad)) ) (vector-normalize! (-> gp-0 0) 1.0) diff --git a/goal_src/jak2/engine/target/board/board-states.gc b/goal_src/jak2/engine/target/board/board-states.gc index 604606dd15..36f8ddee9e 100644 --- a/goal_src/jak2/engine/target/board/board-states.gc +++ b/goal_src/jak2/engine/target/board/board-states.gc @@ -310,8 +310,8 @@ (vector-! gp-0 gp-0 (get-trans self 0)) (send-event *camera* 'relative-position gp-0) ) - (set-setting! 'matrix-blend-max-angle 'abs #x45088889 0) - (set-setting! 'matrix-blend-max-partial 'abs #x3f000000 0) + (set-setting! 'matrix-blend-max-angle 'abs (degrees 12.000001) 0) + (set-setting! 'matrix-blend-max-partial 'abs 0.5 0) ) 0 (none) diff --git a/goal_src/jak2/engine/target/board/target-board.gc b/goal_src/jak2/engine/target/board/target-board.gc index cd2840d5ee..a050857cd1 100644 --- a/goal_src/jak2/engine/target/board/target-board.gc +++ b/goal_src/jak2/engine/target/board/target-board.gc @@ -861,8 +861,8 @@ (set! (-> self board sound-air-knob) 0.0) (set! (-> self board sound-bank-knob) 0.0) (set! (-> self board unknown-sound-id00) (new 'static 'sound-id)) - (set-setting! 'mode-sound-bank 'board 0 0) - (set-setting! 'sound-flava #f #x41f00000 2) + (set-setting! 'mode-sound-bank 'board 0.0 0) + (set-setting! 'sound-flava #f 30.0 2) (set! (-> self board board-get-on-time) (-> self clock frame-counter)) (set! (-> self board stick-lock) #f) (set! (-> self board stick-off) #f) @@ -920,10 +920,10 @@ (-> self control dynam gravity-normal) (the-as float (-> self control dynam gravity-length)) ) - (set-setting! 'string-spline-max-move 'abs #x46000000 0) - (set-setting! 'string-spline-accel 'abs #x433851ec 0) - (set-setting! 'string-spline-max-move-player 'abs #x45c00000 0) - (set-setting! 'string-spline-accel-player 'abs #x430f5c29 0) + (set-setting! 'string-spline-max-move 'abs (meters 2) 0) + (set-setting! 'string-spline-accel 'abs (meters 0.045) 0) + (set-setting! 'string-spline-max-move-player 'abs (meters 1.5) 0) + (set-setting! 'string-spline-accel-player 'abs (meters 0.035) 0) (none) ) diff --git a/goal_src/jak2/engine/target/logic-target.gc b/goal_src/jak2/engine/target/logic-target.gc index ee0c89133c..b4855cf672 100644 --- a/goal_src/jak2/engine/target/logic-target.gc +++ b/goal_src/jak2/engine/target/logic-target.gc @@ -3094,8 +3094,8 @@ (set! (-> obj tobot-recorder) #f) (set! (-> obj mode-cache) #f) (set! (-> obj color-effect) #f) - (set-setting! 'allow-pause #f 0 0) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (set! (-> *setting-control* cam-default mode-name) 'cam-string) (apply-settings *setting-control*) (if (not arg0) diff --git a/goal_src/jak2/engine/target/mech_suit/mech-states.gc b/goal_src/jak2/engine/target/mech_suit/mech-states.gc index 3aa0ac1728..647af0d262 100644 --- a/goal_src/jak2/engine/target/mech_suit/mech-states.gc +++ b/goal_src/jak2/engine/target/mech_suit/mech-states.gc @@ -1180,7 +1180,7 @@ (set! (-> self neck flex-blend) 0.0) (target-timed-invulnerable-off self 0) (target-timed-invulnerable-off self 0) - (set-setting! 'process-mask 'set 0 (process-mask platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask platform projectile death)) (apply-settings *setting-control*) (set! (-> self control transv quad) (the-as uint128 0)) (logior! (-> self focus-status) (focus-status dead)) @@ -1196,7 +1196,7 @@ (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "jakfall" -99.0 0) ) (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) - (set-setting! 'mode-name 'cam-endlessfall 0 0) + (set-setting! 'mode-name 'cam-endlessfall 0.0 0) (set! (-> self control pat-ignore-mask) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> self control pat-ignore-mask)) ) @@ -2706,7 +2706,7 @@ (logior! (-> self state-flags) (state-flags sf5)) (set! (-> self control mod-surface) *empty-mods*) (rot->dir-targ! (-> self control)) - (set-setting! 'slave-options 'clear 0 8192) + (set-setting! 'slave-options 'clear 0.0 (cam-slave-options BIKE_MODE)) (remove-setting! 'fov) (remove-setting! 'head-offset) (send-event *camera* 'set-dist #f #f) diff --git a/goal_src/jak2/engine/target/mech_suit/target-mech.gc b/goal_src/jak2/engine/target/mech_suit/target-mech.gc index 42b3848c03..440ea7ece2 100644 --- a/goal_src/jak2/engine/target/mech_suit/target-mech.gc +++ b/goal_src/jak2/engine/target/mech_suit/target-mech.gc @@ -1290,14 +1290,14 @@ ) ) (logior! (-> self state-flags) (state-flags sf6)) - (set-setting! 'string-max-length 'low #x46e00000 0) - (set-setting! 'string-min-length 'low #x46800000 0) - (set-setting! 'string-max-height 'low #x46a00000 0) - (set-setting! 'string-min-height 'low #x46600000 0) - (set-setting! 'fov 'abs #x46555555 0) - (set-setting! 'head-offset 'abs #x46900000 0) - (set-setting! 'mode-sound-bank 'mech 0 0) - (set-setting! 'sound-flava #f #x41f00000 3) + (set-setting! 'string-max-length 'low (meters 7) 0) + (set-setting! 'string-min-length 'low (meters 4) 0) + (set-setting! 'string-max-height 'low (meters 5) 0) + (set-setting! 'string-min-height 'low (meters 3.5) 0) + (set-setting! 'fov 'abs (degrees 75.0) 0) + (set-setting! 'head-offset 'abs (meters 4.5) 0) + (set-setting! 'mode-sound-bank 'mech 0.0 0) + (set-setting! 'sound-flava #f 30.0 3) (set! (-> self mech hud 0) (ppointer->handle (process-spawn hud-heatmeter :init hud-init-by-other :to self))) (remove-exit) (if arg2 diff --git a/goal_src/jak2/engine/target/target-darkjak.gc b/goal_src/jak2/engine/target/target-darkjak.gc index 03b49817e8..ea5488fea1 100644 --- a/goal_src/jak2/engine/target/target-darkjak.gc +++ b/goal_src/jak2/engine/target/target-darkjak.gc @@ -318,7 +318,7 @@ (set! (-> self darkjak start-time) (-> self clock frame-counter)) (set! (-> self darkjak attack-count) (the-as uint 0)) (set! (-> self darkjak-giant-interp) 1.0) - (set-setting! 'sound-flava #f #x41f00000 4) + (set-setting! 'sound-flava #f 30.0 4) (set! (-> self focus-status) (logior (focus-status dark) (-> self focus-status))) (set! (-> (the-as fact-info-target (-> self fact-override)) darkjak-start-time) (-> self clock frame-counter)) (set! (-> (the-as fact-info-target (-> self fact-override)) darkjak-effect-time) (seconds 20)) @@ -329,8 +329,8 @@ (if (logtest? arg0 64) (go target-stance) ) - (set-setting! 'bg-r 'abs #x3dcccccd 0) - (set-setting! 'bg-b 'abs #x3dcccccd 0) + (set-setting! 'bg-r 'abs 0.1 0) + (set-setting! 'bg-b 'abs 0.1 0) (set-forward-vel 0.0) (let ((s5-0 0)) (while (not (logtest? (-> self control status) (collide-status on-surface))) @@ -433,7 +433,7 @@ (set! (-> a1-1 message) 'target) (set! (-> a1-1 param 0) (the-as uint 'normal)) (let ((t9-1 send-event-function) - (v1-12 (-> *game-info* sub-task-list 4)) + (v1-12 (-> *game-info* sub-task-list (game-task-node city-help-kid-introduction))) ) (t9-1 (handle->process (if (-> v1-12 info) @@ -606,7 +606,7 @@ (sv-56 handle) (sv-64 int) ) - (set-setting! 'rapid-tracking #f 0 0) + (set-setting! 'rapid-tracking #f 0.0 0) ((lambda :behavior target () (set! (-> self control bend-target) (* 0.5 (-> self control bend-target))) @@ -1124,9 +1124,9 @@ (ja :num! (seek!)) ) ) - (set-setting! 'music-volume 'rel 0 0) - (set-setting! 'sfx-volume 'rel 0 0) - (set-setting! 'ambient-volume 'rel 0 0) + (set-setting! 'music-volume 'rel 0.0 0) + (set-setting! 'sfx-volume 'rel 0.0 0) + (set-setting! 'ambient-volume 'rel 0.0 0) (ja-no-eval :group! (-> self draw art-group data 416) :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 416)) frames num-frames) -1))) :frame-num 0.0 @@ -1583,8 +1583,8 @@ ) (logior! (-> self state-flags) (state-flags sf4)) (set! (-> self neck flex-blend) 0.0) - (set-setting! 'music-volume 'rel 0 0) - (set-setting! 'ambient-volume 'rel 0 0) + (set-setting! 'music-volume 'rel 0.0 0) + (set-setting! 'ambient-volume 'rel 0.0 0) (compute-alignment! (-> self align)) (set-action! *gui-control* @@ -1932,12 +1932,12 @@ ) ) (when gp-2 - (set-setting! 'string-min-length 'rel #x3fe66666 0) - (set-setting! 'string-max-length 'rel #x3fc00000 0) - (set-setting! 'string-spline-max-move 'abs #x46000000 0) - (set-setting! 'string-spline-accel 'abs #x433851ec 0) - (set-setting! 'string-spline-max-move-player 'abs #x45c00000 0) - (set-setting! 'string-spline-accel-player 'abs #x430f5c29 0) + (set-setting! 'string-min-length 'rel 1.8 0) + (set-setting! 'string-max-length 'rel 1.5 0) + (set-setting! 'string-spline-max-move 'abs (meters 2) 0) + (set-setting! 'string-spline-accel 'abs (meters 0.045) 0) + (set-setting! 'string-spline-max-move-player 'abs (meters 1.5) 0) + (set-setting! 'string-spline-accel-player 'abs (meters 0.035) 0) ) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! (-> self draw art-group data 412) :num! (seek! (ja-aframe 17.0 0)) :frame-num 0.0) diff --git a/goal_src/jak2/engine/target/target-death.gc b/goal_src/jak2/engine/target/target-death.gc index f6505a224b..de3c52aac4 100644 --- a/goal_src/jak2/engine/target/target-death.gc +++ b/goal_src/jak2/engine/target/target-death.gc @@ -128,12 +128,12 @@ ) (kill-persister *setting-control* (the-as engine-pers 'fail) 'bg-a) (when (not (logtest? (-> arg0 flags) (continue-flags cf4))) - (add-setting! 'bg-a 'abs #x3f800000 0) + (add-setting! 'bg-a 'abs 1.0 0) (set! (-> *setting-control* user-current bg-a) 1.0) ) - (set-setting! 'sfx-volume 'abs 0 0) - (set-setting! 'ambient-volume 'abs 0 0) - (set-setting! 'dialog-volume 'abs 0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) + (set-setting! 'dialog-volume 'abs 0.0 0) (when (and (not (string= (-> arg0 name) "default")) (not (demo?))) (let ((v1-37 (lookup-level-info (-> arg0 level)))) (when (and v1-37 @@ -141,15 +141,15 @@ (!= (-> v1-37 music-bank) (-> *setting-control* user-current music)) (!= (level-status *level* (-> arg0 vis-nick)) 'active) ) - (set-setting! 'music #f 0 0) - (set-setting! 'music-volume 'abs 0 0) + (set-setting! 'music #f 0.0 0) + (set-setting! 'music-volume 'abs 0.0 0) ) ) ) - (set-setting! 'region-mode #f 0 0) - (set-setting! 'border-mode #f 0 0) - (set-setting! 'allow-continue #f 0 0) - (set-setting! 'allow-timeout #f 0 0) + (set-setting! 'region-mode #f 0.0 0) + (set-setting! 'border-mode #f 0.0 0) + (set-setting! 'allow-continue #f 0.0 0) + (set-setting! 'allow-timeout #f 0.0 0) (set! (-> *setting-control* user-default border-mode) #f) (apply-settings *setting-control*) (reset-target-state #t) @@ -218,13 +218,13 @@ (remove-setting! 'music-volume) (let ((s5-2 (-> *level* border?))) (set! (-> *level* border?) (-> *level* play?)) - (set-setting! 'allow-continue #t 0 0) - (set-setting! 'border-mode #t 0 0) + (set-setting! 'allow-continue #t 0.0 0) + (set-setting! 'border-mode #t 0.0 0) (apply-settings *setting-control*) (script-eval '(teleport)) (script-eval (-> arg0 on-goto)) - (set-setting! 'allow-continue #f 0 0) - (set-setting! 'border-mode #f 0 0) + (set-setting! 'allow-continue #f 0.0 0) + (set-setting! 'border-mode #f 0.0 0) (apply-settings *setting-control*) (set! (-> *level* border?) s5-2) ) @@ -1382,7 +1382,7 @@ (if (or (rand-vu-percent? 0.5) (nonzero? (-> *task-manager-engine* length))) (set! gp-2 (the-as spool-anim #f)) ) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-progress #f 0.0 0) (target-death-anim gp-2) (cond ((or (not gp-2) (or (or (logtest? (water-flags touch-water) (-> self water flags)) @@ -1566,13 +1566,13 @@ (target-timed-invulnerable-off self 0) (case arg0 (('bot 'centipede) - (set-setting! 'process-mask 'set 0 (process-mask platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask platform projectile death)) ) (('endlessfall) - (set-setting! 'process-mask 'set 0 (process-mask enemy projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy projectile death)) ) (('instant-death 'lava 'dark-eco-pool 'melt 'explode 'grenade 'big-explosion 'turret) - (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) ) (else (let ((v1-21 (-> self water flags))) @@ -1585,7 +1585,7 @@ (set! arg0 'drown) ) ) - (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) (when (using-gun? self) (send-event (ppointer->process (-> self gun gun)) 'die) (target-gun-end-mode #f) @@ -1876,7 +1876,7 @@ (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "jakfall" -99.0 0) ) (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) - (set-setting! 'mode-name 'cam-endlessfall 0 0) + (set-setting! 'mode-name 'cam-endlessfall 0.0 0) (logclear! (-> self water flags) (water-flags swim-ground)) (let ((f0-1 (fmin -4096.0 (- (-> self control ground-impact-vel))))) (set! (-> self control unknown-word04) (the-as uint f0-1)) diff --git a/goal_src/jak2/engine/target/target-gun.gc b/goal_src/jak2/engine/target/target-gun.gc index b41fb8a31d..e7745b0d5f 100644 --- a/goal_src/jak2/engine/target/target-gun.gc +++ b/goal_src/jak2/engine/target/target-gun.gc @@ -230,9 +230,9 @@ (if (zero? (-> self gun blue-whine-sound-id)) (set! (-> self gun blue-whine-sound-id) (the-as uint (new-sound-id))) ) - (set-setting! 'mode-sound-bank 'gun 0 0) + (set-setting! 'mode-sound-bank 'gun 0.0 0) (sound-play "gun-takeout") - (set-setting! 'sound-flava #f #x41f00000 1) + (set-setting! 'sound-flava #f 30.0 1) (set! (-> self gun charge-ammo) 0.0) (set! (-> self gun charge-start-time) 0) (set! (-> self gun top-anim-tilt-up) 0.0) @@ -696,7 +696,7 @@ (set! (-> self gun combo-fire-delay) (the-as uint 150)) (set! (-> self gun track-beam-size) 1228.8) (remove-setting! 'gun-min-height) - (set-setting! 'gun-max-height 'abs #x46c00000 0) + (set-setting! 'gun-max-height 'abs (meters 6) 0) ) ((4) (set! (-> self gun gun-control) (the-as uint 2)) diff --git a/goal_src/jak2/engine/target/target-tube.gc b/goal_src/jak2/engine/target/target-tube.gc index 41b28861b3..9017511bf8 100644 --- a/goal_src/jak2/engine/target/target-tube.gc +++ b/goal_src/jak2/engine/target/target-tube.gc @@ -571,7 +571,7 @@ (none) ) :code (behavior ((arg0 handle)) - (set-setting! 'slave-options 'set 0 8192) + (set-setting! 'slave-options 'set 0.0 (cam-slave-options BIKE_MODE)) (target-exit) (set! (-> self control surf) *tube-surface*) (if (zero? (-> self tube)) @@ -936,7 +936,7 @@ (local-vars (v1-42 symbol)) (set! (-> self neck flex-blend) 0.0) (target-timed-invulnerable-off self 0) - (add-setting! 'process-mask 'set 0 (process-mask enemy platform projectile death)) + (add-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) (apply-settings *setting-control*) (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self control mod-surface) *neutral-mods*) diff --git a/goal_src/jak2/engine/target/target-turret.gc b/goal_src/jak2/engine/target/target-turret.gc index c2f22477c0..b17e28afee 100644 --- a/goal_src/jak2/engine/target/target-turret.gc +++ b/goal_src/jak2/engine/target/target-turret.gc @@ -1043,7 +1043,7 @@ ) ) :enter (behavior () - (set-setting! 'mode-name 'cam-turret 0 0) + (set-setting! 'mode-name 'cam-turret 0.0 0) (none) ) :code (the-as (function none :behavior base-turret) sleep-code) diff --git a/goal_src/jak2/engine/target/target2.gc b/goal_src/jak2/engine/target/target2.gc index 03154b6b38..437c44f669 100644 --- a/goal_src/jak2/engine/target/target2.gc +++ b/goal_src/jak2/engine/target/target2.gc @@ -257,7 +257,7 @@ (set! (-> self cam-user-mode) 'look-around) (set! (-> self control mod-surface) *look-around-mods*) (logior! (-> self focus-status) (focus-status in-head)) - (set-setting! 'mode-name 'cam-eye 0 0) + (set-setting! 'mode-name 'cam-eye 0.0 0) (none) ) :exit (behavior () diff --git a/goal_src/jak2/engine/ui/credits.gc b/goal_src/jak2/engine/ui/credits.gc index ab44b93307..f1120b8217 100644 --- a/goal_src/jak2/engine/ui/credits.gc +++ b/goal_src/jak2/engine/ui/credits.gc @@ -82,10 +82,10 @@ process (lambda :behavior scene-player () - (set-setting! 'allow-pause #f 0 0) - (set-setting! 'allow-progress #f 0 0) - (set-setting! 'music 'forest 0 0) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'music 'forest 0.0 0) + (set-setting! 'sound-mode #f 0.0 1) (apply-settings *setting-control*) (let ((gp-0 (ppointer->process (-> self parent)))) (when (type? gp-0 scene-player) diff --git a/goal_src/jak2/engine/ui/progress/progress-draw.gc b/goal_src/jak2/engine/ui/progress/progress-draw.gc index 89fad17004..58739afb2c 100644 --- a/goal_src/jak2/engine/ui/progress/progress-draw.gc +++ b/goal_src/jak2/engine/ui/progress/progress-draw.gc @@ -4165,7 +4165,7 @@ (none) ) -;; WARN: Return type mismatch object vs pointer. +;; WARN: Return type mismatch object vs none. (defun draw-secret-list ((arg0 secret-item-option) (arg1 progress) (arg2 font-context) (arg3 int) (arg4 symbol) (arg5 float)) (let ((s4-0 (and arg4 (= arg3 1)))) 380.0 @@ -4242,77 +4242,74 @@ ) ) ) - (the-as - pointer - (cond - ((and (not s4-0) (not (logtest? (-> *game-info* purchase-secrets) (-> arg0 flag)))) - (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) - 50 - 45 - ) - ) - ) - (let ((s4-2 print-game-text)) - (format (clear *temp-string*) "~D" (-> arg0 cost)) - (s4-2 *temp-string* arg2 #f 44 (bucket-id progress)) + (cond + ((and (not s4-0) (not (logtest? (-> *game-info* purchase-secrets) (-> arg0 flag)))) + (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 50 + 45 + ) + ) ) + (let ((s4-2 print-game-text)) + (format (clear *temp-string*) "~D" (-> arg0 cost)) + (s4-2 *temp-string* arg2 #f 44 (bucket-id progress)) ) - ((and (not s4-0) (= (-> arg0 can-toggle) #t) (logtest? (-> *game-info* secrets) (-> arg0 flag))) - (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) - 50 - 45 - ) - ) - ) - (let ((s5-2 print-game-text)) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (text-id progress-on) #f)) - (s5-2 *temp-string* arg2 #f 44 (bucket-id progress)) + ) + ((and (not s4-0) (= (-> arg0 can-toggle) #t) (logtest? (-> *game-info* secrets) (-> arg0 flag))) + (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 50 + 45 + ) + ) ) + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (text-id progress-on) #f)) + (s5-2 *temp-string* arg2 #f 44 (bucket-id progress)) ) - ((and (not s4-0) (= (-> arg0 can-toggle) #t) (not (logtest? (-> *game-info* secrets) (-> arg0 flag)))) - (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) - 50 - 45 - ) - ) - ) - (let ((s5-4 print-game-text)) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (text-id progress-off) #f)) - (s5-4 *temp-string* arg2 #f 44 (bucket-id progress)) + ) + ((and (not s4-0) (= (-> arg0 can-toggle) #t) (not (logtest? (-> *game-info* secrets) (-> arg0 flag)))) + (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 50 + 45 + ) + ) ) + (let ((s5-4 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (text-id progress-off) #f)) + (s5-4 *temp-string* arg2 #f 44 (bucket-id progress)) ) - ((and (not s4-0) (!= (-> arg0 can-toggle) #t)) - (let ((s3-8 80) - (s5-5 70) - (f30-3 (-> arg2 origin x)) - ) - (set! s3-8 (cond - ((= (get-aspect-ratio) 'aspect4x3) - (empty) - s3-8 - ) - (else - s5-5 - ) + ) + ((and (not s4-0) (!= (-> arg0 can-toggle) #t)) + (let ((s3-8 80) + (s5-5 70) + (f30-3 (-> arg2 origin x)) + ) + (set! s3-8 (cond + ((= (get-aspect-ratio) 'aspect4x3) + (empty) + s3-8 + ) + (else + s5-5 ) - ) - (set! (-> arg2 origin x) (+ f30-3 (the float s3-8))) - ) - (let ((a0-61 arg2)) - (set! (-> a0-61 flags) (font-flags kerning right large)) - ) - (let ((s5-6 print-game-text)) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (text-id progress-secrets-unlocked) #f)) - (s5-6 *temp-string* arg2 #f 44 (bucket-id progress)) - ) - (let ((v0-15 (the-as object arg2))) - (set! (-> (the-as font-context v0-15) flags) (font-flags kerning large)) - v0-15 - ) + ) + ) + (set! (-> arg2 origin x) (+ f30-3 (the float s3-8))) ) - ) + (let ((a0-61 arg2)) + (set! (-> a0-61 flags) (font-flags kerning right large)) + ) + (let ((s5-6 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (text-id progress-secrets-unlocked) #f)) + (s5-6 *temp-string* arg2 #f 44 (bucket-id progress)) + ) + (let ((v0-32 arg2)) + (set! (-> v0-32 flags) (font-flags kerning large)) + ) + ) ) ) + (none) ) (defmethod draw-option menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) @@ -5071,7 +5068,11 @@ (set! v0-0 #t) ) ((= v1-0 1) - (set! v0-0 (logtest? (-> *game-info* sub-task-list 75 flags) (game-task-node-flag closed))) + (set! v0-0 + (logtest? (-> *game-info* sub-task-list (game-task-node city-yellow-gun-training-introduction) flags) + (game-task-node-flag closed) + ) + ) ) ((= v1-0 2) (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets gungame-blue))) @@ -5080,27 +5081,45 @@ (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets gungame-dark))) ) ((= v1-0 4) - (set! v0-0 (logtest? (-> *game-info* sub-task-list 63 flags) (game-task-node-flag closed))) + (set! v0-0 (logtest? (-> *game-info* sub-task-list (game-task-node stadium-board1-introduction) flags) + (game-task-node-flag closed) + ) + ) ) ((= v1-0 5) - (set! v0-0 (logtest? (-> *game-info* sub-task-list 135 flags) (game-task-node-flag closed))) + (set! v0-0 (logtest? (-> *game-info* sub-task-list (game-task-node stadium-race-class3-introduction) flags) + (game-task-node-flag closed) + ) + ) ) ((= v1-0 6) - (set! v0-0 (logtest? (-> *game-info* sub-task-list 181 flags) (game-task-node-flag closed))) + (set! v0-0 (logtest? (-> *game-info* sub-task-list (game-task-node stadium-race-class2-introduction) flags) + (game-task-node-flag closed) + ) + ) ) ((= v1-0 7) - (set! v0-0 (logtest? (-> *game-info* sub-task-list 209 flags) (game-task-node-flag closed))) + (set! v0-0 (logtest? (-> *game-info* sub-task-list (game-task-node stadium-race-class1-introduction) flags) + (game-task-node-flag closed) + ) + ) ) ((= v1-0 8) - (set! v0-0 (or (logtest? (-> *game-info* sub-task-list 308 flags) (game-task-node-flag closed)) - (open? (-> *game-info* sub-task-list 308)) - ) + (set! v0-0 + (or (logtest? (-> *game-info* sub-task-list (game-task-node city-burning-bush-race-port-introduction) flags) + (game-task-node-flag closed) + ) + (open? (-> *game-info* sub-task-list (game-task-node city-burning-bush-race-port-introduction))) + ) ) ) ((= v1-0 9) - (set! v0-0 (or (logtest? (-> *game-info* sub-task-list 306 flags) (game-task-node-flag closed)) - (open? (-> *game-info* sub-task-list 306)) - ) + (set! v0-0 + (or (logtest? (-> *game-info* sub-task-list (game-task-node city-burning-bush-race-errol-introduction) flags) + (game-task-node-flag closed) + ) + (open? (-> *game-info* sub-task-list (game-task-node city-burning-bush-race-errol-introduction))) + ) ) ) ((= v1-0 10) @@ -5113,10 +5132,16 @@ (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets reverse-races))) ) ((= v1-0 13) - (set! v0-0 (logtest? (-> *game-info* sub-task-list 149 flags) (game-task-node-flag closed))) + (set! v0-0 (logtest? (-> *game-info* sub-task-list (game-task-node city-play-onin-game-introduction) flags) + (game-task-node-flag closed) + ) + ) ) ((= v1-0 14) - (set! v0-0 (logtest? (-> *game-info* sub-task-list 224 flags) (game-task-node-flag closed))) + (set! v0-0 (logtest? (-> *game-info* sub-task-list (game-task-node city-whack-introduction) flags) + (game-task-node-flag closed) + ) + ) ) ) ) diff --git a/goal_src/jak2/engine/ui/progress/progress.gc b/goal_src/jak2/engine/ui/progress/progress.gc index 2237ee964a..3e211c26c8 100644 --- a/goal_src/jak2/engine/ui/progress/progress.gc +++ b/goal_src/jak2/engine/ui/progress/progress.gc @@ -363,7 +363,7 @@ (hide-hud #f) (disable-level-text-file-loading) (logclear! (-> self mask) (process-mask menu progress actor-pause)) - (add-setting! 'process-mask 'set 0 (process-mask progress)) + (add-setting! 'process-mask 'set 0.0 (process-mask progress)) (set! (-> self clock) (-> *display* real-clock)) (apply-settings *setting-control*) (set-blackout-frames 0) @@ -1293,7 +1293,6 @@ 0 ) -;; ERROR: Failed store: (s.w! (+ v1-8 8) 0) at op 19 (defun end-scan ((arg0 hud-box) (arg1 float)) (with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) diff --git a/goal_src/jak2/levels/atoll/ash1-course.gc b/goal_src/jak2/levels/atoll/ash1-course.gc index a8b229fb80..e0f49a9233 100644 --- a/goal_src/jak2/levels/atoll/ash1-course.gc +++ b/goal_src/jak2/levels/atoll/ash1-course.gc @@ -166,9 +166,9 @@ (send-event arg0 'hide #f) (ashelin-method-250 arg0 #t) (set! (-> arg0 notice-enemy-dist) 245760.0) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) (logior! (-> arg0 bot-flags) (bot-flags bf06)) - (set-setting! 'airlock #f 0 0) + (set-setting! 'airlock #f 0.0 0) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) (process->ppointer pp)) (set! (-> a1-4 num-params) 0) diff --git a/goal_src/jak2/levels/atoll/atoll-obs.gc b/goal_src/jak2/levels/atoll/atoll-obs.gc index 0bea6ebb86..7fc3baf10c 100644 --- a/goal_src/jak2/levels/atoll/atoll-obs.gc +++ b/goal_src/jak2/levels/atoll/atoll-obs.gc @@ -1305,8 +1305,8 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 18 - 3 + (game-task-node atoll-water-exit) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (local-vars (v1-31 symbol)) diff --git a/goal_src/jak2/levels/atoll/sig0-course.gc b/goal_src/jak2/levels/atoll/sig0-course.gc index 497559e80a..b8a0615129 100644 --- a/goal_src/jak2/levels/atoll/sig0-course.gc +++ b/goal_src/jak2/levels/atoll/sig0-course.gc @@ -318,7 +318,7 @@ (logclear! (-> arg0 focus-status) (focus-status disable)) (logior! (-> arg0 bot-flags) (bot-flags bf06)) (set! (-> arg0 too-far-warn-dist) 286720.0) - (set-setting! 'airlock #f 0 0) + (set-setting! 'airlock #f 0.0 0) (let ((a1-3 (new 'stack-no-clear 'array 'symbol 3))) (set! (-> a1-3 2) 'atoll3) (set! (-> a1-3 1) 'atoll2) @@ -968,7 +968,7 @@ (process-grab? *target* #f) (reset-warn-time! arg1) (play-speech arg1 10) - (set-setting! 'entity-name "camera-68" 0 0) + (set-setting! 'entity-name "camera-68" 0.0 0) ) (else (set! (-> arg1 too-far-warn-dist) 81920.0) @@ -992,7 +992,7 @@ (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3)) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) 2) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) ) ) ) @@ -1400,7 +1400,7 @@ (process-grab? *target* #f) (play-speech arg1 15) (reset-warn-time! arg1) - (set-setting! 'entity-name "camera-69" 0 0) + (set-setting! 'entity-name "camera-69" 0.0 0) ) (else (set! (-> arg1 too-far-warn-dist) 73728.0) @@ -1424,7 +1424,7 @@ (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3)) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) 1) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) ) ) ) @@ -1806,7 +1806,7 @@ (process-grab? *target* #f) (reset-warn-time! arg1) (play-speech arg1 21) - (set-setting! 'entity-name "camera-70" 0 0) + (set-setting! 'entity-name "camera-70" 0.0 0) ) (else (set! (-> arg1 too-far-warn-dist) 61440.0) @@ -1830,7 +1830,7 @@ (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3)) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) 1) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) ) ) ) @@ -2155,7 +2155,7 @@ (process-grab? *target* #f) (reset-warn-time! arg1) (play-speech arg1 23) - (set-setting! 'entity-name "camera-71" 0 0) + (set-setting! 'entity-name "camera-71" 0.0 0) ) (else (set! (-> arg1 too-far-warn-dist) 73728.0) @@ -2186,7 +2186,7 @@ (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) 1) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) ) ) ) @@ -2785,7 +2785,7 @@ (process-grab? *target* #f) (reset-warn-time! arg1) (play-speech arg1 31) - (set-setting! 'entity-name "camera-72" 0 0) + (set-setting! 'entity-name "camera-72" 0.0 0) ) (else (set! (-> arg1 too-far-warn-dist) 61440.0) @@ -2816,7 +2816,7 @@ (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x -1.0) 0) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) 1) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) ) ) ) diff --git a/goal_src/jak2/levels/castle/boss/castle-baron.gc b/goal_src/jak2/levels/castle/boss/castle-baron.gc index 9451ab33da..e9762208c9 100644 --- a/goal_src/jak2/levels/castle/boss/castle-baron.gc +++ b/goal_src/jak2/levels/castle/boss/castle-baron.gc @@ -2141,7 +2141,7 @@ For example for an elevator pre-compute the distance between the first and last ) (process-spawn scene-player :init scene-player-init "castle-krew-boss-fight-intro" #t #f) ) - (set-setting! 'music 'danger6 0 0) + (set-setting! 'music 'danger6 0.0 0) (while (not (task-node-closed? (game-task-node castle-boss-introduction))) (suspend) ) @@ -3190,7 +3190,7 @@ For example for an elevator pre-compute the distance between the first and last (t9-0) ) ) - (set-setting! 'music #f 0 0) + (set-setting! 'music #f 0.0 0) (nav-enemy-method-166 self) (let ((v1-8 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-8 enemy-flags))) diff --git a/goal_src/jak2/levels/castle/pad/caspad-obs.gc b/goal_src/jak2/levels/castle/pad/caspad-obs.gc index b82ae5b22a..69eb4ba077 100644 --- a/goal_src/jak2/levels/castle/pad/caspad-obs.gc +++ b/goal_src/jak2/levels/castle/pad/caspad-obs.gc @@ -97,7 +97,7 @@ ) (when (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) (configure-collision self #t) - (set-setting! 'jump #f 0 0) + (set-setting! 'jump #f 0.0 0) ) (none) ) diff --git a/goal_src/jak2/levels/castle/pad/castle-tasks.gc b/goal_src/jak2/levels/castle/pad/castle-tasks.gc index 0477af98f9..cb4554ce2d 100644 --- a/goal_src/jak2/levels/castle/pad/castle-tasks.gc +++ b/goal_src/jak2/levels/castle/pad/castle-tasks.gc @@ -9,33 +9,30 @@ (set-subtask-hook! *game-info* - 219 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> self info end-sphere quad)) - (quaternion-identity! (-> gp-0 quat)) - (set! (-> gp-0 flags) (task-arrow-flags)) - (set! (-> gp-0 map-icon) (the-as uint 15)) - (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) - ) - (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 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-2) (seconds 0.007)) - (suspend) - ) - ) - (go-virtual complete) - ) - (suspend) - ) - #f - (none) + (game-task-node castle-break-in-castle-1) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> self info end-sphere quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) ) + (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 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-2) (seconds 0.007)) + (suspend) + ) + ) + (go-virtual complete) + ) + (suspend) + ) + #f + (none) ) ) diff --git a/goal_src/jak2/levels/city/common/ctywide-obs.gc b/goal_src/jak2/levels/city/common/ctywide-obs.gc index e128887fb8..83e644aabe 100644 --- a/goal_src/jak2/levels/city/common/ctywide-obs.gc +++ b/goal_src/jak2/levels/city/common/ctywide-obs.gc @@ -1451,7 +1451,7 @@ This commonly includes things such as: :code (the-as (function none :behavior cty-guard-turret) sleep-code) :post (behavior () (when (>= (-> self id) 0) - (let* ((v1-4 (-> *game-info* sub-task-list 87)) + (let* ((v1-4 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) (gp-0 (if (-> v1-4 info) (-> v1-4 info manager) (the-as handle #f) @@ -1527,7 +1527,7 @@ This commonly includes things such as: :to self ) ) - (when (and (>= (-> self id) 0) (let ((v1-12 (-> *game-info* sub-task-list 87))) + (when (and (>= (-> self id) 0) (let ((v1-12 (-> *game-info* sub-task-list (game-task-node city-power-resolution)))) (handle->process (if (-> v1-12 info) (-> v1-12 info manager) (the-as handle #f) @@ -1542,7 +1542,7 @@ This commonly includes things such as: (set! (-> a1-6 message) 'guard-turret-killed) (set! (-> a1-6 param 0) (the-as uint (-> self id))) (let ((t9-5 send-event-function) - (v1-23 (-> *game-info* sub-task-list 87)) + (v1-23 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) ) (t9-5 (handle->process (if (-> v1-23 info) @@ -1564,7 +1564,7 @@ This commonly includes things such as: (cond ((and (>= (-> self id) 0) (begin - (let ((v1-4 (-> *game-info* sub-task-list 87))) + (let ((v1-4 (-> *game-info* sub-task-list (game-task-node city-power-resolution)))) (set! v1-6 (if (-> v1-4 info) (-> v1-4 info manager) (the-as handle #f) @@ -1598,7 +1598,7 @@ This commonly includes things such as: (set! (-> a1-2 message) 'guard-turret-button-pushed) (set! (-> a1-2 param 0) (the-as uint (-> self id))) (let ((t9-1 send-event-function) - (v1-25 (-> *game-info* sub-task-list 87)) + (v1-25 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) ) (t9-1 (handle->process (if (-> v1-25 info) @@ -1663,7 +1663,7 @@ This commonly includes things such as: (set! (-> a1-0 param 0) (the-as uint (-> self id))) (set! (-> a1-0 param 1) (the-as uint #f)) (let ((t9-0 send-event-function) - (v1-6 (-> *game-info* sub-task-list 87)) + (v1-6 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) ) (t9-0 (handle->process (if (-> v1-6 info) @@ -1694,7 +1694,7 @@ This commonly includes things such as: (set! (-> a1-2 message) 'guard-turret-button-pushed) (set! (-> a1-2 param 0) (the-as uint (-> self id))) (let ((t9-3 send-event-function) - (v1-25 (-> *game-info* sub-task-list 87)) + (v1-25 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) ) (t9-3 (handle->process (if (-> v1-25 info) @@ -1742,7 +1742,7 @@ This commonly includes things such as: (set! (-> a1-0 param 0) (the-as uint (-> self id))) (set! (-> a1-0 param 1) (the-as uint #t)) (let ((t9-0 send-event-function) - (v1-7 (-> *game-info* sub-task-list 87)) + (v1-7 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) ) (t9-0 (handle->process (if (-> v1-7 info) @@ -2218,7 +2218,7 @@ This commonly includes things such as: (cond ((and (>= (-> obj id) 0) (begin - (let ((v1-21 (-> *game-info* sub-task-list 87))) + (let ((v1-21 (-> *game-info* sub-task-list (game-task-node city-power-resolution)))) (set! v1-23 (if (-> v1-21 info) (-> v1-21 info manager) (the-as handle #f) @@ -2240,7 +2240,7 @@ This commonly includes things such as: (set! (-> a1-11 param 0) (the-as uint (-> obj id))) (set! (-> a1-11 param 1) (the-as uint (-> obj root-override trans))) (let* ((t9-12 send-event-function) - (v1-33 (-> *game-info* sub-task-list 87)) + (v1-33 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) (v1-38 (t9-12 (handle->process (if (-> v1-33 info) (-> v1-33 info manager) @@ -3167,7 +3167,7 @@ This commonly includes things such as: (defstate talking (burning-bush) :virtual #t :enter (behavior () - (set-setting! 'minimap 'clear 0 128) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self time) -1.0) (process-entity-status! self (entity-perm-status no-kill) #t) (none) @@ -3266,7 +3266,7 @@ This commonly includes things such as: ) ) :code (behavior () - (set-setting! 'mode-name 'cam-really-fixed 0 0) + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) (suspend) (until (process-grab? *target* #f) (suspend) @@ -3356,7 +3356,7 @@ This commonly includes things such as: (defstate menu (burning-bush) :virtual #t :enter (behavior () - (set-setting! 'minimap 'clear 0 128) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self time) -1.0) (set! (-> self state-time) (-> self clock frame-counter)) (none) @@ -3758,7 +3758,7 @@ This commonly includes things such as: ) ) :code (behavior () - (set-setting! 'mode-name 'cam-really-fixed 0 0) + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) (suspend) (until (process-grab? *target* #f) (suspend) diff --git a/goal_src/jak2/levels/city/common/ctywide-tasks.gc b/goal_src/jak2/levels/city/common/ctywide-tasks.gc index 0720562456..6a9075e578 100644 --- a/goal_src/jak2/levels/city/common/ctywide-tasks.gc +++ b/goal_src/jak2/levels/city/common/ctywide-tasks.gc @@ -11,162 +11,156 @@ (set-subtask-hook! *game-info* - 68 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #f) 0)) - (none) - ) - ) - ) - -(set-subtask-hook! *game-info* 68 2 (the-as (function object) (lambda :behavior task-manager () (none)))) - -(set-subtask-hook! - *game-info* - 64 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 39) (the-as int #f) (the-as vector #f) 0)) - (none) - ) + (game-task-node stadium-board1-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #f) 0)) + (none) ) ) (set-subtask-hook! *game-info* - 64 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (none) - ) - ) + (game-task-node stadium-board1-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager () (none)) ) (set-subtask-hook! *game-info* - 140 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> (new 'static 'vector :x 3132661.8 :y 33669.12 :z -2965708.8 :w 1.0) quad)) - (quaternion-identity! (-> gp-0 quat)) - (set! (-> gp-0 flags) (task-arrow-flags)) - (set! (-> gp-0 map-icon) (the-as uint 15)) - (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) - ) - (none) - ) + (game-task-node stadium-board1-board) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 39) (the-as int #f) (the-as vector #f) 0)) + (none) ) ) (set-subtask-hook! *game-info* - 140 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (when (movie?) - (if (handle->process (-> self arrow)) - (send-event (handle->process (-> self arrow)) 'leave) - ) - ) - (none) - ) - ) + (game-task-node stadium-board1-board) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (none) + ) ) (set-subtask-hook! *game-info* - 140 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (send-event (handle->process (-> self arrow)) 'leave) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (none) - ) - ) + (game-task-node city-protect-water-slums-get-seal) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> (new 'static 'vector :x 3132661.8 :y 33669.12 :z -2965708.8 :w 1.0) quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) + ) + (none) + ) ) (set-subtask-hook! *game-info* - 4 - 3 - (the-as (function object) (lambda :behavior task-manager - () - (while (not *traffic-manager*) - (suspend) - ) - (suspend) - (let ((gp-0 *traffic-manager*)) - (send-event gp-0 'deactivate-by-type 6) - (send-event gp-0 'deactivate-by-type 18) - (send-event gp-0 'deactivate-by-type 19) - (send-event gp-0 'deactivate-by-type 20) - (send-event gp-0 'set-guard-target-level 0) - ) - (set-setting! 'pilot #f 0 0) - (set-setting! 'vehicle-hijacking #f 0 0) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (while (let ((a0-9 (level-get-target-inside *level*))) - (not (and a0-9 (logtest? (-> a0-9 info level-flags) 1))) - ) - (suspend) - ) - (set-setting! 'airlock #f 0 0) - (apply-settings *setting-control*) - (none) - ) + (game-task-node city-protect-water-slums-get-seal) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (when (movie?) + (if (handle->process (-> self arrow)) + (send-event (handle->process (-> self arrow)) 'leave) ) + ) + (none) + ) ) -(set-subtask-hook! *game-info* 4 1 (the-as (function object) (lambda :behavior task-manager - () - (let ((a0-0 *traffic-manager*)) - (send-event a0-0 'restore-default-settings) - ) - (none) - ) - ) - ) - (set-subtask-hook! *game-info* - 4 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('target) - (case (-> arg3 param 0) - (('normal) - (send-event (handle->process (-> self slave 0)) 'request 'scene-player) - ) - ) - ) - ) - ) + (game-task-node city-protect-water-slums-get-seal) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (send-event (handle->process (-> self arrow)) 'leave) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-help-kid-introduction) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (while (not *traffic-manager*) + (suspend) + ) + (suspend) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'deactivate-by-type 6) + (send-event gp-0 'deactivate-by-type 18) + (send-event gp-0 'deactivate-by-type 19) + (send-event gp-0 'deactivate-by-type 20) + (send-event gp-0 'set-guard-target-level 0) + ) + (set-setting! 'pilot #f 0.0 0) + (set-setting! 'vehicle-hijacking #f 0.0 0) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (while (let ((a0-9 (level-get-target-inside *level*))) + (not (and a0-9 (logtest? (-> a0-9 info level-flags) 1))) + ) + (suspend) + ) + (set-setting! 'airlock #f 0.0 0) + (apply-settings *setting-control*) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-help-kid-introduction) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (let ((a0-0 *traffic-manager*)) + (send-event a0-0 'restore-default-settings) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-help-kid-introduction) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('target) + (case (-> arg3 param 0) + (('normal) + (send-event (handle->process (-> self slave 0)) 'request 'scene-player) ) + ) + ) + ) + ) ) ;; WARN: Return type mismatch symbol vs none. @@ -179,518 +173,501 @@ (set-subtask-hook! *game-info* - 7 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self sound-id 0) - (the-as sound-id (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 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) - (suspend) + (game-task-node city-vehicle-training-map) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 38) *entity-pool* (target-pos 0) (the-as region #f))) ) - ) - (while (or (not *target*) (focus-test? *target* dead teleporting)) + (wait-for-speech-end (-> self sound-id 0)) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) (suspend) ) - (set! (-> self sound-id 0) - (the-as sound-id (talker-spawn-func (-> *talker-speech* 39) *entity-pool* (target-pos 0) (the-as region #f))) - ) - (wait-for-speech-end (-> self sound-id 0)) - (go-virtual complete) - (none) ) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 39) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (wait-for-speech-end (-> self sound-id 0)) + (go-virtual complete) + (none) ) ) (set-subtask-hook! *game-info* - 8 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (and (= (-> self sub-state) 1) (not (and *target* (focus-test? *target* pilot)))) - (set! (-> self sound-id 0) - (the-as sound-id (talker-spawn-func (-> *talker-speech* 46) *entity-pool* (target-pos 0) (the-as region #f))) - ) - (go-virtual fail) - ) - (none) + (game-task-node city-vehicle-training-hover-zone-1) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (when (and (= (-> self sub-state) 1) (not (and *target* (focus-test? *target* pilot)))) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 46) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (go-virtual fail) ) + (none) ) ) (set-subtask-hook! *game-info* - 8 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (local-vars (v1-1 object)) - (until v1-1 - (suspend) - (set! v1-1 (and *target* (focus-test? *target* pilot))) - ) - (set! (-> self slave 0) (-> *target* pilot vehicle)) - (set! (-> self sub-state) (the-as uint 1)) - (while (or (not *target*) (focus-test? *target* dead teleporting)) - (suspend) - ) - (set! (-> self sound-id 0) - (the-as sound-id (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 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) - (suspend) - ) - ) - (while (or (not *target*) (focus-test? *target* dead teleporting)) - (suspend) - ) - (set! (-> self sound-id 0) - (the-as sound-id (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 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-3) (seconds 1)) - (suspend) - ) - ) - (while (or (not *target*) (focus-test? *target* dead teleporting)) - (suspend) - ) - (set! (-> self sound-id 0) - (the-as sound-id (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))) - ) - (while (let ((v1-34 (handle->process (-> self slave 0)))) - (not (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-34) flags))) - ) - (suspend) - ) - (wait-for-speech-end (-> self sound-id 0)) - (while (or (not *target*) (focus-test? *target* dead teleporting)) - (suspend) - ) - (set! (-> self sound-id 0) - (the-as sound-id (talker-spawn-func (-> *talker-speech* 37) *entity-pool* (target-pos 0) (the-as region #f))) - ) - (wait-for-speech-end (-> self sound-id 0)) - (set! (-> self sub-state) (the-as uint 2)) - (let ((gp-6 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-6) (seconds 1)) - (suspend) - ) - ) - (go-virtual complete) - (none) + (game-task-node city-vehicle-training-hover-zone-1) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (local-vars (v1-1 object)) + (until v1-1 + (suspend) + (set! v1-1 (and *target* (focus-test? *target* pilot))) ) - ) - ) - -(set-subtask-hook! - *game-info* - 8 - 5 - (the-as (function object) (lambda :behavior task-manager - () - (task-node-close! (game-task-node city-vehicle-training-hover-zone-1)) - (none) - ) + (set! (-> self slave 0) (-> *target* pilot vehicle)) + (set! (-> self sub-state) (the-as uint 1)) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 31) *entity-pool* (target-pos 0) (the-as region #f))) ) - ) - -(set-subtask-hook! - *game-info* - 8 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (task-node-close! (game-task-node city-vehicle-training-hover-zone-2)) - (none) - ) + (wait-for-speech-end (-> self sound-id 0)) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (suspend) + ) + ) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 35) *entity-pool* (target-pos 0) (the-as region #f))) ) - ) - -(set-subtask-hook! - *game-info* - 9 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (cond - ((zero? (-> self sub-state)) - (cond - ((and *target* (focus-test? *target* pilot)) - (let ((v1-8 (handle->process (-> *target* pilot vehicle)))) - (if (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-8) flags)) - (go-virtual complete) - ) - ) - ) - (else - (set! (-> self state-time) (-> self clock frame-counter)) + (wait-for-speech-end (-> self sound-id 0)) + (let ((gp-3 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-3) (seconds 1)) + (suspend) + ) + ) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (while (let ((v1-34 (handle->process (-> self slave 0)))) + (not (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-34) flags))) ) + (suspend) + ) + (wait-for-speech-end (-> self sound-id 0)) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 37) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (wait-for-speech-end (-> self sound-id 0)) + (set! (-> self sub-state) (the-as uint 2)) + (let ((gp-6 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-6) (seconds 1)) + (suspend) + ) + ) + (go-virtual complete) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-vehicle-training-hover-zone-1) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager + () + (task-node-close! (game-task-node city-vehicle-training-hover-zone-1)) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-vehicle-training-hover-zone-1) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (task-node-close! (game-task-node city-vehicle-training-hover-zone-2)) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-vehicle-training-hover-zone-2) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (cond + ((zero? (-> self sub-state)) + (cond + ((and *target* (focus-test? *target* pilot)) + (let ((v1-8 (handle->process (-> *target* pilot vehicle)))) + (if (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-8) flags)) + (go-virtual complete) + ) + ) + ) + (else + (set! (-> self state-time) (-> self clock frame-counter)) ) ) - ((= (-> self sub-state) 1) - (if (not (and *target* (focus-test? *target* pilot))) - (go-virtual fail) + ) + ((= (-> self sub-state) 1) + (if (not (and *target* (focus-test? *target* pilot))) + (go-virtual fail) + ) + ) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-vehicle-training-hover-zone-2) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 60)) + (suspend) + ) + (set! (-> self sub-state) (the-as uint 1)) + (set! (-> self sound-id 0) + (the-as sound-id (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 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (suspend) + ) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (while (let ((v1-15 (handle->process (-> *target* pilot vehicle)))) + (not (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-15) flags))) ) - ) - ) - (none) + (suspend) ) + (wait-for-speech-end (-> self sound-id 0)) + (set! (-> self sound-id 0) + (the-as sound-id (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 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-4) (seconds 3)) + (suspend) + ) + ) + (go-virtual complete) + (none) ) ) (set-subtask-hook! *game-info* - 9 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 60)) - (suspend) - ) - (set! (-> self sub-state) (the-as uint 1)) - (set! (-> self sound-id 0) - (the-as sound-id (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 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (game-task-node city-keira-delivery-delivery) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -245760.0 :y 45056.0 :z 5468160.0 :w 1.0) quad)) + (set! (-> self end-pos quad) (-> (new 'static 'vector :x 579584.0 :y 49152.0 :z -1985331.2 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (let ((s5-0 *traffic-manager*) + (gp-0 (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> gp-0 position quad) (-> self begin-pos quad)) + (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 16384.0) + (set! (-> gp-0 object-type) (traffic-type bikec)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 proc) #f) + (send-event s5-0 'spawn-object gp-0) + (if (-> gp-0 proc) + (set! (-> self slave 0) (process->handle (-> gp-0 proc))) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-1 pos quad) (-> self end-pos quad)) + (quaternion-identity! (-> gp-1 quat)) + (set! (-> gp-1 flags) (task-arrow-flags task-arrow-flag-00)) + (set! (-> gp-1 map-icon) (the-as uint 12)) + (label cfg-10) + (let ((a0-20 (task-arrow-spawn gp-1 (the-as task-arrow self)))) + (when (not a0-20) (suspend) + (goto cfg-10) ) + (set! (-> self arrow) (process->handle a0-20)) ) - (set! (-> self sound-id 0) - (the-as sound-id (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))) - ) - (while (let ((v1-15 (handle->process (-> *target* pilot vehicle)))) - (not (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-15) flags))) - ) - (suspend) - ) - (wait-for-speech-end (-> self sound-id 0)) - (set! (-> self sound-id 0) - (the-as sound-id (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 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-4) (seconds 3)) - (suspend) - ) - ) - (go-virtual complete) - (none) ) + (set! (-> self start-time) 0) + (set! (-> self time-limit) (seconds 180)) + (none) ) ) (set-subtask-hook! *game-info* - 61 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -245760.0 :y 45056.0 :z 5468160.0 :w 1.0) quad)) - (set! (-> self end-pos quad) (-> (new 'static 'vector :x 579584.0 :y 49152.0 :z -1985331.2 :w 1.0) quad)) - (set-setting! 'minimap 'clear 0 32) - (let ((s5-0 *traffic-manager*) - (gp-0 (new 'stack 'traffic-object-spawn-params)) - ) - (set! (-> gp-0 position quad) (-> self begin-pos quad)) - (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 16384.0) - (set! (-> gp-0 object-type) (traffic-type bikec)) - (set! (-> gp-0 behavior) (the-as uint 0)) - (set! (-> gp-0 id) (the-as uint 0)) - (set! (-> gp-0 proc) #f) - (send-event s5-0 'spawn-object gp-0) - (if (-> gp-0 proc) - (set! (-> self slave 0) (process->handle (-> gp-0 proc))) - ) - ) - (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-1 pos quad) (-> self end-pos quad)) - (quaternion-identity! (-> gp-1 quat)) - (set! (-> gp-1 flags) (task-arrow-flags task-arrow-flag-00)) - (set! (-> gp-1 map-icon) (the-as uint 12)) - (label cfg-10) - (let ((a0-20 (task-arrow-spawn gp-1 (the-as task-arrow self)))) - (when (not a0-20) - (suspend) - (goto cfg-10) - ) - (set! (-> self arrow) (process->handle a0-20)) + (game-task-node city-keira-delivery-delivery) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-keira-delivery-delivery) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (check-time self) + (let ((f0-0 (vector-vector-distance-squared (target-pos 0) (-> self end-pos))) + (f1-0 49152.0) + ) + (if (>= (* f1-0 f1-0) f0-0) + (go-virtual complete) ) - ) - (set! (-> self start-time) 0) - (set! (-> self time-limit) (seconds 180)) - (none) ) + (none) ) ) (set-subtask-hook! *game-info* - 61 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) - ) - -(set-subtask-hook! - *game-info* - 61 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (check-time self) - (let ((f0-0 (vector-vector-distance-squared (target-pos 0) (-> self end-pos))) - (f1-0 49152.0) - ) - (if (>= (* f1-0 f1-0) f0-0) - (go-virtual complete) - ) - ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 61 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (local-vars (v1-7 symbol)) - (send-event *traffic-manager* 'set-target-level #x3f800000) - (until (or v1-7 (and *target* (focus-test? *target* pilot))) - (suspend) - (let ((f0-0 122880.0)) - (set! v1-7 (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0)))) - ) + (game-task-node city-keira-delivery-delivery) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (local-vars (v1-7 symbol)) + (send-event *traffic-manager* 'set-target-level #x3f800000) + (until (or v1-7 (and *target* (focus-test? *target* pilot))) + (suspend) + (let ((f0-0 122880.0)) + (set! v1-7 (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0)))) ) - (set-setting! 'airlock #f 0 0) - (set! (-> self start-time) (-> self clock frame-counter)) - (none) ) + (set-setting! 'airlock #f 0.0 0) + (set! (-> self start-time) (-> self clock frame-counter)) + (none) ) ) (set-subtask-hook! *game-info* - 61 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *traffic-manager* 'decrease-alert-level 0) - (send-event *traffic-manager* 'set-alert-duration 9000) - (send-event *target* 'end-mode) - (set-setting! 'pilot #f 0 0) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (script-eval '(send-event "keira-npc-1" 'say)) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 136 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 39) (the-as int #f) (the-as vector #f) 0)) - (set! (-> self sub-state) (the-as uint 0)) - 0 - (none) + (game-task-node city-keira-delivery-delivery) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'decrease-alert-level 0) + (send-event *traffic-manager* 'set-alert-duration 9000) + (send-event *target* 'end-mode) + (set-setting! 'pilot #f 0.0 0) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) ) + (script-eval '(send-event "keira-npc-1" 'say)) + (none) ) ) (set-subtask-hook! *game-info* - 136 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + (game-task-node stadium-race-class3-race) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 39) (the-as int #f) (the-as vector #f) 0)) + (set! (-> self sub-state) (the-as uint 0)) + 0 + (none) ) ) (set-subtask-hook! *game-info* - 136 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (let* ((v1-1 (-> self info index)) - (a1-2 (cond - ((or (zero? v1-1) (= v1-1 4) (= v1-1 9)) - 'stadiumb - ) - ((or (= v1-1 1) (= v1-1 5) (= v1-1 10)) - 'stadiumc - ) - ((or (= v1-1 2) (= v1-1 6) (= v1-1 11)) - 'stadiumd - ) - (else - #f - ) + (game-task-node stadium-race-class3-race) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node stadium-race-class3-race) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (let* ((v1-1 (-> self info index)) + (a1-2 (cond + ((or (zero? v1-1) (= v1-1 4) (= v1-1 9)) + 'stadiumb + ) + ((or (= v1-1 1) (= v1-1 5) (= v1-1 10)) + 'stadiumc + ) + ((or (= v1-1 2) (= v1-1 6) (= v1-1 11)) + 'stadiumd + ) + (else + #f ) ) - ) - (cond - ((= (level-status *level* a1-2) 'active) - (when (zero? (-> self sub-state)) - (set! (-> self sub-state) (the-as uint 1)) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set! (-> self slave 0) (process->handle (race-start (-> self info index) (the-as symbol self) #f))) - ) + ) ) - (else - (when (nonzero? (-> self sub-state)) - (remove-setting! 'exclusive-task) - (set! (-> self sub-state) (the-as uint 0)) - 0 - ) + (cond + ((= (level-status *level* a1-2) 'active) + (when (zero? (-> self sub-state)) + (set! (-> self sub-state) (the-as uint 1)) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self slave 0) (process->handle (race-start (-> self info index) (the-as symbol self) #f))) + ) + ) + (else + (when (nonzero? (-> self sub-state)) + (remove-setting! 'exclusive-task) + (set! (-> self sub-state) (the-as uint 0)) + 0 ) ) ) - (none) ) + (none) ) ) (set-subtask-hook! *game-info* - 136 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (case (-> self info index) - ((2) - (format #t "kill race manager~%") - (send-event (handle->process (-> self slave 0)) 'die) - ) - ) - (none) - ) - ) + (game-task-node stadium-race-class3-race) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (case (-> self info index) + ((2) + (format #t "kill race manager~%") + (send-event (handle->process (-> self slave 0)) 'die) + ) + ) + (none) + ) ) -(copy-hooks! (-> *game-info* sub-task-list 182) (-> *game-info* sub-task-list 136)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-race-class2-race)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class3-race)) + ) -(copy-hooks! (-> *game-info* sub-task-list 210) (-> *game-info* sub-task-list 136)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-race-class1-race)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class3-race)) + ) -(copy-hooks! (-> *game-info* sub-task-list 313) (-> *game-info* sub-task-list 136)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class3-resolution)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class3-race)) + ) -(copy-hooks! (-> *game-info* sub-task-list 315) (-> *game-info* sub-task-list 182)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class2-resolution)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class2-race)) + ) -(copy-hooks! (-> *game-info* sub-task-list 317) (-> *game-info* sub-task-list 210)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class1-resolution)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class1-race)) + ) -(copy-hooks! (-> *game-info* sub-task-list 319) (-> *game-info* sub-task-list 136)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class3-r-resolution)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class3-race)) + ) -(copy-hooks! (-> *game-info* sub-task-list 321) (-> *game-info* sub-task-list 182)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class2-r-resolution)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class2-race)) + ) -(copy-hooks! (-> *game-info* sub-task-list 323) (-> *game-info* sub-task-list 210)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class1-r-resolution)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class1-race)) + ) (set-subtask-hook! *game-info* - 211 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (let ((gp-0 *traffic-manager*)) - (send-event gp-0 'set-guard-target-count-range 0 0 0) - (send-event gp-0 'set-guard-target-count-range 1 0 0) - (send-event gp-0 'set-guard-target-count-range 2 0 0) - (format #t "class-1 race complete~%") - (send-event gp-0 'set-alert-level 3) - ) - (while (!= (level-status *level* 'lwidea) 'active) - (suspend) - ) - (send-event *traffic-manager* 'spawn-all) + (game-task-node stadium-race-class1-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-guard-target-count-range 0 0 0) + (send-event gp-0 'set-guard-target-count-range 1 0 0) + (send-event gp-0 'set-guard-target-count-range 2 0 0) + (format #t "class-1 race complete~%") + (send-event gp-0 'set-alert-level 3) + ) + (while (!= (level-status *level* 'lwidea) 'active) (suspend) - (suspend) - (let ((gp-2 (new 'static 'city-ambush-info - :count 5 - :array (new 'static 'inline-array city-ambush-spot 5 - (new 'static 'city-ambush-spot - :pos (new 'static 'vector :x 503808.0 :y 49152.0 :z -2805760.0 :w 1.0) - :obj-type #x6 - ) - (new 'static 'city-ambush-spot - :pos (new 'static 'vector :x 458752.0 :y 49152.0 :z -2838528.0 :w 1.0) - :obj-type #x6 - ) - (new 'static 'city-ambush-spot - :pos (new 'static 'vector :x 450560.0 :y 49152.0 :z -2871296.0 :w 1.0) - :obj-type #x6 - ) - (new 'static 'city-ambush-spot - :pos (new 'static 'vector :x 413696.0 :y 49152.0 :z -2879488.0 :w 1.0) - :obj-type #x6 - ) - (new 'static 'city-ambush-spot - :pos (new 'static 'vector :x 368640.0 :y 49152.0 :z -2916352.0 :w 1.0) - :obj-type #x6 - ) + ) + (send-event *traffic-manager* 'spawn-all) + (suspend) + (suspend) + (let ((gp-2 (new 'static 'city-ambush-info + :count 5 + :array (new 'static 'inline-array city-ambush-spot 5 + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 503808.0 :y 49152.0 :z -2805760.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 458752.0 :y 49152.0 :z -2838528.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 450560.0 :y 49152.0 :z -2871296.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 413696.0 :y 49152.0 :z -2879488.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 368640.0 :y 49152.0 :z -2916352.0 :w 1.0) + :obj-type #x6 ) ) ) - (s5-0 (new 'stack-no-clear 'traffic-object-spawn-params)) - ) - (set! (-> s5-0 object-type) (traffic-type crimson-guard-1)) - (set! (-> s5-0 behavior) (the-as uint 9)) - (set! (-> s5-0 id) (the-as uint 0)) - (set! (-> s5-0 nav-mesh) #f) - (set! (-> s5-0 nav-branch) #f) - (set! (-> s5-0 proc) #f) - (set! (-> s5-0 handle) (process->handle *target*)) - (set! (-> s5-0 user-data) (the-as uint 0)) - (set! (-> s5-0 flags) (traffic-spawn-flags)) - (set! (-> s5-0 guard-type) (the-as uint 1)) - (vector-reset! (-> s5-0 velocity)) - (quaternion-identity! (-> s5-0 rotation)) - (city-ambush-info-method-9 gp-2 s5-0) - ) - (go-virtual complete) - (none) + ) + (s5-0 (new 'stack-no-clear 'traffic-object-spawn-params)) + ) + (set! (-> s5-0 object-type) (traffic-type crimson-guard-1)) + (set! (-> s5-0 behavior) (the-as uint 9)) + (set! (-> s5-0 id) (the-as uint 0)) + (set! (-> s5-0 nav-mesh) #f) + (set! (-> s5-0 nav-branch) #f) + (set! (-> s5-0 proc) #f) + (set! (-> s5-0 handle) (process->handle *target*)) + (set! (-> s5-0 user-data) (the-as uint 0)) + (set! (-> s5-0 flags) (traffic-spawn-flags)) + (set! (-> s5-0 guard-type) (the-as uint 1)) + (vector-reset! (-> s5-0 velocity)) + (quaternion-identity! (-> s5-0 rotation)) + (city-ambush-info-method-9 gp-2 s5-0) ) + (go-virtual complete) + (none) ) ) @@ -741,116 +718,109 @@ (set-subtask-hook! *game-info* - 271 - 0 - (the-as (function object) (lambda :behavior task-manager - () - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set-setting! 'airlock #f 0 0) - (set-setting! 'minimap 'clear 0 32) - (let ((gp-0 (-> *city-bb-racepoint-info* (-> self info index)))) - (set! (-> self end-pos quad) (-> gp-0 end-pos quad)) - (let ((s4-0 *traffic-manager*) - (s5-0 (new 'stack 'traffic-object-spawn-params)) - ) - (set! (-> s5-0 position quad) (-> gp-0 bike-pos quad)) - (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 (-> gp-0 bike-angle)) - (set! (-> s5-0 object-type) (traffic-type bikea)) - (set! (-> s5-0 behavior) (the-as uint 0)) - (set! (-> s5-0 id) (the-as uint 0)) - (set! (-> s5-0 proc) #f) - (send-event s4-0 'spawn-object s5-0) - (if (-> s5-0 proc) - (set! (-> self slave 0) (process->handle (-> s5-0 proc))) - ) - ) - (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-1 pos quad) (-> self end-pos quad)) - (quaternion-identity! (-> s5-1 quat)) - (set! (-> s5-1 flags) (task-arrow-flags task-arrow-flag-00)) - (set! (-> s5-1 map-icon) (the-as uint 15)) - (cond - ((-> gp-0 map) - (set! (-> s5-1 map-icon) (the-as uint 15)) - ) - (else - (set! (-> s5-1 map-icon) (the-as uint 0)) - 0 - ) - ) - (label cfg-12) - (let ((a0-20 (task-arrow-spawn s5-1 (the-as task-arrow self)))) - (when (not a0-20) - (suspend) - (goto cfg-12) - ) - (set! (-> self arrow) (process->handle a0-20)) - ) - ) - (set! (-> self start-time) (-> self clock frame-counter)) - (set! (-> self time-limit) (the-as time-frame (the int (-> gp-0 time)))) - ) - (none) - ) + (game-task-node city-burning-bush-racepoint-1-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (let ((gp-0 (-> *city-bb-racepoint-info* (-> self info index)))) + (set! (-> self end-pos quad) (-> gp-0 end-pos quad)) + (let ((s4-0 *traffic-manager*) + (s5-0 (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> s5-0 position quad) (-> gp-0 bike-pos quad)) + (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 (-> gp-0 bike-angle)) + (set! (-> s5-0 object-type) (traffic-type bikea)) + (set! (-> s5-0 behavior) (the-as uint 0)) + (set! (-> s5-0 id) (the-as uint 0)) + (set! (-> s5-0 proc) #f) + (send-event s4-0 'spawn-object s5-0) + (if (-> s5-0 proc) + (set! (-> self slave 0) (process->handle (-> s5-0 proc))) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s5-1 pos quad) (-> self end-pos quad)) + (quaternion-identity! (-> s5-1 quat)) + (set! (-> s5-1 flags) (task-arrow-flags task-arrow-flag-00)) + (set! (-> s5-1 map-icon) (the-as uint 15)) + (cond + ((-> gp-0 map) + (set! (-> s5-1 map-icon) (the-as uint 15)) + ) + (else + (set! (-> s5-1 map-icon) (the-as uint 0)) + 0 + ) ) - ) - -(set-subtask-hook! - *game-info* - 271 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + (label cfg-12) + (let ((a0-20 (task-arrow-spawn s5-1 (the-as task-arrow self)))) + (when (not a0-20) + (suspend) + (goto cfg-12) + ) + (set! (-> self arrow) (process->handle a0-20)) + ) + ) + (set! (-> self start-time) (-> self clock frame-counter)) + (set! (-> self time-limit) (the-as time-frame (the int (-> gp-0 time)))) + ) + (none) ) ) (set-subtask-hook! *game-info* - 271 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (check-time self) - (let ((f0-0 (vector-vector-distance-squared (target-pos 0) (-> self end-pos))) - (f1-0 49152.0) - ) - (if (>= (* f1-0 f1-0) f0-0) - (go-virtual complete) - ) - ) - (none) - ) - ) + (game-task-node city-burning-bush-racepoint-1-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) ) (set-subtask-hook! *game-info* - 271 - 3 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *traffic-manager* 'restore-default-settings) - (send-event *traffic-manager* 'set-target-level #x3f800000) - (none) - ) + (game-task-node city-burning-bush-racepoint-1-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (check-time self) + (let ((f0-0 (vector-vector-distance-squared (target-pos 0) (-> self end-pos))) + (f1-0 49152.0) ) + (if (>= (* f1-0 f1-0) f0-0) + (go-virtual complete) + ) + ) + (none) + ) ) (set-subtask-hook! *game-info* - 271 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *target* 'end-mode) - (set-setting! 'pilot #f 0 0) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (close! (-> self node-info) 'event) - (none) - ) - ) + (game-task-node city-burning-bush-racepoint-1-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'restore-default-settings) + (send-event *traffic-manager* 'set-target-level #x3f800000) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-racepoint-1-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (send-event *target* 'end-mode) + (set-setting! 'pilot #f 0.0 0) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (close! (-> self node-info) 'event) + (none) + ) ) diff --git a/goal_src/jak2/levels/city/common/pilot-states.gc b/goal_src/jak2/levels/city/common/pilot-states.gc index fca457fe57..277a0f6f51 100644 --- a/goal_src/jak2/levels/city/common/pilot-states.gc +++ b/goal_src/jak2/levels/city/common/pilot-states.gc @@ -882,21 +882,21 @@ (target-timed-invulnerable-off self 0) (case arg0 (('bot) - (set-setting! 'process-mask 'set 0 (process-mask platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask platform projectile death)) ) (('endlessfall 'instant-death 'lava 'dark-eco-pool 'melt 'explode 'grenade) - (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) ) (else - (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) (when (using-gun? self) (send-event (ppointer->process (-> self gun gun)) 'die) (target-gun-end-mode #f) ) ) ) - (set-setting! 'mode-name 'cam-fixed 0 0) - (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) (apply-settings *setting-control*) (set! (-> self control transv quad) (the-as uint128 0)) (logior! (-> self focus-status) (focus-status dead)) diff --git a/goal_src/jak2/levels/city/common/traffic-engine.gc b/goal_src/jak2/levels/city/common/traffic-engine.gc index b201f76bd5..4b26b13a45 100644 --- a/goal_src/jak2/levels/city/common/traffic-engine.gc +++ b/goal_src/jak2/levels/city/common/traffic-engine.gc @@ -2831,7 +2831,7 @@ Process is recycled and moved to reserved, if it deactivates." (logior! (-> obj alert-state flags) (traffic-alert-flag alarm-on)) (set! (-> *game-info* wanted-flash) (the-as basic #t)) (if (= (-> *setting-control* user-current music) 'city1) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) ) ) (let ((s5-1 (new 'stack-no-clear 'vector))) @@ -3422,8 +3422,8 @@ Process is recycled and moved to reserved, if it deactivates." ) (let ((s5-0 (math-camera-pos)) (f30-0 (meters 20)) - (f28-0 (meters 2000)) - (f26-0 (meters 1200)) + (f28-0 (meters 200)) + (f26-0 (meters 120)) ) (dotimes (s4-0 (the-as int (-> obj city-info cell-count))) (let ((s3-0 (-> obj city-info cell-array s4-0))) diff --git a/goal_src/jak2/levels/city/common/traffic-manager.gc b/goal_src/jak2/levels/city/common/traffic-manager.gc index 7b629791fb..99cc21bb58 100644 --- a/goal_src/jak2/levels/city/common/traffic-manager.gc +++ b/goal_src/jak2/levels/city/common/traffic-manager.gc @@ -741,7 +741,7 @@ (stack-size-set! (-> self main-thread) 128) (ctywide-entity-hack) (init-params self) - (add-setting! 'task-mask 'clear 0 #x4000) + (add-setting! 'task-mask 'clear 0.0 (task-mask ctywide)) (set! (-> self event-hook) traffic-manager-event-handler) (rigid-body-queue-manager-spawn *traffic-rigid-body-queue* self) (go-virtual idle) diff --git a/goal_src/jak2/levels/city/common/vehicle-states.gc b/goal_src/jak2/levels/city/common/vehicle-states.gc index 4485ccde6f..308c5165db 100644 --- a/goal_src/jak2/levels/city/common/vehicle-states.gc +++ b/goal_src/jak2/levels/city/common/vehicle-states.gc @@ -140,7 +140,7 @@ :virtual #t :event (the-as (function process int symbol event-message-block object :behavior vehicle) vehicle-event-handler) :enter (behavior () - (set-setting! 'sound-flava #f #x41f80000 5) + (set-setting! 'sound-flava #f 31.0 5) (set! (-> self state-time) (-> self clock frame-counter)) (iterate-prims (-> self root-override-2) diff --git a/goal_src/jak2/levels/city/common/vehicle-util.gc b/goal_src/jak2/levels/city/common/vehicle-util.gc index 82e1fbae3c..9e83758b22 100644 --- a/goal_src/jak2/levels/city/common/vehicle-util.gc +++ b/goal_src/jak2/levels/city/common/vehicle-util.gc @@ -335,17 +335,9 @@ This commonly includes things such as: (can-display-query? obj (the-as string #f) (/ 1.0 (-> s5-0 floats 3))) ) ) - (let ((s3-1 (new - 'stack - 'font-context - *font-default-matrix* - 32 - 320 - 0.0 - (font-color default) - (font-flags shadow kerning) - ) - ) + (let ((s3-1 + (new 'stack 'font-context *font-default-matrix* 32 320 0.0 (font-color default) (font-flags shadow kerning)) + ) ) (let ((v1-97 s3-1)) (set! (-> v1-97 width) (the float 340)) @@ -913,7 +905,7 @@ This commonly includes things such as: (set-setting! 'string-max-height 'abs (-> obj info-override camera-string-max-height) 0) (set-setting! 'head-offset 'abs (-> obj info-override camera-head-offset) 0) (set-setting! 'foot-offset 'abs (-> obj info-override camera-foot-offset) 0) - (set-setting! 'target-height 'abs 0 0) + (set-setting! 'target-height 'abs (meters 0) 0) (vehicle-method-92 obj) (vehicle-method-89 obj) (persist-with-delay *setting-control* 'mode-name (seconds 0.2) 'mode-name 'cam-fixed 0.0 0) @@ -972,7 +964,7 @@ This commonly includes things such as: (defmethod vehicle-method-89 vehicle ((obj vehicle)) (when (not (logtest? (rigid-body-object-flag camera-bike-mode) (-> obj flags))) (set! (-> obj flags) (logior (rigid-body-object-flag camera-bike-mode) (-> obj flags))) - (set-setting! 'bike-mode #f 0 0) + (set-setting! 'bike-mode #f 0.0 0) ) 0 (none) @@ -990,7 +982,7 @@ This commonly includes things such as: (defmethod vehicle-method-91 vehicle ((obj vehicle)) (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) (set! (-> obj flags) (logior (rigid-body-object-flag camera-rapid-track-mode) (-> obj flags))) - (set-setting! 'rapid-tracking #f 0 0) + (set-setting! 'rapid-tracking #f 0.0 0) ) 0 (none) diff --git a/goal_src/jak2/levels/city/common/vehicle.gc b/goal_src/jak2/levels/city/common/vehicle.gc index 93303bb982..22f50c1da9 100644 --- a/goal_src/jak2/levels/city/common/vehicle.gc +++ b/goal_src/jak2/levels/city/common/vehicle.gc @@ -612,7 +612,7 @@ (when (or (< 55296.0 (-> obj rbody state lin-velocity y)) (>= (- (-> pp clock frame-counter) (-> obj air-time)) (seconds 0.75)) ) - (set-setting! 'extra-follow-height 'abs -964689920 0) + (set-setting! 'extra-follow-height 'abs (meters -4) 0) (send-event *camera* 'set-max-angle-offset (-> obj info-override camera-air-max-angle-offset)) ) ) @@ -711,7 +711,7 @@ ) (cond ((and (< f0-26 0.15) (< -0.5 f0-26)) - (set-setting! 'vertical-follow-matches-camera #f 0 0) + (set-setting! 'vertical-follow-matches-camera #f 0.0 0) ) (else (if (< (fabs (-> obj root-override-2 transv y)) 8192.0) diff --git a/goal_src/jak2/levels/city/kid_escort/hal4-course.gc b/goal_src/jak2/levels/city/kid_escort/hal4-course.gc index dc3e9c77d5..ca1224a39e 100644 --- a/goal_src/jak2/levels/city/kid_escort/hal4-course.gc +++ b/goal_src/jak2/levels/city/kid_escort/hal4-course.gc @@ -371,7 +371,7 @@ (>= (- (-> pp clock frame-counter) (-> obj locked-player-time)) (seconds 10)) ) (remove-setting! 'pilot-exit) - (set-setting! 'pilot #f 0 0) + (set-setting! 'pilot #f 0.0 0) (apply-settings *setting-control*) ) ) @@ -383,7 +383,7 @@ ) ) ) - (set-setting! 'pilot-exit #f 0 0) + (set-setting! 'pilot-exit #f 0.0 0) (apply-settings *setting-control*) (set! (-> obj locked-player-time) (-> pp clock frame-counter)) ) @@ -697,8 +697,8 @@ :skip-to -1 :on-set (lambda ((arg0 hal-escort)) (process-entity-status! arg0 (entity-perm-status no-kill) #t) - (set-setting! 'exclusive-task #f 0 34) - (set-setting! 'allow-continue #f 0 0) + (set-setting! 'exclusive-task #f 0.0 (game-task city-escort-kid)) + (set-setting! 'allow-continue #f 0.0 0) (clear-speech-flags! arg0) (speech-control-method-10 *speech-control* @@ -763,8 +763,8 @@ (logior! (-> v1-12 extra perm status) (entity-perm-status bit-9)) ) ) - (set-setting! 'airlock #f 0 0) - (set-setting! 'minimap 'clear 0 32) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) (let ((s5-0 (new 'stack-no-clear 'task-arrow-params))) (set! (-> s5-0 pos quad) (-> arg0 hal4-course spots 1 center quad)) (quaternion-identity! (-> s5-0 quat)) @@ -874,7 +874,7 @@ :nav-mesh-index -1 :skip-to #xf :on-set (lambda ((arg0 hal-escort)) - (set-setting! 'sound-mode #f 0 2) + (set-setting! 'sound-mode #f 0.0 2) (let ((s5-0 (-> arg0 hal4-course spots))) (vector-! (the-as vector (-> arg0 notice-plane)) (the-as vector (-> s5-0 4)) (the-as vector (-> s5-0 3))) (vector-normalize! (-> arg0 notice-plane) 1.0) @@ -949,7 +949,7 @@ :skip-to #xf :on-set (lambda ((arg0 hal-escort)) (init-traffic-params! arg0 #t) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) (let ((v1-5 (get-task-by-type (-> arg0 ai-ctrl) halt-wait-spot arg0))) (set! (-> v1-5 bytes 5) 1) (set! (-> v1-5 bytes 6) 0) @@ -1652,7 +1652,7 @@ (apply-settings *setting-control*) (send-event (handle->process (-> arg0 arrow-handle)) 'die) (play-speech arg0 11) - (set-setting! 'entity-name "camera-224" 0 0) + (set-setting! 'entity-name "camera-224" 0.0 0) (let ((s5-0 *traffic-manager*)) (send-event s5-0 'set-guard-target-level 0) (send-event s5-0 'set-max-alert-level 0) @@ -1845,7 +1845,7 @@ (set! (-> a1-1 num-params) 0) (set! (-> a1-1 message) 'fail) (let ((t9-0 send-event-function) - (v1-8 (-> *game-info* sub-task-list 111)) + (v1-8 (-> *game-info* sub-task-list (game-task-node city-escort-kid-resolution))) ) (t9-0 (handle->process (if (-> v1-8 info) diff --git a/goal_src/jak2/levels/city/market/east/ashelin/ash4-course.gc b/goal_src/jak2/levels/city/market/east/ashelin/ash4-course.gc index 71d1cd671f..0c44e6797c 100644 --- a/goal_src/jak2/levels/city/market/east/ashelin/ash4-course.gc +++ b/goal_src/jak2/levels/city/market/east/ashelin/ash4-course.gc @@ -191,8 +191,8 @@ :nav-mesh-index -1 :skip-to -1 :on-set (lambda ((arg0 ashelin-tanker)) - (set-setting! 'calm #t 0 0) - (set-setting! 'exclusive-task #f 0 42) + (set-setting! 'calm #t 0.0 0) + (set-setting! 'exclusive-task #f 0.0 (game-task city-intercept-tanker)) (let ((v1-5 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) (set! (-> v1-5 bytes 5) 1) (set! (-> v1-5 bytes 6) 0) @@ -254,7 +254,7 @@ (with-pp (send-event arg0 'hide #f) (remove-setting! 'calm) - (set-setting! 'music 'danger9 0 0) + (set-setting! 'music 'danger9 0.0 0) (set! (-> arg0 notice-enemy-dist) 245760.0) (logior! (-> arg0 bot-flags) (bot-flags bf06)) (set! (-> arg0 bot-task-bits) (logand -3 (-> arg0 bot-task-bits))) diff --git a/goal_src/jak2/levels/city/market/west/brutter_kiosk/meet-brutter.gc b/goal_src/jak2/levels/city/market/west/brutter_kiosk/meet-brutter.gc index 9179a30fef..71b6972fa0 100644 --- a/goal_src/jak2/levels/city/market/west/brutter_kiosk/meet-brutter.gc +++ b/goal_src/jak2/levels/city/market/west/brutter_kiosk/meet-brutter.gc @@ -2235,387 +2235,375 @@ (set-subtask-hook! *game-info* - 124 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'allow-continue #f 0 0) - (set-continue! *game-info* "ctyport-hiphog-no-hiphog" #f) - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (let ((s5-0 *traffic-manager*) - (gp-0 (new 'stack 'traffic-object-spawn-params)) - ) - (set! (-> gp-0 position quad) (-> self begin-pos quad)) - (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 0.0) - (set! (-> gp-0 object-type) (traffic-type cara)) - (set! (-> gp-0 behavior) (the-as uint 0)) - (set! (-> gp-0 id) (the-as uint 0)) - (set! (-> gp-0 proc) #f) - (send-event s5-0 'spawn-object gp-0) - (if (not (-> gp-0 proc)) - (format #t "traffic object spawn failed~%") - ) - ) - (set! (-> self start-time) 0) - (set! (-> self sub-state) (the-as uint 0)) - (set! (-> self max-count) 3) - (set! (-> self count) 3) - (dotimes (v1-20 4) - (set! (-> self data-vector v1-20 quad) (-> *meet-brutter-position* v1-20 quad)) - ) - (let ((gp-1 (new 'stack-no-clear 'mystery-traffic-object-spawn-params-1))) - (vector-reset! (-> gp-1 vec)) - (forward-up-nopitch->quaternion - (-> gp-1 quat) - (new 'static 'vector :z 1.0 :w 1.0) - (new 'static 'vector :y 1.0 :w 1.0) + (game-task-node city-meet-brutter-meet-brutter) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'allow-continue #f 0.0 0) + (set-continue! *game-info* "ctyport-hiphog-no-hiphog" #f) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (let ((s5-0 *traffic-manager*) + (gp-0 (new 'stack 'traffic-object-spawn-params)) ) - (set! (-> gp-1 params 0 object-type) (traffic-type tt17)) - (set! (-> gp-1 params 0 behavior) (the-as uint 1)) - (set! (-> gp-1 params 0 id) (the-as uint 0)) - (set! (-> gp-1 params 0 nav-mesh) #f) - (set! (-> gp-1 params 0 nav-branch) #f) - (set! (-> gp-1 params 0 proc) #f) - (set! (-> gp-1 params 0 handle) (the-as handle #f)) - (set! (-> gp-1 params 0 user-data) (the-as uint 0)) - (set! (-> gp-1 params 0 flags) (traffic-spawn-flags trsflags-01)) - (set! (-> gp-1 params 0 guard-type) (the-as uint 7)) - (vector-reset! (-> gp-1 params 0 velocity)) - (set! (-> gp-1 params 0 position quad) (-> gp-1 vec quad)) - (quaternion-copy! (-> gp-1 params 0 rotation) (-> gp-1 quat)) - (set! (-> gp-1 params 1 object-type) (traffic-type tt5)) - (set! (-> gp-1 params 1 behavior) (the-as uint 0)) - (set! (-> gp-1 params 1 id) (the-as uint 0)) - (set! (-> gp-1 params 1 nav-mesh) #f) - (set! (-> gp-1 params 1 nav-branch) #f) - (set! (-> gp-1 params 1 proc) #f) - (set! (-> gp-1 params 1 handle) (the-as handle #f)) - (set! (-> gp-1 params 1 user-data) (the-as uint 0)) - (set! (-> gp-1 params 1 flags) (traffic-spawn-flags trsflags-00)) - (set! (-> gp-1 params 1 guard-type) (the-as uint 7)) - (vector-reset! (-> gp-1 params 1 velocity)) - (set! (-> gp-1 params 1 position quad) (-> gp-1 vec quad)) - (quaternion-copy! (-> gp-1 params 1 rotation) (-> gp-1 quat)) - (countdown (s5-1 (-> self max-count)) - (let ((s2-0 (-> *city-meet-brutter-vehicle-info* s5-1))) - (set! (-> gp-1 params 0 id) (the-as uint (+ s5-1 120))) - (set! (-> gp-1 params 0 position quad) (-> s2-0 pos quad)) - (set! (-> gp-1 params 1 position quad) (-> s2-0 pos quad)) - (let ((s4-0 (the-as - paddywagon - (vehicle-spawn *traffic-manager* paddywagon (the-as traffic-object-spawn-params (-> gp-1 params))) - ) - ) - ) - (when s4-0 - (set! (-> s4-0 current-level) (-> s2-0 level)) - (set! (-> self slave (+ s5-1 (-> self max-count))) (process->handle s4-0)) - (send-event *traffic-manager* 'add-object (-> gp-1 params 0 object-type) s4-0) - (let ((s3-0 (the-as city-lurker (citizen-spawn self city-lurker (-> gp-1 params 1))))) - (when s3-0 - (set! (-> s3-0 end-pos quad) (-> s2-0 end-pos quad)) - (set! (-> s3-0 task-node) (game-task-node city-meet-brutter-meet-brutter)) - (set! (-> s3-0 index) (the-as uint s5-1)) - (set! (-> s3-0 nav-mesh-aid) (the-as uint 0)) - (set! (-> self slave s5-1) (process->handle s3-0)) - (set! (-> self data-int32 s5-1) -1) - (change-parent s3-0 s4-0) - (logior! (-> s3-0 flags) (citizen-flag persistent)) - (send-event *traffic-manager* 'add-object (-> gp-1 params 1 object-type) s3-0) - (set! (-> s3-0 controller traffic) *traffic-engine*) - (set! (-> s3-0 vehicle) (process->handle s4-0)) - (let ((s2-1 (get-best-seat-for-vehicle s4-0 (-> s4-0 root-override-2 trans) 4 0))) - (when (!= s2-1 -1) - (format #t "adding lurker to seat ~d~%" s2-1) - (put-rider-in-seat s4-0 s2-1 s3-0) - (logior! (-> s3-0 focus-status) (focus-status pilot-riding)) + (set! (-> gp-0 position quad) (-> self begin-pos quad)) + (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 0.0) + (set! (-> gp-0 object-type) (traffic-type cara)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 proc) #f) + (send-event s5-0 'spawn-object gp-0) + (if (not (-> gp-0 proc)) + (format #t "traffic object spawn failed~%") + ) + ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self max-count) 3) + (set! (-> self count) 3) + (dotimes (v1-20 4) + (set! (-> self data-vector v1-20 quad) (-> *meet-brutter-position* v1-20 quad)) + ) + (let ((gp-1 (new 'stack-no-clear 'mystery-traffic-object-spawn-params-1))) + (vector-reset! (-> gp-1 vec)) + (forward-up-nopitch->quaternion + (-> gp-1 quat) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) + (set! (-> gp-1 params 0 object-type) (traffic-type tt17)) + (set! (-> gp-1 params 0 behavior) (the-as uint 1)) + (set! (-> gp-1 params 0 id) (the-as uint 0)) + (set! (-> gp-1 params 0 nav-mesh) #f) + (set! (-> gp-1 params 0 nav-branch) #f) + (set! (-> gp-1 params 0 proc) #f) + (set! (-> gp-1 params 0 handle) (the-as handle #f)) + (set! (-> gp-1 params 0 user-data) (the-as uint 0)) + (set! (-> gp-1 params 0 flags) (traffic-spawn-flags trsflags-01)) + (set! (-> gp-1 params 0 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-1 params 0 velocity)) + (set! (-> gp-1 params 0 position quad) (-> gp-1 vec quad)) + (quaternion-copy! (-> gp-1 params 0 rotation) (-> gp-1 quat)) + (set! (-> gp-1 params 1 object-type) (traffic-type tt5)) + (set! (-> gp-1 params 1 behavior) (the-as uint 0)) + (set! (-> gp-1 params 1 id) (the-as uint 0)) + (set! (-> gp-1 params 1 nav-mesh) #f) + (set! (-> gp-1 params 1 nav-branch) #f) + (set! (-> gp-1 params 1 proc) #f) + (set! (-> gp-1 params 1 handle) (the-as handle #f)) + (set! (-> gp-1 params 1 user-data) (the-as uint 0)) + (set! (-> gp-1 params 1 flags) (traffic-spawn-flags trsflags-00)) + (set! (-> gp-1 params 1 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-1 params 1 velocity)) + (set! (-> gp-1 params 1 position quad) (-> gp-1 vec quad)) + (quaternion-copy! (-> gp-1 params 1 rotation) (-> gp-1 quat)) + (countdown (s5-1 (-> self max-count)) + (let ((s2-0 (-> *city-meet-brutter-vehicle-info* s5-1))) + (set! (-> gp-1 params 0 id) (the-as uint (+ s5-1 120))) + (set! (-> gp-1 params 0 position quad) (-> s2-0 pos quad)) + (set! (-> gp-1 params 1 position quad) (-> s2-0 pos quad)) + (let ((s4-0 (the-as + paddywagon + (vehicle-spawn *traffic-manager* paddywagon (the-as traffic-object-spawn-params (-> gp-1 params))) ) ) - ) - (if (not s3-0) - (format #t "brutter-task: unable to spawn rider~%") + ) + (when s4-0 + (set! (-> s4-0 current-level) (-> s2-0 level)) + (set! (-> self slave (+ s5-1 (-> self max-count))) (process->handle s4-0)) + (send-event *traffic-manager* 'add-object (-> gp-1 params 0 object-type) s4-0) + (let ((s3-0 (the-as city-lurker (citizen-spawn self city-lurker (-> gp-1 params 1))))) + (when s3-0 + (set! (-> s3-0 end-pos quad) (-> s2-0 end-pos quad)) + (set! (-> s3-0 task-node) (game-task-node city-meet-brutter-meet-brutter)) + (set! (-> s3-0 index) (the-as uint s5-1)) + (set! (-> s3-0 nav-mesh-aid) (the-as uint 0)) + (set! (-> self slave s5-1) (process->handle s3-0)) + (set! (-> self data-int32 s5-1) -1) + (change-parent s3-0 s4-0) + (logior! (-> s3-0 flags) (citizen-flag persistent)) + (send-event *traffic-manager* 'add-object (-> gp-1 params 1 object-type) s3-0) + (set! (-> s3-0 controller traffic) *traffic-engine*) + (set! (-> s3-0 vehicle) (process->handle s4-0)) + (let ((s2-1 (get-best-seat-for-vehicle s4-0 (-> s4-0 root-override-2 trans) 4 0))) + (when (!= s2-1 -1) + (format #t "adding lurker to seat ~d~%" s2-1) + (put-rider-in-seat s4-0 s2-1 s3-0) + (logior! (-> s3-0 focus-status) (focus-status pilot-riding)) ) - ) - ) - (if (not s4-0) - (format 0 "failed to spawn paddywagon~%") - ) - ) - ) - ) - (send-event *traffic-manager* 'set-object-target-count (-> gp-1 params 0 object-type) 0) - (send-event *traffic-manager* 'set-object-target-count (-> gp-1 params 1 object-type) 0) - ) - (set! (-> *game-info* counter) (the float (-> self count))) - (set! (-> self data-int32 16) 0) - (set! (-> self data-int32 17) 0) - (set! (-> self data-int32 17) (rand-vu-int-count 4)) - (set! (-> self data-int32 18) (rand-vu-int-count 4)) - (change-parent self *traffic-manager*) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 124 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) - ) - -(set-subtask-hook! - *game-info* - 124 - 6 - (the-as - (function object) - (lambda :behavior task-manager - ((arg0 city-lurker) (arg1 object) (arg2 symbol)) - (case arg2 - (('task-done) - (let ((v1-1 arg0)) - (set! (-> self data-int32 (-> v1-1 index)) 2) - ) - ) - (('on-ground) - (let ((gp-0 arg0)) - (cond - ((= (-> self data-int32 (-> gp-0 index)) -1) - (+! (-> self data-int32 (-> gp-0 index)) 1) - (set! (-> self beep-time) (+ (-> self clock frame-counter) (rand-vu-int-range (seconds 10) (seconds 20)))) - (let ((v1-14 (-> self data-int32 16))) - (cond - ((zero? v1-14) - (talker-spawn-func (-> *talker-speech* 379) *entity-pool* (target-pos 0) (the-as region #f)) - ) - ((= v1-14 1) - (talker-spawn-func (-> *talker-speech* 381) *entity-pool* (target-pos 0) (the-as region #f)) - ) - ((= v1-14 2) - (talker-spawn-func (-> *talker-speech* 383) *entity-pool* (target-pos 0) (the-as region #f)) - ) - ) - ) - (set! (-> self beep-time) (+ (-> self clock frame-counter) (rand-vu-int-range (seconds 10) (seconds 20)))) - (+! (-> self data-int32 16) 1) - ) - ((= (-> self data-int32 (-> gp-0 index)) 1) - ) - ) - (change-parent gp-0 self) - ) - ) - ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 124 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (local-vars (v1-163 float) (v1-205 float)) - (rlet ((acc :class vf) - (vf0 :class vf) - (vf1 :class vf) - (vf2 :class vf) - ) - (init-vf0-vector) - (check-time self) - (let ((v1-2 0) - (gp-0 0) - ) - (dotimes (a0-1 (-> self max-count)) - (let ((a1-3 (handle->process (-> self slave a0-1)))) - (when (-> (the-as city-lurker a1-3) task-done?) - (+! gp-0 1) - (set! (-> self data-int32 a0-1) 3) - ) - (if (and (focus-test? (the-as city-lurker a1-3) pilot) (!= (-> self data-int32 a0-1) -1)) - (+! v1-2 1) - ) - ) - ) - (cond - ((zero? v1-2) - (dotimes (s5-0 (-> self max-count)) - (when (and (handle->process (-> self slave s5-0)) (not (-> self minimap s5-0))) - (let ((a1-15 (-> self slave s5-0 process 0))) - (if (not (-> (the-as city-lurker a1-15) task-done?)) - (set! (-> self minimap s5-0) - (add-icon! *minimap* a1-15 (the-as uint 15) (the-as int #f) (the-as vector #t) 0) - ) - ) - ) - ) - ) - (when (-> self minimap 3) - (logior! (-> self minimap 3 flags) (minimap-flag fade-out)) - (set! (-> self minimap 3) #f) - ) - ) - (else - (dotimes (v1-30 (-> self max-count)) - (when (-> self minimap v1-30) - (when (-> self minimap v1-30) - (logior! (-> self minimap v1-30 flags) (minimap-flag fade-out)) - (set! (-> self minimap v1-30) #f) ) ) + (if (not s3-0) + (format #t "brutter-task: unable to spawn rider~%") + ) ) - (if (not (-> self minimap 3)) - (set! (-> self minimap 3) (add-icon! *minimap* self (the-as uint 19) (the-as int #f) (the-as vector #f) 0)) - ) ) + (if (not s4-0) + (format 0 "failed to spawn paddywagon~%") + ) ) - (set! (-> self count) (- (-> self max-count) gp-0)) - (set! (-> *game-info* counter) (the float (-> self count))) - (if (= gp-0 (-> self max-count)) - (go-virtual complete) - ) ) - (dotimes (gp-1 (-> self max-count)) - (let ((s5-1 (handle->process (-> self slave (+ gp-1 (-> self max-count)))))) - (when (and s5-1 (not (logtest? (-> (the-as city-lurker s5-1) focus-status) (focus-status dead)))) + ) + (send-event *traffic-manager* 'set-object-target-count (-> gp-1 params 0 object-type) 0) + (send-event *traffic-manager* 'set-object-target-count (-> gp-1 params 1 object-type) 0) + ) + (set! (-> *game-info* counter) (the float (-> self count))) + (set! (-> self data-int32 16) 0) + (set! (-> self data-int32 17) 0) + (set! (-> self data-int32 17) (rand-vu-int-count 4)) + (set! (-> self data-int32 18) (rand-vu-int-count 4)) + (change-parent self *traffic-manager*) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-meet-brutter-meet-brutter) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-meet-brutter-meet-brutter) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 city-lurker) (arg1 object) (arg2 symbol)) + (case arg2 + (('task-done) + (let ((v1-1 arg0)) + (set! (-> self data-int32 (-> v1-1 index)) 2) + ) + ) + (('on-ground) + (let ((gp-0 arg0)) + (cond + ((= (-> self data-int32 (-> gp-0 index)) -1) + (+! (-> self data-int32 (-> gp-0 index)) 1) + (set! (-> self beep-time) (+ (-> self clock frame-counter) (rand-vu-int-range (seconds 10) (seconds 20)))) + (let ((v1-14 (-> self data-int32 16))) (cond - ((or (not (-> (the-as paddywagon s5-1) current-level)) - (= (level-status *level* (-> (the-as paddywagon s5-1) current-level)) 'active) - ) - (when (focus-test? (the-as paddywagon s5-1) inactive) - (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s4-0 object-type) (traffic-type tt17)) - (set! (-> s4-0 behavior) (the-as uint 2)) - (set! (-> s4-0 id) (the-as uint 0)) - (set! (-> s4-0 nav-mesh) #f) - (set! (-> s4-0 nav-branch) #f) - (set! (-> s4-0 proc) #f) - (set! (-> s4-0 handle) (-> self slave (+ gp-1 (-> self max-count)))) - (set! (-> s4-0 user-data) (the-as uint 0)) - (set! (-> s4-0 flags) (traffic-spawn-flags trsflags-01)) - (set! (-> s4-0 guard-type) (the-as uint 7)) - (vector-reset! (-> s4-0 velocity)) - (set! (-> s4-0 position quad) (-> (the-as paddywagon s5-1) root-override-2 trans quad)) - (quaternion-copy! (-> s4-0 rotation) (-> (the-as paddywagon s5-1) root-override-2 quat)) - (activate-by-handle *traffic-engine* s4-0) - ) - (let ((s4-1 (handle->process (-> self slave gp-1)))) - (when s4-1 - (let ((s3-0 - (get-best-seat-for-vehicle (the-as paddywagon s5-1) (-> (the-as paddywagon s5-1) root-override-2 trans) 4 0) - ) - ) - (when (!= s3-0 -1) - (format #t "adding lurker to seat ~d~%" s3-0) - (put-rider-in-seat (the-as paddywagon s5-1) s3-0 (the-as city-lurker s4-1)) - (logior! (-> (the-as city-lurker s4-1) focus-status) (focus-status pilot-riding)) + ((zero? v1-14) + (talker-spawn-func (-> *talker-speech* 379) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-14 1) + (talker-spawn-func (-> *talker-speech* 381) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-14 2) + (talker-spawn-func (-> *talker-speech* 383) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! (-> self beep-time) (+ (-> self clock frame-counter) (rand-vu-int-range (seconds 10) (seconds 20)))) + (+! (-> self data-int32 16) 1) + ) + ((= (-> self data-int32 (-> gp-0 index)) 1) + ) + ) + (change-parent gp-0 self) + ) + ) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-meet-brutter-meet-brutter) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (local-vars (v1-163 float) (v1-205 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (check-time self) + (let ((v1-2 0) + (gp-0 0) + ) + (dotimes (a0-1 (-> self max-count)) + (let ((a1-3 (handle->process (-> self slave a0-1)))) + (when (-> (the-as city-lurker a1-3) task-done?) + (+! gp-0 1) + (set! (-> self data-int32 a0-1) 3) + ) + (if (and (focus-test? (the-as city-lurker a1-3) pilot) (!= (-> self data-int32 a0-1) -1)) + (+! v1-2 1) + ) + ) + ) + (cond + ((zero? v1-2) + (dotimes (s5-0 (-> self max-count)) + (when (and (handle->process (-> self slave s5-0)) (not (-> self minimap s5-0))) + (let ((a1-15 (-> self slave s5-0 process 0))) + (if (not (-> (the-as city-lurker a1-15) task-done?)) + (set! (-> self minimap s5-0) + (add-icon! *minimap* a1-15 (the-as uint 15) (the-as int #f) (the-as vector #t) 0) ) + ) + ) + ) + ) + (when (-> self minimap 3) + (logior! (-> self minimap 3 flags) (minimap-flag fade-out)) + (set! (-> self minimap 3) #f) + ) + ) + (else + (dotimes (v1-30 (-> self max-count)) + (when (-> self minimap v1-30) + (when (-> self minimap v1-30) + (logior! (-> self minimap v1-30 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-30) #f) + ) + ) + ) + (if (not (-> self minimap 3)) + (set! (-> self minimap 3) (add-icon! *minimap* self (the-as uint 19) (the-as int #f) (the-as vector #f) 0)) + ) + ) + ) + (set! (-> self count) (- (-> self max-count) gp-0)) + (set! (-> *game-info* counter) (the float (-> self count))) + (if (= gp-0 (-> self max-count)) + (go-virtual complete) + ) + ) + (dotimes (gp-1 (-> self max-count)) + (let ((s5-1 (handle->process (-> self slave (+ gp-1 (-> self max-count)))))) + (when (and s5-1 (not (logtest? (-> (the-as city-lurker s5-1) focus-status) (focus-status dead)))) + (cond + ((or (not (-> (the-as paddywagon s5-1) current-level)) + (= (level-status *level* (-> (the-as paddywagon s5-1) current-level)) 'active) + ) + (when (focus-test? (the-as paddywagon s5-1) inactive) + (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s4-0 object-type) (traffic-type tt17)) + (set! (-> s4-0 behavior) (the-as uint 2)) + (set! (-> s4-0 id) (the-as uint 0)) + (set! (-> s4-0 nav-mesh) #f) + (set! (-> s4-0 nav-branch) #f) + (set! (-> s4-0 proc) #f) + (set! (-> s4-0 handle) (-> self slave (+ gp-1 (-> self max-count)))) + (set! (-> s4-0 user-data) (the-as uint 0)) + (set! (-> s4-0 flags) (traffic-spawn-flags trsflags-01)) + (set! (-> s4-0 guard-type) (the-as uint 7)) + (vector-reset! (-> s4-0 velocity)) + (set! (-> s4-0 position quad) (-> (the-as paddywagon s5-1) root-override-2 trans quad)) + (quaternion-copy! (-> s4-0 rotation) (-> (the-as paddywagon s5-1) root-override-2 quat)) + (activate-by-handle *traffic-engine* s4-0) + ) + (let ((s4-1 (handle->process (-> self slave gp-1)))) + (when s4-1 + (let ((s3-0 + (get-best-seat-for-vehicle (the-as paddywagon s5-1) (-> (the-as paddywagon s5-1) root-override-2 trans) 4 0) + ) + ) + (when (!= s3-0 -1) + (format #t "adding lurker to seat ~d~%" s3-0) + (put-rider-in-seat (the-as paddywagon s5-1) s3-0 (the-as city-lurker s4-1)) + (logior! (-> (the-as city-lurker s4-1) focus-status) (focus-status pilot-riding)) ) ) ) ) ) - (else - (if (not (focus-test? (the-as paddywagon s5-1) inactive)) - (send-event (the-as paddywagon s5-1) 'traffic-off-force) - ) - ) + ) + (else + (if (not (focus-test? (the-as paddywagon s5-1) inactive)) + (send-event (the-as paddywagon s5-1) 'traffic-off-force) + ) ) ) ) ) - (let ((gp-2 #f)) - (dotimes (v1-100 (-> self max-count)) - (if (= (-> self data-int32 v1-100) 1) - (set! gp-2 #t) - ) - ) - (dotimes (s5-2 (-> self max-count)) - (let ((s4-2 (handle->process (-> self slave s5-2)))) - (cond - ((= (-> self data-int32 s5-2) -1) - (when s4-2 - (when (focus-test? (the-as city-lurker s4-2) inactive) - (let ((s3-1 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s3-1 object-type) (traffic-type tt5)) - (set! (-> s3-1 behavior) (the-as uint 6)) - (set! (-> s3-1 id) (the-as uint 0)) - (set! (-> s3-1 nav-mesh) #f) - (set! (-> s3-1 nav-branch) #f) - (set! (-> s3-1 proc) #f) - (set! (-> s3-1 handle) (-> self slave s5-2)) - (set! (-> s3-1 user-data) (the-as uint 0)) - (set! (-> s3-1 flags) (traffic-spawn-flags)) - (set! (-> s3-1 guard-type) (the-as uint 7)) - (vector-reset! (-> s3-1 velocity)) - (set! (-> s3-1 position quad) (-> (the-as city-lurker s4-2) root-override2 trans quad)) - (quaternion-copy! (-> s3-1 rotation) (-> (the-as city-lurker s4-2) root-override2 quat)) - (activate-by-handle *traffic-engine* s3-1) - ) + ) + (let ((gp-2 #f)) + (dotimes (v1-100 (-> self max-count)) + (if (= (-> self data-int32 v1-100) 1) + (set! gp-2 #t) + ) + ) + (dotimes (s5-2 (-> self max-count)) + (let ((s4-2 (handle->process (-> self slave s5-2)))) + (cond + ((= (-> self data-int32 s5-2) -1) + (when s4-2 + (when (focus-test? (the-as city-lurker s4-2) inactive) + (let ((s3-1 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s3-1 object-type) (traffic-type tt5)) + (set! (-> s3-1 behavior) (the-as uint 6)) + (set! (-> s3-1 id) (the-as uint 0)) + (set! (-> s3-1 nav-mesh) #f) + (set! (-> s3-1 nav-branch) #f) + (set! (-> s3-1 proc) #f) + (set! (-> s3-1 handle) (-> self slave s5-2)) + (set! (-> s3-1 user-data) (the-as uint 0)) + (set! (-> s3-1 flags) (traffic-spawn-flags)) + (set! (-> s3-1 guard-type) (the-as uint 7)) + (vector-reset! (-> s3-1 velocity)) + (set! (-> s3-1 position quad) (-> (the-as city-lurker s4-2) root-override2 trans quad)) + (quaternion-copy! (-> s3-1 rotation) (-> (the-as city-lurker s4-2) root-override2 quat)) + (activate-by-handle *traffic-engine* s3-1) ) ) ) - ((zero? (-> self data-int32 s5-2)) - (when (the-as city-lurker s4-2) - (let* ((s2-0 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) - (s3-2 (if (type? s2-0 entity-nav-mesh) - s2-0 - ) - ) - ) - (when (and s3-2 (!= (-> (the-as city-lurker s4-2) nav state mesh) (-> s3-2 nav-mesh))) - (when (nonzero? (-> (the-as city-lurker s4-2) nav state mesh)) - (remove-process-drawable (-> (the-as city-lurker s4-2) nav state mesh) (the-as city-lurker s4-2)) - (set! (-> (the-as city-lurker s4-2) nav) #f) - ) - (change-to (-> s3-2 nav-mesh) (the-as city-lurker s4-2)) - ) - ) - (let ((a0-73 *target*)) - (when (and a0-73 (focus-test? a0-73 pilot)) - (let ((s3-3 (handle->process (-> a0-73 pilot vehicle)))) - (when s3-3 - (cond - ((and (focus-test? (the-as city-lurker s4-2) pilot) (handle->process (-> (the-as city-lurker s4-2) vehicle))) - (+! (-> self data-int32 s5-2) 1) + ) + ((zero? (-> self data-int32 s5-2)) + (when (the-as city-lurker s4-2) + (let* ((s2-0 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) + (s3-2 (if (type? s2-0 entity-nav-mesh) + s2-0 + ) ) - (else - (.lvf vf1 (&-> (-> (the-as vehicle s3-3) root-override-2 transv) quad)) - (.add.w.vf vf2 vf0 vf0 :mask #b1) - (.mul.vf vf1 vf1 vf1) - (.mul.x.vf acc vf2 vf1 :mask #b1) - (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) - (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) - (.mov v1-163 vf1) - (let ((f0-2 v1-163) - (f1-0 32768.0) - ) - (when (and (< f0-2 (* f1-0 f1-0)) - (let ((f0-3 (vector-vector-distance-squared - (-> (the-as vehicle s3-3) root-override-2 trans) - (-> (the-as city-lurker s4-2) root-override2 trans) - ) - ) - (f1-3 65536.0) - ) - (< f0-3 (* f1-3 f1-3)) - ) - (not gp-2) - ) - (set! gp-2 #t) - (send-event (the-as city-lurker s4-2) 'board-vehicle (the-as vehicle s3-3)) + ) + (when (and s3-2 (!= (-> (the-as city-lurker s4-2) nav state mesh) (-> s3-2 nav-mesh))) + (when (nonzero? (-> (the-as city-lurker s4-2) nav state mesh)) + (remove-process-drawable (-> (the-as city-lurker s4-2) nav state mesh) (the-as city-lurker s4-2)) + (set! (-> (the-as city-lurker s4-2) nav) #f) + ) + (change-to (-> s3-2 nav-mesh) (the-as city-lurker s4-2)) + ) + ) + (let ((a0-73 *target*)) + (when (and a0-73 (focus-test? a0-73 pilot)) + (let ((s3-3 (handle->process (-> a0-73 pilot vehicle)))) + (when s3-3 + (cond + ((and (focus-test? (the-as city-lurker s4-2) pilot) (handle->process (-> (the-as city-lurker s4-2) vehicle))) + (+! (-> self data-int32 s5-2) 1) + ) + (else + (.lvf vf1 (&-> (-> (the-as vehicle s3-3) root-override-2 transv) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-163 vf1) + (let ((f0-2 v1-163) + (f1-0 32768.0) ) + (when (and (< f0-2 (* f1-0 f1-0)) + (let ((f0-3 (vector-vector-distance-squared + (-> (the-as vehicle s3-3) root-override-2 trans) + (-> (the-as city-lurker s4-2) root-override2 trans) + ) + ) + (f1-3 65536.0) + ) + (< f0-3 (* f1-3 f1-3)) + ) + (not gp-2) + ) + (set! gp-2 #t) + (send-event (the-as city-lurker s4-2) 'board-vehicle (the-as vehicle s3-3)) ) ) ) @@ -2625,124 +2613,125 @@ ) ) ) - ((= (-> self data-int32 s5-2) 1) - (when (the-as city-lurker s4-2) - (if (or (not *target*) (not (logtest? (focus-status pilot) (-> *target* focus-status)))) - (send-event (the-as city-lurker s4-2) 'exit-vehicle (-> (the-as city-lurker s4-2) root-override2 trans)) + ) + ((= (-> self data-int32 s5-2) 1) + (when (the-as city-lurker s4-2) + (if (or (not *target*) (not (logtest? (focus-status pilot) (-> *target* focus-status)))) + (send-event (the-as city-lurker s4-2) 'exit-vehicle (-> (the-as city-lurker s4-2) root-override2 trans)) + ) + (let ((s3-4 (-> self data-vector 3)) + (s2-1 (handle->process (-> *target* pilot vehicle))) ) - (let ((s3-4 (-> self data-vector 3)) - (s2-1 (handle->process (-> *target* pilot vehicle))) - ) - (cond - ((focus-test? (the-as city-lurker s4-2) pilot) - (when (and s2-1 - (let ((f0-4 (vector-vector-distance-squared s3-4 (-> (the-as vehicle s2-1) root-override-2 trans))) - (f1-6 114688.0) - ) - (< f0-4 (* f1-6 f1-6)) - ) - (begin - (.lvf vf1 (&-> (-> (the-as vehicle s2-1) root-override-2 transv) quad)) - (.add.w.vf vf2 vf0 vf0 :mask #b1) - (.mul.vf vf1 vf1 vf1) - (.mul.x.vf acc vf2 vf1 :mask #b1) - (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) - (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) - (.mov v1-205 vf1) - (let ((f0-5 v1-205) - (f1-9 421888.0) - ) - (< f0-5 (* f1-9 f1-9)) + (cond + ((focus-test? (the-as city-lurker s4-2) pilot) + (when (and s2-1 + (let ((f0-4 (vector-vector-distance-squared s3-4 (-> (the-as vehicle s2-1) root-override-2 trans))) + (f1-6 114688.0) ) + (< f0-4 (* f1-6 f1-6)) + ) + (begin + (.lvf vf1 (&-> (-> (the-as vehicle s2-1) root-override-2 transv) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-205 vf1) + (let ((f0-5 v1-205) + (f1-9 421888.0) + ) + (< f0-5 (* f1-9 f1-9)) ) ) - (set! (-> (the-as city-lurker s4-2) task-done?) #t) - (send-event (the-as city-lurker s4-2) 'exit-vehicle s3-4) - (let ((v1-214 (-> self data-int32 17))) - (cond - ((zero? v1-214) - (talker-spawn-func (-> *talker-speech* 380) *entity-pool* (target-pos 0) (the-as region #f)) - ) - ((= v1-214 1) - (talker-spawn-func (-> *talker-speech* 382) *entity-pool* (target-pos 0) (the-as region #f)) - ) - ((= v1-214 2) - (talker-spawn-func (-> *talker-speech* 384) *entity-pool* (target-pos 0) (the-as region #f)) - ) - ) + ) + (set! (-> (the-as city-lurker s4-2) task-done?) #t) + (send-event (the-as city-lurker s4-2) 'exit-vehicle s3-4) + (let ((v1-214 (-> self data-int32 17))) + (cond + ((zero? v1-214) + (talker-spawn-func (-> *talker-speech* 380) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-214 1) + (talker-spawn-func (-> *talker-speech* 382) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-214 2) + (talker-spawn-func (-> *talker-speech* 384) *entity-pool* (target-pos 0) (the-as region #f)) + ) ) - (+! (-> self data-int32 17) 1) ) + (+! (-> self data-int32 17) 1) ) - (else - (set! (-> self data-int32 s5-2) 0) - 0 - ) + ) + (else + (set! (-> self data-int32 s5-2) 0) + 0 ) ) ) ) - ((= (-> self data-int32 s5-2) 2) - (let* ((s3-8 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) - (a0-116 (if (type? s3-8 entity-nav-mesh) - s3-8 - ) - ) - ) - (if a0-116 - (change-to (-> a0-116 nav-mesh) (the-as city-lurker s4-2)) - ) - ) + ) + ((= (-> self data-int32 s5-2) 2) + (let* ((s3-8 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) + (a0-116 (if (type? s3-8 entity-nav-mesh) + s3-8 + ) + ) + ) + (if a0-116 + (change-to (-> a0-116 nav-mesh) (the-as city-lurker s4-2)) + ) ) - ) + ) ) ) ) - (none) - ) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 124 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) - (suspend) - (send-event *traffic-manager* 'set-target-level #x3f400000) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) - (suspend) ) (none) ) ) ) -(set-subtask-hook! *game-info* 124 5 (the-as (function object) (lambda :behavior task-manager () (none)))) +(set-subtask-hook! + *game-info* + (game-task-node city-meet-brutter-meet-brutter) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) + (suspend) + (send-event *traffic-manager* 'set-target-level #x3f400000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (none) + ) + ) (set-subtask-hook! *game-info* - 124 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *traffic-manager* 'decrease-alert-level 0) - (send-event *traffic-manager* 'set-alert-duration 9000) - (send-event *target* 'end-mode) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (task-node-close! (game-task-node city-meet-brutter-meet-brutter)) - (none) - ) - ) + (game-task-node city-meet-brutter-meet-brutter) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager () (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-meet-brutter-meet-brutter) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'decrease-alert-level 0) + (send-event *traffic-manager* 'set-alert-duration 9000) + (send-event *target* 'end-mode) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (task-node-close! (game-task-node city-meet-brutter-meet-brutter)) + (none) + ) ) (deftype city-save-lurkers-info (structure) @@ -2829,159 +2818,152 @@ (set-subtask-hook! *game-info* - 207 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) - (set-setting! 'minimap 'clear 0 32) - (dotimes (v1-3 8) - (set! (-> self minimap v1-3) #f) + (game-task-node city-save-lurkers-save-lurkers) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (dotimes (v1-3 8) + (set! (-> self minimap v1-3) #f) + ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self max-count) 6) + (set! (-> self count) 6) + (dotimes (v1-8 4) + (set! (-> self data-vector v1-8 quad) (-> *save-lurkers-position* v1-8 quad)) + ) + (let ((gp-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params-1))) + (vector-reset! (-> gp-0 vec)) + (forward-up-nopitch->quaternion + (-> gp-0 quat) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) ) - (set! (-> self start-time) 0) - (set! (-> self sub-state) (the-as uint 0)) - (set! (-> self max-count) 6) - (set! (-> self count) 6) - (dotimes (v1-8 4) - (set! (-> self data-vector v1-8 quad) (-> *save-lurkers-position* v1-8 quad)) - ) - (let ((gp-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params-1))) - (vector-reset! (-> gp-0 vec)) - (forward-up-nopitch->quaternion - (-> gp-0 quat) - (new 'static 'vector :z 1.0 :w 1.0) - (new 'static 'vector :y 1.0 :w 1.0) - ) - (set! (-> gp-0 params 0 object-type) (traffic-type tt17)) - (set! (-> gp-0 params 0 behavior) (the-as uint 1)) - (set! (-> gp-0 params 0 id) (the-as uint 0)) - (set! (-> gp-0 params 0 nav-mesh) #f) - (set! (-> gp-0 params 0 nav-branch) #f) - (set! (-> gp-0 params 0 proc) #f) - (set! (-> gp-0 params 0 handle) (the-as handle #f)) - (set! (-> gp-0 params 0 user-data) (the-as uint 0)) - (set! (-> gp-0 params 0 flags) (traffic-spawn-flags trsflags-01)) - (set! (-> gp-0 params 0 guard-type) (the-as uint 7)) - (vector-reset! (-> gp-0 params 0 velocity)) - (set! (-> gp-0 params 0 position quad) (-> gp-0 vec quad)) - (quaternion-copy! (-> gp-0 params 0 rotation) (-> gp-0 quat)) - (set! (-> gp-0 params 1 object-type) (traffic-type tt5)) - (set! (-> gp-0 params 1 behavior) (the-as uint 8)) - (set! (-> gp-0 params 1 id) (the-as uint 0)) - (set! (-> gp-0 params 1 nav-mesh) #f) - (set! (-> gp-0 params 1 nav-branch) #f) - (set! (-> gp-0 params 1 proc) #f) - (set! (-> gp-0 params 1 handle) (the-as handle #f)) - (set! (-> gp-0 params 1 user-data) (the-as uint 0)) - (set! (-> gp-0 params 1 flags) (traffic-spawn-flags trsflags-00)) - (set! (-> gp-0 params 1 guard-type) (the-as uint 7)) - (vector-reset! (-> gp-0 params 1 velocity)) - (set! (-> gp-0 params 1 position quad) (-> gp-0 vec quad)) - (quaternion-copy! (-> gp-0 params 1 rotation) (-> gp-0 quat)) - (countdown (s5-0 (-> self max-count)) - (let ((s2-0 (-> *city-save-lurkers-vehicle-info* s5-0))) - (set! (-> gp-0 params 0 id) (the-as uint (+ s5-0 120))) - (set! (-> gp-0 params 0 position quad) (-> s2-0 pos quad)) - (set! (-> gp-0 params 1 position quad) (-> s2-0 pos quad)) - (let ((s4-0 (the-as - paddywagon - (vehicle-spawn *traffic-manager* paddywagon (the-as traffic-object-spawn-params (-> gp-0 params))) - ) - ) - ) - (when s4-0 - (set! (-> s4-0 current-level) (-> s2-0 level)) - (set! (-> self slave (+ s5-0 (-> self max-count))) (process->handle s4-0)) - (send-event *traffic-manager* 'add-object (-> gp-0 params 0 object-type) s4-0) - (let ((s3-0 (the-as city-lurker (citizen-spawn self city-lurker (-> gp-0 params 1))))) - (when s3-0 - (set! (-> s3-0 jump-in-pipe?) #t) - (set! (-> s3-0 pipe-name) (-> s2-0 pipe-name)) - (set! (-> s3-0 end-pos quad) (-> s2-0 end-pos quad)) - (set! (-> s3-0 task-node) (game-task-node city-save-lurkers-save-lurkers)) - (set! (-> s3-0 index) (the-as uint s5-0)) - (set! (-> s3-0 nav-mesh-aid) (the-as uint 0)) - (set! (-> self slave s5-0) (process->handle s3-0)) - (set! (-> self data-int32 s5-0) -1) - (change-parent s3-0 s4-0) - (logior! (-> s3-0 flags) (citizen-flag persistent)) - (send-event *traffic-manager* 'add-object (-> gp-0 params 1 object-type) s3-0) - (set! (-> s3-0 controller traffic) *traffic-engine*) - (set! (-> s3-0 vehicle) (process->handle s4-0)) - (let ((s2-1 (get-best-seat-for-vehicle s4-0 (-> s4-0 root-override-2 trans) 4 0))) - (when (!= s2-1 -1) - (format #t "adding lurker to seat ~d~%" s2-1) - (put-rider-in-seat s4-0 s2-1 s3-0) - (logior! (-> s3-0 focus-status) (focus-status pilot-riding)) + (set! (-> gp-0 params 0 object-type) (traffic-type tt17)) + (set! (-> gp-0 params 0 behavior) (the-as uint 1)) + (set! (-> gp-0 params 0 id) (the-as uint 0)) + (set! (-> gp-0 params 0 nav-mesh) #f) + (set! (-> gp-0 params 0 nav-branch) #f) + (set! (-> gp-0 params 0 proc) #f) + (set! (-> gp-0 params 0 handle) (the-as handle #f)) + (set! (-> gp-0 params 0 user-data) (the-as uint 0)) + (set! (-> gp-0 params 0 flags) (traffic-spawn-flags trsflags-01)) + (set! (-> gp-0 params 0 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-0 params 0 velocity)) + (set! (-> gp-0 params 0 position quad) (-> gp-0 vec quad)) + (quaternion-copy! (-> gp-0 params 0 rotation) (-> gp-0 quat)) + (set! (-> gp-0 params 1 object-type) (traffic-type tt5)) + (set! (-> gp-0 params 1 behavior) (the-as uint 8)) + (set! (-> gp-0 params 1 id) (the-as uint 0)) + (set! (-> gp-0 params 1 nav-mesh) #f) + (set! (-> gp-0 params 1 nav-branch) #f) + (set! (-> gp-0 params 1 proc) #f) + (set! (-> gp-0 params 1 handle) (the-as handle #f)) + (set! (-> gp-0 params 1 user-data) (the-as uint 0)) + (set! (-> gp-0 params 1 flags) (traffic-spawn-flags trsflags-00)) + (set! (-> gp-0 params 1 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-0 params 1 velocity)) + (set! (-> gp-0 params 1 position quad) (-> gp-0 vec quad)) + (quaternion-copy! (-> gp-0 params 1 rotation) (-> gp-0 quat)) + (countdown (s5-0 (-> self max-count)) + (let ((s2-0 (-> *city-save-lurkers-vehicle-info* s5-0))) + (set! (-> gp-0 params 0 id) (the-as uint (+ s5-0 120))) + (set! (-> gp-0 params 0 position quad) (-> s2-0 pos quad)) + (set! (-> gp-0 params 1 position quad) (-> s2-0 pos quad)) + (let ((s4-0 (the-as + paddywagon + (vehicle-spawn *traffic-manager* paddywagon (the-as traffic-object-spawn-params (-> gp-0 params))) ) ) + ) + (when s4-0 + (set! (-> s4-0 current-level) (-> s2-0 level)) + (set! (-> self slave (+ s5-0 (-> self max-count))) (process->handle s4-0)) + (send-event *traffic-manager* 'add-object (-> gp-0 params 0 object-type) s4-0) + (let ((s3-0 (the-as city-lurker (citizen-spawn self city-lurker (-> gp-0 params 1))))) + (when s3-0 + (set! (-> s3-0 jump-in-pipe?) #t) + (set! (-> s3-0 pipe-name) (-> s2-0 pipe-name)) + (set! (-> s3-0 end-pos quad) (-> s2-0 end-pos quad)) + (set! (-> s3-0 task-node) (game-task-node city-save-lurkers-save-lurkers)) + (set! (-> s3-0 index) (the-as uint s5-0)) + (set! (-> s3-0 nav-mesh-aid) (the-as uint 0)) + (set! (-> self slave s5-0) (process->handle s3-0)) + (set! (-> self data-int32 s5-0) -1) + (change-parent s3-0 s4-0) + (logior! (-> s3-0 flags) (citizen-flag persistent)) + (send-event *traffic-manager* 'add-object (-> gp-0 params 1 object-type) s3-0) + (set! (-> s3-0 controller traffic) *traffic-engine*) + (set! (-> s3-0 vehicle) (process->handle s4-0)) + (let ((s2-1 (get-best-seat-for-vehicle s4-0 (-> s4-0 root-override-2 trans) 4 0))) + (when (!= s2-1 -1) + (format #t "adding lurker to seat ~d~%" s2-1) + (put-rider-in-seat s4-0 s2-1 s3-0) + (logior! (-> s3-0 focus-status) (focus-status pilot-riding)) + ) ) - (if (not s3-0) - (format #t "brutter-task: unable to spawn rider~%") - ) ) + (if (not s3-0) + (format #t "brutter-task: unable to spawn rider~%") + ) ) - (if (not s4-0) - (format 0 "failed to spawn paddywagon~%") - ) ) + (if (not s4-0) + (format 0 "failed to spawn paddywagon~%") + ) ) ) - (send-event *traffic-manager* 'set-object-target-count (-> gp-0 params 0 object-type) 0) - (send-event *traffic-manager* 'set-object-target-count (-> gp-0 params 1 object-type) 0) ) - (set! (-> *game-info* counter) (the float (-> self count))) - (set! (-> self arrow) (the-as handle #f)) - (change-parent self *traffic-manager*) - (none) + (send-event *traffic-manager* 'set-object-target-count (-> gp-0 params 0 object-type) 0) + (send-event *traffic-manager* 'set-object-target-count (-> gp-0 params 1 object-type) 0) ) + (set! (-> *game-info* counter) (the float (-> self count))) + (set! (-> self arrow) (the-as handle #f)) + (change-parent self *traffic-manager*) + (none) ) ) (set-subtask-hook! *game-info* - 207 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) + (game-task-node city-save-lurkers-save-lurkers) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) ) (set-subtask-hook! *game-info* - 207 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 city-lurker) (arg1 object) (arg2 symbol)) - (case arg2 - (('task-done) - (let ((v1-1 arg0)) - (set! (-> self data-int32 (-> v1-1 index)) 2) - ) - ) - (('on-ground) - (cond - ((= (-> self data-int32 (-> arg0 index)) -1) - (+! (-> self data-int32 (-> arg0 index)) 1) - ) - ((= (-> self data-int32 (-> arg0 index)) 1) - ) - ) - (change-parent arg0 self) - ) - ) - (none) - ) + (game-task-node city-save-lurkers-save-lurkers) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 city-lurker) (arg1 object) (arg2 symbol)) + (case arg2 + (('task-done) + (let ((v1-1 arg0)) + (set! (-> self data-int32 (-> v1-1 index)) 2) + ) + ) + (('on-ground) + (cond + ((= (-> self data-int32 (-> arg0 index)) -1) + (+! (-> self data-int32 (-> arg0 index)) 1) ) + ((= (-> self data-int32 (-> arg0 index)) 1) + ) + ) + (change-parent arg0 self) + ) + ) + (none) + ) ) (set-subtask-hook! *game-info* - 207 - 2 + (game-task-node city-save-lurkers-save-lurkers) + TASK_MANAGER_UPDATE_HOOK (lambda :behavior task-manager () (local-vars (v1-178 float) (v1-231 float)) @@ -3284,55 +3266,54 @@ (set-subtask-hook! *game-info* - 207 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) + (game-task-node city-save-lurkers-save-lurkers) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) + (suspend) + (send-event *traffic-manager* 'set-target-level #x3f400000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) (suspend) - (send-event *traffic-manager* 'set-target-level #x3f400000) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) - (suspend) - ) - (none) ) + (none) ) ) -(set-subtask-hook! *game-info* 207 5 (the-as (function object) (lambda :behavior task-manager () (none)))) - (set-subtask-hook! *game-info* - 207 - 4 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (until #f - (let ((v1-2 0)) - (dotimes (a0-0 6) - (let ((a1-3 (handle->process (-> self slave a0-0)))) - (if (and a1-3 (-> a1-3 next-state) (= (-> a1-3 next-state name) 'inactive)) - (+! v1-2 1) - ) - ) + (game-task-node city-save-lurkers-save-lurkers) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager () (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-save-lurkers-save-lurkers) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (until #f + (let ((v1-2 0)) + (dotimes (a0-0 6) + (let ((a1-3 (handle->process (-> self slave a0-0)))) + (if (and a1-3 (-> a1-3 next-state) (= (-> a1-3 next-state name) 'inactive)) + (+! v1-2 1) + ) ) - (if (= v1-2 6) - (goto cfg-20) - ) ) - (suspend) - 0 + (if (= v1-2 6) + (goto cfg-20) + ) ) - #f - (label cfg-20) - (task-node-close! (game-task-node city-save-lurkers-save-lurkers)) - (none) + (suspend) + 0 ) + #f + (label cfg-20) + (task-node-close! (game-task-node city-save-lurkers-save-lurkers)) + (none) ) ) diff --git a/goal_src/jak2/levels/city/misc/collection_task/collection-task.gc b/goal_src/jak2/levels/city/misc/collection_task/collection-task.gc index e3a8b7dfdd..306040994b 100644 --- a/goal_src/jak2/levels/city/misc/collection_task/collection-task.gc +++ b/goal_src/jak2/levels/city/misc/collection_task/collection-task.gc @@ -206,140 +206,134 @@ (set-subtask-hook! *game-info* - 73 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -245760.0 :y 45056.0 :z 5468160.0 :w 1.0) quad)) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (let ((traffic-manager *traffic-manager*) - (traffic-obj-params (new 'stack 'traffic-object-spawn-params)) - ) - (set! (-> traffic-obj-params position quad) (-> self begin-pos quad)) - (quaternion-axis-angle! (-> traffic-obj-params rotation) 0.0 1.0 0.0 16384.0) - (set! (-> traffic-obj-params object-type) (traffic-type bikec)) - (set! (-> traffic-obj-params behavior) (the-as uint 0)) - (set! (-> traffic-obj-params id) (the-as uint 0)) - (set! (-> traffic-obj-params proc) #f) - (send-event traffic-manager 'spawn-object traffic-obj-params) - ) - (set! (-> self start-time) 0) - (set! (-> self count) -1) - (set! (-> self max-count) 14) - (set! (-> self data-vector 0 quad) - (-> (new 'static 'vector :x 1282048.0 :y 37925.273 :z 5492736.0 :w 1.0) quad) - ) - (set! (-> self data-vector 1 quad) - (-> (new 'static 'vector :x 2392064.0 :y 23235.379 :z 5980160.0 :w 1.0) quad) - ) - (set! (-> self data-vector 2 quad) - (-> (new 'static 'vector :x 3231744.0 :y 38680.984 :z 4788224.0 :w 1.0) quad) - ) - (set! (-> self data-vector 3 quad) - (-> (new 'static 'vector :x 3829760.0 :y 38680.984 :z 3682304.0 :w 1.0) quad) - ) - (set! (-> self data-vector 4 quad) - (-> (new 'static 'vector :x 4325376.0 :y 38680.984 :z 2564096.0 :w 1.0) quad) - ) - (set! (-> self data-vector 5 quad) - (-> (new 'static 'vector :x 4014080.0 :y 38680.984 :z 1822720.0 :w 1.0) quad) - ) - (set! (-> self data-vector 6 quad) - (-> (new 'static 'vector :x 3698688.0 :y 38680.984 :z 1728512.0 :w 1.0) quad) - ) - (set! (-> self data-vector 7 quad) - (-> (new 'static 'vector :x 3792896.0 :y 38680.984 :z 2387968.0 :w 1.0) quad) - ) - (set! (-> self data-vector 8 quad) - (-> (new 'static 'vector :x 4616192.0 :y 38680.984 :z 2863104.0 :w 1.0) quad) - ) - (set! (-> self data-vector 9 quad) - (-> (new 'static 'vector :x 3633152.0 :y 38680.984 :z 3477504.0 :w 1.0) quad) - ) - (set! (-> self data-vector 10 quad) - (-> (new 'static 'vector :x 3993600.0 :y 38680.984 :z 4378624.0 :w 1.0) quad) - ) - (set! (-> self data-vector 11 quad) - (-> (new 'static 'vector :x 3112960.0 :y 23472.947 :z 5390336.0 :w 1.0) quad) - ) - (set! (-> self data-vector 12 quad) - (-> (new 'static 'vector :x 1789952.0 :y 37616.027 :z 5455872.0 :w 1.0) quad) - ) - (set! (-> self data-vector 13 quad) - (-> (new 'static 'vector :x 237568.0 :y 37541.477 :z 5439488.0 :w 1.0) quad) - ) - (set! (-> self data-int32 0) #x2904) - (set! (-> self data-int32 1) 9000) - (set! (-> self data-int32 2) 9000) - (set! (-> self data-int32 3) 9000) - (set! (-> self data-int32 4) 9000) - (set! (-> self data-int32 5) 9000) - (set! (-> self data-int32 6) 3000) - (set! (-> self data-int32 7) 6000) - (set! (-> self data-int32 8) 9000) - (set! (-> self data-int32 9) 9000) - (set! (-> self data-int32 10) 9000) - (set! (-> self data-int32 11) 9000) - (set! (-> self data-int32 12) 7500) - (set! (-> self data-int32 13) 7500) - (set! (-> *game-info* counter) (the float (-> self max-count))) - (none) + (game-task-node city-krew-collection-collection) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -245760.0 :y 45056.0 :z 5468160.0 :w 1.0) quad)) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (let ((traffic-manager *traffic-manager*) + (traffic-obj-params (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> traffic-obj-params position quad) (-> self begin-pos quad)) + (quaternion-axis-angle! (-> traffic-obj-params rotation) 0.0 1.0 0.0 16384.0) + (set! (-> traffic-obj-params object-type) (traffic-type bikec)) + (set! (-> traffic-obj-params behavior) (the-as uint 0)) + (set! (-> traffic-obj-params id) (the-as uint 0)) + (set! (-> traffic-obj-params proc) #f) + (send-event traffic-manager 'spawn-object traffic-obj-params) ) + (set! (-> self start-time) 0) + (set! (-> self count) -1) + (set! (-> self max-count) 14) + (set! (-> self data-vector 0 quad) + (-> (new 'static 'vector :x 1282048.0 :y 37925.273 :z 5492736.0 :w 1.0) quad) + ) + (set! (-> self data-vector 1 quad) + (-> (new 'static 'vector :x 2392064.0 :y 23235.379 :z 5980160.0 :w 1.0) quad) + ) + (set! (-> self data-vector 2 quad) + (-> (new 'static 'vector :x 3231744.0 :y 38680.984 :z 4788224.0 :w 1.0) quad) + ) + (set! (-> self data-vector 3 quad) + (-> (new 'static 'vector :x 3829760.0 :y 38680.984 :z 3682304.0 :w 1.0) quad) + ) + (set! (-> self data-vector 4 quad) + (-> (new 'static 'vector :x 4325376.0 :y 38680.984 :z 2564096.0 :w 1.0) quad) + ) + (set! (-> self data-vector 5 quad) + (-> (new 'static 'vector :x 4014080.0 :y 38680.984 :z 1822720.0 :w 1.0) quad) + ) + (set! (-> self data-vector 6 quad) + (-> (new 'static 'vector :x 3698688.0 :y 38680.984 :z 1728512.0 :w 1.0) quad) + ) + (set! (-> self data-vector 7 quad) + (-> (new 'static 'vector :x 3792896.0 :y 38680.984 :z 2387968.0 :w 1.0) quad) + ) + (set! (-> self data-vector 8 quad) + (-> (new 'static 'vector :x 4616192.0 :y 38680.984 :z 2863104.0 :w 1.0) quad) + ) + (set! (-> self data-vector 9 quad) + (-> (new 'static 'vector :x 3633152.0 :y 38680.984 :z 3477504.0 :w 1.0) quad) + ) + (set! (-> self data-vector 10 quad) + (-> (new 'static 'vector :x 3993600.0 :y 38680.984 :z 4378624.0 :w 1.0) quad) + ) + (set! (-> self data-vector 11 quad) + (-> (new 'static 'vector :x 3112960.0 :y 23472.947 :z 5390336.0 :w 1.0) quad) + ) + (set! (-> self data-vector 12 quad) + (-> (new 'static 'vector :x 1789952.0 :y 37616.027 :z 5455872.0 :w 1.0) quad) + ) + (set! (-> self data-vector 13 quad) + (-> (new 'static 'vector :x 237568.0 :y 37541.477 :z 5439488.0 :w 1.0) quad) + ) + (set! (-> self data-int32 0) #x2904) + (set! (-> self data-int32 1) 9000) + (set! (-> self data-int32 2) 9000) + (set! (-> self data-int32 3) 9000) + (set! (-> self data-int32 4) 9000) + (set! (-> self data-int32 5) 9000) + (set! (-> self data-int32 6) 3000) + (set! (-> self data-int32 7) 6000) + (set! (-> self data-int32 8) 9000) + (set! (-> self data-int32 9) 9000) + (set! (-> self data-int32 10) 9000) + (set! (-> self data-int32 11) 9000) + (set! (-> self data-int32 12) 7500) + (set! (-> self data-int32 13) 7500) + (set! (-> *game-info* counter) (the float (-> self max-count))) + (none) ) ) (set-subtask-hook! *game-info* - 73 - 1 + (game-task-node city-krew-collection-collection) + TASK_MANAGER_CLEANUP_HOOK (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings)) ) (set-subtask-hook! *game-info* - 73 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (check-time self) - (when (>= (-> self count) 0) - (cond - ((handle->process (-> self slave 0)) - ) - (else - (let ((task-count (-> self count))) - (cond - ((< task-count (-> self max-count)) - (let ((krew-item (krew-collection-item-spawn self (-> self data-vector task-count)))) - (when krew-item - (set! (-> self slave 0) (process->handle krew-item)) - (set! (-> self time-limit) (the-as time-frame (-> self data-int32 task-count))) - (set! (-> self start-time) (-> self clock frame-counter)) - (+! (-> self count) 1) - ) + (game-task-node city-krew-collection-collection) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (check-time self) + (when (>= (-> self count) 0) + (cond + ((handle->process (-> self slave 0)) + ) + (else + (let ((task-count (-> self count))) + (cond + ((< task-count (-> self max-count)) + (let ((krew-item (krew-collection-item-spawn self (-> self data-vector task-count)))) + (when krew-item + (set! (-> self slave 0) (process->handle krew-item)) + (set! (-> self time-limit) (the-as time-frame (-> self data-int32 task-count))) + (set! (-> self start-time) (-> self clock frame-counter)) + (+! (-> self count) 1) ) ) - (else - (go-virtual complete) - ) + ) + (else + (go-virtual complete) ) ) ) ) ) - (none) ) + (none) ) ) (set-subtask-hook! *game-info* - 73 - 3 + (game-task-node city-krew-collection-collection) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (local-vars (moved-beyond-start? symbol)) @@ -353,7 +347,7 @@ ) ) ) - (set-setting! 'airlock #f 0 0) + (set-setting! 'airlock #f 0.0 0) (set! (-> self count) 0) (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-moneybag :init hud-init-by-other :to *target*)) @@ -370,27 +364,24 @@ (set-subtask-hook! *game-info* - 73 - 5 + (game-task-node city-krew-collection-collection) + TASK_MANAGER_FAIL_HOOK (lambda :behavior task-manager () (the-as object (kill-all-children self))) ) (set-subtask-hook! *game-info* - 73 - 4 - (the-as - (function object) - (lambda :behavior task-manager - () - (send-event *traffic-manager* 'decrease-alert-level 0) - (send-event *traffic-manager* 'set-alert-duration 9000) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (talker-spawn-func (-> *talker-speech* 88) *entity-pool* (target-pos 0) (the-as region #f)) - (none) + (game-task-node city-krew-collection-collection) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'decrease-alert-level 0) + (send-event *traffic-manager* 'set-alert-duration 9000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) ) + (talker-spawn-func (-> *talker-speech* 88) *entity-pool* (target-pos 0) (the-as region #f)) + (none) ) ) diff --git a/goal_src/jak2/levels/city/misc/delivery/delivery-task.gc b/goal_src/jak2/levels/city/misc/delivery/delivery-task.gc index 6e891fae2e..4b4c470a20 100644 --- a/goal_src/jak2/levels/city/misc/delivery/delivery-task.gc +++ b/goal_src/jak2/levels/city/misc/delivery/delivery-task.gc @@ -123,79 +123,73 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 24 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (while (!= (level-status *level* 'ctysluma) 'active) - (suspend) - ) - (let ((v1-3 (entity-by-name "parking-spot-8"))) - (if v1-3 - (logior! (-> v1-3 extra perm status) (entity-perm-status bit-9)) + (game-task-node city-krew-delivery-delivery) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (while (!= (level-status *level* 'ctysluma) 'active) + (suspend) + ) + (let ((v1-3 (entity-by-name "parking-spot-8"))) + (if v1-3 + (logior! (-> v1-3 extra perm status) (entity-perm-status bit-9)) + ) + ) + (set! (-> self end-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (let ((gp-1 *traffic-manager*)) + (let ((s5-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s5-0 position quad) (-> (new 'static 'vector :x 4698112.0 :y 45875.2 :z 81920.0 :w 1.0) quad)) + (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 32768.0) + (set! (-> s5-0 object-type) (traffic-type bikea)) + (set! (-> s5-0 behavior) (the-as uint 0)) + (set! (-> s5-0 id) (the-as uint 0)) + (set! (-> s5-0 proc) #f) + (send-event gp-1 'spawn-object s5-0) + (when (-> s5-0 proc) + (set! (-> self slave 0) (process->handle (-> s5-0 proc))) + (let ((v1-20 (-> s5-0 proc))) + (set! (-> (the-as vehicle v1-20) damage-factor) 2.0) ) - ) - (set! (-> self end-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) - (set-setting! 'minimap 'clear 0 32) - (let ((gp-1 *traffic-manager*)) - (let ((s5-0 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s5-0 position quad) (-> (new 'static 'vector :x 4698112.0 :y 45875.2 :z 81920.0 :w 1.0) quad)) - (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 32768.0) - (set! (-> s5-0 object-type) (traffic-type bikea)) - (set! (-> s5-0 behavior) (the-as uint 0)) - (set! (-> s5-0 id) (the-as uint 0)) - (set! (-> s5-0 proc) #f) - (send-event gp-1 'spawn-object s5-0) - (when (-> s5-0 proc) - (set! (-> self slave 0) (process->handle (-> s5-0 proc))) - (let ((v1-20 (-> s5-0 proc))) - (set! (-> (the-as vehicle v1-20) damage-factor) 2.0) - ) - (let ((v1-22 (krew-package-spawn (-> s5-0 proc) (-> s5-0 proc)))) - (if v1-22 - (set! (-> self slave 1) (process->handle (-> v1-22 0))) - ) - ) - ) - (let ((s4-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s4-0 pos quad) (-> s5-0 position quad)) - (quaternion-identity! (-> s4-0 quat)) - (set! (-> s4-0 flags) (task-arrow-flags task-arrow-flag-03)) - (set! (-> s4-0 map-icon) (the-as uint 15)) - (label cfg-21) - (let ((a0-30 (task-arrow-spawn s4-0 (the-as task-arrow self)))) - (when (not a0-30) - (format #t "waiting for task-arrow~%") - (suspend) - (goto cfg-21) + (let ((v1-22 (krew-package-spawn (-> s5-0 proc) (-> s5-0 proc)))) + (if v1-22 + (set! (-> self slave 1) (process->handle (-> v1-22 0))) ) - (set! (-> self arrow) (process->handle a0-30)) - ) ) ) - (send-event gp-1 'set-target-level #x3f800000) - (send-event gp-1 'set-guard-target-count-range 4 0 1) - (send-event gp-1 'set-guard-target-count-range 5 0 0) + (let ((s4-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s4-0 pos quad) (-> s5-0 position quad)) + (quaternion-identity! (-> s4-0 quat)) + (set! (-> s4-0 flags) (task-arrow-flags task-arrow-flag-03)) + (set! (-> s4-0 map-icon) (the-as uint 15)) + (label cfg-21) + (let ((a0-30 (task-arrow-spawn s4-0 (the-as task-arrow self)))) + (when (not a0-30) + (format #t "waiting for task-arrow~%") + (suspend) + (goto cfg-21) + ) + (set! (-> self arrow) (process->handle a0-30)) + ) + ) ) - (set! (-> self sub-state) (the-as uint -1)) - (set! (-> self data-int8 0) 0) - (set! (-> self data-int8 1) 0) - 0 - (none) + (send-event gp-1 'set-target-level #x3f800000) + (send-event gp-1 'set-guard-target-count-range 4 0 1) + (send-event gp-1 'set-guard-target-count-range 5 0 0) ) + (set! (-> self sub-state) (the-as uint -1)) + (set! (-> self data-int8 0) 0) + (set! (-> self data-int8 1) 0) + 0 + (none) ) ) (set-subtask-hook! *game-info* - 24 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) + (game-task-node city-krew-delivery-delivery) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) ) (defun delivery-task-setup-ambush-1 () @@ -344,178 +338,100 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 24 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (local-vars (a0-32 float)) - (rlet ((acc :class vf) - (vf0 :class vf) - (vf1 :class vf) - (vf2 :class vf) + (game-task-node city-krew-delivery-delivery) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (local-vars (a0-32 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (handle->process (-> self slave 0)))) + (cond + ((and gp-0 (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead)))) + (cond + ((zero? (-> self data-int8 0)) + (when (= (level-status *level* 'ctyindb) 'active) + (set! (-> self data-int8 0) 1) + (delivery-task-setup-ambush-1) + ) + ) + (else + (when (!= (level-status *level* 'ctyindb) 'active) + (set! (-> self data-int8 0) 0) + 0 + ) + ) ) - (init-vf0-vector) - (let ((gp-0 (handle->process (-> self slave 0)))) - (cond - ((and gp-0 (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead)))) + (cond + ((zero? (-> self data-int8 1)) + (when (= (level-status *level* 'ctyinda) 'active) + (set! (-> self data-int8 1) 1) + (delivery-task-setup-ambush-2) + ) + ) + (else + (when (!= (level-status *level* 'ctyinda) 'active) + (set! (-> self data-int8 1) 0) + 0 + ) + ) + ) + (let ((f0-0 (vector-vector-distance-squared (-> (the-as process-drawable gp-0) root trans) (target-pos 0))) + (f1-0 12288.0) + ) (cond - ((zero? (-> self data-int8 0)) - (when (= (level-status *level* 'ctyindb) 'active) - (set! (-> self data-int8 0) 1) - (delivery-task-setup-ambush-1) + ((and (< f0-0 (* f1-0 f1-0)) *target* (focus-test? *target* pilot)) + (when (nonzero? (-> self sub-state)) + (send-event (handle->process (-> self arrow)) 'set-position (-> self end-pos)) + (send-event (handle->process (-> self arrow)) 'modify-flags 1 0) + (send-event (handle->process (-> self arrow)) 'map-icon 8) + (set! (-> self sub-state) (the-as uint 0)) + 0 ) ) (else - (when (!= (level-status *level* 'ctyindb) 'active) - (set! (-> self data-int8 0) 0) - 0 - ) - ) - ) - (cond - ((zero? (-> self data-int8 1)) - (when (= (level-status *level* 'ctyinda) 'active) - (set! (-> self data-int8 1) 1) - (delivery-task-setup-ambush-2) - ) - ) - (else - (when (!= (level-status *level* 'ctyinda) 'active) - (set! (-> self data-int8 1) 0) - 0 - ) - ) - ) - (let ((f0-0 (vector-vector-distance-squared (-> (the-as process-drawable gp-0) root trans) (target-pos 0))) - (f1-0 12288.0) - ) - (cond - ((and (< f0-0 (* f1-0 f1-0)) *target* (focus-test? *target* pilot)) - (when (nonzero? (-> self sub-state)) - (send-event (handle->process (-> self arrow)) 'set-position (-> self end-pos)) - (send-event (handle->process (-> self arrow)) 'modify-flags 1 0) - (send-event (handle->process (-> self arrow)) 'map-icon 8) - (set! (-> self sub-state) (the-as uint 0)) - 0 - ) - ) - (else - (let* ((v1-59 (new 'stack-no-clear 'inline-array 'vector 1)) - (f0-1 409.6) - (f0-3 (* f0-1 f0-1)) - ) - (.lvf vf1 (&-> (-> (the-as process-drawable gp-0) root transv) quad)) - (.add.w.vf vf2 vf0 vf0 :mask #b1) - (.mul.vf vf1 vf1 vf1) - (.mul.x.vf acc vf2 vf1 :mask #b1) - (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) - (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) - (.mov a0-32 vf1) - (when (>= f0-3 a0-32) - (set! (-> v1-59 0 quad) (-> (the-as process-drawable gp-0) root trans quad)) - (set! (-> v1-59 0 y) (+ -14336.0 (-> v1-59 0 y))) - (send-event (handle->process (-> self arrow)) 'set-position (-> v1-59 0)) - ) - ) - (when (!= (-> self sub-state) 1) - (send-event (handle->process (-> self arrow)) 'modify-flags 0 1) - (send-event (handle->process (-> self arrow)) 'map-icon 15) - (set! (-> self sub-state) (the-as uint 1)) + (let* ((v1-59 (new 'stack-no-clear 'inline-array 'vector 1)) + (f0-1 409.6) + (f0-3 (* f0-1 f0-1)) + ) + (.lvf vf1 (&-> (-> (the-as process-drawable gp-0) root transv) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov a0-32 vf1) + (when (>= f0-3 a0-32) + (set! (-> v1-59 0 quad) (-> (the-as process-drawable gp-0) root trans quad)) + (set! (-> v1-59 0 y) (+ -14336.0 (-> v1-59 0 y))) + (send-event (handle->process (-> self arrow)) 'set-position (-> v1-59 0)) ) ) + (when (!= (-> self sub-state) 1) + (send-event (handle->process (-> self arrow)) 'modify-flags 0 1) + (send-event (handle->process (-> self arrow)) 'map-icon 15) + (set! (-> self sub-state) (the-as uint 1)) + ) ) ) - (let ((f30-0 49152.0) - (f0-6 (vector-vector-distance-squared (-> (the-as process-drawable gp-0) root trans) (-> self end-pos))) - ) - (if (>= (* f30-0 f30-0) f0-6) - (go-virtual complete) - ) - ) ) - (else - (go-virtual fail) - ) + (let ((f30-0 49152.0) + (f0-6 (vector-vector-distance-squared (-> (the-as process-drawable gp-0) root trans) (-> self end-pos))) + ) + (if (>= (* f30-0 f30-0) f0-6) + (go-virtual complete) + ) + ) + ) + (else + (go-virtual fail) ) ) - (none) ) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 24 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (let ((gp-0 (new 'static 'vector :x 4501504.0 :y 73728.0 :z 2338816.0 :w 204800.0)) - (s5-0 #f) - ) - (while (not s5-0) - (let ((v1-1 (handle->process (-> self slave 0)))) - (when v1-1 - (let ((f0-0 (vector-vector-distance-squared (-> (the-as process-drawable v1-1) root trans) gp-0)) - (f1-0 (-> gp-0 w)) - ) - (set! s5-0 (< f0-0 (* f1-0 f1-0))) - ) - ) - ) - (suspend) - ) - ) - (send-event *traffic-manager* 'set-guard-target-count-range 0 0 0) - (send-event *traffic-manager* 'set-guard-target-count-range 1 4 4) - (send-event *traffic-manager* 'set-guard-target-count-range 2 0 0) - (send-event *traffic-manager* 'set-guard-target-count-range 4 0 10) - (send-event *traffic-manager* 'set-guard-target-count-range 5 0 10) - (send-event *traffic-manager* 'set-alert-level 3) - (send-event *traffic-manager* 'set-alert-duration #xa4cb80) - (speech-control-method-10 *speech-control* 7 (new 'static 'speech-type-info - :channel #x1 - :priority -2 - :min-delay #x258 - :max-delay #x4b0 - :list (new 'static 'boxed-array :type string - "kg243a" - "kg241a" - "kg242a" - "kg244a" - "kg245a" - "kg246a" - "kg247a" - "kg248a" - "kg249a" - "kg250a" - "kg251a" - "kg252a" - ) - ) - ) - (talker-spawn-func (-> *talker-speech* 49) *entity-pool* (target-pos 0) (the-as region #f)) - (let ((gp-2 (new 'static 'vector :x 3358720.0 :y 32768.0 :z 4689920.0 :w 204800.0)) - (s5-2 #f) - ) - (while (not s5-2) - (let ((v1-48 (handle->process (-> self slave 0)))) - (when v1-48 - (let ((f0-1 (vector-vector-distance-squared (-> (the-as process-drawable v1-48) root trans) gp-2)) - (f1-3 (-> gp-2 w)) - ) - (set! s5-2 (< f0-1 (* f1-3 f1-3))) - ) - ) - ) - (suspend) - ) - ) - (talker-spawn-func (-> *talker-speech* 50) *entity-pool* (target-pos 0) (the-as region #f)) (none) ) ) @@ -523,21 +439,92 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 24 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *traffic-manager* 'decrease-alert-level 0) - (send-event *traffic-manager* 'set-alert-duration 9000) - (if (and *target* (focus-test? *target* pilot)) - (send-event *target* 'change-mode 'normal) - ) - (set-setting! 'pilot #f 0 0) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (none) - ) + (game-task-node city-krew-delivery-delivery) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (let ((gp-0 (new 'static 'vector :x 4501504.0 :y 73728.0 :z 2338816.0 :w 204800.0)) + (s5-0 #f) ) + (while (not s5-0) + (let ((v1-1 (handle->process (-> self slave 0)))) + (when v1-1 + (let ((f0-0 (vector-vector-distance-squared (-> (the-as process-drawable v1-1) root trans) gp-0)) + (f1-0 (-> gp-0 w)) + ) + (set! s5-0 (< f0-0 (* f1-0 f1-0))) + ) + ) + ) + (suspend) + ) + ) + (send-event *traffic-manager* 'set-guard-target-count-range 0 0 0) + (send-event *traffic-manager* 'set-guard-target-count-range 1 4 4) + (send-event *traffic-manager* 'set-guard-target-count-range 2 0 0) + (send-event *traffic-manager* 'set-guard-target-count-range 4 0 10) + (send-event *traffic-manager* 'set-guard-target-count-range 5 0 10) + (send-event *traffic-manager* 'set-alert-level 3) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (speech-control-method-10 *speech-control* 7 (new 'static 'speech-type-info + :channel #x1 + :priority -2 + :min-delay #x258 + :max-delay #x4b0 + :list (new 'static 'boxed-array :type string + "kg243a" + "kg241a" + "kg242a" + "kg244a" + "kg245a" + "kg246a" + "kg247a" + "kg248a" + "kg249a" + "kg250a" + "kg251a" + "kg252a" + ) + ) + ) + (talker-spawn-func (-> *talker-speech* 49) *entity-pool* (target-pos 0) (the-as region #f)) + (let ((gp-2 (new 'static 'vector :x 3358720.0 :y 32768.0 :z 4689920.0 :w 204800.0)) + (s5-2 #f) + ) + (while (not s5-2) + (let ((v1-48 (handle->process (-> self slave 0)))) + (when v1-48 + (let ((f0-1 (vector-vector-distance-squared (-> (the-as process-drawable v1-48) root trans) gp-2)) + (f1-3 (-> gp-2 w)) + ) + (set! s5-2 (< f0-1 (* f1-3 f1-3))) + ) + ) + ) + (suspend) + ) + ) + (talker-spawn-func (-> *talker-speech* 50) *entity-pool* (target-pos 0) (the-as region #f)) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-krew-delivery-delivery) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'decrease-alert-level 0) + (send-event *traffic-manager* 'set-alert-duration 9000) + (if (and *target* (focus-test? *target* pilot)) + (send-event *target* 'change-mode 'normal) + ) + (set-setting! 'pilot #f 0.0 0) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (none) + ) ) diff --git a/goal_src/jak2/levels/city/onin_tent/onin-game.gc b/goal_src/jak2/levels/city/onin_tent/onin-game.gc index 8dbb410856..60b21b4c23 100644 --- a/goal_src/jak2/levels/city/onin_tent/onin-game.gc +++ b/goal_src/jak2/levels/city/onin_tent/onin-game.gc @@ -2373,7 +2373,14 @@ ) :enter (behavior ((arg0 symbol)) (when arg0 - (add-connection *task-manager-engine* self nothing self (-> *game-info* sub-task-list 151) #f) + (add-connection + *task-manager-engine* + self + nothing + self + (-> *game-info* sub-task-list (game-task-node city-play-onin-game-resolution)) + #f + ) (let ((a1-1 (new 'stack-no-clear 'array 'pointer 3))) (set! (-> a1-1 2) (the-as pointer 'onin2)) (set! (-> a1-1 1) (the-as pointer 'onin1)) @@ -2399,18 +2406,18 @@ (talker-speech-class-method-11 (-> *talker-speech* 158)) (talker-speech-class-method-11 (-> *talker-speech* 159)) (talker-speech-class-method-11 (-> *talker-speech* 160)) - (add-setting! 'music 'danger3 0 0) - (set-setting! 'entity-name (res-lump-struct (-> self entity) 'camera-name structure) 0 0) - (set-setting! 'airlock #f 0 0) - (set-setting! 'minimap 'clear 0 128) + (add-setting! 'music 'danger3 0.0 0) + (set-setting! 'entity-name (res-lump-struct (-> self entity) 'camera-name structure) 0.0 0) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self hud-score) (ppointer->handle (process-spawn hud-big-score :init hud-init-by-other :to self))) (set! (-> self hud-goal) (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :to self))) (set! (-> self hud-miss) (ppointer->handle (process-spawn hud-miss :init hud-init-by-other :to self))) (set! (-> self game-start-time) (-> self clock frame-counter)) (send-event *target* 'draw #f) - (set-setting! 'gun #f 0 0) - (set-setting! 'calm #t 0 0) - (set-setting! 'gem #f 0 0) + (set-setting! 'gun #f 0.0 0) + (set-setting! 'calm #t 0.0 0) + (set-setting! 'gem #f 0.0 0) (let ((a0-50 (-> *part-id-table* 3429))) (when a0-50 (let ((v1-110 (get-field-spec-by-id a0-50 (sp-field-id spt-num)))) @@ -2584,7 +2591,7 @@ (set! gp-0 (-> gp-0 0 brother)) ) ) - (let* ((v1-14 (-> *game-info* sub-task-list 151)) + (let* ((v1-14 (-> *game-info* sub-task-list (game-task-node city-play-onin-game-resolution))) (gp-1 (if (-> v1-14 info) (-> v1-14 info manager) (the-as handle #f) @@ -2669,7 +2676,7 @@ (talker-spawn-func (-> *talker-speech* 162) *entity-pool* (target-pos 0) (the-as region #f)) ) ) - (v1-31 (-> *game-info* sub-task-list 151)) + (v1-31 (-> *game-info* sub-task-list (game-task-node city-play-onin-game-resolution))) (gp-4 (if (-> v1-31 info) (-> v1-31 info manager) (the-as handle #f) @@ -2710,7 +2717,7 @@ (the-as pair 0) ) (logior! (-> self skel status) (joint-control-status blend-shape eye-anim)) - (set-setting! 'minimap 'clear 0 128) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self hud-score) (the-as handle #f)) (set! (-> self hud-goal) (the-as handle #f)) (set! (-> self hud-miss) (the-as handle #f)) diff --git a/goal_src/jak2/levels/city/oracle/oracle-training.gc b/goal_src/jak2/levels/city/oracle/oracle-training.gc index 7269a55132..f18d9487c0 100644 --- a/goal_src/jak2/levels/city/oracle/oracle-training.gc +++ b/goal_src/jak2/levels/city/oracle/oracle-training.gc @@ -9,421 +9,358 @@ (set-subtask-hook! *game-info* - 251 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) - (send-event *target* 'change-mode 'darkjak #f 65) - (set! (-> self sound-id 0) - (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) - ) - (send-event *target* 'get-notify self) - (none) + (game-task-node city-oracle-level0-training) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-oracle-level0-training) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-oracle-level0-training) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if (= (-> arg3 param 1) 16) + (go-virtual complete) + ) + ) + ) + ) ) ) ) (set-subtask-hook! *game-info* - 251 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *target* 'get-pickup 7 (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) - (send-event *target* 'get-notify #f) - (set-action! - *gui-control* - (gui-action stop) - (-> self sound-id 0) - (gui-channel none) - (gui-action none) - (the-as string #f) - (the-as (function gui-connection symbol) #f) - (the-as process #f) - ) - (close! (-> self node-info) 'event) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 251 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('notify) - (case (-> arg3 param 0) - (('attack) - (if (= (-> arg3 param 1) 16) - (go-virtual complete) - ) - ) - ) - ) - ) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 251 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) - ) - (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) - (let ((gp-1 (new - 'stack - 'font-context - *font-default-matrix* - 32 - 280 - 0.0 - (font-color default) - (font-flags shadow kerning) - ) - ) + (game-task-node city-oracle-level0-training) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 + (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) ) - (set! (-> gp-1 flags) (font-flags shadow kerning large)) - (let ((v1-14 gp-1)) - (set! (-> v1-14 width) (the float 440)) - ) - (let ((v1-15 gp-1)) - (set! (-> v1-15 height) (the float 80)) - ) - (let ((v1-16 gp-1)) - (set! (-> v1-16 scale) 0.7) - ) - (let ((s5-0 print-game-text)) - (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-bomb) #f)) - (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-bomb) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) ) - (none) ) + (none) ) ) (set-subtask-hook! *game-info* - 253 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) - (send-event *target* 'change-mode 'darkjak #f 65) - (set! (-> self sound-id 0) - (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) - ) - (send-event *target* 'get-notify self) - (none) - ) + (game-task-node city-oracle-level1-training) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (none) ) ) (set-subtask-hook! *game-info* - 253 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *target* 'get-pickup 7 (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) - (send-event *target* 'get-notify #f) - (set-action! - *gui-control* - (gui-action stop) - (-> self sound-id 0) - (gui-channel none) - (gui-action none) - (the-as string #f) - (the-as (function gui-connection symbol) #f) - (the-as process #f) - ) - (close! (-> self node-info) 'event) - (none) - ) - ) + (game-task-node city-oracle-level1-training) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) ) (set-subtask-hook! *game-info* - 253 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('notify) - (case (-> arg3 param 0) - (('attack) - (if (= (-> arg3 param 1) 17) - (go-virtual complete) - ) - ) - ) - ) - ) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 253 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) - ) - (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) - (let ((gp-1 (new - 'stack - 'font-context - *font-default-matrix* - 32 - 280 - 0.0 - (font-color default) - (font-flags shadow kerning) - ) - ) + (game-task-node city-oracle-level1-training) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if (= (-> arg3 param 1) 17) + (go-virtual complete) + ) + ) + ) + ) + ) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-oracle-level1-training) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 + (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) ) - (set! (-> gp-1 flags) (font-flags shadow kerning large)) - (let ((v1-14 gp-1)) - (set! (-> v1-14 width) (the float 440)) - ) - (let ((v1-15 gp-1)) - (set! (-> v1-15 height) (the float 80)) - ) - (let ((v1-16 gp-1)) - (set! (-> v1-16 scale) 0.7) - ) - (let ((s5-0 print-game-text)) - (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-blast) #f)) - (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-blast) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) ) - (none) ) + (none) ) ) (set-subtask-hook! *game-info* - 255 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) - (send-event *target* 'change-mode 'darkjak #f 65) - (set! (-> self sound-id 0) - (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) - ) - (send-event *target* 'get-notify self) - (set! (-> self start-time) (-> self clock frame-counter)) - (none) - ) + (game-task-node city-oracle-level2-training) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (set! (-> self start-time) (-> self clock frame-counter)) + (none) ) ) (set-subtask-hook! *game-info* - 255 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *target* 'get-pickup 7 (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) - (send-event *target* 'get-notify #f) - (set-action! - *gui-control* - (gui-action stop) - (-> self sound-id 0) - (gui-channel none) - (gui-action none) - (the-as string #f) - (the-as (function gui-connection symbol) #f) - (the-as process #f) - ) - (close! (-> self node-info) 'event) - (none) - ) - ) + (game-task-node city-oracle-level2-training) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) ) (set-subtask-hook! *game-info* - 255 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) - ) - (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) - (let ((gp-1 (new - 'stack - 'font-context - *font-default-matrix* - 32 - 280 - 0.0 - (font-color default) - (font-flags shadow kerning) - ) - ) + (game-task-node city-oracle-level2-training) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 + (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) ) - (set! (-> gp-1 flags) (font-flags shadow kerning large)) - (let ((v1-14 gp-1)) - (set! (-> v1-14 width) (the float 440)) - ) - (let ((v1-15 gp-1)) - (set! (-> v1-15 height) (the float 80)) - ) - (let ((v1-16 gp-1)) - (set! (-> v1-16 scale) 0.7) - ) - (let ((s5-0 print-game-text)) - (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-invincible) #f)) - (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-invincible) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) ) - (none) ) + (none) ) ) (set-subtask-hook! *game-info* - 257 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) - (send-event *target* 'change-mode 'darkjak #f 65) - (set! (-> self sound-id 0) - (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) - ) - (send-event *target* 'get-notify self) - (none) - ) + (game-task-node city-oracle-level3-training) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (none) ) ) (set-subtask-hook! *game-info* - 257 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *target* 'get-pickup 7 (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) - (send-event *target* 'get-notify #f) - (set-action! - *gui-control* - (gui-action stop) - (-> self sound-id 0) - (gui-channel none) - (gui-action none) - (the-as string #f) - (the-as (function gui-connection symbol) #f) - (the-as process #f) - ) - (close! (-> self node-info) 'event) - (none) - ) - ) + (game-task-node city-oracle-level3-training) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) ) (set-subtask-hook! *game-info* - 257 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('notify) - (case (-> arg3 param 0) - (('attack) - (if (= (-> arg3 param 1) 18) - #f - ) - ) - ) - ) - ) - ) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 257 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) - ) - (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) - (let ((gp-1 (new - 'stack - 'font-context - *font-default-matrix* - 32 - 280 - 0.0 - (font-color default) - (font-flags shadow kerning) + (game-task-node city-oracle-level3-training) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (the-as object (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if (= (-> arg3 param 1) 18) + #f + ) + ) + ) ) - ) + ) + ) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-oracle-level3-training) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 + (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) ) - (set! (-> gp-1 flags) (font-flags shadow kerning large)) - (let ((v1-14 gp-1)) - (set! (-> v1-14 width) (the float 440)) - ) - (let ((v1-15 gp-1)) - (set! (-> v1-15 height) (the float 80)) - ) - (let ((v1-16 gp-1)) - (set! (-> v1-16 scale) 0.7) - ) - (let ((s5-0 print-game-text)) - (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-giant) #f)) - (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-giant) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) ) - (none) ) + (none) ) ) diff --git a/goal_src/jak2/levels/city/port/mines/portrun.gc b/goal_src/jak2/levels/city/port/mines/portrun.gc index 0c671910bb..127790f500 100644 --- a/goal_src/jak2/levels/city/port/mines/portrun.gc +++ b/goal_src/jak2/levels/city/port/mines/portrun.gc @@ -224,27 +224,24 @@ (set-subtask-hook! *game-info* - 119 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (while (or (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 30)) - (let ((a0-3 (level-get-target-inside *level*))) - (when (not (and a0-3 (logtest? (-> a0-3 info level-flags) 1))) - (set! (-> self state-time) (-> self clock frame-counter)) - #t - ) + (game-task-node city-port-run-introduction) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (or (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 30)) + (let ((a0-3 (level-get-target-inside *level*))) + (when (not (and a0-3 (logtest? (-> a0-3 info level-flags) 1))) + (set! (-> self state-time) (-> self clock frame-counter)) + #t ) ) - (suspend) - ) - (talker-spawn-func (-> *talker-speech* 93) *entity-pool* (target-pos 0) (the-as region #f)) - (send-event self 'complete) - (none) + ) + (suspend) ) + (talker-spawn-func (-> *talker-speech* 93) *entity-pool* (target-pos 0) (the-as region #f)) + (send-event self 'complete) + (none) ) ) @@ -1520,8 +1517,8 @@ (none) ) :code (behavior () - (set-setting! 'interp-time 'abs 0 0) - (set-setting! 'mode-name 'cam-fixed 0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'mode-name 'cam-fixed 0.0 0) (suspend) (ctyport-cargo-method-30 self) (ja-no-eval :group! (ja-group) @@ -1657,315 +1654,306 @@ (set-subtask-hook! *game-info* - 120 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (if (task-node-closed? (game-task-node city-port-run-resolution)) - (go-virtual complete) + (game-task-node city-port-run-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (if (task-node-closed? (game-task-node city-port-run-resolution)) + (go-virtual complete) + ) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) + (let ((gp-0 *traffic-manager*) + (s5-0 (new 'stack 'traffic-object-spawn-params)) ) - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) - (let ((gp-0 *traffic-manager*) - (s5-0 (new 'stack 'traffic-object-spawn-params)) - ) - (set! (-> s5-0 position quad) (-> self begin-pos quad)) - (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 0.0) - (set! (-> s5-0 object-type) (traffic-type bikec)) - (set! (-> s5-0 behavior) (the-as uint 0)) - (set! (-> s5-0 id) (the-as uint 0)) - (set! (-> s5-0 proc) #f) - (send-event gp-0 'spawn-object s5-0) - ) - (set! (-> self max-count) (-> *city-port-run-cargo-info* length)) - (set! (-> self count) (-> self max-count)) - (set! (-> *game-info* counter) (the float (-> self max-count))) - (dotimes (v1-17 (-> *city-port-run-mine-info* length)) - (set! (-> *city-port-run-mine-info* v1-17 handle) (the-as handle #f)) - ) - (set! (-> self minimap 0) #f) - (dotimes (v1-20 (-> self max-count)) - (set! (-> self data-int32 v1-20) 0) - (set! (-> self slave v1-20) (the-as handle #f)) - ) - (set! (-> self data-int32 20) 0) - (set! (-> self data-int32 21) 0) - (set! (-> self data-int32 22) 0) - 0 - (none) + (set! (-> s5-0 position quad) (-> self begin-pos quad)) + (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 0.0) + (set! (-> s5-0 object-type) (traffic-type bikec)) + (set! (-> s5-0 behavior) (the-as uint 0)) + (set! (-> s5-0 id) (the-as uint 0)) + (set! (-> s5-0 proc) #f) + (send-event gp-0 'spawn-object s5-0) ) + (set! (-> self max-count) (-> *city-port-run-cargo-info* length)) + (set! (-> self count) (-> self max-count)) + (set! (-> *game-info* counter) (the float (-> self max-count))) + (dotimes (v1-17 (-> *city-port-run-mine-info* length)) + (set! (-> *city-port-run-mine-info* v1-17 handle) (the-as handle #f)) + ) + (set! (-> self minimap 0) #f) + (dotimes (v1-20 (-> self max-count)) + (set! (-> self data-int32 v1-20) 0) + (set! (-> self slave v1-20) (the-as handle #f)) + ) + (set! (-> self data-int32 20) 0) + (set! (-> self data-int32 21) 0) + (set! (-> self data-int32 22) 0) + 0 + (none) ) ) (set-subtask-hook! *game-info* - 120 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *traffic-manager* 'restore-default-settings) - (dotimes (v1-3 (-> *city-port-run-mine-info* length)) - (set! (-> *city-port-run-mine-info* v1-3 handle) (the-as handle #f)) - ) - (set! (-> self minimap 0) #f) - (dotimes (v1-6 (-> self max-count)) - (set! (-> self data-int32 v1-6) 0) - (set! (-> self slave v1-6) (the-as handle #f)) - ) - (none) - ) - ) + (game-task-node city-port-run-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'restore-default-settings) + (dotimes (v1-3 (-> *city-port-run-mine-info* length)) + (set! (-> *city-port-run-mine-info* v1-3 handle) (the-as handle #f)) + ) + (set! (-> self minimap 0) #f) + (dotimes (v1-6 (-> self max-count)) + (set! (-> self data-int32 v1-6) 0) + (set! (-> self slave v1-6) (the-as handle #f)) + ) + (none) + ) ) (set-subtask-hook! *game-info* - 120 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (task-node-open? (game-task-node city-port-run-resolution)) - (check-time self) - (cond - ((= (level-status *level* 'ctyport) 'active) - (when (zero? (-> self data-int32 21)) - (set! (-> self data-int32 21) 1) - (dotimes (gp-1 (-> *city-port-run-mine-info* length)) - (let ((a1-1 (-> *city-port-run-mine-info* gp-1))) - (if (or (zero? (-> a1-1 handle)) (not (handle->process (-> a1-1 handle)))) - (ctyport-mine-spawn self a1-1) - ) - ) + (game-task-node city-port-run-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (when (task-node-open? (game-task-node city-port-run-resolution)) + (check-time self) + (cond + ((= (level-status *level* 'ctyport) 'active) + (when (zero? (-> self data-int32 21)) + (set! (-> self data-int32 21) 1) + (dotimes (gp-1 (-> *city-port-run-mine-info* length)) + (let ((a1-1 (-> *city-port-run-mine-info* gp-1))) + (if (or (zero? (-> a1-1 handle)) (not (handle->process (-> a1-1 handle)))) + (ctyport-mine-spawn self a1-1) + ) ) ) ) - (else - (dotimes (gp-2 (-> *city-port-run-mine-info* length)) - (let ((s5-0 (-> *city-port-run-mine-info* gp-2))) - (when (and (nonzero? (-> s5-0 handle)) (handle->process (-> s5-0 handle))) - (deactivate (-> s5-0 handle process 0)) - (set! (-> s5-0 handle) (the-as handle #f)) - ) + ) + (else + (dotimes (gp-2 (-> *city-port-run-mine-info* length)) + (let ((s5-0 (-> *city-port-run-mine-info* gp-2))) + (when (and (nonzero? (-> s5-0 handle)) (handle->process (-> s5-0 handle))) + (deactivate (-> s5-0 handle process 0)) + (set! (-> s5-0 handle) (the-as handle #f)) ) ) ) ) - (cond - ((zero? (-> self data-int32 20)) - (cond - ((= (level-status *level* 'ctyport) 'active) - (let ((gp-4 (get-nav-mesh (the-as actor-id #x65e1)))) - (dotimes (s5-1 (-> self max-count)) - (cond - ((zero? (-> self data-int32 s5-1)) - (when (not (-> self slave s5-1)) - (let ((a0-18 (ctyport-cargo-spawn self (-> *city-port-run-cargo-info* s5-1 pos) gp-4))) - (if a0-18 - (set! (-> self slave s5-1) (process->handle a0-18)) - ) - ) + ) + (cond + ((zero? (-> self data-int32 20)) + (cond + ((= (level-status *level* 'ctyport) 'active) + (let ((gp-4 (get-nav-mesh (the-as actor-id #x65e1)))) + (dotimes (s5-1 (-> self max-count)) + (cond + ((zero? (-> self data-int32 s5-1)) + (when (not (-> self slave s5-1)) + (let ((a0-18 (ctyport-cargo-spawn self (-> *city-port-run-cargo-info* s5-1 pos) gp-4))) + (if a0-18 + (set! (-> self slave s5-1) (process->handle a0-18)) + ) ) ) - (else - (set! (-> self slave s5-1) (the-as handle #f)) - ) + ) + (else + (set! (-> self slave s5-1) (the-as handle #f)) ) ) ) - (set! (-> self count) 0) - (dotimes (v1-61 (-> self max-count)) - (if (or (not (-> self slave v1-61)) (handle->process (-> self slave v1-61))) - (+! (-> self count) 1) - (set! (-> self data-int32 v1-61) 1) - ) - ) - (when (-> self minimap 0) - (logior! (-> self minimap 0 flags) (minimap-flag fade-out)) - (set! (-> self minimap 0) #f) - ) ) - (else - (dotimes (gp-5 (-> self max-count)) - (when (-> self slave gp-5) - (deactivate (-> self slave gp-5 process 0)) - (set! (-> self slave gp-5) (the-as handle #f)) - ) - ) - (set! (-> self data-int32 21) 0) - (if (not (-> self minimap 0)) - (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 15) (the-as int #f) *city-port-position* 0)) - ) - ) - ) - ) - (else (set! (-> self count) 0) - (dotimes (v1-90 (-> self max-count)) - (if (handle->process (-> self slave v1-90)) + (dotimes (v1-61 (-> self max-count)) + (if (or (not (-> self slave v1-61)) (handle->process (-> self slave v1-61))) (+! (-> self count) 1) - (set! (-> self data-int32 v1-90) 1) + (set! (-> self data-int32 v1-61) 1) ) ) - ) - ) - (let ((v1-93 0)) - (dotimes (a0-48 (-> *city-port-run-mine-info* length)) - (let ((a1-21 (-> *city-port-run-mine-info* a0-48))) - (if (and (nonzero? (-> a1-21 handle)) (handle->process (-> a1-21 handle))) - (+! v1-93 1) - ) + (when (-> self minimap 0) + (logior! (-> self minimap 0 flags) (minimap-flag fade-out)) + (set! (-> self minimap 0) #f) ) ) - ) - (cond - ((and (= (-> self count) (-> self max-count)) (zero? (-> self data-int32 22))) - (set! (-> self state-time) (-> self clock frame-counter)) - ) - ((and (or (and (zero? (-> self data-int32 20)) (= (-> self count) (+ (-> self max-count) -1))) - (= (-> self data-int32 22) 1) - ) - (task-node-open? (game-task-node city-port-run-resolution)) - ) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set! (-> self data-int32 20) 1) - (+! (-> self data-int32 22) 1) - (set! (-> self time-limit) (seconds 135)) - (set! (-> self start-time) (-> self clock frame-counter)) - (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-cargo :init hud-init-by-other :to self))) - ) - ) - (set! (-> *game-info* counter) (the float (-> self count))) - (when (= (-> self data-int32 20) 1) - (let ((v1-130 (level-get *level* 'ctyport))) - (when (or (not v1-130) (!= (-> v1-130 display?) 'display)) - (backup-load-state-and-set-cmds *load-state* '()) - (script-eval '(want-display 'ctyport 'display)) - (restore-load-state-and-cleanup *load-state*) - (go-virtual fail) - ) - ) - ) - ) - (when (zero? (-> self count)) - (cond - ((not (task-node-closed? (game-task-node city-port-run-resolution))) - (talker-spawn-func (-> *talker-speech* 94) *entity-pool* (target-pos 0) (the-as region #f)) - (task-node-close! (game-task-node city-port-run-resolution)) - (send-event (handle->process (-> self hud-timer)) 'hide-and-die) - (send-event (handle->process (-> self hud-counter)) 'hide-and-die) - (set! (-> self fail-on-death?) #f) - (dotimes (gp-8 (-> *city-port-run-mine-info* length)) - (let ((v1-161 (-> *city-port-run-mine-info* gp-8))) - (if (handle->process (-> v1-161 handle)) - (send-event (handle->process (-> v1-161 handle)) 'fall) - ) + (else + (dotimes (gp-5 (-> self max-count)) + (when (-> self slave gp-5) + (deactivate (-> self slave gp-5 process 0)) + (set! (-> self slave gp-5) (the-as handle #f)) + ) ) + (set! (-> self data-int32 21) 0) + (if (not (-> self minimap 0)) + (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 15) (the-as int #f) *city-port-position* 0)) + ) ) ) - (else - (let ((v1-168 0)) - (dotimes (a0-96 (-> *city-port-run-mine-info* length)) - (if (handle->process (-> *city-port-run-mine-info* a0-96 handle)) - (+! v1-168 1) - ) + ) + (else + (set! (-> self count) 0) + (dotimes (v1-90 (-> self max-count)) + (if (handle->process (-> self slave v1-90)) + (+! (-> self count) 1) + (set! (-> self data-int32 v1-90) 1) ) - (if (zero? v1-168) - (go-virtual complete) - ) - ) ) ) ) - (none) - ) - ) - ) - -(set-subtask-hook! *game-info* 120 6 (the-as (function object) (lambda :behavior task-manager - ((arg0 object) (arg1 object) (arg2 symbol)) - (case arg2 - (('mine-dead) - (format #t "mine-dead~%") - (+! (-> self data-int32 22) 1) - ) - ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 120 - 3 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *traffic-manager* 'set-target-level #x3f800000) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) - (suspend) - ) - (send-event *traffic-manager* 'set-alert-level 1) - (send-event *traffic-manager* 'set-alert-duration #xa4cb80) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 120 - 5 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (< (- (-> self time-limit) (- (-> self clock frame-counter) (-> self start-time))) 0) - (let ((gp-0 #f)) - (dotimes (s5-0 (-> self max-count)) - (when (zero? (-> self data-int32 s5-0)) - (when (-> self slave s5-0) - (let* ((s3-0 (handle->process (-> self slave s5-0))) - (s4-0 (if (type? s3-0 process-focusable) - s3-0 - ) - ) - ) - (when (not gp-0) - (set! gp-0 #t) - (send-event s4-0 'focus-camera) - ) - (send-event s4-0 'spy) - ) + (let ((v1-93 0)) + (dotimes (a0-48 (-> *city-port-run-mine-info* length)) + (let ((a1-21 (-> *city-port-run-mine-info* a0-48))) + (if (and (nonzero? (-> a1-21 handle)) (handle->process (-> a1-21 handle))) + (+! v1-93 1) ) - ) - ) - ) - (let ((gp-1 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-1) (seconds 2)) - (suspend) ) ) ) - (none) + (cond + ((and (= (-> self count) (-> self max-count)) (zero? (-> self data-int32 22))) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + ((and (or (and (zero? (-> self data-int32 20)) (= (-> self count) (+ (-> self max-count) -1))) + (= (-> self data-int32 22) 1) + ) + (task-node-open? (game-task-node city-port-run-resolution)) + ) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self data-int32 20) 1) + (+! (-> self data-int32 22) 1) + (set! (-> self time-limit) (seconds 135)) + (set! (-> self start-time) (-> self clock frame-counter)) + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-cargo :init hud-init-by-other :to self))) + ) + ) + (set! (-> *game-info* counter) (the float (-> self count))) + (when (= (-> self data-int32 20) 1) + (let ((v1-130 (level-get *level* 'ctyport))) + (when (or (not v1-130) (!= (-> v1-130 display?) 'display)) + (backup-load-state-and-set-cmds *load-state* '()) + (script-eval '(want-display 'ctyport 'display)) + (restore-load-state-and-cleanup *load-state*) + (go-virtual fail) + ) + ) + ) ) + (when (zero? (-> self count)) + (cond + ((not (task-node-closed? (game-task-node city-port-run-resolution))) + (talker-spawn-func (-> *talker-speech* 94) *entity-pool* (target-pos 0) (the-as region #f)) + (task-node-close! (game-task-node city-port-run-resolution)) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (set! (-> self fail-on-death?) #f) + (dotimes (gp-8 (-> *city-port-run-mine-info* length)) + (let ((v1-161 (-> *city-port-run-mine-info* gp-8))) + (if (handle->process (-> v1-161 handle)) + (send-event (handle->process (-> v1-161 handle)) 'fall) + ) + ) + ) + ) + (else + (let ((v1-168 0)) + (dotimes (a0-96 (-> *city-port-run-mine-info* length)) + (if (handle->process (-> *city-port-run-mine-info* a0-96 handle)) + (+! v1-168 1) + ) + ) + (if (zero? v1-168) + (go-virtual complete) + ) + ) + ) + ) + ) + (none) ) ) (set-subtask-hook! *game-info* - 120 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) - (suspend) - ) - (task-node-close! (game-task-node city-port-run-post-win)) - (none) - ) - ) + (game-task-node city-port-run-resolution) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 object) (arg1 object) (arg2 symbol)) + (case arg2 + (('mine-dead) + (format #t "mine-dead~%") + (+! (-> self data-int32 22) 1) + ) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-port-run-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'set-target-level #x3f800000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (send-event *traffic-manager* 'set-alert-level 1) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-port-run-resolution) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager + () + (when (< (- (-> self time-limit) (- (-> self clock frame-counter) (-> self start-time))) 0) + (let ((gp-0 #f)) + (dotimes (s5-0 (-> self max-count)) + (when (zero? (-> self data-int32 s5-0)) + (when (-> self slave s5-0) + (let* ((s3-0 (handle->process (-> self slave s5-0))) + (s4-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when (not gp-0) + (set! gp-0 #t) + (send-event s4-0 'focus-camera) + ) + (send-event s4-0 'spy) + ) + ) + ) + ) + ) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 2)) + (suspend) + ) + ) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-port-run-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (suspend) + ) + (task-node-close! (game-task-node city-port-run-post-win)) + (none) + ) ) diff --git a/goal_src/jak2/levels/city/port/race/errol-chal.gc b/goal_src/jak2/levels/city/port/race/errol-chal.gc index 304d9f7ff4..2c21742c2c 100644 --- a/goal_src/jak2/levels/city/port/race/errol-chal.gc +++ b/goal_src/jak2/levels/city/port/race/errol-chal.gc @@ -1139,172 +1139,162 @@ (set-subtask-hook! *game-info* - 189 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (let ((gp-0 *traffic-manager*)) - (send-event gp-0 'set-target-level #x3e800000) - (send-event gp-0 'set-guard-target-count-range 0 0 0) - (send-event gp-0 'set-guard-target-count-range 1 0 0) - (send-event gp-0 'set-guard-target-count-range 2 0 0) - (send-event gp-0 'set-guard-target-count-range 3 0 0) - (send-event gp-0 'set-guard-target-count-range 4 0 1) - (send-event gp-0 'set-guard-target-count-range 5 0 0) - ) - (until (= (level-status *level* 'ctyport) 'active) - (suspend) - ) - (let ((v1-43 (entity-by-name "parking-spot-20"))) - (if v1-43 - (logior! (-> v1-43 extra perm status) (entity-perm-status bit-9)) - ) - ) - (set! (-> self start-time) 0) - (set! (-> self sub-state) (the-as uint 0)) - (set! (-> self count) 0) - (set! (-> self max-count) -1) - (race-start (-> self info index) (the-as symbol self) #f) - (set! (-> self begin-pos quad) - (-> (new 'static 'vector :x -326041.6 :y 36454.4 :z 5391565.0 :w 266240.0) quad) - ) - (set-setting! 'attack #f 0 0) - (set-setting! 'board #f 0 0) - (set-setting! 'gun #f 0 0) - (set-setting! 'vehicle-hijacking #f 0 0) - (none) + (game-task-node city-errol-challenge-race) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-target-level #x3e800000) + (send-event gp-0 'set-guard-target-count-range 0 0 0) + (send-event gp-0 'set-guard-target-count-range 1 0 0) + (send-event gp-0 'set-guard-target-count-range 2 0 0) + (send-event gp-0 'set-guard-target-count-range 3 0 0) + (send-event gp-0 'set-guard-target-count-range 4 0 1) + (send-event gp-0 'set-guard-target-count-range 5 0 0) ) + (until (= (level-status *level* 'ctyport) 'active) + (suspend) + ) + (let ((v1-43 (entity-by-name "parking-spot-20"))) + (if v1-43 + (logior! (-> v1-43 extra perm status) (entity-perm-status bit-9)) + ) + ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self count) 0) + (set! (-> self max-count) -1) + (race-start (-> self info index) (the-as symbol self) #f) + (set! (-> self begin-pos quad) + (-> (new 'static 'vector :x -326041.6 :y 36454.4 :z 5391565.0 :w 266240.0) quad) + ) + (set-setting! 'attack #f 0.0 0) + (set-setting! 'board #f 0.0 0) + (set-setting! 'gun #f 0.0 0) + (set-setting! 'vehicle-hijacking #f 0.0 0) + (none) ) ) (set-subtask-hook! *game-info* - 189 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) + (game-task-node city-errol-challenge-race) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) ) (set-subtask-hook! *game-info* - 189 - 6 - (the-as - (function object) - (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('turbo-ring-pickup) - (let ((gp-0 (-> arg3 param 0))) - (format #t "player collected ring ~d~%" gp-0) - (cond - ((= gp-0 (-> self sub-state)) - (let ((v0-0 (the-as object (+ (-> self sub-state) 1)))) - (set! (-> self sub-state) (the-as uint v0-0)) - v0-0 - ) + (game-task-node city-errol-challenge-race) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('turbo-ring-pickup) + (let ((gp-0 (-> arg3 param 0))) + (format #t "player collected ring ~d~%" gp-0) + (cond + ((= gp-0 (-> self sub-state)) + (let ((v0-0 (the-as object (+ (-> self sub-state) 1)))) + (set! (-> self sub-state) (the-as uint v0-0)) + v0-0 ) - ((< (the-as int gp-0) (the-as int (-> self sub-state))) - (format #t "player re-collecting an earlier ring (~d)~%" gp-0) - ) - (else - (format #t "missed a ring (ring-id ~d, sub-state ~d)~%" gp-0 (-> self sub-state)) - (go-virtual fail) - ) + ) + ((< (the-as int gp-0) (the-as int (-> self sub-state))) + (format #t "player re-collecting an earlier ring (~d)~%" gp-0) + ) + (else + (format #t "missed a ring (ring-id ~d, sub-state ~d)~%" gp-0 (-> self sub-state)) + (go-virtual fail) ) ) ) - ) + ) ) ) ) (set-subtask-hook! *game-info* - 189 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 1)) - (s5-0 *city-errol-challenge-rings*) - ) - (if (= (-> self max-count) -1) - (set! (-> self max-count) (-> s5-0 length)) - ) - (set! (-> gp-0 0 quad) (-> (target-pos 0) quad)) - (let* ((s4-1 (new 'static 'vector :x 1305804.8 :y 102400.0 :z 3180544.0 :w 163840.0)) - (f0-0 (vector-vector-distance-squared s4-1 (-> gp-0 0))) - (f1-0 (-> s4-1 w)) - ) - (when (< f0-0 (* f1-0 f1-0)) - (if (< (-> self count) 18) - (go-virtual fail) - ) - ) + (game-task-node city-errol-challenge-race) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 1)) + (s5-0 *city-errol-challenge-rings*) ) - (while (< (-> self count) (-> self max-count)) - (let ((s4-2 (-> s5-0 (-> self count)))) - (let ((f0-1 (-> s4-2 dist))) - (b! (< (* f0-1 f0-1) (vector-vector-distance-squared (-> gp-0 0) (-> s4-2 pos))) cfg-11) - ) - (if (turbo-ring-spawn self s4-2 (-> self count) #f) - (+! (-> self count) 1) - ) - ) + (if (= (-> self max-count) -1) + (set! (-> self max-count) (-> s5-0 length)) ) - ) - (label cfg-11) - 0 - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 189 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (while (not (logtest? (-> *race-state* flags) 1)) - (let ((f0-0 (-> self begin-pos w))) - (if (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))) + (set! (-> gp-0 0 quad) (-> (target-pos 0) quad)) + (let* ((s4-1 (new 'static 'vector :x 1305804.8 :y 102400.0 :z 3180544.0 :w 163840.0)) + (f0-0 (vector-vector-distance-squared s4-1 (-> gp-0 0))) + (f1-0 (-> s4-1 w)) + ) + (when (< f0-0 (* f1-0 f1-0)) + (if (< (-> self count) 18) (go-virtual fail) ) ) - (suspend) ) - (set-setting! 'exclusive-load 'lerlchal 0 0) - (set-setting! 'airlock #f 0 0) - (none) + (while (< (-> self count) (-> self max-count)) + (let ((s4-2 (-> s5-0 (-> self count)))) + (let ((f0-1 (-> s4-2 dist))) + (b! (< (* f0-1 f0-1) (vector-vector-distance-squared (-> gp-0 0) (-> s4-2 pos))) cfg-11) + ) + (if (turbo-ring-spawn self s4-2 (-> self count) #f) + (+! (-> self count) 1) + ) + ) + ) ) + (label cfg-11) + 0 + (none) ) ) -(set-subtask-hook! *game-info* 189 5 (the-as (function object) (lambda :behavior task-manager () (none)))) - (set-subtask-hook! *game-info* - 189 - 4 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'decrease-alert-level 0) (none)) + (game-task-node city-errol-challenge-race) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (not (logtest? (-> *race-state* flags) 1)) + (let ((f0-0 (-> self begin-pos w))) + (if (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))) + (go-virtual fail) + ) + ) + (suspend) + ) + (set-setting! 'exclusive-load 'lerlchal 0.0 0) + (set-setting! 'airlock #f 0.0 0) + (none) ) ) -(copy-hooks! (-> *game-info* sub-task-list 307) (-> *game-info* sub-task-list 189)) +(set-subtask-hook! + *game-info* + (game-task-node city-errol-challenge-race) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager () (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-errol-challenge-race) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'decrease-alert-level 0) (none)) + ) + +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-race-errol-resolution)) + (-> *game-info* sub-task-list (game-task-node city-errol-challenge-race)) + ) (define *city-bush-port-rings* (new 'static 'boxed-array :type city-race-ring-info (new 'static 'city-race-ring-info @@ -1387,147 +1377,138 @@ (set-subtask-hook! *game-info* - 309 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set-setting! 'exclusive-load 'lprtrace 0 0) - (set-setting! 'airlock #f 0 0) - (let ((gp-0 *traffic-manager*)) - (send-event gp-0 'set-target-level #x3e800000) - (send-event gp-0 'set-guard-target-count-range 0 0 0) - (send-event gp-0 'set-guard-target-count-range 1 0 0) - (send-event gp-0 'set-guard-target-count-range 2 0 0) - (send-event gp-0 'set-guard-target-count-range 3 0 0) - (send-event gp-0 'set-guard-target-count-range 4 0 1) - (send-event gp-0 'set-guard-target-count-range 5 0 0) - ) - (until (= (level-status *level* 'ctyport) 'active) - (suspend) - ) - (let ((v1-47 (entity-by-name "parking-spot-22"))) - (if v1-47 - (logior! (-> v1-47 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-49 (entity-by-name "parking-spot-23"))) - (if v1-49 - (logior! (-> v1-49 extra perm status) (entity-perm-status bit-9)) - ) - ) - (set! (-> self start-time) 0) - (set! (-> self sub-state) (the-as uint 0)) - (set! (-> self count) 0) - (let ((gp-2 *city-bush-port-rings*)) - (set! (-> self max-count) (-> gp-2 length)) - (dotimes (s5-0 (-> self max-count)) - (let ((a1-12 (-> gp-2 s5-0))) - (if (turbo-ring-spawn self a1-12 s5-0 #t) - (+! (-> self count) 1) - ) - ) - ) - ) - (race-start (-> self info index) (the-as symbol self) #f) - (set! (-> self begin-pos quad) - (-> (new 'static 'vector :x 2519040.0 :y 40960.0 :z 6545408.0 :w 184320.0) quad) - ) - (set-setting! 'attack #f 0 0) - (set-setting! 'board #f 0 0) - (set-setting! 'gun #f 0 0) - (set-setting! 'vehicle-hijacking #f 0 0) - (none) + (game-task-node city-burning-bush-race-port-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set-setting! 'exclusive-load 'lprtrace 0.0 0) + (set-setting! 'airlock #f 0.0 0) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-target-level #x3e800000) + (send-event gp-0 'set-guard-target-count-range 0 0 0) + (send-event gp-0 'set-guard-target-count-range 1 0 0) + (send-event gp-0 'set-guard-target-count-range 2 0 0) + (send-event gp-0 'set-guard-target-count-range 3 0 0) + (send-event gp-0 'set-guard-target-count-range 4 0 1) + (send-event gp-0 'set-guard-target-count-range 5 0 0) ) - ) - ) - -(set-subtask-hook! - *game-info* - 309 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) - ) - -(set-subtask-hook! - *game-info* - 309 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('race-win 'race-lose) - (let ((v0-0 1)) - (set! (-> self sub-state) (the-as uint v0-0)) - v0-0 - ) - ) - ) - ) - ) + (until (= (level-status *level* 'ctyport) 'active) + (suspend) + ) + (let ((v1-47 (entity-by-name "parking-spot-22"))) + (if v1-47 + (logior! (-> v1-47 extra perm status) (entity-perm-status bit-9)) ) - ) - -(set-subtask-hook! - *game-info* - 309 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (while (not (logtest? (-> *race-state* flags) 1)) - (let ((f0-0 (-> self begin-pos w))) - (if (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))) - (go-virtual fail) + ) + (let ((v1-49 (entity-by-name "parking-spot-23"))) + (if v1-49 + (logior! (-> v1-49 extra perm status) (entity-perm-status bit-9)) + ) + ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self count) 0) + (let ((gp-2 *city-bush-port-rings*)) + (set! (-> self max-count) (-> gp-2 length)) + (dotimes (s5-0 (-> self max-count)) + (let ((a1-12 (-> gp-2 s5-0))) + (if (turbo-ring-spawn self a1-12 s5-0 #t) + (+! (-> self count) 1) ) ) - (suspend) ) - (none) ) - ) - ) - -(set-subtask-hook! - *game-info* - 309 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (when (zero? (-> self sub-state)) - (let ((v1-2 (-> *target* pilot))) - (when (nonzero? v1-2) - (let ((v1-4 (handle->process (-> v1-2 vehicle)))) - (when v1-4 - (if (< (-> (the-as process-drawable v1-4) root trans y) 16384.0) - (go-virtual fail) - ) - ) - ) - ) - ) - ) - (none) - ) + (race-start (-> self info index) (the-as symbol self) #f) + (set! (-> self begin-pos quad) + (-> (new 'static 'vector :x 2519040.0 :y 40960.0 :z 6545408.0 :w 184320.0) quad) ) + (set-setting! 'attack #f 0.0 0) + (set-setting! 'board #f 0.0 0) + (set-setting! 'gun #f 0.0 0) + (set-setting! 'vehicle-hijacking #f 0.0 0) + (none) + ) ) -(set-subtask-hook! *game-info* 309 5 (the-as (function object) (lambda :behavior task-manager () (none)))) - (set-subtask-hook! *game-info* - 309 - 4 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'decrease-alert-level 0) (none)) + (game-task-node city-burning-bush-race-port-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-race-port-resolution) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (the-as object (case arg2 + (('race-win 'race-lose) + (let ((v0-0 1)) + (set! (-> self sub-state) (the-as uint v0-0)) + v0-0 + ) + ) + ) + ) ) ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-race-port-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (not (logtest? (-> *race-state* flags) 1)) + (let ((f0-0 (-> self begin-pos w))) + (if (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))) + (go-virtual fail) + ) + ) + (suspend) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-race-port-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (when (zero? (-> self sub-state)) + (let ((v1-2 (-> *target* pilot))) + (when (nonzero? v1-2) + (let ((v1-4 (handle->process (-> v1-2 vehicle)))) + (when v1-4 + (if (< (-> (the-as process-drawable v1-4) root trans y) 16384.0) + (go-virtual fail) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-race-port-resolution) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager () (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-race-port-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'decrease-alert-level 0) (none)) + ) diff --git a/goal_src/jak2/levels/city/side_missions/ctywide-bbush.gc b/goal_src/jak2/levels/city/side_missions/ctywide-bbush.gc index 0e6f6c4c4c..32411b928c 100644 --- a/goal_src/jak2/levels/city/side_missions/ctywide-bbush.gc +++ b/goal_src/jak2/levels/city/side_missions/ctywide-bbush.gc @@ -1426,119 +1426,115 @@ (set-subtask-hook! *game-info* - 259 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set-setting! 'airlock #f 0 0) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (let ((s5-0 *traffic-manager*) - (gp-0 (new 'stack 'traffic-object-spawn-params)) - ) - (set! (-> gp-0 position quad) (-> *bb-ring-info* (-> self info index) start-pos quad)) - (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 (-> *bb-ring-info* (-> self info index) rotation)) - (set! (-> gp-0 object-type) (traffic-type bikea)) - (set! (-> gp-0 behavior) (the-as uint 0)) - (set! (-> gp-0 id) (the-as uint 0)) - (set! (-> gp-0 proc) #f) - (send-event s5-0 'spawn-object gp-0) - (if (-> gp-0 proc) - (set! (-> self slave 1) (process->handle (-> gp-0 proc))) - ) - ) - (set! (-> self start-time) 0) - (set! (-> self sub-state) (the-as uint 0)) - (set! (-> self count) 0) - (set! (-> self max-count) (-> *bb-ring-info* (-> self info index) rings length)) - (none) + (game-task-node city-burning-bush-ring-1-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (let ((s5-0 *traffic-manager*) + (gp-0 (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> gp-0 position quad) (-> *bb-ring-info* (-> self info index) start-pos quad)) + (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 (-> *bb-ring-info* (-> self info index) rotation)) + (set! (-> gp-0 object-type) (traffic-type bikea)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 proc) #f) + (send-event s5-0 'spawn-object gp-0) + (if (-> gp-0 proc) + (set! (-> self slave 1) (process->handle (-> gp-0 proc))) + ) ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self count) 0) + (set! (-> self max-count) (-> *bb-ring-info* (-> self info index) rings length)) + (none) ) ) (set-subtask-hook! *game-info* - 259 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) + (game-task-node city-burning-bush-ring-1-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) ) (set-subtask-hook! *game-info* - 259 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (check-time self) - (cond - ((and (handle->process (-> self slave 0)) - (-> self slave 0 process 0 next-state) - (= (-> self slave 0 process 0 next-state name) 'idle) - ) - ) - (else - (let ((v1-15 (-> self sub-state))) - (cond - ((< v1-15 (the-as uint (-> self max-count))) - (let* ((a1-2 (-> *bb-ring-info* (-> self info index) rings v1-15)) - (a0-14 (race-ring-spawn self a1-2)) - ) - (when a0-14 - (set! (-> self slave 0) (process->handle a0-14)) - (set! (-> self time-limit) (the-as time-frame (if (zero? (-> self sub-state)) - 4500 - (the-as int (-> *bb-ring-info* (-> self info index) time)) - ) - ) - ) - (set! (-> self start-time) (-> self clock frame-counter)) - (+! (-> self sub-state) 1) - ) + (game-task-node city-burning-bush-ring-1-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (check-time self) + (cond + ((and (handle->process (-> self slave 0)) + (-> self slave 0 process 0 next-state) + (= (-> self slave 0 process 0 next-state name) 'idle) + ) + ) + (else + (let ((v1-15 (-> self sub-state))) + (cond + ((< v1-15 (the-as uint (-> self max-count))) + (let* ((a1-2 (-> *bb-ring-info* (-> self info index) rings v1-15)) + (a0-14 (race-ring-spawn self a1-2)) + ) + (when a0-14 + (set! (-> self slave 0) (process->handle a0-14)) + (set! (-> self time-limit) (the-as time-frame (if (zero? (-> self sub-state)) + 4500 + (the-as int (-> *bb-ring-info* (-> self info index) time)) + ) + ) + ) + (set! (-> self start-time) (-> self clock frame-counter)) + (+! (-> self sub-state) 1) ) ) - (else - (go-virtual complete) - ) + ) + (else + (go-virtual complete) ) ) ) ) - (none) ) + (none) ) ) (set-subtask-hook! *game-info* - 259 - 3 - (the-as (function object) (lambda :behavior task-manager - () - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) - (suspend) - ) - (none) - ) - ) + (game-task-node city-burning-bush-ring-1-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (none) + ) ) (set-subtask-hook! *game-info* - 259 - 4 - (the-as (function object) (lambda :behavior task-manager () (close! (-> self node-info) 'event) (none))) + (game-task-node city-burning-bush-ring-1-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager () (close! (-> self node-info) 'event) (none)) ) -(copy-hooks! (-> *game-info* sub-task-list 273) (-> *game-info* sub-task-list 259)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-ring-2-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-ring-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 293) (-> *game-info* sub-task-list 259)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-ring-3-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-ring-1-resolution)) + ) (defpartgroup group-bush-collect :id 1056 @@ -2530,185 +2526,173 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 269 - 1 - (the-as - (function object) - (lambda :behavior task-manager - () - (let ((v1-4 (-> *bb-collection-info* (-> self info index)))) - (dotimes (a0-1 (-> v1-4 colls length)) - (when (and (-> v1-4 colls a0-1 minimap) (nonzero? (-> v1-4 colls a0-1 minimap))) - (logior! (-> v1-4 colls a0-1 minimap flags) (minimap-flag fade-out)) - (set! (-> v1-4 colls a0-1 minimap) #f) - ) + (game-task-node city-burning-bush-collection-1-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (let ((v1-4 (-> *bb-collection-info* (-> self info index)))) + (dotimes (a0-1 (-> v1-4 colls length)) + (when (and (-> v1-4 colls a0-1 minimap) (nonzero? (-> v1-4 colls a0-1 minimap))) + (logior! (-> v1-4 colls a0-1 minimap flags) (minimap-flag fade-out)) + (set! (-> v1-4 colls a0-1 minimap) #f) ) ) - (none) ) + (none) ) ) (set-subtask-hook! *game-info* - 269 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'airlock #f 0 0) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (let ((gp-0 (-> *bb-collection-info* (-> self info index)))) - (let ((v1-9 (-> gp-0 user-data))) - (cond - ((zero? v1-9) - (set! (-> self hud-counter) - (ppointer->handle (process-spawn hud-homing-beacon :init hud-init-by-other :to *target*)) - ) - ) - ((= v1-9 1) - (set! (-> self hud-counter) - (ppointer->handle (process-spawn hud-dark-eco-pickup :init hud-init-by-other :to *target*)) - ) - ) - ((= v1-9 2) - (set! (-> self hud-counter) - (ppointer->handle (process-spawn hud-green-eco-pickup :init hud-init-by-other :to *target*)) - ) - ) - ) + (game-task-node city-burning-bush-collection-1-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (let ((gp-0 (-> *bb-collection-info* (-> self info index)))) + (let ((v1-9 (-> gp-0 user-data))) + (cond + ((zero? v1-9) + (set! (-> self hud-counter) + (ppointer->handle (process-spawn hud-homing-beacon :init hud-init-by-other :to *target*)) + ) + ) + ((= v1-9 1) + (set! (-> self hud-counter) + (ppointer->handle (process-spawn hud-dark-eco-pickup :init hud-init-by-other :to *target*)) + ) + ) + ((= v1-9 2) + (set! (-> self hud-counter) + (ppointer->handle (process-spawn hud-green-eco-pickup :init hud-init-by-other :to *target*)) + ) + ) ) - (dotimes (s5-3 (-> gp-0 colls length)) - (let ((v1-32 (-> gp-0 user-data))) - (cond - ((zero? v1-32) + ) + (dotimes (s5-3 (-> gp-0 colls length)) + (let ((v1-32 (-> gp-0 user-data))) + (cond + ((zero? v1-32) + (set! (-> gp-0 colls s5-3 handle) + (ppointer->handle (bush-collect-homing-beacon-spawn self (-> gp-0 colls s5-3 pos))) + ) + (set! (-> gp-0 colls s5-3 minimap) (add-icon! + *minimap* + (handle->process (-> gp-0 colls s5-3 handle)) + (the-as uint 16) + (the-as int #f) + (the-as vector #t) + 0 + ) + ) + ) + ((= v1-32 1) + (let ((t1-3 (new 'stack 'fact-info self (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc))) + ) + (new 'stack-no-clear 'vector) + (set! (-> t1-3 options) (logior (actor-option fade-out no-distance-check-fadeout) (-> t1-3 options))) + (set! (-> t1-3 fade-time) (-> gp-0 time)) (set! (-> gp-0 colls s5-3 handle) - (ppointer->handle (bush-collect-homing-beacon-spawn self (-> gp-0 colls s5-3 pos))) - ) - (set! (-> gp-0 colls s5-3 minimap) (add-icon! - *minimap* - (handle->process (-> gp-0 colls s5-3 handle)) - (the-as uint 16) - (the-as int #f) - (the-as vector #t) - 0 - ) - ) - ) - ((= v1-32 1) - (let ((t1-3 (new 'stack 'fact-info self (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc))) - ) - (new 'stack-no-clear 'vector) - (set! (-> t1-3 options) (logior (actor-option fade-out no-distance-check-fadeout) (-> t1-3 options))) - (set! (-> t1-3 fade-time) (-> gp-0 time)) - (set! (-> gp-0 colls s5-3 handle) - (ppointer->handle - (birth-pickup-at-point (-> gp-0 colls s5-3 pos) (pickup-type eco-pill-dark) 1.0 #t self t1-3) - ) + (ppointer->handle + (birth-pickup-at-point (-> gp-0 colls s5-3 pos) (pickup-type eco-pill-dark) 1.0 #t self t1-3) ) - ) - (set! (-> gp-0 colls s5-3 minimap) (add-icon! - *minimap* - (handle->process (-> gp-0 colls s5-3 handle)) - (the-as uint 16) - (the-as int #f) - (the-as vector #t) - 0 - ) ) ) - ((= v1-32 2) - (let ((t1-5 (new 'stack 'fact-info self (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc))) - ) - (new 'stack-no-clear 'vector) - (set! (-> t1-5 options) (logior (actor-option fade-out no-distance-check-fadeout) (-> t1-5 options))) - (set! (-> t1-5 fade-time) (-> gp-0 time)) - (set! (-> gp-0 colls s5-3 handle) - (ppointer->handle - (birth-pickup-at-point (-> gp-0 colls s5-3 pos) (pickup-type eco-pill-green) 1.0 #t self t1-5) - ) + (set! (-> gp-0 colls s5-3 minimap) (add-icon! + *minimap* + (handle->process (-> gp-0 colls s5-3 handle)) + (the-as uint 16) + (the-as int #f) + (the-as vector #t) + 0 + ) + ) + ) + ((= v1-32 2) + (let ((t1-5 (new 'stack 'fact-info self (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc))) + ) + (new 'stack-no-clear 'vector) + (set! (-> t1-5 options) (logior (actor-option fade-out no-distance-check-fadeout) (-> t1-5 options))) + (set! (-> t1-5 fade-time) (-> gp-0 time)) + (set! (-> gp-0 colls s5-3 handle) + (ppointer->handle + (birth-pickup-at-point (-> gp-0 colls s5-3 pos) (pickup-type eco-pill-green) 1.0 #t self t1-5) ) - ) - (set! (-> gp-0 colls s5-3 minimap) (add-icon! - *minimap* - (handle->process (-> gp-0 colls s5-3 handle)) - (the-as uint 16) - (the-as int #f) - (the-as vector #t) - 0 - ) ) ) - (else - (set! (-> gp-0 colls s5-3 handle) (ppointer->handle (bush-collect-spawn self (-> gp-0 colls s5-3 pos)))) - (set! (-> gp-0 colls s5-3 minimap) #f) - ) - ) - ) - ) - (set! (-> self start-time) (-> self clock frame-counter)) - (set! (-> self time-limit) (-> gp-0 time)) - ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 269 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (check-time self) - (let ((a0-2 (-> *bb-collection-info* (-> self info index))) - (v1-6 0) - ) - (dotimes (a1-0 (-> a0-2 colls length)) - (cond - ((and (nonzero? (-> a0-2 colls a1-0 handle)) (handle->process (-> a0-2 colls a1-0 handle))) - (+! v1-6 1) + (set! (-> gp-0 colls s5-3 minimap) (add-icon! + *minimap* + (handle->process (-> gp-0 colls s5-3 handle)) + (the-as uint 16) + (the-as int #f) + (the-as vector #t) + 0 + ) + ) ) (else - (when (-> a0-2 colls a1-0 minimap) - (logior! (-> a0-2 colls a1-0 minimap flags) (minimap-flag fade-out)) - (set! (-> a0-2 colls a1-0 minimap) #f) - ) + (set! (-> gp-0 colls s5-3 handle) (ppointer->handle (bush-collect-spawn self (-> gp-0 colls s5-3 pos)))) + (set! (-> gp-0 colls s5-3 minimap) #f) ) ) ) - (set! (-> *game-info* counter) (the float v1-6)) - (if (zero? v1-6) - (go-virtual complete) - ) ) - (none) + (set! (-> self start-time) (-> self clock frame-counter)) + (set! (-> self time-limit) (-> gp-0 time)) ) + (none) ) ) (set-subtask-hook! *game-info* - 269 - 3 - (the-as - (function object) - (lambda :behavior task-manager () (set! (-> self state-time) (-> self clock frame-counter)) (none)) + (game-task-node city-burning-bush-collection-1-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (check-time self) + (let ((a0-2 (-> *bb-collection-info* (-> self info index))) + (v1-6 0) + ) + (dotimes (a1-0 (-> a0-2 colls length)) + (cond + ((and (nonzero? (-> a0-2 colls a1-0 handle)) (handle->process (-> a0-2 colls a1-0 handle))) + (+! v1-6 1) + ) + (else + (when (-> a0-2 colls a1-0 minimap) + (logior! (-> a0-2 colls a1-0 minimap flags) (minimap-flag fade-out)) + (set! (-> a0-2 colls a1-0 minimap) #f) + ) + ) + ) + ) + (set! (-> *game-info* counter) (the float v1-6)) + (if (zero? v1-6) + (go-virtual complete) + ) + ) + (none) ) ) -;; PC PORT NOTE : added complete hook for collection bbush tasks where we wait for the hud to die first -(set-subtask-hook! *game-info* 269 4 - (lambda :behavior task-manager () - (while (handle->process (-> self hud-counter)) - (suspend)))) +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-collection-1-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager () (set! (-> self state-time) (-> self clock frame-counter)) (none)) + ) -(copy-hooks! (-> *game-info* sub-task-list 287) (-> *game-info* sub-task-list 269)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-collection-2-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-collection-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 305) (-> *game-info* sub-task-list 269)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-collection-3-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-collection-1-resolution)) + ) (deftype burning-bush-get-on-info (structure) ((trans vector :inline :offset-assert 0) @@ -2835,63 +2819,65 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 261 - 0 - (the-as (function object) (lambda :behavior task-manager - () - (set-setting! 'airlock #f 0 0) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (none) - ) - ) - ) - -(set-subtask-hook! *game-info* 261 2 (the-as (function object) (lambda :behavior task-manager () (none)))) - -(set-subtask-hook! - *game-info* - 261 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (let ((a0-1 (handle->process (-> self slave 0)))) - (if a0-1 - (deactivate a0-1) - ) - ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 261 - 4 - (the-as (function object) (lambda :behavior task-manager () (close! (-> self node-info) 'event) (none))) - ) - -(set-subtask-hook! - *game-info* - 261 - 5 - (the-as (function object) (lambda :behavior task-manager - () - (if (and *target* (focus-test? *target* grabbed)) - (process-release? *target*) - ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 261 - 3 + (game-task-node city-burning-bush-get-to-1-resolution) + TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () - (set-setting! 'minimap 'clear 0 128) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-get-to-1-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager () (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-get-to-1-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (let ((a0-1 (handle->process (-> self slave 0)))) + (if a0-1 + (deactivate a0-1) + ) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-get-to-1-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager () (close! (-> self node-info) 'event) (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-get-to-1-resolution) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager + () + (if (and *target* (focus-test? *target* grabbed)) + (process-release? *target*) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-get-to-1-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (while (not (process-grab? *target* #f)) (suspend) ) @@ -2916,8 +2902,8 @@ This commonly includes things such as: ) (suspend) (send-event (handle->process (-> self slave 0)) 'get-notify self) - (set-setting! 'interp-time 'abs 0 0) - (set-setting! 'mode-name 'cam-fixed 0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'mode-name 'cam-fixed 0.0 0) (set! (-> *ACTOR-bank* birth-max) 1000) (suspend) (let ((gp-0 (new 'stack 'transformq))) @@ -2969,54 +2955,95 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 261 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('notify) - (case (-> arg3 param 0) - (('pickup) - (go-virtual complete) - ) - (('die) - (go-virtual fail) - ) - ) - ) - ) - (none) - ) + (game-task-node city-burning-bush-get-to-1-resolution) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('pickup) + (go-virtual complete) ) + (('die) + (go-virtual fail) + ) + ) + ) + ) + (none) + ) ) -(copy-hooks! (-> *game-info* sub-task-list 263) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-2-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 265) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-3-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 267) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-4-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 275) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-5-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 277) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-6-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 281) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-7-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 283) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-8-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 285) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-9-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 289) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-10-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 291) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-11-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 295) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-12-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 299) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-13-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 301) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-14-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) -(copy-hooks! (-> *game-info* sub-task-list 303) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-15-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) (defmethod draw hud-homing-beacon ((obj hud-homing-beacon)) (set-hud-piece-position! diff --git a/goal_src/jak2/levels/common/ai/bot.gc b/goal_src/jak2/levels/common/ai/bot.gc index 5c0ad9fc0f..cd0e7803f2 100644 --- a/goal_src/jak2/levels/common/ai/bot.gc +++ b/goal_src/jak2/levels/common/ai/bot.gc @@ -1843,7 +1843,7 @@ If the player is too far, play a warning speech." ) ) ) - (set-setting! 'immediate-string-min-max #f 0 0) + (set-setting! 'immediate-string-min-max #f 0.0 0) (set! (-> *ACTOR-bank* birth-max) 1000) ) ((logtest? (-> obj bot-flags) (bot-flags bf14)) diff --git a/goal_src/jak2/levels/common/battle.gc b/goal_src/jak2/levels/common/battle.gc index 5e2eea9de6..9d410ef7f3 100644 --- a/goal_src/jak2/levels/common/battle.gc +++ b/goal_src/jak2/levels/common/battle.gc @@ -1571,10 +1571,10 @@ (when (and a3-0 (not (logtest? (-> obj flags) 16))) (case a3-0 (('sound-mode) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) ) (else - (set-setting! 'music a3-0 0 0) + (set-setting! 'music a3-0 0.0 0) ) ) (logior! (-> obj flags) 16) diff --git a/goal_src/jak2/levels/common/enemy/bombots/bombbot.gc b/goal_src/jak2/levels/common/enemy/bombots/bombbot.gc index 36429c611e..a1d6418a80 100644 --- a/goal_src/jak2/levels/common/enemy/bombots/bombbot.gc +++ b/goal_src/jak2/levels/common/enemy/bombots/bombbot.gc @@ -3028,304 +3028,280 @@ (set-subtask-hook! *game-info* - 186 - 0 - (the-as (function object) (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set! (-> self data-int32 0) 0) - 0 - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 186 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + (game-task-node city-stop-bomb-bots-destroy) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self data-int32 0) 0) + 0 + (none) ) ) (set-subtask-hook! *game-info* - 186 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (nonzero? (-> self data-int32 0)) - (let ((gp-0 0)) - (let ((s5-0 10000)) - (dotimes (s4-0 3) - (let* ((s2-0 (-> self slave s4-0 process 0)) - (s3-0 (if (type? s2-0 bombbot) - (the-as bombbot s2-0) - ) - ) - ) - (when s3-0 - (+! gp-0 1) - (let ((v1-14 - (the int (* 0.000030517578 (vector-vector-xz-distance - (-> s3-0 root-override2 trans) - (the-as vector (-> s3-0 city-path node (+ (-> s3-0 city-path node-count) -1))) - ) - ) - ) - ) + (game-task-node city-stop-bomb-bots-destroy) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-stop-bomb-bots-destroy) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (when (nonzero? (-> self data-int32 0)) + (let ((gp-0 0)) + (let ((s5-0 10000)) + (dotimes (s4-0 3) + (let* ((s2-0 (-> self slave s4-0 process 0)) + (s3-0 (if (type? s2-0 bombbot) + (the-as bombbot s2-0) + ) + ) + ) + (when s3-0 + (+! gp-0 1) + (let ((v1-14 + (the int (* 0.000030517578 (vector-vector-xz-distance + (-> s3-0 root-override2 trans) + (the-as vector (-> s3-0 city-path node (+ (-> s3-0 city-path node-count) -1))) + ) + ) + ) ) - (if (< v1-14 s5-0) - (set! s5-0 v1-14) - ) - ) - (when (= (-> s3-0 current-node) (+ (-> s3-0 city-path node-count) -1)) - ) + ) + (if (< v1-14 s5-0) + (set! s5-0 v1-14) + ) + ) + (when (= (-> s3-0 current-node) (+ (-> s3-0 city-path node-count) -1)) ) ) ) - (set! (-> self data-int32 1) s5-0) - (cond - ((< s5-0 10) - (set! (-> *game-info* timer) (the-as time-frame (the int (* 300.0 (the float s5-0))))) - (let ((v1-25 (handle->process (-> self hud-timer)))) - (if (and *target* (not v1-25)) - (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) - ) - ) - (when (zero? s5-0) - (send-event (handle->process (-> self hud-timer)) 'hide-and-die) - (go-virtual fail) - ) - ) - (else - (if (handle->process (-> self hud-timer)) - (send-event (handle->process (-> self hud-timer)) 'hide-and-die) - ) - ) - ) ) - (if (zero? gp-0) - (go-virtual complete) - ) - ) - ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 186 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (while (!= (-> (level-get-target-inside *level*) name) 'ctysluma) - (suspend) - ) - (set! (-> self data-int32 0) 1) - (set-setting! 'airlock #f 0 0) - (set-setting! 'sound-mode #f 0 1) - (let ((gp-1 *traffic-manager*)) - (send-event gp-1 'set-guard-target-count-range 4 0 0) - (send-event gp-1 'set-guard-target-count-range 5 0 0) - ) - (let ((gp-2 (new 'stack 'bombbot-spawn-params))) - (set! (-> gp-2 nav-mesh) (get-nav-mesh (the-as actor-id 9592))) - (set! (-> gp-2 position quad) - (-> (new 'static 'quaternion :x 4387619.0 :y 37262.54 :z 230567.11 :w 1.0) quad) - ) - (quaternion-copy! (-> gp-2 quat) (new 'static 'quaternion :x 0.0006 :y -0.8345 :z -0.0013 :w -0.5509)) - (set! (-> gp-2 path) *bombbot-path-1*) - (set! (-> self slave 0) (ppointer->handle (process-spawn bombbot gp-2 :to self))) - (set! (-> gp-2 path) *bombbot-path-2*) - (set! (-> self slave 1) (ppointer->handle (process-spawn bombbot gp-2 :to self))) - (set! (-> gp-2 path) *bombbot-path-3*) - (set! (-> self slave 2) (ppointer->handle (process-spawn bombbot gp-2 :to self))) - ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 186 - 4 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (talker-spawn-func (-> *talker-speech* 117) *entity-pool* (target-pos 0) (the-as region #f)) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 186 - 5 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (and *target* - (not (focus-test? *target* dead)) - (zero? (-> self data-int32 1)) - (nonzero? (-> self data-int32 0)) - ) - (cond - ((= (level-status *level* 'ctysluma) 'active) - (set-setting! 'entity-name "camera-236" 0 0) - (set-setting! 'minimap 'clear 0 128) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (add-process *gui-control* self (gui-channel sig) (gui-action play) "bbotxplo" -99.0 0) - (dotimes (gp-1 3) - (let* ((s5-0 (-> self slave gp-1 process 0)) - (a0-7 (if (type? s5-0 bombbot) - s5-0 - ) - ) - ) - (if a0-7 - (send-event a0-7 'explode) + (set! (-> self data-int32 1) s5-0) + (cond + ((< s5-0 10) + (set! (-> *game-info* timer) (the-as time-frame (the int (* 300.0 (the float s5-0))))) + (let ((v1-25 (handle->process (-> self hud-timer)))) + (if (and *target* (not v1-25)) + (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) ) ) + (when (zero? s5-0) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + (go-virtual fail) + ) ) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.3)) - (suspend) - ) - (setup - *screen-filter* - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) - (-> self clock seconds-per-frame) - (bucket-id tex-all-map) - ) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) - (suspend) - ) - (set-setting! 'interp-time 'abs 0 0) - (remove-setting! 'entity-name) + (else + (if (handle->process (-> self hud-timer)) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + ) + ) + ) + ) + (if (zero? gp-0) + (go-virtual complete) + ) + ) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-stop-bomb-bots-destroy) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (while (!= (-> (level-get-target-inside *level*) name) 'ctysluma) + (suspend) + ) + (set! (-> self data-int32 0) 1) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'sound-mode #f 0.0 1) + (let ((gp-1 *traffic-manager*)) + (send-event gp-1 'set-guard-target-count-range 4 0 0) + (send-event gp-1 'set-guard-target-count-range 5 0 0) + ) + (let ((gp-2 (new 'stack 'bombbot-spawn-params))) + (set! (-> gp-2 nav-mesh) (get-nav-mesh (the-as actor-id 9592))) + (set! (-> gp-2 position quad) + (-> (new 'static 'quaternion :x 4387619.0 :y 37262.54 :z 230567.11 :w 1.0) quad) + ) + (quaternion-copy! (-> gp-2 quat) (new 'static 'quaternion :x 0.0006 :y -0.8345 :z -0.0013 :w -0.5509)) + (set! (-> gp-2 path) *bombbot-path-1*) + (set! (-> self slave 0) (ppointer->handle (process-spawn bombbot gp-2 :to self))) + (set! (-> gp-2 path) *bombbot-path-2*) + (set! (-> self slave 1) (ppointer->handle (process-spawn bombbot gp-2 :to self))) + (set! (-> gp-2 path) *bombbot-path-3*) + (set! (-> self slave 2) (ppointer->handle (process-spawn bombbot gp-2 :to self))) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-stop-bomb-bots-destroy) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (talker-spawn-func (-> *talker-speech* 117) *entity-pool* (target-pos 0) (the-as region #f)) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-stop-bomb-bots-destroy) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager + () + (when (and *target* + (not (focus-test? *target* dead)) + (zero? (-> self data-int32 1)) + (nonzero? (-> self data-int32 0)) + ) + (cond + ((= (level-status *level* 'ctysluma) 'active) + (set-setting! 'entity-name "camera-236" 0.0 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) ) - (else + (add-process *gui-control* self (gui-channel sig) (gui-action play) "bbotxplo" -99.0 0) + (dotimes (gp-1 3) + (let* ((s5-0 (-> self slave gp-1 process 0)) + (a0-7 (if (type? s5-0 bombbot) + s5-0 + ) + ) + ) + (if a0-7 + (send-event a0-7 'explode) + ) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.3)) + (suspend) + ) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (-> self clock seconds-per-frame) + (bucket-id tex-all-map) + ) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (suspend) + ) + (set-setting! 'interp-time 'abs 0.0 0) + (remove-setting! 'entity-name) + ) + (else + ) + ) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-stop-bomb-bots-destroy) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (disable *screen-filter*) (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-bombbot-1-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-guard-target-count-range 4 0 0) + (send-event gp-0 'set-guard-target-count-range 5 0 0) + ) + (let ((gp-1 (new 'stack 'bombbot-spawn-params))) + (set! (-> gp-1 nav-mesh) (get-nav-mesh (the-as actor-id 9592))) + (set! (-> gp-1 position quad) + (-> (new 'static 'quaternion :x 4387619.0 :y 37262.54 :z 230567.11 :w 1.0) quad) + ) + (quaternion-copy! (-> gp-1 quat) (new 'static 'quaternion :x 0.0006 :y -0.8345 :z -0.0013 :w -0.5509)) + (set! (-> gp-1 path) *bombbot-path-4*) + (set! (-> self slave 0) (ppointer->handle (process-spawn bombbot gp-1 :to self))) + (set! (-> gp-1 path) *bombbot-path-5*) + (set! (-> self slave 1) (ppointer->handle (process-spawn bombbot gp-1 :to self))) + (set! (-> gp-1 path) *bombbot-path-6*) + (set! (-> self slave 2) (ppointer->handle (process-spawn bombbot gp-1 :to self))) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-bombbot-1-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-bombbot-1-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (let ((gp-0 0)) + 10000 + (dotimes (s5-0 3) + (let* ((s4-0 (-> self slave s5-0 process 0)) + (v1-6 (if (type? s4-0 bombbot) + (the-as bombbot s4-0) + ) + ) + ) + (when v1-6 + (+! gp-0 1) + (when (= (-> v1-6 current-node) (+ (-> v1-6 city-path node-count) -1)) + (set! (-> v1-6 current-node) (the-as uint 0)) + 0 + ) ) ) ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 186 - 1 - (the-as (function object) (lambda :behavior task-manager () (disable *screen-filter*) (none))) - ) - -(set-subtask-hook! - *game-info* - 297 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set-setting! 'airlock #f 0 0) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (let ((gp-0 *traffic-manager*)) - (send-event gp-0 'set-guard-target-count-range 4 0 0) - (send-event gp-0 'set-guard-target-count-range 5 0 0) - ) - (let ((gp-1 (new 'stack 'bombbot-spawn-params))) - (set! (-> gp-1 nav-mesh) (get-nav-mesh (the-as actor-id 9592))) - (set! (-> gp-1 position quad) - (-> (new 'static 'quaternion :x 4387619.0 :y 37262.54 :z 230567.11 :w 1.0) quad) - ) - (quaternion-copy! (-> gp-1 quat) (new 'static 'quaternion :x 0.0006 :y -0.8345 :z -0.0013 :w -0.5509)) - (set! (-> gp-1 path) *bombbot-path-4*) - (set! (-> self slave 0) (ppointer->handle (process-spawn bombbot gp-1 :to self))) - (set! (-> gp-1 path) *bombbot-path-5*) - (set! (-> self slave 1) (ppointer->handle (process-spawn bombbot gp-1 :to self))) - (set! (-> gp-1 path) *bombbot-path-6*) - (set! (-> self slave 2) (ppointer->handle (process-spawn bombbot gp-1 :to self))) - ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 297 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) - ) - -(set-subtask-hook! - *game-info* - 297 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (let ((gp-0 0)) - 10000 - (dotimes (s5-0 3) - (let* ((s4-0 (-> self slave s5-0 process 0)) - (v1-6 (if (type? s4-0 bombbot) - (the-as bombbot s4-0) - ) - ) - ) - (when v1-6 - (+! gp-0 1) - (when (= (-> v1-6 current-node) (+ (-> v1-6 city-path node-count) -1)) - (set! (-> v1-6 current-node) (the-as uint 0)) - 0 - ) - ) - ) - ) - (if (zero? gp-0) - (go-virtual complete) - ) - ) - (none) - ) + (if (zero? gp-0) + (go-virtual complete) ) + ) + (none) + ) ) (set-subtask-hook! *game-info* - 297 - 3 - (the-as (function object) (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (until #f - (suspend) - ) - #f - (none) - ) - ) + (game-task-node city-burning-bush-bombbot-1-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (until #f + (suspend) + ) + #f + (none) + ) ) diff --git a/goal_src/jak2/levels/common/enemy/hellcat/helldog.gc b/goal_src/jak2/levels/common/enemy/hellcat/helldog.gc index ba009d664d..4ca533b471 100644 --- a/goal_src/jak2/levels/common/enemy/hellcat/helldog.gc +++ b/goal_src/jak2/levels/common/enemy/hellcat/helldog.gc @@ -448,8 +448,8 @@ (set-subtask-hook! *game-info* - 147 - 0 + (game-task-node city-destroy-guard-vehicles-destroy) + TASK_MANAGER_INIT_HOOK (the-as (function object) (lambda :behavior task-manager @@ -539,12 +539,17 @@ ) ) -(set-subtask-hook! *game-info* 147 1 (the-as (function object) (lambda :behavior task-manager () (none)))) +(set-subtask-hook! + *game-info* + (game-task-node city-destroy-guard-vehicles-destroy) + TASK_MANAGER_CLEANUP_HOOK + (the-as (function object) (lambda :behavior task-manager () (none))) + ) (set-subtask-hook! *game-info* - 147 - 2 + (game-task-node city-destroy-guard-vehicles-destroy) + TASK_MANAGER_UPDATE_HOOK (the-as (function object) (lambda :behavior task-manager @@ -599,8 +604,8 @@ (set-subtask-hook! *game-info* - 147 - 3 + (game-task-node city-destroy-guard-vehicles-destroy) + TASK_MANAGER_CODE_HOOK (the-as (function object) (lambda :behavior task-manager @@ -611,12 +616,17 @@ ) ) -(set-subtask-hook! *game-info* 147 5 (the-as (function object) (lambda :behavior task-manager () (none)))) +(set-subtask-hook! + *game-info* + (game-task-node city-destroy-guard-vehicles-destroy) + TASK_MANAGER_FAIL_HOOK + (the-as (function object) (lambda :behavior task-manager () (none))) + ) (set-subtask-hook! *game-info* - 147 - 4 + (game-task-node city-destroy-guard-vehicles-destroy) + TASK_MANAGER_COMPLETE_HOOK (the-as (function object) (lambda :behavior task-manager diff --git a/goal_src/jak2/levels/common/entities/com-elevator.gc b/goal_src/jak2/levels/common/entities/com-elevator.gc index 2e7e11cc0b..98c46816c5 100644 --- a/goal_src/jak2/levels/common/entities/com-elevator.gc +++ b/goal_src/jak2/levels/common/entities/com-elevator.gc @@ -117,7 +117,7 @@ ) (com-elevator-method-49 self #t) (if (not (logtest? (-> self elevator-status) (elevator-status moving))) - (set-setting! 'allow-look-around #f 0 0) + (set-setting! 'allow-look-around #f 0.0 0) ) (none) ) @@ -268,7 +268,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) (if (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) - (set-setting! 'jump #f 0 0) + (set-setting! 'jump #f 0.0 0) ) (none) ) diff --git a/goal_src/jak2/levels/common/races/race-manager.gc b/goal_src/jak2/levels/common/races/race-manager.gc index 29d1ac8094..63116b5c5b 100644 --- a/goal_src/jak2/levels/common/races/race-manager.gc +++ b/goal_src/jak2/levels/common/races/race-manager.gc @@ -392,7 +392,7 @@ (logior! (-> obj flags) 1) (race-state-method-17 obj) (send-event (handle->process (-> obj manager)) 'begin-race) - (set-setting! 'sound-mode #f 0 0) + (set-setting! 'sound-mode #f 0.0 0) (remove-setting! 'allow-progress) (set! (-> obj race-start-time) (-> obj current-time)) (let ((s5-0 (handle->process (-> obj manager)))) @@ -409,7 +409,7 @@ (set! (-> obj hud-turbo-counter) (ppointer->handle (process-spawn hud-race-turbo-counter :init hud-init-by-other :to s5-0)) ) - (set-setting! 'race-minimap #f 0 (-> obj info map-index)) + (set-setting! 'race-minimap #f 0.0 (-> obj info map-index)) ) ) (dotimes (s5-1 (-> obj racer-count)) @@ -546,7 +546,7 @@ ) (defmethod race-state-method-18 race-state ((obj race-state)) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-progress #f 0.0 0) (send-event (handle->process (-> obj arrow)) 'leave) (when (logtest? (-> obj info flags) 16) (send-event *traffic-manager* 'set-target-level 0) @@ -636,7 +636,7 @@ ) (when (< 0.4 f30-0) (when (-> obj info start-camera) - (set-setting! 'entity-name (-> obj info start-camera) 0 0) + (set-setting! 'entity-name (-> obj info start-camera) 0.0 0) (if (logtest? (-> obj info flags) 64) (talker-spawn-func (-> *talker-speech* 377) *entity-pool* (target-pos 0) (the-as region #f)) ) @@ -1365,11 +1365,11 @@ #f ) (else - (set-setting! 'music 'race 0 0) - (set-setting! 'sound-mode #f 0 2) + (set-setting! 'music 'race 0.0 0) + (set-setting! 'sound-mode #f 0.0 2) (let ((gp-0 (-> self race-state info))) (when (logtest? (-> gp-0 flags) 16) - (set-setting! 'borrow (-> gp-0 borrow) 0 0) + (set-setting! 'borrow (-> gp-0 borrow) 0.0 0) (while (!= (level-status *level* 'lracelit) 'active) (suspend) ) @@ -1483,7 +1483,7 @@ ) (send-event (ppointer->process (-> self parent)) 'allow-fail #f) (if (not (logtest? (-> self race-state info flags) 16)) - (set-setting! 'sound-mode #f 0 2) + (set-setting! 'sound-mode #f 0.0 2) ) (set! (-> self message-id) (the-as uint (add-process *gui-control* self (gui-channel supertitle) (gui-action play) "fail" 81920.0 0)) @@ -1638,7 +1638,7 @@ ;; WARN: Return type mismatch object vs none. (defbehavior race-manager-init-by-other race-manager ((arg0 race-info) (arg1 symbol)) - (stack-size-set! (-> self main-thread) 1024) ;; changed + (stack-size-set! (-> self main-thread) 512) (race-vehicle-entity-hack) (set! (-> self race-state) *race-state*) (set! (-> self race-state info) arg0) diff --git a/goal_src/jak2/levels/common/scene-actor.gc b/goal_src/jak2/levels/common/scene-actor.gc index 80204dd97a..4767792b9e 100644 --- a/goal_src/jak2/levels/common/scene-actor.gc +++ b/goal_src/jak2/levels/common/scene-actor.gc @@ -795,13 +795,14 @@ This commonly includes things such as: ) ) (if (and (= (-> v1-1 action) (game-task-action play)) - (or (and *target* (focus-test? *target* grabbed)) (let ((v1-10 (-> *game-info* sub-task-list 151))) - (handle->process (if (-> v1-10 info) - (-> v1-10 info manager) - (the-as handle #f) - ) - ) - ) + (or (and *target* (focus-test? *target* grabbed)) + (let ((v1-10 (-> *game-info* sub-task-list (game-task-node city-play-onin-game-resolution)))) + (handle->process (if (-> v1-10 info) + (-> v1-10 info manager) + (the-as handle #f) + ) + ) + ) ) ) (-> obj draw art-group data 6) diff --git a/goal_src/jak2/levels/common/warp-gate.gc b/goal_src/jak2/levels/common/warp-gate.gc index 5facbd2a05..d3bd8e412a 100644 --- a/goal_src/jak2/levels/common/warp-gate.gc +++ b/goal_src/jak2/levels/common/warp-gate.gc @@ -633,15 +633,15 @@ :code (behavior ((arg0 continue-point)) (local-vars (v1-38 symbol)) (kill-current-talker (the-as symbol '()) '() 'exit) - (set-setting! 'mode-name 'cam-fixed 0 0) - (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) (set! (-> self state-time) (-> self clock frame-counter)) (logclear! (-> self mask) (process-mask actor-pause)) (when (not arg0) (process-release? *target*) (go-virtual idle) ) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-progress #f 0.0 0) (set! (-> *setting-control* user-default border-mode) #t) (set! (-> *level* play?) #t) (apply-settings *setting-control*) @@ -979,7 +979,7 @@ This commonly includes things such as: (lambda ((arg0 string)) (local-vars (a1-2 event-message-block)) (with-pp - (add-setting! 'entity-name arg0 0 0) + (add-setting! 'entity-name arg0 0.0 0) (until (send-event-function *camera* a1-2) (suspend) (set! a1-2 (new 'stack-no-clear 'event-message-block)) @@ -1251,7 +1251,7 @@ This commonly includes things such as: (process-release? *target*) (go-virtual idle) ) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-progress #f 0.0 0) (set! (-> *setting-control* user-default border-mode) #t) (set! (-> *level* play?) #t) (apply-settings *setting-control*) diff --git a/goal_src/jak2/levels/demo/demo-obs.gc b/goal_src/jak2/levels/demo/demo-obs.gc index 6021b21cc6..fc0f4e6fee 100644 --- a/goal_src/jak2/levels/demo/demo-obs.gc +++ b/goal_src/jak2/levels/demo/demo-obs.gc @@ -446,12 +446,12 @@ (set! (-> self want 0) (the-as int arg0)) (set! (-> self want 1) (-> self draw)) (when arg2 - (set-setting! 'bg-a 'abs #x3f800000 0) + (set-setting! 'bg-a 'abs 1.0 0) (set! (-> *setting-control* user-current bg-a) 1.0) (apply-settings *setting-control*) ) (when (>= (-> self draw) 0) - (set-setting! 'bg-a 'abs #x3f800000 0) + (set-setting! 'bg-a 'abs 1.0 0) (apply-settings *setting-control*) (while (!= (-> *setting-control* user-current bg-a) 1.0) (suspend) @@ -814,7 +814,7 @@ (send-event (ppointer->process *time-of-day*) 'change 'hour 8) (set! (-> self mask) gp-25) ) - (set-setting! 'allow-pause #t 0 0) + (set-setting! 'allow-pause #t 0.0 0) (let ((gp-27 (ppointer->handle (process-spawn scene-player :init scene-player-init "atoll-2-intro-demo" #t "hiphog-demo")) ) @@ -823,8 +823,8 @@ (suspend) ) ) - (set-setting! 'allow-timeout #f 0 0) - (set-setting! 'allow-pause #f 0 0) + (set-setting! 'allow-timeout #f 0.0 0) + (set-setting! 'allow-pause #f 0.0 0) (let ((t9-49 demo-screen-change) (a0-81 0) (a1-39 -1) @@ -842,7 +842,7 @@ (play-task (game-task strip-rescue) 'debug #f) (set! (-> self mask) gp-29) ) - (set-setting! 'allow-pause #t 0 0) + (set-setting! 'allow-pause #t 0.0 0) (let ((gp-31 (ppointer->handle (process-spawn scene-player :init scene-player-init "crane-intro-demo" #t "vinroom-demo")) ) @@ -860,8 +860,8 @@ (send-event (ppointer->process *time-of-day*) 'change 'hour 8) (set! (-> self mask) gp-32) ) - (set-setting! 'allow-timeout #f 0 0) - (set-setting! 'allow-pause #f 0 0) + (set-setting! 'allow-timeout #f 0.0 0) + (set-setting! 'allow-pause #f 0.0 0) (let ((t9-63 demo-screen-change) (a0-105 1) (a1-54 -1) @@ -874,8 +874,8 @@ (start 'play (get-continue-by-name *game-info* "strip-warp")) ) ((= gp-24 2) - (set-setting! 'allow-timeout #f 0 0) - (set-setting! 'allow-pause #f 0 0) + (set-setting! 'allow-timeout #f 0.0 0) + (set-setting! 'allow-pause #f 0.0 0) (demo-screen-change (the-as symbol -1) -1 #f (the-as int #t)) (set! (-> *setting-control* user-default music-volume) 0.0) (case *kernel-boot-message* @@ -1027,11 +1027,11 @@ ) (process-entity-set! self a1-2) ) - (set-setting! 'allow-pause #f 0 0) - (set-setting! 'allow-progress #f 0 0) - (set-setting! 'airlock #f 0 0) - (set-setting! 'music #f 0 0) - (set-setting! 'allow-timeout #f 0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'music #f 0.0 0) + (set-setting! 'allow-timeout #f 0.0 0) (apply-settings *setting-control*) (dotimes (gp-0 2) (set! (-> self buffer gp-0) diff --git a/goal_src/jak2/levels/dig/dig-obs.gc b/goal_src/jak2/levels/dig/dig-obs.gc index fd04aa5f7b..a2124f8726 100644 --- a/goal_src/jak2/levels/dig/dig-obs.gc +++ b/goal_src/jak2/levels/dig/dig-obs.gc @@ -550,7 +550,7 @@ (defstate moving (dig-log) :virtual #t :enter (behavior () - (set-setting! 'ignore-target #t 0 0) + (set-setting! 'ignore-target #t 0.0 0) (none) ) :exit (behavior () @@ -582,7 +582,7 @@ (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.2)) (suspend) ) - (set-setting! 'entity-name "camera-249" 0 0) + (set-setting! 'entity-name "camera-249" 0.0 0) (set-action! *gui-control* (gui-action play) diff --git a/goal_src/jak2/levels/dig/dig3-obs.gc b/goal_src/jak2/levels/dig/dig3-obs.gc index d8779e5c46..614edc980c 100644 --- a/goal_src/jak2/levels/dig/dig3-obs.gc +++ b/goal_src/jak2/levels/dig/dig3-obs.gc @@ -1139,9 +1139,9 @@ This commonly includes things such as: (cond ((-> self trapeze-grabbed) (when (not (-> self grabbed)) - (set-setting! 'mode-name 'cam-pov-track 0 0) + (set-setting! 'mode-name 'cam-pov-track 0.0 0) (let ((v1-33 (process->ppointer self))) - (set-setting! 'pov-handle v1-33 #x40400000 (-> v1-33 0 pid)) + (set-setting! 'pov-handle v1-33 3.0 (-> v1-33 0 pid)) ) (set! (-> self pov-cam-offset z) (if (< 0.0 (vector-dot (-> self node-list data 0 bone transform vector 2) (-> (camera-matrix) vector 2))) diff --git a/goal_src/jak2/levels/drill_platform/drill-baron.gc b/goal_src/jak2/levels/drill_platform/drill-baron.gc index 17b9bae6cb..34d109247b 100644 --- a/goal_src/jak2/levels/drill_platform/drill-baron.gc +++ b/goal_src/jak2/levels/drill_platform/drill-baron.gc @@ -1278,7 +1278,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set-setting! 'music 'danger4 0 0) + (set-setting! 'music 'danger4 0.0 0) (let ((v1-2 2) (a0-2 (+ (-> self pass) 1)) ) diff --git a/goal_src/jak2/levels/drill_platform/drill-mech-master.gc b/goal_src/jak2/levels/drill_platform/drill-mech-master.gc index a7aae23351..1b996b5af4 100644 --- a/goal_src/jak2/levels/drill_platform/drill-mech-master.gc +++ b/goal_src/jak2/levels/drill_platform/drill-mech-master.gc @@ -104,7 +104,7 @@ (let ((gp-0 (-> arg3 param 0))) (set! (-> *game-info* counter) (the float (-> self cpanel-count))) (spawn-hud-panel self (the-as symbol gp-0)) - (set-setting! 'music #f 0 0) + (set-setting! 'music #f 0.0 0) (if (not gp-0) (set! (-> self exited?) #t) ) @@ -127,6 +127,7 @@ ) (defmethod spawn-hud-panel drill-mech-master ((obj drill-mech-master) (arg0 symbol)) + "Spawn the hud panel for the drill-mech mission." (cond ((and arg0 (nonzero? (-> obj cpanel-count))) (if (not (handle->process (-> obj hud-cpanel))) @@ -168,13 +169,13 @@ (task-node-close! (game-task-node drill-mech-smash-consoles)) (set! (-> self alarm-sound-id) (sound-play "drill-alarm")) (persist-with-delay *setting-control* 'ignore-target (seconds 8) 'ignore-target #t 0.0 0) - (set-setting! 'music 'danger10 0 0) + (set-setting! 'music 'danger10 0.0 0) (set! (-> self state-time) (-> self clock frame-counter)) (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) (suspend) ) (talker-spawn-func (-> *talker-speech* 183) *entity-pool* (target-pos 0) (the-as region #f)) - (set-setting! 'pilot #f 0 0) + (set-setting! 'pilot #f 0.0 0) (let ((v1-20 *target*)) (if v1-20 (send-event (handle->process (-> v1-20 mech hud 0)) 'hide-and-die) @@ -245,8 +246,8 @@ :event drill-mech-master-event-handler :enter (behavior () (set! (-> self state-time) (-> self clock frame-counter)) - (set-setting! 'allow-pause #f 0 0) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (none) ) :exit (behavior () @@ -390,7 +391,7 @@ (set! (-> self total-countdown-time) (seconds 75)) (task-node-close! (game-task-node drill-mech-smash-consoles)) (set! (-> self alarm-sound-id) (sound-play "drill-alarm")) - (set-setting! 'music 'danger10 0 0) + (set-setting! 'music 'danger10 0.0 0) (go-virtual hostile) ) (else @@ -402,34 +403,33 @@ (set-subtask-hook! *game-info* - 203 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('hud-cpanel) - (let ((v1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-1 from) (process->ppointer arg0)) - (set! (-> v1-1 num-params) arg1) - (set! (-> v1-1 message) arg2) - (set! (-> v1-1 param 0) (-> arg3 param 0)) - (set! (-> v1-1 param 1) (-> arg3 param 1)) - (set! (-> v1-1 param 2) (-> arg3 param 2)) - (set! (-> v1-1 param 3) (-> arg3 param 3)) - (set! (-> v1-1 param 4) (-> arg3 param 4)) - (set! (-> v1-1 param 5) (-> arg3 param 5)) - (send-event-function (handle->process (-> self slave 0)) v1-1) - ) - ) - ) - ) - ) + (game-task-node drill-mech-started-smashing) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hud-cpanel) + (let ((v1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-1 from) (process->ppointer arg0)) + (set! (-> v1-1 num-params) arg1) + (set! (-> v1-1 message) arg2) + (set! (-> v1-1 param 0) (-> arg3 param 0)) + (set! (-> v1-1 param 1) (-> arg3 param 1)) + (set! (-> v1-1 param 2) (-> arg3 param 2)) + (set! (-> v1-1 param 3) (-> arg3 param 3)) + (set! (-> v1-1 param 4) (-> arg3 param 4)) + (set! (-> v1-1 param 5) (-> arg3 param 5)) + (send-event-function (handle->process (-> self slave 0)) v1-1) + ) + ) + ) + ) ) (set-subtask-hook! *game-info* - 203 - 0 + (game-task-node drill-mech-started-smashing) + TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () (let ((v0-3 (ppointer->handle (process-spawn drill-mech-master :to self)))) (set! (-> self slave 0) (the-as handle v0-3)) (the-as object v0-3) diff --git a/goal_src/jak2/levels/drill_platform/drill-obs.gc b/goal_src/jak2/levels/drill_platform/drill-obs.gc index 1327af7398..2837cdc283 100644 --- a/goal_src/jak2/levels/drill_platform/drill-obs.gc +++ b/goal_src/jak2/levels/drill_platform/drill-obs.gc @@ -560,9 +560,9 @@ For example for an elevator pre-compute the distance between the first and last (let ((v1-9 *target*)) (when v1-9 (if (not (focus-test? v1-9 mech)) - (set-setting! 'pilot #f 0 0) + (set-setting! 'pilot #f 0.0 0) ) - (set-setting! 'pilot-exit #f 0 0) + (set-setting! 'pilot-exit #f 0.0 0) ) ) ) @@ -1590,8 +1590,8 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 118 - 0 + (game-task-node drill-ship-resolution) + TASK_MANAGER_INIT_HOOK (lambda () (speech-control-method-10 *speech-control* @@ -1690,7 +1690,12 @@ This commonly includes things such as: ) ) -(set-subtask-hook! *game-info* 118 1 (lambda () (the-as object (speech-control-method-9 *speech-control*)))) +(set-subtask-hook! + *game-info* + (game-task-node drill-ship-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda () (the-as object (speech-control-method-9 *speech-control*))) + ) (defun drill-login () (set! *nav-network* (new 'loading-level 'nav-network)) diff --git a/goal_src/jak2/levels/forest/forest-obs.gc b/goal_src/jak2/levels/forest/forest-obs.gc index 89dec5e8fb..cdbb20f3d8 100644 --- a/goal_src/jak2/levels/forest/forest-obs.gc +++ b/goal_src/jak2/levels/forest/forest-obs.gc @@ -150,7 +150,7 @@ This commonly includes things such as: (set! (-> a1-19 num-params) 0) (set! (-> a1-19 message) 'fail) (let ((t9-11 send-event-function) - (v1-45 (-> *game-info* sub-task-list 200)) + (v1-45 (-> *game-info* sub-task-list (game-task-node forest-protect-resolution))) ) (t9-11 (handle->process (if (-> v1-45 info) @@ -372,7 +372,7 @@ This commonly includes things such as: (set! (-> a1-10 num-params) 0) (set! (-> a1-10 message) 'fail) (let ((t9-12 send-event-function) - (v1-62 (-> *game-info* sub-task-list 200)) + (v1-62 (-> *game-info* sub-task-list (game-task-node forest-protect-resolution))) ) (t9-12 (handle->process (if (-> v1-62 info) @@ -511,544 +511,538 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 200 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'airlock #f 0 0) - (set-setting! 'sound-mode #f 0 1) - (set-setting! 'sound-excitement 'abs #x3f4ccccd 0) - (set-setting! 'extra-bank '((forest2 forest4) (forest3 forest5)) 0 0) - (speech-control-method-10 - *speech-control* - 6 - (new 'static 'speech-type-info - :min-delay #x4b0 - :max-delay #x960 - :list (new 'static 'boxed-array :type string - "kg001" - "kg002" - "kg004" - "kg006" - "kg001a" - "kg013" - "kg016" - "kg018" - "kg019" - "kg023" - "kg024" - "kg002a" - "kg004a" - "kg078a" - "kg079a" - "kg080a" - "kg081a" - "kg004a" - "kg082a" - "kg083a" - "kg084a" - "kg085a" - "kg086a" - "kg087a" - "kg088a" - "kg091a" - "kg023a" - "kg006a" - "kg092a" - "kg093a" - "kg094a" - "kg095a" - "kg103a" - "kg104a" - "kg112a" - "kg024a" - "kg134" - "kg136" - "kg137" - "kg138" - "kg139" - "kg140" - "kg141" - "kg130" - "kg135" - "kg156" - "kg157" - ) + (game-task-node forest-protect-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'sound-mode #f 0.0 1) + (set-setting! 'sound-excitement 'abs 0.8 0) + (set-setting! 'extra-bank '((forest2 forest4) (forest3 forest5)) 0.0 0) + (speech-control-method-10 + *speech-control* + 6 + (new 'static 'speech-type-info + :min-delay #x4b0 + :max-delay #x960 + :list (new 'static 'boxed-array :type string + "kg001" + "kg002" + "kg004" + "kg006" + "kg001a" + "kg013" + "kg016" + "kg018" + "kg019" + "kg023" + "kg024" + "kg002a" + "kg004a" + "kg078a" + "kg079a" + "kg080a" + "kg081a" + "kg004a" + "kg082a" + "kg083a" + "kg084a" + "kg085a" + "kg086a" + "kg087a" + "kg088a" + "kg091a" + "kg023a" + "kg006a" + "kg092a" + "kg093a" + "kg094a" + "kg095a" + "kg103a" + "kg104a" + "kg112a" + "kg024a" + "kg134" + "kg136" + "kg137" + "kg138" + "kg139" + "kg140" + "kg141" + "kg130" + "kg135" + "kg156" + "kg157" ) ) - (speech-control-method-10 - *speech-control* - 9 - (new 'static 'speech-type-info - :priority #x9 - :max-delay #x12c - :list (new 'static 'boxed-array :type string - "kg133" - "kg137" - "kg142" - "kg144" - "kg145" - "kg146" - "kg147" - "kg148" - "kg149" - "kg150" - "kg138" - "kg151" - "kg152" - "kg153" - "kg154" - "kg155" - "kg159" - "kg163" - "kg164" - ) - ) - ) - (speech-control-method-10 - *speech-control* - 10 - (new 'static 'speech-type-info :priority #xa :max-delay #x12c :list (new 'static 'boxed-array :type string - "kg165" - "kg166" - "kg167" - "kg168" - "kg169" - "kg170" - "kg171" - "kg172" - "kg173" - "kg174" - "kg175" - "kg176" - ) - ) - ) - (none) ) + (speech-control-method-10 + *speech-control* + 9 + (new 'static 'speech-type-info + :priority #x9 + :max-delay #x12c + :list (new 'static 'boxed-array :type string + "kg133" + "kg137" + "kg142" + "kg144" + "kg145" + "kg146" + "kg147" + "kg148" + "kg149" + "kg150" + "kg138" + "kg151" + "kg152" + "kg153" + "kg154" + "kg155" + "kg159" + "kg163" + "kg164" + ) + ) + ) + (speech-control-method-10 + *speech-control* + 10 + (new 'static 'speech-type-info :priority #xa :max-delay #x12c :list (new 'static 'boxed-array :type string + "kg165" + "kg166" + "kg167" + "kg168" + "kg169" + "kg170" + "kg171" + "kg172" + "kg173" + "kg174" + "kg175" + "kg176" + ) + ) + ) + (none) ) ) (set-subtask-hook! *game-info* - 200 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (if (!= (level-status *level* 'forestb) 'active) - (go-virtual fail) - ) - (none) - ) - ) + (game-task-node forest-protect-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (if (!= (level-status *level* 'forestb) 'active) + (go-virtual fail) + ) + (none) + ) ) (set-subtask-hook! *game-info* - 200 - 3 - (the-as (function object) (lambda :behavior task-manager - () - (set! (-> self start-time) (-> self clock frame-counter)) - (let ((gp-0 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.5)) - (suspend) - ) - ) - (let ((s5-0 (entity-by-name "transport-level-1")) - (gp-1 (entity-by-name "transport-level-2")) - ) - (let ((s4-0 (entity-by-name "forest-hover-manager-1"))) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) (process->ppointer self)) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'spawn-time) - (set! (-> a1-0 param 0) (the-as uint 150)) - (let ((t9-3 send-event-function) - (v1-11 s5-0) - ) - (t9-3 - (if v1-11 - (-> v1-11 extra process) - ) - a1-0 - ) - ) - ) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) (process->ppointer self)) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'spawn-time) - (set! (-> a1-1 param 0) (the-as uint 150)) - (let ((t9-4 send-event-function) - (v1-18 gp-1) - ) - (t9-4 - (if v1-18 - (-> v1-18 extra process) - ) - a1-1 - ) - ) - ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) (process->ppointer self)) - (set! (-> a1-2 num-params) 1) - (set! (-> a1-2 message) 'guards-alive) - (set! (-> a1-2 param 0) (the-as uint 0)) - (let ((t9-5 send-event-function) - (v1-24 s5-0) - ) - (t9-5 - (if v1-24 - (-> v1-24 extra process) - ) - a1-2 - ) - ) - ) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) (process->ppointer self)) - (set! (-> a1-3 num-params) 1) - (set! (-> a1-3 message) 'guards-alive) - (set! (-> a1-3 param 0) (the-as uint 3)) - (let ((t9-6 send-event-function) - (v1-31 gp-1) - ) - (t9-6 - (if v1-31 - (-> v1-31 extra process) - ) - a1-3 - ) - ) - ) - (let ((s3-0 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s3-0) (seconds 15)) - (suspend) - ) - ) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) (process->ppointer self)) - (set! (-> a1-4 num-params) 1) - (set! (-> a1-4 message) 'guards-alive) - (set! (-> a1-4 param 0) (the-as uint 3)) - (let ((t9-7 send-event-function) - (v1-43 s5-0) - ) - (t9-7 - (if v1-43 - (-> v1-43 extra process) - ) - a1-4 - ) - ) - ) - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) (process->ppointer self)) - (set! (-> a1-5 num-params) 1) - (set! (-> a1-5 message) 'guards-alive) - (set! (-> a1-5 param 0) (the-as uint 0)) - (let ((t9-8 send-event-function) - (v1-49 gp-1) - ) - (t9-8 - (if v1-49 - (-> v1-49 extra process) - ) - a1-5 - ) - ) - ) - (dotimes (s3-1 3) - (let ((s2-0 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s2-0) (seconds 10)) - (suspend) - ) - ) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) (process->ppointer self)) - (set! (-> a1-6 num-params) 1) - (set! (-> a1-6 message) 'guards-alive) - (set! (-> a1-6 param 0) (the-as uint 0)) - (let ((t9-9 send-event-function) - (v1-60 s5-0) - ) - (t9-9 - (if v1-60 - (-> v1-60 extra process) - ) - a1-6 - ) - ) - ) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) (process->ppointer self)) - (set! (-> a1-7 num-params) 1) - (set! (-> a1-7 message) 'guards-alive) - (set! (-> a1-7 param 0) (the-as uint 4)) - (let ((t9-10 send-event-function) - (v1-67 gp-1) - ) - (t9-10 - (if v1-67 - (-> v1-67 extra process) - ) - a1-7 - ) - ) - ) - (let ((s2-1 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s2-1) (seconds 10)) - (suspend) - ) - ) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) (process->ppointer self)) - (set! (-> a1-8 num-params) 1) - (set! (-> a1-8 message) 'guards-alive) - (set! (-> a1-8 param 0) (the-as uint 4)) - (let ((t9-11 send-event-function) - (v1-79 s5-0) - ) - (t9-11 - (if v1-79 - (-> v1-79 extra process) - ) - a1-8 - ) - ) - ) - (let ((a1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-9 from) (process->ppointer self)) - (set! (-> a1-9 num-params) 1) - (set! (-> a1-9 message) 'guards-alive) - (set! (-> a1-9 param 0) (the-as uint 0)) - (let ((t9-12 send-event-function) - (v1-85 gp-1) - ) - (t9-12 - (if v1-85 - (-> v1-85 extra process) - ) - a1-9 - ) - ) - ) - ) - (let ((s3-2 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s3-2) (seconds 10)) - (suspend) - ) - ) - (let ((a1-10 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-10 from) (process->ppointer self)) - (set! (-> a1-10 num-params) 1) - (set! (-> a1-10 message) 'guards-alive) - (set! (-> a1-10 param 0) (the-as uint 2)) - (let ((t9-13 send-event-function) - (v1-99 s5-0) - ) - (t9-13 - (if v1-99 - (-> v1-99 extra process) - ) - a1-10 - ) - ) - ) - (let ((a1-11 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-11 from) (process->ppointer self)) - (set! (-> a1-11 num-params) 1) - (set! (-> a1-11 message) 'guards-alive) - (set! (-> a1-11 param 0) (the-as uint 2)) - (let ((t9-14 send-event-function) - (v1-106 gp-1) - ) - (t9-14 - (if v1-106 - (-> v1-106 extra process) - ) - a1-11 - ) - ) - ) - (let ((s3-3 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s3-3) (seconds 10)) - (suspend) - ) - ) - (dotimes (s3-4 10) - (let ((v1-114 s4-0)) - (if (not (if v1-114 - (-> v1-114 extra process) - ) - ) - (goto cfg-74) - ) - ) - (let ((s2-2 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s2-2) (seconds 1)) - (suspend) - ) - ) - ) - (label cfg-74) - (let ((a1-12 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-12 from) (process->ppointer self)) - (set! (-> a1-12 num-params) 0) - (set! (-> a1-12 message) 'stop-spawning) - (let ((t9-15 send-event-function) - (v1-128 s5-0) - ) - (t9-15 - (if v1-128 - (-> v1-128 extra process) - ) - a1-12 - ) - ) - ) - (let ((a1-13 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-13 from) (process->ppointer self)) - (set! (-> a1-13 num-params) 0) - (set! (-> a1-13 message) 'stop-spawning) - (let ((t9-16 send-event-function) - (v1-133 gp-1) - ) - (t9-16 - (if v1-133 - (-> v1-133 extra process) - ) - a1-13 - ) - ) - ) - (while (let ((v1-141 s4-0)) - (or (if v1-141 - (-> v1-141 extra process) - ) - (let ((a1-14 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-14 from) (process->ppointer self)) - (set! (-> a1-14 num-params) 0) - (set! (-> a1-14 message) 'guards-alive-count) - (let ((t9-17 send-event-function) - (v1-146 s5-0) - ) - (> (the-as uint (t9-17 - (if v1-146 - (-> v1-146 extra process) - ) - a1-14 - ) - ) - 0 - ) - ) - ) - (let ((a1-15 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-15 from) (process->ppointer self)) - (set! (-> a1-15 num-params) 0) - (set! (-> a1-15 message) 'guards-alive-count) - (let ((t9-18 send-event-function) - (v1-151 gp-1) - ) - (> (the-as uint (t9-18 - (if v1-151 - (-> v1-151 extra process) - ) - a1-15 - ) - ) - 0 - ) - ) - ) + (game-task-node forest-protect-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self start-time) (-> self clock frame-counter)) + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.5)) + (suspend) + ) + ) + (let ((s5-0 (entity-by-name "transport-level-1")) + (gp-1 (entity-by-name "transport-level-2")) + ) + (let ((s4-0 (entity-by-name "forest-hover-manager-1"))) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'spawn-time) + (set! (-> a1-0 param 0) (the-as uint 150)) + (let ((t9-3 send-event-function) + (v1-11 s5-0) + ) + (t9-3 + (if v1-11 + (-> v1-11 extra process) + ) + a1-0 + ) + ) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'spawn-time) + (set! (-> a1-1 param 0) (the-as uint 150)) + (let ((t9-4 send-event-function) + (v1-18 gp-1) + ) + (t9-4 + (if v1-18 + (-> v1-18 extra process) + ) + a1-1 + ) + ) + ) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'guards-alive) + (set! (-> a1-2 param 0) (the-as uint 0)) + (let ((t9-5 send-event-function) + (v1-24 s5-0) + ) + (t9-5 + (if v1-24 + (-> v1-24 extra process) + ) + a1-2 + ) + ) + ) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 1) + (set! (-> a1-3 message) 'guards-alive) + (set! (-> a1-3 param 0) (the-as uint 3)) + (let ((t9-6 send-event-function) + (v1-31 gp-1) + ) + (t9-6 + (if v1-31 + (-> v1-31 extra process) + ) + a1-3 + ) + ) + ) + (let ((s3-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s3-0) (seconds 15)) + (suspend) + ) + ) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 1) + (set! (-> a1-4 message) 'guards-alive) + (set! (-> a1-4 param 0) (the-as uint 3)) + (let ((t9-7 send-event-function) + (v1-43 s5-0) + ) + (t9-7 + (if v1-43 + (-> v1-43 extra process) + ) + a1-4 + ) + ) + ) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer self)) + (set! (-> a1-5 num-params) 1) + (set! (-> a1-5 message) 'guards-alive) + (set! (-> a1-5 param 0) (the-as uint 0)) + (let ((t9-8 send-event-function) + (v1-49 gp-1) + ) + (t9-8 + (if v1-49 + (-> v1-49 extra process) + ) + a1-5 + ) + ) + ) + (dotimes (s3-1 3) + (let ((s2-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s2-0) (seconds 10)) + (suspend) + ) + ) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 1) + (set! (-> a1-6 message) 'guards-alive) + (set! (-> a1-6 param 0) (the-as uint 0)) + (let ((t9-9 send-event-function) + (v1-60 s5-0) + ) + (t9-9 + (if v1-60 + (-> v1-60 extra process) + ) + a1-6 + ) + ) + ) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 1) + (set! (-> a1-7 message) 'guards-alive) + (set! (-> a1-7 param 0) (the-as uint 4)) + (let ((t9-10 send-event-function) + (v1-67 gp-1) + ) + (t9-10 + (if v1-67 + (-> v1-67 extra process) + ) + a1-7 + ) + ) + ) + (let ((s2-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s2-1) (seconds 10)) + (suspend) + ) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer self)) + (set! (-> a1-8 num-params) 1) + (set! (-> a1-8 message) 'guards-alive) + (set! (-> a1-8 param 0) (the-as uint 4)) + (let ((t9-11 send-event-function) + (v1-79 s5-0) + ) + (t9-11 + (if v1-79 + (-> v1-79 extra process) + ) + a1-8 + ) + ) + ) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer self)) + (set! (-> a1-9 num-params) 1) + (set! (-> a1-9 message) 'guards-alive) + (set! (-> a1-9 param 0) (the-as uint 0)) + (let ((t9-12 send-event-function) + (v1-85 gp-1) + ) + (t9-12 + (if v1-85 + (-> v1-85 extra process) + ) + a1-9 + ) + ) + ) + ) + (let ((s3-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s3-2) (seconds 10)) + (suspend) + ) + ) + (let ((a1-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-10 from) (process->ppointer self)) + (set! (-> a1-10 num-params) 1) + (set! (-> a1-10 message) 'guards-alive) + (set! (-> a1-10 param 0) (the-as uint 2)) + (let ((t9-13 send-event-function) + (v1-99 s5-0) + ) + (t9-13 + (if v1-99 + (-> v1-99 extra process) + ) + a1-10 + ) + ) + ) + (let ((a1-11 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-11 from) (process->ppointer self)) + (set! (-> a1-11 num-params) 1) + (set! (-> a1-11 message) 'guards-alive) + (set! (-> a1-11 param 0) (the-as uint 2)) + (let ((t9-14 send-event-function) + (v1-106 gp-1) + ) + (t9-14 + (if v1-106 + (-> v1-106 extra process) + ) + a1-11 + ) + ) + ) + (let ((s3-3 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s3-3) (seconds 10)) + (suspend) + ) + ) + (dotimes (s3-4 10) + (let ((v1-114 s4-0)) + (if (not (if v1-114 + (-> v1-114 extra process) + ) + ) + (goto cfg-74) + ) + ) + (let ((s2-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s2-2) (seconds 1)) + (suspend) + ) + ) + ) + (label cfg-74) + (let ((a1-12 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-12 from) (process->ppointer self)) + (set! (-> a1-12 num-params) 0) + (set! (-> a1-12 message) 'stop-spawning) + (let ((t9-15 send-event-function) + (v1-128 s5-0) + ) + (t9-15 + (if v1-128 + (-> v1-128 extra process) + ) + a1-12 + ) + ) + ) + (let ((a1-13 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-13 from) (process->ppointer self)) + (set! (-> a1-13 num-params) 0) + (set! (-> a1-13 message) 'stop-spawning) + (let ((t9-16 send-event-function) + (v1-133 gp-1) + ) + (t9-16 + (if v1-133 + (-> v1-133 extra process) + ) + a1-13 + ) + ) + ) + (while (let ((v1-141 s4-0)) + (or (if v1-141 + (-> v1-141 extra process) + ) + (let ((a1-14 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-14 from) (process->ppointer self)) + (set! (-> a1-14 num-params) 0) + (set! (-> a1-14 message) 'guards-alive-count) + (let ((t9-17 send-event-function) + (v1-146 s5-0) + ) + (> (the-as uint (t9-17 + (if v1-146 + (-> v1-146 extra process) ) + a1-14 ) - (let ((s3-5 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s3-5) (seconds 1)) - (suspend) - ) - ) ) - ) - (let ((s4-1 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s4-1) (seconds 0.5)) - (suspend) + 0 + ) + ) + ) + (let ((a1-15 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-15 from) (process->ppointer self)) + (set! (-> a1-15 num-params) 0) + (set! (-> a1-15 message) 'guards-alive-count) + (let ((t9-18 send-event-function) + (v1-151 gp-1) + ) + (> (the-as uint (t9-18 + (if v1-151 + (-> v1-151 extra process) + ) + a1-15 + ) ) - ) - (set-setting! 'entity-name "camera-260" 0 0) - (set-setting! 'process-mask 'set 0 (process-mask movie enemy)) - (process-grab? *target* #f) - (let ((s4-2 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s4-2) (seconds 0.5)) - (suspend) - ) - ) - (send-event - (if s5-0 - (-> s5-0 extra process) - ) - 'leave - ) - (let ((s5-1 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s5-1) (seconds 0.2)) - (suspend) - ) - ) - (send-event - (if gp-1 - (-> gp-1 extra process) - ) - 'leave - ) - ) - (let ((gp-2 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-2) (seconds 3)) - (suspend) - ) - ) - (remove-setting! 'entity-name) - (remove-setting! 'process-mask) - (process-release? *target*) - (let ((gp-3 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-3) (seconds 3)) - (suspend) - ) - ) - (go-virtual complete) - (while *target* - (suspend) - ) - (go-virtual fail) - (none) - ) + 0 + ) + ) + ) + ) + ) + (let ((s3-5 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s3-5) (seconds 1)) + (suspend) + ) + ) ) + ) + (let ((s4-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s4-1) (seconds 0.5)) + (suspend) + ) + ) + (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 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s4-2) (seconds 0.5)) + (suspend) + ) + ) + (send-event + (if s5-0 + (-> s5-0 extra process) + ) + 'leave + ) + (let ((s5-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s5-1) (seconds 0.2)) + (suspend) + ) + ) + (send-event + (if gp-1 + (-> gp-1 extra process) + ) + 'leave + ) + ) + (let ((gp-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-2) (seconds 3)) + (suspend) + ) + ) + (remove-setting! 'entity-name) + (remove-setting! 'process-mask) + (process-release? *target*) + (let ((gp-3 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-3) (seconds 3)) + (suspend) + ) + ) + (go-virtual complete) + (while *target* + (suspend) + ) + (go-virtual fail) + (none) + ) ) (set-subtask-hook! *game-info* - 200 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (let ((a0-1 (process-by-name "transport-level-1" *active-pool*))) - (if a0-1 - (send-event a0-1 'leave) - ) - ) - (let ((a0-3 (process-by-name "transport-level-2" *active-pool*))) - (if a0-3 - (send-event a0-3 'leave) - ) - ) - (speech-control-method-9 *speech-control*) - (none) - ) + (game-task-node forest-protect-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (let ((a0-1 (process-by-name "transport-level-1" *active-pool*))) + (if a0-1 + (send-event a0-1 'leave) ) + ) + (let ((a0-3 (process-by-name "transport-level-2" *active-pool*))) + (if a0-3 + (send-event a0-3 'leave) + ) + ) + (speech-control-method-9 *speech-control*) + (none) + ) ) (defun forest-login () diff --git a/goal_src/jak2/levels/forest/lifeseed/protect.gc b/goal_src/jak2/levels/forest/lifeseed/protect.gc index ad953b8484..cb6b02a5b8 100644 --- a/goal_src/jak2/levels/forest/lifeseed/protect.gc +++ b/goal_src/jak2/levels/forest/lifeseed/protect.gc @@ -267,353 +267,342 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 142 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set-setting! 'airlock #f 0 0) - (let ((v1-5 (entity-by-name "parking-spot-1"))) - (if v1-5 - (logior! (-> v1-5 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-7 (entity-by-name "parking-spot-2"))) - (if v1-7 - (logior! (-> v1-7 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-9 (entity-by-name "parking-spot-12"))) - (if v1-9 - (logior! (-> v1-9 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-11 (entity-by-name "parking-spot-59"))) - (if v1-11 - (logior! (-> v1-11 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-13 (entity-by-name "parking-spot-60"))) - (if v1-13 - (logior! (-> v1-13 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-15 (entity-by-name "parking-spot-61"))) - (if v1-15 - (logior! (-> v1-15 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-17 (entity-by-name "parking-spot-62"))) - (if v1-17 - (logior! (-> v1-17 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((gp-0 *traffic-manager*)) - (send-event gp-0 'set-alert-level 2) - (send-event gp-0 'set-alert-duration #xa4cb80) - (send-event gp-0 'deactivate-by-type 6) - (send-event gp-0 'deactivate-by-type 18) - (send-event gp-0 'deactivate-by-type 19) - (send-event gp-0 'deactivate-by-type 20) - (send-event gp-0 'deactivate-by-type 11) - (send-event gp-0 'deactivate-by-type 12) - (send-event gp-0 'deactivate-by-type 13) - (send-event gp-0 'deactivate-by-type 14) - (send-event gp-0 'deactivate-by-type 15) - (send-event gp-0 'deactivate-by-type 16) - (send-event gp-0 'set-object-target-count 6 0) - (send-event gp-0 'set-object-target-count 18 0) - (send-event gp-0 'set-object-target-count 19 0) - (send-event gp-0 'set-object-target-count 11 0) - (send-event gp-0 'set-object-target-count 12 0) - (send-event gp-0 'set-object-target-count 13 0) - (send-event gp-0 'set-object-target-count 14 0) - (send-event gp-0 'set-object-target-count 15 0) - (send-event gp-0 'set-object-target-count 16 0) - (send-event gp-0 'set-object-auto-activate 6 #f) - (send-event gp-0 'set-guard-target-count-range 0 4 4) - (send-event gp-0 'set-guard-target-count-range 1 5 5) - (send-event gp-0 'set-guard-target-count-range 4 0 0) - (send-event gp-0 'set-guard-target-count-range 5 0 0) - ) - (speech-control-method-10 *speech-control* 6 (new 'static 'speech-type-info - :channel #x1 - :priority -2 - :min-delay #x258 - :max-delay #x4b0 - :list (new 'static 'boxed-array :type string - "kg320a" - "kg321a" - "kg322a" - "kg323a" - "kg324a" - "kg325a" - "kg326a" - "kg327a" - "kg328a" - "kg329a" - "kg330a" - "kg331a" - "kg332a" - "kg333a" - "kg334a" - "kg335a" - "kg336a" - "kg337a" - "kg338a" - "kg339a" - "kg340a" - "kg341a" - "kg342a" - "kg343a" - "kg344a" - "kg345a" - "kg347a" - ) - ) - ) - (dotimes (gp-1 (length *city-slums-transport-info*)) - (set! (-> *city-slums-transport-info* gp-1 spawned) #f) - ) - (let ((gp-2 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-2 pos quad) (-> (new 'static 'vector :x 1666621.9 :y 32766.771 :z -1103984.6 :w 1.0) quad)) - (quaternion-identity! (-> gp-2 quat)) - (set! (-> gp-2 flags) (task-arrow-flags)) - (set! (-> gp-2 map-icon) (the-as uint 15)) - (set! (-> self arrow) (process->handle (task-arrow-spawn gp-2 (the-as task-arrow self)))) - ) - (set! (-> self data-int32 0) 0) - 0 - (none) + (game-task-node city-protect-water-slums-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set-setting! 'airlock #f 0.0 0) + (let ((v1-5 (entity-by-name "parking-spot-1"))) + (if v1-5 + (logior! (-> v1-5 extra perm status) (entity-perm-status bit-9)) + ) ) + (let ((v1-7 (entity-by-name "parking-spot-2"))) + (if v1-7 + (logior! (-> v1-7 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-9 (entity-by-name "parking-spot-12"))) + (if v1-9 + (logior! (-> v1-9 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-11 (entity-by-name "parking-spot-59"))) + (if v1-11 + (logior! (-> v1-11 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-13 (entity-by-name "parking-spot-60"))) + (if v1-13 + (logior! (-> v1-13 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-15 (entity-by-name "parking-spot-61"))) + (if v1-15 + (logior! (-> v1-15 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-17 (entity-by-name "parking-spot-62"))) + (if v1-17 + (logior! (-> v1-17 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-alert-level 2) + (send-event gp-0 'set-alert-duration #xa4cb80) + (send-event gp-0 'deactivate-by-type 6) + (send-event gp-0 'deactivate-by-type 18) + (send-event gp-0 'deactivate-by-type 19) + (send-event gp-0 'deactivate-by-type 20) + (send-event gp-0 'deactivate-by-type 11) + (send-event gp-0 'deactivate-by-type 12) + (send-event gp-0 'deactivate-by-type 13) + (send-event gp-0 'deactivate-by-type 14) + (send-event gp-0 'deactivate-by-type 15) + (send-event gp-0 'deactivate-by-type 16) + (send-event gp-0 'set-object-target-count 6 0) + (send-event gp-0 'set-object-target-count 18 0) + (send-event gp-0 'set-object-target-count 19 0) + (send-event gp-0 'set-object-target-count 11 0) + (send-event gp-0 'set-object-target-count 12 0) + (send-event gp-0 'set-object-target-count 13 0) + (send-event gp-0 'set-object-target-count 14 0) + (send-event gp-0 'set-object-target-count 15 0) + (send-event gp-0 'set-object-target-count 16 0) + (send-event gp-0 'set-object-auto-activate 6 #f) + (send-event gp-0 'set-guard-target-count-range 0 4 4) + (send-event gp-0 'set-guard-target-count-range 1 5 5) + (send-event gp-0 'set-guard-target-count-range 4 0 0) + (send-event gp-0 'set-guard-target-count-range 5 0 0) + ) + (speech-control-method-10 *speech-control* 6 (new 'static 'speech-type-info + :channel #x1 + :priority -2 + :min-delay #x258 + :max-delay #x4b0 + :list (new 'static 'boxed-array :type string + "kg320a" + "kg321a" + "kg322a" + "kg323a" + "kg324a" + "kg325a" + "kg326a" + "kg327a" + "kg328a" + "kg329a" + "kg330a" + "kg331a" + "kg332a" + "kg333a" + "kg334a" + "kg335a" + "kg336a" + "kg337a" + "kg338a" + "kg339a" + "kg340a" + "kg341a" + "kg342a" + "kg343a" + "kg344a" + "kg345a" + "kg347a" + ) + ) + ) + (dotimes (gp-1 (length *city-slums-transport-info*)) + (set! (-> *city-slums-transport-info* gp-1 spawned) #f) + ) + (let ((gp-2 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-2 pos quad) (-> (new 'static 'vector :x 1666621.9 :y 32766.771 :z -1103984.6 :w 1.0) quad)) + (quaternion-identity! (-> gp-2 quat)) + (set! (-> gp-2 flags) (task-arrow-flags)) + (set! (-> gp-2 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-2 (the-as task-arrow self)))) + ) + (set! (-> self data-int32 0) 0) + 0 + (none) ) ) (set-subtask-hook! *game-info* - 142 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (let ((a0-0 *traffic-manager*)) - (send-event a0-0 'restore-default-settings) - ) - (none) - ) - ) + (game-task-node city-protect-water-slums-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (let ((a0-0 *traffic-manager*)) + (send-event a0-0 'restore-default-settings) + ) + (none) + ) ) (set-subtask-hook! *game-info* - 142 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (local-vars (s5-4 object)) - (let ((s4-0 (new 'static 'vector :x 1666621.9 :y 32766.771 :z -1103984.6 :w 1.0)) - (gp-0 (vector-z-quaternion! - (new 'stack-no-clear 'vector) - (new 'static 'quaternion :x -0.0015 :y -0.199 :z 0.0002 :w -0.9799) + (game-task-node city-protect-water-slums-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (local-vars (s5-4 object)) + (let ((s4-0 (new 'static 'vector :x 1666621.9 :y 32766.771 :z -1103984.6 :w 1.0)) + (gp-0 (vector-z-quaternion! + (new 'stack-no-clear 'vector) + (new 'static 'quaternion :x -0.0015 :y -0.199 :z 0.0002 :w -0.9799) + ) + ) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-! s5-0 (target-pos 0) s4-0) + (let ((v1-1 s5-0)) + (if (and (< (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 122880.0) + (< 0.0 (vector-dot s5-0 gp-0)) + ) + (set! (-> self data-int32 0) 1) + ) + ) + ) + (cond + ((zero? (-> self data-int32 0)) + (dotimes (gp-1 (length *city-slums-transport-info*)) + (let ((s5-1 (-> *city-slums-transport-info* gp-1))) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + 0.0 + (let ((f0-7 (vector-vector-xz-distance (target-pos 0) (-> s5-1 t-pos)))) + (cond + ((and (< f0-7 327680.0) (< 204800.0 f0-7)) + (when (and (not (handle->process (-> self slave gp-1))) + (< (the int (-> self data-float gp-1)) (-> self clock frame-counter)) + ) + (let ((s4-2 (new 'stack-no-clear 'transport-params))) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (set! (-> s3-2 quad) (-> s5-1 t-pos quad)) + (set! (-> s4-2 spawn-pos quad) (-> s5-1 t-pos quad)) + (quaternion-copy! (-> s4-2 quat) (-> s5-1 t-quat)) + (set! (-> s4-2 max-guard) (-> s5-1 num-guard)) + (set! (-> s4-2 max-guard) (the-as uint 8)) + (set! (-> s4-2 turret?) #t) + (set! (-> s4-2 speeches?) #t) + (set! (-> s3-2 y) 0.0) + ) + (let* ((s5-2 (entity-nav-mesh-by-aid (the-as actor-id 9070))) + (a0-16 (if (type? s5-2 entity-nav-mesh) + s5-2 + ) + ) + ) + (when a0-16 + (set! (-> s4-2 nav-mesh) (-> a0-16 nav-mesh)) + (set! (-> self slave gp-1) (ppointer->handle (process-spawn transport s4-2 :to self))) + ) + ) ) ) - (s5-0 (new 'stack-no-clear 'vector)) + ) + ((< 368640.0 f0-7) + (if (handle->process (-> self slave gp-1)) + (send-event (handle->process (-> self slave gp-1)) 'leave) + ) + ) + ) + ) + ) + (if (and (handle->process (-> self slave gp-1)) + (begin + (let ((s5-5 #t) + (a1-11 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-11 from) (process->ppointer self)) + (set! (-> a1-11 num-params) 0) + (set! (-> a1-11 message) 'guards-left) + (let ((v1-75 (the-as object (send-event-function (handle->process (-> self slave gp-1)) a1-11)))) + (cmove-#f-nonzero s5-4 v1-75 s5-5) + ) + ) + s5-4 + ) + ) + (set! (-> self data-float gp-1) (the float (+ (-> self clock frame-counter) (seconds 20)))) + ) + ) + ) + (else + (let ((gp-2 0)) + (dotimes (s5-6 (length *city-slums-transport-info*)) + (when (handle->process (-> self slave s5-6)) + (send-event (handle->process (-> self slave s5-6)) 'leave) + (+! gp-2 1) + ) ) - (vector-! s5-0 (target-pos 0) s4-0) - (let ((v1-1 s5-0)) - (if (and (< (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 122880.0) - (< 0.0 (vector-dot s5-0 gp-0)) - ) - (set! (-> self data-int32 0) 1) + (if (zero? gp-2) + (go-virtual complete) ) ) ) - (cond - ((zero? (-> self data-int32 0)) - (dotimes (gp-1 (length *city-slums-transport-info*)) - (let ((s5-1 (-> *city-slums-transport-info* gp-1))) - (new 'stack-no-clear 'vector) - (new 'stack-no-clear 'vector) - (new 'stack-no-clear 'vector) - (new 'stack-no-clear 'vector) - 0.0 - (let ((f0-7 (vector-vector-xz-distance (target-pos 0) (-> s5-1 t-pos)))) - (cond - ((and (< f0-7 327680.0) (< 204800.0 f0-7)) - (when (and (not (handle->process (-> self slave gp-1))) - (< (the int (-> self data-float gp-1)) (-> self clock frame-counter)) - ) - (let ((s4-2 (new 'stack-no-clear 'transport-params))) - (let ((s3-2 (new 'stack-no-clear 'vector))) - (set! (-> s3-2 quad) (-> s5-1 t-pos quad)) - (set! (-> s4-2 spawn-pos quad) (-> s5-1 t-pos quad)) - (quaternion-copy! (-> s4-2 quat) (-> s5-1 t-quat)) - (set! (-> s4-2 max-guard) (-> s5-1 num-guard)) - (set! (-> s4-2 max-guard) (the-as uint 8)) - (set! (-> s4-2 turret?) #t) - (set! (-> s4-2 speeches?) #t) - (set! (-> s3-2 y) 0.0) - ) - (let* ((s5-2 (entity-nav-mesh-by-aid (the-as actor-id 9070))) - (a0-16 (if (type? s5-2 entity-nav-mesh) - s5-2 - ) - ) - ) - (when a0-16 - (set! (-> s4-2 nav-mesh) (-> a0-16 nav-mesh)) - (set! (-> self slave gp-1) (ppointer->handle (process-spawn transport s4-2 :to self))) - ) - ) - ) - ) - ) - ((< 368640.0 f0-7) - (if (handle->process (-> self slave gp-1)) - (send-event (handle->process (-> self slave gp-1)) 'leave) - ) - ) - ) - ) - ) - (if (and (handle->process (-> self slave gp-1)) - (begin - (let ((s5-5 #t) - (a1-11 (new 'stack-no-clear 'event-message-block)) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-protect-water-slums-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (until #f + (suspend) + ) + #f + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-protect-water-slums-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (send-event (handle->process (-> self arrow)) 'leave) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (talker-spawn-func (-> *talker-speech* 185) *entity-pool* (target-pos 0) (the-as region #f)) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-protect-water-slums-resolution) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager () (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-protect-water-slums-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-protect-water-slums-fight) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set! (-> self slave 0) + (ppointer->handle (seal-of-mar-spawn + self + (new 'static 'vector :x 3150154.5 :y 41696.617 :z -2989634.8 :w 1.0) + (new 'static 'vector :x -0.0086 :y -0.0227 :z -0.691 :w 0.7223) + (new 'static 'vector :x 0.06 :y 0.06 :z 0.06 :w 1.0) + ) ) - (set! (-> a1-11 from) (process->ppointer self)) - (set! (-> a1-11 num-params) 0) - (set! (-> a1-11 message) 'guards-left) - (let ((v1-75 (the-as object (send-event-function (handle->process (-> self slave gp-1)) a1-11)))) - (cmove-#f-nonzero s5-4 v1-75 s5-5) - ) - ) - s5-4 - ) - ) - (set! (-> self data-float gp-1) (the float (+ (-> self clock frame-counter) (seconds 20)))) + ) + (set! (-> self slave 1) (the-as handle #f)) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-protect-water-slums-fight) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (when (handle->process (-> self slave 0)) + (let ((f0-0 + (vector-vector-xz-distance (new 'static 'vector :x 3132661.8 :y 33669.12 :z -2965708.8 :w 1.0) (target-pos 0)) + ) + ) + (cond + ((< f0-0 20480.0) + (when (!= (-> self slave 0) #f) + (deactivate (handle->process (-> self slave 0))) + (set! (-> self slave 0) (the-as handle #f)) + ) + (if (= (-> self slave 1) #f) + (set! (-> self slave 1) + (ppointer->handle (process-spawn scene-player :init scene-player-init "city-protect-slums-intro" #t #f)) + ) ) ) - ) - (else - (let ((gp-2 0)) - (dotimes (s5-6 (length *city-slums-transport-info*)) - (when (handle->process (-> self slave s5-6)) - (send-event (handle->process (-> self slave s5-6)) 'leave) - (+! gp-2 1) - ) - ) - (if (zero? gp-2) - (go-virtual complete) - ) - ) + ((< f0-0 163840.0) + (script-eval '(want-anim "city-protect-slums-intro")) + ) ) ) - (none) - ) - ) - ) - -(set-subtask-hook! *game-info* 142 3 (the-as (function object) (lambda :behavior task-manager - () - (until #f - (suspend) - ) - #f - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 142 - 4 - (the-as - (function object) - (lambda :behavior task-manager - () - (send-event (handle->process (-> self arrow)) 'leave) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (talker-spawn-func (-> *talker-speech* 185) *entity-pool* (target-pos 0) (the-as region #f)) - (none) - ) - ) - ) - -(set-subtask-hook! *game-info* 142 5 (the-as (function object) (lambda :behavior task-manager () (none)))) - -(set-subtask-hook! - *game-info* - 142 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) - ) - -(set-subtask-hook! - *game-info* - 141 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self slave 0) - (ppointer->handle (seal-of-mar-spawn - self - (new 'static 'vector :x 3150154.5 :y 41696.617 :z -2989634.8 :w 1.0) - (new 'static 'vector :x -0.0086 :y -0.0227 :z -0.691 :w 0.7223) - (new 'static 'vector :x 0.06 :y 0.06 :z 0.06 :w 1.0) - ) - ) - ) - (set! (-> self slave 1) (the-as handle #f)) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 141 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (handle->process (-> self slave 0)) - (let ((f0-0 - (vector-vector-xz-distance (new 'static 'vector :x 3132661.8 :y 33669.12 :z -2965708.8 :w 1.0) (target-pos 0)) - ) - ) - (cond - ((< f0-0 20480.0) - (when (!= (-> self slave 0) #f) - (deactivate (handle->process (-> self slave 0))) - (set! (-> self slave 0) (the-as handle #f)) - ) - (if (= (-> self slave 1) #f) - (set! (-> self slave 1) - (ppointer->handle (process-spawn scene-player :init scene-player-init "city-protect-slums-intro" #t #f)) - ) - ) - ) - ((< f0-0 163840.0) - (script-eval '(want-anim "city-protect-slums-intro")) - ) - ) - ) - ) - (none) ) + (none) ) ) diff --git a/goal_src/jak2/levels/forest/pegasus.gc b/goal_src/jak2/levels/forest/pegasus.gc index b8316b9590..437d1279e7 100644 --- a/goal_src/jak2/levels/forest/pegasus.gc +++ b/goal_src/jak2/levels/forest/pegasus.gc @@ -1021,7 +1021,7 @@ The faster it's moving the fast it flaps it's wings, etc ) (set! (-> self state-time) (-> self clock frame-counter)) (set! (-> self far-time) (-> self clock frame-counter)) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) (none) ) :exit (behavior () @@ -1081,7 +1081,7 @@ The faster it's moving the fast it flaps it's wings, etc ) (set! (-> self near-timer) 3000) (set! (-> self far-time) (-> self clock frame-counter)) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) (none) ) :exit (behavior () @@ -1171,7 +1171,7 @@ The faster it's moving the fast it flaps it's wings, etc (t9-0) ) ) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) (none) ) :exit (behavior () @@ -1252,7 +1252,7 @@ The faster it's moving the fast it flaps it's wings, etc (defmethod init-enemy-collision! pegasus ((obj pegasus)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (stack-size-set! (-> obj main-thread) 512) + (stack-size-set! (-> obj main-thread) 512) ;; added (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) @@ -1410,8 +1410,8 @@ The faster it's moving the fast it flaps it's wings, etc (set-subtask-hook! *game-info* - 107 - 0 + (game-task-node forest-scouts-pegasus) + TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () (set! (-> *game-info* controller 0) (process->handle self)) @@ -1436,48 +1436,42 @@ The faster it's moving the fast it flaps it's wings, etc (set-subtask-hook! *game-info* - 107 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (local-vars (data int)) - (set! (-> self start-time) (-> self clock frame-counter)) - (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-pegasus :init hud-init-by-other :to self))) - (while (> (-> self data-int32 0) 0) - (set! data (-> self data-int32 1)) - (when (-> self actor-group 0) - (dotimes (actor-group (the-as int (-> self actor-group 0 0))) - (let ((actor (-> (&+ (-> self actor-group 0) (* actor-group 8)) 3))) - (if (and actor (logtest? (-> actor extra perm status) (entity-perm-status subtask-complete))) - (set! data (+ data -1)) - ) - ) + (game-task-node forest-scouts-pegasus) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (local-vars (data int)) + (set! (-> self start-time) (-> self clock frame-counter)) + (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-pegasus :init hud-init-by-other :to self))) + (while (> (-> self data-int32 0) 0) + (set! data (-> self data-int32 1)) + (when (-> self actor-group 0) + (dotimes (actor-group (the-as int (-> self actor-group 0 0))) + (let ((actor (-> (&+ (-> self actor-group 0) (* actor-group 8)) 3))) + (if (and actor (logtest? (-> actor extra perm status) (entity-perm-status subtask-complete))) + (set! data (+ data -1)) + ) ) ) - (let ((_data data)) - (set! (-> self data-int32 0) _data) - (set! (-> *game-info* counter) (the float _data)) - ) - (suspend) ) - (go-virtual complete) - (none) + (let ((_data data)) + (set! (-> self data-int32 0) _data) + (set! (-> *game-info* counter) (the float _data)) + ) + (suspend) ) + (go-virtual complete) + (none) ) ) (set-subtask-hook! *game-info* - 107 - 4 - (the-as - (function object) - (lambda () - (task-node-close! (game-task-node forest-scouts-resolution)) - (talker-spawn-func (-> *talker-speech* 90) *entity-pool* (target-pos 0) (the-as region #f)) - (none) - ) + (game-task-node forest-scouts-pegasus) + TASK_MANAGER_COMPLETE_HOOK + (lambda () + (task-node-close! (game-task-node forest-scouts-resolution)) + (talker-spawn-func (-> *talker-speech* 90) *entity-pool* (target-pos 0) (the-as region #f)) + (none) ) ) diff --git a/goal_src/jak2/levels/fortress/ammo_dump/fordumpa-obs.gc b/goal_src/jak2/levels/fortress/ammo_dump/fordumpa-obs.gc index 045b965af4..b5b57f0e5d 100644 --- a/goal_src/jak2/levels/fortress/ammo_dump/fordumpa-obs.gc +++ b/goal_src/jak2/levels/fortress/ammo_dump/fordumpa-obs.gc @@ -161,8 +161,8 @@ ) ) (when v1-22 - (set-setting! 'entity-name "camera-180" 0 0) - (set-setting! 'process-mask 'set 0 (process-mask movie enemy)) + (set-setting! 'entity-name "camera-180" 0.0 0) + (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (process-grab? *target* #f) (let ((a1-13 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-13 from) (process->ppointer self)) diff --git a/goal_src/jak2/levels/fortress/ammo_dump/fordumpc-obs.gc b/goal_src/jak2/levels/fortress/ammo_dump/fordumpc-obs.gc index e0a3d56765..b624070bb1 100644 --- a/goal_src/jak2/levels/fortress/ammo_dump/fordumpc-obs.gc +++ b/goal_src/jak2/levels/fortress/ammo_dump/fordumpc-obs.gc @@ -629,8 +629,8 @@ This commonly includes things such as: (while (not (process-grab? *target* #f)) (suspend) ) - (set-setting! 'entity-name "camera-182" 0 0) - (set-setting! 'process-mask 'set 0 (process-mask movie enemy)) + (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 (-> self clock frame-counter))) (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.75)) @@ -749,8 +749,8 @@ This commonly includes things such as: ) ) :enter (behavior () - (set-setting! 'allow-pause #f 0 0) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (none) ) :exit (behavior () diff --git a/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank-turret.gc b/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank-turret.gc index e7ae60b60d..22c1c4cac2 100644 --- a/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank-turret.gc +++ b/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank-turret.gc @@ -601,7 +601,7 @@ ) (ja-no-eval :group! (-> self draw art-group data 3) :num! zero) (ja-post) - (set-setting! 'spotlight-color #f 0 (the-as uint #x80a0a0ff)) + (set-setting! 'spotlight-color #f 0.0 (the-as uint #x80a0a0ff)) (go-virtual idle) (none) ) @@ -722,7 +722,7 @@ ) ;; WARN: Return type mismatch pointer vs symbol. -;; ERROR: Failed store: (s.w! (+ t5-0 8) 0) at op 82 +;; ERROR: Failed load: (set! t0-6 (l.d (+ a0-28 8))) at op 170 (defmethod fort-robotank-turret-method-32 fort-robotank-turret ((obj fort-robotank-turret) (arg0 (inline-array vector))) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) diff --git a/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank.gc b/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank.gc index d99ac351d7..ce31f8d273 100644 --- a/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank.gc +++ b/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank.gc @@ -205,7 +205,7 @@ (new 'static 'fort-robotank-segment-event :event-type 'code :pos-norm 0.01 - :param-obj (lambda () (set-setting! 'target-height 'abs -981467136 0) (none)) + :param-obj (lambda () (set-setting! 'target-height 'abs (meters -1) 0) (none)) ) (new 'static 'fort-robotank-segment-event :event-type 'send-event @@ -595,11 +595,11 @@ ) ) (('pov-cam-on) - (set-setting! 'mode-name 'cam-pov-track 0 0) - (set-setting! 'allow-look-around #f 0 0) - (set-setting! 'target-height 'abs -968884224 0) + (set-setting! 'mode-name 'cam-pov-track 0.0 0) + (set-setting! 'allow-look-around #f 0.0 0) + (set-setting! 'target-height 'abs (meters -3) 0) (let ((v1-27 (process->ppointer obj))) - (set-setting! 'pov-handle v1-27 #x40400000 (-> v1-27 0 pid)) + (set-setting! 'pov-handle v1-27 3.0 (-> v1-27 0 pid)) ) (set-setting! 'pov-offset 'asdf (-> obj pov-cam-offset) 0) (send-event (handle->process (-> obj turret)) 'pov-cam-on) @@ -625,8 +625,8 @@ ) (('external-cam-on) (hide-hud-quick #f) - (set-setting! 'entity-name (-> sv-96 actor) 0 0) - (set-setting! 'process-mask 'set 0 (process-mask movie enemy)) + (set-setting! 'entity-name (-> sv-96 actor) 0.0 0) + (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (remove-setting! 'target-height) (process-grab? *target* #f) (send-event (handle->process (-> obj turret)) 'fire-suppress #t) @@ -687,8 +687,8 @@ ) (when (logtest? (-> self flags) 32) (set! (-> self flags) (logand -33 (-> self flags))) - (set-setting! 'music 'danger11 0 0) - (set-setting! 'music-volume 'rel #x3f666666 0) + (set-setting! 'music 'danger11 0.0 0) + (set-setting! 'music-volume 'rel 0.9 0) (go-virtual moving) ) (none) diff --git a/goal_src/jak2/levels/fortress/exit/forexita-obs.gc b/goal_src/jak2/levels/fortress/exit/forexita-obs.gc index b55bb3bbff..462ab70c15 100644 --- a/goal_src/jak2/levels/fortress/exit/forexita-obs.gc +++ b/goal_src/jak2/levels/fortress/exit/forexita-obs.gc @@ -324,25 +324,20 @@ This commonly includes things such as: (none) ) -;; failed to figure out what this is: (set-subtask-hook! *game-info* - 2 - 3 - (lambda () (with-pp - (until #f - (sound-play "fortress-alarm") - (let ((gp-1 (-> pp clock frame-counter))) - (until (>= (- (-> pp clock frame-counter) gp-1) (seconds 1)) - (suspend) - ) - ) - ) - (the-as object #f) - ) + (game-task-node fortress-escape-introduction) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (until #f + (sound-play "fortress-alarm") + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (suspend) ) + ) + ) + (the-as object #f) + ) ) - - - - diff --git a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc index 081fad35d1..2d6d9e4c18 100644 --- a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc @@ -238,8 +238,8 @@ This commonly includes things such as: ) ) (hide-hud-quick #f) - (set-setting! 'entity-name "camera-243" 0 0) - (set-setting! 'process-mask 'set 0 (process-mask movie enemy)) + (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 (-> self clock frame-counter))) (until (>= (- (-> self clock frame-counter) gp-2) (seconds 2)) @@ -347,7 +347,7 @@ This commonly includes things such as: ) ) ) - (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'interp-time 'abs 0.0 0) (remove-setting! 'entity-name) (remove-setting! 'process-mask) (dotimes (gp-1 2) diff --git a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc index a119531cc5..695ac21240 100644 --- a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc @@ -691,124 +691,118 @@ and return it as well. Otherwise, set it to `0`" (set-subtask-hook! *game-info* - 172 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'sound-mode #f 0 1) - (set-setting! 'sound-excitement 'abs #x3f4ccccd 0) - (speech-control-method-10 - *speech-control* - 6 - (new 'static 'speech-type-info - :min-delay #x4b0 - :max-delay #x960 - :list (new 'static 'boxed-array :type string - "kg001" - "kg002" - "kg004" - "kg006" - "kg001a" - "kg013" - "kg016" - "kg018" - "kg019" - "kg023" - "kg024" - "kg002a" - "kg004a" - "kg078a" - "kg079a" - "kg080a" - "kg081a" - "kg004a" - "kg082a" - "kg083a" - "kg084a" - "kg085a" - "kg086a" - "kg087a" - "kg088a" - "kg091a" - "kg023a" - "kg006a" - "kg092a" - "kg020a" - "kg093a" - "kg094a" - "kg095a" - "kg103a" - "kg104a" - "kg112a" - "kg024a" - "kg134" - "kg136" - "kg137" - "kg138" - "kg139" - "kg140" - "kg141" - ) + (game-task-node fortress-save-friends-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'sound-mode #f 0.0 1) + (set-setting! 'sound-excitement 'abs 0.8 0) + (speech-control-method-10 + *speech-control* + 6 + (new 'static 'speech-type-info + :min-delay #x4b0 + :max-delay #x960 + :list (new 'static 'boxed-array :type string + "kg001" + "kg002" + "kg004" + "kg006" + "kg001a" + "kg013" + "kg016" + "kg018" + "kg019" + "kg023" + "kg024" + "kg002a" + "kg004a" + "kg078a" + "kg079a" + "kg080a" + "kg081a" + "kg004a" + "kg082a" + "kg083a" + "kg084a" + "kg085a" + "kg086a" + "kg087a" + "kg088a" + "kg091a" + "kg023a" + "kg006a" + "kg092a" + "kg020a" + "kg093a" + "kg094a" + "kg095a" + "kg103a" + "kg104a" + "kg112a" + "kg024a" + "kg134" + "kg136" + "kg137" + "kg138" + "kg139" + "kg140" + "kg141" ) ) - (speech-control-method-10 - *speech-control* - 9 - (new 'static 'speech-type-info - :priority 1 - :min-delay #x12c - :max-delay #x258 - :list (new 'static 'boxed-array :type string - "kg133" - "kg142" - "kg144" - "kg145" - "kg146" - "kg147" - "kg148" - "kg149" - "kg150" - "kg138" - "kg151" - "kg152" - "kg153" - "kg154" - "kg155" - "kg159" - "kg163" - "kg164" - ) - ) - ) - (speech-control-method-10 - *speech-control* - 10 - (new 'static 'speech-type-info :priority #xa :max-delay #x12c :list (new 'static 'boxed-array :type string - "kg166" - "kg167" - "kg168" - "kg169" - "kg171" - "kg172" - "kg173" - "kg174" - "kg175" - ) - ) - ) - (none) ) + (speech-control-method-10 + *speech-control* + 9 + (new 'static 'speech-type-info + :priority 1 + :min-delay #x12c + :max-delay #x258 + :list (new 'static 'boxed-array :type string + "kg133" + "kg142" + "kg144" + "kg145" + "kg146" + "kg147" + "kg148" + "kg149" + "kg150" + "kg138" + "kg151" + "kg152" + "kg153" + "kg154" + "kg155" + "kg159" + "kg163" + "kg164" + ) + ) + ) + (speech-control-method-10 + *speech-control* + 10 + (new 'static 'speech-type-info :priority #xa :max-delay #x12c :list (new 'static 'boxed-array :type string + "kg166" + "kg167" + "kg168" + "kg169" + "kg171" + "kg172" + "kg173" + "kg174" + "kg175" + ) + ) + ) + (none) ) ) (set-subtask-hook! *game-info* - 172 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (speech-control-method-9 *speech-control*) (none)) - ) + (game-task-node fortress-save-friends-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (speech-control-method-9 *speech-control*) (none)) ) diff --git a/goal_src/jak2/levels/gungame/gungame-obs.gc b/goal_src/jak2/levels/gungame/gungame-obs.gc index 6b772b14a7..9b1e2c5995 100644 --- a/goal_src/jak2/levels/gungame/gungame-obs.gc +++ b/goal_src/jak2/levels/gungame/gungame-obs.gc @@ -202,7 +202,7 @@ This commonly includes things such as: (cond ((= (-> (level-get-target-inside *level*) name) 'gungame) (when (or (zero? (-> obj in-out)) (= (-> obj in-out) 1)) - (set-setting! 'minimap 'clear 0 128) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> obj in-out) (the-as uint 2)) ) ) @@ -1166,7 +1166,7 @@ This commonly includes things such as: (set! (-> self training-goal) 4000.0) (set! (-> self training?) #t) ) - (set-setting! 'features 'clear 0 896) + (set-setting! 'features 'clear 0.0 (game-feature gun-red gun-blue gun-dark)) (if (!= (-> *game-info* gun-type) 1) (send-event *target* 'change-mode 'gun #f 1) ) @@ -1182,7 +1182,7 @@ This commonly includes things such as: (set! (-> self training-goal) 3000.0) (set! (-> self training?) #t) ) - (set-setting! 'features 'clear 0 832) + (set-setting! 'features 'clear 0.0 (game-feature gun-yellow gun-blue gun-dark)) (if (!= (-> *game-info* gun-type) 2) (send-event *target* 'change-mode 'gun #f 2) ) @@ -1193,7 +1193,7 @@ This commonly includes things such as: (set! (-> self task-silver) (the-as uint 101)) (set! (-> self task-bronze) (the-as uint 100)) (set! (-> *game-info* goal) 4000.0) - (set-setting! 'features 'clear 0 704) + (set-setting! 'features 'clear 0.0 (game-feature gun-yellow gun-red gun-dark)) (if (!= (-> *game-info* gun-type) 3) (send-event *target* 'change-mode 'gun #f 3) ) @@ -1715,8 +1715,15 @@ This commonly includes things such as: ) ) (else - (set! (-> *game-info* sub-task-list 76 death-count) - (the-as uint (seekl (the-as int (-> *game-info* sub-task-list 76 death-count)) #xffff 1)) + (set! (-> *game-info* sub-task-list (game-task-node city-yellow-gun-training-resolution) death-count) + (the-as + uint + (seekl + (the-as int (-> *game-info* sub-task-list (game-task-node city-yellow-gun-training-resolution) death-count)) + #xffff + 1 + ) + ) ) (let ((v1-28 (rand-vu-int-count 4))) (cond @@ -1778,8 +1785,15 @@ This commonly includes things such as: ) ) (else - (set! (-> *game-info* sub-task-list 28 death-count) - (the-as uint (seekl (the-as int (-> *game-info* sub-task-list 28 death-count)) #xffff 1)) + (set! (-> *game-info* sub-task-list (game-task-node city-red-gun-training-resolution) death-count) + (the-as + uint + (seekl + (the-as int (-> *game-info* sub-task-list (game-task-node city-red-gun-training-resolution) death-count)) + #xffff + 1 + ) + ) ) (let ((v1-46 (rand-vu-int-count 4))) (cond @@ -2173,7 +2187,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set-setting! 'darkjak #f 0 0) + (set-setting! 'darkjak #f 0.0 0) (set! sv-16 (new 'static 'res-tag)) (let ((v1-3 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond @@ -2205,7 +2219,7 @@ This commonly includes things such as: (training-manager-method-27 obj *blue-training-path-global-info*) (training-manager-method-27 obj *peace-training-path-global-info*) (training-manager-method-22 obj #f) - (set-setting! 'speech-control #f 0 0) + (set-setting! 'speech-control #f 0.0 0) (go (method-of-object obj wait)) (none) ) @@ -2509,8 +2523,8 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 43 - 0 + (game-task-node sewer-enemy-resolution) + TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () (let ((s5-0 (new 'static 'fact-info :pickup-type (pickup-type gun-yellow) :pickup-spawn-amount 1.0)) @@ -2539,8 +2553,8 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 43 - 2 + (game-task-node sewer-enemy-resolution) + TASK_MANAGER_UPDATE_HOOK (lambda :behavior task-manager () (the-as object (gui-control-method-12 *gui-control* self @@ -2557,8 +2571,8 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 177 - 0 + (game-task-node sewer-escort-get-gun) + TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () (let ((s5-0 (new 'static 'fact-info :pickup-type (pickup-type gun-dark) :pickup-spawn-amount 1.0)) @@ -2587,8 +2601,8 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 177 - 2 + (game-task-node sewer-escort-get-gun) + TASK_MANAGER_UPDATE_HOOK (lambda :behavior task-manager () (the-as object (gui-control-method-12 *gui-control* self diff --git a/goal_src/jak2/levels/hideout/hideout-obs.gc b/goal_src/jak2/levels/hideout/hideout-obs.gc index c63595f7e1..8769809dd1 100644 --- a/goal_src/jak2/levels/hideout/hideout-obs.gc +++ b/goal_src/jak2/levels/hideout/hideout-obs.gc @@ -180,7 +180,7 @@ This commonly includes things such as: (set! (-> obj draw shadow-ctrl) v1-9) ) (hide-light-spawn obj *zero-vector* (-> obj node-list data 12)) - (set-setting! 'spotlight-color #f 0 (the-as uint #x80c0c0c0)) + (set-setting! 'spotlight-color #f 0.0 (the-as uint #x80c0c0c0)) (ja-post) (go (method-of-object obj idle)) (none) diff --git a/goal_src/jak2/levels/hiphog/hiphog-scenes.gc b/goal_src/jak2/levels/hiphog/hiphog-scenes.gc index 7908158b36..b5e3d42e5e 100644 --- a/goal_src/jak2/levels/hiphog/hiphog-scenes.gc +++ b/goal_src/jak2/levels/hiphog/hiphog-scenes.gc @@ -133,7 +133,7 @@ This commonly includes things such as: (defstate play-game (hip-whack-a-metal) :virtual #t :code (behavior ((arg0 game-task-event)) - (set-setting! 'borrow '((hiphog 0 lwhack special)) 0 0) + (set-setting! 'borrow '((hiphog 0 lwhack special)) 0.0 0) (process-taskable-anim-loop (the-as (function process-taskable object) (lambda () (!= (level-status *level* 'lwhack) 'active))) ) diff --git a/goal_src/jak2/levels/hiphog/whack.gc b/goal_src/jak2/levels/hiphog/whack.gc index 5861fe49b5..d1736d9632 100644 --- a/goal_src/jak2/levels/hiphog/whack.gc +++ b/goal_src/jak2/levels/hiphog/whack.gc @@ -2098,8 +2098,8 @@ (when arg0 (set! (-> *game-info* score) 0.0) (sound-play "whack-start") - (add-setting! 'music 'danger3 0 0) - (set-setting! 'entity-name (res-lump-struct (-> self entity) 'camera-name structure) 0 0) + (add-setting! 'music 'danger3 0.0 0) + (set-setting! 'entity-name (res-lump-struct (-> self entity) 'camera-name structure) 0.0 0) (set! (-> self bopper) (process-spawn manipy :init manipy-init @@ -2113,8 +2113,8 @@ ) ) (send-event (ppointer->process (-> self bopper)) 'anim-mode 'clone-anim) - (set-setting! 'airlock #f 0 0) - (set-setting! 'borrow '((ctywide 1 lwidea #f) (hiphog 0 lwhack special)) 0 0) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'borrow '((ctywide 1 lwidea #f) (hiphog 0 lwhack special)) 0.0 0) (want-display-level *load-state* 'ctyport #f) (want-display-level *load-state* 'ctywide #f) (set! (-> self speech-time) (-> self clock frame-counter)) @@ -2670,7 +2670,7 @@ (ja :num! (loop!)) ) ) - (let* ((v1-32 (-> *game-info* sub-task-list 226)) + (let* ((v1-32 (-> *game-info* sub-task-list (game-task-node city-whack-resolution))) (v1-34 (if (-> v1-32 info) (-> v1-32 info manager) (the-as handle #f) @@ -2750,7 +2750,7 @@ (set! (-> a1-11 num-params) 0) (set! (-> a1-11 message) 'complete) (let ((t9-20 send-event-function) - (v1-34 (-> *game-info* sub-task-list 226)) + (v1-34 (-> *game-info* sub-task-list (game-task-node city-whack-resolution))) ) (t9-20 (handle->process (if (-> v1-34 info) @@ -2811,8 +2811,8 @@ (set-subtask-hook! *game-info* - 226 - 0 + (game-task-node city-whack-resolution) + TASK_MANAGER_INIT_HOOK (lambda :behavior whack-a-metal () (let ((gp-0 (entity-by-name "hip-whack-a-metal-2"))) (if gp-0 (process-spawn whack-a-metal :init whack-a-metal-init gp-0 :to self) diff --git a/goal_src/jak2/levels/intro/intro-scenes.gc b/goal_src/jak2/levels/intro/intro-scenes.gc index 140d492309..49af78beba 100644 --- a/goal_src/jak2/levels/intro/intro-scenes.gc +++ b/goal_src/jak2/levels/intro/intro-scenes.gc @@ -3122,7 +3122,7 @@ (* 0.2 (-> self clock seconds-per-frame)) (bucket-id screen-filter) ) - (set-setting! 'allow-blackout #f 0 0) + (set-setting! 'allow-blackout #f 0.0 0) ) (none) ) @@ -3620,7 +3620,12 @@ (485 (apply ,(lambda () - (set-setting! 'borrow '((ctywide 0 lcguard special) (prison 0 ldjakbrn special) (introcst 0 lcitylow #f)) 0 0) + (set-setting! + 'borrow + '((ctywide 0 lcguard special) (prison 0 ldjakbrn special) (introcst 0 lcitylow #f)) + 0.0 + 0 + ) (apply-settings *setting-control*) ) ) @@ -3629,7 +3634,7 @@ (apply ,(lambda () (with-pp - (set-setting! 'allow-blackout #f 0 0) + (set-setting! 'allow-blackout #f 0.0 0) (setup *screen-filter* (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) diff --git a/goal_src/jak2/levels/landing_pad/castle-obs.gc b/goal_src/jak2/levels/landing_pad/castle-obs.gc index ac664905ce..88bb5287fd 100644 --- a/goal_src/jak2/levels/landing_pad/castle-obs.gc +++ b/goal_src/jak2/levels/landing_pad/castle-obs.gc @@ -2385,7 +2385,7 @@ This commonly includes things such as: ) (let ((a3-4 (res-lump-struct (-> self entity) 'camera-name structure))) (if a3-4 - (set-setting! 'entity-name a3-4 0 0) + (set-setting! 'entity-name a3-4 0.0 0) ) ) (let ((gp-5 (-> self clock frame-counter))) @@ -2419,7 +2419,7 @@ This commonly includes things such as: ) (let ((a3-6 (res-lump-struct (-> self entity) 'camera-name structure))) (if a3-6 - (set-setting! 'entity-name a3-6 0 0) + (set-setting! 'entity-name a3-6 0.0 0) ) ) (let ((gp-7 (-> self clock frame-counter))) @@ -2515,7 +2515,7 @@ This commonly includes things such as: ) (let ((a3-2 (res-lump-struct (-> self entity) 'camera-name structure))) (if a3-2 - (set-setting! 'entity-name a3-2 0 0) + (set-setting! 'entity-name a3-2 0.0 0) ) ) (let ((gp-2 (-> self clock frame-counter))) diff --git a/goal_src/jak2/levels/mars_tomb/left/chase/target-indax.gc b/goal_src/jak2/levels/mars_tomb/left/chase/target-indax.gc index abcc28c1e7..a6498227fb 100644 --- a/goal_src/jak2/levels/mars_tomb/left/chase/target-indax.gc +++ b/goal_src/jak2/levels/mars_tomb/left/chase/target-indax.gc @@ -1450,7 +1450,7 @@ ) (set! (-> self neck flex-blend) 0.0) (target-timed-invulnerable-off self 0) - (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) (apply-settings *setting-control*) (set! (-> self control transv quad) (the-as uint128 0)) (logior! (-> self focus-status) (focus-status dead)) diff --git a/goal_src/jak2/levels/mars_tomb/tomb-obs.gc b/goal_src/jak2/levels/mars_tomb/tomb-obs.gc index be3ed42887..f919344e4c 100644 --- a/goal_src/jak2/levels/mars_tomb/tomb-obs.gc +++ b/goal_src/jak2/levels/mars_tomb/tomb-obs.gc @@ -516,7 +516,7 @@ This commonly includes things such as: (set! (-> self camera-state) 3) ) ((and (= (-> self camera-state) 1) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 8))) - (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) (set! (-> self camera-state) 2) @@ -534,7 +534,7 @@ This commonly includes things such as: (suspend) (set! v1-5 (or (not *target*) (process-grab? *target* #f))) ) - (set-setting! 'entity-name "camera-171" 0 0) + (set-setting! 'entity-name "camera-171" 0.0 0) (set! (-> self camera-state) 1) (ja-channel-push! 1 (seconds 2)) (ja :group! (-> self draw art-group data 3) :num! min) @@ -627,7 +627,7 @@ This commonly includes things such as: ) ) ((and (= (-> self camera-state) 1) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 4))) - (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) (set! (-> self camera-state) 2) @@ -656,7 +656,7 @@ This commonly includes things such as: (suspend) (set! v1-1 (or (not *target*) (process-grab? *target* #f))) ) - (set-setting! 'entity-name "camera-170" 0 0) + (set-setting! 'entity-name "camera-170" 0.0 0) (set! (-> self state-time) (-> self clock frame-counter)) (set! (-> self camera-state) 1) (ja-channel-push! 1 (seconds 2)) diff --git a/goal_src/jak2/levels/mars_tomb/tomb-water.gc b/goal_src/jak2/levels/mars_tomb/tomb-water.gc index 66839bc582..a2e276dda3 100644 --- a/goal_src/jak2/levels/mars_tomb/tomb-water.gc +++ b/goal_src/jak2/levels/mars_tomb/tomb-water.gc @@ -655,8 +655,8 @@ This commonly includes things such as: (set! (-> v1-15 user-int8 1) 1) ) ) - (set-setting! 'gun #f 0 0) - (set-setting! 'entity-name "camera-194" 0 0) + (set-setting! 'gun #f 0.0 0) + (set-setting! 'entity-name "camera-194" 0.0 0) (if (and *target* (logtest? (state-flags prevent-gun) (-> *target* state-flags)) (cpad-pressed? (-> *target* control cpad number) up right down left r1) @@ -1989,7 +1989,7 @@ This commonly includes things such as: (when (and (not (logtest? (-> self flags) 2)) (< (vector-vector-distance (-> self root trans) (get-trans gp-0 0)) 102400.0) ) - (set-setting! 'sound-mode #f 0 2) + (set-setting! 'sound-mode #f 0.0 2) (logior! (-> self flags) 2) ) (when (and (logtest? (-> self flags) 2) diff --git a/goal_src/jak2/levels/nest/boss/metalkor-states.gc b/goal_src/jak2/levels/nest/boss/metalkor-states.gc index 37992d5e43..963282d5af 100644 --- a/goal_src/jak2/levels/nest/boss/metalkor-states.gc +++ b/goal_src/jak2/levels/nest/boss/metalkor-states.gc @@ -401,7 +401,7 @@ (go-virtual hidden) ) ((= v1-28 1) - (set-setting! 'music 'danger4 0 0) + (set-setting! 'music 'danger4 0.0 0) (set! (-> self hud) (ppointer->handle (process-spawn hud-metalkor :init hud-init-by-other :to self))) (metalkor-update-hud) (set! (-> self lowtorso) @@ -421,17 +421,17 @@ ) ) (set-countdown-to-roar) - (set-setting! 'fov 'abs #x466eeeef 0) + (set-setting! 'fov 'abs (degrees 84.0) 0) (ja :group! (-> self draw art-group data 9) :num! min) (go-virtual hang-shoot-n-launch) ) ((= v1-28 2) - (set-setting! 'music 'danger4 0 0) + (set-setting! 'music 'danger4 0.0 0) (set-countdown-to-roar) (go-virtual start-second-stage) ) ((= v1-28 3) - (set-setting! 'music 'danger4 0 0) + (set-setting! 'music 'danger4 0.0 0) (set! (-> self last-close-attack) 0) (set! (-> self last-standing-attack) 0) (cond @@ -474,13 +474,13 @@ (set! (-> self legs) (ppointer->handle (process-spawn metalkor-legs "" (-> self root-override trans) :to self)) ) - (set-setting! 'fov 'abs #x466eeeef 0) + (set-setting! 'fov 'abs (degrees 84.0) 0) (go-virtual chase-target) ) ) ) ((= v1-28 4) - (set-setting! 'music 'danger4 0 0) + (set-setting! 'music 'danger4 0.0 0) (set! (-> self wings) (ppointer->handle (process-spawn metalkor-wings "" (-> self root-override trans) :to self)) ) @@ -1499,7 +1499,7 @@ ) :enter (behavior () (process-grab? *target* #f) - (set-setting! 'entity-name "camera-271" 0 0) + (set-setting! 'entity-name "camera-271" 0.0 0) (send-event *camera* 'change-target self) (none) ) @@ -1654,7 +1654,7 @@ ) ) ) - (set-setting! 'entity-name "camera-272" 0 0) + (set-setting! 'entity-name "camera-272" 0.0 0) (send-event *camera* 'change-target self) (set! (-> self need-teleport) #f) (set-setting! 'teleport-on-entity-change 'abs #t 0) @@ -1729,7 +1729,7 @@ ) (when (< f0-10 (* f1-9 f1-9)) (set! (-> self been-to-entity) #t) - (set-setting! 'entity-name "camera-271" 0 0) + (set-setting! 'entity-name "camera-271" 0.0 0) ) ) ) @@ -1756,9 +1756,9 @@ (defstate last-gasp (metalkor) :virtual #t :enter (behavior () - (set-setting! 'music #f 0 0) + (set-setting! 'music #f 0.0 0) (process-grab? *target* #f) - (set-setting! 'entity-name "camera-272" 0 0) + (set-setting! 'entity-name "camera-272" 0.0 0) (remove-setting! 'point-of-interest) (send-event *camera* 'change-target self) (if (nonzero? (-> self neck)) diff --git a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc index dc459f0fac..ace5c5be12 100644 --- a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc +++ b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc @@ -9,35 +9,34 @@ (set-subtask-hook! *game-info* - 245 - 0 - (the-as (function object) (lambda :behavior scene-player - () - 0.0 - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) (process->ppointer self)) - (set! (-> a1-0 num-params) 1) - (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 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.1)) - (suspend) - ) - ) - (send-event *target* 'change-mode 'darkjak #f 64) - (let ((gp-1 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.1)) - (suspend) - ) - ) - (send-event *target* 'get-pickup 7 f30-0) - ) - ) - (send-event *target* 'end-mode) - (none) - ) + (game-task-node nest-boss-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior scene-player + () + 0.0 + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (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 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.1)) + (suspend) + ) ) + (send-event *target* 'change-mode 'darkjak #f 64) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.1)) + (suspend) + ) + ) + (send-event *target* 'get-pickup 7 f30-0) + ) + ) + (send-event *target* 'end-mode) + (none) + ) ) (defskelgroup skel-metalkor-fma-spinner metalkor-fma-spinner metalkor-fma-spinner-lod0-jg metalkor-fma-spinner-idle-ja diff --git a/goal_src/jak2/levels/nest/nest-obs.gc b/goal_src/jak2/levels/nest/nest-obs.gc index ac2fa56e6a..1371e465ad 100644 --- a/goal_src/jak2/levels/nest/nest-obs.gc +++ b/goal_src/jak2/levels/nest/nest-obs.gc @@ -75,8 +75,8 @@ (when (and (not (-> self set-camera)) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.6))) (process-grab? *target* #f) (hide-hud-quick #f) - (set-setting! 'process-mask 'set 0 (process-mask movie enemy)) - (set-setting! 'entity-name "camera-253" 0 0) + (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) + (set-setting! 'entity-name "camera-253" 0.0 0) (set! (-> self set-camera) #t) ) (rider-trans) diff --git a/goal_src/jak2/levels/outro/outro-scenes.gc b/goal_src/jak2/levels/outro/outro-scenes.gc index 04889e4e1d..d14d3c5202 100644 --- a/goal_src/jak2/levels/outro/outro-scenes.gc +++ b/goal_src/jak2/levels/outro/outro-scenes.gc @@ -1564,7 +1564,7 @@ (apply ,(lambda () (with-pp - (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile)) (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 (let ((t9-2 (method-of-type part-tracker activate))) diff --git a/goal_src/jak2/levels/palace/boss/squid-states.gc b/goal_src/jak2/levels/palace/boss/squid-states.gc index 48b957b94e..84990c4798 100644 --- a/goal_src/jak2/levels/palace/boss/squid-states.gc +++ b/goal_src/jak2/levels/palace/boss/squid-states.gc @@ -521,7 +521,7 @@ (get-point-at-percent-along-path! (-> self second-path) (-> self traj-dest) 0.0 'interp) ) (else - (set-setting! 'music #f 0 0) + (set-setting! 'music #f 0.0 0) (process-grab? *target* #f) (get-point-at-percent-along-path! (-> self third-path) (-> self traj-dest) 0.0 'interp) (send-event (handle->process (-> self hud)) 'hide-and-die) @@ -1678,7 +1678,7 @@ :virtual #t :event squid-handler :enter (behavior () - (set-setting! 'music 'danger4 0 0) + (set-setting! 'music 'danger4 0.0 0) (set! (-> self driver-blend target) 1.0) (set! (-> self state-time) (-> self clock frame-counter)) (set! (-> self hud) (ppointer->handle (process-spawn hud-squid :init hud-init-by-other :to self))) diff --git a/goal_src/jak2/levels/palace/throne_room/palace-scenes.gc b/goal_src/jak2/levels/palace/throne_room/palace-scenes.gc index 32a60815a8..a11de1e5fe 100644 --- a/goal_src/jak2/levels/palace/throne_room/palace-scenes.gc +++ b/goal_src/jak2/levels/palace/throne_room/palace-scenes.gc @@ -359,7 +359,7 @@ This commonly includes things such as: (fadein (seconds (new 'static 'bfloat :data 0.5))) (kill "pal-lowrez-throne-1") (fadein (frame-time-30 10)) - (apply ,(lambda :behavior scene-player () (set-setting! 'rain 'abs 0 0) (none))) + (apply ,(lambda :behavior scene-player () (set-setting! 'rain 'abs 0.0 0) (none))) (send-event "metalkor-head" 'trans-hook @@ -627,7 +627,7 @@ This commonly includes things such as: :art-group "scenecamera" :anim "palace-sneak-in-res" :parts 21 - :command-list '((0 (fadein (seconds 1)) (apply ,(lambda :behavior scene-player () (set-setting! 'rain 'abs 0 0) (none)))) + :command-list '((0 (fadein (seconds 1)) (apply ,(lambda :behavior scene-player () (set-setting! 'rain 'abs 0.0 0) (none)))) (10000 (unless (task-closed? "palace-sneak-in-meeting") (talker-spawn "miss010")) (task-close! "palace-sneak-in-meeting") diff --git a/goal_src/jak2/levels/power_station/power_switches/ctypower.gc b/goal_src/jak2/levels/power_station/power_switches/ctypower.gc index c69a069dd7..ed99b132dc 100644 --- a/goal_src/jak2/levels/power_station/power_switches/ctypower.gc +++ b/goal_src/jak2/levels/power_station/power_switches/ctypower.gc @@ -55,234 +55,219 @@ (set-subtask-hook! *game-info* - 87 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (not (task-node-closed? (game-task-node city-power-resolution))) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) - (set-setting! 'minimap 'clear 0 32) - (set! (-> self max-count) 5) - (set! (-> self count) 0) - (set! (-> *game-info* counter) 5.0) - (dotimes (v1-9 5) - (set! (-> self data-int32 v1-9) 0) - ) - (set! (-> self slave 10) (the-as handle #f)) - (dotimes (gp-0 (-> self max-count)) - (set! (-> self data-vector gp-0 quad) (-> *city-power-switch-on-position* gp-0 quad)) - (set! (-> self minimap gp-0) - (add-icon! *minimap* self (the-as uint 15) (the-as int #f) (-> *city-power-switch-on-position* gp-0) 0) - ) - ) + (game-task-node city-power-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (when (not (task-node-closed? (game-task-node city-power-resolution))) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set! (-> self max-count) 5) + (set! (-> self count) 0) + (set! (-> *game-info* counter) 5.0) + (dotimes (v1-9 5) + (set! (-> self data-int32 v1-9) 0) ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 87 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *traffic-manager* 'restore-default-settings) - (dotimes (v1-3 (-> self max-count)) - (when (-> self minimap v1-3) - (logior! (-> self minimap v1-3 flags) (minimap-flag fade-out)) - (set! (-> self minimap v1-3) #f) - ) - ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 87 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (not (task-node-closed? (game-task-node city-power-resolution))) - (check-time self) - (set! (-> self count) 0) - (dotimes (v1-3 (-> self max-count)) - (if (>= 1 (-> self data-int32 v1-3)) - (+! (-> self count) 1) + (set! (-> self slave 10) (the-as handle #f)) + (dotimes (gp-0 (-> self max-count)) + (set! (-> self data-vector gp-0 quad) (-> *city-power-switch-on-position* gp-0 quad)) + (set! (-> self minimap gp-0) + (add-icon! *minimap* self (the-as uint 15) (the-as int #f) (-> *city-power-switch-on-position* gp-0) 0) ) - ) - (if (= (-> self count) (-> self max-count)) - (set! (-> self state-time) (-> self clock frame-counter)) - ) - (set! (-> *game-info* counter) (the float (-> self count))) ) - (when (or (zero? (-> self count)) (task-node-closed? (game-task-node city-power-resolution))) - (when (zero? (-> self count)) - (talker-spawn-func (-> *talker-speech* 92) *entity-pool* (target-pos 0) (the-as region #f)) - (task-node-close! (game-task-node city-power-resolution)) - (send-event (handle->process (-> self hud-timer)) 'hide-and-die) - (send-event (handle->process (-> self hud-counter)) 'hide-and-die) - (set! (-> self fail-on-death?) #f) - ) - (cond - ((handle->process (-> self slave 10)) - (let ((gp-1 (handle->process (-> self slave 10)))) - (when (and gp-1 - (< 40960.0 (vector-vector-xz-distance (-> (the-as process-drawable gp-1) root trans) (target-pos 0))) - ) - (send-event gp-1 'close) - (go-virtual complete) - ) - ) - ) - (else - (go-virtual complete) - ) - ) - ) - (none) ) + (none) ) ) (set-subtask-hook! *game-info* - 87 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-turret :init hud-init-by-other :to self))) - (send-event *traffic-manager* 'set-target-level #x3f800000) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) - (suspend) + (game-task-node city-power-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'restore-default-settings) + (dotimes (v1-3 (-> self max-count)) + (when (-> self minimap v1-3) + (logior! (-> self minimap v1-3 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-3) #f) ) - (send-event *traffic-manager* 'set-alert-level 1) - (send-event *traffic-manager* 'set-alert-duration #xa4cb80) - (none) ) + (none) ) ) (set-subtask-hook! *game-info* - 87 - 5 - (the-as (function object) (lambda :behavior task-manager - () - (dotimes (v1-0 (-> self max-count)) - (when (-> self minimap v1-0) - (logior! (-> self minimap v1-0 flags) (minimap-flag fade-out)) - (set! (-> self minimap v1-0) #f) - ) - ) - (kill-all-children self) - (none) - ) + (game-task-node city-power-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (when (not (task-node-closed? (game-task-node city-power-resolution))) + (check-time self) + (set! (-> self count) 0) + (dotimes (v1-3 (-> self max-count)) + (if (>= 1 (-> self data-int32 v1-3)) + (+! (-> self count) 1) + ) + ) + (if (= (-> self count) (-> self max-count)) + (set! (-> self state-time) (-> self clock frame-counter)) ) - ) - -(set-subtask-hook! - *game-info* - 87 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) - (suspend) - ) - (task-node-close! (game-task-node city-power-post-win)) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 87 - 6 - (the-as - (function object) - (lambda :behavior task-manager - ((arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((gp-0 (-> (level-get *level* 'lpower) entity data 0 entity))) - (cond - ((= arg2 'guard-turret-status) - (let ((v1-5 (-> arg3 param 0))) - (let ((a0-2 (the-as object (-> arg3 param 1)))) - (set! (-> *city-power-switch-on-position* v1-5 quad) (-> (the-as vector a0-2) quad)) - ) - (-> self data-int32 v1-5) + (set! (-> *game-info* counter) (the float (-> self count))) + ) + (when (or (zero? (-> self count)) (task-node-closed? (game-task-node city-power-resolution))) + (when (zero? (-> self count)) + (talker-spawn-func (-> *talker-speech* 92) *entity-pool* (target-pos 0) (the-as region #f)) + (task-node-close! (game-task-node city-power-resolution)) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (set! (-> self fail-on-death?) #f) + ) + (cond + ((handle->process (-> self slave 10)) + (let ((gp-1 (handle->process (-> self slave 10)))) + (when (and gp-1 + (< 40960.0 (vector-vector-xz-distance (-> (the-as process-drawable gp-1) root trans) (target-pos 0))) + ) + (send-event gp-1 'close) + (go-virtual complete) ) ) - ((= arg2 'guard-turret-killed) - (let ((s4-1 (-> arg3 param 0))) - (set! (-> self data-int32 s4-1) 1) - (let ((v1-12 (process-spawn - cty-guard-turret-button - :init basebutton-init-by-other - gp-0 - (-> arg0 root trans) - (-> arg0 root quat) - (-> arg0 entity) - #f - 0 - :to self - ) + ) + (else + (go-virtual complete) + ) + ) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-power-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-turret :init hud-init-by-other :to self))) + (send-event *traffic-manager* 'set-target-level #x3f800000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (send-event *traffic-manager* 'set-alert-level 1) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-power-resolution) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager + () + (dotimes (v1-0 (-> self max-count)) + (when (-> self minimap v1-0) + (logior! (-> self minimap v1-0 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-0) #f) + ) + ) + (kill-all-children self) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-power-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (suspend) + ) + (task-node-close! (game-task-node city-power-post-win)) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-power-resolution) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((gp-0 (-> (level-get *level* 'lpower) entity data 0 entity))) + (cond + ((= arg2 'guard-turret-status) + (let ((v1-5 (-> arg3 param 0))) + (let ((a0-2 (the-as object (-> arg3 param 1)))) + (set! (-> *city-power-switch-on-position* v1-5 quad) (-> (the-as vector a0-2) quad)) + ) + (-> self data-int32 v1-5) + ) + ) + ((= arg2 'guard-turret-killed) + (let ((s4-1 (-> arg3 param 0))) + (set! (-> self data-int32 s4-1) 1) + (let ((v1-12 (process-spawn + cty-guard-turret-button + :init basebutton-init-by-other + gp-0 + (-> arg0 root trans) + (-> arg0 root quat) + (-> arg0 entity) + #f + 0 + :to self ) - ) - (set! (-> self slave (-> self data-int32 s4-1)) (ppointer->handle v1-12)) - (set! (-> (the-as basebutton (-> v1-12 0)) event-down) 'button-down) - ) - ) - #t - ) - ((= arg2 'guard-turret-button-pushed) - (let ((v1-21 (-> arg3 param 0))) - (set! (-> self data-int32 v1-21) 2) - (set! (-> self slave 10) (process->handle arg0)) - (logior! (-> self minimap v1-21 flags) (minimap-flag fade-out)) - (set! (-> self minimap v1-21) #f) - ) - #t - ) - ((= arg2 'spawn-button) - (let ((s4-2 (-> arg3 param 0)) - (s3-2 (-> arg3 param 1)) + ) ) - (when (not (handle->process (-> self slave (-> self data-int32 s4-2)))) - (let ((v0-1 (the-as object (ppointer->handle (process-spawn - cty-guard-turret-button - :init basebutton-init-by-other - gp-0 - (-> arg0 root trans) - (-> arg0 root quat) - (-> arg0 entity) - s3-2 - 0 - :to self - ) + (set! (-> self slave (-> self data-int32 s4-1)) (ppointer->handle v1-12)) + (set! (-> (the-as basebutton (-> v1-12 0)) event-down) 'button-down) + ) + ) + #t + ) + ((= arg2 'guard-turret-button-pushed) + (let ((v1-21 (-> arg3 param 0))) + (set! (-> self data-int32 v1-21) 2) + (set! (-> self slave 10) (process->handle arg0)) + (logior! (-> self minimap v1-21 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-21) #f) + ) + #t + ) + ((= arg2 'spawn-button) + (let ((s4-2 (-> arg3 param 0)) + (s3-2 (-> arg3 param 1)) + ) + (when (not (handle->process (-> self slave (-> self data-int32 s4-2)))) + (let ((v0-1 (the-as object (ppointer->handle (process-spawn + cty-guard-turret-button + :init basebutton-init-by-other + gp-0 + (-> arg0 root trans) + (-> arg0 root quat) + (-> arg0 entity) + s3-2 + 0 + :to self ) - ) - ) - ) - (set! (-> self slave (-> self data-int32 s4-2)) (the-as handle v0-1)) - v0-1 - ) + ) + ) + ) + ) + (set! (-> self slave (-> self data-int32 s4-2)) (the-as handle v0-1)) + v0-1 ) ) ) - ) + ) ) ) ) diff --git a/goal_src/jak2/levels/ruins/ruins-obs.gc b/goal_src/jak2/levels/ruins/ruins-obs.gc index 18c96c9ace..2ceb4efab4 100644 --- a/goal_src/jak2/levels/ruins/ruins-obs.gc +++ b/goal_src/jak2/levels/ruins/ruins-obs.gc @@ -724,8 +724,8 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 13 - 3 + (game-task-node ruins-tower-exit) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (set! (-> self data-int32 0) 0) @@ -781,12 +781,15 @@ This commonly includes things such as: ) ) -(copy-hooks! (-> *game-info* sub-task-list 99) (-> *game-info* sub-task-list 13)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node ruins-enemy-exit)) + (-> *game-info* sub-task-list (game-task-node ruins-tower-exit)) + ) (set-subtask-hook! *game-info* - 194 - 3 + (game-task-node ruins-mech-break-wall-1) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (let ((s4-0 (entity-by-type mech)) @@ -873,8 +876,8 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 195 - 3 + (game-task-node ruins-mech-move-block-1) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (local-vars (v1-3 object) (v1-14 symbol) (v1-18 symbol) (v1-25 object) (v1-31 symbol) (v1-32 symbol)) @@ -949,8 +952,8 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 196 - 3 + (game-task-node ruins-mech-throw-block-1) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (local-vars (v1-6 object) (v1-58 symbol)) diff --git a/goal_src/jak2/levels/ruins/ruins-scenes.gc b/goal_src/jak2/levels/ruins/ruins-scenes.gc index 0119bdd9f8..7cb7dff22c 100644 --- a/goal_src/jak2/levels/ruins/ruins-scenes.gc +++ b/goal_src/jak2/levels/ruins/ruins-scenes.gc @@ -1570,7 +1570,7 @@ This commonly includes things such as: :command-list '((-10 (want-force-vis 'sagehut #t) (fadein (seconds (new 'static 'bfloat :data 0.333))) - (apply ,(lambda () (set-setting! 'rain 'abs 0 0) (none))) + (apply ,(lambda () (set-setting! 'rain 'abs 0.0 0) (none))) ) (1 (joint-eval start-seed-effect entity "life-seed")) (340 (part-tracker diff --git a/goal_src/jak2/levels/sewer/hal2-course.gc b/goal_src/jak2/levels/sewer/hal2-course.gc index 13bd09923c..17a92ca965 100644 --- a/goal_src/jak2/levels/sewer/hal2-course.gc +++ b/goal_src/jak2/levels/sewer/hal2-course.gc @@ -3832,7 +3832,7 @@ ) ) ) - (set-setting! 'allow-look-around #f 0 0) + (set-setting! 'allow-look-around #f 0.0 0) (let ((v1-46 (get-task-by-type (-> arg0 ai-ctrl) halt-wait-spot arg0))) (set! (-> v1-46 bytes 5) 1) (set! (-> v1-46 bytes 6) 4) diff --git a/goal_src/jak2/levels/sewer/sewer-obs2.gc b/goal_src/jak2/levels/sewer/sewer-obs2.gc index 0cfa39af91..4fc424a537 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs2.gc @@ -102,7 +102,7 @@ (logtest? (elevator-flags airlock-opened) (-> self params flags)) ) (configure-collision self #t) - (set-setting! 'jump #f 0 0) + (set-setting! 'jump #f 0.0 0) ) (none) ) diff --git a/goal_src/jak2/levels/sewer/sewer-scenes.gc b/goal_src/jak2/levels/sewer/sewer-scenes.gc index bcd09f2909..a2bad21a31 100644 --- a/goal_src/jak2/levels/sewer/sewer-scenes.gc +++ b/goal_src/jak2/levels/sewer/sewer-scenes.gc @@ -1247,8 +1247,8 @@ (set-subtask-hook! *game-info* - 41 - 0 + (game-task-node sewer-enemy-blow-up-turrets) + TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () (while (!= (level-status *level* 'sewer) 'active) @@ -1277,8 +1277,8 @@ (set-subtask-hook! *game-info* - 41 - 3 + (game-task-node sewer-enemy-blow-up-turrets) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (local-vars (sv-96 int) (sv-100 float) (sv-104 vector)) diff --git a/goal_src/jak2/levels/stadium/jetboard/skatea-obs.gc b/goal_src/jak2/levels/stadium/jetboard/skatea-obs.gc index 1268aba67c..a956fcb233 100644 --- a/goal_src/jak2/levels/stadium/jetboard/skatea-obs.gc +++ b/goal_src/jak2/levels/stadium/jetboard/skatea-obs.gc @@ -62,18 +62,10 @@ (defmethod render-text hoverboard-training-manager ((obj hoverboard-training-manager) (arg0 text-id)) - (when (= (get-status *gui-control* (the-as sound-id (-> obj gui-id))) (gui-status active)) - (let ((s5-1 (new - 'stack - 'font-context - *font-default-matrix* - 32 - 280 - 0.0 - (font-color default) - (font-flags shadow kerning) - ) - ) + (when (= (get-status *gui-control* (-> obj gui-id)) (gui-status active)) + (let ((s5-1 + (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) + ) ) (set! (-> s5-1 flags) (font-flags shadow kerning large)) (let ((v1-4 s5-1)) @@ -224,7 +216,7 @@ (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'complete) (let ((t9-0 send-event-function) - (v1-5 (-> *game-info* sub-task-list 64)) + (v1-5 (-> *game-info* sub-task-list (game-task-node stadium-board1-board))) ) (t9-0 (handle->process (if (-> v1-5 info) @@ -329,7 +321,7 @@ (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei002" -99.0 0) ) - (while (nonzero? (get-status *gui-control* (the-as sound-id (-> self last-sound-id)))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) @@ -354,7 +346,7 @@ :virtual #t :event hoverboard-training-manager-event-handler :code (behavior () - (while (nonzero? (get-status *gui-control* (the-as sound-id (-> self last-sound-id)))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) @@ -367,7 +359,7 @@ (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei006" -99.0 0) ) - (while (nonzero? (get-status *gui-control* (the-as sound-id (-> self last-sound-id)))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) @@ -396,7 +388,7 @@ (none) ) :code (behavior () - (while (nonzero? (get-status *gui-control* (the-as sound-id (-> self last-sound-id)))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) @@ -472,7 +464,7 @@ (none) ) :code (behavior () - (while (nonzero? (get-status *gui-control* (the-as sound-id (-> self last-sound-id)))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (let ((gp-0 (-> self clock frame-counter))) @@ -537,7 +529,7 @@ :virtual #t :event hoverboard-training-manager-event-handler :code (behavior () - (while (nonzero? (get-status *gui-control* (the-as sound-id (-> self last-sound-id)))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) @@ -553,7 +545,7 @@ (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei011" -99.0 0) ) - (while (nonzero? (get-status *gui-control* (the-as sound-id (-> self last-sound-id)))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) @@ -578,7 +570,7 @@ :virtual #t :event hoverboard-training-manager-event-handler :code (behavior () - (while (nonzero? (get-status *gui-control* (the-as sound-id (-> self last-sound-id)))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) @@ -591,7 +583,7 @@ (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei016" -99.0 0) ) - (while (nonzero? (get-status *gui-control* (the-as sound-id (-> self last-sound-id)))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) @@ -616,7 +608,7 @@ :virtual #t :event hoverboard-training-manager-event-handler :code (behavior () - (while (nonzero? (get-status *gui-control* (the-as sound-id (-> self last-sound-id)))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) @@ -629,7 +621,7 @@ (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei017" -99.0 0) ) - (while (nonzero? (get-status *gui-control* (the-as sound-id (-> self last-sound-id)))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) @@ -662,7 +654,7 @@ :virtual #t :event hoverboard-training-manager-event-handler :code (behavior () - (while (nonzero? (get-status *gui-control* (the-as sound-id (-> self last-sound-id)))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) @@ -673,7 +665,7 @@ (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei019" -99.0 0) ) - (while (nonzero? (get-status *gui-control* (the-as sound-id (-> self last-sound-id)))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) @@ -1133,8 +1125,15 @@ (set! (-> self arrow) (process->handle (task-arrow-spawn gp-4 (the-as task-arrow self)))) ) (else - (set! (-> *game-info* sub-task-list 66 death-count) - (the-as uint (seekl (the-as int (-> *game-info* sub-task-list 66 death-count)) #xffff 1)) + (set! (-> *game-info* sub-task-list (game-task-node stadium-board1-training-judge) death-count) + (the-as + uint + (seekl + (the-as int (-> *game-info* sub-task-list (game-task-node stadium-board1-training-judge) death-count)) + #xffff + 1 + ) + ) ) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei020" -99.0 0) ) @@ -1344,7 +1343,7 @@ This commonly includes things such as: - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 1024) + (stack-size-set! (-> obj main-thread) 1024) ;; added (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-1 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) @@ -1391,7 +1390,7 @@ This commonly includes things such as: (send-event s5-0 'set-object-target-count 19 0) (send-event s5-0 'set-guard-target-level 0) ) - (set-setting! 'allow-continue #f 0 0) + (set-setting! 'allow-continue #f 0.0 0) (cond ((task-node-closed? (game-task-node forest-scouts-get-board)) (go (method-of-object obj idle)) @@ -1576,7 +1575,7 @@ This commonly includes things such as: ) ) (('close) - (set-setting! 'minimap 'clear 0 128) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self onoff) #f) #f ) diff --git a/goal_src/jak2/levels/stadium/stadium-obs.gc b/goal_src/jak2/levels/stadium/stadium-obs.gc index 03bcb1032d..7f4cfff072 100644 --- a/goal_src/jak2/levels/stadium/stadium-obs.gc +++ b/goal_src/jak2/levels/stadium/stadium-obs.gc @@ -886,7 +886,7 @@ This commonly includes things such as: (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'complete) (let ((t9-0 send-event-function) - (v1-4 (-> *game-info* sub-task-list 237)) + (v1-4 (-> *game-info* sub-task-list (game-task-node city-defend-stadium-resolution))) ) (t9-0 (handle->process (if (-> v1-4 info) @@ -1777,7 +1777,8 @@ This commonly includes things such as: ) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) - (normalized-heading-to-quaternion! s5-0 s4-0) ;; changed to avoid NaN issue + (quaternion-set! s5-0 0.0 (-> s4-0 x) 0.0 (+ 1.0 (-> s4-0 z))) + (quaternion-normalize! s5-0) (quaternion-slerp! (-> self root-override2 quat) (-> self root-override2 quat) @@ -2011,7 +2012,7 @@ This commonly includes things such as: (set! (-> a1-21 num-params) 0) (set! (-> a1-21 message) 'fail) (let ((t9-11 send-event-function) - (v1-73 (-> *game-info* sub-task-list 237)) + (v1-73 (-> *game-info* sub-task-list (game-task-node city-defend-stadium-resolution))) ) (t9-11 (handle->process (if (-> v1-73 info) @@ -3147,174 +3148,156 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 237 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'border-mode #f 0 0) - (while (!= (level-status *level* 'stadblmp) 'active) - (suspend) - ) - (set-setting! 'minimap 'clear 0 32) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set-setting! 'music 'danger6 0 0) - (want-force-vis *load-state* 'stadblmp #t) - (let ((gp-1 *traffic-manager*)) - (send-event gp-1 'set-object-target-count 11 0) - (send-event gp-1 'set-object-target-count 12 0) - (send-event gp-1 'set-object-target-count 13 0) - (send-event gp-1 'set-object-target-count 14 0) - (send-event gp-1 'set-object-target-count 15 0) - (send-event gp-1 'set-object-target-count 16 0) - (send-event gp-1 'set-object-target-count 0 0) - (send-event gp-1 'set-object-target-count 1 0) - (send-event gp-1 'set-object-target-count 2 0) - (send-event gp-1 'set-object-target-count 6 0) - (send-event gp-1 'set-object-target-count 7 0) - (send-event gp-1 'set-object-target-count 8 0) - (send-event gp-1 'set-object-target-count 9 0) - (send-event gp-1 'set-object-target-count 10 0) - (send-event gp-1 'set-object-target-count 18 0) - (send-event gp-1 'set-object-target-count 19 0) - (send-event gp-1 'deactivate-by-type 11) - (send-event gp-1 'deactivate-by-type 12) - (send-event gp-1 'deactivate-by-type 13) - (send-event gp-1 'deactivate-by-type 14) - (send-event gp-1 'deactivate-by-type 15) - (send-event gp-1 'deactivate-by-type 16) - (send-event gp-1 'deactivate-by-type 0) - (send-event gp-1 'deactivate-by-type 1) - (send-event gp-1 'deactivate-by-type 2) - (send-event gp-1 'deactivate-by-type 6) - (send-event gp-1 'deactivate-by-type 7) - (send-event gp-1 'deactivate-by-type 8) - (send-event gp-1 'deactivate-by-type 9) - (send-event gp-1 'deactivate-by-type 10) - (send-event gp-1 'deactivate-by-type 18) - (send-event gp-1 'deactivate-by-type 19) - (send-event gp-1 'set-guard-target-level 0) - ) - (let ((v1-177 (entity-by-name "parking-spot-48"))) - (if v1-177 - (logior! (-> v1-177 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-179 (entity-by-name "parking-spot-49"))) - (if v1-179 - (logior! (-> v1-179 extra perm status) (entity-perm-status bit-9)) - ) - ) - (set! (-> self slave 0) - (process->handle (the-as process (ppointer->process (process-spawn stad-keira :to self)))) - ) - (set! (-> self slave 1) - (process->handle (the-as process (ppointer->process (process-spawn stad-brutter :to self)))) - ) - (none) + (game-task-node city-defend-stadium-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'border-mode #f 0.0 0) + (while (!= (level-status *level* 'stadblmp) 'active) + (suspend) ) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set-setting! 'music 'danger6 0.0 0) + (want-force-vis *load-state* 'stadblmp #t) + (let ((gp-1 *traffic-manager*)) + (send-event gp-1 'set-object-target-count 11 0) + (send-event gp-1 'set-object-target-count 12 0) + (send-event gp-1 'set-object-target-count 13 0) + (send-event gp-1 'set-object-target-count 14 0) + (send-event gp-1 'set-object-target-count 15 0) + (send-event gp-1 'set-object-target-count 16 0) + (send-event gp-1 'set-object-target-count 0 0) + (send-event gp-1 'set-object-target-count 1 0) + (send-event gp-1 'set-object-target-count 2 0) + (send-event gp-1 'set-object-target-count 6 0) + (send-event gp-1 'set-object-target-count 7 0) + (send-event gp-1 'set-object-target-count 8 0) + (send-event gp-1 'set-object-target-count 9 0) + (send-event gp-1 'set-object-target-count 10 0) + (send-event gp-1 'set-object-target-count 18 0) + (send-event gp-1 'set-object-target-count 19 0) + (send-event gp-1 'deactivate-by-type 11) + (send-event gp-1 'deactivate-by-type 12) + (send-event gp-1 'deactivate-by-type 13) + (send-event gp-1 'deactivate-by-type 14) + (send-event gp-1 'deactivate-by-type 15) + (send-event gp-1 'deactivate-by-type 16) + (send-event gp-1 'deactivate-by-type 0) + (send-event gp-1 'deactivate-by-type 1) + (send-event gp-1 'deactivate-by-type 2) + (send-event gp-1 'deactivate-by-type 6) + (send-event gp-1 'deactivate-by-type 7) + (send-event gp-1 'deactivate-by-type 8) + (send-event gp-1 'deactivate-by-type 9) + (send-event gp-1 'deactivate-by-type 10) + (send-event gp-1 'deactivate-by-type 18) + (send-event gp-1 'deactivate-by-type 19) + (send-event gp-1 'set-guard-target-level 0) + ) + (let ((v1-177 (entity-by-name "parking-spot-48"))) + (if v1-177 + (logior! (-> v1-177 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-179 (entity-by-name "parking-spot-49"))) + (if v1-179 + (logior! (-> v1-179 extra perm status) (entity-perm-status bit-9)) + ) + ) + (set! (-> self slave 0) + (process->handle (the-as process (ppointer->process (process-spawn stad-keira :to self)))) + ) + (set! (-> self slave 1) + (process->handle (the-as process (ppointer->process (process-spawn stad-brutter :to self)))) + ) + (none) ) ) (set-subtask-hook! *game-info* - 237 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (let ((a0-0 *suppress-stadium*)) - (let ((v1-0 (-> a0-0 bbox))) - (set! (-> v1-0 min x) 373227.53) - (set! (-> v1-0 min y) -204800.0) - (set! (-> v1-0 min z) -3276800.0) - (set! (-> v1-0 min w) 1.0) - ) - (set-vector! (-> a0-0 bbox max) 1482301.5 204800.0 -1228800.0 1.0) - (set! (-> a0-0 duration) (seconds 604800)) - (create-or-update-suppression-box a0-0) - ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 237 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (dotimes (gp-0 2) - (send-event (handle->process (-> self slave gp-0)) 'die) - ) - (let ((gp-1 (-> (process-by-name "battle-58" *active-pool*) child))) - (while gp-1 - (send-event (ppointer->process gp-1) 'die-fast) - (set! gp-1 (-> gp-1 0 brother)) - ) - ) - (let ((gp-2 (-> (process-by-name "battle-59" *active-pool*) child))) - (while gp-2 - (send-event (ppointer->process gp-2) 'die-fast) - (set! gp-2 (-> gp-2 0 brother)) - ) - ) - (let ((gp-3 (-> (process-by-name "battle-60" *active-pool*) child))) - (while gp-3 - (send-event (ppointer->process gp-3) 'die-fast) - (set! gp-3 (-> gp-3 0 brother)) - ) - ) - (none) - ) - ) - ) - -(set-subtask-hook! - *game-info* - 237 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (remove-setting! 'border-mode) - (send-event *traffic-manager* 'restore-default-settings) - (none) - ) - ) - ) - -;; jp patch -(set-subtask-hook! - *game-info* - 236 - 0 - (the-as - (function object) - (lambda :behavior task-manager () (task-close! "stadium-burning-bush-race-board-introduction") (none)) + (game-task-node city-defend-stadium-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (let ((a0-0 *suppress-stadium*)) + (let ((v1-0 (-> a0-0 bbox))) + (set! (-> v1-0 min x) 373227.53) + (set! (-> v1-0 min y) -204800.0) + (set! (-> v1-0 min z) -3276800.0) + (set! (-> v1-0 min w) 1.0) + ) + (set-vector! (-> a0-0 bbox max) 1482301.5 204800.0 -1228800.0 1.0) + (set! (-> a0-0 duration) (seconds 604800)) + (create-or-update-suppression-box a0-0) + ) + (none) ) ) (set-subtask-hook! *game-info* - 236 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (let ((a0-0 *suppress-stadium*)) - (let ((v1-0 (-> a0-0 bbox))) - (set! (-> v1-0 min x) 373227.53) - (set! (-> v1-0 min y) -204800.0) - (set! (-> v1-0 min z) -3276800.0) - (set! (-> v1-0 min w) 1.0) - ) - (set-vector! (-> a0-0 bbox max) 1482301.5 204800.0 -1228800.0 1.0) - (set! (-> a0-0 duration) (seconds 604800)) - (create-or-update-suppression-box a0-0) - ) - (none) - ) - ) + (game-task-node city-defend-stadium-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (dotimes (gp-0 2) + (send-event (handle->process (-> self slave gp-0)) 'die) + ) + (let ((gp-1 (-> (process-by-name "battle-58" *active-pool*) child))) + (while gp-1 + (send-event (ppointer->process gp-1) 'die-fast) + (set! gp-1 (-> gp-1 0 brother)) + ) + ) + (let ((gp-2 (-> (process-by-name "battle-59" *active-pool*) child))) + (while gp-2 + (send-event (ppointer->process gp-2) 'die-fast) + (set! gp-2 (-> gp-2 0 brother)) + ) + ) + (let ((gp-3 (-> (process-by-name "battle-60" *active-pool*) child))) + (while gp-3 + (send-event (ppointer->process gp-3) 'die-fast) + (set! gp-3 (-> gp-3 0 brother)) + ) + ) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-defend-stadium-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (remove-setting! 'border-mode) + (send-event *traffic-manager* 'restore-default-settings) + (none) + ) + ) + +(set-subtask-hook! + *game-info* + (game-task-node city-defend-stadium-introduction) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (let ((a0-0 *suppress-stadium*)) + (let ((v1-0 (-> a0-0 bbox))) + (set! (-> v1-0 min x) 373227.53) + (set! (-> v1-0 min y) -204800.0) + (set! (-> v1-0 min z) -3276800.0) + (set! (-> v1-0 min w) 1.0) + ) + (set-vector! (-> a0-0 bbox max) 1482301.5 204800.0 -1228800.0 1.0) + (set! (-> a0-0 duration) (seconds 604800)) + (create-or-update-suppression-box a0-0) + ) + (none) + ) ) (defmethod draw hud-samos-old ((obj hud-samos-old)) diff --git a/goal_src/jak2/levels/strip/strip-obs.gc b/goal_src/jak2/levels/strip/strip-obs.gc index 4f3e090622..04dff10aed 100644 --- a/goal_src/jak2/levels/strip/strip-obs.gc +++ b/goal_src/jak2/levels/strip/strip-obs.gc @@ -767,7 +767,7 @@ This commonly includes things such as: (cond ((send-event proc 'grenade (-> self speed)) (if (-> self camera-name) - (set-setting! 'entity-name (-> self camera-name) 0 -1) + (set-setting! 'entity-name (-> self camera-name) 0.0 -1) ) ) ((>= (- (-> self clock frame-counter) (-> self enter-time)) (seconds 3)) @@ -1474,15 +1474,15 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 115 - 0 + (game-task-node strip-grenade-explode) + TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () - (set-setting! 'music 'danger10 0 0) + (set-setting! 'music 'danger10 0.0 0) (set! (-> *game-info* controller 0) (process->handle self)) (set! (-> self entity) (the-as entity-actor (entity-by-name "grenade-point-1"))) (set! (-> self actor-group 0) (res-lump-struct (-> self entity) 'actor-groups (pointer entity-actor))) - (set-setting! 'allow-continue #f 0 0) + (set-setting! 'allow-continue #f 0.0 0) (when (-> self actor-group 0) (dotimes (gp-0 (the-as int (-> self actor-group 0 0))) (let ((s5-0 (-> (&+ (-> self actor-group 0) (* gp-0 8)) 3))) @@ -1502,8 +1502,8 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 115 - 3 + (game-task-node strip-grenade-explode) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (local-vars (sv-16 object)) @@ -1595,30 +1595,29 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 115 - 5 - (the-as (function object) (lambda :behavior task-manager - () - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) (process->ppointer self)) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'attack-invinc) - (set! (-> a1-0 param 0) (the-as uint #f)) - (let ((v1-3 (new 'static 'attack-info :mask (attack-info-mask mode id)))) - (let* ((a0-1 *game-info*) - (a2-1 (+ (-> a0-1 attack-id) 1)) - ) - (set! (-> a0-1 attack-id) a2-1) - (set! (-> v1-3 id) a2-1) - ) - (set! (-> v1-3 mode) 'big-explosion) - (set! (-> a1-0 param 1) (the-as uint v1-3)) - ) - (send-event-function *target* a1-0) - ) - (none) - ) + (game-task-node strip-grenade-explode) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager + () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'attack-invinc) + (set! (-> a1-0 param 0) (the-as uint #f)) + (let ((v1-3 (new 'static 'attack-info :mask (attack-info-mask mode id)))) + (let* ((a0-1 *game-info*) + (a2-1 (+ (-> a0-1 attack-id) 1)) + ) + (set! (-> a0-1 attack-id) a2-1) + (set! (-> v1-3 id) a2-1) ) + (set! (-> v1-3 mode) 'big-explosion) + (set! (-> a1-0 param 1) (the-as uint v1-3)) + ) + (send-event-function *target* a1-0) + ) + (none) + ) ) (deftype drill-plat (strip-hazard) @@ -1791,26 +1790,23 @@ This commonly includes things such as: (set-subtask-hook! *game-info* - 45 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> self info end-sphere quad)) - (quaternion-identity! (-> gp-0 quat)) - (set! (-> gp-0 flags) (task-arrow-flags)) - (set! (-> gp-0 map-icon) (the-as uint 15)) - (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) - ) - (while (>= (vector-vector-distance (target-pos 0) (-> self info end-sphere)) (-> self info end-sphere r)) - (suspend) - ) - (send-event (handle->process (-> self arrow)) 'leave) - (sleep-code) - (none) + (game-task-node strip-rescue-battle) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> self info end-sphere quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) ) + (while (>= (vector-vector-distance (target-pos 0) (-> self info end-sphere)) (-> self info end-sphere r)) + (suspend) + ) + (send-event (handle->process (-> self arrow)) 'leave) + (sleep-code) + (none) ) ) diff --git a/goal_src/jak2/levels/temple/mountain-obs.gc b/goal_src/jak2/levels/temple/mountain-obs.gc index 05c5af9801..63c228462e 100644 --- a/goal_src/jak2/levels/temple/mountain-obs.gc +++ b/goal_src/jak2/levels/temple/mountain-obs.gc @@ -1920,7 +1920,7 @@ This commonly includes things such as: (until (process-grab? *target* #f) (suspend) ) - (set-setting! 'entity-name "camera-259" 0 0) + (set-setting! 'entity-name "camera-259" 0.0 0) (let ((gp-0 (-> self clock frame-counter))) (until (>= (- (-> self clock frame-counter) gp-0) (seconds 1)) (suspend) diff --git a/goal_src/jak2/levels/temple/mountain-obs2.gc b/goal_src/jak2/levels/temple/mountain-obs2.gc index 9c13273552..317ca453d5 100644 --- a/goal_src/jak2/levels/temple/mountain-obs2.gc +++ b/goal_src/jak2/levels/temple/mountain-obs2.gc @@ -349,8 +349,8 @@ For example for an elevator pre-compute the distance between the first and last (set-subtask-hook! *game-info* - 155 - 3 + (game-task-node canyon-insert-items-door) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (let ((arrow-params (new 'stack-no-clear 'task-arrow-params))) diff --git a/goal_src/jak2/levels/temple/rhino.gc b/goal_src/jak2/levels/temple/rhino.gc index 2ca997734b..79c173c2c9 100644 --- a/goal_src/jak2/levels/temple/rhino.gc +++ b/goal_src/jak2/levels/temple/rhino.gc @@ -553,7 +553,7 @@ ((= v1-0 'interesting) (+! (-> obj interest) 1) (let ((v1-67 (process->ppointer obj))) - (set-setting! 'handle-of-interest v1-67 0 (-> v1-67 0 pid)) + (set-setting! 'handle-of-interest v1-67 0.0 (-> v1-67 0 pid)) ) ) ((= v1-0 'uninteresting) @@ -1128,8 +1128,8 @@ (defstate hostile (rhino) :virtual #t :enter (behavior () - (set-setting! 'sound-mode #f 0 1) - (set-setting! 'sound-excitement 'abs 0 0) + (set-setting! 'sound-mode #f 0.0 1) + (set-setting! 'sound-excitement 'abs 0.0 0) (let ((t9-2 (-> (method-of-type nav-enemy hostile) enter))) (if t9-2 (t9-2) @@ -1472,8 +1472,8 @@ :virtual #t :event (the-as (function process int symbol event-message-block object :behavior rhino) enemy-event-handler) :enter (behavior () - (set-setting! 'sound-mode #f 0 1) - (set-setting! 'sound-excitement 'abs 0 0) + (set-setting! 'sound-mode #f 0.0 1) + (set-setting! 'sound-excitement 'abs 0.0 0) (set! (-> self state-time) (-> self clock frame-counter)) (nav-enemy-method-166 self) (let ((v1-8 self)) diff --git a/goal_src/jak2/levels/title/title-obs.gc b/goal_src/jak2/levels/title/title-obs.gc index a34c314dab..e1ff0336a7 100644 --- a/goal_src/jak2/levels/title/title-obs.gc +++ b/goal_src/jak2/levels/title/title-obs.gc @@ -451,13 +451,13 @@ (set! (-> self want-name 1) (-> self draw-name)) (set! (-> self want 1) (-> self draw)) (when arg4 - (set-setting! 'bg-a 'abs #x3f800000 0) + (set-setting! 'bg-a 'abs 1.0 0) (set! (-> *setting-control* user-current bg-a) 1.0) (set-blackout-frames 0) (apply-settings *setting-control*) ) (when (>= (-> self draw) 0) - (set-setting! 'bg-a 'abs #x3f800000 0) + (set-setting! 'bg-a 'abs 1.0 0) (apply-settings *setting-control*) (while (!= (-> *setting-control* user-current bg-a) 1.0) (suspend) @@ -597,10 +597,10 @@ (-> pp clock seconds-per-frame) (bucket-id screen-filter) ) - (set-setting! 'allow-progress #t 0 0) + (set-setting! 'allow-progress #t 0.0 0) (apply-settings *setting-control*) (activate-progress *dproc* arg0) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-progress #f 0.0 0) (dotimes (gp-1 5) (suspend) ) @@ -609,7 +609,7 @@ (while (-> *blit-displays-work* menu-mode) (suspend) ) - (set-setting! 'allow-error #f 0 0) + (set-setting! 'allow-error #f 0.0 0) (apply-settings *setting-control*) (set-blackout-frames (seconds 0.2)) 0 @@ -701,10 +701,10 @@ ) (while (and (handle->process (the-as handle gp-2)) (= (-> *game-info* demo-state) 1)) (when (and (cpad-pressed? 0 start triangle) (< (-> *setting-control* user-current movie-skip-frame) 0.0)) - (set-setting! 'movie-skip-frame 'abs #x448a2000 0) - (set-setting! 'dialog-volume 'abs 0 0) + (set-setting! 'movie-skip-frame 'abs 1105.0 0) + (set-setting! 'dialog-volume 'abs 0.0 0) (set! (-> *setting-control* user-current dialog-volume) 0.000000001) - (set-setting! 'bg-a 'abs #x3f800000 0) + (set-setting! 'bg-a 'abs 1.0 0) (set! (-> *setting-control* user-current bg-a) 1.0) (apply-settings *setting-control*) ) @@ -917,13 +917,13 @@ ) (process-entity-set! self a1-2) ) - (set-setting! 'allow-pause #f 0 0) - (set-setting! 'allow-progress #f 0 0) - (set-setting! 'airlock #f 0 0) - (set-setting! 'music #f 0 0) - (set-setting! 'allow-timeout #f 0 0) - (set-setting! 'allow-error #f 0 0) - (set-setting! 'music-volume 'abs 0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'music #f 0.0 0) + (set-setting! 'allow-timeout #f 0.0 0) + (set-setting! 'allow-error #f 0.0 0) + (set-setting! 'music-volume 'abs 0.0 0) (apply-settings *setting-control*) (dotimes (gp-0 2) (set! (-> self buffer gp-0) diff --git a/goal_src/jak2/levels/underport/centipede.gc b/goal_src/jak2/levels/underport/centipede.gc index c9a0ffe2cf..6cc3d2f570 100644 --- a/goal_src/jak2/levels/underport/centipede.gc +++ b/goal_src/jak2/levels/underport/centipede.gc @@ -798,12 +798,12 @@ (logior! (-> self enemy-flags) (enemy-flag chase-startup)) (set! (-> self desired-talking-volume) 0.0) (centipede-method-187 self) - (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'interp-time 'abs 0.0 0) (when (not (-> self set-camera-mode?)) (set! (-> self set-camera-mode?) #t) (set-setting-by-param *setting-control* 'mode-name 'cam-fixed 0 0) ) - (set-setting! 'allow-look-around #f 0 0) + (set-setting! 'allow-look-around #f 0.0 0) (suspend) (until #f (let ((v1-13 *camera*)) @@ -1226,7 +1226,7 @@ (remove-setting-by-arg0 *setting-control* 'mode-name) ) (remove-setting! 'allow-look-around) - (set-setting! 'entity-name "camera-252" 0 0) + (set-setting! 'entity-name "camera-252" 0.0 0) (centipede-method-188 self) (suspend) (suspend) diff --git a/goal_src/jak2/levels/underport/sig5-course.gc b/goal_src/jak2/levels/underport/sig5-course.gc index 7470731dbc..2869f4611c 100644 --- a/goal_src/jak2/levels/underport/sig5-course.gc +++ b/goal_src/jak2/levels/underport/sig5-course.gc @@ -595,7 +595,7 @@ (the-as (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) - (set-setting! 'music 'tomb 0 0) + (set-setting! 'music 'tomb 0.0 0) (when (scene-release? arg1) (reset-warn-time! arg1) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -833,7 +833,7 @@ :nav-mesh-index -1 :skip-to -1 :on-set (lambda ((arg0 sig-under)) - (set-setting! 'music 'danger7 0 0) + (set-setting! 'music 'danger7 0.0 0) (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) (set! (-> v1-3 bytes 5) 1) (set! (-> v1-3 bytes 6) 7) @@ -915,7 +915,7 @@ :nav-mesh-index -1 :skip-to -1 :on-set (lambda ((arg0 sig-under)) - (set-setting! 'music 'tomb 0 0) + (set-setting! 'music 'tomb 0.0 0) (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) (set! (-> v1-3 bytes 5) 1) (set! (-> v1-3 bytes 6) 10) @@ -1255,7 +1255,7 @@ (with-pp (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (+ (-> pp clock frame-counter) (seconds -6))) (logior! (-> arg1 waypoint-bits) 1) - (set-setting! 'music 'danger3 0 0) + (set-setting! 'music 'danger3 0.0 0) ) #f ) @@ -1290,7 +1290,7 @@ (when (and (process-grab? arg0 #t) (process-grab? *target* #t)) (process-grab? arg0 #f) (process-grab? *target* #f) - (set-setting! 'entity-name "camera-245" 0 0) + (set-setting! 'entity-name "camera-245" 0.0 0) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) (process->ppointer pp)) (set! (-> a1-6 num-params) 0) @@ -1322,7 +1322,7 @@ ) ) (send-event (handle->process (-> arg0 growls 0)) 'fade) - (set-setting! 'music 'tomb 0 0) + (set-setting! 'music 'tomb 0.0 0) (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) (go-to-waypoint! arg0 21 #f) ) @@ -1524,7 +1524,7 @@ :skip-to -1 :on-set (lambda ((arg0 sig-under)) (stop-speech arg0 (the-as uint 0) #f) - (set-setting! 'music 'danger7 0 0) + (set-setting! 'music 'danger7 0.0 0) (set! (-> arg0 bot-task-bits) (logand -9 (-> arg0 bot-task-bits))) (let ((v1-7 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) (set! (-> v1-7 bytes 5) 1) diff --git a/goal_src/jak2/levels/underport/under-obs.gc b/goal_src/jak2/levels/underport/under-obs.gc index a9d590a7c7..2526d13050 100644 --- a/goal_src/jak2/levels/underport/under-obs.gc +++ b/goal_src/jak2/levels/underport/under-obs.gc @@ -1562,7 +1562,7 @@ This commonly includes things such as: (logtest? (elevator-flags airlock-opened) (-> self params flags)) ) (under-lift-method-49 self #t) - (set-setting! 'jump #f 0 0) + (set-setting! 'jump #f 0.0 0) ) (none) ) diff --git a/goal_src/jak2/levels/underport/underb-master.gc b/goal_src/jak2/levels/underport/underb-master.gc index cf954ef458..b3ce6ec08a 100644 --- a/goal_src/jak2/levels/underport/underb-master.gc +++ b/goal_src/jak2/levels/underport/underb-master.gc @@ -205,7 +205,7 @@ ((-> *setting-control* user-current pilot-exit) (let ((a1-2 *target*)) (when (and a1-2 (focus-test? a1-2 mech)) - (set-setting! 'pilot-exit #f 0 0) + (set-setting! 'pilot-exit #f 0.0 0) (apply-settings *setting-control*) #t ) @@ -482,7 +482,7 @@ :virtual #t :event underb-master-event-handler :enter (behavior () - (set-setting! 'entity-name "camera-239" 0 0) + (set-setting! 'entity-name "camera-239" 0.0 0) (send-event (ppointer->process *underb-master*) 'request 'under-warp #f) (none) ) @@ -527,7 +527,7 @@ :virtual #t :event underb-master-event-handler :enter (behavior () - (set-setting! 'mode-name 'cam-endlessfall 0 0) + (set-setting! 'mode-name 'cam-endlessfall 0.0 0) (none) ) :exit (behavior () @@ -563,7 +563,7 @@ :event underb-master-event-handler :enter (behavior () (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) - (set-setting! 'entity-name "camera-244" 0 0) + (set-setting! 'entity-name "camera-244" 0.0 0) (set! (-> self big-room-timer) (-> self clock frame-counter)) (send-event (ppointer->process *underb-master*) 'request 'under-warp #t) (none) @@ -961,7 +961,7 @@ (label cfg-11) (let ((a3-1 (res-lump-struct (-> self entity) 'camera-name structure))) (if a3-1 - (set-setting! 'entity-name a3-1 0 0) + (set-setting! 'entity-name a3-1 0.0 0) ) ) (until #f @@ -1045,7 +1045,7 @@ ) (let ((a3-1 (res-lump-struct (-> self entity) 'camera-name structure))) (if a3-1 - (set-setting! 'entity-name a3-1 0 0) + (set-setting! 'entity-name a3-1 0.0 0) ) ) (send-event (ppointer->process *underb-master*) 'request 'under-warp #f) diff --git a/goal_src/jak2/pc/debug/default-menu-pc.gc b/goal_src/jak2/pc/debug/default-menu-pc.gc index 0dac97e0d8..cdf19658ff 100644 --- a/goal_src/jak2/pc/debug/default-menu-pc.gc +++ b/goal_src/jak2/pc/debug/default-menu-pc.gc @@ -684,8 +684,8 @@ (set! *region-pick-menu* pick-menu) (debug-menu-append-item regions-menu (new-dm-submenu "Pick Region" pick-menu)) ) - (debug-menu-append-item regions-menu (new-dm-func "Refresh" #f build-regions-list)) (debug-menu-append-item regions-menu (new-dm-func "Refresh (merge prims)" #t build-regions-list)) + (debug-menu-append-item regions-menu (new-dm-func "Refresh" #f build-regions-list)) (debug-menu-append-item regions-menu (new-dm-func "Go to region" #f (lambda () (unless *region-debug-inspect* (return #f)) @@ -700,6 +700,12 @@ (debug-menu-append-item regions-menu (new-dm-func "Print on-exit" 'on-exit dm-print-region-pick-func)) (debug-menu-append-item regions-menu (new-dm-bool "Display region inside" *display-region-inside* dm-boolean-toggle-pick-func)) (debug-menu-append-item regions-menu (new-dm-bool "Region Marks" *display-region-marks* dm-boolean-toggle-pick-func)) + (debug-menu-append-item regions-menu (new-dm-bool "region-mode" #f + (lambda (arg (msg debug-menu-msg)) + (if (= msg (debug-menu-msg press)) + (not! (-> *setting-control* user-default region-mode)) + ) + (-> *setting-control* user-default region-mode)))) (new-dm-submenu "Regions" regions-menu) ) diff --git a/goal_src/jak2/pc/util/font-encode-test.gc b/goal_src/jak2/pc/util/font-encode-test.gc index 0779f89d1f..909b81ca0c 100644 --- a/goal_src/jak2/pc/util/font-encode-test.gc +++ b/goal_src/jak2/pc/util/font-encode-test.gc @@ -56,7 +56,7 @@ (loop (suspend) - (set-setting! 'music *music-to-be-less-annoying* 0 0) + (set-setting! 'music *music-to-be-less-annoying* 0.0 0) (cond ((not (cpad-hold? 0 r3)) (if (or (cpad-pressed? 0 left) (cpad-hold? 0 l1)) diff --git a/test/decompiler/reference/jak2/characters/underground_fighters/shuttle_REF.gc b/test/decompiler/reference/jak2/characters/underground_fighters/shuttle_REF.gc index 2db1c7d83b..48abb48c3d 100644 --- a/test/decompiler/reference/jak2/characters/underground_fighters/shuttle_REF.gc +++ b/test/decompiler/reference/jak2/characters/underground_fighters/shuttle_REF.gc @@ -1073,7 +1073,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. (defun shuttle-init ((arg0 task-manager) (arg1 (array city-shuttle-info))) - (set-setting! 'minimap 'clear 0 32) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) (let ((s3-0 *traffic-manager*) (s4-0 (new 'stack 'traffic-object-spawn-params)) ) @@ -1150,7 +1150,7 @@ (else (set! (-> arg0 start-time) (-> pp clock frame-counter)) (when (< (vector-vector-xz-distance (target-pos 0) (-> arg0 begin-pos)) 102400.0) - (set-setting! 'airlock #f 0 0) + (set-setting! 'airlock #f 0.0 0) (set! (-> arg0 data-int32 9) 1) ) ) @@ -1564,148 +1564,131 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 95 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 citizen-rebel) (arg1 object) (arg2 symbol)) - (case arg2 - (('task-done) - (format #t "task-done~%") - (set! (-> self sub-state) (+ (-> arg0 index) 2)) - (set! (-> *game-info* counter) (+ -1.0 (-> *game-info* counter))) - ) - ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 95 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) - (let ((v1-4 (entity-by-name "parking-spot-8"))) - (if v1-4 - (logior! (-> v1-4 extra perm status) (entity-perm-status bit-9)) - ) - ) - (shuttle-init self *city-shuttle-info*) - (none) + (game-task-node city-shuttle-shuttle) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 citizen-rebel) (arg1 object) (arg2 symbol)) + (case arg2 + (('task-done) + (format #t "task-done~%") + (set! (-> self sub-state) (+ (-> arg0 index) 2)) + (set! (-> *game-info* counter) (+ -1.0 (-> *game-info* counter))) + ) ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 95 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (let ((t9-0 shuttle-cleanup) - (a0-0 self) - ) - *city-shuttle-info* - (t9-0 a0-0) - ) - (send-event *traffic-manager* 'restore-default-settings) - (none) - ) + (game-task-node city-shuttle-shuttle) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) + (let ((v1-4 (entity-by-name "parking-spot-8"))) + (if v1-4 + (logior! (-> v1-4 extra perm status) (entity-perm-status bit-9)) ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 95 - 2 - (the-as - (function object) - (lambda :behavior task-manager () (shuttle-update self *city-shuttle-info* (the-as uint 95)) (none)) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 95 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-citizen :init hud-init-by-other :to self))) - (send-event *traffic-manager* 'set-target-level #x3f400000) - (send-event *traffic-manager* 'set-guard-target-count-range 4 0 1) - (send-event *traffic-manager* 'set-guard-target-count-range 5 0 1) - (send-event *traffic-manager* 'set-guard-target-count-range 0 0 2) - (send-event *traffic-manager* 'set-guard-target-count-range 1 0 3) - (while (zero? (-> self sub-state)) - (suspend) - ) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) - (suspend) - ) - (send-event *traffic-manager* 'set-alert-level 2) - (send-event *traffic-manager* 'set-alert-duration #xa4cb80) - (none) ) + (shuttle-init self *city-shuttle-info*) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 95 - 5 - (the-as - (function object) - (lambda :behavior task-manager () (send-event (handle->process (-> self arrow)) 'die) (none)) + (game-task-node city-shuttle-shuttle) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (let ((t9-0 shuttle-cleanup) + (a0-0 self) + ) + *city-shuttle-info* + (t9-0 a0-0) + ) + (send-event *traffic-manager* 'restore-default-settings) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 95 - 4 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (talker-spawn-func (-> *talker-speech* 97) *entity-pool* (target-pos 0) (the-as region #f)) - (let ((gp-1 (-> self clock frame-counter))) - (until #f - (let ((v1-4 0)) - (dotimes (a0-2 4) - (let ((a1-5 (handle->process (-> self slave (* a0-2 2))))) - (if (or (not a1-5) (and (-> a1-5 next-state) (= (-> a1-5 next-state name) 'inactive))) - (+! v1-4 1) - ) - ) + (game-task-node city-shuttle-shuttle) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager () (shuttle-update self *city-shuttle-info* (the-as uint 95)) (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-shuttle-shuttle) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-citizen :init hud-init-by-other :to self))) + (send-event *traffic-manager* 'set-target-level #x3f400000) + (send-event *traffic-manager* 'set-guard-target-count-range 4 0 1) + (send-event *traffic-manager* 'set-guard-target-count-range 5 0 1) + (send-event *traffic-manager* 'set-guard-target-count-range 0 0 2) + (send-event *traffic-manager* 'set-guard-target-count-range 1 0 3) + (while (zero? (-> self sub-state)) + (suspend) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (send-event *traffic-manager* 'set-alert-level 2) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-shuttle-shuttle) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager () (send-event (handle->process (-> self arrow)) 'die) (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-shuttle-shuttle) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (talker-spawn-func (-> *talker-speech* 97) *entity-pool* (target-pos 0) (the-as region #f)) + (let ((gp-1 (-> self clock frame-counter))) + (until #f + (let ((v1-4 0)) + (dotimes (a0-2 4) + (let ((a1-5 (handle->process (-> self slave (* a0-2 2))))) + (if (or (not a1-5) (and (-> a1-5 next-state) (= (-> a1-5 next-state name) 'inactive))) + (+! v1-4 1) + ) ) - (if (or (>= v1-4 4) (>= (- (-> self clock frame-counter) gp-1) (seconds 10))) - (goto cfg-23) - ) ) - (suspend) - 0 + (if (or (>= v1-4 4) (>= (- (-> self clock frame-counter) gp-1) (seconds 10))) + (goto cfg-23) + ) ) + (suspend) + 0 ) - #f - (label cfg-23) - (task-node-close! (game-task-node city-shuttle-resolution)) - (none) ) + #f + (label cfg-23) + (task-node-close! (game-task-node city-shuttle-resolution)) + (none) ) ) @@ -1766,64 +1749,59 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 279 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 citizen-rebel) (arg1 object) (arg2 symbol)) - (case arg2 - (('task-done) - (format #t "task-done~%") - (set! (-> self sub-state) (+ (-> arg0 index) 2)) - (set! (-> *game-info* counter) (+ -1.0 (-> *game-info* counter))) - ) - ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 279 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'airlock #f 0 0) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -687390.75 :y 40960.0 :z 3479224.2 :w 1.0) quad)) - (shuttle-init self *city-burning-bush-shuttle-1-info*) - (none) + (game-task-node city-burning-bush-shuttle-1-resolution) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 citizen-rebel) (arg1 object) (arg2 symbol)) + (case arg2 + (('task-done) + (format #t "task-done~%") + (set! (-> self sub-state) (+ (-> arg0 index) 2)) + (set! (-> *game-info* counter) (+ -1.0 (-> *game-info* counter))) + ) ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 279 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (let ((t9-0 shuttle-cleanup) - (a0-0 self) - ) - *city-burning-bush-shuttle-1-info* - (t9-0 a0-0) - ) - (send-event *traffic-manager* 'restore-default-settings) - (none) - ) - ) + (game-task-node city-burning-bush-shuttle-1-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -687390.75 :y 40960.0 :z 3479224.2 :w 1.0) quad)) + (shuttle-init self *city-burning-bush-shuttle-1-info*) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 279 - 2 + (game-task-node city-burning-bush-shuttle-1-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (let ((t9-0 shuttle-cleanup) + (a0-0 self) + ) + *city-burning-bush-shuttle-1-info* + (t9-0 a0-0) + ) + (send-event *traffic-manager* 'restore-default-settings) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-shuttle-1-resolution) + TASK_MANAGER_UPDATE_HOOK (lambda :behavior task-manager () (the-as symbol (shuttle-update self *city-burning-bush-shuttle-1-info* (the-as uint 279))) @@ -1833,77 +1811,64 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 279 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-citizen :init hud-init-by-other :to self))) - (send-event *traffic-manager* 'set-target-level #x3f400000) - (send-event *traffic-manager* 'set-guard-target-count-range 4 0 1) - (send-event *traffic-manager* 'set-guard-target-count-range 5 0 1) - (send-event *traffic-manager* 'set-guard-target-count-range 0 0 2) - (send-event *traffic-manager* 'set-guard-target-count-range 1 0 3) - (while (zero? (-> self sub-state)) - (suspend) - ) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) - (suspend) - ) - (send-event *traffic-manager* 'set-alert-level 2) - (send-event *traffic-manager* 'set-alert-duration #xa4cb80) - (none) + (game-task-node city-burning-bush-shuttle-1-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-citizen :init hud-init-by-other :to self))) + (send-event *traffic-manager* 'set-target-level #x3f400000) + (send-event *traffic-manager* 'set-guard-target-count-range 4 0 1) + (send-event *traffic-manager* 'set-guard-target-count-range 5 0 1) + (send-event *traffic-manager* 'set-guard-target-count-range 0 0 2) + (send-event *traffic-manager* 'set-guard-target-count-range 1 0 3) + (while (zero? (-> self sub-state)) + (suspend) ) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (send-event *traffic-manager* 'set-alert-level 2) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 279 - 5 - (the-as - (function object) - (lambda :behavior task-manager () (send-event (handle->process (-> self arrow)) 'die) (none)) - ) + (game-task-node city-burning-bush-shuttle-1-resolution) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager () (send-event (handle->process (-> self arrow)) 'die) (none)) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 279 - 4 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (until #f - (let ((v1-2 0)) - (dotimes (a0-0 4) - (let ((a1-4 (handle->process (-> self slave (* a0-0 2))))) - (if (and a1-4 (-> a1-4 next-state) (= (-> a1-4 next-state name) 'inactive)) - (+! v1-2 1) - ) - ) + (game-task-node city-burning-bush-shuttle-1-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (until #f + (let ((v1-2 0)) + (dotimes (a0-0 4) + (let ((a1-4 (handle->process (-> self slave (* a0-0 2))))) + (if (and a1-4 (-> a1-4 next-state) (= (-> a1-4 next-state name) 'inactive)) + (+! v1-2 1) + ) ) - (if (= v1-2 4) - (goto cfg-20) - ) ) - (suspend) - 0 + (if (= v1-2 4) + (goto cfg-20) + ) ) - #f - (label cfg-20) - (task-node-close! (game-task-node city-burning-bush-shuttle-1-resolution)) - (none) + (suspend) + 0 ) + #f + (label cfg-20) + (task-node-close! (game-task-node city-burning-bush-shuttle-1-resolution)) + (none) ) ) - - - - diff --git a/test/decompiler/reference/jak2/decompiler-macros.gc b/test/decompiler/reference/jak2/decompiler-macros.gc index 99eccd5341..04416687eb 100644 --- a/test/decompiler/reference/jak2/decompiler-macros.gc +++ b/test/decompiler/reference/jak2/decompiler-macros.gc @@ -1554,4 +1554,15 @@ `(eval! (new 'stack 'script-context ,key ,proc ,vector) ,script)) (defmacro focus-test? (pfoc &rest status) - `(logtest? (-> (the process-focusable ,pfoc) focus-status) (focus-status ,@status))) \ No newline at end of file + `(logtest? (-> (the process-focusable ,pfoc) focus-status) (focus-status ,@status))) + + + +(defconstant TASK_MANAGER_INIT_HOOK 0) +(defconstant TASK_MANAGER_CLEANUP_HOOK 1) +(defconstant TASK_MANAGER_UPDATE_HOOK 2) +(defconstant TASK_MANAGER_CODE_HOOK 3) +(defconstant TASK_MANAGER_COMPLETE_HOOK 4) +(defconstant TASK_MANAGER_FAIL_HOOK 5) +(defconstant TASK_MANAGER_EVENT_HOOK 6) + diff --git a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc index 25c0410f89..f207ecb468 100644 --- a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc @@ -392,8 +392,8 @@ (if (logtest? (-> self message flags) 1) (play-communicator-speech! (-> self message)) ) - (set-setting! 'hint (process->ppointer self) 0 0) - (set-setting! 'speech-control #f 0 0) + (set-setting! 'hint (process->ppointer self) 0.0 0) + (set-setting! 'speech-control #f 0.0 0) (if (nonzero? (-> self voice-id)) (set-action! *gui-control* diff --git a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc index 734e57b3bb..0021a73f8c 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc @@ -296,7 +296,6 @@ ) ;; definition for function cam-layout-print -;; ERROR: Failed store: (s.w! (+ v1-6 8) 0) at op 22 (defun cam-layout-print ((arg0 int) (arg1 int) (arg2 string)) (with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) debug-buf)) (bucket-id debug2) @@ -953,7 +952,7 @@ "Displays the message `button test`" (cam-layout-print 16 *camera-layout-message-ypos* "button test") (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) - (set-setting! 'master-options 'set 0 32) + (set-setting! 'master-options 'set 0.0 32) #f ) @@ -962,7 +961,7 @@ "Displays the message `button not available`" (cam-layout-print 16 *camera-layout-message-ypos* "button not applicable") (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) - (set-setting! 'master-options 'set 0 32) + (set-setting! 'master-options 'set 0.0 32) #t ) @@ -971,7 +970,7 @@ "Displays the message `button not implemented yet`" (cam-layout-print 16 *camera-layout-message-ypos* "button not implemented yet") (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) - (set-setting! 'master-options 'set 0 32) + (set-setting! 'master-options 'set 0.0 32) #t ) @@ -1129,7 +1128,7 @@ ) ) ) - (set-setting! 'master-options 'set 0 32) + (set-setting! 'master-options 'set 0.0 32) #t ) @@ -1168,7 +1167,7 @@ ) ) (clmf-next-volume a0-1) - (set-setting! 'master-options 'set 0 32) + (set-setting! 'master-options 'set 0.0 32) #t ) @@ -1283,7 +1282,7 @@ (set! (-> *camera-other-root* quad) (-> *camera-other-trans* quad)) (cam-slave-get-rot (the-as entity-actor (-> self cam-entity)) *camera-other-matrix*) (set! *camera-look-through-other* 10) - (set-setting! 'master-options 'set 0 32) + (set-setting! 'master-options 'set 0.0 32) #f ) @@ -2512,7 +2511,7 @@ ) ) ) - (set-setting! 'master-options 'set 0 32) + (set-setting! 'master-options 'set 0.0 32) #t ) @@ -3435,7 +3434,7 @@ ) (let ((s5-0 30)) (let ((s4-0 (cam-state-from-entity (-> self cam-entity)))) - (set-setting! 'master-options 'clear 0 32) + (set-setting! 'master-options 'clear 0.0 32) (let ((s3-0 (-> self cam-entity))) (clear *temp-string*) (if s3-0 diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc index c3d76a13d4..a0e04056f6 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc @@ -3792,8 +3792,8 @@ ) :enter (behavior () (when (not (-> self enter-has-run)) - (set-setting! 'head-offset 'abs #x46800000 0) - (set-setting! 'foot-offset 'abs #x45800000 0) + (set-setting! 'head-offset 'abs (meters 4) 0) + (set-setting! 'foot-offset 'abs (meters 1) 0) (set! (-> self view-off x) 0.0) (set! (-> self view-off y) (-> *CAM_BIKE-bank* max-y)) (set! (-> self view-off z) (-> *CAM_BIKE-bank* max-z)) diff --git a/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc index 14ef964466..addd1057a1 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc @@ -328,7 +328,7 @@ which is obviously useful for an elevator." ) ((= evt-type 'use-camera) (if (-> event param 0) - (set-setting! 'entity-name (-> event param 0) 0 0) + (set-setting! 'entity-name (-> event param 0) 0.0 0) (remove-setting! 'entity-name) ) ) @@ -675,7 +675,7 @@ do so. ) ) (logclear! (-> self mask) (process-mask actor-pause)) - (set-setting! 'board #f 0 0) + (set-setting! 'board #f 0.0 0) (let ((gp-0 (-> self on-activate))) (if gp-0 (script-eval gp-0 :key (* (the int (-> self move-pos 0)) 8) :vector (-> self root-override trans)) @@ -686,7 +686,7 @@ do so. (update-vol! (-> self sound) 0.0) ) (when (logtest? (-> self params flags) (elevator-flags prevent-jump)) - (set-setting! 'jump #f 0 0) + (set-setting! 'jump #f 0.0 0) (apply-settings *setting-control*) ) (none) 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 a3aa2e2f3c..df46985e36 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/powerups_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/powerups_REF.gc @@ -1003,8 +1003,8 @@ ((logtest? (-> self game features) (game-feature unk-game-feature-01)) (cond ((< (-> self clock frame-counter) (-> (the-as fact-info-target (-> self fact-override)) stop-time-timeout)) - (set-setting! 'bg-a 'abs #x3e99999a 0) - (set-setting! 'bg-r 'abs #x3f800000 0) + (set-setting! 'bg-a 'abs 0.3 0) + (set-setting! 'bg-r 'abs 1.0 0) (update-rates! (-> *display* entity-clock) 0.0) (if (zero? (mod (the-as int (-> *display* base-clock integral-frame-counter)) 60)) (sound-play "stopwatch") diff --git a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc index bd0c8e2676..8e0238dfde 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc @@ -2086,8 +2086,8 @@ (logclear! (-> self mask) (process-mask freeze pause menu)) (set! (-> self clock) (-> *display* real-clock)) (set! (-> self current) (new 'debug 'editable-array 4096)) - (add-setting! 'mouse #t 0 0) - (add-setting! 'cursor #t 0 0) + (add-setting! 'mouse #t 0.0 0) + (add-setting! 'cursor #t 0.0 0) (set! (-> self select-command) (the-as function 3)) (set! (-> self move-command) (the-as function 18)) (set! (-> self extra-command) (the-as function 23)) @@ -2622,7 +2622,3 @@ *debug-hook* ) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc b/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc index 6daa56d270..4fc278a676 100644 --- a/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc @@ -327,7 +327,7 @@ (give (_type_ symbol float handle) float 10) (task-complete? (_type_ game-task) symbol 11) (subtask-index-by-name (_type_ string) int 12) - (set-subtask-hook! (_type_ int int (function object :behavior task-manager)) (function object :behavior task-manager) 13) + (set-subtask-hook! (_type_ game-task-node int function) function 13) (actor-perm (_type_ actor-id) entity-perm 14) (task-perm-by-index (_type_ int) entity-perm 15) (copy-perms-from-level! (_type_ level) int 16) 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 11d0623d74..f3499b2ce1 100644 --- a/test/decompiler/reference/jak2/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-info_REF.gc @@ -57,7 +57,7 @@ ) ;; definition for method 13 of type game-info -(defmethod set-subtask-hook! game-info ((obj game-info) (arg0 int) (arg1 int) (arg2 (function object))) +(defmethod set-subtask-hook! game-info ((obj game-info) (arg0 game-task-node) (arg1 int) (arg2 function)) (let ((subtask (-> obj sub-task-list arg0))) (if (and subtask (-> subtask info)) (set! (-> subtask info hooks arg1) arg2) @@ -408,7 +408,7 @@ (set! (-> self mask) (process-mask)) (stop arg0) (reset-actors arg1) - (close! (-> *game-info* sub-task-list 1) 'event) + (close! (-> *game-info* sub-task-list (game-task-node fortress-escape-start)) 'event) (set-continue! *game-info* arg2 #f) (when arg3 (load-game *game-info* arg3) @@ -565,7 +565,7 @@ (set! (-> a1-13 num-params) 0) (set! (-> a1-13 message) 'complete) (let ((t9-12 send-event-function) - (v1-71 (-> *game-info* sub-task-list 43)) + (v1-71 (-> *game-info* sub-task-list (game-task-node sewer-enemy-resolution))) ) (t9-12 (handle->process (if (-> v1-71 info) @@ -588,7 +588,7 @@ (set! (-> a1-14 num-params) 0) (set! (-> a1-14 message) 'complete) (let ((t9-13 send-event-function) - (v1-85 (-> *game-info* sub-task-list 177)) + (v1-85 (-> *game-info* sub-task-list (game-task-node sewer-escort-get-gun))) ) (t9-13 (handle->process (if (-> v1-85 info) diff --git a/test/decompiler/reference/jak2/engine/game/game-save_REF.gc b/test/decompiler/reference/jak2/engine/game/game-save_REF.gc index 8925d4cd6d..7a4f490427 100644 --- a/test/decompiler/reference/jak2/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-save_REF.gc @@ -1878,7 +1878,6 @@ ) ;; definition for function auto-save-post -;; ERROR: Failed store: (s.w! (+ v1-45 8) 0) at op 192 (defbehavior auto-save-post auto-save () (when (and (= *cheat-mode* 'debug) (cpad-hold? 0 l3)) (let ((gp-0 @@ -1967,7 +1966,7 @@ auto-save-post (set! (-> self card) (-> *game-info* auto-save-card)) (set! (-> self which) (-> *game-info* auto-save-which)) ) - (set-setting! 'allow-pause #f 0 0) + (set-setting! 'allow-pause #f 0.0 0) (apply-settings *setting-control*) ) ((= arg0 'error) @@ -2374,12 +2373,12 @@ auto-save-post (go-virtual error (mc-status-code bad-version)) ) ) - (set-setting! 'music-volume 'abs 0 0) - (set-setting! 'sfx-volume 'abs 0 0) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (-> self save) (the-as string #f)) (set-master-mode 'game) - (add-setting! 'process-mask 'set 0 (process-mask progress)) + (add-setting! 'process-mask 'set 0.0 (process-mask progress)) (apply-settings *setting-control*) (sleep-code) (go-virtual done) diff --git a/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc b/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc index 68644c861e..63eea93c15 100644 --- a/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc @@ -72,7 +72,7 @@ (subtitle symbol :offset-assert 276) (borrow pair :offset-assert 280) (doorway symbol :offset-assert 284) - (gen symbol :offset-assert 288) + (gem symbol :offset-assert 288) (half-speed symbol :offset-assert 292) (gun-buoy symbol :offset-assert 296) (double-jump symbol :offset-assert 300) @@ -270,7 +270,7 @@ (format #t "~1Tsubtitle: ~A~%" (-> obj subtitle)) (format #t "~1Tborrow: ~A~%" (-> obj borrow)) (format #t "~1Tdoorway: ~A~%" (-> obj doorway)) - (format #t "~1Tgem: ~A~%" (-> obj gen)) + (format #t "~1Tgem: ~A~%" (-> obj gem)) (format #t "~1Thalf-speed: ~A~%" (-> obj half-speed)) (format #t "~1Tgun-buoy: ~A~%" (-> obj gun-buoy)) (format #t "~1Tdouble-jump: ~A~%" (-> obj double-jump)) diff --git a/test/decompiler/reference/jak2/engine/game/settings_REF.gc b/test/decompiler/reference/jak2/engine/game/settings_REF.gc index 91bcfd46a5..1708e4d655 100644 --- a/test/decompiler/reference/jak2/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/settings_REF.gc @@ -445,7 +445,7 @@ ) ) (('gem) - (set! (-> obj gen) arg1) + (set! (-> obj gem) arg1) ) (('minimap) (case arg1 @@ -1000,7 +1000,7 @@ (set! (-> s5-0 features) (-> s4-0 features)) (set! (-> s5-0 rain) (-> s4-0 rain)) (set! (-> s5-0 snow) (-> s4-0 snow)) - (set! (-> s5-0 gen) (-> s4-0 gen)) + (set! (-> s5-0 gem) (-> s4-0 gem)) (set! (-> s5-0 minimap) (-> s4-0 minimap)) (set! (-> s5-0 race-minimap) (-> s4-0 race-minimap)) (set! (-> s5-0 half-speed) (-> s4-0 half-speed)) @@ -1476,7 +1476,7 @@ (set! (-> gp-0 speech-control) #t) (set! (-> gp-0 vehicle-hijacking) #t) (set! (-> gp-0 ignore-target) #f) - (set! (-> gp-0 gen) #t) + (set! (-> gp-0 gem) #t) (set! (-> gp-0 half-speed) #f) (set! (-> gp-0 render) #t) (set! (-> gp-0 speed-mult) 1.0) @@ -1566,7 +1566,7 @@ (set! (-> s5-0 gun) (-> gp-0 gun)) (set! (-> s5-0 doorway) (-> gp-0 doorway)) (set! (-> s5-0 board) (-> gp-0 board)) - (set! (-> s5-0 gen) (-> gp-0 gen)) + (set! (-> s5-0 gem) (-> gp-0 gem)) (set! (-> s5-0 half-speed) (-> gp-0 half-speed)) (set! (-> s5-0 render) (-> gp-0 render)) (set! (-> s5-0 speed-mult) (-> gp-0 speed-mult)) diff --git a/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc b/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc index 2d201eec8a..3a51b36dd4 100644 --- a/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc @@ -921,7 +921,7 @@ (((game-task-action say)) "say" ) - (((game-task-action shade)) + (((game-task-action trade)) "trade" ) (((game-task-action menu)) @@ -984,7 +984,7 @@ (complete-hook (function object) :offset-assert 60) (fail-hook (function object) :offset-assert 64) (event-hook (function process int symbol event-message-block object) :offset-assert 68) - (hooks (function object) 7 :offset 44) + (hooks function 7 :offset 44) (final-node game-task-node :offset-assert 72) (time-limit int32 :offset-assert 76) (sphere-count int8 :offset-assert 80) 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 9e84ee6061..ae07ca6c7e 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 @@ -125,7 +125,7 @@ ) ) ) - (borrow-eval (-> *game-info* sub-task-list 1 borrow)) + (borrow-eval (-> *game-info* sub-task-list (game-task-node fortress-escape-start) borrow)) (let ((game-nodes (-> *game-info* sub-task-list))) (dotimes (i (-> game-nodes length)) (when (nonzero? i) @@ -1303,7 +1303,7 @@ ((= v1-1 (game-task-action say)) "say" ) - ((= v1-1 (game-task-action shade)) + ((= v1-1 (game-task-action trade)) "trade" ) ((= v1-1 (game-task-action menu)) @@ -1788,8 +1788,8 @@ (set! (-> self reset-delay) (-> arg0 reset-delay)) (set! (-> self task) (-> arg0 task)) (set! (-> self fail-message) (the-as uint (-> arg0 fail-message))) - (set-setting! 'allow-continue #f 0 0) - (set-setting! 'minimap 'clear 0 128) + (set-setting! 'allow-continue #f 0.0 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set-action! *gui-control* (gui-action stop) @@ -1817,9 +1817,9 @@ ) ) ) - (set-setting! 'music-volume 'abs 0 0) - (set-setting! 'sfx-volume 'abs 0 0) - (set-setting! 'speech-control #f 0 0) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'speech-control #f 0.0 0) (set! (-> self clock) (-> *display* base-clock)) (apply-settings *setting-control*) (if (or (not (logtest? (-> self flags) (fail-mission-flags famflags-2))) @@ -1887,8 +1887,8 @@ (add-connection *task-manager-engine* self nothing self arg0 #f) (set! (-> self node-info) arg0) (set! (-> self lev-name) arg1) - (add-setting! 'task arg0 0 0) - (add-setting! 'task-manager (process->ppointer self) 0 0) + (add-setting! 'task arg0 0.0 0) + (add-setting! 'task-manager (process->ppointer self) 0.0 0) (set! (-> self intro-time) (-> self clock frame-counter)) (set! (-> self fail-on-death?) (not (logtest? (-> arg0 flags) (game-task-node-flag no-fail-on-death)))) (when arg1 diff --git a/test/decompiler/reference/jak2/engine/load/loader_REF.gc b/test/decompiler/reference/jak2/engine/load/loader_REF.gc index a74f6cc247..d3f799a793 100644 --- a/test/decompiler/reference/jak2/engine/load/loader_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/loader_REF.gc @@ -922,8 +922,8 @@ ) ) ) - (set-setting! 'spooling (process->ppointer self) 0 0) - (set-setting! 'spool-anim (-> gp-0 anim) 0 0) + (set-setting! 'spooling (process->ppointer self) 0.0 0) + (set-setting! 'spool-anim (-> gp-0 anim) 0.0 0) (apply-settings *setting-control*) (set! (-> gp-0 old-time) (-> self clock frame-counter)) (while (< (-> gp-0 part) (-> gp-0 anim parts)) 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 1b8324ced2..ca0e31f46d 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 @@ -196,7 +196,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) (when (and (or (= (-> gp-0 action) (game-task-action say)) (= (-> gp-0 action) (game-task-action talk)) - (= (-> gp-0 action) (game-task-action shade)) + (= (-> gp-0 action) (game-task-action trade)) (= (-> gp-0 action) (game-task-action play)) ) (process-taskable-method-34 self) diff --git a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc index 53defb46fb..e92d21f64d 100644 --- a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc +++ b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc @@ -648,11 +648,11 @@ ) (process-entity-status! obj (entity-perm-status no-kill) #t) (when arg1 - (set-setting! 'region-mode #f 0 0) - (set-setting! 'process-mask 'set 0 (-> gp-0 mask-to-clear)) - (set-setting! 'sound-bank-load #f 0 0) - (set-setting! 'movie (process->ppointer obj) 0 0) - (set-setting! 'movie-name (-> gp-0 name) 0 0) + (set-setting! 'region-mode #f 0.0 0) + (set-setting! 'process-mask 'set 0.0 (-> gp-0 mask-to-clear)) + (set-setting! 'sound-bank-load #f 0.0 0) + (set-setting! 'movie (process->ppointer obj) 0.0 0) + (set-setting! 'movie-name (-> gp-0 name) 0.0 0) (set-setting! 'music-volume 'rel @@ -681,9 +681,9 @@ 0 ) (if (nonzero? (the int (-> gp-0 music-delay))) - (set-setting! 'sound-mode #f 0 2) + (set-setting! 'sound-mode #f 0.0 2) ) - (set-setting! 'gem #f 0 0) + (set-setting! 'gem #f 0.0 0) (apply-settings *setting-control*) ) ) @@ -747,7 +747,6 @@ ;; definition for function draw-subtitle-image ;; INFO: Used lq/sq ;; WARN: Return type mismatch pointer vs none. -;; ERROR: Failed store: (s.w! (+ a0-7 8) 0) at op 45 (defun draw-subtitle-image ((arg0 subtitle-image) (arg1 font-context)) (local-vars (sv-16 pointer) (sv-32 int)) (let ((gp-0 (-> arg0 width)) @@ -934,7 +933,7 @@ ) (when gp-0 (when (-> self scene) - (set-setting! 'borrow (-> self scene borrow) 0 0) + (set-setting! 'borrow (-> self scene borrow) 0.0 0) (apply-settings *setting-control*) ) (cond @@ -987,8 +986,8 @@ (while *progress-process* (suspend) ) - (set-setting! 'allow-progress #f 0 0) - (set-setting! 'bg-a-force 'abs #x3f800000 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'bg-a-force 'abs 1.0 0) (apply-settings *setting-control*) ) (if (or (not *target*) (or (focus-test? *target* grabbed) @@ -1033,7 +1032,7 @@ (-> *setting-control* user-current ambient) ) ) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-progress #f 0.0 0) (apply-settings *setting-control*) (dotimes (s4-0 2) (while (or (-> *setting-control* user-current talking) @@ -1096,7 +1095,7 @@ (when (and (zero? s5-1) (< (-> self scene-index) (-> self scene-list length))) (scene-player-method-24 self (-> self scene-list (-> self scene-index)) #t) (when (-> self scene) - (set-setting! 'borrow (-> self scene borrow) 0 0) + (set-setting! 'borrow (-> self scene borrow) 0.0 0) (apply-settings *setting-control*) ) ) @@ -1142,11 +1141,11 @@ (when (= (-> *game-info* demo-state) 100) (logclear! (-> self mask) (process-mask pause progress)) (set-blackout-frames (seconds 0.05)) - (set-setting! 'music-volume 'abs 0 0) - (set-setting! 'sfx-volume 'abs 0 0) - (set-setting! 'ambient-volume 'abs 0 0) - (set-setting! 'allow-pause #f 0 0) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (setup *screen-filter* (new 'static 'vector) @@ -1171,7 +1170,7 @@ (set! (-> *game-info* blackout-time) 0) (set! (-> *game-info* demo-state) (the-as uint 1)) (set! (-> *setting-control* user-current bg-a-force) 0.0) - (set-setting! 'allow-progress #t 0 0) + (set-setting! 'allow-progress #t 0.0 0) (remove-setting! 'process-mask) (apply-settings *setting-control*) (send-event *target* 'draw #t) @@ -1736,8 +1735,8 @@ ) (set! *scene-player* (the-as (pointer scene-player) (process->ppointer self))) (set! *display-entity-errors* #f) - (set-setting! 'speech-control #f 0 0) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'speech-control #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (apply-settings *setting-control*) (go-virtual wait arg1) (none) diff --git a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc index 4e55404657..d3a3ea3444 100644 --- a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc @@ -840,9 +840,9 @@ otherwise, an explicit [[vector]] can be provided" ;; definition for function sound-volume-off (defun sound-volume-off () - (set-setting! 'music-volume 'abs 0 0) - (set-setting! 'sfx-volume 'abs 0 0) - (set-setting! 'ambient-volume 'abs 0 0) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) 0 ) 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 2d601e5fd8..8c4ce99a96 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 @@ -288,8 +288,8 @@ (vector-! gp-0 gp-0 (get-trans self 0)) (send-event *camera* 'relative-position gp-0) ) - (set-setting! 'matrix-blend-max-angle 'abs #x45088889 0) - (set-setting! 'matrix-blend-max-partial 'abs #x3f000000 0) + (set-setting! 'matrix-blend-max-angle 'abs (degrees 12.000001) 0) + (set-setting! 'matrix-blend-max-partial 'abs 0.5 0) ) 0 (none) diff --git a/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc b/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc index 95c358e670..1cd08a96d6 100644 --- a/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc @@ -697,8 +697,8 @@ (set! (-> self board sound-air-knob) 0.0) (set! (-> self board sound-bank-knob) 0.0) (set! (-> self board unknown-sound-id00) (new 'static 'sound-id)) - (set-setting! 'mode-sound-bank 'board 0 0) - (set-setting! 'sound-flava #f #x41f00000 2) + (set-setting! 'mode-sound-bank 'board 0.0 0) + (set-setting! 'sound-flava #f 30.0 2) (set! (-> self board board-get-on-time) (-> self clock frame-counter)) (set! (-> self board stick-lock) #f) (set! (-> self board stick-off) #f) @@ -756,10 +756,10 @@ (-> self control dynam gravity-normal) (the-as float (-> self control dynam gravity-length)) ) - (set-setting! 'string-spline-max-move 'abs #x46000000 0) - (set-setting! 'string-spline-accel 'abs #x433851ec 0) - (set-setting! 'string-spline-max-move-player 'abs #x45c00000 0) - (set-setting! 'string-spline-accel-player 'abs #x430f5c29 0) + (set-setting! 'string-spline-max-move 'abs (meters 2) 0) + (set-setting! 'string-spline-accel 'abs (meters 0.045) 0) + (set-setting! 'string-spline-max-move-player 'abs (meters 1.5) 0) + (set-setting! 'string-spline-accel-player 'abs (meters 0.035) 0) (none) ) @@ -3029,7 +3029,3 @@ (none) ) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc index c34d089f98..8173ea2c3e 100644 --- a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc @@ -3155,8 +3155,8 @@ (set! (-> obj tobot-recorder) #f) (set! (-> obj mode-cache) #f) (set! (-> obj color-effect) #f) - (set-setting! 'allow-pause #f 0 0) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (set! (-> *setting-control* cam-default mode-name) 'cam-string) (apply-settings *setting-control*) (if (not arg0) diff --git a/test/decompiler/reference/jak2/engine/target/mech_suit/mech-states_REF.gc b/test/decompiler/reference/jak2/engine/target/mech_suit/mech-states_REF.gc index 400076d807..654e645c51 100644 --- a/test/decompiler/reference/jak2/engine/target/mech_suit/mech-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech_suit/mech-states_REF.gc @@ -1186,7 +1186,7 @@ (set! (-> self neck flex-blend) 0.0) (target-timed-invulnerable-off self 0) (target-timed-invulnerable-off self 0) - (set-setting! 'process-mask 'set 0 (process-mask platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask platform projectile death)) (apply-settings *setting-control*) (set! (-> self control transv quad) (the-as uint128 0)) (logior! (-> self focus-status) (focus-status dead)) @@ -1202,7 +1202,7 @@ (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "jakfall" -99.0 0) ) (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) - (set-setting! 'mode-name 'cam-endlessfall 0 0) + (set-setting! 'mode-name 'cam-endlessfall 0.0 0) (set! (-> self control pat-ignore-mask) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> self control pat-ignore-mask)) ) @@ -2726,7 +2726,7 @@ (logior! (-> self state-flags) (state-flags sf5)) (set! (-> self control mod-surface) *empty-mods*) (rot->dir-targ! (-> self control)) - (set-setting! 'slave-options 'clear 0 8192) + (set-setting! 'slave-options 'clear 0.0 (cam-slave-options BIKE_MODE)) (remove-setting! 'fov) (remove-setting! 'head-offset) (send-event *camera* 'set-dist #f #f) diff --git a/test/decompiler/reference/jak2/engine/target/mech_suit/target-mech_REF.gc b/test/decompiler/reference/jak2/engine/target/mech_suit/target-mech_REF.gc index 8257b61e58..5def06c9ce 100644 --- a/test/decompiler/reference/jak2/engine/target/mech_suit/target-mech_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech_suit/target-mech_REF.gc @@ -1292,14 +1292,14 @@ ) ) (logior! (-> self state-flags) (state-flags sf6)) - (set-setting! 'string-max-length 'low #x46e00000 0) - (set-setting! 'string-min-length 'low #x46800000 0) - (set-setting! 'string-max-height 'low #x46a00000 0) - (set-setting! 'string-min-height 'low #x46600000 0) - (set-setting! 'fov 'abs #x46555555 0) - (set-setting! 'head-offset 'abs #x46900000 0) - (set-setting! 'mode-sound-bank 'mech 0 0) - (set-setting! 'sound-flava #f #x41f00000 3) + (set-setting! 'string-max-length 'low (meters 7) 0) + (set-setting! 'string-min-length 'low (meters 4) 0) + (set-setting! 'string-max-height 'low (meters 5) 0) + (set-setting! 'string-min-height 'low (meters 3.5) 0) + (set-setting! 'fov 'abs (degrees 75.0) 0) + (set-setting! 'head-offset 'abs (meters 4.5) 0) + (set-setting! 'mode-sound-bank 'mech 0.0 0) + (set-setting! 'sound-flava #f 30.0 3) (set! (-> self mech hud 0) (ppointer->handle (process-spawn hud-heatmeter :init hud-init-by-other :to self))) (remove-exit) (if arg2 @@ -1785,3 +1785,7 @@ (target-mech-real-post) (none) ) + + + + diff --git a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc index 56c8072922..c3662bf809 100644 --- a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc @@ -317,7 +317,7 @@ (set! (-> self darkjak start-time) (-> self clock frame-counter)) (set! (-> self darkjak attack-count) (the-as uint 0)) (set! (-> self darkjak-giant-interp) 1.0) - (set-setting! 'sound-flava #f #x41f00000 4) + (set-setting! 'sound-flava #f 30.0 4) (set! (-> self focus-status) (logior (focus-status dark) (-> self focus-status))) (set! (-> (the-as fact-info-target (-> self fact-override)) darkjak-start-time) (-> self clock frame-counter)) (set! (-> (the-as fact-info-target (-> self fact-override)) darkjak-effect-time) (seconds 20)) @@ -328,8 +328,8 @@ (if (logtest? arg0 64) (go target-stance) ) - (set-setting! 'bg-r 'abs #x3dcccccd 0) - (set-setting! 'bg-b 'abs #x3dcccccd 0) + (set-setting! 'bg-r 'abs 0.1 0) + (set-setting! 'bg-b 'abs 0.1 0) (set-forward-vel 0.0) (let ((s5-0 0)) (while (not (logtest? (-> self control status) (collide-status on-surface))) @@ -433,7 +433,7 @@ (set! (-> a1-1 message) 'target) (set! (-> a1-1 param 0) (the-as uint 'normal)) (let ((t9-1 send-event-function) - (v1-12 (-> *game-info* sub-task-list 4)) + (v1-12 (-> *game-info* sub-task-list (game-task-node city-help-kid-introduction))) ) (t9-1 (handle->process (if (-> v1-12 info) @@ -607,7 +607,7 @@ (sv-56 handle) (sv-64 int) ) - (set-setting! 'rapid-tracking #f 0 0) + (set-setting! 'rapid-tracking #f 0.0 0) ((lambda :behavior target () (set! (-> self control bend-target) (* 0.5 (-> self control bend-target))) @@ -1130,9 +1130,9 @@ (ja :num! (seek!)) ) ) - (set-setting! 'music-volume 'rel 0 0) - (set-setting! 'sfx-volume 'rel 0 0) - (set-setting! 'ambient-volume 'rel 0 0) + (set-setting! 'music-volume 'rel 0.0 0) + (set-setting! 'sfx-volume 'rel 0.0 0) + (set-setting! 'ambient-volume 'rel 0.0 0) (ja-no-eval :group! (-> self draw art-group data 416) :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 416)) frames num-frames) -1))) :frame-num 0.0 @@ -1593,8 +1593,8 @@ ) (logior! (-> self state-flags) (state-flags sf4)) (set! (-> self neck flex-blend) 0.0) - (set-setting! 'music-volume 'rel 0 0) - (set-setting! 'ambient-volume 'rel 0 0) + (set-setting! 'music-volume 'rel 0.0 0) + (set-setting! 'ambient-volume 'rel 0.0 0) (compute-alignment! (-> self align)) (set-action! *gui-control* @@ -1943,12 +1943,12 @@ ) ) (when gp-2 - (set-setting! 'string-min-length 'rel #x3fe66666 0) - (set-setting! 'string-max-length 'rel #x3fc00000 0) - (set-setting! 'string-spline-max-move 'abs #x46000000 0) - (set-setting! 'string-spline-accel 'abs #x433851ec 0) - (set-setting! 'string-spline-max-move-player 'abs #x45c00000 0) - (set-setting! 'string-spline-accel-player 'abs #x430f5c29 0) + (set-setting! 'string-min-length 'rel 1.8 0) + (set-setting! 'string-max-length 'rel 1.5 0) + (set-setting! 'string-spline-max-move 'abs (meters 2) 0) + (set-setting! 'string-spline-accel 'abs (meters 0.045) 0) + (set-setting! 'string-spline-max-move-player 'abs (meters 1.5) 0) + (set-setting! 'string-spline-accel-player 'abs (meters 0.035) 0) ) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! (-> self draw art-group data 412) :num! (seek! (ja-aframe 17.0 0)) :frame-num 0.0) 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 d79e059d83..2507ce2856 100644 --- a/test/decompiler/reference/jak2/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-death_REF.gc @@ -121,12 +121,12 @@ ) (kill-persister *setting-control* (the-as engine-pers 'fail) 'bg-a) (when (not (logtest? (-> arg0 flags) (continue-flags cf4))) - (add-setting! 'bg-a 'abs #x3f800000 0) + (add-setting! 'bg-a 'abs 1.0 0) (set! (-> *setting-control* user-current bg-a) 1.0) ) - (set-setting! 'sfx-volume 'abs 0 0) - (set-setting! 'ambient-volume 'abs 0 0) - (set-setting! 'dialog-volume 'abs 0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) + (set-setting! 'dialog-volume 'abs 0.0 0) (when (and (not (string= (-> arg0 name) "default")) (not (demo?))) (let ((v1-37 (lookup-level-info (-> arg0 level)))) (when (and v1-37 @@ -134,15 +134,15 @@ (!= (-> v1-37 music-bank) (-> *setting-control* user-current music)) (!= (level-status *level* (-> arg0 vis-nick)) 'active) ) - (set-setting! 'music #f 0 0) - (set-setting! 'music-volume 'abs 0 0) + (set-setting! 'music #f 0.0 0) + (set-setting! 'music-volume 'abs 0.0 0) ) ) ) - (set-setting! 'region-mode #f 0 0) - (set-setting! 'border-mode #f 0 0) - (set-setting! 'allow-continue #f 0 0) - (set-setting! 'allow-timeout #f 0 0) + (set-setting! 'region-mode #f 0.0 0) + (set-setting! 'border-mode #f 0.0 0) + (set-setting! 'allow-continue #f 0.0 0) + (set-setting! 'allow-timeout #f 0.0 0) (set! (-> *setting-control* user-default border-mode) #f) (apply-settings *setting-control*) (reset-target-state #t) @@ -211,13 +211,13 @@ (remove-setting! 'music-volume) (let ((s5-2 (-> *level* border?))) (set! (-> *level* border?) (-> *level* play?)) - (set-setting! 'allow-continue #t 0 0) - (set-setting! 'border-mode #t 0 0) + (set-setting! 'allow-continue #t 0.0 0) + (set-setting! 'border-mode #t 0.0 0) (apply-settings *setting-control*) (script-eval '(teleport)) (script-eval (-> arg0 on-goto)) - (set-setting! 'allow-continue #f 0 0) - (set-setting! 'border-mode #f 0 0) + (set-setting! 'allow-continue #f 0.0 0) + (set-setting! 'border-mode #f 0.0 0) (apply-settings *setting-control*) (set! (-> *level* border?) s5-2) ) @@ -1414,7 +1414,7 @@ (if (or (rand-vu-percent? 0.5) (nonzero? (-> *task-manager-engine* length))) (set! gp-2 (the-as spool-anim #f)) ) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-progress #f 0.0 0) (target-death-anim gp-2) (cond ((or (not gp-2) (or (or (logtest? (water-flags touch-water) (-> self water flags)) @@ -1602,13 +1602,13 @@ (target-timed-invulnerable-off self 0) (case arg0 (('bot 'centipede) - (set-setting! 'process-mask 'set 0 (process-mask platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask platform projectile death)) ) (('endlessfall) - (set-setting! 'process-mask 'set 0 (process-mask enemy projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy projectile death)) ) (('instant-death 'lava 'dark-eco-pool 'melt 'explode 'grenade 'big-explosion 'turret) - (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) ) (else (let ((v1-21 (-> self water flags))) @@ -1621,7 +1621,7 @@ (set! arg0 'drown) ) ) - (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) (when (using-gun? self) (send-event (ppointer->process (-> self gun gun)) 'die) (target-gun-end-mode #f) @@ -1912,7 +1912,7 @@ (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "jakfall" -99.0 0) ) (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) - (set-setting! 'mode-name 'cam-endlessfall 0 0) + (set-setting! 'mode-name 'cam-endlessfall 0.0 0) (logclear! (-> self water flags) (water-flags swim-ground)) (let ((f0-1 (fmin -4096.0 (- (-> self control ground-impact-vel))))) (set! (-> self control unknown-word04) (the-as uint f0-1)) diff --git a/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc b/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc index 8d36b9b540..59e1f50556 100644 --- a/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc @@ -231,9 +231,9 @@ (if (zero? (-> self gun blue-whine-sound-id)) (set! (-> self gun blue-whine-sound-id) (the-as uint (new-sound-id))) ) - (set-setting! 'mode-sound-bank 'gun 0 0) + (set-setting! 'mode-sound-bank 'gun 0.0 0) (sound-play "gun-takeout") - (set-setting! 'sound-flava #f #x41f00000 1) + (set-setting! 'sound-flava #f 30.0 1) (set! (-> self gun charge-ammo) 0.0) (set! (-> self gun charge-start-time) 0) (set! (-> self gun top-anim-tilt-up) 0.0) @@ -703,7 +703,7 @@ (set! (-> self gun combo-fire-delay) (the-as uint 150)) (set! (-> self gun track-beam-size) 1228.8) (remove-setting! 'gun-min-height) - (set-setting! 'gun-max-height 'abs #x46c00000 0) + (set-setting! 'gun-max-height 'abs (meters 6) 0) ) ((4) (set! (-> self gun gun-control) (the-as uint 2)) diff --git a/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc b/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc index a420ce9bae..991308dad3 100644 --- a/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc @@ -610,7 +610,7 @@ (none) ) :code (behavior ((arg0 handle)) - (set-setting! 'slave-options 'set 0 8192) + (set-setting! 'slave-options 'set 0.0 (cam-slave-options BIKE_MODE)) (target-exit) (set! (-> self control surf) *tube-surface*) (if (zero? (-> self tube)) @@ -981,7 +981,7 @@ (local-vars (v1-42 symbol)) (set! (-> self neck flex-blend) 0.0) (target-timed-invulnerable-off self 0) - (add-setting! 'process-mask 'set 0 (process-mask enemy platform projectile death)) + (add-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) (apply-settings *setting-control*) (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self control mod-surface) *neutral-mods*) 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 d09a49c70a..48db98caaa 100644 --- a/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc @@ -1242,7 +1242,7 @@ ) ) :enter (behavior () - (set-setting! 'mode-name 'cam-turret 0 0) + (set-setting! 'mode-name 'cam-turret 0.0 0) (none) ) :code (the-as (function none :behavior base-turret) sleep-code) diff --git a/test/decompiler/reference/jak2/engine/target/target2_REF.gc b/test/decompiler/reference/jak2/engine/target/target2_REF.gc index 60fe182ef1..e1c0c8f4be 100644 --- a/test/decompiler/reference/jak2/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target2_REF.gc @@ -254,7 +254,7 @@ (set! (-> self cam-user-mode) 'look-around) (set! (-> self control mod-surface) *look-around-mods*) (logior! (-> self focus-status) (focus-status in-head)) - (set-setting! 'mode-name 'cam-eye 0 0) + (set-setting! 'mode-name 'cam-eye 0.0 0) (none) ) :exit (behavior () diff --git a/test/decompiler/reference/jak2/engine/ui/credits_REF.gc b/test/decompiler/reference/jak2/engine/ui/credits_REF.gc index 5a5e166ef2..1866b52054 100644 --- a/test/decompiler/reference/jak2/engine/ui/credits_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/credits_REF.gc @@ -79,10 +79,10 @@ process (lambda :behavior scene-player () - (set-setting! 'allow-pause #f 0 0) - (set-setting! 'allow-progress #f 0 0) - (set-setting! 'music 'forest 0 0) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'music 'forest 0.0 0) + (set-setting! 'sound-mode #f 0.0 1) (apply-settings *setting-control*) (let ((gp-0 (ppointer->process (-> self parent)))) (when (type? gp-0 scene-player) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc index 5238ec826e..91c27a8fab 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc @@ -4432,7 +4432,7 @@ ) ;; definition for function draw-secret-list -;; WARN: Return type mismatch object vs pointer. +;; WARN: Return type mismatch object vs none. (defun draw-secret-list ((arg0 secret-item-option) (arg1 progress) (arg2 font-context) (arg3 int) (arg4 symbol) (arg5 float)) (let ((s4-0 (and arg4 (= arg3 1)))) 380.0 @@ -4509,77 +4509,74 @@ ) ) ) - (the-as - pointer - (cond - ((and (not s4-0) (not (logtest? (-> *game-info* purchase-secrets) (-> arg0 flag)))) - (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) - 50 - 45 - ) - ) - ) - (let ((s4-2 print-game-text)) - (format (clear *temp-string*) "~D" (-> arg0 cost)) - (s4-2 *temp-string* arg2 #f 44 (bucket-id progress)) + (cond + ((and (not s4-0) (not (logtest? (-> *game-info* purchase-secrets) (-> arg0 flag)))) + (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 50 + 45 + ) + ) ) + (let ((s4-2 print-game-text)) + (format (clear *temp-string*) "~D" (-> arg0 cost)) + (s4-2 *temp-string* arg2 #f 44 (bucket-id progress)) ) - ((and (not s4-0) (= (-> arg0 can-toggle) #t) (logtest? (-> *game-info* secrets) (-> arg0 flag))) - (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) - 50 - 45 - ) - ) - ) - (let ((s5-2 print-game-text)) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (text-id progress-on) #f)) - (s5-2 *temp-string* arg2 #f 44 (bucket-id progress)) + ) + ((and (not s4-0) (= (-> arg0 can-toggle) #t) (logtest? (-> *game-info* secrets) (-> arg0 flag))) + (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 50 + 45 + ) + ) ) + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (text-id progress-on) #f)) + (s5-2 *temp-string* arg2 #f 44 (bucket-id progress)) ) - ((and (not s4-0) (= (-> arg0 can-toggle) #t) (not (logtest? (-> *game-info* secrets) (-> arg0 flag)))) - (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) - 50 - 45 - ) - ) - ) - (let ((s5-4 print-game-text)) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (text-id progress-off) #f)) - (s5-4 *temp-string* arg2 #f 44 (bucket-id progress)) + ) + ((and (not s4-0) (= (-> arg0 can-toggle) #t) (not (logtest? (-> *game-info* secrets) (-> arg0 flag)))) + (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 50 + 45 + ) + ) ) + (let ((s5-4 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (text-id progress-off) #f)) + (s5-4 *temp-string* arg2 #f 44 (bucket-id progress)) ) - ((and (not s4-0) (!= (-> arg0 can-toggle) #t)) - (let ((s3-8 80) - (s5-5 70) - (f30-3 (-> arg2 origin x)) - ) - (set! s3-8 (cond - ((= (get-aspect-ratio) 'aspect4x3) - (empty) - s3-8 - ) - (else - s5-5 - ) + ) + ((and (not s4-0) (!= (-> arg0 can-toggle) #t)) + (let ((s3-8 80) + (s5-5 70) + (f30-3 (-> arg2 origin x)) + ) + (set! s3-8 (cond + ((= (get-aspect-ratio) 'aspect4x3) + (empty) + s3-8 + ) + (else + s5-5 ) - ) - (set! (-> arg2 origin x) (+ f30-3 (the float s3-8))) - ) - (let ((a0-61 arg2)) - (set! (-> a0-61 flags) (font-flags kerning right large)) - ) - (let ((s5-6 print-game-text)) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (text-id progress-secrets-unlocked) #f)) - (s5-6 *temp-string* arg2 #f 44 (bucket-id progress)) - ) - (let ((v0-15 (the-as object arg2))) - (set! (-> (the-as font-context v0-15) flags) (font-flags kerning large)) - v0-15 - ) + ) + ) + (set! (-> arg2 origin x) (+ f30-3 (the float s3-8))) ) - ) + (let ((a0-61 arg2)) + (set! (-> a0-61 flags) (font-flags kerning right large)) + ) + (let ((s5-6 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (text-id progress-secrets-unlocked) #f)) + (s5-6 *temp-string* arg2 #f 44 (bucket-id progress)) + ) + (let ((v0-32 arg2)) + (set! (-> v0-32 flags) (font-flags kerning large)) + ) + ) ) ) + (none) ) ;; definition for method 10 of type menu-secret-option @@ -5701,7 +5698,11 @@ (set! v0-0 #t) ) ((= v1-0 1) - (set! v0-0 (logtest? (-> *game-info* sub-task-list 75 flags) (game-task-node-flag closed))) + (set! v0-0 + (logtest? (-> *game-info* sub-task-list (game-task-node city-yellow-gun-training-introduction) flags) + (game-task-node-flag closed) + ) + ) ) ((= v1-0 2) (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets gungame-blue))) @@ -5710,27 +5711,45 @@ (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets gungame-dark))) ) ((= v1-0 4) - (set! v0-0 (logtest? (-> *game-info* sub-task-list 63 flags) (game-task-node-flag closed))) + (set! v0-0 (logtest? (-> *game-info* sub-task-list (game-task-node stadium-board1-introduction) flags) + (game-task-node-flag closed) + ) + ) ) ((= v1-0 5) - (set! v0-0 (logtest? (-> *game-info* sub-task-list 135 flags) (game-task-node-flag closed))) + (set! v0-0 (logtest? (-> *game-info* sub-task-list (game-task-node stadium-race-class3-introduction) flags) + (game-task-node-flag closed) + ) + ) ) ((= v1-0 6) - (set! v0-0 (logtest? (-> *game-info* sub-task-list 181 flags) (game-task-node-flag closed))) + (set! v0-0 (logtest? (-> *game-info* sub-task-list (game-task-node stadium-race-class2-introduction) flags) + (game-task-node-flag closed) + ) + ) ) ((= v1-0 7) - (set! v0-0 (logtest? (-> *game-info* sub-task-list 209 flags) (game-task-node-flag closed))) + (set! v0-0 (logtest? (-> *game-info* sub-task-list (game-task-node stadium-race-class1-introduction) flags) + (game-task-node-flag closed) + ) + ) ) ((= v1-0 8) - (set! v0-0 (or (logtest? (-> *game-info* sub-task-list 308 flags) (game-task-node-flag closed)) - (open? (-> *game-info* sub-task-list 308)) - ) + (set! v0-0 + (or (logtest? (-> *game-info* sub-task-list (game-task-node city-burning-bush-race-port-introduction) flags) + (game-task-node-flag closed) + ) + (open? (-> *game-info* sub-task-list (game-task-node city-burning-bush-race-port-introduction))) + ) ) ) ((= v1-0 9) - (set! v0-0 (or (logtest? (-> *game-info* sub-task-list 306 flags) (game-task-node-flag closed)) - (open? (-> *game-info* sub-task-list 306)) - ) + (set! v0-0 + (or (logtest? (-> *game-info* sub-task-list (game-task-node city-burning-bush-race-errol-introduction) flags) + (game-task-node-flag closed) + ) + (open? (-> *game-info* sub-task-list (game-task-node city-burning-bush-race-errol-introduction))) + ) ) ) ((= v1-0 10) @@ -5743,10 +5762,16 @@ (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets reverse-races))) ) ((= v1-0 13) - (set! v0-0 (logtest? (-> *game-info* sub-task-list 149 flags) (game-task-node-flag closed))) + (set! v0-0 (logtest? (-> *game-info* sub-task-list (game-task-node city-play-onin-game-introduction) flags) + (game-task-node-flag closed) + ) + ) ) ((= v1-0 14) - (set! v0-0 (logtest? (-> *game-info* sub-task-list 224 flags) (game-task-node-flag closed))) + (set! v0-0 (logtest? (-> *game-info* sub-task-list (game-task-node city-whack-introduction) flags) + (game-task-node-flag closed) + ) + ) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc index a5d1dcb071..84149a9557 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc @@ -442,7 +442,7 @@ (hide-hud #f) (disable-level-text-file-loading) (logclear! (-> self mask) (process-mask menu progress actor-pause)) - (add-setting! 'process-mask 'set 0 (process-mask progress)) + (add-setting! 'process-mask 'set 0.0 (process-mask progress)) (set! (-> self clock) (-> *display* real-clock)) (apply-settings *setting-control*) (set-blackout-frames 0) diff --git a/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc b/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc index 6beb5fd3c1..dfd3936ea7 100644 --- a/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc @@ -177,9 +177,9 @@ (send-event arg0 'hide #f) (ashelin-method-250 arg0 #t) (set! (-> arg0 notice-enemy-dist) 245760.0) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) (logior! (-> arg0 bot-flags) (bot-flags bf06)) - (set-setting! 'airlock #f 0 0) + (set-setting! 'airlock #f 0.0 0) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) (process->ppointer pp)) (set! (-> a1-4 num-params) 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 720132e872..b0c43875bb 100644 --- a/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc @@ -1505,8 +1505,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 18 - 3 + (game-task-node atoll-water-exit) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (local-vars (v1-31 symbol)) diff --git a/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc b/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc index 0520d495a2..723225be0d 100644 --- a/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc @@ -360,7 +360,7 @@ (logclear! (-> arg0 focus-status) (focus-status disable)) (logior! (-> arg0 bot-flags) (bot-flags bf06)) (set! (-> arg0 too-far-warn-dist) 286720.0) - (set-setting! 'airlock #f 0 0) + (set-setting! 'airlock #f 0.0 0) (let ((a1-3 (new 'stack-no-clear 'array 'symbol 3))) (set! (-> a1-3 2) 'atoll3) (set! (-> a1-3 1) 'atoll2) @@ -1010,7 +1010,7 @@ (process-grab? *target* #f) (reset-warn-time! arg1) (play-speech arg1 10) - (set-setting! 'entity-name "camera-68" 0 0) + (set-setting! 'entity-name "camera-68" 0.0 0) ) (else (set! (-> arg1 too-far-warn-dist) 81920.0) @@ -1034,7 +1034,7 @@ (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3)) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) 2) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) ) ) ) @@ -1442,7 +1442,7 @@ (process-grab? *target* #f) (play-speech arg1 15) (reset-warn-time! arg1) - (set-setting! 'entity-name "camera-69" 0 0) + (set-setting! 'entity-name "camera-69" 0.0 0) ) (else (set! (-> arg1 too-far-warn-dist) 73728.0) @@ -1466,7 +1466,7 @@ (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3)) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) 1) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) ) ) ) @@ -1848,7 +1848,7 @@ (process-grab? *target* #f) (reset-warn-time! arg1) (play-speech arg1 21) - (set-setting! 'entity-name "camera-70" 0 0) + (set-setting! 'entity-name "camera-70" 0.0 0) ) (else (set! (-> arg1 too-far-warn-dist) 61440.0) @@ -1872,7 +1872,7 @@ (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3)) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) 1) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) ) ) ) @@ -2197,7 +2197,7 @@ (process-grab? *target* #f) (reset-warn-time! arg1) (play-speech arg1 23) - (set-setting! 'entity-name "camera-71" 0 0) + (set-setting! 'entity-name "camera-71" 0.0 0) ) (else (set! (-> arg1 too-far-warn-dist) 73728.0) @@ -2228,7 +2228,7 @@ (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) 1) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) ) ) ) @@ -2827,7 +2827,7 @@ (process-grab? *target* #f) (reset-warn-time! arg1) (play-speech arg1 31) - (set-setting! 'entity-name "camera-72" 0 0) + (set-setting! 'entity-name "camera-72" 0.0 0) ) (else (set! (-> arg1 too-far-warn-dist) 61440.0) @@ -2858,7 +2858,7 @@ (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x -1.0) 0) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) 1) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc b/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc index d0c45b4df1..f81b424c80 100644 --- a/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc @@ -2318,7 +2318,7 @@ For example for an elevator pre-compute the distance between the first and last ) (process-spawn scene-player :init scene-player-init "castle-krew-boss-fight-intro" #t #f) ) - (set-setting! 'music 'danger6 0 0) + (set-setting! 'music 'danger6 0.0 0) (while (not (task-node-closed? (game-task-node castle-boss-introduction))) (suspend) ) @@ -3091,7 +3091,7 @@ For example for an elevator pre-compute the distance between the first and last (t9-0) ) ) - (set-setting! 'music #f 0 0) + (set-setting! 'music #f 0.0 0) (nav-enemy-method-166 self) (let ((v1-8 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-8 enemy-flags))) 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 11e732e01b..aa0020694a 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 @@ -112,7 +112,7 @@ ) (when (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) (configure-collision self #t) - (set-setting! 'jump #f 0 0) + (set-setting! 'jump #f 0.0 0) ) (none) ) 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 da0f8fd9b8..b946ba715c 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 @@ -4,37 +4,30 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 219 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> self info end-sphere quad)) - (quaternion-identity! (-> gp-0 quat)) - (set! (-> gp-0 flags) (task-arrow-flags)) - (set! (-> gp-0 map-icon) (the-as uint 15)) - (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) - ) - (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 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-2) (seconds 0.007)) - (suspend) - ) - ) - (go-virtual complete) - ) - (suspend) - ) - #f - (none) + (game-task-node castle-break-in-castle-1) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> self info end-sphere quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) ) + (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 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-2) (seconds 0.007)) + (suspend) + ) + ) + (go-virtual complete) + ) + (suspend) + ) + #f + (none) ) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/city/common/ctywide-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/common/ctywide-obs_REF.gc index 9a5965996c..27bbb3b9eb 100644 --- a/test/decompiler/reference/jak2/levels/city/common/ctywide-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/ctywide-obs_REF.gc @@ -1554,7 +1554,7 @@ This commonly includes things such as: :code (the-as (function none :behavior cty-guard-turret) sleep-code) :post (behavior () (when (>= (-> self id) 0) - (let* ((v1-4 (-> *game-info* sub-task-list 87)) + (let* ((v1-4 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) (gp-0 (if (-> v1-4 info) (-> v1-4 info manager) (the-as handle #f) @@ -1631,7 +1631,7 @@ This commonly includes things such as: :to self ) ) - (when (and (>= (-> self id) 0) (let ((v1-12 (-> *game-info* sub-task-list 87))) + (when (and (>= (-> self id) 0) (let ((v1-12 (-> *game-info* sub-task-list (game-task-node city-power-resolution)))) (handle->process (if (-> v1-12 info) (-> v1-12 info manager) (the-as handle #f) @@ -1646,7 +1646,7 @@ This commonly includes things such as: (set! (-> a1-6 message) 'guard-turret-killed) (set! (-> a1-6 param 0) (the-as uint (-> self id))) (let ((t9-5 send-event-function) - (v1-23 (-> *game-info* sub-task-list 87)) + (v1-23 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) ) (t9-5 (handle->process (if (-> v1-23 info) @@ -1692,7 +1692,7 @@ This commonly includes things such as: (set! (-> a1-0 param 0) (the-as uint (-> self id))) (set! (-> a1-0 param 1) (the-as uint #f)) (let ((t9-0 send-event-function) - (v1-6 (-> *game-info* sub-task-list 87)) + (v1-6 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) ) (t9-0 (handle->process (if (-> v1-6 info) @@ -1723,7 +1723,7 @@ This commonly includes things such as: (set! (-> a1-2 message) 'guard-turret-button-pushed) (set! (-> a1-2 param 0) (the-as uint (-> self id))) (let ((t9-3 send-event-function) - (v1-25 (-> *game-info* sub-task-list 87)) + (v1-25 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) ) (t9-3 (handle->process (if (-> v1-25 info) @@ -1772,7 +1772,7 @@ This commonly includes things such as: (set! (-> a1-0 param 0) (the-as uint (-> self id))) (set! (-> a1-0 param 1) (the-as uint #t)) (let ((t9-0 send-event-function) - (v1-7 (-> *game-info* sub-task-list 87)) + (v1-7 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) ) (t9-0 (handle->process (if (-> v1-7 info) @@ -2259,7 +2259,7 @@ This commonly includes things such as: (cond ((and (>= (-> obj id) 0) (begin - (let ((v1-21 (-> *game-info* sub-task-list 87))) + (let ((v1-21 (-> *game-info* sub-task-list (game-task-node city-power-resolution)))) (set! v1-23 (if (-> v1-21 info) (-> v1-21 info manager) (the-as handle #f) @@ -2281,7 +2281,7 @@ This commonly includes things such as: (set! (-> a1-11 param 0) (the-as uint (-> obj id))) (set! (-> a1-11 param 1) (the-as uint (-> obj root-override trans))) (let* ((t9-12 send-event-function) - (v1-33 (-> *game-info* sub-task-list 87)) + (v1-33 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) (v1-38 (t9-12 (handle->process (if (-> v1-33 info) (-> v1-33 info manager) @@ -3310,7 +3310,7 @@ This commonly includes things such as: (defstate talking (burning-bush) :virtual #t :enter (behavior () - (set-setting! 'minimap 'clear 0 128) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self time) -1.0) (process-entity-status! self (entity-perm-status no-kill) #t) (none) @@ -3409,7 +3409,7 @@ This commonly includes things such as: ) ) :code (behavior () - (set-setting! 'mode-name 'cam-really-fixed 0 0) + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) (suspend) (until (process-grab? *target* #f) (suspend) @@ -3500,7 +3500,7 @@ This commonly includes things such as: (defstate menu (burning-bush) :virtual #t :enter (behavior () - (set-setting! 'minimap 'clear 0 128) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self time) -1.0) (set! (-> self state-time) (-> self clock frame-counter)) (none) @@ -3902,7 +3902,7 @@ This commonly includes things such as: ) ) :code (behavior () - (set-setting! 'mode-name 'cam-really-fixed 0 0) + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) (suspend) (until (process-grab? *target* #f) (suspend) diff --git a/test/decompiler/reference/jak2/levels/city/common/ctywide-tasks_REF.gc b/test/decompiler/reference/jak2/levels/city/common/ctywide-tasks_REF.gc index 025c634499..e1d46ffe59 100644 --- a/test/decompiler/reference/jak2/levels/city/common/ctywide-tasks_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/ctywide-tasks_REF.gc @@ -4,171 +4,165 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 68 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #f) 0)) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! *game-info* 68 2 (the-as (function object) (lambda :behavior task-manager () (none)))) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 64 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 39) (the-as int #f) (the-as vector #f) 0)) - (none) - ) + (game-task-node stadium-board1-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #f) 0)) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 64 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (none) - ) - ) + (game-task-node stadium-board1-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager () (none)) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 140 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> (new 'static 'vector :x 3132661.8 :y 33669.12 :z -2965708.8 :w 1.0) quad)) - (quaternion-identity! (-> gp-0 quat)) - (set! (-> gp-0 flags) (task-arrow-flags)) - (set! (-> gp-0 map-icon) (the-as uint 15)) - (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) - ) - (none) - ) + (game-task-node stadium-board1-board) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 39) (the-as int #f) (the-as vector #f) 0)) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 140 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (when (movie?) - (if (handle->process (-> self arrow)) - (send-event (handle->process (-> self arrow)) 'leave) - ) - ) - (none) - ) - ) + (game-task-node stadium-board1-board) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 140 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (send-event (handle->process (-> self arrow)) 'leave) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (none) - ) - ) + (game-task-node city-protect-water-slums-get-seal) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> (new 'static 'vector :x 3132661.8 :y 33669.12 :z -2965708.8 :w 1.0) quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) + ) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 4 - 3 - (the-as (function object) (lambda :behavior task-manager - () - (while (not *traffic-manager*) - (suspend) - ) - (suspend) - (let ((gp-0 *traffic-manager*)) - (send-event gp-0 'deactivate-by-type 6) - (send-event gp-0 'deactivate-by-type 18) - (send-event gp-0 'deactivate-by-type 19) - (send-event gp-0 'deactivate-by-type 20) - (send-event gp-0 'set-guard-target-level 0) - ) - (set-setting! 'pilot #f 0 0) - (set-setting! 'vehicle-hijacking #f 0 0) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (while (let ((a0-9 (level-get-target-inside *level*))) - (not (and a0-9 (logtest? (-> a0-9 info level-flags) 1))) - ) - (suspend) - ) - (set-setting! 'airlock #f 0 0) - (apply-settings *setting-control*) - (none) - ) + (game-task-node city-protect-water-slums-get-seal) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (when (movie?) + (if (handle->process (-> self arrow)) + (send-event (handle->process (-> self arrow)) 'leave) ) + ) + (none) + ) ) -;; failed to figure out what this is: -(set-subtask-hook! *game-info* 4 1 (the-as (function object) (lambda :behavior task-manager - () - (let ((a0-0 *traffic-manager*)) - (send-event a0-0 'restore-default-settings) - ) - (none) - ) - ) - ) - ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 4 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('target) - (case (-> arg3 param 0) - (('normal) - (send-event (handle->process (-> self slave 0)) 'request 'scene-player) - ) - ) - ) - ) - ) + (game-task-node city-protect-water-slums-get-seal) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (send-event (handle->process (-> self arrow)) 'leave) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-help-kid-introduction) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (while (not *traffic-manager*) + (suspend) + ) + (suspend) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'deactivate-by-type 6) + (send-event gp-0 'deactivate-by-type 18) + (send-event gp-0 'deactivate-by-type 19) + (send-event gp-0 'deactivate-by-type 20) + (send-event gp-0 'set-guard-target-level 0) + ) + (set-setting! 'pilot #f 0.0 0) + (set-setting! 'vehicle-hijacking #f 0.0 0) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (while (let ((a0-9 (level-get-target-inside *level*))) + (not (and a0-9 (logtest? (-> a0-9 info level-flags) 1))) + ) + (suspend) + ) + (set-setting! 'airlock #f 0.0 0) + (apply-settings *setting-control*) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-help-kid-introduction) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (let ((a0-0 *traffic-manager*)) + (send-event a0-0 'restore-default-settings) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-help-kid-introduction) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('target) + (case (-> arg3 param 0) + (('normal) + (send-event (handle->process (-> self slave 0)) 'request 'scene-player) ) + ) + ) + ) + ) ) ;; definition for function wait-for-speech-end @@ -183,542 +177,525 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 7 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self sound-id 0) - (the-as sound-id (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 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) - (suspend) + (game-task-node city-vehicle-training-map) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 38) *entity-pool* (target-pos 0) (the-as region #f))) ) - ) - (while (or (not *target*) (focus-test? *target* dead teleporting)) + (wait-for-speech-end (-> self sound-id 0)) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) (suspend) ) - (set! (-> self sound-id 0) - (the-as sound-id (talker-spawn-func (-> *talker-speech* 39) *entity-pool* (target-pos 0) (the-as region #f))) - ) - (wait-for-speech-end (-> self sound-id 0)) - (go-virtual complete) - (none) ) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 39) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (wait-for-speech-end (-> self sound-id 0)) + (go-virtual complete) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 8 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (and (= (-> self sub-state) 1) (not (and *target* (focus-test? *target* pilot)))) - (set! (-> self sound-id 0) - (the-as sound-id (talker-spawn-func (-> *talker-speech* 46) *entity-pool* (target-pos 0) (the-as region #f))) - ) - (go-virtual fail) - ) - (none) + (game-task-node city-vehicle-training-hover-zone-1) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (when (and (= (-> self sub-state) 1) (not (and *target* (focus-test? *target* pilot)))) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 46) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (go-virtual fail) ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 8 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (local-vars (v1-1 object)) - (until v1-1 - (suspend) - (set! v1-1 (and *target* (focus-test? *target* pilot))) - ) - (set! (-> self slave 0) (-> *target* pilot vehicle)) - (set! (-> self sub-state) (the-as uint 1)) - (while (or (not *target*) (focus-test? *target* dead teleporting)) - (suspend) - ) - (set! (-> self sound-id 0) - (the-as sound-id (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 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) - (suspend) - ) - ) - (while (or (not *target*) (focus-test? *target* dead teleporting)) - (suspend) - ) - (set! (-> self sound-id 0) - (the-as sound-id (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 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-3) (seconds 1)) - (suspend) - ) - ) - (while (or (not *target*) (focus-test? *target* dead teleporting)) - (suspend) - ) - (set! (-> self sound-id 0) - (the-as sound-id (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))) - ) - (while (let ((v1-34 (handle->process (-> self slave 0)))) - (not (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-34) flags))) - ) - (suspend) - ) - (wait-for-speech-end (-> self sound-id 0)) - (while (or (not *target*) (focus-test? *target* dead teleporting)) - (suspend) - ) - (set! (-> self sound-id 0) - (the-as sound-id (talker-spawn-func (-> *talker-speech* 37) *entity-pool* (target-pos 0) (the-as region #f))) - ) - (wait-for-speech-end (-> self sound-id 0)) - (set! (-> self sub-state) (the-as uint 2)) - (let ((gp-6 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-6) (seconds 1)) - (suspend) - ) - ) - (go-virtual complete) - (none) + (game-task-node city-vehicle-training-hover-zone-1) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (local-vars (v1-1 object)) + (until v1-1 + (suspend) + (set! v1-1 (and *target* (focus-test? *target* pilot))) ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 8 - 5 - (the-as (function object) (lambda :behavior task-manager - () - (task-node-close! (game-task-node city-vehicle-training-hover-zone-1)) - (none) - ) + (set! (-> self slave 0) (-> *target* pilot vehicle)) + (set! (-> self sub-state) (the-as uint 1)) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 31) *entity-pool* (target-pos 0) (the-as region #f))) ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 8 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (task-node-close! (game-task-node city-vehicle-training-hover-zone-2)) - (none) - ) + (wait-for-speech-end (-> self sound-id 0)) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (suspend) + ) + ) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 35) *entity-pool* (target-pos 0) (the-as region #f))) ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 9 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (cond - ((zero? (-> self sub-state)) - (cond - ((and *target* (focus-test? *target* pilot)) - (let ((v1-8 (handle->process (-> *target* pilot vehicle)))) - (if (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-8) flags)) - (go-virtual complete) - ) - ) - ) - (else - (set! (-> self state-time) (-> self clock frame-counter)) + (wait-for-speech-end (-> self sound-id 0)) + (let ((gp-3 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-3) (seconds 1)) + (suspend) + ) + ) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (while (let ((v1-34 (handle->process (-> self slave 0)))) + (not (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-34) flags))) ) + (suspend) + ) + (wait-for-speech-end (-> self sound-id 0)) + (while (or (not *target*) (focus-test? *target* dead teleporting)) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 37) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (wait-for-speech-end (-> self sound-id 0)) + (set! (-> self sub-state) (the-as uint 2)) + (let ((gp-6 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-6) (seconds 1)) + (suspend) + ) + ) + (go-virtual complete) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-vehicle-training-hover-zone-1) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager + () + (task-node-close! (game-task-node city-vehicle-training-hover-zone-1)) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-vehicle-training-hover-zone-1) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (task-node-close! (game-task-node city-vehicle-training-hover-zone-2)) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-vehicle-training-hover-zone-2) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (cond + ((zero? (-> self sub-state)) + (cond + ((and *target* (focus-test? *target* pilot)) + (let ((v1-8 (handle->process (-> *target* pilot vehicle)))) + (if (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-8) flags)) + (go-virtual complete) + ) + ) + ) + (else + (set! (-> self state-time) (-> self clock frame-counter)) ) ) - ((= (-> self sub-state) 1) - (if (not (and *target* (focus-test? *target* pilot))) - (go-virtual fail) + ) + ((= (-> self sub-state) 1) + (if (not (and *target* (focus-test? *target* pilot))) + (go-virtual fail) + ) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-vehicle-training-hover-zone-2) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 60)) + (suspend) + ) + (set! (-> self sub-state) (the-as uint 1)) + (set! (-> self sound-id 0) + (the-as sound-id (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 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (suspend) + ) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (while (let ((v1-15 (handle->process (-> *target* pilot vehicle)))) + (not (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-15) flags))) ) - ) - ) - (none) + (suspend) ) + (wait-for-speech-end (-> self sound-id 0)) + (set! (-> self sound-id 0) + (the-as sound-id (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 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-4) (seconds 3)) + (suspend) + ) + ) + (go-virtual complete) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 9 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 60)) - (suspend) - ) - (set! (-> self sub-state) (the-as uint 1)) - (set! (-> self sound-id 0) - (the-as sound-id (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 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (game-task-node city-keira-delivery-delivery) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -245760.0 :y 45056.0 :z 5468160.0 :w 1.0) quad)) + (set! (-> self end-pos quad) (-> (new 'static 'vector :x 579584.0 :y 49152.0 :z -1985331.2 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (let ((s5-0 *traffic-manager*) + (gp-0 (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> gp-0 position quad) (-> self begin-pos quad)) + (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 16384.0) + (set! (-> gp-0 object-type) (traffic-type bikec)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 proc) #f) + (send-event s5-0 'spawn-object gp-0) + (if (-> gp-0 proc) + (set! (-> self slave 0) (process->handle (-> gp-0 proc))) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-1 pos quad) (-> self end-pos quad)) + (quaternion-identity! (-> gp-1 quat)) + (set! (-> gp-1 flags) (task-arrow-flags task-arrow-flag-00)) + (set! (-> gp-1 map-icon) (the-as uint 12)) + (label cfg-10) + (let ((a0-20 (task-arrow-spawn gp-1 (the-as task-arrow self)))) + (when (not a0-20) (suspend) + (goto cfg-10) ) + (set! (-> self arrow) (process->handle a0-20)) ) - (set! (-> self sound-id 0) - (the-as sound-id (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))) - ) - (while (let ((v1-15 (handle->process (-> *target* pilot vehicle)))) - (not (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-15) flags))) - ) - (suspend) - ) - (wait-for-speech-end (-> self sound-id 0)) - (set! (-> self sound-id 0) - (the-as sound-id (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 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-4) (seconds 3)) - (suspend) - ) - ) - (go-virtual complete) - (none) ) + (set! (-> self start-time) 0) + (set! (-> self time-limit) (seconds 180)) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 61 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -245760.0 :y 45056.0 :z 5468160.0 :w 1.0) quad)) - (set! (-> self end-pos quad) (-> (new 'static 'vector :x 579584.0 :y 49152.0 :z -1985331.2 :w 1.0) quad)) - (set-setting! 'minimap 'clear 0 32) - (let ((s5-0 *traffic-manager*) - (gp-0 (new 'stack 'traffic-object-spawn-params)) - ) - (set! (-> gp-0 position quad) (-> self begin-pos quad)) - (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 16384.0) - (set! (-> gp-0 object-type) (traffic-type bikec)) - (set! (-> gp-0 behavior) (the-as uint 0)) - (set! (-> gp-0 id) (the-as uint 0)) - (set! (-> gp-0 proc) #f) - (send-event s5-0 'spawn-object gp-0) - (if (-> gp-0 proc) - (set! (-> self slave 0) (process->handle (-> gp-0 proc))) - ) - ) - (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-1 pos quad) (-> self end-pos quad)) - (quaternion-identity! (-> gp-1 quat)) - (set! (-> gp-1 flags) (task-arrow-flags task-arrow-flag-00)) - (set! (-> gp-1 map-icon) (the-as uint 12)) - (label cfg-10) - (let ((a0-20 (task-arrow-spawn gp-1 (the-as task-arrow self)))) - (when (not a0-20) - (suspend) - (goto cfg-10) - ) - (set! (-> self arrow) (process->handle a0-20)) + (game-task-node city-keira-delivery-delivery) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-keira-delivery-delivery) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (check-time self) + (let ((f0-0 (vector-vector-distance-squared (target-pos 0) (-> self end-pos))) + (f1-0 49152.0) + ) + (if (>= (* f1-0 f1-0) f0-0) + (go-virtual complete) ) - ) - (set! (-> self start-time) 0) - (set! (-> self time-limit) (seconds 180)) - (none) ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 61 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 61 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (check-time self) - (let ((f0-0 (vector-vector-distance-squared (target-pos 0) (-> self end-pos))) - (f1-0 49152.0) - ) - (if (>= (* f1-0 f1-0) f0-0) - (go-virtual complete) - ) - ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 61 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (local-vars (v1-7 symbol)) - (send-event *traffic-manager* 'set-target-level #x3f800000) - (until (or v1-7 (and *target* (focus-test? *target* pilot))) - (suspend) - (let ((f0-0 122880.0)) - (set! v1-7 (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0)))) - ) + (game-task-node city-keira-delivery-delivery) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (local-vars (v1-7 symbol)) + (send-event *traffic-manager* 'set-target-level #x3f800000) + (until (or v1-7 (and *target* (focus-test? *target* pilot))) + (suspend) + (let ((f0-0 122880.0)) + (set! v1-7 (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0)))) ) - (set-setting! 'airlock #f 0 0) - (set! (-> self start-time) (-> self clock frame-counter)) - (none) ) + (set-setting! 'airlock #f 0.0 0) + (set! (-> self start-time) (-> self clock frame-counter)) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 61 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *traffic-manager* 'decrease-alert-level 0) - (send-event *traffic-manager* 'set-alert-duration 9000) - (send-event *target* 'end-mode) - (set-setting! 'pilot #f 0 0) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (script-eval '(send-event "keira-npc-1" 'say)) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 136 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 39) (the-as int #f) (the-as vector #f) 0)) - (set! (-> self sub-state) (the-as uint 0)) - 0 - (none) + (game-task-node city-keira-delivery-delivery) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'decrease-alert-level 0) + (send-event *traffic-manager* 'set-alert-duration 9000) + (send-event *target* 'end-mode) + (set-setting! 'pilot #f 0.0 0) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) ) + (script-eval '(send-event "keira-npc-1" 'say)) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 136 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + (game-task-node stadium-race-class3-race) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 39) (the-as int #f) (the-as vector #f) 0)) + (set! (-> self sub-state) (the-as uint 0)) + 0 + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 136 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (let* ((v1-1 (-> self info index)) - (a1-2 (cond - ((or (zero? v1-1) (= v1-1 4) (= v1-1 9)) - 'stadiumb - ) - ((or (= v1-1 1) (= v1-1 5) (= v1-1 10)) - 'stadiumc - ) - ((or (= v1-1 2) (= v1-1 6) (= v1-1 11)) - 'stadiumd - ) - (else - #f - ) + (game-task-node stadium-race-class3-race) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node stadium-race-class3-race) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (let* ((v1-1 (-> self info index)) + (a1-2 (cond + ((or (zero? v1-1) (= v1-1 4) (= v1-1 9)) + 'stadiumb + ) + ((or (= v1-1 1) (= v1-1 5) (= v1-1 10)) + 'stadiumc + ) + ((or (= v1-1 2) (= v1-1 6) (= v1-1 11)) + 'stadiumd + ) + (else + #f ) ) - ) - (cond - ((= (level-status *level* a1-2) 'active) - (when (zero? (-> self sub-state)) - (set! (-> self sub-state) (the-as uint 1)) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set! (-> self slave 0) (process->handle (race-start (-> self info index) (the-as symbol self) #f))) - ) + ) ) - (else - (when (nonzero? (-> self sub-state)) - (remove-setting! 'exclusive-task) - (set! (-> self sub-state) (the-as uint 0)) - 0 - ) + (cond + ((= (level-status *level* a1-2) 'active) + (when (zero? (-> self sub-state)) + (set! (-> self sub-state) (the-as uint 1)) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self slave 0) (process->handle (race-start (-> self info index) (the-as symbol self) #f))) + ) + ) + (else + (when (nonzero? (-> self sub-state)) + (remove-setting! 'exclusive-task) + (set! (-> self sub-state) (the-as uint 0)) + 0 ) ) ) - (none) ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 136 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (case (-> self info index) - ((2) - (format #t "kill race manager~%") - (send-event (handle->process (-> self slave 0)) 'die) - ) - ) - (none) - ) - ) + (game-task-node stadium-race-class3-race) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (case (-> self info index) + ((2) + (format #t "kill race manager~%") + (send-event (handle->process (-> self slave 0)) 'die) + ) + ) + (none) + ) ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 182) (-> *game-info* sub-task-list 136)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-race-class2-race)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class3-race)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 210) (-> *game-info* sub-task-list 136)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-race-class1-race)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class3-race)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 313) (-> *game-info* sub-task-list 136)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class3-resolution)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class3-race)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 315) (-> *game-info* sub-task-list 182)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class2-resolution)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class2-race)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 317) (-> *game-info* sub-task-list 210)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class1-resolution)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class1-race)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 319) (-> *game-info* sub-task-list 136)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class3-r-resolution)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class3-race)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 321) (-> *game-info* sub-task-list 182)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class2-r-resolution)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class2-race)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 323) (-> *game-info* sub-task-list 210)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class1-r-resolution)) + (-> *game-info* sub-task-list (game-task-node stadium-race-class1-race)) + ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 211 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (let ((gp-0 *traffic-manager*)) - (send-event gp-0 'set-guard-target-count-range 0 0 0) - (send-event gp-0 'set-guard-target-count-range 1 0 0) - (send-event gp-0 'set-guard-target-count-range 2 0 0) - (format #t "class-1 race complete~%") - (send-event gp-0 'set-alert-level 3) - ) - (while (!= (level-status *level* 'lwidea) 'active) - (suspend) - ) - (send-event *traffic-manager* 'spawn-all) + (game-task-node stadium-race-class1-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-guard-target-count-range 0 0 0) + (send-event gp-0 'set-guard-target-count-range 1 0 0) + (send-event gp-0 'set-guard-target-count-range 2 0 0) + (format #t "class-1 race complete~%") + (send-event gp-0 'set-alert-level 3) + ) + (while (!= (level-status *level* 'lwidea) 'active) (suspend) - (suspend) - (let ((gp-2 (new 'static 'city-ambush-info - :count 5 - :array (new 'static 'inline-array city-ambush-spot 5 - (new 'static 'city-ambush-spot - :pos (new 'static 'vector :x 503808.0 :y 49152.0 :z -2805760.0 :w 1.0) - :obj-type #x6 - ) - (new 'static 'city-ambush-spot - :pos (new 'static 'vector :x 458752.0 :y 49152.0 :z -2838528.0 :w 1.0) - :obj-type #x6 - ) - (new 'static 'city-ambush-spot - :pos (new 'static 'vector :x 450560.0 :y 49152.0 :z -2871296.0 :w 1.0) - :obj-type #x6 - ) - (new 'static 'city-ambush-spot - :pos (new 'static 'vector :x 413696.0 :y 49152.0 :z -2879488.0 :w 1.0) - :obj-type #x6 - ) - (new 'static 'city-ambush-spot - :pos (new 'static 'vector :x 368640.0 :y 49152.0 :z -2916352.0 :w 1.0) - :obj-type #x6 - ) + ) + (send-event *traffic-manager* 'spawn-all) + (suspend) + (suspend) + (let ((gp-2 (new 'static 'city-ambush-info + :count 5 + :array (new 'static 'inline-array city-ambush-spot 5 + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 503808.0 :y 49152.0 :z -2805760.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 458752.0 :y 49152.0 :z -2838528.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 450560.0 :y 49152.0 :z -2871296.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 413696.0 :y 49152.0 :z -2879488.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 368640.0 :y 49152.0 :z -2916352.0 :w 1.0) + :obj-type #x6 ) ) ) - (s5-0 (new 'stack-no-clear 'traffic-object-spawn-params)) - ) - (set! (-> s5-0 object-type) (traffic-type crimson-guard-1)) - (set! (-> s5-0 behavior) (the-as uint 9)) - (set! (-> s5-0 id) (the-as uint 0)) - (set! (-> s5-0 nav-mesh) #f) - (set! (-> s5-0 nav-branch) #f) - (set! (-> s5-0 proc) #f) - (set! (-> s5-0 handle) (process->handle *target*)) - (set! (-> s5-0 user-data) (the-as uint 0)) - (set! (-> s5-0 flags) (traffic-spawn-flags)) - (set! (-> s5-0 guard-type) (the-as uint 1)) - (vector-reset! (-> s5-0 velocity)) - (quaternion-identity! (-> s5-0 rotation)) - (city-ambush-info-method-9 gp-2 s5-0) - ) - (go-virtual complete) - (none) + ) + (s5-0 (new 'stack-no-clear 'traffic-object-spawn-params)) + ) + (set! (-> s5-0 object-type) (traffic-type crimson-guard-1)) + (set! (-> s5-0 behavior) (the-as uint 9)) + (set! (-> s5-0 id) (the-as uint 0)) + (set! (-> s5-0 nav-mesh) #f) + (set! (-> s5-0 nav-branch) #f) + (set! (-> s5-0 proc) #f) + (set! (-> s5-0 handle) (process->handle *target*)) + (set! (-> s5-0 user-data) (the-as uint 0)) + (set! (-> s5-0 flags) (traffic-spawn-flags)) + (set! (-> s5-0 guard-type) (the-as uint 1)) + (vector-reset! (-> s5-0 velocity)) + (quaternion-identity! (-> s5-0 rotation)) + (city-ambush-info-method-9 gp-2 s5-0) ) + (go-virtual complete) + (none) ) ) @@ -787,120 +764,113 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 271 - 0 - (the-as (function object) (lambda :behavior task-manager - () - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set-setting! 'airlock #f 0 0) - (set-setting! 'minimap 'clear 0 32) - (let ((gp-0 (-> *city-bb-racepoint-info* (-> self info index)))) - (set! (-> self end-pos quad) (-> gp-0 end-pos quad)) - (let ((s4-0 *traffic-manager*) - (s5-0 (new 'stack 'traffic-object-spawn-params)) - ) - (set! (-> s5-0 position quad) (-> gp-0 bike-pos quad)) - (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 (-> gp-0 bike-angle)) - (set! (-> s5-0 object-type) (traffic-type bikea)) - (set! (-> s5-0 behavior) (the-as uint 0)) - (set! (-> s5-0 id) (the-as uint 0)) - (set! (-> s5-0 proc) #f) - (send-event s4-0 'spawn-object s5-0) - (if (-> s5-0 proc) - (set! (-> self slave 0) (process->handle (-> s5-0 proc))) - ) - ) - (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-1 pos quad) (-> self end-pos quad)) - (quaternion-identity! (-> s5-1 quat)) - (set! (-> s5-1 flags) (task-arrow-flags task-arrow-flag-00)) - (set! (-> s5-1 map-icon) (the-as uint 15)) - (cond - ((-> gp-0 map) - (set! (-> s5-1 map-icon) (the-as uint 15)) - ) - (else - (set! (-> s5-1 map-icon) (the-as uint 0)) - 0 - ) - ) - (label cfg-12) - (let ((a0-20 (task-arrow-spawn s5-1 (the-as task-arrow self)))) - (when (not a0-20) - (suspend) - (goto cfg-12) - ) - (set! (-> self arrow) (process->handle a0-20)) - ) - ) - (set! (-> self start-time) (-> self clock frame-counter)) - (set! (-> self time-limit) (the-as time-frame (the int (-> gp-0 time)))) - ) - (none) - ) + (game-task-node city-burning-bush-racepoint-1-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (let ((gp-0 (-> *city-bb-racepoint-info* (-> self info index)))) + (set! (-> self end-pos quad) (-> gp-0 end-pos quad)) + (let ((s4-0 *traffic-manager*) + (s5-0 (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> s5-0 position quad) (-> gp-0 bike-pos quad)) + (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 (-> gp-0 bike-angle)) + (set! (-> s5-0 object-type) (traffic-type bikea)) + (set! (-> s5-0 behavior) (the-as uint 0)) + (set! (-> s5-0 id) (the-as uint 0)) + (set! (-> s5-0 proc) #f) + (send-event s4-0 'spawn-object s5-0) + (if (-> s5-0 proc) + (set! (-> self slave 0) (process->handle (-> s5-0 proc))) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s5-1 pos quad) (-> self end-pos quad)) + (quaternion-identity! (-> s5-1 quat)) + (set! (-> s5-1 flags) (task-arrow-flags task-arrow-flag-00)) + (set! (-> s5-1 map-icon) (the-as uint 15)) + (cond + ((-> gp-0 map) + (set! (-> s5-1 map-icon) (the-as uint 15)) + ) + (else + (set! (-> s5-1 map-icon) (the-as uint 0)) + 0 + ) ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 271 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + (label cfg-12) + (let ((a0-20 (task-arrow-spawn s5-1 (the-as task-arrow self)))) + (when (not a0-20) + (suspend) + (goto cfg-12) + ) + (set! (-> self arrow) (process->handle a0-20)) + ) + ) + (set! (-> self start-time) (-> self clock frame-counter)) + (set! (-> self time-limit) (the-as time-frame (the int (-> gp-0 time)))) + ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 271 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (check-time self) - (let ((f0-0 (vector-vector-distance-squared (target-pos 0) (-> self end-pos))) - (f1-0 49152.0) - ) - (if (>= (* f1-0 f1-0) f0-0) - (go-virtual complete) - ) - ) - (none) - ) - ) + (game-task-node city-burning-bush-racepoint-1-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 271 - 3 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *traffic-manager* 'restore-default-settings) - (send-event *traffic-manager* 'set-target-level #x3f800000) - (none) - ) + (game-task-node city-burning-bush-racepoint-1-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (check-time self) + (let ((f0-0 (vector-vector-distance-squared (target-pos 0) (-> self end-pos))) + (f1-0 49152.0) ) + (if (>= (* f1-0 f1-0) f0-0) + (go-virtual complete) + ) + ) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 271 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *target* 'end-mode) - (set-setting! 'pilot #f 0 0) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (close! (-> self node-info) 'event) - (none) - ) - ) + (game-task-node city-burning-bush-racepoint-1-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'restore-default-settings) + (send-event *traffic-manager* 'set-target-level #x3f800000) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-racepoint-1-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (send-event *target* 'end-mode) + (set-setting! 'pilot #f 0.0 0) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (close! (-> self node-info) 'event) + (none) + ) ) diff --git a/test/decompiler/reference/jak2/levels/city/common/pilot-states_REF.gc b/test/decompiler/reference/jak2/levels/city/common/pilot-states_REF.gc index 49d6f58c5b..80b5b87b3c 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 @@ -869,21 +869,21 @@ (target-timed-invulnerable-off self 0) (case arg0 (('bot) - (set-setting! 'process-mask 'set 0 (process-mask platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask platform projectile death)) ) (('endlessfall 'instant-death 'lava 'dark-eco-pool 'melt 'explode 'grenade) - (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) ) (else - (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) (when (using-gun? self) (send-event (ppointer->process (-> self gun gun)) 'die) (target-gun-end-mode #f) ) ) ) - (set-setting! 'mode-name 'cam-fixed 0 0) - (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) (apply-settings *setting-control*) (set! (-> self control transv quad) (the-as uint128 0)) (logior! (-> self focus-status) (focus-status dead)) diff --git a/test/decompiler/reference/jak2/levels/city/common/traffic-engine_REF.gc b/test/decompiler/reference/jak2/levels/city/common/traffic-engine_REF.gc index ac5b26b5ac..e39c91024b 100644 --- a/test/decompiler/reference/jak2/levels/city/common/traffic-engine_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/traffic-engine_REF.gc @@ -3000,7 +3000,7 @@ Process is recycled and moved to reserved, if it deactivates." (logior! (-> obj alert-state flags) (traffic-alert-flag alarm-on)) (set! (-> *game-info* wanted-flash) (the-as basic #t)) (if (= (-> *setting-control* user-current music) 'city1) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) ) ) (let ((s5-1 (new 'stack-no-clear 'vector))) diff --git a/test/decompiler/reference/jak2/levels/city/common/traffic-manager_REF.gc b/test/decompiler/reference/jak2/levels/city/common/traffic-manager_REF.gc index 53d7d7ee09..8ddb522d0b 100644 --- a/test/decompiler/reference/jak2/levels/city/common/traffic-manager_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/traffic-manager_REF.gc @@ -712,7 +712,7 @@ (stack-size-set! (-> self main-thread) 128) (ctywide-entity-hack) (init-params self) - (add-setting! 'task-mask 'clear 0 #x4000) + (add-setting! 'task-mask 'clear 0.0 (task-mask ctywide)) (set! (-> self event-hook) traffic-manager-event-handler) (rigid-body-queue-manager-spawn *traffic-rigid-body-queue* self) (go-virtual idle) @@ -923,7 +923,3 @@ (none) ) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/city/common/vehicle-states_REF.gc b/test/decompiler/reference/jak2/levels/city/common/vehicle-states_REF.gc index ad01d6bac8..8eb99b0284 100644 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/vehicle-states_REF.gc @@ -140,7 +140,7 @@ :virtual #t :event (the-as (function process int symbol event-message-block object :behavior vehicle) vehicle-event-handler) :enter (behavior () - (set-setting! 'sound-flava #f #x41f80000 5) + (set-setting! 'sound-flava #f 31.0 5) (set! (-> self state-time) (-> self clock frame-counter)) (iterate-prims (-> self root-override-2) diff --git a/test/decompiler/reference/jak2/levels/city/common/vehicle-util_REF.gc b/test/decompiler/reference/jak2/levels/city/common/vehicle-util_REF.gc index 18aeccefc3..71dcc730bd 100644 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle-util_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/vehicle-util_REF.gc @@ -1024,7 +1024,7 @@ This commonly includes things such as: (set-setting! 'string-max-height 'abs (-> obj info-override camera-string-max-height) 0) (set-setting! 'head-offset 'abs (-> obj info-override camera-head-offset) 0) (set-setting! 'foot-offset 'abs (-> obj info-override camera-foot-offset) 0) - (set-setting! 'target-height 'abs 0 0) + (set-setting! 'target-height 'abs (meters 0) 0) (vehicle-method-92 obj) (vehicle-method-89 obj) (persist-with-delay *setting-control* 'mode-name (seconds 0.2) 'mode-name 'cam-fixed 0.0 0) @@ -1087,7 +1087,7 @@ This commonly includes things such as: (defmethod vehicle-method-89 vehicle ((obj vehicle)) (when (not (logtest? (rigid-body-object-flag camera-bike-mode) (-> obj flags))) (set! (-> obj flags) (logior (rigid-body-object-flag camera-bike-mode) (-> obj flags))) - (set-setting! 'bike-mode #f 0 0) + (set-setting! 'bike-mode #f 0.0 0) ) 0 (none) @@ -1109,7 +1109,7 @@ This commonly includes things such as: (defmethod vehicle-method-91 vehicle ((obj vehicle)) (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) (set! (-> obj flags) (logior (rigid-body-object-flag camera-rapid-track-mode) (-> obj flags))) - (set-setting! 'rapid-tracking #f 0 0) + (set-setting! 'rapid-tracking #f 0.0 0) ) 0 (none) diff --git a/test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc b/test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc index 63f4b78428..3a80793642 100644 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc @@ -640,7 +640,7 @@ (when (or (< 55296.0 (-> obj rbody state lin-velocity y)) (>= (- (-> pp clock frame-counter) (-> obj air-time)) (seconds 0.75)) ) - (set-setting! 'extra-follow-height 'abs -964689920 0) + (set-setting! 'extra-follow-height 'abs (meters -4) 0) (send-event *camera* 'set-max-angle-offset (-> obj info-override camera-air-max-angle-offset)) ) ) @@ -739,7 +739,7 @@ ) (cond ((and (< f0-26 0.15) (< -0.5 f0-26)) - (set-setting! 'vertical-follow-matches-camera #f 0 0) + (set-setting! 'vertical-follow-matches-camera #f 0.0 0) ) (else (if (< (fabs (-> obj root-override-2 transv y)) 8192.0) diff --git a/test/decompiler/reference/jak2/levels/city/kid_escort/hal4-course_REF.gc b/test/decompiler/reference/jak2/levels/city/kid_escort/hal4-course_REF.gc index 20000bb5b8..56c28ec0fd 100644 --- a/test/decompiler/reference/jak2/levels/city/kid_escort/hal4-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kid_escort/hal4-course_REF.gc @@ -427,7 +427,7 @@ (>= (- (-> pp clock frame-counter) (-> obj locked-player-time)) (seconds 10)) ) (remove-setting! 'pilot-exit) - (set-setting! 'pilot #f 0 0) + (set-setting! 'pilot #f 0.0 0) (apply-settings *setting-control*) ) ) @@ -439,7 +439,7 @@ ) ) ) - (set-setting! 'pilot-exit #f 0 0) + (set-setting! 'pilot-exit #f 0.0 0) (apply-settings *setting-control*) (set! (-> obj locked-player-time) (-> pp clock frame-counter)) ) @@ -763,8 +763,8 @@ :skip-to -1 :on-set (lambda ((arg0 hal-escort)) (process-entity-status! arg0 (entity-perm-status no-kill) #t) - (set-setting! 'exclusive-task #f 0 34) - (set-setting! 'allow-continue #f 0 0) + (set-setting! 'exclusive-task #f 0.0 (game-task city-escort-kid)) + (set-setting! 'allow-continue #f 0.0 0) (clear-speech-flags! arg0) (speech-control-method-10 *speech-control* @@ -829,8 +829,8 @@ (logior! (-> v1-12 extra perm status) (entity-perm-status bit-9)) ) ) - (set-setting! 'airlock #f 0 0) - (set-setting! 'minimap 'clear 0 32) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) (let ((s5-0 (new 'stack-no-clear 'task-arrow-params))) (set! (-> s5-0 pos quad) (-> arg0 hal4-course spots 1 center quad)) (quaternion-identity! (-> s5-0 quat)) @@ -940,7 +940,7 @@ :nav-mesh-index -1 :skip-to #xf :on-set (lambda ((arg0 hal-escort)) - (set-setting! 'sound-mode #f 0 2) + (set-setting! 'sound-mode #f 0.0 2) (let ((s5-0 (-> arg0 hal4-course spots))) (vector-! (the-as vector (-> arg0 notice-plane)) (the-as vector (-> s5-0 4)) (the-as vector (-> s5-0 3))) (vector-normalize! (-> arg0 notice-plane) 1.0) @@ -1015,7 +1015,7 @@ :skip-to #xf :on-set (lambda ((arg0 hal-escort)) (init-traffic-params! arg0 #t) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) (let ((v1-5 (get-task-by-type (-> arg0 ai-ctrl) halt-wait-spot arg0))) (set! (-> v1-5 bytes 5) 1) (set! (-> v1-5 bytes 6) 0) @@ -1718,7 +1718,7 @@ (apply-settings *setting-control*) (send-event (handle->process (-> arg0 arrow-handle)) 'die) (play-speech arg0 11) - (set-setting! 'entity-name "camera-224" 0 0) + (set-setting! 'entity-name "camera-224" 0.0 0) (let ((s5-0 *traffic-manager*)) (send-event s5-0 'set-guard-target-level 0) (send-event s5-0 'set-max-alert-level 0) @@ -1911,7 +1911,7 @@ (set! (-> a1-1 num-params) 0) (set! (-> a1-1 message) 'fail) (let ((t9-0 send-event-function) - (v1-8 (-> *game-info* sub-task-list 111)) + (v1-8 (-> *game-info* sub-task-list (game-task-node city-escort-kid-resolution))) ) (t9-0 (handle->process (if (-> v1-8 info) diff --git a/test/decompiler/reference/jak2/levels/city/market/east/ashelin/ash4-course_REF.gc b/test/decompiler/reference/jak2/levels/city/market/east/ashelin/ash4-course_REF.gc index 11debf7ab8..9c4ee1d771 100644 --- a/test/decompiler/reference/jak2/levels/city/market/east/ashelin/ash4-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/east/ashelin/ash4-course_REF.gc @@ -204,8 +204,8 @@ :nav-mesh-index -1 :skip-to -1 :on-set (lambda ((arg0 ashelin-tanker)) - (set-setting! 'calm #t 0 0) - (set-setting! 'exclusive-task #f 0 42) + (set-setting! 'calm #t 0.0 0) + (set-setting! 'exclusive-task #f 0.0 (game-task city-intercept-tanker)) (let ((v1-5 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) (set! (-> v1-5 bytes 5) 1) (set! (-> v1-5 bytes 6) 0) @@ -267,7 +267,7 @@ (with-pp (send-event arg0 'hide #f) (remove-setting! 'calm) - (set-setting! 'music 'danger9 0 0) + (set-setting! 'music 'danger9 0.0 0) (set! (-> arg0 notice-enemy-dist) 245760.0) (logior! (-> arg0 bot-flags) (bot-flags bf06)) (set! (-> arg0 bot-task-bits) (logand -3 (-> arg0 bot-task-bits))) diff --git a/test/decompiler/reference/jak2/levels/city/market/west/brutter_kiosk/meet-brutter_REF.gc b/test/decompiler/reference/jak2/levels/city/market/west/brutter_kiosk/meet-brutter_REF.gc index f43b29ea4e..ae21a002c6 100644 --- a/test/decompiler/reference/jak2/levels/city/market/west/brutter_kiosk/meet-brutter_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/west/brutter_kiosk/meet-brutter_REF.gc @@ -2361,390 +2361,378 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 124 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'allow-continue #f 0 0) - (set-continue! *game-info* "ctyport-hiphog-no-hiphog" #f) - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (let ((s5-0 *traffic-manager*) - (gp-0 (new 'stack 'traffic-object-spawn-params)) - ) - (set! (-> gp-0 position quad) (-> self begin-pos quad)) - (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 0.0) - (set! (-> gp-0 object-type) (traffic-type cara)) - (set! (-> gp-0 behavior) (the-as uint 0)) - (set! (-> gp-0 id) (the-as uint 0)) - (set! (-> gp-0 proc) #f) - (send-event s5-0 'spawn-object gp-0) - (if (not (-> gp-0 proc)) - (format #t "traffic object spawn failed~%") - ) - ) - (set! (-> self start-time) 0) - (set! (-> self sub-state) (the-as uint 0)) - (set! (-> self max-count) 3) - (set! (-> self count) 3) - (dotimes (v1-20 4) - (set! (-> self data-vector v1-20 quad) (-> *meet-brutter-position* v1-20 quad)) - ) - (let ((gp-1 (new 'stack-no-clear 'mystery-traffic-object-spawn-params-1))) - (vector-reset! (-> gp-1 vec)) - (forward-up-nopitch->quaternion - (-> gp-1 quat) - (new 'static 'vector :z 1.0 :w 1.0) - (new 'static 'vector :y 1.0 :w 1.0) + (game-task-node city-meet-brutter-meet-brutter) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'allow-continue #f 0.0 0) + (set-continue! *game-info* "ctyport-hiphog-no-hiphog" #f) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (let ((s5-0 *traffic-manager*) + (gp-0 (new 'stack 'traffic-object-spawn-params)) ) - (set! (-> gp-1 params 0 object-type) (traffic-type tt17)) - (set! (-> gp-1 params 0 behavior) (the-as uint 1)) - (set! (-> gp-1 params 0 id) (the-as uint 0)) - (set! (-> gp-1 params 0 nav-mesh) #f) - (set! (-> gp-1 params 0 nav-branch) #f) - (set! (-> gp-1 params 0 proc) #f) - (set! (-> gp-1 params 0 handle) (the-as handle #f)) - (set! (-> gp-1 params 0 user-data) (the-as uint 0)) - (set! (-> gp-1 params 0 flags) (traffic-spawn-flags trsflags-01)) - (set! (-> gp-1 params 0 guard-type) (the-as uint 7)) - (vector-reset! (-> gp-1 params 0 velocity)) - (set! (-> gp-1 params 0 position quad) (-> gp-1 vec quad)) - (quaternion-copy! (-> gp-1 params 0 rotation) (-> gp-1 quat)) - (set! (-> gp-1 params 1 object-type) (traffic-type tt5)) - (set! (-> gp-1 params 1 behavior) (the-as uint 0)) - (set! (-> gp-1 params 1 id) (the-as uint 0)) - (set! (-> gp-1 params 1 nav-mesh) #f) - (set! (-> gp-1 params 1 nav-branch) #f) - (set! (-> gp-1 params 1 proc) #f) - (set! (-> gp-1 params 1 handle) (the-as handle #f)) - (set! (-> gp-1 params 1 user-data) (the-as uint 0)) - (set! (-> gp-1 params 1 flags) (traffic-spawn-flags trsflags-00)) - (set! (-> gp-1 params 1 guard-type) (the-as uint 7)) - (vector-reset! (-> gp-1 params 1 velocity)) - (set! (-> gp-1 params 1 position quad) (-> gp-1 vec quad)) - (quaternion-copy! (-> gp-1 params 1 rotation) (-> gp-1 quat)) - (countdown (s5-1 (-> self max-count)) - (let ((s2-0 (-> *city-meet-brutter-vehicle-info* s5-1))) - (set! (-> gp-1 params 0 id) (the-as uint (+ s5-1 120))) - (set! (-> gp-1 params 0 position quad) (-> s2-0 pos quad)) - (set! (-> gp-1 params 1 position quad) (-> s2-0 pos quad)) - (let ((s4-0 (the-as - paddywagon - (vehicle-spawn *traffic-manager* paddywagon (the-as traffic-object-spawn-params (-> gp-1 params))) - ) - ) - ) - (when s4-0 - (set! (-> s4-0 current-level) (-> s2-0 level)) - (set! (-> self slave (+ s5-1 (-> self max-count))) (process->handle s4-0)) - (send-event *traffic-manager* 'add-object (-> gp-1 params 0 object-type) s4-0) - (let ((s3-0 (the-as city-lurker (citizen-spawn self city-lurker (-> gp-1 params 1))))) - (when s3-0 - (set! (-> s3-0 end-pos quad) (-> s2-0 end-pos quad)) - (set! (-> s3-0 task-node) (game-task-node city-meet-brutter-meet-brutter)) - (set! (-> s3-0 index) (the-as uint s5-1)) - (set! (-> s3-0 nav-mesh-aid) (the-as uint 0)) - (set! (-> self slave s5-1) (process->handle s3-0)) - (set! (-> self data-int32 s5-1) -1) - (change-parent s3-0 s4-0) - (logior! (-> s3-0 flags) (citizen-flag persistent)) - (send-event *traffic-manager* 'add-object (-> gp-1 params 1 object-type) s3-0) - (set! (-> s3-0 controller traffic) *traffic-engine*) - (set! (-> s3-0 vehicle) (process->handle s4-0)) - (let ((s2-1 (get-best-seat-for-vehicle s4-0 (-> s4-0 root-override-2 trans) 4 0))) - (when (!= s2-1 -1) - (format #t "adding lurker to seat ~d~%" s2-1) - (put-rider-in-seat s4-0 s2-1 s3-0) - (logior! (-> s3-0 focus-status) (focus-status pilot-riding)) + (set! (-> gp-0 position quad) (-> self begin-pos quad)) + (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 0.0) + (set! (-> gp-0 object-type) (traffic-type cara)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 proc) #f) + (send-event s5-0 'spawn-object gp-0) + (if (not (-> gp-0 proc)) + (format #t "traffic object spawn failed~%") + ) + ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self max-count) 3) + (set! (-> self count) 3) + (dotimes (v1-20 4) + (set! (-> self data-vector v1-20 quad) (-> *meet-brutter-position* v1-20 quad)) + ) + (let ((gp-1 (new 'stack-no-clear 'mystery-traffic-object-spawn-params-1))) + (vector-reset! (-> gp-1 vec)) + (forward-up-nopitch->quaternion + (-> gp-1 quat) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) + (set! (-> gp-1 params 0 object-type) (traffic-type tt17)) + (set! (-> gp-1 params 0 behavior) (the-as uint 1)) + (set! (-> gp-1 params 0 id) (the-as uint 0)) + (set! (-> gp-1 params 0 nav-mesh) #f) + (set! (-> gp-1 params 0 nav-branch) #f) + (set! (-> gp-1 params 0 proc) #f) + (set! (-> gp-1 params 0 handle) (the-as handle #f)) + (set! (-> gp-1 params 0 user-data) (the-as uint 0)) + (set! (-> gp-1 params 0 flags) (traffic-spawn-flags trsflags-01)) + (set! (-> gp-1 params 0 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-1 params 0 velocity)) + (set! (-> gp-1 params 0 position quad) (-> gp-1 vec quad)) + (quaternion-copy! (-> gp-1 params 0 rotation) (-> gp-1 quat)) + (set! (-> gp-1 params 1 object-type) (traffic-type tt5)) + (set! (-> gp-1 params 1 behavior) (the-as uint 0)) + (set! (-> gp-1 params 1 id) (the-as uint 0)) + (set! (-> gp-1 params 1 nav-mesh) #f) + (set! (-> gp-1 params 1 nav-branch) #f) + (set! (-> gp-1 params 1 proc) #f) + (set! (-> gp-1 params 1 handle) (the-as handle #f)) + (set! (-> gp-1 params 1 user-data) (the-as uint 0)) + (set! (-> gp-1 params 1 flags) (traffic-spawn-flags trsflags-00)) + (set! (-> gp-1 params 1 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-1 params 1 velocity)) + (set! (-> gp-1 params 1 position quad) (-> gp-1 vec quad)) + (quaternion-copy! (-> gp-1 params 1 rotation) (-> gp-1 quat)) + (countdown (s5-1 (-> self max-count)) + (let ((s2-0 (-> *city-meet-brutter-vehicle-info* s5-1))) + (set! (-> gp-1 params 0 id) (the-as uint (+ s5-1 120))) + (set! (-> gp-1 params 0 position quad) (-> s2-0 pos quad)) + (set! (-> gp-1 params 1 position quad) (-> s2-0 pos quad)) + (let ((s4-0 (the-as + paddywagon + (vehicle-spawn *traffic-manager* paddywagon (the-as traffic-object-spawn-params (-> gp-1 params))) ) ) - ) - (if (not s3-0) - (format #t "brutter-task: unable to spawn rider~%") + ) + (when s4-0 + (set! (-> s4-0 current-level) (-> s2-0 level)) + (set! (-> self slave (+ s5-1 (-> self max-count))) (process->handle s4-0)) + (send-event *traffic-manager* 'add-object (-> gp-1 params 0 object-type) s4-0) + (let ((s3-0 (the-as city-lurker (citizen-spawn self city-lurker (-> gp-1 params 1))))) + (when s3-0 + (set! (-> s3-0 end-pos quad) (-> s2-0 end-pos quad)) + (set! (-> s3-0 task-node) (game-task-node city-meet-brutter-meet-brutter)) + (set! (-> s3-0 index) (the-as uint s5-1)) + (set! (-> s3-0 nav-mesh-aid) (the-as uint 0)) + (set! (-> self slave s5-1) (process->handle s3-0)) + (set! (-> self data-int32 s5-1) -1) + (change-parent s3-0 s4-0) + (logior! (-> s3-0 flags) (citizen-flag persistent)) + (send-event *traffic-manager* 'add-object (-> gp-1 params 1 object-type) s3-0) + (set! (-> s3-0 controller traffic) *traffic-engine*) + (set! (-> s3-0 vehicle) (process->handle s4-0)) + (let ((s2-1 (get-best-seat-for-vehicle s4-0 (-> s4-0 root-override-2 trans) 4 0))) + (when (!= s2-1 -1) + (format #t "adding lurker to seat ~d~%" s2-1) + (put-rider-in-seat s4-0 s2-1 s3-0) + (logior! (-> s3-0 focus-status) (focus-status pilot-riding)) ) - ) - ) - (if (not s4-0) - (format 0 "failed to spawn paddywagon~%") - ) - ) - ) - ) - (send-event *traffic-manager* 'set-object-target-count (-> gp-1 params 0 object-type) 0) - (send-event *traffic-manager* 'set-object-target-count (-> gp-1 params 1 object-type) 0) - ) - (set! (-> *game-info* counter) (the float (-> self count))) - (set! (-> self data-int32 16) 0) - (set! (-> self data-int32 17) 0) - (set! (-> self data-int32 17) (rand-vu-int-count 4)) - (set! (-> self data-int32 18) (rand-vu-int-count 4)) - (change-parent self *traffic-manager*) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 124 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 124 - 6 - (the-as - (function object) - (lambda :behavior task-manager - ((arg0 city-lurker) (arg1 object) (arg2 symbol)) - (case arg2 - (('task-done) - (let ((v1-1 arg0)) - (set! (-> self data-int32 (-> v1-1 index)) 2) - ) - ) - (('on-ground) - (let ((gp-0 arg0)) - (cond - ((= (-> self data-int32 (-> gp-0 index)) -1) - (+! (-> self data-int32 (-> gp-0 index)) 1) - (set! (-> self beep-time) (+ (-> self clock frame-counter) (rand-vu-int-range (seconds 10) (seconds 20)))) - (let ((v1-14 (-> self data-int32 16))) - (cond - ((zero? v1-14) - (talker-spawn-func (-> *talker-speech* 379) *entity-pool* (target-pos 0) (the-as region #f)) - ) - ((= v1-14 1) - (talker-spawn-func (-> *talker-speech* 381) *entity-pool* (target-pos 0) (the-as region #f)) - ) - ((= v1-14 2) - (talker-spawn-func (-> *talker-speech* 383) *entity-pool* (target-pos 0) (the-as region #f)) - ) - ) - ) - (set! (-> self beep-time) (+ (-> self clock frame-counter) (rand-vu-int-range (seconds 10) (seconds 20)))) - (+! (-> self data-int32 16) 1) - ) - ((= (-> self data-int32 (-> gp-0 index)) 1) - ) - ) - (change-parent gp-0 self) - ) - ) - ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 124 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (local-vars (v1-163 float) (v1-205 float)) - (rlet ((acc :class vf) - (vf0 :class vf) - (vf1 :class vf) - (vf2 :class vf) - ) - (init-vf0-vector) - (check-time self) - (let ((v1-2 0) - (gp-0 0) - ) - (dotimes (a0-1 (-> self max-count)) - (let ((a1-3 (handle->process (-> self slave a0-1)))) - (when (-> (the-as city-lurker a1-3) task-done?) - (+! gp-0 1) - (set! (-> self data-int32 a0-1) 3) - ) - (if (and (focus-test? (the-as city-lurker a1-3) pilot) (!= (-> self data-int32 a0-1) -1)) - (+! v1-2 1) - ) - ) - ) - (cond - ((zero? v1-2) - (dotimes (s5-0 (-> self max-count)) - (when (and (handle->process (-> self slave s5-0)) (not (-> self minimap s5-0))) - (let ((a1-15 (-> self slave s5-0 process 0))) - (if (not (-> (the-as city-lurker a1-15) task-done?)) - (set! (-> self minimap s5-0) - (add-icon! *minimap* a1-15 (the-as uint 15) (the-as int #f) (the-as vector #t) 0) - ) - ) - ) - ) - ) - (when (-> self minimap 3) - (logior! (-> self minimap 3 flags) (minimap-flag fade-out)) - (set! (-> self minimap 3) #f) - ) - ) - (else - (dotimes (v1-30 (-> self max-count)) - (when (-> self minimap v1-30) - (when (-> self minimap v1-30) - (logior! (-> self minimap v1-30 flags) (minimap-flag fade-out)) - (set! (-> self minimap v1-30) #f) ) ) + (if (not s3-0) + (format #t "brutter-task: unable to spawn rider~%") + ) ) - (if (not (-> self minimap 3)) - (set! (-> self minimap 3) (add-icon! *minimap* self (the-as uint 19) (the-as int #f) (the-as vector #f) 0)) - ) ) + (if (not s4-0) + (format 0 "failed to spawn paddywagon~%") + ) ) - (set! (-> self count) (- (-> self max-count) gp-0)) - (set! (-> *game-info* counter) (the float (-> self count))) - (if (= gp-0 (-> self max-count)) - (go-virtual complete) - ) ) - (dotimes (gp-1 (-> self max-count)) - (let ((s5-1 (handle->process (-> self slave (+ gp-1 (-> self max-count)))))) - (when (and s5-1 (not (logtest? (-> (the-as city-lurker s5-1) focus-status) (focus-status dead)))) + ) + (send-event *traffic-manager* 'set-object-target-count (-> gp-1 params 0 object-type) 0) + (send-event *traffic-manager* 'set-object-target-count (-> gp-1 params 1 object-type) 0) + ) + (set! (-> *game-info* counter) (the float (-> self count))) + (set! (-> self data-int32 16) 0) + (set! (-> self data-int32 17) 0) + (set! (-> self data-int32 17) (rand-vu-int-count 4)) + (set! (-> self data-int32 18) (rand-vu-int-count 4)) + (change-parent self *traffic-manager*) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-meet-brutter-meet-brutter) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-meet-brutter-meet-brutter) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 city-lurker) (arg1 object) (arg2 symbol)) + (case arg2 + (('task-done) + (let ((v1-1 arg0)) + (set! (-> self data-int32 (-> v1-1 index)) 2) + ) + ) + (('on-ground) + (let ((gp-0 arg0)) + (cond + ((= (-> self data-int32 (-> gp-0 index)) -1) + (+! (-> self data-int32 (-> gp-0 index)) 1) + (set! (-> self beep-time) (+ (-> self clock frame-counter) (rand-vu-int-range (seconds 10) (seconds 20)))) + (let ((v1-14 (-> self data-int32 16))) (cond - ((or (not (-> (the-as paddywagon s5-1) current-level)) - (= (level-status *level* (-> (the-as paddywagon s5-1) current-level)) 'active) - ) - (when (focus-test? (the-as paddywagon s5-1) inactive) - (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s4-0 object-type) (traffic-type tt17)) - (set! (-> s4-0 behavior) (the-as uint 2)) - (set! (-> s4-0 id) (the-as uint 0)) - (set! (-> s4-0 nav-mesh) #f) - (set! (-> s4-0 nav-branch) #f) - (set! (-> s4-0 proc) #f) - (set! (-> s4-0 handle) (-> self slave (+ gp-1 (-> self max-count)))) - (set! (-> s4-0 user-data) (the-as uint 0)) - (set! (-> s4-0 flags) (traffic-spawn-flags trsflags-01)) - (set! (-> s4-0 guard-type) (the-as uint 7)) - (vector-reset! (-> s4-0 velocity)) - (set! (-> s4-0 position quad) (-> (the-as paddywagon s5-1) root-override-2 trans quad)) - (quaternion-copy! (-> s4-0 rotation) (-> (the-as paddywagon s5-1) root-override-2 quat)) - (activate-by-handle *traffic-engine* s4-0) - ) - (let ((s4-1 (handle->process (-> self slave gp-1)))) - (when s4-1 - (let ((s3-0 - (get-best-seat-for-vehicle (the-as paddywagon s5-1) (-> (the-as paddywagon s5-1) root-override-2 trans) 4 0) - ) - ) - (when (!= s3-0 -1) - (format #t "adding lurker to seat ~d~%" s3-0) - (put-rider-in-seat (the-as paddywagon s5-1) s3-0 (the-as city-lurker s4-1)) - (logior! (-> (the-as city-lurker s4-1) focus-status) (focus-status pilot-riding)) + ((zero? v1-14) + (talker-spawn-func (-> *talker-speech* 379) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-14 1) + (talker-spawn-func (-> *talker-speech* 381) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-14 2) + (talker-spawn-func (-> *talker-speech* 383) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! (-> self beep-time) (+ (-> self clock frame-counter) (rand-vu-int-range (seconds 10) (seconds 20)))) + (+! (-> self data-int32 16) 1) + ) + ((= (-> self data-int32 (-> gp-0 index)) 1) + ) + ) + (change-parent gp-0 self) + ) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-meet-brutter-meet-brutter) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (local-vars (v1-163 float) (v1-205 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (check-time self) + (let ((v1-2 0) + (gp-0 0) + ) + (dotimes (a0-1 (-> self max-count)) + (let ((a1-3 (handle->process (-> self slave a0-1)))) + (when (-> (the-as city-lurker a1-3) task-done?) + (+! gp-0 1) + (set! (-> self data-int32 a0-1) 3) + ) + (if (and (focus-test? (the-as city-lurker a1-3) pilot) (!= (-> self data-int32 a0-1) -1)) + (+! v1-2 1) + ) + ) + ) + (cond + ((zero? v1-2) + (dotimes (s5-0 (-> self max-count)) + (when (and (handle->process (-> self slave s5-0)) (not (-> self minimap s5-0))) + (let ((a1-15 (-> self slave s5-0 process 0))) + (if (not (-> (the-as city-lurker a1-15) task-done?)) + (set! (-> self minimap s5-0) + (add-icon! *minimap* a1-15 (the-as uint 15) (the-as int #f) (the-as vector #t) 0) ) + ) + ) + ) + ) + (when (-> self minimap 3) + (logior! (-> self minimap 3 flags) (minimap-flag fade-out)) + (set! (-> self minimap 3) #f) + ) + ) + (else + (dotimes (v1-30 (-> self max-count)) + (when (-> self minimap v1-30) + (when (-> self minimap v1-30) + (logior! (-> self minimap v1-30 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-30) #f) + ) + ) + ) + (if (not (-> self minimap 3)) + (set! (-> self minimap 3) (add-icon! *minimap* self (the-as uint 19) (the-as int #f) (the-as vector #f) 0)) + ) + ) + ) + (set! (-> self count) (- (-> self max-count) gp-0)) + (set! (-> *game-info* counter) (the float (-> self count))) + (if (= gp-0 (-> self max-count)) + (go-virtual complete) + ) + ) + (dotimes (gp-1 (-> self max-count)) + (let ((s5-1 (handle->process (-> self slave (+ gp-1 (-> self max-count)))))) + (when (and s5-1 (not (logtest? (-> (the-as city-lurker s5-1) focus-status) (focus-status dead)))) + (cond + ((or (not (-> (the-as paddywagon s5-1) current-level)) + (= (level-status *level* (-> (the-as paddywagon s5-1) current-level)) 'active) + ) + (when (focus-test? (the-as paddywagon s5-1) inactive) + (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s4-0 object-type) (traffic-type tt17)) + (set! (-> s4-0 behavior) (the-as uint 2)) + (set! (-> s4-0 id) (the-as uint 0)) + (set! (-> s4-0 nav-mesh) #f) + (set! (-> s4-0 nav-branch) #f) + (set! (-> s4-0 proc) #f) + (set! (-> s4-0 handle) (-> self slave (+ gp-1 (-> self max-count)))) + (set! (-> s4-0 user-data) (the-as uint 0)) + (set! (-> s4-0 flags) (traffic-spawn-flags trsflags-01)) + (set! (-> s4-0 guard-type) (the-as uint 7)) + (vector-reset! (-> s4-0 velocity)) + (set! (-> s4-0 position quad) (-> (the-as paddywagon s5-1) root-override-2 trans quad)) + (quaternion-copy! (-> s4-0 rotation) (-> (the-as paddywagon s5-1) root-override-2 quat)) + (activate-by-handle *traffic-engine* s4-0) + ) + (let ((s4-1 (handle->process (-> self slave gp-1)))) + (when s4-1 + (let ((s3-0 + (get-best-seat-for-vehicle (the-as paddywagon s5-1) (-> (the-as paddywagon s5-1) root-override-2 trans) 4 0) + ) + ) + (when (!= s3-0 -1) + (format #t "adding lurker to seat ~d~%" s3-0) + (put-rider-in-seat (the-as paddywagon s5-1) s3-0 (the-as city-lurker s4-1)) + (logior! (-> (the-as city-lurker s4-1) focus-status) (focus-status pilot-riding)) ) ) ) ) ) - (else - (if (not (focus-test? (the-as paddywagon s5-1) inactive)) - (send-event (the-as paddywagon s5-1) 'traffic-off-force) - ) - ) + ) + (else + (if (not (focus-test? (the-as paddywagon s5-1) inactive)) + (send-event (the-as paddywagon s5-1) 'traffic-off-force) + ) ) ) ) ) - (let ((gp-2 #f)) - (dotimes (v1-100 (-> self max-count)) - (if (= (-> self data-int32 v1-100) 1) - (set! gp-2 #t) - ) - ) - (dotimes (s5-2 (-> self max-count)) - (let ((s4-2 (handle->process (-> self slave s5-2)))) - (cond - ((= (-> self data-int32 s5-2) -1) - (when s4-2 - (when (focus-test? (the-as city-lurker s4-2) inactive) - (let ((s3-1 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s3-1 object-type) (traffic-type tt5)) - (set! (-> s3-1 behavior) (the-as uint 6)) - (set! (-> s3-1 id) (the-as uint 0)) - (set! (-> s3-1 nav-mesh) #f) - (set! (-> s3-1 nav-branch) #f) - (set! (-> s3-1 proc) #f) - (set! (-> s3-1 handle) (-> self slave s5-2)) - (set! (-> s3-1 user-data) (the-as uint 0)) - (set! (-> s3-1 flags) (traffic-spawn-flags)) - (set! (-> s3-1 guard-type) (the-as uint 7)) - (vector-reset! (-> s3-1 velocity)) - (set! (-> s3-1 position quad) (-> (the-as city-lurker s4-2) root-override2 trans quad)) - (quaternion-copy! (-> s3-1 rotation) (-> (the-as city-lurker s4-2) root-override2 quat)) - (activate-by-handle *traffic-engine* s3-1) - ) + ) + (let ((gp-2 #f)) + (dotimes (v1-100 (-> self max-count)) + (if (= (-> self data-int32 v1-100) 1) + (set! gp-2 #t) + ) + ) + (dotimes (s5-2 (-> self max-count)) + (let ((s4-2 (handle->process (-> self slave s5-2)))) + (cond + ((= (-> self data-int32 s5-2) -1) + (when s4-2 + (when (focus-test? (the-as city-lurker s4-2) inactive) + (let ((s3-1 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s3-1 object-type) (traffic-type tt5)) + (set! (-> s3-1 behavior) (the-as uint 6)) + (set! (-> s3-1 id) (the-as uint 0)) + (set! (-> s3-1 nav-mesh) #f) + (set! (-> s3-1 nav-branch) #f) + (set! (-> s3-1 proc) #f) + (set! (-> s3-1 handle) (-> self slave s5-2)) + (set! (-> s3-1 user-data) (the-as uint 0)) + (set! (-> s3-1 flags) (traffic-spawn-flags)) + (set! (-> s3-1 guard-type) (the-as uint 7)) + (vector-reset! (-> s3-1 velocity)) + (set! (-> s3-1 position quad) (-> (the-as city-lurker s4-2) root-override2 trans quad)) + (quaternion-copy! (-> s3-1 rotation) (-> (the-as city-lurker s4-2) root-override2 quat)) + (activate-by-handle *traffic-engine* s3-1) ) ) ) - ((zero? (-> self data-int32 s5-2)) - (when (the-as city-lurker s4-2) - (let* ((s2-0 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) - (s3-2 (if (type? s2-0 entity-nav-mesh) - s2-0 - ) - ) - ) - (when (and s3-2 (!= (-> (the-as city-lurker s4-2) nav state mesh) (-> s3-2 nav-mesh))) - (when (nonzero? (-> (the-as city-lurker s4-2) nav state mesh)) - (remove-process-drawable (-> (the-as city-lurker s4-2) nav state mesh) (the-as city-lurker s4-2)) - (set! (-> (the-as city-lurker s4-2) nav) #f) - ) - (change-to (-> s3-2 nav-mesh) (the-as city-lurker s4-2)) - ) - ) - (let ((a0-73 *target*)) - (when (and a0-73 (focus-test? a0-73 pilot)) - (let ((s3-3 (handle->process (-> a0-73 pilot vehicle)))) - (when s3-3 - (cond - ((and (focus-test? (the-as city-lurker s4-2) pilot) (handle->process (-> (the-as city-lurker s4-2) vehicle))) - (+! (-> self data-int32 s5-2) 1) + ) + ((zero? (-> self data-int32 s5-2)) + (when (the-as city-lurker s4-2) + (let* ((s2-0 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) + (s3-2 (if (type? s2-0 entity-nav-mesh) + s2-0 + ) ) - (else - (.lvf vf1 (&-> (-> (the-as vehicle s3-3) root-override-2 transv) quad)) - (.add.w.vf vf2 vf0 vf0 :mask #b1) - (.mul.vf vf1 vf1 vf1) - (.mul.x.vf acc vf2 vf1 :mask #b1) - (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) - (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) - (.mov v1-163 vf1) - (let ((f0-2 v1-163) - (f1-0 32768.0) - ) - (when (and (< f0-2 (* f1-0 f1-0)) - (let ((f0-3 (vector-vector-distance-squared - (-> (the-as vehicle s3-3) root-override-2 trans) - (-> (the-as city-lurker s4-2) root-override2 trans) - ) - ) - (f1-3 65536.0) - ) - (< f0-3 (* f1-3 f1-3)) - ) - (not gp-2) - ) - (set! gp-2 #t) - (send-event (the-as city-lurker s4-2) 'board-vehicle (the-as vehicle s3-3)) + ) + (when (and s3-2 (!= (-> (the-as city-lurker s4-2) nav state mesh) (-> s3-2 nav-mesh))) + (when (nonzero? (-> (the-as city-lurker s4-2) nav state mesh)) + (remove-process-drawable (-> (the-as city-lurker s4-2) nav state mesh) (the-as city-lurker s4-2)) + (set! (-> (the-as city-lurker s4-2) nav) #f) + ) + (change-to (-> s3-2 nav-mesh) (the-as city-lurker s4-2)) + ) + ) + (let ((a0-73 *target*)) + (when (and a0-73 (focus-test? a0-73 pilot)) + (let ((s3-3 (handle->process (-> a0-73 pilot vehicle)))) + (when s3-3 + (cond + ((and (focus-test? (the-as city-lurker s4-2) pilot) (handle->process (-> (the-as city-lurker s4-2) vehicle))) + (+! (-> self data-int32 s5-2) 1) + ) + (else + (.lvf vf1 (&-> (-> (the-as vehicle s3-3) root-override-2 transv) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-163 vf1) + (let ((f0-2 v1-163) + (f1-0 32768.0) ) + (when (and (< f0-2 (* f1-0 f1-0)) + (let ((f0-3 (vector-vector-distance-squared + (-> (the-as vehicle s3-3) root-override-2 trans) + (-> (the-as city-lurker s4-2) root-override2 trans) + ) + ) + (f1-3 65536.0) + ) + (< f0-3 (* f1-3 f1-3)) + ) + (not gp-2) + ) + (set! gp-2 #t) + (send-event (the-as city-lurker s4-2) 'board-vehicle (the-as vehicle s3-3)) ) ) ) @@ -2754,100 +2742,79 @@ ) ) ) - ((= (-> self data-int32 s5-2) 1) - (when (the-as city-lurker s4-2) - (if (or (not *target*) (not (logtest? (focus-status pilot) (-> *target* focus-status)))) - (send-event (the-as city-lurker s4-2) 'exit-vehicle (-> (the-as city-lurker s4-2) root-override2 trans)) + ) + ((= (-> self data-int32 s5-2) 1) + (when (the-as city-lurker s4-2) + (if (or (not *target*) (not (logtest? (focus-status pilot) (-> *target* focus-status)))) + (send-event (the-as city-lurker s4-2) 'exit-vehicle (-> (the-as city-lurker s4-2) root-override2 trans)) + ) + (let ((s3-4 (-> self data-vector 3)) + (s2-1 (handle->process (-> *target* pilot vehicle))) ) - (let ((s3-4 (-> self data-vector 3)) - (s2-1 (handle->process (-> *target* pilot vehicle))) - ) - (cond - ((focus-test? (the-as city-lurker s4-2) pilot) - (when (and s2-1 - (let ((f0-4 (vector-vector-distance-squared s3-4 (-> (the-as vehicle s2-1) root-override-2 trans))) - (f1-6 114688.0) - ) - (< f0-4 (* f1-6 f1-6)) - ) - (begin - (.lvf vf1 (&-> (-> (the-as vehicle s2-1) root-override-2 transv) quad)) - (.add.w.vf vf2 vf0 vf0 :mask #b1) - (.mul.vf vf1 vf1 vf1) - (.mul.x.vf acc vf2 vf1 :mask #b1) - (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) - (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) - (.mov v1-205 vf1) - (let ((f0-5 v1-205) - (f1-9 421888.0) - ) - (< f0-5 (* f1-9 f1-9)) + (cond + ((focus-test? (the-as city-lurker s4-2) pilot) + (when (and s2-1 + (let ((f0-4 (vector-vector-distance-squared s3-4 (-> (the-as vehicle s2-1) root-override-2 trans))) + (f1-6 114688.0) ) + (< f0-4 (* f1-6 f1-6)) + ) + (begin + (.lvf vf1 (&-> (-> (the-as vehicle s2-1) root-override-2 transv) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-205 vf1) + (let ((f0-5 v1-205) + (f1-9 421888.0) + ) + (< f0-5 (* f1-9 f1-9)) ) ) - (set! (-> (the-as city-lurker s4-2) task-done?) #t) - (send-event (the-as city-lurker s4-2) 'exit-vehicle s3-4) - (let ((v1-214 (-> self data-int32 17))) - (cond - ((zero? v1-214) - (talker-spawn-func (-> *talker-speech* 380) *entity-pool* (target-pos 0) (the-as region #f)) - ) - ((= v1-214 1) - (talker-spawn-func (-> *talker-speech* 382) *entity-pool* (target-pos 0) (the-as region #f)) - ) - ((= v1-214 2) - (talker-spawn-func (-> *talker-speech* 384) *entity-pool* (target-pos 0) (the-as region #f)) - ) - ) + ) + (set! (-> (the-as city-lurker s4-2) task-done?) #t) + (send-event (the-as city-lurker s4-2) 'exit-vehicle s3-4) + (let ((v1-214 (-> self data-int32 17))) + (cond + ((zero? v1-214) + (talker-spawn-func (-> *talker-speech* 380) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-214 1) + (talker-spawn-func (-> *talker-speech* 382) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-214 2) + (talker-spawn-func (-> *talker-speech* 384) *entity-pool* (target-pos 0) (the-as region #f)) + ) ) - (+! (-> self data-int32 17) 1) ) + (+! (-> self data-int32 17) 1) ) - (else - (set! (-> self data-int32 s5-2) 0) - 0 - ) + ) + (else + (set! (-> self data-int32 s5-2) 0) + 0 ) ) ) ) - ((= (-> self data-int32 s5-2) 2) - (let* ((s3-8 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) - (a0-116 (if (type? s3-8 entity-nav-mesh) - s3-8 - ) - ) - ) - (if a0-116 - (change-to (-> a0-116 nav-mesh) (the-as city-lurker s4-2)) - ) - ) + ) + ((= (-> self data-int32 s5-2) 2) + (let* ((s3-8 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) + (a0-116 (if (type? s3-8 entity-nav-mesh) + s3-8 + ) + ) + ) + (if a0-116 + (change-to (-> a0-116 nav-mesh) (the-as city-lurker s4-2)) + ) ) - ) + ) ) ) ) - (none) - ) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 124 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) - (suspend) - (send-event *traffic-manager* 'set-target-level #x3f400000) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) - (suspend) ) (none) ) @@ -2855,26 +2822,48 @@ ) ;; failed to figure out what this is: -(set-subtask-hook! *game-info* 124 5 (the-as (function object) (lambda :behavior task-manager () (none)))) +(set-subtask-hook! + *game-info* + (game-task-node city-meet-brutter-meet-brutter) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) + (suspend) + (send-event *traffic-manager* 'set-target-level #x3f400000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (none) + ) + ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 124 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *traffic-manager* 'decrease-alert-level 0) - (send-event *traffic-manager* 'set-alert-duration 9000) - (send-event *target* 'end-mode) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (task-node-close! (game-task-node city-meet-brutter-meet-brutter)) - (none) - ) - ) + (game-task-node city-meet-brutter-meet-brutter) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager () (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-meet-brutter-meet-brutter) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'decrease-alert-level 0) + (send-event *traffic-manager* 'set-alert-duration 9000) + (send-event *target* 'end-mode) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (task-node-close! (game-task-node city-meet-brutter-meet-brutter)) + (none) + ) ) ;; definition of type city-save-lurkers-info @@ -2981,162 +2970,155 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 207 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) - (set-setting! 'minimap 'clear 0 32) - (dotimes (v1-3 8) - (set! (-> self minimap v1-3) #f) + (game-task-node city-save-lurkers-save-lurkers) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (dotimes (v1-3 8) + (set! (-> self minimap v1-3) #f) + ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self max-count) 6) + (set! (-> self count) 6) + (dotimes (v1-8 4) + (set! (-> self data-vector v1-8 quad) (-> *save-lurkers-position* v1-8 quad)) + ) + (let ((gp-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params-1))) + (vector-reset! (-> gp-0 vec)) + (forward-up-nopitch->quaternion + (-> gp-0 quat) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) ) - (set! (-> self start-time) 0) - (set! (-> self sub-state) (the-as uint 0)) - (set! (-> self max-count) 6) - (set! (-> self count) 6) - (dotimes (v1-8 4) - (set! (-> self data-vector v1-8 quad) (-> *save-lurkers-position* v1-8 quad)) - ) - (let ((gp-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params-1))) - (vector-reset! (-> gp-0 vec)) - (forward-up-nopitch->quaternion - (-> gp-0 quat) - (new 'static 'vector :z 1.0 :w 1.0) - (new 'static 'vector :y 1.0 :w 1.0) - ) - (set! (-> gp-0 params 0 object-type) (traffic-type tt17)) - (set! (-> gp-0 params 0 behavior) (the-as uint 1)) - (set! (-> gp-0 params 0 id) (the-as uint 0)) - (set! (-> gp-0 params 0 nav-mesh) #f) - (set! (-> gp-0 params 0 nav-branch) #f) - (set! (-> gp-0 params 0 proc) #f) - (set! (-> gp-0 params 0 handle) (the-as handle #f)) - (set! (-> gp-0 params 0 user-data) (the-as uint 0)) - (set! (-> gp-0 params 0 flags) (traffic-spawn-flags trsflags-01)) - (set! (-> gp-0 params 0 guard-type) (the-as uint 7)) - (vector-reset! (-> gp-0 params 0 velocity)) - (set! (-> gp-0 params 0 position quad) (-> gp-0 vec quad)) - (quaternion-copy! (-> gp-0 params 0 rotation) (-> gp-0 quat)) - (set! (-> gp-0 params 1 object-type) (traffic-type tt5)) - (set! (-> gp-0 params 1 behavior) (the-as uint 8)) - (set! (-> gp-0 params 1 id) (the-as uint 0)) - (set! (-> gp-0 params 1 nav-mesh) #f) - (set! (-> gp-0 params 1 nav-branch) #f) - (set! (-> gp-0 params 1 proc) #f) - (set! (-> gp-0 params 1 handle) (the-as handle #f)) - (set! (-> gp-0 params 1 user-data) (the-as uint 0)) - (set! (-> gp-0 params 1 flags) (traffic-spawn-flags trsflags-00)) - (set! (-> gp-0 params 1 guard-type) (the-as uint 7)) - (vector-reset! (-> gp-0 params 1 velocity)) - (set! (-> gp-0 params 1 position quad) (-> gp-0 vec quad)) - (quaternion-copy! (-> gp-0 params 1 rotation) (-> gp-0 quat)) - (countdown (s5-0 (-> self max-count)) - (let ((s2-0 (-> *city-save-lurkers-vehicle-info* s5-0))) - (set! (-> gp-0 params 0 id) (the-as uint (+ s5-0 120))) - (set! (-> gp-0 params 0 position quad) (-> s2-0 pos quad)) - (set! (-> gp-0 params 1 position quad) (-> s2-0 pos quad)) - (let ((s4-0 (the-as - paddywagon - (vehicle-spawn *traffic-manager* paddywagon (the-as traffic-object-spawn-params (-> gp-0 params))) - ) - ) - ) - (when s4-0 - (set! (-> s4-0 current-level) (-> s2-0 level)) - (set! (-> self slave (+ s5-0 (-> self max-count))) (process->handle s4-0)) - (send-event *traffic-manager* 'add-object (-> gp-0 params 0 object-type) s4-0) - (let ((s3-0 (the-as city-lurker (citizen-spawn self city-lurker (-> gp-0 params 1))))) - (when s3-0 - (set! (-> s3-0 jump-in-pipe?) #t) - (set! (-> s3-0 pipe-name) (-> s2-0 pipe-name)) - (set! (-> s3-0 end-pos quad) (-> s2-0 end-pos quad)) - (set! (-> s3-0 task-node) (game-task-node city-save-lurkers-save-lurkers)) - (set! (-> s3-0 index) (the-as uint s5-0)) - (set! (-> s3-0 nav-mesh-aid) (the-as uint 0)) - (set! (-> self slave s5-0) (process->handle s3-0)) - (set! (-> self data-int32 s5-0) -1) - (change-parent s3-0 s4-0) - (logior! (-> s3-0 flags) (citizen-flag persistent)) - (send-event *traffic-manager* 'add-object (-> gp-0 params 1 object-type) s3-0) - (set! (-> s3-0 controller traffic) *traffic-engine*) - (set! (-> s3-0 vehicle) (process->handle s4-0)) - (let ((s2-1 (get-best-seat-for-vehicle s4-0 (-> s4-0 root-override-2 trans) 4 0))) - (when (!= s2-1 -1) - (format #t "adding lurker to seat ~d~%" s2-1) - (put-rider-in-seat s4-0 s2-1 s3-0) - (logior! (-> s3-0 focus-status) (focus-status pilot-riding)) + (set! (-> gp-0 params 0 object-type) (traffic-type tt17)) + (set! (-> gp-0 params 0 behavior) (the-as uint 1)) + (set! (-> gp-0 params 0 id) (the-as uint 0)) + (set! (-> gp-0 params 0 nav-mesh) #f) + (set! (-> gp-0 params 0 nav-branch) #f) + (set! (-> gp-0 params 0 proc) #f) + (set! (-> gp-0 params 0 handle) (the-as handle #f)) + (set! (-> gp-0 params 0 user-data) (the-as uint 0)) + (set! (-> gp-0 params 0 flags) (traffic-spawn-flags trsflags-01)) + (set! (-> gp-0 params 0 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-0 params 0 velocity)) + (set! (-> gp-0 params 0 position quad) (-> gp-0 vec quad)) + (quaternion-copy! (-> gp-0 params 0 rotation) (-> gp-0 quat)) + (set! (-> gp-0 params 1 object-type) (traffic-type tt5)) + (set! (-> gp-0 params 1 behavior) (the-as uint 8)) + (set! (-> gp-0 params 1 id) (the-as uint 0)) + (set! (-> gp-0 params 1 nav-mesh) #f) + (set! (-> gp-0 params 1 nav-branch) #f) + (set! (-> gp-0 params 1 proc) #f) + (set! (-> gp-0 params 1 handle) (the-as handle #f)) + (set! (-> gp-0 params 1 user-data) (the-as uint 0)) + (set! (-> gp-0 params 1 flags) (traffic-spawn-flags trsflags-00)) + (set! (-> gp-0 params 1 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-0 params 1 velocity)) + (set! (-> gp-0 params 1 position quad) (-> gp-0 vec quad)) + (quaternion-copy! (-> gp-0 params 1 rotation) (-> gp-0 quat)) + (countdown (s5-0 (-> self max-count)) + (let ((s2-0 (-> *city-save-lurkers-vehicle-info* s5-0))) + (set! (-> gp-0 params 0 id) (the-as uint (+ s5-0 120))) + (set! (-> gp-0 params 0 position quad) (-> s2-0 pos quad)) + (set! (-> gp-0 params 1 position quad) (-> s2-0 pos quad)) + (let ((s4-0 (the-as + paddywagon + (vehicle-spawn *traffic-manager* paddywagon (the-as traffic-object-spawn-params (-> gp-0 params))) ) ) + ) + (when s4-0 + (set! (-> s4-0 current-level) (-> s2-0 level)) + (set! (-> self slave (+ s5-0 (-> self max-count))) (process->handle s4-0)) + (send-event *traffic-manager* 'add-object (-> gp-0 params 0 object-type) s4-0) + (let ((s3-0 (the-as city-lurker (citizen-spawn self city-lurker (-> gp-0 params 1))))) + (when s3-0 + (set! (-> s3-0 jump-in-pipe?) #t) + (set! (-> s3-0 pipe-name) (-> s2-0 pipe-name)) + (set! (-> s3-0 end-pos quad) (-> s2-0 end-pos quad)) + (set! (-> s3-0 task-node) (game-task-node city-save-lurkers-save-lurkers)) + (set! (-> s3-0 index) (the-as uint s5-0)) + (set! (-> s3-0 nav-mesh-aid) (the-as uint 0)) + (set! (-> self slave s5-0) (process->handle s3-0)) + (set! (-> self data-int32 s5-0) -1) + (change-parent s3-0 s4-0) + (logior! (-> s3-0 flags) (citizen-flag persistent)) + (send-event *traffic-manager* 'add-object (-> gp-0 params 1 object-type) s3-0) + (set! (-> s3-0 controller traffic) *traffic-engine*) + (set! (-> s3-0 vehicle) (process->handle s4-0)) + (let ((s2-1 (get-best-seat-for-vehicle s4-0 (-> s4-0 root-override-2 trans) 4 0))) + (when (!= s2-1 -1) + (format #t "adding lurker to seat ~d~%" s2-1) + (put-rider-in-seat s4-0 s2-1 s3-0) + (logior! (-> s3-0 focus-status) (focus-status pilot-riding)) + ) ) - (if (not s3-0) - (format #t "brutter-task: unable to spawn rider~%") - ) ) + (if (not s3-0) + (format #t "brutter-task: unable to spawn rider~%") + ) ) - (if (not s4-0) - (format 0 "failed to spawn paddywagon~%") - ) ) + (if (not s4-0) + (format 0 "failed to spawn paddywagon~%") + ) ) ) - (send-event *traffic-manager* 'set-object-target-count (-> gp-0 params 0 object-type) 0) - (send-event *traffic-manager* 'set-object-target-count (-> gp-0 params 1 object-type) 0) ) - (set! (-> *game-info* counter) (the float (-> self count))) - (set! (-> self arrow) (the-as handle #f)) - (change-parent self *traffic-manager*) - (none) + (send-event *traffic-manager* 'set-object-target-count (-> gp-0 params 0 object-type) 0) + (send-event *traffic-manager* 'set-object-target-count (-> gp-0 params 1 object-type) 0) ) + (set! (-> *game-info* counter) (the float (-> self count))) + (set! (-> self arrow) (the-as handle #f)) + (change-parent self *traffic-manager*) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 207 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) + (game-task-node city-save-lurkers-save-lurkers) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 207 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 city-lurker) (arg1 object) (arg2 symbol)) - (case arg2 - (('task-done) - (let ((v1-1 arg0)) - (set! (-> self data-int32 (-> v1-1 index)) 2) - ) - ) - (('on-ground) - (cond - ((= (-> self data-int32 (-> arg0 index)) -1) - (+! (-> self data-int32 (-> arg0 index)) 1) - ) - ((= (-> self data-int32 (-> arg0 index)) 1) - ) - ) - (change-parent arg0 self) - ) - ) - (none) - ) + (game-task-node city-save-lurkers-save-lurkers) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 city-lurker) (arg1 object) (arg2 symbol)) + (case arg2 + (('task-done) + (let ((v1-1 arg0)) + (set! (-> self data-int32 (-> v1-1 index)) 2) + ) + ) + (('on-ground) + (cond + ((= (-> self data-int32 (-> arg0 index)) -1) + (+! (-> self data-int32 (-> arg0 index)) 1) ) + ((= (-> self data-int32 (-> arg0 index)) 1) + ) + ) + (change-parent arg0 self) + ) + ) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 207 - 2 + (game-task-node city-save-lurkers-save-lurkers) + TASK_MANAGER_UPDATE_HOOK (lambda :behavior task-manager () (local-vars (v1-178 float) (v1-231 float)) @@ -3440,57 +3422,56 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 207 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) + (game-task-node city-save-lurkers-save-lurkers) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) + (suspend) + (send-event *traffic-manager* 'set-target-level #x3f400000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) (suspend) - (send-event *traffic-manager* 'set-target-level #x3f400000) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) - (suspend) - ) - (none) ) + (none) ) ) -;; failed to figure out what this is: -(set-subtask-hook! *game-info* 207 5 (the-as (function object) (lambda :behavior task-manager () (none)))) - ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 207 - 4 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (until #f - (let ((v1-2 0)) - (dotimes (a0-0 6) - (let ((a1-3 (handle->process (-> self slave a0-0)))) - (if (and a1-3 (-> a1-3 next-state) (= (-> a1-3 next-state name) 'inactive)) - (+! v1-2 1) - ) - ) + (game-task-node city-save-lurkers-save-lurkers) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager () (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-save-lurkers-save-lurkers) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (until #f + (let ((v1-2 0)) + (dotimes (a0-0 6) + (let ((a1-3 (handle->process (-> self slave a0-0)))) + (if (and a1-3 (-> a1-3 next-state) (= (-> a1-3 next-state name) 'inactive)) + (+! v1-2 1) + ) ) - (if (= v1-2 6) - (goto cfg-20) - ) ) - (suspend) - 0 + (if (= v1-2 6) + (goto cfg-20) + ) ) - #f - (label cfg-20) - (task-node-close! (game-task-node city-save-lurkers-save-lurkers)) - (none) + (suspend) + 0 ) + #f + (label cfg-20) + (task-node-close! (game-task-node city-save-lurkers-save-lurkers)) + (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/misc/collection_task/collection-task_REF.gc b/test/decompiler/reference/jak2/levels/city/misc/collection_task/collection-task_REF.gc index 4a6fde48c4..c839d9c0fa 100644 --- a/test/decompiler/reference/jak2/levels/city/misc/collection_task/collection-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/misc/collection_task/collection-task_REF.gc @@ -228,143 +228,137 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 73 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -245760.0 :y 45056.0 :z 5468160.0 :w 1.0) quad)) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (let ((traffic-manager *traffic-manager*) - (traffic-obj-params (new 'stack 'traffic-object-spawn-params)) - ) - (set! (-> traffic-obj-params position quad) (-> self begin-pos quad)) - (quaternion-axis-angle! (-> traffic-obj-params rotation) 0.0 1.0 0.0 16384.0) - (set! (-> traffic-obj-params object-type) (traffic-type bikec)) - (set! (-> traffic-obj-params behavior) (the-as uint 0)) - (set! (-> traffic-obj-params id) (the-as uint 0)) - (set! (-> traffic-obj-params proc) #f) - (send-event traffic-manager 'spawn-object traffic-obj-params) - ) - (set! (-> self start-time) 0) - (set! (-> self count) -1) - (set! (-> self max-count) 14) - (set! (-> self data-vector 0 quad) - (-> (new 'static 'vector :x 1282048.0 :y 37925.273 :z 5492736.0 :w 1.0) quad) - ) - (set! (-> self data-vector 1 quad) - (-> (new 'static 'vector :x 2392064.0 :y 23235.379 :z 5980160.0 :w 1.0) quad) - ) - (set! (-> self data-vector 2 quad) - (-> (new 'static 'vector :x 3231744.0 :y 38680.984 :z 4788224.0 :w 1.0) quad) - ) - (set! (-> self data-vector 3 quad) - (-> (new 'static 'vector :x 3829760.0 :y 38680.984 :z 3682304.0 :w 1.0) quad) - ) - (set! (-> self data-vector 4 quad) - (-> (new 'static 'vector :x 4325376.0 :y 38680.984 :z 2564096.0 :w 1.0) quad) - ) - (set! (-> self data-vector 5 quad) - (-> (new 'static 'vector :x 4014080.0 :y 38680.984 :z 1822720.0 :w 1.0) quad) - ) - (set! (-> self data-vector 6 quad) - (-> (new 'static 'vector :x 3698688.0 :y 38680.984 :z 1728512.0 :w 1.0) quad) - ) - (set! (-> self data-vector 7 quad) - (-> (new 'static 'vector :x 3792896.0 :y 38680.984 :z 2387968.0 :w 1.0) quad) - ) - (set! (-> self data-vector 8 quad) - (-> (new 'static 'vector :x 4616192.0 :y 38680.984 :z 2863104.0 :w 1.0) quad) - ) - (set! (-> self data-vector 9 quad) - (-> (new 'static 'vector :x 3633152.0 :y 38680.984 :z 3477504.0 :w 1.0) quad) - ) - (set! (-> self data-vector 10 quad) - (-> (new 'static 'vector :x 3993600.0 :y 38680.984 :z 4378624.0 :w 1.0) quad) - ) - (set! (-> self data-vector 11 quad) - (-> (new 'static 'vector :x 3112960.0 :y 23472.947 :z 5390336.0 :w 1.0) quad) - ) - (set! (-> self data-vector 12 quad) - (-> (new 'static 'vector :x 1789952.0 :y 37616.027 :z 5455872.0 :w 1.0) quad) - ) - (set! (-> self data-vector 13 quad) - (-> (new 'static 'vector :x 237568.0 :y 37541.477 :z 5439488.0 :w 1.0) quad) - ) - (set! (-> self data-int32 0) #x2904) - (set! (-> self data-int32 1) 9000) - (set! (-> self data-int32 2) 9000) - (set! (-> self data-int32 3) 9000) - (set! (-> self data-int32 4) 9000) - (set! (-> self data-int32 5) 9000) - (set! (-> self data-int32 6) 3000) - (set! (-> self data-int32 7) 6000) - (set! (-> self data-int32 8) 9000) - (set! (-> self data-int32 9) 9000) - (set! (-> self data-int32 10) 9000) - (set! (-> self data-int32 11) 9000) - (set! (-> self data-int32 12) 7500) - (set! (-> self data-int32 13) 7500) - (set! (-> *game-info* counter) (the float (-> self max-count))) - (none) + (game-task-node city-krew-collection-collection) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -245760.0 :y 45056.0 :z 5468160.0 :w 1.0) quad)) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (let ((traffic-manager *traffic-manager*) + (traffic-obj-params (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> traffic-obj-params position quad) (-> self begin-pos quad)) + (quaternion-axis-angle! (-> traffic-obj-params rotation) 0.0 1.0 0.0 16384.0) + (set! (-> traffic-obj-params object-type) (traffic-type bikec)) + (set! (-> traffic-obj-params behavior) (the-as uint 0)) + (set! (-> traffic-obj-params id) (the-as uint 0)) + (set! (-> traffic-obj-params proc) #f) + (send-event traffic-manager 'spawn-object traffic-obj-params) ) + (set! (-> self start-time) 0) + (set! (-> self count) -1) + (set! (-> self max-count) 14) + (set! (-> self data-vector 0 quad) + (-> (new 'static 'vector :x 1282048.0 :y 37925.273 :z 5492736.0 :w 1.0) quad) + ) + (set! (-> self data-vector 1 quad) + (-> (new 'static 'vector :x 2392064.0 :y 23235.379 :z 5980160.0 :w 1.0) quad) + ) + (set! (-> self data-vector 2 quad) + (-> (new 'static 'vector :x 3231744.0 :y 38680.984 :z 4788224.0 :w 1.0) quad) + ) + (set! (-> self data-vector 3 quad) + (-> (new 'static 'vector :x 3829760.0 :y 38680.984 :z 3682304.0 :w 1.0) quad) + ) + (set! (-> self data-vector 4 quad) + (-> (new 'static 'vector :x 4325376.0 :y 38680.984 :z 2564096.0 :w 1.0) quad) + ) + (set! (-> self data-vector 5 quad) + (-> (new 'static 'vector :x 4014080.0 :y 38680.984 :z 1822720.0 :w 1.0) quad) + ) + (set! (-> self data-vector 6 quad) + (-> (new 'static 'vector :x 3698688.0 :y 38680.984 :z 1728512.0 :w 1.0) quad) + ) + (set! (-> self data-vector 7 quad) + (-> (new 'static 'vector :x 3792896.0 :y 38680.984 :z 2387968.0 :w 1.0) quad) + ) + (set! (-> self data-vector 8 quad) + (-> (new 'static 'vector :x 4616192.0 :y 38680.984 :z 2863104.0 :w 1.0) quad) + ) + (set! (-> self data-vector 9 quad) + (-> (new 'static 'vector :x 3633152.0 :y 38680.984 :z 3477504.0 :w 1.0) quad) + ) + (set! (-> self data-vector 10 quad) + (-> (new 'static 'vector :x 3993600.0 :y 38680.984 :z 4378624.0 :w 1.0) quad) + ) + (set! (-> self data-vector 11 quad) + (-> (new 'static 'vector :x 3112960.0 :y 23472.947 :z 5390336.0 :w 1.0) quad) + ) + (set! (-> self data-vector 12 quad) + (-> (new 'static 'vector :x 1789952.0 :y 37616.027 :z 5455872.0 :w 1.0) quad) + ) + (set! (-> self data-vector 13 quad) + (-> (new 'static 'vector :x 237568.0 :y 37541.477 :z 5439488.0 :w 1.0) quad) + ) + (set! (-> self data-int32 0) #x2904) + (set! (-> self data-int32 1) 9000) + (set! (-> self data-int32 2) 9000) + (set! (-> self data-int32 3) 9000) + (set! (-> self data-int32 4) 9000) + (set! (-> self data-int32 5) 9000) + (set! (-> self data-int32 6) 3000) + (set! (-> self data-int32 7) 6000) + (set! (-> self data-int32 8) 9000) + (set! (-> self data-int32 9) 9000) + (set! (-> self data-int32 10) 9000) + (set! (-> self data-int32 11) 9000) + (set! (-> self data-int32 12) 7500) + (set! (-> self data-int32 13) 7500) + (set! (-> *game-info* counter) (the float (-> self max-count))) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 73 - 1 + (game-task-node city-krew-collection-collection) + TASK_MANAGER_CLEANUP_HOOK (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings)) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 73 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (check-time self) - (when (>= (-> self count) 0) - (cond - ((handle->process (-> self slave 0)) - ) - (else - (let ((task-count (-> self count))) - (cond - ((< task-count (-> self max-count)) - (let ((krew-item (krew-collection-item-spawn self (-> self data-vector task-count)))) - (when krew-item - (set! (-> self slave 0) (process->handle krew-item)) - (set! (-> self time-limit) (the-as time-frame (-> self data-int32 task-count))) - (set! (-> self start-time) (-> self clock frame-counter)) - (+! (-> self count) 1) - ) + (game-task-node city-krew-collection-collection) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (check-time self) + (when (>= (-> self count) 0) + (cond + ((handle->process (-> self slave 0)) + ) + (else + (let ((task-count (-> self count))) + (cond + ((< task-count (-> self max-count)) + (let ((krew-item (krew-collection-item-spawn self (-> self data-vector task-count)))) + (when krew-item + (set! (-> self slave 0) (process->handle krew-item)) + (set! (-> self time-limit) (the-as time-frame (-> self data-int32 task-count))) + (set! (-> self start-time) (-> self clock frame-counter)) + (+! (-> self count) 1) ) ) - (else - (go-virtual complete) - ) + ) + (else + (go-virtual complete) ) ) ) ) ) - (none) ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 73 - 3 + (game-task-node city-krew-collection-collection) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (local-vars (moved-beyond-start? symbol)) @@ -378,7 +372,7 @@ ) ) ) - (set-setting! 'airlock #f 0 0) + (set-setting! 'airlock #f 0.0 0) (set! (-> self count) 0) (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-moneybag :init hud-init-by-other :to *target*)) @@ -396,28 +390,25 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 73 - 5 + (game-task-node city-krew-collection-collection) + TASK_MANAGER_FAIL_HOOK (lambda :behavior task-manager () (the-as object (kill-all-children self))) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 73 - 4 - (the-as - (function object) - (lambda :behavior task-manager - () - (send-event *traffic-manager* 'decrease-alert-level 0) - (send-event *traffic-manager* 'set-alert-duration 9000) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (talker-spawn-func (-> *talker-speech* 88) *entity-pool* (target-pos 0) (the-as region #f)) - (none) + (game-task-node city-krew-collection-collection) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'decrease-alert-level 0) + (send-event *traffic-manager* 'set-alert-duration 9000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) ) + (talker-spawn-func (-> *talker-speech* 88) *entity-pool* (target-pos 0) (the-as region #f)) + (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/misc/delivery/delivery-task_REF.gc b/test/decompiler/reference/jak2/levels/city/misc/delivery/delivery-task_REF.gc index 3060f79e2a..04ce8e1be2 100644 --- a/test/decompiler/reference/jak2/levels/city/misc/delivery/delivery-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/misc/delivery/delivery-task_REF.gc @@ -144,80 +144,74 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 24 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (while (!= (level-status *level* 'ctysluma) 'active) - (suspend) - ) - (let ((v1-3 (entity-by-name "parking-spot-8"))) - (if v1-3 - (logior! (-> v1-3 extra perm status) (entity-perm-status bit-9)) + (game-task-node city-krew-delivery-delivery) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (while (!= (level-status *level* 'ctysluma) 'active) + (suspend) + ) + (let ((v1-3 (entity-by-name "parking-spot-8"))) + (if v1-3 + (logior! (-> v1-3 extra perm status) (entity-perm-status bit-9)) + ) + ) + (set! (-> self end-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (let ((gp-1 *traffic-manager*)) + (let ((s5-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s5-0 position quad) (-> (new 'static 'vector :x 4698112.0 :y 45875.2 :z 81920.0 :w 1.0) quad)) + (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 32768.0) + (set! (-> s5-0 object-type) (traffic-type bikea)) + (set! (-> s5-0 behavior) (the-as uint 0)) + (set! (-> s5-0 id) (the-as uint 0)) + (set! (-> s5-0 proc) #f) + (send-event gp-1 'spawn-object s5-0) + (when (-> s5-0 proc) + (set! (-> self slave 0) (process->handle (-> s5-0 proc))) + (let ((v1-20 (-> s5-0 proc))) + (set! (-> (the-as vehicle v1-20) damage-factor) 2.0) ) - ) - (set! (-> self end-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) - (set-setting! 'minimap 'clear 0 32) - (let ((gp-1 *traffic-manager*)) - (let ((s5-0 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s5-0 position quad) (-> (new 'static 'vector :x 4698112.0 :y 45875.2 :z 81920.0 :w 1.0) quad)) - (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 32768.0) - (set! (-> s5-0 object-type) (traffic-type bikea)) - (set! (-> s5-0 behavior) (the-as uint 0)) - (set! (-> s5-0 id) (the-as uint 0)) - (set! (-> s5-0 proc) #f) - (send-event gp-1 'spawn-object s5-0) - (when (-> s5-0 proc) - (set! (-> self slave 0) (process->handle (-> s5-0 proc))) - (let ((v1-20 (-> s5-0 proc))) - (set! (-> (the-as vehicle v1-20) damage-factor) 2.0) - ) - (let ((v1-22 (krew-package-spawn (-> s5-0 proc) (-> s5-0 proc)))) - (if v1-22 - (set! (-> self slave 1) (process->handle (-> v1-22 0))) - ) - ) - ) - (let ((s4-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s4-0 pos quad) (-> s5-0 position quad)) - (quaternion-identity! (-> s4-0 quat)) - (set! (-> s4-0 flags) (task-arrow-flags task-arrow-flag-03)) - (set! (-> s4-0 map-icon) (the-as uint 15)) - (label cfg-21) - (let ((a0-30 (task-arrow-spawn s4-0 (the-as task-arrow self)))) - (when (not a0-30) - (format #t "waiting for task-arrow~%") - (suspend) - (goto cfg-21) + (let ((v1-22 (krew-package-spawn (-> s5-0 proc) (-> s5-0 proc)))) + (if v1-22 + (set! (-> self slave 1) (process->handle (-> v1-22 0))) ) - (set! (-> self arrow) (process->handle a0-30)) - ) ) ) - (send-event gp-1 'set-target-level #x3f800000) - (send-event gp-1 'set-guard-target-count-range 4 0 1) - (send-event gp-1 'set-guard-target-count-range 5 0 0) + (let ((s4-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s4-0 pos quad) (-> s5-0 position quad)) + (quaternion-identity! (-> s4-0 quat)) + (set! (-> s4-0 flags) (task-arrow-flags task-arrow-flag-03)) + (set! (-> s4-0 map-icon) (the-as uint 15)) + (label cfg-21) + (let ((a0-30 (task-arrow-spawn s4-0 (the-as task-arrow self)))) + (when (not a0-30) + (format #t "waiting for task-arrow~%") + (suspend) + (goto cfg-21) + ) + (set! (-> self arrow) (process->handle a0-30)) + ) + ) ) - (set! (-> self sub-state) (the-as uint -1)) - (set! (-> self data-int8 0) 0) - (set! (-> self data-int8 1) 0) - 0 - (none) + (send-event gp-1 'set-target-level #x3f800000) + (send-event gp-1 'set-guard-target-count-range 4 0 1) + (send-event gp-1 'set-guard-target-count-range 5 0 0) ) + (set! (-> self sub-state) (the-as uint -1)) + (set! (-> self data-int8 0) 0) + (set! (-> self data-int8 1) 0) + 0 + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 24 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) + (game-task-node city-krew-delivery-delivery) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) ) ;; definition for function delivery-task-setup-ambush-1 @@ -369,179 +363,100 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 24 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (local-vars (a0-32 float)) - (rlet ((acc :class vf) - (vf0 :class vf) - (vf1 :class vf) - (vf2 :class vf) + (game-task-node city-krew-delivery-delivery) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (local-vars (a0-32 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (handle->process (-> self slave 0)))) + (cond + ((and gp-0 (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead)))) + (cond + ((zero? (-> self data-int8 0)) + (when (= (level-status *level* 'ctyindb) 'active) + (set! (-> self data-int8 0) 1) + (delivery-task-setup-ambush-1) + ) + ) + (else + (when (!= (level-status *level* 'ctyindb) 'active) + (set! (-> self data-int8 0) 0) + 0 + ) + ) ) - (init-vf0-vector) - (let ((gp-0 (handle->process (-> self slave 0)))) - (cond - ((and gp-0 (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead)))) + (cond + ((zero? (-> self data-int8 1)) + (when (= (level-status *level* 'ctyinda) 'active) + (set! (-> self data-int8 1) 1) + (delivery-task-setup-ambush-2) + ) + ) + (else + (when (!= (level-status *level* 'ctyinda) 'active) + (set! (-> self data-int8 1) 0) + 0 + ) + ) + ) + (let ((f0-0 (vector-vector-distance-squared (-> (the-as process-drawable gp-0) root trans) (target-pos 0))) + (f1-0 12288.0) + ) (cond - ((zero? (-> self data-int8 0)) - (when (= (level-status *level* 'ctyindb) 'active) - (set! (-> self data-int8 0) 1) - (delivery-task-setup-ambush-1) + ((and (< f0-0 (* f1-0 f1-0)) *target* (focus-test? *target* pilot)) + (when (nonzero? (-> self sub-state)) + (send-event (handle->process (-> self arrow)) 'set-position (-> self end-pos)) + (send-event (handle->process (-> self arrow)) 'modify-flags 1 0) + (send-event (handle->process (-> self arrow)) 'map-icon 8) + (set! (-> self sub-state) (the-as uint 0)) + 0 ) ) (else - (when (!= (level-status *level* 'ctyindb) 'active) - (set! (-> self data-int8 0) 0) - 0 - ) - ) - ) - (cond - ((zero? (-> self data-int8 1)) - (when (= (level-status *level* 'ctyinda) 'active) - (set! (-> self data-int8 1) 1) - (delivery-task-setup-ambush-2) - ) - ) - (else - (when (!= (level-status *level* 'ctyinda) 'active) - (set! (-> self data-int8 1) 0) - 0 - ) - ) - ) - (let ((f0-0 (vector-vector-distance-squared (-> (the-as process-drawable gp-0) root trans) (target-pos 0))) - (f1-0 12288.0) - ) - (cond - ((and (< f0-0 (* f1-0 f1-0)) *target* (focus-test? *target* pilot)) - (when (nonzero? (-> self sub-state)) - (send-event (handle->process (-> self arrow)) 'set-position (-> self end-pos)) - (send-event (handle->process (-> self arrow)) 'modify-flags 1 0) - (send-event (handle->process (-> self arrow)) 'map-icon 8) - (set! (-> self sub-state) (the-as uint 0)) - 0 - ) - ) - (else - (let* ((v1-59 (new 'stack-no-clear 'inline-array 'vector 1)) - (f0-1 409.6) - (f0-3 (* f0-1 f0-1)) - ) - (.lvf vf1 (&-> (-> (the-as process-drawable gp-0) root transv) quad)) - (.add.w.vf vf2 vf0 vf0 :mask #b1) - (.mul.vf vf1 vf1 vf1) - (.mul.x.vf acc vf2 vf1 :mask #b1) - (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) - (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) - (.mov a0-32 vf1) - (when (>= f0-3 a0-32) - (set! (-> v1-59 0 quad) (-> (the-as process-drawable gp-0) root trans quad)) - (set! (-> v1-59 0 y) (+ -14336.0 (-> v1-59 0 y))) - (send-event (handle->process (-> self arrow)) 'set-position (-> v1-59 0)) - ) - ) - (when (!= (-> self sub-state) 1) - (send-event (handle->process (-> self arrow)) 'modify-flags 0 1) - (send-event (handle->process (-> self arrow)) 'map-icon 15) - (set! (-> self sub-state) (the-as uint 1)) + (let* ((v1-59 (new 'stack-no-clear 'inline-array 'vector 1)) + (f0-1 409.6) + (f0-3 (* f0-1 f0-1)) + ) + (.lvf vf1 (&-> (-> (the-as process-drawable gp-0) root transv) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov a0-32 vf1) + (when (>= f0-3 a0-32) + (set! (-> v1-59 0 quad) (-> (the-as process-drawable gp-0) root trans quad)) + (set! (-> v1-59 0 y) (+ -14336.0 (-> v1-59 0 y))) + (send-event (handle->process (-> self arrow)) 'set-position (-> v1-59 0)) ) ) + (when (!= (-> self sub-state) 1) + (send-event (handle->process (-> self arrow)) 'modify-flags 0 1) + (send-event (handle->process (-> self arrow)) 'map-icon 15) + (set! (-> self sub-state) (the-as uint 1)) + ) ) ) - (let ((f30-0 49152.0) - (f0-6 (vector-vector-distance-squared (-> (the-as process-drawable gp-0) root trans) (-> self end-pos))) - ) - (if (>= (* f30-0 f30-0) f0-6) - (go-virtual complete) - ) - ) ) - (else - (go-virtual fail) - ) + (let ((f30-0 49152.0) + (f0-6 (vector-vector-distance-squared (-> (the-as process-drawable gp-0) root trans) (-> self end-pos))) + ) + (if (>= (* f30-0 f30-0) f0-6) + (go-virtual complete) + ) + ) + ) + (else + (go-virtual fail) ) ) - (none) ) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 24 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (let ((gp-0 (new 'static 'vector :x 4501504.0 :y 73728.0 :z 2338816.0 :w 204800.0)) - (s5-0 #f) - ) - (while (not s5-0) - (let ((v1-1 (handle->process (-> self slave 0)))) - (when v1-1 - (let ((f0-0 (vector-vector-distance-squared (-> (the-as process-drawable v1-1) root trans) gp-0)) - (f1-0 (-> gp-0 w)) - ) - (set! s5-0 (< f0-0 (* f1-0 f1-0))) - ) - ) - ) - (suspend) - ) - ) - (send-event *traffic-manager* 'set-guard-target-count-range 0 0 0) - (send-event *traffic-manager* 'set-guard-target-count-range 1 4 4) - (send-event *traffic-manager* 'set-guard-target-count-range 2 0 0) - (send-event *traffic-manager* 'set-guard-target-count-range 4 0 10) - (send-event *traffic-manager* 'set-guard-target-count-range 5 0 10) - (send-event *traffic-manager* 'set-alert-level 3) - (send-event *traffic-manager* 'set-alert-duration #xa4cb80) - (speech-control-method-10 *speech-control* 7 (new 'static 'speech-type-info - :channel #x1 - :priority -2 - :min-delay #x258 - :max-delay #x4b0 - :list (new 'static 'boxed-array :type string - "kg243a" - "kg241a" - "kg242a" - "kg244a" - "kg245a" - "kg246a" - "kg247a" - "kg248a" - "kg249a" - "kg250a" - "kg251a" - "kg252a" - ) - ) - ) - (talker-spawn-func (-> *talker-speech* 49) *entity-pool* (target-pos 0) (the-as region #f)) - (let ((gp-2 (new 'static 'vector :x 3358720.0 :y 32768.0 :z 4689920.0 :w 204800.0)) - (s5-2 #f) - ) - (while (not s5-2) - (let ((v1-48 (handle->process (-> self slave 0)))) - (when v1-48 - (let ((f0-1 (vector-vector-distance-squared (-> (the-as process-drawable v1-48) root trans) gp-2)) - (f1-3 (-> gp-2 w)) - ) - (set! s5-2 (< f0-1 (* f1-3 f1-3))) - ) - ) - ) - (suspend) - ) - ) - (talker-spawn-func (-> *talker-speech* 50) *entity-pool* (target-pos 0) (the-as region #f)) (none) ) ) @@ -550,21 +465,93 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 24 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *traffic-manager* 'decrease-alert-level 0) - (send-event *traffic-manager* 'set-alert-duration 9000) - (if (and *target* (focus-test? *target* pilot)) - (send-event *target* 'change-mode 'normal) - ) - (set-setting! 'pilot #f 0 0) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (none) - ) + (game-task-node city-krew-delivery-delivery) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (let ((gp-0 (new 'static 'vector :x 4501504.0 :y 73728.0 :z 2338816.0 :w 204800.0)) + (s5-0 #f) ) + (while (not s5-0) + (let ((v1-1 (handle->process (-> self slave 0)))) + (when v1-1 + (let ((f0-0 (vector-vector-distance-squared (-> (the-as process-drawable v1-1) root trans) gp-0)) + (f1-0 (-> gp-0 w)) + ) + (set! s5-0 (< f0-0 (* f1-0 f1-0))) + ) + ) + ) + (suspend) + ) + ) + (send-event *traffic-manager* 'set-guard-target-count-range 0 0 0) + (send-event *traffic-manager* 'set-guard-target-count-range 1 4 4) + (send-event *traffic-manager* 'set-guard-target-count-range 2 0 0) + (send-event *traffic-manager* 'set-guard-target-count-range 4 0 10) + (send-event *traffic-manager* 'set-guard-target-count-range 5 0 10) + (send-event *traffic-manager* 'set-alert-level 3) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (speech-control-method-10 *speech-control* 7 (new 'static 'speech-type-info + :channel #x1 + :priority -2 + :min-delay #x258 + :max-delay #x4b0 + :list (new 'static 'boxed-array :type string + "kg243a" + "kg241a" + "kg242a" + "kg244a" + "kg245a" + "kg246a" + "kg247a" + "kg248a" + "kg249a" + "kg250a" + "kg251a" + "kg252a" + ) + ) + ) + (talker-spawn-func (-> *talker-speech* 49) *entity-pool* (target-pos 0) (the-as region #f)) + (let ((gp-2 (new 'static 'vector :x 3358720.0 :y 32768.0 :z 4689920.0 :w 204800.0)) + (s5-2 #f) + ) + (while (not s5-2) + (let ((v1-48 (handle->process (-> self slave 0)))) + (when v1-48 + (let ((f0-1 (vector-vector-distance-squared (-> (the-as process-drawable v1-48) root trans) gp-2)) + (f1-3 (-> gp-2 w)) + ) + (set! s5-2 (< f0-1 (* f1-3 f1-3))) + ) + ) + ) + (suspend) + ) + ) + (talker-spawn-func (-> *talker-speech* 50) *entity-pool* (target-pos 0) (the-as region #f)) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-krew-delivery-delivery) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'decrease-alert-level 0) + (send-event *traffic-manager* 'set-alert-duration 9000) + (if (and *target* (focus-test? *target* pilot)) + (send-event *target* 'change-mode 'normal) + ) + (set-setting! 'pilot #f 0.0 0) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (none) + ) ) diff --git a/test/decompiler/reference/jak2/levels/city/onin_tent/onin-game_REF.gc b/test/decompiler/reference/jak2/levels/city/onin_tent/onin-game_REF.gc index dd1dde578d..17ffff41c5 100644 --- a/test/decompiler/reference/jak2/levels/city/onin_tent/onin-game_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/onin_tent/onin-game_REF.gc @@ -2538,7 +2538,14 @@ ) :enter (behavior ((arg0 symbol)) (when arg0 - (add-connection *task-manager-engine* self nothing self (-> *game-info* sub-task-list 151) #f) + (add-connection + *task-manager-engine* + self + nothing + self + (-> *game-info* sub-task-list (game-task-node city-play-onin-game-resolution)) + #f + ) (let ((a1-1 (new 'stack-no-clear 'array 'pointer 3))) (set! (-> a1-1 2) (the-as pointer 'onin2)) (set! (-> a1-1 1) (the-as pointer 'onin1)) @@ -2564,18 +2571,18 @@ (talker-speech-class-method-11 (-> *talker-speech* 158)) (talker-speech-class-method-11 (-> *talker-speech* 159)) (talker-speech-class-method-11 (-> *talker-speech* 160)) - (add-setting! 'music 'danger3 0 0) - (set-setting! 'entity-name (res-lump-struct (-> self entity) 'camera-name structure) 0 0) - (set-setting! 'airlock #f 0 0) - (set-setting! 'minimap 'clear 0 128) + (add-setting! 'music 'danger3 0.0 0) + (set-setting! 'entity-name (res-lump-struct (-> self entity) 'camera-name structure) 0.0 0) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self hud-score) (ppointer->handle (process-spawn hud-big-score :init hud-init-by-other :to self))) (set! (-> self hud-goal) (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :to self))) (set! (-> self hud-miss) (ppointer->handle (process-spawn hud-miss :init hud-init-by-other :to self))) (set! (-> self game-start-time) (-> self clock frame-counter)) (send-event *target* 'draw #f) - (set-setting! 'gun #f 0 0) - (set-setting! 'calm #t 0 0) - (set-setting! 'gem #f 0 0) + (set-setting! 'gun #f 0.0 0) + (set-setting! 'calm #t 0.0 0) + (set-setting! 'gem #f 0.0 0) (let ((a0-50 (-> *part-id-table* 3429))) (when a0-50 (let ((v1-110 (get-field-spec-by-id a0-50 (sp-field-id spt-num)))) @@ -2750,7 +2757,7 @@ (set! gp-0 (-> gp-0 0 brother)) ) ) - (let* ((v1-14 (-> *game-info* sub-task-list 151)) + (let* ((v1-14 (-> *game-info* sub-task-list (game-task-node city-play-onin-game-resolution))) (gp-1 (if (-> v1-14 info) (-> v1-14 info manager) (the-as handle #f) @@ -2836,7 +2843,7 @@ (talker-spawn-func (-> *talker-speech* 162) *entity-pool* (target-pos 0) (the-as region #f)) ) ) - (v1-31 (-> *game-info* sub-task-list 151)) + (v1-31 (-> *game-info* sub-task-list (game-task-node city-play-onin-game-resolution))) (gp-4 (if (-> v1-31 info) (-> v1-31 info manager) (the-as handle #f) @@ -2878,7 +2885,7 @@ (the-as pair 0) ) (logior! (-> self skel status) (joint-control-status blend-shape eye-anim)) - (set-setting! 'minimap 'clear 0 128) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self hud-score) (the-as handle #f)) (set! (-> self hud-goal) (the-as handle #f)) (set! (-> self hud-miss) (the-as handle #f)) diff --git a/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc b/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc index c758256275..0500131b51 100644 --- a/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc @@ -4,19 +4,62 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 251 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) - (send-event *target* 'change-mode 'darkjak #f 65) - (set! (-> self sound-id 0) - (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) - ) - (send-event *target* 'get-notify self) - (none) + (game-task-node city-oracle-level0-training) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-oracle-level0-training) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-oracle-level0-training) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if (= (-> arg3 param 1) 16) + (go-virtual complete) + ) + ) + ) + ) ) ) ) @@ -24,383 +67,309 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 251 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *target* 'get-pickup 7 (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) - (send-event *target* 'get-notify #f) - (set-action! - *gui-control* - (gui-action stop) - (-> self sound-id 0) - (gui-channel none) - (gui-action none) - (the-as string #f) - (the-as (function gui-connection symbol) #f) - (the-as process #f) - ) - (close! (-> self node-info) 'event) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 251 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('notify) - (case (-> arg3 param 0) - (('attack) - (if (= (-> arg3 param 1) 16) - (go-virtual complete) - ) - ) - ) - ) - ) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 251 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) - ) - (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) - (let ((gp-1 - (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) - ) + (game-task-node city-oracle-level0-training) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 + (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) ) - (set! (-> gp-1 flags) (font-flags shadow kerning large)) - (let ((v1-14 gp-1)) - (set! (-> v1-14 width) (the float 440)) - ) - (let ((v1-15 gp-1)) - (set! (-> v1-15 height) (the float 80)) - ) - (let ((v1-16 gp-1)) - (set! (-> v1-16 scale) 0.7) - ) - (let ((s5-0 print-game-text)) - (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-bomb) #f)) - (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-bomb) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) ) - (none) ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 253 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) - (send-event *target* 'change-mode 'darkjak #f 65) - (set! (-> self sound-id 0) - (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) - ) - (send-event *target* 'get-notify self) - (none) - ) + (game-task-node city-oracle-level1-training) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 253 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *target* 'get-pickup 7 (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) - (send-event *target* 'get-notify #f) - (set-action! - *gui-control* - (gui-action stop) - (-> self sound-id 0) - (gui-channel none) - (gui-action none) - (the-as string #f) - (the-as (function gui-connection symbol) #f) - (the-as process #f) - ) - (close! (-> self node-info) 'event) - (none) - ) - ) + (game-task-node city-oracle-level1-training) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 253 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('notify) - (case (-> arg3 param 0) - (('attack) - (if (= (-> arg3 param 1) 17) - (go-virtual complete) - ) - ) - ) - ) - ) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 253 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) - ) - (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) - (let ((gp-1 - (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) - ) + (game-task-node city-oracle-level1-training) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if (= (-> arg3 param 1) 17) + (go-virtual complete) + ) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-oracle-level1-training) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 + (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) ) - (set! (-> gp-1 flags) (font-flags shadow kerning large)) - (let ((v1-14 gp-1)) - (set! (-> v1-14 width) (the float 440)) - ) - (let ((v1-15 gp-1)) - (set! (-> v1-15 height) (the float 80)) - ) - (let ((v1-16 gp-1)) - (set! (-> v1-16 scale) 0.7) - ) - (let ((s5-0 print-game-text)) - (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-blast) #f)) - (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-blast) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) ) - (none) ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 255 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) - (send-event *target* 'change-mode 'darkjak #f 65) - (set! (-> self sound-id 0) - (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) - ) - (send-event *target* 'get-notify self) - (set! (-> self start-time) (-> self clock frame-counter)) - (none) - ) + (game-task-node city-oracle-level2-training) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (set! (-> self start-time) (-> self clock frame-counter)) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 255 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *target* 'get-pickup 7 (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) - (send-event *target* 'get-notify #f) - (set-action! - *gui-control* - (gui-action stop) - (-> self sound-id 0) - (gui-channel none) - (gui-action none) - (the-as string #f) - (the-as (function gui-connection symbol) #f) - (the-as process #f) - ) - (close! (-> self node-info) 'event) - (none) - ) - ) + (game-task-node city-oracle-level2-training) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 255 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) - ) - (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) - (let ((gp-1 - (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) - ) + (game-task-node city-oracle-level2-training) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 + (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) ) - (set! (-> gp-1 flags) (font-flags shadow kerning large)) - (let ((v1-14 gp-1)) - (set! (-> v1-14 width) (the float 440)) - ) - (let ((v1-15 gp-1)) - (set! (-> v1-15 height) (the float 80)) - ) - (let ((v1-16 gp-1)) - (set! (-> v1-16 scale) 0.7) - ) - (let ((s5-0 print-game-text)) - (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-invincible) #f)) - (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-invincible) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) ) - (none) ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 257 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) - (send-event *target* 'change-mode 'darkjak #f 65) - (set! (-> self sound-id 0) - (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + (game-task-node city-oracle-level3-training) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-oracle-level3-training) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-oracle-level3-training) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (the-as object (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if (= (-> arg3 param 1) 18) + #f + ) + ) + ) + ) + ) ) - (send-event *target* 'get-notify self) - (none) - ) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 257 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *target* 'get-pickup 7 (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) - (send-event *target* 'get-notify #f) - (set-action! - *gui-control* - (gui-action stop) - (-> self sound-id 0) - (gui-channel none) - (gui-action none) - (the-as string #f) - (the-as (function gui-connection symbol) #f) - (the-as process #f) - ) - (close! (-> self node-info) 'event) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 257 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('notify) - (case (-> arg3 param 0) - (('attack) - (if (= (-> arg3 param 1) 18) - #f - ) - ) - ) - ) - ) - ) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 257 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) - ) - (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) - (let ((gp-1 - (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) - ) + (game-task-node city-oracle-level3-training) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 + (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) ) - (set! (-> gp-1 flags) (font-flags shadow kerning large)) - (let ((v1-14 gp-1)) - (set! (-> v1-14 width) (the float 440)) - ) - (let ((v1-15 gp-1)) - (set! (-> v1-15 height) (the float 80)) - ) - (let ((v1-16 gp-1)) - (set! (-> v1-16 scale) 0.7) - ) - (let ((s5-0 print-game-text)) - (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-giant) #f)) - (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id oracle-tutorial-dark-giant) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) ) ) - (none) ) + (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/port/mines/portrun_REF.gc b/test/decompiler/reference/jak2/levels/city/port/mines/portrun_REF.gc index 5fd3fd280d..3d560eec1b 100644 --- a/test/decompiler/reference/jak2/levels/city/port/mines/portrun_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/port/mines/portrun_REF.gc @@ -235,27 +235,24 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 119 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (while (or (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 30)) - (let ((a0-3 (level-get-target-inside *level*))) - (when (not (and a0-3 (logtest? (-> a0-3 info level-flags) 1))) - (set! (-> self state-time) (-> self clock frame-counter)) - #t - ) + (game-task-node city-port-run-introduction) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (or (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 30)) + (let ((a0-3 (level-get-target-inside *level*))) + (when (not (and a0-3 (logtest? (-> a0-3 info level-flags) 1))) + (set! (-> self state-time) (-> self clock frame-counter)) + #t ) ) - (suspend) - ) - (talker-spawn-func (-> *talker-speech* 93) *entity-pool* (target-pos 0) (the-as region #f)) - (send-event self 'complete) - (none) + ) + (suspend) ) + (talker-spawn-func (-> *talker-speech* 93) *entity-pool* (target-pos 0) (the-as region #f)) + (send-event self 'complete) + (none) ) ) @@ -1632,8 +1629,8 @@ (none) ) :code (behavior () - (set-setting! 'interp-time 'abs 0 0) - (set-setting! 'mode-name 'cam-fixed 0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'mode-name 'cam-fixed 0.0 0) (suspend) (ctyport-cargo-method-30 self) (ja-no-eval :group! (ja-group) @@ -1787,321 +1784,312 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 120 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (if (task-node-closed? (game-task-node city-port-run-resolution)) - (go-virtual complete) + (game-task-node city-port-run-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (if (task-node-closed? (game-task-node city-port-run-resolution)) + (go-virtual complete) + ) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) + (let ((gp-0 *traffic-manager*) + (s5-0 (new 'stack 'traffic-object-spawn-params)) ) - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) - (let ((gp-0 *traffic-manager*) - (s5-0 (new 'stack 'traffic-object-spawn-params)) - ) - (set! (-> s5-0 position quad) (-> self begin-pos quad)) - (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 0.0) - (set! (-> s5-0 object-type) (traffic-type bikec)) - (set! (-> s5-0 behavior) (the-as uint 0)) - (set! (-> s5-0 id) (the-as uint 0)) - (set! (-> s5-0 proc) #f) - (send-event gp-0 'spawn-object s5-0) - ) - (set! (-> self max-count) (-> *city-port-run-cargo-info* length)) - (set! (-> self count) (-> self max-count)) - (set! (-> *game-info* counter) (the float (-> self max-count))) - (dotimes (v1-17 (-> *city-port-run-mine-info* length)) - (set! (-> *city-port-run-mine-info* v1-17 handle) (the-as handle #f)) - ) - (set! (-> self minimap 0) #f) - (dotimes (v1-20 (-> self max-count)) - (set! (-> self data-int32 v1-20) 0) - (set! (-> self slave v1-20) (the-as handle #f)) - ) - (set! (-> self data-int32 20) 0) - (set! (-> self data-int32 21) 0) - (set! (-> self data-int32 22) 0) - 0 - (none) + (set! (-> s5-0 position quad) (-> self begin-pos quad)) + (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 0.0) + (set! (-> s5-0 object-type) (traffic-type bikec)) + (set! (-> s5-0 behavior) (the-as uint 0)) + (set! (-> s5-0 id) (the-as uint 0)) + (set! (-> s5-0 proc) #f) + (send-event gp-0 'spawn-object s5-0) ) + (set! (-> self max-count) (-> *city-port-run-cargo-info* length)) + (set! (-> self count) (-> self max-count)) + (set! (-> *game-info* counter) (the float (-> self max-count))) + (dotimes (v1-17 (-> *city-port-run-mine-info* length)) + (set! (-> *city-port-run-mine-info* v1-17 handle) (the-as handle #f)) + ) + (set! (-> self minimap 0) #f) + (dotimes (v1-20 (-> self max-count)) + (set! (-> self data-int32 v1-20) 0) + (set! (-> self slave v1-20) (the-as handle #f)) + ) + (set! (-> self data-int32 20) 0) + (set! (-> self data-int32 21) 0) + (set! (-> self data-int32 22) 0) + 0 + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 120 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *traffic-manager* 'restore-default-settings) - (dotimes (v1-3 (-> *city-port-run-mine-info* length)) - (set! (-> *city-port-run-mine-info* v1-3 handle) (the-as handle #f)) - ) - (set! (-> self minimap 0) #f) - (dotimes (v1-6 (-> self max-count)) - (set! (-> self data-int32 v1-6) 0) - (set! (-> self slave v1-6) (the-as handle #f)) - ) - (none) - ) - ) + (game-task-node city-port-run-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'restore-default-settings) + (dotimes (v1-3 (-> *city-port-run-mine-info* length)) + (set! (-> *city-port-run-mine-info* v1-3 handle) (the-as handle #f)) + ) + (set! (-> self minimap 0) #f) + (dotimes (v1-6 (-> self max-count)) + (set! (-> self data-int32 v1-6) 0) + (set! (-> self slave v1-6) (the-as handle #f)) + ) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 120 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (task-node-open? (game-task-node city-port-run-resolution)) - (check-time self) - (cond - ((= (level-status *level* 'ctyport) 'active) - (when (zero? (-> self data-int32 21)) - (set! (-> self data-int32 21) 1) - (dotimes (gp-1 (-> *city-port-run-mine-info* length)) - (let ((a1-1 (-> *city-port-run-mine-info* gp-1))) - (if (or (zero? (-> a1-1 handle)) (not (handle->process (-> a1-1 handle)))) - (ctyport-mine-spawn self a1-1) - ) - ) + (game-task-node city-port-run-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (when (task-node-open? (game-task-node city-port-run-resolution)) + (check-time self) + (cond + ((= (level-status *level* 'ctyport) 'active) + (when (zero? (-> self data-int32 21)) + (set! (-> self data-int32 21) 1) + (dotimes (gp-1 (-> *city-port-run-mine-info* length)) + (let ((a1-1 (-> *city-port-run-mine-info* gp-1))) + (if (or (zero? (-> a1-1 handle)) (not (handle->process (-> a1-1 handle)))) + (ctyport-mine-spawn self a1-1) + ) ) ) ) - (else - (dotimes (gp-2 (-> *city-port-run-mine-info* length)) - (let ((s5-0 (-> *city-port-run-mine-info* gp-2))) - (when (and (nonzero? (-> s5-0 handle)) (handle->process (-> s5-0 handle))) - (deactivate (-> s5-0 handle process 0)) - (set! (-> s5-0 handle) (the-as handle #f)) - ) + ) + (else + (dotimes (gp-2 (-> *city-port-run-mine-info* length)) + (let ((s5-0 (-> *city-port-run-mine-info* gp-2))) + (when (and (nonzero? (-> s5-0 handle)) (handle->process (-> s5-0 handle))) + (deactivate (-> s5-0 handle process 0)) + (set! (-> s5-0 handle) (the-as handle #f)) ) ) ) ) - (cond - ((zero? (-> self data-int32 20)) - (cond - ((= (level-status *level* 'ctyport) 'active) - (let ((gp-4 (get-nav-mesh (the-as actor-id #x65e1)))) - (dotimes (s5-1 (-> self max-count)) - (cond - ((zero? (-> self data-int32 s5-1)) - (when (not (-> self slave s5-1)) - (let ((a0-18 (ctyport-cargo-spawn self (-> *city-port-run-cargo-info* s5-1 pos) gp-4))) - (if a0-18 - (set! (-> self slave s5-1) (process->handle a0-18)) - ) - ) + ) + (cond + ((zero? (-> self data-int32 20)) + (cond + ((= (level-status *level* 'ctyport) 'active) + (let ((gp-4 (get-nav-mesh (the-as actor-id #x65e1)))) + (dotimes (s5-1 (-> self max-count)) + (cond + ((zero? (-> self data-int32 s5-1)) + (when (not (-> self slave s5-1)) + (let ((a0-18 (ctyport-cargo-spawn self (-> *city-port-run-cargo-info* s5-1 pos) gp-4))) + (if a0-18 + (set! (-> self slave s5-1) (process->handle a0-18)) + ) ) ) - (else - (set! (-> self slave s5-1) (the-as handle #f)) - ) + ) + (else + (set! (-> self slave s5-1) (the-as handle #f)) ) ) ) - (set! (-> self count) 0) - (dotimes (v1-61 (-> self max-count)) - (if (or (not (-> self slave v1-61)) (handle->process (-> self slave v1-61))) - (+! (-> self count) 1) - (set! (-> self data-int32 v1-61) 1) - ) - ) - (when (-> self minimap 0) - (logior! (-> self minimap 0 flags) (minimap-flag fade-out)) - (set! (-> self minimap 0) #f) - ) ) - (else - (dotimes (gp-5 (-> self max-count)) - (when (-> self slave gp-5) - (deactivate (-> self slave gp-5 process 0)) - (set! (-> self slave gp-5) (the-as handle #f)) - ) - ) - (set! (-> self data-int32 21) 0) - (if (not (-> self minimap 0)) - (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 15) (the-as int #f) *city-port-position* 0)) - ) - ) - ) - ) - (else (set! (-> self count) 0) - (dotimes (v1-90 (-> self max-count)) - (if (handle->process (-> self slave v1-90)) + (dotimes (v1-61 (-> self max-count)) + (if (or (not (-> self slave v1-61)) (handle->process (-> self slave v1-61))) (+! (-> self count) 1) - (set! (-> self data-int32 v1-90) 1) + (set! (-> self data-int32 v1-61) 1) ) ) - ) - ) - (let ((v1-93 0)) - (dotimes (a0-48 (-> *city-port-run-mine-info* length)) - (let ((a1-21 (-> *city-port-run-mine-info* a0-48))) - (if (and (nonzero? (-> a1-21 handle)) (handle->process (-> a1-21 handle))) - (+! v1-93 1) - ) + (when (-> self minimap 0) + (logior! (-> self minimap 0 flags) (minimap-flag fade-out)) + (set! (-> self minimap 0) #f) ) ) - ) - (cond - ((and (= (-> self count) (-> self max-count)) (zero? (-> self data-int32 22))) - (set! (-> self state-time) (-> self clock frame-counter)) - ) - ((and (or (and (zero? (-> self data-int32 20)) (= (-> self count) (+ (-> self max-count) -1))) - (= (-> self data-int32 22) 1) - ) - (task-node-open? (game-task-node city-port-run-resolution)) - ) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set! (-> self data-int32 20) 1) - (+! (-> self data-int32 22) 1) - (set! (-> self time-limit) (seconds 135)) - (set! (-> self start-time) (-> self clock frame-counter)) - (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-cargo :init hud-init-by-other :to self))) - ) - ) - (set! (-> *game-info* counter) (the float (-> self count))) - (when (= (-> self data-int32 20) 1) - (let ((v1-130 (level-get *level* 'ctyport))) - (when (or (not v1-130) (!= (-> v1-130 display?) 'display)) - (backup-load-state-and-set-cmds *load-state* '()) - (script-eval '(want-display 'ctyport 'display)) - (restore-load-state-and-cleanup *load-state*) - (go-virtual fail) - ) - ) - ) - ) - (when (zero? (-> self count)) - (cond - ((not (task-node-closed? (game-task-node city-port-run-resolution))) - (talker-spawn-func (-> *talker-speech* 94) *entity-pool* (target-pos 0) (the-as region #f)) - (task-node-close! (game-task-node city-port-run-resolution)) - (send-event (handle->process (-> self hud-timer)) 'hide-and-die) - (send-event (handle->process (-> self hud-counter)) 'hide-and-die) - (set! (-> self fail-on-death?) #f) - (dotimes (gp-8 (-> *city-port-run-mine-info* length)) - (let ((v1-161 (-> *city-port-run-mine-info* gp-8))) - (if (handle->process (-> v1-161 handle)) - (send-event (handle->process (-> v1-161 handle)) 'fall) - ) + (else + (dotimes (gp-5 (-> self max-count)) + (when (-> self slave gp-5) + (deactivate (-> self slave gp-5 process 0)) + (set! (-> self slave gp-5) (the-as handle #f)) + ) ) + (set! (-> self data-int32 21) 0) + (if (not (-> self minimap 0)) + (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 15) (the-as int #f) *city-port-position* 0)) + ) ) ) - (else - (let ((v1-168 0)) - (dotimes (a0-96 (-> *city-port-run-mine-info* length)) - (if (handle->process (-> *city-port-run-mine-info* a0-96 handle)) - (+! v1-168 1) - ) + ) + (else + (set! (-> self count) 0) + (dotimes (v1-90 (-> self max-count)) + (if (handle->process (-> self slave v1-90)) + (+! (-> self count) 1) + (set! (-> self data-int32 v1-90) 1) ) - (if (zero? v1-168) - (go-virtual complete) - ) - ) ) ) ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! *game-info* 120 6 (the-as (function object) (lambda :behavior task-manager - ((arg0 object) (arg1 object) (arg2 symbol)) - (case arg2 - (('mine-dead) - (format #t "mine-dead~%") - (+! (-> self data-int32 22) 1) - ) - ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 120 - 3 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *traffic-manager* 'set-target-level #x3f800000) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) - (suspend) - ) - (send-event *traffic-manager* 'set-alert-level 1) - (send-event *traffic-manager* 'set-alert-duration #xa4cb80) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 120 - 5 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (< (- (-> self time-limit) (- (-> self clock frame-counter) (-> self start-time))) 0) - (let ((gp-0 #f)) - (dotimes (s5-0 (-> self max-count)) - (when (zero? (-> self data-int32 s5-0)) - (when (-> self slave s5-0) - (let* ((s3-0 (handle->process (-> self slave s5-0))) - (s4-0 (if (type? s3-0 process-focusable) - s3-0 - ) - ) - ) - (when (not gp-0) - (set! gp-0 #t) - (send-event s4-0 'focus-camera) - ) - (send-event s4-0 'spy) - ) + (let ((v1-93 0)) + (dotimes (a0-48 (-> *city-port-run-mine-info* length)) + (let ((a1-21 (-> *city-port-run-mine-info* a0-48))) + (if (and (nonzero? (-> a1-21 handle)) (handle->process (-> a1-21 handle))) + (+! v1-93 1) ) - ) - ) - ) - (let ((gp-1 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-1) (seconds 2)) - (suspend) ) ) ) - (none) + (cond + ((and (= (-> self count) (-> self max-count)) (zero? (-> self data-int32 22))) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + ((and (or (and (zero? (-> self data-int32 20)) (= (-> self count) (+ (-> self max-count) -1))) + (= (-> self data-int32 22) 1) + ) + (task-node-open? (game-task-node city-port-run-resolution)) + ) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self data-int32 20) 1) + (+! (-> self data-int32 22) 1) + (set! (-> self time-limit) (seconds 135)) + (set! (-> self start-time) (-> self clock frame-counter)) + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-cargo :init hud-init-by-other :to self))) + ) + ) + (set! (-> *game-info* counter) (the float (-> self count))) + (when (= (-> self data-int32 20) 1) + (let ((v1-130 (level-get *level* 'ctyport))) + (when (or (not v1-130) (!= (-> v1-130 display?) 'display)) + (backup-load-state-and-set-cmds *load-state* '()) + (script-eval '(want-display 'ctyport 'display)) + (restore-load-state-and-cleanup *load-state*) + (go-virtual fail) + ) + ) + ) ) + (when (zero? (-> self count)) + (cond + ((not (task-node-closed? (game-task-node city-port-run-resolution))) + (talker-spawn-func (-> *talker-speech* 94) *entity-pool* (target-pos 0) (the-as region #f)) + (task-node-close! (game-task-node city-port-run-resolution)) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (set! (-> self fail-on-death?) #f) + (dotimes (gp-8 (-> *city-port-run-mine-info* length)) + (let ((v1-161 (-> *city-port-run-mine-info* gp-8))) + (if (handle->process (-> v1-161 handle)) + (send-event (handle->process (-> v1-161 handle)) 'fall) + ) + ) + ) + ) + (else + (let ((v1-168 0)) + (dotimes (a0-96 (-> *city-port-run-mine-info* length)) + (if (handle->process (-> *city-port-run-mine-info* a0-96 handle)) + (+! v1-168 1) + ) + ) + (if (zero? v1-168) + (go-virtual complete) + ) + ) + ) + ) + ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 120 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) - (suspend) - ) - (task-node-close! (game-task-node city-port-run-post-win)) - (none) - ) - ) + (game-task-node city-port-run-resolution) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 object) (arg1 object) (arg2 symbol)) + (case arg2 + (('mine-dead) + (format #t "mine-dead~%") + (+! (-> self data-int32 22) 1) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-port-run-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'set-target-level #x3f800000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (send-event *traffic-manager* 'set-alert-level 1) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-port-run-resolution) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager + () + (when (< (- (-> self time-limit) (- (-> self clock frame-counter) (-> self start-time))) 0) + (let ((gp-0 #f)) + (dotimes (s5-0 (-> self max-count)) + (when (zero? (-> self data-int32 s5-0)) + (when (-> self slave s5-0) + (let* ((s3-0 (handle->process (-> self slave s5-0))) + (s4-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when (not gp-0) + (set! gp-0 #t) + (send-event s4-0 'focus-camera) + ) + (send-event s4-0 'spy) + ) + ) + ) + ) + ) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 2)) + (suspend) + ) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-port-run-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (suspend) + ) + (task-node-close! (game-task-node city-port-run-post-win)) + (none) + ) ) diff --git a/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc b/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc index 79dd25d2a2..95e34b688d 100644 --- a/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc @@ -1247,90 +1247,81 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 189 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (let ((gp-0 *traffic-manager*)) - (send-event gp-0 'set-target-level #x3e800000) - (send-event gp-0 'set-guard-target-count-range 0 0 0) - (send-event gp-0 'set-guard-target-count-range 1 0 0) - (send-event gp-0 'set-guard-target-count-range 2 0 0) - (send-event gp-0 'set-guard-target-count-range 3 0 0) - (send-event gp-0 'set-guard-target-count-range 4 0 1) - (send-event gp-0 'set-guard-target-count-range 5 0 0) - ) - (until (= (level-status *level* 'ctyport) 'active) - (suspend) - ) - (let ((v1-43 (entity-by-name "parking-spot-20"))) - (if v1-43 - (logior! (-> v1-43 extra perm status) (entity-perm-status bit-9)) - ) - ) - (set! (-> self start-time) 0) - (set! (-> self sub-state) (the-as uint 0)) - (set! (-> self count) 0) - (set! (-> self max-count) -1) - (race-start (-> self info index) (the-as symbol self) #f) - (set! (-> self begin-pos quad) - (-> (new 'static 'vector :x -326041.6 :y 36454.4 :z 5391565.0 :w 266240.0) quad) - ) - (set-setting! 'attack #f 0 0) - (set-setting! 'board #f 0 0) - (set-setting! 'gun #f 0 0) - (set-setting! 'vehicle-hijacking #f 0 0) - (none) + (game-task-node city-errol-challenge-race) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-target-level #x3e800000) + (send-event gp-0 'set-guard-target-count-range 0 0 0) + (send-event gp-0 'set-guard-target-count-range 1 0 0) + (send-event gp-0 'set-guard-target-count-range 2 0 0) + (send-event gp-0 'set-guard-target-count-range 3 0 0) + (send-event gp-0 'set-guard-target-count-range 4 0 1) + (send-event gp-0 'set-guard-target-count-range 5 0 0) ) + (until (= (level-status *level* 'ctyport) 'active) + (suspend) + ) + (let ((v1-43 (entity-by-name "parking-spot-20"))) + (if v1-43 + (logior! (-> v1-43 extra perm status) (entity-perm-status bit-9)) + ) + ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self count) 0) + (set! (-> self max-count) -1) + (race-start (-> self info index) (the-as symbol self) #f) + (set! (-> self begin-pos quad) + (-> (new 'static 'vector :x -326041.6 :y 36454.4 :z 5391565.0 :w 266240.0) quad) + ) + (set-setting! 'attack #f 0.0 0) + (set-setting! 'board #f 0.0 0) + (set-setting! 'gun #f 0.0 0) + (set-setting! 'vehicle-hijacking #f 0.0 0) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 189 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) + (game-task-node city-errol-challenge-race) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 189 - 6 - (the-as - (function object) - (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('turbo-ring-pickup) - (let ((gp-0 (-> arg3 param 0))) - (format #t "player collected ring ~d~%" gp-0) - (cond - ((= gp-0 (-> self sub-state)) - (let ((v0-0 (the-as object (+ (-> self sub-state) 1)))) - (set! (-> self sub-state) (the-as uint v0-0)) - v0-0 - ) + (game-task-node city-errol-challenge-race) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('turbo-ring-pickup) + (let ((gp-0 (-> arg3 param 0))) + (format #t "player collected ring ~d~%" gp-0) + (cond + ((= gp-0 (-> self sub-state)) + (let ((v0-0 (the-as object (+ (-> self sub-state) 1)))) + (set! (-> self sub-state) (the-as uint v0-0)) + v0-0 ) - ((< (the-as int gp-0) (the-as int (-> self sub-state))) - (format #t "player re-collecting an earlier ring (~d)~%" gp-0) - ) - (else - (format #t "missed a ring (ring-id ~d, sub-state ~d)~%" gp-0 (-> self sub-state)) - (go-virtual fail) - ) + ) + ((< (the-as int gp-0) (the-as int (-> self sub-state))) + (format #t "player re-collecting an earlier ring (~d)~%" gp-0) + ) + (else + (format #t "missed a ring (ring-id ~d, sub-state ~d)~%" gp-0 (-> self sub-state)) + (go-virtual fail) ) ) ) - ) + ) ) ) ) @@ -1338,88 +1329,87 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 189 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 1)) - (s5-0 *city-errol-challenge-rings*) - ) - (if (= (-> self max-count) -1) - (set! (-> self max-count) (-> s5-0 length)) - ) - (set! (-> gp-0 0 quad) (-> (target-pos 0) quad)) - (let* ((s4-1 (new 'static 'vector :x 1305804.8 :y 102400.0 :z 3180544.0 :w 163840.0)) - (f0-0 (vector-vector-distance-squared s4-1 (-> gp-0 0))) - (f1-0 (-> s4-1 w)) - ) - (when (< f0-0 (* f1-0 f1-0)) - (if (< (-> self count) 18) - (go-virtual fail) - ) - ) + (game-task-node city-errol-challenge-race) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 1)) + (s5-0 *city-errol-challenge-rings*) ) - (while (< (-> self count) (-> self max-count)) - (let ((s4-2 (-> s5-0 (-> self count)))) - (let ((f0-1 (-> s4-2 dist))) - (b! (< (* f0-1 f0-1) (vector-vector-distance-squared (-> gp-0 0) (-> s4-2 pos))) cfg-11) - ) - (if (turbo-ring-spawn self s4-2 (-> self count) #f) - (+! (-> self count) 1) - ) - ) + (if (= (-> self max-count) -1) + (set! (-> self max-count) (-> s5-0 length)) ) - ) - (label cfg-11) - 0 - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 189 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (while (not (logtest? (-> *race-state* flags) 1)) - (let ((f0-0 (-> self begin-pos w))) - (if (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))) + (set! (-> gp-0 0 quad) (-> (target-pos 0) quad)) + (let* ((s4-1 (new 'static 'vector :x 1305804.8 :y 102400.0 :z 3180544.0 :w 163840.0)) + (f0-0 (vector-vector-distance-squared s4-1 (-> gp-0 0))) + (f1-0 (-> s4-1 w)) + ) + (when (< f0-0 (* f1-0 f1-0)) + (if (< (-> self count) 18) (go-virtual fail) ) ) - (suspend) ) - (set-setting! 'exclusive-load 'lerlchal 0 0) - (set-setting! 'airlock #f 0 0) - (none) + (while (< (-> self count) (-> self max-count)) + (let ((s4-2 (-> s5-0 (-> self count)))) + (let ((f0-1 (-> s4-2 dist))) + (b! (< (* f0-1 f0-1) (vector-vector-distance-squared (-> gp-0 0) (-> s4-2 pos))) cfg-11) + ) + (if (turbo-ring-spawn self s4-2 (-> self count) #f) + (+! (-> self count) 1) + ) + ) + ) ) + (label cfg-11) + 0 + (none) ) ) -;; failed to figure out what this is: -(set-subtask-hook! *game-info* 189 5 (the-as (function object) (lambda :behavior task-manager () (none)))) - ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 189 - 4 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'decrease-alert-level 0) (none)) + (game-task-node city-errol-challenge-race) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (not (logtest? (-> *race-state* flags) 1)) + (let ((f0-0 (-> self begin-pos w))) + (if (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))) + (go-virtual fail) + ) + ) + (suspend) + ) + (set-setting! 'exclusive-load 'lerlchal 0.0 0) + (set-setting! 'airlock #f 0.0 0) + (none) ) ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 307) (-> *game-info* sub-task-list 189)) +(set-subtask-hook! + *game-info* + (game-task-node city-errol-challenge-race) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager () (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-errol-challenge-race) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'decrease-alert-level 0) (none)) + ) + +;; failed to figure out what this is: +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-race-errol-resolution)) + (-> *game-info* sub-task-list (game-task-node city-errol-challenge-race)) + ) ;; definition for symbol *city-bush-port-rings*, type (array city-race-ring-info) (define *city-bush-port-rings* (new 'static 'boxed-array :type city-race-ring-info @@ -1504,153 +1494,144 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 309 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set-setting! 'exclusive-load 'lprtrace 0 0) - (set-setting! 'airlock #f 0 0) - (let ((gp-0 *traffic-manager*)) - (send-event gp-0 'set-target-level #x3e800000) - (send-event gp-0 'set-guard-target-count-range 0 0 0) - (send-event gp-0 'set-guard-target-count-range 1 0 0) - (send-event gp-0 'set-guard-target-count-range 2 0 0) - (send-event gp-0 'set-guard-target-count-range 3 0 0) - (send-event gp-0 'set-guard-target-count-range 4 0 1) - (send-event gp-0 'set-guard-target-count-range 5 0 0) - ) - (until (= (level-status *level* 'ctyport) 'active) - (suspend) - ) - (let ((v1-47 (entity-by-name "parking-spot-22"))) - (if v1-47 - (logior! (-> v1-47 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-49 (entity-by-name "parking-spot-23"))) - (if v1-49 - (logior! (-> v1-49 extra perm status) (entity-perm-status bit-9)) - ) - ) - (set! (-> self start-time) 0) - (set! (-> self sub-state) (the-as uint 0)) - (set! (-> self count) 0) - (let ((gp-2 *city-bush-port-rings*)) - (set! (-> self max-count) (-> gp-2 length)) - (dotimes (s5-0 (-> self max-count)) - (let ((a1-12 (-> gp-2 s5-0))) - (if (turbo-ring-spawn self a1-12 s5-0 #t) - (+! (-> self count) 1) - ) - ) - ) - ) - (race-start (-> self info index) (the-as symbol self) #f) - (set! (-> self begin-pos quad) - (-> (new 'static 'vector :x 2519040.0 :y 40960.0 :z 6545408.0 :w 184320.0) quad) - ) - (set-setting! 'attack #f 0 0) - (set-setting! 'board #f 0 0) - (set-setting! 'gun #f 0 0) - (set-setting! 'vehicle-hijacking #f 0 0) - (none) + (game-task-node city-burning-bush-race-port-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set-setting! 'exclusive-load 'lprtrace 0.0 0) + (set-setting! 'airlock #f 0.0 0) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-target-level #x3e800000) + (send-event gp-0 'set-guard-target-count-range 0 0 0) + (send-event gp-0 'set-guard-target-count-range 1 0 0) + (send-event gp-0 'set-guard-target-count-range 2 0 0) + (send-event gp-0 'set-guard-target-count-range 3 0 0) + (send-event gp-0 'set-guard-target-count-range 4 0 1) + (send-event gp-0 'set-guard-target-count-range 5 0 0) ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 309 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 309 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (case arg2 - (('race-win 'race-lose) - (let ((v0-0 1)) - (set! (-> self sub-state) (the-as uint v0-0)) - v0-0 - ) - ) - ) - ) - ) + (until (= (level-status *level* 'ctyport) 'active) + (suspend) + ) + (let ((v1-47 (entity-by-name "parking-spot-22"))) + (if v1-47 + (logior! (-> v1-47 extra perm status) (entity-perm-status bit-9)) ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 309 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (while (not (logtest? (-> *race-state* flags) 1)) - (let ((f0-0 (-> self begin-pos w))) - (if (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))) - (go-virtual fail) + ) + (let ((v1-49 (entity-by-name "parking-spot-23"))) + (if v1-49 + (logior! (-> v1-49 extra perm status) (entity-perm-status bit-9)) + ) + ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self count) 0) + (let ((gp-2 *city-bush-port-rings*)) + (set! (-> self max-count) (-> gp-2 length)) + (dotimes (s5-0 (-> self max-count)) + (let ((a1-12 (-> gp-2 s5-0))) + (if (turbo-ring-spawn self a1-12 s5-0 #t) + (+! (-> self count) 1) ) ) - (suspend) ) - (none) ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 309 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (when (zero? (-> self sub-state)) - (let ((v1-2 (-> *target* pilot))) - (when (nonzero? v1-2) - (let ((v1-4 (handle->process (-> v1-2 vehicle)))) - (when v1-4 - (if (< (-> (the-as process-drawable v1-4) root trans y) 16384.0) - (go-virtual fail) - ) - ) - ) - ) - ) - ) - (none) - ) + (race-start (-> self info index) (the-as symbol self) #f) + (set! (-> self begin-pos quad) + (-> (new 'static 'vector :x 2519040.0 :y 40960.0 :z 6545408.0 :w 184320.0) quad) ) + (set-setting! 'attack #f 0.0 0) + (set-setting! 'board #f 0.0 0) + (set-setting! 'gun #f 0.0 0) + (set-setting! 'vehicle-hijacking #f 0.0 0) + (none) + ) ) -;; failed to figure out what this is: -(set-subtask-hook! *game-info* 309 5 (the-as (function object) (lambda :behavior task-manager () (none)))) - ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 309 - 4 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'decrease-alert-level 0) (none)) + (game-task-node city-burning-bush-race-port-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-race-port-resolution) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (the-as object (case arg2 + (('race-win 'race-lose) + (let ((v0-0 1)) + (set! (-> self sub-state) (the-as uint v0-0)) + v0-0 + ) + ) + ) + ) ) ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-race-port-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (not (logtest? (-> *race-state* flags) 1)) + (let ((f0-0 (-> self begin-pos w))) + (if (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))) + (go-virtual fail) + ) + ) + (suspend) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-race-port-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (when (zero? (-> self sub-state)) + (let ((v1-2 (-> *target* pilot))) + (when (nonzero? v1-2) + (let ((v1-4 (handle->process (-> v1-2 vehicle)))) + (when v1-4 + (if (< (-> (the-as process-drawable v1-4) root trans y) 16384.0) + (go-virtual fail) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-race-port-resolution) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager () (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-race-port-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'decrease-alert-level 0) (none)) + ) diff --git a/test/decompiler/reference/jak2/levels/city/side_missions/ctywide-bbush_REF.gc b/test/decompiler/reference/jak2/levels/city/side_missions/ctywide-bbush_REF.gc index 1ad90b961b..4da5400b4e 100644 --- a/test/decompiler/reference/jak2/levels/city/side_missions/ctywide-bbush_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/side_missions/ctywide-bbush_REF.gc @@ -1481,125 +1481,121 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 259 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set-setting! 'airlock #f 0 0) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (let ((s5-0 *traffic-manager*) - (gp-0 (new 'stack 'traffic-object-spawn-params)) - ) - (set! (-> gp-0 position quad) (-> *bb-ring-info* (-> self info index) start-pos quad)) - (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 (-> *bb-ring-info* (-> self info index) rotation)) - (set! (-> gp-0 object-type) (traffic-type bikea)) - (set! (-> gp-0 behavior) (the-as uint 0)) - (set! (-> gp-0 id) (the-as uint 0)) - (set! (-> gp-0 proc) #f) - (send-event s5-0 'spawn-object gp-0) - (if (-> gp-0 proc) - (set! (-> self slave 1) (process->handle (-> gp-0 proc))) - ) - ) - (set! (-> self start-time) 0) - (set! (-> self sub-state) (the-as uint 0)) - (set! (-> self count) 0) - (set! (-> self max-count) (-> *bb-ring-info* (-> self info index) rings length)) - (none) + (game-task-node city-burning-bush-ring-1-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (let ((s5-0 *traffic-manager*) + (gp-0 (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> gp-0 position quad) (-> *bb-ring-info* (-> self info index) start-pos quad)) + (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 (-> *bb-ring-info* (-> self info index) rotation)) + (set! (-> gp-0 object-type) (traffic-type bikea)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 proc) #f) + (send-event s5-0 'spawn-object gp-0) + (if (-> gp-0 proc) + (set! (-> self slave 1) (process->handle (-> gp-0 proc))) + ) ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self count) 0) + (set! (-> self max-count) (-> *bb-ring-info* (-> self info index) rings length)) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 259 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) + (game-task-node city-burning-bush-ring-1-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 259 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (check-time self) - (cond - ((and (handle->process (-> self slave 0)) - (-> self slave 0 process 0 next-state) - (= (-> self slave 0 process 0 next-state name) 'idle) - ) - ) - (else - (let ((v1-15 (-> self sub-state))) - (cond - ((< v1-15 (the-as uint (-> self max-count))) - (let* ((a1-2 (-> *bb-ring-info* (-> self info index) rings v1-15)) - (a0-14 (race-ring-spawn self a1-2)) - ) - (when a0-14 - (set! (-> self slave 0) (process->handle a0-14)) - (set! (-> self time-limit) (the-as time-frame (if (zero? (-> self sub-state)) - 4500 - (the-as int (-> *bb-ring-info* (-> self info index) time)) - ) - ) - ) - (set! (-> self start-time) (-> self clock frame-counter)) - (+! (-> self sub-state) 1) - ) + (game-task-node city-burning-bush-ring-1-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (check-time self) + (cond + ((and (handle->process (-> self slave 0)) + (-> self slave 0 process 0 next-state) + (= (-> self slave 0 process 0 next-state name) 'idle) + ) + ) + (else + (let ((v1-15 (-> self sub-state))) + (cond + ((< v1-15 (the-as uint (-> self max-count))) + (let* ((a1-2 (-> *bb-ring-info* (-> self info index) rings v1-15)) + (a0-14 (race-ring-spawn self a1-2)) + ) + (when a0-14 + (set! (-> self slave 0) (process->handle a0-14)) + (set! (-> self time-limit) (the-as time-frame (if (zero? (-> self sub-state)) + 4500 + (the-as int (-> *bb-ring-info* (-> self info index) time)) + ) + ) + ) + (set! (-> self start-time) (-> self clock frame-counter)) + (+! (-> self sub-state) 1) ) ) - (else - (go-virtual complete) - ) + ) + (else + (go-virtual complete) ) ) ) ) - (none) ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 259 - 3 - (the-as (function object) (lambda :behavior task-manager - () - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) - (suspend) - ) - (none) - ) - ) + (game-task-node city-burning-bush-ring-1-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 259 - 4 - (the-as (function object) (lambda :behavior task-manager () (close! (-> self node-info) 'event) (none))) + (game-task-node city-burning-bush-ring-1-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager () (close! (-> self node-info) 'event) (none)) ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 273) (-> *game-info* sub-task-list 259)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-ring-2-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-ring-1-resolution)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 293) (-> *game-info* sub-task-list 259)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-ring-3-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-ring-1-resolution)) + ) ;; failed to figure out what this is: (defpartgroup group-bush-collect @@ -2663,184 +2659,178 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 269 - 1 - (the-as - (function object) - (lambda :behavior task-manager - () - (let ((v1-4 (-> *bb-collection-info* (-> self info index)))) - (dotimes (a0-1 (-> v1-4 colls length)) - (when (and (-> v1-4 colls a0-1 minimap) (nonzero? (-> v1-4 colls a0-1 minimap))) - (logior! (-> v1-4 colls a0-1 minimap flags) (minimap-flag fade-out)) - (set! (-> v1-4 colls a0-1 minimap) #f) - ) + (game-task-node city-burning-bush-collection-1-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (let ((v1-4 (-> *bb-collection-info* (-> self info index)))) + (dotimes (a0-1 (-> v1-4 colls length)) + (when (and (-> v1-4 colls a0-1 minimap) (nonzero? (-> v1-4 colls a0-1 minimap))) + (logior! (-> v1-4 colls a0-1 minimap flags) (minimap-flag fade-out)) + (set! (-> v1-4 colls a0-1 minimap) #f) ) ) - (none) ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 269 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'airlock #f 0 0) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (let ((gp-0 (-> *bb-collection-info* (-> self info index)))) - (let ((v1-9 (-> gp-0 user-data))) - (cond - ((zero? v1-9) - (set! (-> self hud-counter) - (ppointer->handle (process-spawn hud-homing-beacon :init hud-init-by-other :to *target*)) - ) - ) - ((= v1-9 1) - (set! (-> self hud-counter) - (ppointer->handle (process-spawn hud-dark-eco-pickup :init hud-init-by-other :to *target*)) - ) - ) - ((= v1-9 2) - (set! (-> self hud-counter) - (ppointer->handle (process-spawn hud-green-eco-pickup :init hud-init-by-other :to *target*)) - ) - ) - ) + (game-task-node city-burning-bush-collection-1-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (let ((gp-0 (-> *bb-collection-info* (-> self info index)))) + (let ((v1-9 (-> gp-0 user-data))) + (cond + ((zero? v1-9) + (set! (-> self hud-counter) + (ppointer->handle (process-spawn hud-homing-beacon :init hud-init-by-other :to *target*)) + ) + ) + ((= v1-9 1) + (set! (-> self hud-counter) + (ppointer->handle (process-spawn hud-dark-eco-pickup :init hud-init-by-other :to *target*)) + ) + ) + ((= v1-9 2) + (set! (-> self hud-counter) + (ppointer->handle (process-spawn hud-green-eco-pickup :init hud-init-by-other :to *target*)) + ) + ) ) - (dotimes (s5-3 (-> gp-0 colls length)) - (let ((v1-32 (-> gp-0 user-data))) - (cond - ((zero? v1-32) + ) + (dotimes (s5-3 (-> gp-0 colls length)) + (let ((v1-32 (-> gp-0 user-data))) + (cond + ((zero? v1-32) + (set! (-> gp-0 colls s5-3 handle) + (ppointer->handle (bush-collect-homing-beacon-spawn self (-> gp-0 colls s5-3 pos))) + ) + (set! (-> gp-0 colls s5-3 minimap) (add-icon! + *minimap* + (handle->process (-> gp-0 colls s5-3 handle)) + (the-as uint 16) + (the-as int #f) + (the-as vector #t) + 0 + ) + ) + ) + ((= v1-32 1) + (let ((t1-3 (new 'stack 'fact-info self (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc))) + ) + (new 'stack-no-clear 'vector) + (set! (-> t1-3 options) (logior (actor-option fade-out no-distance-check-fadeout) (-> t1-3 options))) + (set! (-> t1-3 fade-time) (-> gp-0 time)) (set! (-> gp-0 colls s5-3 handle) - (ppointer->handle (bush-collect-homing-beacon-spawn self (-> gp-0 colls s5-3 pos))) - ) - (set! (-> gp-0 colls s5-3 minimap) (add-icon! - *minimap* - (handle->process (-> gp-0 colls s5-3 handle)) - (the-as uint 16) - (the-as int #f) - (the-as vector #t) - 0 - ) - ) - ) - ((= v1-32 1) - (let ((t1-3 (new 'stack 'fact-info self (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc))) - ) - (new 'stack-no-clear 'vector) - (set! (-> t1-3 options) (logior (actor-option fade-out no-distance-check-fadeout) (-> t1-3 options))) - (set! (-> t1-3 fade-time) (-> gp-0 time)) - (set! (-> gp-0 colls s5-3 handle) - (ppointer->handle - (birth-pickup-at-point (-> gp-0 colls s5-3 pos) (pickup-type eco-pill-dark) 1.0 #t self t1-3) - ) + (ppointer->handle + (birth-pickup-at-point (-> gp-0 colls s5-3 pos) (pickup-type eco-pill-dark) 1.0 #t self t1-3) ) - ) - (set! (-> gp-0 colls s5-3 minimap) (add-icon! - *minimap* - (handle->process (-> gp-0 colls s5-3 handle)) - (the-as uint 16) - (the-as int #f) - (the-as vector #t) - 0 - ) ) ) - ((= v1-32 2) - (let ((t1-5 (new 'stack 'fact-info self (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc))) - ) - (new 'stack-no-clear 'vector) - (set! (-> t1-5 options) (logior (actor-option fade-out no-distance-check-fadeout) (-> t1-5 options))) - (set! (-> t1-5 fade-time) (-> gp-0 time)) - (set! (-> gp-0 colls s5-3 handle) - (ppointer->handle - (birth-pickup-at-point (-> gp-0 colls s5-3 pos) (pickup-type eco-pill-green) 1.0 #t self t1-5) - ) + (set! (-> gp-0 colls s5-3 minimap) (add-icon! + *minimap* + (handle->process (-> gp-0 colls s5-3 handle)) + (the-as uint 16) + (the-as int #f) + (the-as vector #t) + 0 + ) + ) + ) + ((= v1-32 2) + (let ((t1-5 (new 'stack 'fact-info self (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc))) + ) + (new 'stack-no-clear 'vector) + (set! (-> t1-5 options) (logior (actor-option fade-out no-distance-check-fadeout) (-> t1-5 options))) + (set! (-> t1-5 fade-time) (-> gp-0 time)) + (set! (-> gp-0 colls s5-3 handle) + (ppointer->handle + (birth-pickup-at-point (-> gp-0 colls s5-3 pos) (pickup-type eco-pill-green) 1.0 #t self t1-5) ) - ) - (set! (-> gp-0 colls s5-3 minimap) (add-icon! - *minimap* - (handle->process (-> gp-0 colls s5-3 handle)) - (the-as uint 16) - (the-as int #f) - (the-as vector #t) - 0 - ) ) ) - (else - (set! (-> gp-0 colls s5-3 handle) (ppointer->handle (bush-collect-spawn self (-> gp-0 colls s5-3 pos)))) - (set! (-> gp-0 colls s5-3 minimap) #f) - ) - ) - ) - ) - (set! (-> self start-time) (-> self clock frame-counter)) - (set! (-> self time-limit) (-> gp-0 time)) - ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 269 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (check-time self) - (let ((a0-2 (-> *bb-collection-info* (-> self info index))) - (v1-6 0) - ) - (dotimes (a1-0 (-> a0-2 colls length)) - (cond - ((and (nonzero? (-> a0-2 colls a1-0 handle)) (handle->process (-> a0-2 colls a1-0 handle))) - (+! v1-6 1) + (set! (-> gp-0 colls s5-3 minimap) (add-icon! + *minimap* + (handle->process (-> gp-0 colls s5-3 handle)) + (the-as uint 16) + (the-as int #f) + (the-as vector #t) + 0 + ) + ) ) (else - (when (-> a0-2 colls a1-0 minimap) - (logior! (-> a0-2 colls a1-0 minimap flags) (minimap-flag fade-out)) - (set! (-> a0-2 colls a1-0 minimap) #f) - ) + (set! (-> gp-0 colls s5-3 handle) (ppointer->handle (bush-collect-spawn self (-> gp-0 colls s5-3 pos)))) + (set! (-> gp-0 colls s5-3 minimap) #f) ) ) ) - (set! (-> *game-info* counter) (the float v1-6)) - (if (zero? v1-6) - (go-virtual complete) - ) ) - (none) + (set! (-> self start-time) (-> self clock frame-counter)) + (set! (-> self time-limit) (-> gp-0 time)) ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 269 - 3 - (the-as - (function object) - (lambda :behavior task-manager () (set! (-> self state-time) (-> self clock frame-counter)) (none)) + (game-task-node city-burning-bush-collection-1-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (check-time self) + (let ((a0-2 (-> *bb-collection-info* (-> self info index))) + (v1-6 0) + ) + (dotimes (a1-0 (-> a0-2 colls length)) + (cond + ((and (nonzero? (-> a0-2 colls a1-0 handle)) (handle->process (-> a0-2 colls a1-0 handle))) + (+! v1-6 1) + ) + (else + (when (-> a0-2 colls a1-0 minimap) + (logior! (-> a0-2 colls a1-0 minimap flags) (minimap-flag fade-out)) + (set! (-> a0-2 colls a1-0 minimap) #f) + ) + ) + ) + ) + (set! (-> *game-info* counter) (the float v1-6)) + (if (zero? v1-6) + (go-virtual complete) + ) + ) + (none) ) ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 287) (-> *game-info* sub-task-list 269)) +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-collection-1-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager () (set! (-> self state-time) (-> self clock frame-counter)) (none)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 305) (-> *game-info* sub-task-list 269)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-collection-2-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-collection-1-resolution)) + ) + +;; failed to figure out what this is: +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-collection-3-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-collection-1-resolution)) + ) ;; definition of type burning-bush-get-on-info (deftype burning-bush-get-on-info (structure) @@ -2985,68 +2975,70 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 261 - 0 - (the-as (function object) (lambda :behavior task-manager - () - (set-setting! 'airlock #f 0 0) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! *game-info* 261 2 (the-as (function object) (lambda :behavior task-manager () (none)))) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 261 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (let ((a0-1 (handle->process (-> self slave 0)))) - (if a0-1 - (deactivate a0-1) - ) - ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 261 - 4 - (the-as (function object) (lambda :behavior task-manager () (close! (-> self node-info) 'event) (none))) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 261 - 5 - (the-as (function object) (lambda :behavior task-manager - () - (if (and *target* (focus-test? *target* grabbed)) - (process-release? *target*) - ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 261 - 3 + (game-task-node city-burning-bush-get-to-1-resolution) + TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () - (set-setting! 'minimap 'clear 0 128) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-get-to-1-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager () (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-get-to-1-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (let ((a0-1 (handle->process (-> self slave 0)))) + (if a0-1 + (deactivate a0-1) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-get-to-1-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager () (close! (-> self node-info) 'event) (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-get-to-1-resolution) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager + () + (if (and *target* (focus-test? *target* grabbed)) + (process-release? *target*) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-get-to-1-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (while (not (process-grab? *target* #f)) (suspend) ) @@ -3071,8 +3063,8 @@ This commonly includes things such as: ) (suspend) (send-event (handle->process (-> self slave 0)) 'get-notify self) - (set-setting! 'interp-time 'abs 0 0) - (set-setting! 'mode-name 'cam-fixed 0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'mode-name 'cam-fixed 0.0 0) (set! (-> *ACTOR-bank* birth-max) 1000) (suspend) (let ((gp-0 (new 'stack 'transformq))) @@ -3125,68 +3117,109 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 261 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('notify) - (case (-> arg3 param 0) - (('pickup) - (go-virtual complete) - ) - (('die) - (go-virtual fail) - ) - ) - ) - ) - (none) - ) + (game-task-node city-burning-bush-get-to-1-resolution) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('pickup) + (go-virtual complete) ) + (('die) + (go-virtual fail) + ) + ) + ) + ) + (none) + ) ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 263) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-2-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 265) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-3-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 267) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-4-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 275) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-5-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 277) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-6-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 281) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-7-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 283) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-8-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 285) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-9-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 289) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-10-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 291) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-11-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 295) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-12-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 299) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-13-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 301) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-14-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 303) (-> *game-info* sub-task-list 261)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-15-resolution)) + (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) + ) ;; definition for method 15 of type hud-homing-beacon ;; WARN: Return type mismatch int vs none. diff --git a/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc index d96254738f..aaf45e0574 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc @@ -1910,7 +1910,7 @@ If the player is too far, play a warning speech." ) ) ) - (set-setting! 'immediate-string-min-max #f 0 0) + (set-setting! 'immediate-string-min-max #f 0.0 0) (set! (-> *ACTOR-bank* birth-max) 1000) ) ((logtest? (-> obj bot-flags) (bot-flags bf14)) @@ -2095,7 +2095,3 @@ If the player is too far, play a warning speech." (none) ) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/common/battle_REF.gc b/test/decompiler/reference/jak2/levels/common/battle_REF.gc index f52ccd6a02..b4c18b593c 100644 --- a/test/decompiler/reference/jak2/levels/common/battle_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/battle_REF.gc @@ -1742,10 +1742,10 @@ (when (and a3-0 (not (logtest? (-> obj flags) 16))) (case a3-0 (('sound-mode) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) ) (else - (set-setting! 'music a3-0 0 0) + (set-setting! 'music a3-0 0.0 0) ) ) (logior! (-> obj flags) 16) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot_REF.gc index 8e51a5fd81..0f1be49362 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot_REF.gc @@ -3226,314 +3226,290 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 186 - 0 - (the-as (function object) (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set! (-> self data-int32 0) 0) - 0 - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 186 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + (game-task-node city-stop-bomb-bots-destroy) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self data-int32 0) 0) + 0 + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 186 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (nonzero? (-> self data-int32 0)) - (let ((gp-0 0)) - (let ((s5-0 10000)) - (dotimes (s4-0 3) - (let* ((s2-0 (-> self slave s4-0 process 0)) - (s3-0 (if (type? s2-0 bombbot) - (the-as bombbot s2-0) - ) - ) - ) - (when s3-0 - (+! gp-0 1) - (let ((v1-14 - (the int (* 0.000030517578 (vector-vector-xz-distance - (-> s3-0 root-override2 trans) - (the-as vector (-> s3-0 city-path node (+ (-> s3-0 city-path node-count) -1))) - ) - ) - ) - ) + (game-task-node city-stop-bomb-bots-destroy) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-stop-bomb-bots-destroy) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (when (nonzero? (-> self data-int32 0)) + (let ((gp-0 0)) + (let ((s5-0 10000)) + (dotimes (s4-0 3) + (let* ((s2-0 (-> self slave s4-0 process 0)) + (s3-0 (if (type? s2-0 bombbot) + (the-as bombbot s2-0) + ) + ) + ) + (when s3-0 + (+! gp-0 1) + (let ((v1-14 + (the int (* 0.000030517578 (vector-vector-xz-distance + (-> s3-0 root-override2 trans) + (the-as vector (-> s3-0 city-path node (+ (-> s3-0 city-path node-count) -1))) + ) + ) + ) ) - (if (< v1-14 s5-0) - (set! s5-0 v1-14) - ) - ) - (when (= (-> s3-0 current-node) (+ (-> s3-0 city-path node-count) -1)) - ) + ) + (if (< v1-14 s5-0) + (set! s5-0 v1-14) + ) + ) + (when (= (-> s3-0 current-node) (+ (-> s3-0 city-path node-count) -1)) ) ) ) - (set! (-> self data-int32 1) s5-0) - (cond - ((< s5-0 10) - (set! (-> *game-info* timer) (the-as time-frame (the int (* 300.0 (the float s5-0))))) - (let ((v1-25 (handle->process (-> self hud-timer)))) - (if (and *target* (not v1-25)) - (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) - ) - ) - (when (zero? s5-0) - (send-event (handle->process (-> self hud-timer)) 'hide-and-die) - (go-virtual fail) - ) - ) - (else - (if (handle->process (-> self hud-timer)) - (send-event (handle->process (-> self hud-timer)) 'hide-and-die) - ) - ) - ) ) - (if (zero? gp-0) - (go-virtual complete) - ) - ) - ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 186 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (while (!= (-> (level-get-target-inside *level*) name) 'ctysluma) - (suspend) - ) - (set! (-> self data-int32 0) 1) - (set-setting! 'airlock #f 0 0) - (set-setting! 'sound-mode #f 0 1) - (let ((gp-1 *traffic-manager*)) - (send-event gp-1 'set-guard-target-count-range 4 0 0) - (send-event gp-1 'set-guard-target-count-range 5 0 0) - ) - (let ((gp-2 (new 'stack 'bombbot-spawn-params))) - (set! (-> gp-2 nav-mesh) (get-nav-mesh (the-as actor-id 9592))) - (set! (-> gp-2 position quad) - (-> (new 'static 'quaternion :x 4387619.0 :y 37262.54 :z 230567.11 :w 1.0) quad) - ) - (quaternion-copy! (-> gp-2 quat) (new 'static 'quaternion :x 0.0006 :y -0.8345 :z -0.0013 :w -0.5509)) - (set! (-> gp-2 path) *bombbot-path-1*) - (set! (-> self slave 0) (ppointer->handle (process-spawn bombbot gp-2 :to self))) - (set! (-> gp-2 path) *bombbot-path-2*) - (set! (-> self slave 1) (ppointer->handle (process-spawn bombbot gp-2 :to self))) - (set! (-> gp-2 path) *bombbot-path-3*) - (set! (-> self slave 2) (ppointer->handle (process-spawn bombbot gp-2 :to self))) - ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 186 - 4 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (talker-spawn-func (-> *talker-speech* 117) *entity-pool* (target-pos 0) (the-as region #f)) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 186 - 5 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (and *target* - (not (focus-test? *target* dead)) - (zero? (-> self data-int32 1)) - (nonzero? (-> self data-int32 0)) - ) - (cond - ((= (level-status *level* 'ctysluma) 'active) - (set-setting! 'entity-name "camera-236" 0 0) - (set-setting! 'minimap 'clear 0 128) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (add-process *gui-control* self (gui-channel sig) (gui-action play) "bbotxplo" -99.0 0) - (dotimes (gp-1 3) - (let* ((s5-0 (-> self slave gp-1 process 0)) - (a0-7 (if (type? s5-0 bombbot) - s5-0 - ) - ) - ) - (if a0-7 - (send-event a0-7 'explode) + (set! (-> self data-int32 1) s5-0) + (cond + ((< s5-0 10) + (set! (-> *game-info* timer) (the-as time-frame (the int (* 300.0 (the float s5-0))))) + (let ((v1-25 (handle->process (-> self hud-timer)))) + (if (and *target* (not v1-25)) + (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) ) ) + (when (zero? s5-0) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + (go-virtual fail) + ) ) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.3)) - (suspend) - ) - (setup - *screen-filter* - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) - (-> self clock seconds-per-frame) - (bucket-id tex-all-map) - ) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) - (suspend) - ) - (set-setting! 'interp-time 'abs 0 0) - (remove-setting! 'entity-name) + (else + (if (handle->process (-> self hud-timer)) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + ) + ) + ) + ) + (if (zero? gp-0) + (go-virtual complete) + ) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-stop-bomb-bots-destroy) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (while (!= (-> (level-get-target-inside *level*) name) 'ctysluma) + (suspend) + ) + (set! (-> self data-int32 0) 1) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'sound-mode #f 0.0 1) + (let ((gp-1 *traffic-manager*)) + (send-event gp-1 'set-guard-target-count-range 4 0 0) + (send-event gp-1 'set-guard-target-count-range 5 0 0) + ) + (let ((gp-2 (new 'stack 'bombbot-spawn-params))) + (set! (-> gp-2 nav-mesh) (get-nav-mesh (the-as actor-id 9592))) + (set! (-> gp-2 position quad) + (-> (new 'static 'quaternion :x 4387619.0 :y 37262.54 :z 230567.11 :w 1.0) quad) + ) + (quaternion-copy! (-> gp-2 quat) (new 'static 'quaternion :x 0.0006 :y -0.8345 :z -0.0013 :w -0.5509)) + (set! (-> gp-2 path) *bombbot-path-1*) + (set! (-> self slave 0) (ppointer->handle (process-spawn bombbot gp-2 :to self))) + (set! (-> gp-2 path) *bombbot-path-2*) + (set! (-> self slave 1) (ppointer->handle (process-spawn bombbot gp-2 :to self))) + (set! (-> gp-2 path) *bombbot-path-3*) + (set! (-> self slave 2) (ppointer->handle (process-spawn bombbot gp-2 :to self))) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-stop-bomb-bots-destroy) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (talker-spawn-func (-> *talker-speech* 117) *entity-pool* (target-pos 0) (the-as region #f)) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-stop-bomb-bots-destroy) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager + () + (when (and *target* + (not (focus-test? *target* dead)) + (zero? (-> self data-int32 1)) + (nonzero? (-> self data-int32 0)) + ) + (cond + ((= (level-status *level* 'ctysluma) 'active) + (set-setting! 'entity-name "camera-236" 0.0 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) ) - (else + (add-process *gui-control* self (gui-channel sig) (gui-action play) "bbotxplo" -99.0 0) + (dotimes (gp-1 3) + (let* ((s5-0 (-> self slave gp-1 process 0)) + (a0-7 (if (type? s5-0 bombbot) + s5-0 + ) + ) + ) + (if a0-7 + (send-event a0-7 'explode) + ) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.3)) + (suspend) + ) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (-> self clock seconds-per-frame) + (bucket-id tex-all-map) + ) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (suspend) + ) + (set-setting! 'interp-time 'abs 0.0 0) + (remove-setting! 'entity-name) + ) + (else + ) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-stop-bomb-bots-destroy) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (disable *screen-filter*) (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-bombbot-1-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-guard-target-count-range 4 0 0) + (send-event gp-0 'set-guard-target-count-range 5 0 0) + ) + (let ((gp-1 (new 'stack 'bombbot-spawn-params))) + (set! (-> gp-1 nav-mesh) (get-nav-mesh (the-as actor-id 9592))) + (set! (-> gp-1 position quad) + (-> (new 'static 'quaternion :x 4387619.0 :y 37262.54 :z 230567.11 :w 1.0) quad) + ) + (quaternion-copy! (-> gp-1 quat) (new 'static 'quaternion :x 0.0006 :y -0.8345 :z -0.0013 :w -0.5509)) + (set! (-> gp-1 path) *bombbot-path-4*) + (set! (-> self slave 0) (ppointer->handle (process-spawn bombbot gp-1 :to self))) + (set! (-> gp-1 path) *bombbot-path-5*) + (set! (-> self slave 1) (ppointer->handle (process-spawn bombbot gp-1 :to self))) + (set! (-> gp-1 path) *bombbot-path-6*) + (set! (-> self slave 2) (ppointer->handle (process-spawn bombbot gp-1 :to self))) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-bombbot-1-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-burning-bush-bombbot-1-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (let ((gp-0 0)) + 10000 + (dotimes (s5-0 3) + (let* ((s4-0 (-> self slave s5-0 process 0)) + (v1-6 (if (type? s4-0 bombbot) + (the-as bombbot s4-0) + ) + ) + ) + (when v1-6 + (+! gp-0 1) + (when (= (-> v1-6 current-node) (+ (-> v1-6 city-path node-count) -1)) + (set! (-> v1-6 current-node) (the-as uint 0)) + 0 + ) ) ) ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 186 - 1 - (the-as (function object) (lambda :behavior task-manager () (disable *screen-filter*) (none))) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 297 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'minimap 'clear 0 32) - (set-setting! 'airlock #f 0 0) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (let ((gp-0 *traffic-manager*)) - (send-event gp-0 'set-guard-target-count-range 4 0 0) - (send-event gp-0 'set-guard-target-count-range 5 0 0) - ) - (let ((gp-1 (new 'stack 'bombbot-spawn-params))) - (set! (-> gp-1 nav-mesh) (get-nav-mesh (the-as actor-id 9592))) - (set! (-> gp-1 position quad) - (-> (new 'static 'quaternion :x 4387619.0 :y 37262.54 :z 230567.11 :w 1.0) quad) - ) - (quaternion-copy! (-> gp-1 quat) (new 'static 'quaternion :x 0.0006 :y -0.8345 :z -0.0013 :w -0.5509)) - (set! (-> gp-1 path) *bombbot-path-4*) - (set! (-> self slave 0) (ppointer->handle (process-spawn bombbot gp-1 :to self))) - (set! (-> gp-1 path) *bombbot-path-5*) - (set! (-> self slave 1) (ppointer->handle (process-spawn bombbot gp-1 :to self))) - (set! (-> gp-1 path) *bombbot-path-6*) - (set! (-> self slave 2) (ppointer->handle (process-spawn bombbot gp-1 :to self))) - ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 297 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 297 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (let ((gp-0 0)) - 10000 - (dotimes (s5-0 3) - (let* ((s4-0 (-> self slave s5-0 process 0)) - (v1-6 (if (type? s4-0 bombbot) - (the-as bombbot s4-0) - ) - ) - ) - (when v1-6 - (+! gp-0 1) - (when (= (-> v1-6 current-node) (+ (-> v1-6 city-path node-count) -1)) - (set! (-> v1-6 current-node) (the-as uint 0)) - 0 - ) - ) - ) - ) - (if (zero? gp-0) - (go-virtual complete) - ) - ) - (none) - ) + (if (zero? gp-0) + (go-virtual complete) ) + ) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 297 - 3 - (the-as (function object) (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (until #f - (suspend) - ) - #f - (none) - ) - ) + (game-task-node city-burning-bush-bombbot-1-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (until #f + (suspend) + ) + #f + (none) + ) ) diff --git a/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc index 230360d92b..23d5c5557a 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 @@ -135,7 +135,7 @@ ) (com-elevator-method-49 self #t) (if (not (logtest? (-> self elevator-status) (elevator-status moving))) - (set-setting! 'allow-look-around #f 0 0) + (set-setting! 'allow-look-around #f 0.0 0) ) (none) ) @@ -305,7 +305,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) (if (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) - (set-setting! 'jump #f 0 0) + (set-setting! 'jump #f 0.0 0) ) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/races/race-manager_REF.gc b/test/decompiler/reference/jak2/levels/common/races/race-manager_REF.gc index 9cf2d34221..ef15143523 100644 --- a/test/decompiler/reference/jak2/levels/common/races/race-manager_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/races/race-manager_REF.gc @@ -396,7 +396,7 @@ (logior! (-> obj flags) 1) (race-state-method-17 obj) (send-event (handle->process (-> obj manager)) 'begin-race) - (set-setting! 'sound-mode #f 0 0) + (set-setting! 'sound-mode #f 0.0 0) (remove-setting! 'allow-progress) (set! (-> obj race-start-time) (-> obj current-time)) (let ((s5-0 (handle->process (-> obj manager)))) @@ -413,7 +413,7 @@ (set! (-> obj hud-turbo-counter) (ppointer->handle (process-spawn hud-race-turbo-counter :init hud-init-by-other :to s5-0)) ) - (set-setting! 'race-minimap #f 0 (-> obj info map-index)) + (set-setting! 'race-minimap #f 0.0 (-> obj info map-index)) ) ) (dotimes (s5-1 (-> obj racer-count)) @@ -559,7 +559,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod race-state-method-18 race-state ((obj race-state)) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-progress #f 0.0 0) (send-event (handle->process (-> obj arrow)) 'leave) (when (logtest? (-> obj info flags) 16) (send-event *traffic-manager* 'set-target-level 0) @@ -651,7 +651,7 @@ ) (when (< 0.4 f30-0) (when (-> obj info start-camera) - (set-setting! 'entity-name (-> obj info start-camera) 0 0) + (set-setting! 'entity-name (-> obj info start-camera) 0.0 0) (if (logtest? (-> obj info flags) 64) (talker-spawn-func (-> *talker-speech* 377) *entity-pool* (target-pos 0) (the-as region #f)) ) @@ -1408,11 +1408,11 @@ #f ) (else - (set-setting! 'music 'race 0 0) - (set-setting! 'sound-mode #f 0 2) + (set-setting! 'music 'race 0.0 0) + (set-setting! 'sound-mode #f 0.0 2) (let ((gp-0 (-> self race-state info))) (when (logtest? (-> gp-0 flags) 16) - (set-setting! 'borrow (-> gp-0 borrow) 0 0) + (set-setting! 'borrow (-> gp-0 borrow) 0.0 0) (while (!= (level-status *level* 'lracelit) 'active) (suspend) ) @@ -1527,7 +1527,7 @@ ) (send-event (ppointer->process (-> self parent)) 'allow-fail #f) (if (not (logtest? (-> self race-state info flags) 16)) - (set-setting! 'sound-mode #f 0 2) + (set-setting! 'sound-mode #f 0.0 2) ) (set! (-> self message-id) (the-as uint (add-process *gui-control* self (gui-channel supertitle) (gui-action play) "fail" 81920.0 0)) diff --git a/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc b/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc index e8078b5c66..c2de3723b5 100644 --- a/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc @@ -1004,13 +1004,14 @@ This commonly includes things such as: ) ) (if (and (= (-> v1-1 action) (game-task-action play)) - (or (and *target* (focus-test? *target* grabbed)) (let ((v1-10 (-> *game-info* sub-task-list 151))) - (handle->process (if (-> v1-10 info) - (-> v1-10 info manager) - (the-as handle #f) - ) - ) - ) + (or (and *target* (focus-test? *target* grabbed)) + (let ((v1-10 (-> *game-info* sub-task-list (game-task-node city-play-onin-game-resolution)))) + (handle->process (if (-> v1-10 info) + (-> v1-10 info manager) + (the-as handle #f) + ) + ) + ) ) ) (-> obj draw art-group data 6) 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 bf4a014d29..abc9606263 100644 --- a/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc @@ -681,15 +681,15 @@ :code (behavior ((arg0 continue-point)) (local-vars (v1-38 symbol)) (kill-current-talker (the-as symbol '()) '() 'exit) - (set-setting! 'mode-name 'cam-fixed 0 0) - (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) (set! (-> self state-time) (-> self clock frame-counter)) (logclear! (-> self mask) (process-mask actor-pause)) (when (not arg0) (process-release? *target*) (go-virtual idle) ) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-progress #f 0.0 0) (set! (-> *setting-control* user-default border-mode) #t) (set! (-> *level* play?) #t) (apply-settings *setting-control*) @@ -1036,7 +1036,7 @@ This commonly includes things such as: (lambda ((arg0 string)) (local-vars (a1-2 event-message-block)) (with-pp - (add-setting! 'entity-name arg0 0 0) + (add-setting! 'entity-name arg0 0.0 0) (until (send-event-function *camera* a1-2) (suspend) (set! a1-2 (new 'stack-no-clear 'event-message-block)) @@ -1335,7 +1335,7 @@ This commonly includes things such as: (process-release? *target*) (go-virtual idle) ) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-progress #f 0.0 0) (set! (-> *setting-control* user-default border-mode) #t) (set! (-> *level* play?) #t) (apply-settings *setting-control*) 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 1c16008e01..cec9b672c2 100644 --- a/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc @@ -473,12 +473,12 @@ (set! (-> self want 0) (the-as int arg0)) (set! (-> self want 1) (-> self draw)) (when arg2 - (set-setting! 'bg-a 'abs #x3f800000 0) + (set-setting! 'bg-a 'abs 1.0 0) (set! (-> *setting-control* user-current bg-a) 1.0) (apply-settings *setting-control*) ) (when (>= (-> self draw) 0) - (set-setting! 'bg-a 'abs #x3f800000 0) + (set-setting! 'bg-a 'abs 1.0 0) (apply-settings *setting-control*) (while (!= (-> *setting-control* user-current bg-a) 1.0) (suspend) @@ -844,7 +844,7 @@ (send-event (ppointer->process *time-of-day*) 'change 'hour 8) (set! (-> self mask) gp-25) ) - (set-setting! 'allow-pause #t 0 0) + (set-setting! 'allow-pause #t 0.0 0) (let ((gp-27 (ppointer->handle (process-spawn scene-player :init scene-player-init "atoll-2-intro-demo" #t "hiphog-demo")) ) @@ -853,8 +853,8 @@ (suspend) ) ) - (set-setting! 'allow-timeout #f 0 0) - (set-setting! 'allow-pause #f 0 0) + (set-setting! 'allow-timeout #f 0.0 0) + (set-setting! 'allow-pause #f 0.0 0) (let ((t9-49 demo-screen-change) (a0-81 0) (a1-39 -1) @@ -872,7 +872,7 @@ (play-task (game-task strip-rescue) 'debug #f) (set! (-> self mask) gp-29) ) - (set-setting! 'allow-pause #t 0 0) + (set-setting! 'allow-pause #t 0.0 0) (let ((gp-31 (ppointer->handle (process-spawn scene-player :init scene-player-init "crane-intro-demo" #t "vinroom-demo")) ) @@ -890,8 +890,8 @@ (send-event (ppointer->process *time-of-day*) 'change 'hour 8) (set! (-> self mask) gp-32) ) - (set-setting! 'allow-timeout #f 0 0) - (set-setting! 'allow-pause #f 0 0) + (set-setting! 'allow-timeout #f 0.0 0) + (set-setting! 'allow-pause #f 0.0 0) (let ((t9-63 demo-screen-change) (a0-105 1) (a1-54 -1) @@ -904,8 +904,8 @@ (start 'play (get-continue-by-name *game-info* "strip-warp")) ) ((= gp-24 2) - (set-setting! 'allow-timeout #f 0 0) - (set-setting! 'allow-pause #f 0 0) + (set-setting! 'allow-timeout #f 0.0 0) + (set-setting! 'allow-pause #f 0.0 0) (demo-screen-change (the-as symbol -1) -1 #f (the-as int #t)) (set! (-> *setting-control* user-default music-volume) 0.0) (case *kernel-boot-message* @@ -1058,11 +1058,11 @@ ) (process-entity-set! self a1-2) ) - (set-setting! 'allow-pause #f 0 0) - (set-setting! 'allow-progress #f 0 0) - (set-setting! 'airlock #f 0 0) - (set-setting! 'music #f 0 0) - (set-setting! 'allow-timeout #f 0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'music #f 0.0 0) + (set-setting! 'allow-timeout #f 0.0 0) (apply-settings *setting-control*) (dotimes (gp-0 2) (set! (-> self buffer gp-0) diff --git a/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc index ff8ca3219e..83147b21d3 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc @@ -627,7 +627,7 @@ (defstate moving (dig-log) :virtual #t :enter (behavior () - (set-setting! 'ignore-target #t 0 0) + (set-setting! 'ignore-target #t 0.0 0) (none) ) :exit (behavior () @@ -659,7 +659,7 @@ (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.2)) (suspend) ) - (set-setting! 'entity-name "camera-249" 0 0) + (set-setting! 'entity-name "camera-249" 0.0 0) (set-action! *gui-control* (gui-action play) 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 231adf441e..b156240984 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc @@ -1266,9 +1266,9 @@ This commonly includes things such as: (cond ((-> self trapeze-grabbed) (when (not (-> self grabbed)) - (set-setting! 'mode-name 'cam-pov-track 0 0) + (set-setting! 'mode-name 'cam-pov-track 0.0 0) (let ((v1-33 (process->ppointer self))) - (set-setting! 'pov-handle v1-33 #x40400000 (-> v1-33 0 pid)) + (set-setting! 'pov-handle v1-33 3.0 (-> v1-33 0 pid)) ) (set! (-> self pov-cam-offset z) (if (< 0.0 (vector-dot (-> self node-list data 0 bone transform vector 2) (-> (camera-matrix) vector 2))) diff --git a/test/decompiler/reference/jak2/levels/drill_platform/drill-baron_REF.gc b/test/decompiler/reference/jak2/levels/drill_platform/drill-baron_REF.gc index b35951ccf6..22c3b8f548 100644 --- a/test/decompiler/reference/jak2/levels/drill_platform/drill-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill_platform/drill-baron_REF.gc @@ -1422,7 +1422,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set-setting! 'music 'danger4 0 0) + (set-setting! 'music 'danger4 0.0 0) (let ((v1-2 2) (a0-2 (+ (-> self pass) 1)) ) diff --git a/test/decompiler/reference/jak2/levels/drill_platform/drill-mech-master_REF.gc b/test/decompiler/reference/jak2/levels/drill_platform/drill-mech-master_REF.gc index 890ef15afc..a54e0ae1de 100644 --- a/test/decompiler/reference/jak2/levels/drill_platform/drill-mech-master_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill_platform/drill-mech-master_REF.gc @@ -132,7 +132,7 @@ (let ((gp-0 (-> arg3 param 0))) (set! (-> *game-info* counter) (the float (-> self cpanel-count))) (spawn-hud-panel self (the-as symbol gp-0)) - (set-setting! 'music #f 0 0) + (set-setting! 'music #f 0.0 0) (if (not gp-0) (set! (-> self exited?) #t) ) @@ -201,13 +201,13 @@ (task-node-close! (game-task-node drill-mech-smash-consoles)) (set! (-> self alarm-sound-id) (sound-play "drill-alarm")) (persist-with-delay *setting-control* 'ignore-target (seconds 8) 'ignore-target #t 0.0 0) - (set-setting! 'music 'danger10 0 0) + (set-setting! 'music 'danger10 0.0 0) (set! (-> self state-time) (-> self clock frame-counter)) (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) (suspend) ) (talker-spawn-func (-> *talker-speech* 183) *entity-pool* (target-pos 0) (the-as region #f)) - (set-setting! 'pilot #f 0 0) + (set-setting! 'pilot #f 0.0 0) (let ((v1-20 *target*)) (if v1-20 (send-event (handle->process (-> v1-20 mech hud 0)) 'hide-and-die) @@ -280,8 +280,8 @@ :event drill-mech-master-event-handler :enter (behavior () (set! (-> self state-time) (-> self clock frame-counter)) - (set-setting! 'allow-pause #f 0 0) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (none) ) :exit (behavior () @@ -427,7 +427,7 @@ (set! (-> self total-countdown-time) (seconds 75)) (task-node-close! (game-task-node drill-mech-smash-consoles)) (set! (-> self alarm-sound-id) (sound-play "drill-alarm")) - (set-setting! 'music 'danger10 0 0) + (set-setting! 'music 'danger10 0.0 0) (go-virtual hostile) ) (else @@ -440,42 +440,37 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 203 - 6 - (the-as (function object) (lambda :behavior task-manager - ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('hud-cpanel) - (let ((v1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-1 from) (process->ppointer arg0)) - (set! (-> v1-1 num-params) arg1) - (set! (-> v1-1 message) arg2) - (set! (-> v1-1 param 0) (-> arg3 param 0)) - (set! (-> v1-1 param 1) (-> arg3 param 1)) - (set! (-> v1-1 param 2) (-> arg3 param 2)) - (set! (-> v1-1 param 3) (-> arg3 param 3)) - (set! (-> v1-1 param 4) (-> arg3 param 4)) - (set! (-> v1-1 param 5) (-> arg3 param 5)) - (send-event-function (handle->process (-> self slave 0)) v1-1) - ) - ) - ) - ) - ) + (game-task-node drill-mech-started-smashing) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hud-cpanel) + (let ((v1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-1 from) (process->ppointer arg0)) + (set! (-> v1-1 num-params) arg1) + (set! (-> v1-1 message) arg2) + (set! (-> v1-1 param 0) (-> arg3 param 0)) + (set! (-> v1-1 param 1) (-> arg3 param 1)) + (set! (-> v1-1 param 2) (-> arg3 param 2)) + (set! (-> v1-1 param 3) (-> arg3 param 3)) + (set! (-> v1-1 param 4) (-> arg3 param 4)) + (set! (-> v1-1 param 5) (-> arg3 param 5)) + (send-event-function (handle->process (-> self slave 0)) v1-1) + ) + ) + ) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 203 - 0 + (game-task-node drill-mech-started-smashing) + TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () (let ((v0-3 (ppointer->handle (process-spawn drill-mech-master :to self)))) (set! (-> self slave 0) (the-as handle v0-3)) (the-as object v0-3) ) ) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/drill_platform/drill-obs_REF.gc b/test/decompiler/reference/jak2/levels/drill_platform/drill-obs_REF.gc index 7233ae857a..eaf171318b 100644 --- a/test/decompiler/reference/jak2/levels/drill_platform/drill-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill_platform/drill-obs_REF.gc @@ -651,9 +651,9 @@ For example for an elevator pre-compute the distance between the first and last (let ((v1-9 *target*)) (when v1-9 (if (not (focus-test? v1-9 mech)) - (set-setting! 'pilot #f 0 0) + (set-setting! 'pilot #f 0.0 0) ) - (set-setting! 'pilot-exit #f 0 0) + (set-setting! 'pilot-exit #f 0.0 0) ) ) ) @@ -1804,8 +1804,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 118 - 0 + (game-task-node drill-ship-resolution) + TASK_MANAGER_INIT_HOOK (lambda () (speech-control-method-10 *speech-control* @@ -1905,7 +1905,12 @@ This commonly includes things such as: ) ;; failed to figure out what this is: -(set-subtask-hook! *game-info* 118 1 (lambda () (the-as object (speech-control-method-9 *speech-control*)))) +(set-subtask-hook! + *game-info* + (game-task-node drill-ship-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda () (the-as object (speech-control-method-9 *speech-control*))) + ) ;; definition for function drill-login ;; WARN: Return type mismatch int vs none. diff --git a/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc b/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc index 90039bfed4..8a67554336 100644 --- a/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc @@ -186,7 +186,7 @@ This commonly includes things such as: (set! (-> a1-19 num-params) 0) (set! (-> a1-19 message) 'fail) (let ((t9-11 send-event-function) - (v1-45 (-> *game-info* sub-task-list 200)) + (v1-45 (-> *game-info* sub-task-list (game-task-node forest-protect-resolution))) ) (t9-11 (handle->process (if (-> v1-45 info) @@ -411,7 +411,7 @@ This commonly includes things such as: (set! (-> a1-10 num-params) 0) (set! (-> a1-10 message) 'fail) (let ((t9-12 send-event-function) - (v1-62 (-> *game-info* sub-task-list 200)) + (v1-62 (-> *game-info* sub-task-list (game-task-node forest-protect-resolution))) ) (t9-12 (handle->process (if (-> v1-62 info) @@ -557,547 +557,541 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 200 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'airlock #f 0 0) - (set-setting! 'sound-mode #f 0 1) - (set-setting! 'sound-excitement 'abs #x3f4ccccd 0) - (set-setting! 'extra-bank '((forest2 forest4) (forest3 forest5)) 0 0) - (speech-control-method-10 - *speech-control* - 6 - (new 'static 'speech-type-info - :min-delay #x4b0 - :max-delay #x960 - :list (new 'static 'boxed-array :type string - "kg001" - "kg002" - "kg004" - "kg006" - "kg001a" - "kg013" - "kg016" - "kg018" - "kg019" - "kg023" - "kg024" - "kg002a" - "kg004a" - "kg078a" - "kg079a" - "kg080a" - "kg081a" - "kg004a" - "kg082a" - "kg083a" - "kg084a" - "kg085a" - "kg086a" - "kg087a" - "kg088a" - "kg091a" - "kg023a" - "kg006a" - "kg092a" - "kg093a" - "kg094a" - "kg095a" - "kg103a" - "kg104a" - "kg112a" - "kg024a" - "kg134" - "kg136" - "kg137" - "kg138" - "kg139" - "kg140" - "kg141" - "kg130" - "kg135" - "kg156" - "kg157" - ) + (game-task-node forest-protect-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'sound-mode #f 0.0 1) + (set-setting! 'sound-excitement 'abs 0.8 0) + (set-setting! 'extra-bank '((forest2 forest4) (forest3 forest5)) 0.0 0) + (speech-control-method-10 + *speech-control* + 6 + (new 'static 'speech-type-info + :min-delay #x4b0 + :max-delay #x960 + :list (new 'static 'boxed-array :type string + "kg001" + "kg002" + "kg004" + "kg006" + "kg001a" + "kg013" + "kg016" + "kg018" + "kg019" + "kg023" + "kg024" + "kg002a" + "kg004a" + "kg078a" + "kg079a" + "kg080a" + "kg081a" + "kg004a" + "kg082a" + "kg083a" + "kg084a" + "kg085a" + "kg086a" + "kg087a" + "kg088a" + "kg091a" + "kg023a" + "kg006a" + "kg092a" + "kg093a" + "kg094a" + "kg095a" + "kg103a" + "kg104a" + "kg112a" + "kg024a" + "kg134" + "kg136" + "kg137" + "kg138" + "kg139" + "kg140" + "kg141" + "kg130" + "kg135" + "kg156" + "kg157" ) ) - (speech-control-method-10 - *speech-control* - 9 - (new 'static 'speech-type-info - :priority #x9 - :max-delay #x12c - :list (new 'static 'boxed-array :type string - "kg133" - "kg137" - "kg142" - "kg144" - "kg145" - "kg146" - "kg147" - "kg148" - "kg149" - "kg150" - "kg138" - "kg151" - "kg152" - "kg153" - "kg154" - "kg155" - "kg159" - "kg163" - "kg164" - ) - ) - ) - (speech-control-method-10 - *speech-control* - 10 - (new 'static 'speech-type-info :priority #xa :max-delay #x12c :list (new 'static 'boxed-array :type string - "kg165" - "kg166" - "kg167" - "kg168" - "kg169" - "kg170" - "kg171" - "kg172" - "kg173" - "kg174" - "kg175" - "kg176" - ) - ) - ) - (none) ) + (speech-control-method-10 + *speech-control* + 9 + (new 'static 'speech-type-info + :priority #x9 + :max-delay #x12c + :list (new 'static 'boxed-array :type string + "kg133" + "kg137" + "kg142" + "kg144" + "kg145" + "kg146" + "kg147" + "kg148" + "kg149" + "kg150" + "kg138" + "kg151" + "kg152" + "kg153" + "kg154" + "kg155" + "kg159" + "kg163" + "kg164" + ) + ) + ) + (speech-control-method-10 + *speech-control* + 10 + (new 'static 'speech-type-info :priority #xa :max-delay #x12c :list (new 'static 'boxed-array :type string + "kg165" + "kg166" + "kg167" + "kg168" + "kg169" + "kg170" + "kg171" + "kg172" + "kg173" + "kg174" + "kg175" + "kg176" + ) + ) + ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 200 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (if (!= (level-status *level* 'forestb) 'active) - (go-virtual fail) - ) - (none) - ) - ) + (game-task-node forest-protect-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (if (!= (level-status *level* 'forestb) 'active) + (go-virtual fail) + ) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 200 - 3 - (the-as (function object) (lambda :behavior task-manager - () - (set! (-> self start-time) (-> self clock frame-counter)) - (let ((gp-0 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.5)) - (suspend) - ) - ) - (let ((s5-0 (entity-by-name "transport-level-1")) - (gp-1 (entity-by-name "transport-level-2")) - ) - (let ((s4-0 (entity-by-name "forest-hover-manager-1"))) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) (process->ppointer self)) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'spawn-time) - (set! (-> a1-0 param 0) (the-as uint 150)) - (let ((t9-3 send-event-function) - (v1-11 s5-0) - ) - (t9-3 - (if v1-11 - (-> v1-11 extra process) - ) - a1-0 - ) - ) - ) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) (process->ppointer self)) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'spawn-time) - (set! (-> a1-1 param 0) (the-as uint 150)) - (let ((t9-4 send-event-function) - (v1-18 gp-1) - ) - (t9-4 - (if v1-18 - (-> v1-18 extra process) - ) - a1-1 - ) - ) - ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) (process->ppointer self)) - (set! (-> a1-2 num-params) 1) - (set! (-> a1-2 message) 'guards-alive) - (set! (-> a1-2 param 0) (the-as uint 0)) - (let ((t9-5 send-event-function) - (v1-24 s5-0) - ) - (t9-5 - (if v1-24 - (-> v1-24 extra process) - ) - a1-2 - ) - ) - ) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) (process->ppointer self)) - (set! (-> a1-3 num-params) 1) - (set! (-> a1-3 message) 'guards-alive) - (set! (-> a1-3 param 0) (the-as uint 3)) - (let ((t9-6 send-event-function) - (v1-31 gp-1) - ) - (t9-6 - (if v1-31 - (-> v1-31 extra process) - ) - a1-3 - ) - ) - ) - (let ((s3-0 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s3-0) (seconds 15)) - (suspend) - ) - ) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) (process->ppointer self)) - (set! (-> a1-4 num-params) 1) - (set! (-> a1-4 message) 'guards-alive) - (set! (-> a1-4 param 0) (the-as uint 3)) - (let ((t9-7 send-event-function) - (v1-43 s5-0) - ) - (t9-7 - (if v1-43 - (-> v1-43 extra process) - ) - a1-4 - ) - ) - ) - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) (process->ppointer self)) - (set! (-> a1-5 num-params) 1) - (set! (-> a1-5 message) 'guards-alive) - (set! (-> a1-5 param 0) (the-as uint 0)) - (let ((t9-8 send-event-function) - (v1-49 gp-1) - ) - (t9-8 - (if v1-49 - (-> v1-49 extra process) - ) - a1-5 - ) - ) - ) - (dotimes (s3-1 3) - (let ((s2-0 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s2-0) (seconds 10)) - (suspend) - ) - ) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) (process->ppointer self)) - (set! (-> a1-6 num-params) 1) - (set! (-> a1-6 message) 'guards-alive) - (set! (-> a1-6 param 0) (the-as uint 0)) - (let ((t9-9 send-event-function) - (v1-60 s5-0) - ) - (t9-9 - (if v1-60 - (-> v1-60 extra process) - ) - a1-6 - ) - ) - ) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) (process->ppointer self)) - (set! (-> a1-7 num-params) 1) - (set! (-> a1-7 message) 'guards-alive) - (set! (-> a1-7 param 0) (the-as uint 4)) - (let ((t9-10 send-event-function) - (v1-67 gp-1) - ) - (t9-10 - (if v1-67 - (-> v1-67 extra process) - ) - a1-7 - ) - ) - ) - (let ((s2-1 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s2-1) (seconds 10)) - (suspend) - ) - ) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) (process->ppointer self)) - (set! (-> a1-8 num-params) 1) - (set! (-> a1-8 message) 'guards-alive) - (set! (-> a1-8 param 0) (the-as uint 4)) - (let ((t9-11 send-event-function) - (v1-79 s5-0) - ) - (t9-11 - (if v1-79 - (-> v1-79 extra process) - ) - a1-8 - ) - ) - ) - (let ((a1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-9 from) (process->ppointer self)) - (set! (-> a1-9 num-params) 1) - (set! (-> a1-9 message) 'guards-alive) - (set! (-> a1-9 param 0) (the-as uint 0)) - (let ((t9-12 send-event-function) - (v1-85 gp-1) - ) - (t9-12 - (if v1-85 - (-> v1-85 extra process) - ) - a1-9 - ) - ) - ) - ) - (let ((s3-2 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s3-2) (seconds 10)) - (suspend) - ) - ) - (let ((a1-10 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-10 from) (process->ppointer self)) - (set! (-> a1-10 num-params) 1) - (set! (-> a1-10 message) 'guards-alive) - (set! (-> a1-10 param 0) (the-as uint 2)) - (let ((t9-13 send-event-function) - (v1-99 s5-0) - ) - (t9-13 - (if v1-99 - (-> v1-99 extra process) - ) - a1-10 - ) - ) - ) - (let ((a1-11 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-11 from) (process->ppointer self)) - (set! (-> a1-11 num-params) 1) - (set! (-> a1-11 message) 'guards-alive) - (set! (-> a1-11 param 0) (the-as uint 2)) - (let ((t9-14 send-event-function) - (v1-106 gp-1) - ) - (t9-14 - (if v1-106 - (-> v1-106 extra process) - ) - a1-11 - ) - ) - ) - (let ((s3-3 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s3-3) (seconds 10)) - (suspend) - ) - ) - (dotimes (s3-4 10) - (let ((v1-114 s4-0)) - (if (not (if v1-114 - (-> v1-114 extra process) - ) - ) - (goto cfg-74) - ) - ) - (let ((s2-2 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s2-2) (seconds 1)) - (suspend) - ) - ) - ) - (label cfg-74) - (let ((a1-12 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-12 from) (process->ppointer self)) - (set! (-> a1-12 num-params) 0) - (set! (-> a1-12 message) 'stop-spawning) - (let ((t9-15 send-event-function) - (v1-128 s5-0) - ) - (t9-15 - (if v1-128 - (-> v1-128 extra process) - ) - a1-12 - ) - ) - ) - (let ((a1-13 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-13 from) (process->ppointer self)) - (set! (-> a1-13 num-params) 0) - (set! (-> a1-13 message) 'stop-spawning) - (let ((t9-16 send-event-function) - (v1-133 gp-1) - ) - (t9-16 - (if v1-133 - (-> v1-133 extra process) - ) - a1-13 - ) - ) - ) - (while (let ((v1-141 s4-0)) - (or (if v1-141 - (-> v1-141 extra process) - ) - (let ((a1-14 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-14 from) (process->ppointer self)) - (set! (-> a1-14 num-params) 0) - (set! (-> a1-14 message) 'guards-alive-count) - (let ((t9-17 send-event-function) - (v1-146 s5-0) - ) - (> (the-as uint (t9-17 - (if v1-146 - (-> v1-146 extra process) - ) - a1-14 - ) - ) - 0 - ) - ) - ) - (let ((a1-15 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-15 from) (process->ppointer self)) - (set! (-> a1-15 num-params) 0) - (set! (-> a1-15 message) 'guards-alive-count) - (let ((t9-18 send-event-function) - (v1-151 gp-1) - ) - (> (the-as uint (t9-18 - (if v1-151 - (-> v1-151 extra process) - ) - a1-15 - ) - ) - 0 - ) - ) - ) + (game-task-node forest-protect-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self start-time) (-> self clock frame-counter)) + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.5)) + (suspend) + ) + ) + (let ((s5-0 (entity-by-name "transport-level-1")) + (gp-1 (entity-by-name "transport-level-2")) + ) + (let ((s4-0 (entity-by-name "forest-hover-manager-1"))) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'spawn-time) + (set! (-> a1-0 param 0) (the-as uint 150)) + (let ((t9-3 send-event-function) + (v1-11 s5-0) + ) + (t9-3 + (if v1-11 + (-> v1-11 extra process) + ) + a1-0 + ) + ) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'spawn-time) + (set! (-> a1-1 param 0) (the-as uint 150)) + (let ((t9-4 send-event-function) + (v1-18 gp-1) + ) + (t9-4 + (if v1-18 + (-> v1-18 extra process) + ) + a1-1 + ) + ) + ) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'guards-alive) + (set! (-> a1-2 param 0) (the-as uint 0)) + (let ((t9-5 send-event-function) + (v1-24 s5-0) + ) + (t9-5 + (if v1-24 + (-> v1-24 extra process) + ) + a1-2 + ) + ) + ) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 1) + (set! (-> a1-3 message) 'guards-alive) + (set! (-> a1-3 param 0) (the-as uint 3)) + (let ((t9-6 send-event-function) + (v1-31 gp-1) + ) + (t9-6 + (if v1-31 + (-> v1-31 extra process) + ) + a1-3 + ) + ) + ) + (let ((s3-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s3-0) (seconds 15)) + (suspend) + ) + ) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 1) + (set! (-> a1-4 message) 'guards-alive) + (set! (-> a1-4 param 0) (the-as uint 3)) + (let ((t9-7 send-event-function) + (v1-43 s5-0) + ) + (t9-7 + (if v1-43 + (-> v1-43 extra process) + ) + a1-4 + ) + ) + ) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer self)) + (set! (-> a1-5 num-params) 1) + (set! (-> a1-5 message) 'guards-alive) + (set! (-> a1-5 param 0) (the-as uint 0)) + (let ((t9-8 send-event-function) + (v1-49 gp-1) + ) + (t9-8 + (if v1-49 + (-> v1-49 extra process) + ) + a1-5 + ) + ) + ) + (dotimes (s3-1 3) + (let ((s2-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s2-0) (seconds 10)) + (suspend) + ) + ) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 1) + (set! (-> a1-6 message) 'guards-alive) + (set! (-> a1-6 param 0) (the-as uint 0)) + (let ((t9-9 send-event-function) + (v1-60 s5-0) + ) + (t9-9 + (if v1-60 + (-> v1-60 extra process) + ) + a1-6 + ) + ) + ) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 1) + (set! (-> a1-7 message) 'guards-alive) + (set! (-> a1-7 param 0) (the-as uint 4)) + (let ((t9-10 send-event-function) + (v1-67 gp-1) + ) + (t9-10 + (if v1-67 + (-> v1-67 extra process) + ) + a1-7 + ) + ) + ) + (let ((s2-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s2-1) (seconds 10)) + (suspend) + ) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer self)) + (set! (-> a1-8 num-params) 1) + (set! (-> a1-8 message) 'guards-alive) + (set! (-> a1-8 param 0) (the-as uint 4)) + (let ((t9-11 send-event-function) + (v1-79 s5-0) + ) + (t9-11 + (if v1-79 + (-> v1-79 extra process) + ) + a1-8 + ) + ) + ) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer self)) + (set! (-> a1-9 num-params) 1) + (set! (-> a1-9 message) 'guards-alive) + (set! (-> a1-9 param 0) (the-as uint 0)) + (let ((t9-12 send-event-function) + (v1-85 gp-1) + ) + (t9-12 + (if v1-85 + (-> v1-85 extra process) + ) + a1-9 + ) + ) + ) + ) + (let ((s3-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s3-2) (seconds 10)) + (suspend) + ) + ) + (let ((a1-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-10 from) (process->ppointer self)) + (set! (-> a1-10 num-params) 1) + (set! (-> a1-10 message) 'guards-alive) + (set! (-> a1-10 param 0) (the-as uint 2)) + (let ((t9-13 send-event-function) + (v1-99 s5-0) + ) + (t9-13 + (if v1-99 + (-> v1-99 extra process) + ) + a1-10 + ) + ) + ) + (let ((a1-11 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-11 from) (process->ppointer self)) + (set! (-> a1-11 num-params) 1) + (set! (-> a1-11 message) 'guards-alive) + (set! (-> a1-11 param 0) (the-as uint 2)) + (let ((t9-14 send-event-function) + (v1-106 gp-1) + ) + (t9-14 + (if v1-106 + (-> v1-106 extra process) + ) + a1-11 + ) + ) + ) + (let ((s3-3 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s3-3) (seconds 10)) + (suspend) + ) + ) + (dotimes (s3-4 10) + (let ((v1-114 s4-0)) + (if (not (if v1-114 + (-> v1-114 extra process) + ) + ) + (goto cfg-74) + ) + ) + (let ((s2-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s2-2) (seconds 1)) + (suspend) + ) + ) + ) + (label cfg-74) + (let ((a1-12 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-12 from) (process->ppointer self)) + (set! (-> a1-12 num-params) 0) + (set! (-> a1-12 message) 'stop-spawning) + (let ((t9-15 send-event-function) + (v1-128 s5-0) + ) + (t9-15 + (if v1-128 + (-> v1-128 extra process) + ) + a1-12 + ) + ) + ) + (let ((a1-13 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-13 from) (process->ppointer self)) + (set! (-> a1-13 num-params) 0) + (set! (-> a1-13 message) 'stop-spawning) + (let ((t9-16 send-event-function) + (v1-133 gp-1) + ) + (t9-16 + (if v1-133 + (-> v1-133 extra process) + ) + a1-13 + ) + ) + ) + (while (let ((v1-141 s4-0)) + (or (if v1-141 + (-> v1-141 extra process) + ) + (let ((a1-14 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-14 from) (process->ppointer self)) + (set! (-> a1-14 num-params) 0) + (set! (-> a1-14 message) 'guards-alive-count) + (let ((t9-17 send-event-function) + (v1-146 s5-0) + ) + (> (the-as uint (t9-17 + (if v1-146 + (-> v1-146 extra process) ) + a1-14 ) - (let ((s3-5 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s3-5) (seconds 1)) - (suspend) - ) - ) ) - ) - (let ((s4-1 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s4-1) (seconds 0.5)) - (suspend) + 0 + ) + ) + ) + (let ((a1-15 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-15 from) (process->ppointer self)) + (set! (-> a1-15 num-params) 0) + (set! (-> a1-15 message) 'guards-alive-count) + (let ((t9-18 send-event-function) + (v1-151 gp-1) + ) + (> (the-as uint (t9-18 + (if v1-151 + (-> v1-151 extra process) + ) + a1-15 + ) ) - ) - (set-setting! 'entity-name "camera-260" 0 0) - (set-setting! 'process-mask 'set 0 (process-mask movie enemy)) - (process-grab? *target* #f) - (let ((s4-2 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s4-2) (seconds 0.5)) - (suspend) - ) - ) - (send-event - (if s5-0 - (-> s5-0 extra process) - ) - 'leave - ) - (let ((s5-1 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) s5-1) (seconds 0.2)) - (suspend) - ) - ) - (send-event - (if gp-1 - (-> gp-1 extra process) - ) - 'leave - ) - ) - (let ((gp-2 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-2) (seconds 3)) - (suspend) - ) - ) - (remove-setting! 'entity-name) - (remove-setting! 'process-mask) - (process-release? *target*) - (let ((gp-3 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-3) (seconds 3)) - (suspend) - ) - ) - (go-virtual complete) - (while *target* - (suspend) - ) - (go-virtual fail) - (none) - ) + 0 + ) + ) + ) + ) + ) + (let ((s3-5 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s3-5) (seconds 1)) + (suspend) + ) + ) ) + ) + (let ((s4-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s4-1) (seconds 0.5)) + (suspend) + ) + ) + (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 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s4-2) (seconds 0.5)) + (suspend) + ) + ) + (send-event + (if s5-0 + (-> s5-0 extra process) + ) + 'leave + ) + (let ((s5-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s5-1) (seconds 0.2)) + (suspend) + ) + ) + (send-event + (if gp-1 + (-> gp-1 extra process) + ) + 'leave + ) + ) + (let ((gp-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-2) (seconds 3)) + (suspend) + ) + ) + (remove-setting! 'entity-name) + (remove-setting! 'process-mask) + (process-release? *target*) + (let ((gp-3 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-3) (seconds 3)) + (suspend) + ) + ) + (go-virtual complete) + (while *target* + (suspend) + ) + (go-virtual fail) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 200 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (let ((a0-1 (process-by-name "transport-level-1" *active-pool*))) - (if a0-1 - (send-event a0-1 'leave) - ) - ) - (let ((a0-3 (process-by-name "transport-level-2" *active-pool*))) - (if a0-3 - (send-event a0-3 'leave) - ) - ) - (speech-control-method-9 *speech-control*) - (none) - ) + (game-task-node forest-protect-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (let ((a0-1 (process-by-name "transport-level-1" *active-pool*))) + (if a0-1 + (send-event a0-1 'leave) ) + ) + (let ((a0-3 (process-by-name "transport-level-2" *active-pool*))) + (if a0-3 + (send-event a0-3 'leave) + ) + ) + (speech-control-method-9 *speech-control*) + (none) + ) ) ;; definition for function forest-login diff --git a/test/decompiler/reference/jak2/levels/forest/lifeseed/protect_REF.gc b/test/decompiler/reference/jak2/levels/forest/lifeseed/protect_REF.gc index 66d95dd73e..655be73934 100644 --- a/test/decompiler/reference/jak2/levels/forest/lifeseed/protect_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/lifeseed/protect_REF.gc @@ -308,361 +308,350 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 142 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set-setting! 'airlock #f 0 0) - (let ((v1-5 (entity-by-name "parking-spot-1"))) - (if v1-5 - (logior! (-> v1-5 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-7 (entity-by-name "parking-spot-2"))) - (if v1-7 - (logior! (-> v1-7 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-9 (entity-by-name "parking-spot-12"))) - (if v1-9 - (logior! (-> v1-9 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-11 (entity-by-name "parking-spot-59"))) - (if v1-11 - (logior! (-> v1-11 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-13 (entity-by-name "parking-spot-60"))) - (if v1-13 - (logior! (-> v1-13 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-15 (entity-by-name "parking-spot-61"))) - (if v1-15 - (logior! (-> v1-15 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-17 (entity-by-name "parking-spot-62"))) - (if v1-17 - (logior! (-> v1-17 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((gp-0 *traffic-manager*)) - (send-event gp-0 'set-alert-level 2) - (send-event gp-0 'set-alert-duration #xa4cb80) - (send-event gp-0 'deactivate-by-type 6) - (send-event gp-0 'deactivate-by-type 18) - (send-event gp-0 'deactivate-by-type 19) - (send-event gp-0 'deactivate-by-type 20) - (send-event gp-0 'deactivate-by-type 11) - (send-event gp-0 'deactivate-by-type 12) - (send-event gp-0 'deactivate-by-type 13) - (send-event gp-0 'deactivate-by-type 14) - (send-event gp-0 'deactivate-by-type 15) - (send-event gp-0 'deactivate-by-type 16) - (send-event gp-0 'set-object-target-count 6 0) - (send-event gp-0 'set-object-target-count 18 0) - (send-event gp-0 'set-object-target-count 19 0) - (send-event gp-0 'set-object-target-count 11 0) - (send-event gp-0 'set-object-target-count 12 0) - (send-event gp-0 'set-object-target-count 13 0) - (send-event gp-0 'set-object-target-count 14 0) - (send-event gp-0 'set-object-target-count 15 0) - (send-event gp-0 'set-object-target-count 16 0) - (send-event gp-0 'set-object-auto-activate 6 #f) - (send-event gp-0 'set-guard-target-count-range 0 4 4) - (send-event gp-0 'set-guard-target-count-range 1 5 5) - (send-event gp-0 'set-guard-target-count-range 4 0 0) - (send-event gp-0 'set-guard-target-count-range 5 0 0) - ) - (speech-control-method-10 *speech-control* 6 (new 'static 'speech-type-info - :channel #x1 - :priority -2 - :min-delay #x258 - :max-delay #x4b0 - :list (new 'static 'boxed-array :type string - "kg320a" - "kg321a" - "kg322a" - "kg323a" - "kg324a" - "kg325a" - "kg326a" - "kg327a" - "kg328a" - "kg329a" - "kg330a" - "kg331a" - "kg332a" - "kg333a" - "kg334a" - "kg335a" - "kg336a" - "kg337a" - "kg338a" - "kg339a" - "kg340a" - "kg341a" - "kg342a" - "kg343a" - "kg344a" - "kg345a" - "kg347a" - ) - ) - ) - (dotimes (gp-1 (length *city-slums-transport-info*)) - (set! (-> *city-slums-transport-info* gp-1 spawned) #f) - ) - (let ((gp-2 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-2 pos quad) (-> (new 'static 'vector :x 1666621.9 :y 32766.771 :z -1103984.6 :w 1.0) quad)) - (quaternion-identity! (-> gp-2 quat)) - (set! (-> gp-2 flags) (task-arrow-flags)) - (set! (-> gp-2 map-icon) (the-as uint 15)) - (set! (-> self arrow) (process->handle (task-arrow-spawn gp-2 (the-as task-arrow self)))) - ) - (set! (-> self data-int32 0) 0) - 0 - (none) + (game-task-node city-protect-water-slums-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set-setting! 'airlock #f 0.0 0) + (let ((v1-5 (entity-by-name "parking-spot-1"))) + (if v1-5 + (logior! (-> v1-5 extra perm status) (entity-perm-status bit-9)) + ) ) + (let ((v1-7 (entity-by-name "parking-spot-2"))) + (if v1-7 + (logior! (-> v1-7 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-9 (entity-by-name "parking-spot-12"))) + (if v1-9 + (logior! (-> v1-9 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-11 (entity-by-name "parking-spot-59"))) + (if v1-11 + (logior! (-> v1-11 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-13 (entity-by-name "parking-spot-60"))) + (if v1-13 + (logior! (-> v1-13 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-15 (entity-by-name "parking-spot-61"))) + (if v1-15 + (logior! (-> v1-15 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-17 (entity-by-name "parking-spot-62"))) + (if v1-17 + (logior! (-> v1-17 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-alert-level 2) + (send-event gp-0 'set-alert-duration #xa4cb80) + (send-event gp-0 'deactivate-by-type 6) + (send-event gp-0 'deactivate-by-type 18) + (send-event gp-0 'deactivate-by-type 19) + (send-event gp-0 'deactivate-by-type 20) + (send-event gp-0 'deactivate-by-type 11) + (send-event gp-0 'deactivate-by-type 12) + (send-event gp-0 'deactivate-by-type 13) + (send-event gp-0 'deactivate-by-type 14) + (send-event gp-0 'deactivate-by-type 15) + (send-event gp-0 'deactivate-by-type 16) + (send-event gp-0 'set-object-target-count 6 0) + (send-event gp-0 'set-object-target-count 18 0) + (send-event gp-0 'set-object-target-count 19 0) + (send-event gp-0 'set-object-target-count 11 0) + (send-event gp-0 'set-object-target-count 12 0) + (send-event gp-0 'set-object-target-count 13 0) + (send-event gp-0 'set-object-target-count 14 0) + (send-event gp-0 'set-object-target-count 15 0) + (send-event gp-0 'set-object-target-count 16 0) + (send-event gp-0 'set-object-auto-activate 6 #f) + (send-event gp-0 'set-guard-target-count-range 0 4 4) + (send-event gp-0 'set-guard-target-count-range 1 5 5) + (send-event gp-0 'set-guard-target-count-range 4 0 0) + (send-event gp-0 'set-guard-target-count-range 5 0 0) + ) + (speech-control-method-10 *speech-control* 6 (new 'static 'speech-type-info + :channel #x1 + :priority -2 + :min-delay #x258 + :max-delay #x4b0 + :list (new 'static 'boxed-array :type string + "kg320a" + "kg321a" + "kg322a" + "kg323a" + "kg324a" + "kg325a" + "kg326a" + "kg327a" + "kg328a" + "kg329a" + "kg330a" + "kg331a" + "kg332a" + "kg333a" + "kg334a" + "kg335a" + "kg336a" + "kg337a" + "kg338a" + "kg339a" + "kg340a" + "kg341a" + "kg342a" + "kg343a" + "kg344a" + "kg345a" + "kg347a" + ) + ) + ) + (dotimes (gp-1 (length *city-slums-transport-info*)) + (set! (-> *city-slums-transport-info* gp-1 spawned) #f) + ) + (let ((gp-2 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-2 pos quad) (-> (new 'static 'vector :x 1666621.9 :y 32766.771 :z -1103984.6 :w 1.0) quad)) + (quaternion-identity! (-> gp-2 quat)) + (set! (-> gp-2 flags) (task-arrow-flags)) + (set! (-> gp-2 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-2 (the-as task-arrow self)))) + ) + (set! (-> self data-int32 0) 0) + 0 + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 142 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (let ((a0-0 *traffic-manager*)) - (send-event a0-0 'restore-default-settings) - ) - (none) - ) - ) + (game-task-node city-protect-water-slums-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (let ((a0-0 *traffic-manager*)) + (send-event a0-0 'restore-default-settings) + ) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 142 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (local-vars (s5-4 object)) - (let ((s4-0 (new 'static 'vector :x 1666621.9 :y 32766.771 :z -1103984.6 :w 1.0)) - (gp-0 (vector-z-quaternion! - (new 'stack-no-clear 'vector) - (new 'static 'quaternion :x -0.0015 :y -0.199 :z 0.0002 :w -0.9799) + (game-task-node city-protect-water-slums-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (local-vars (s5-4 object)) + (let ((s4-0 (new 'static 'vector :x 1666621.9 :y 32766.771 :z -1103984.6 :w 1.0)) + (gp-0 (vector-z-quaternion! + (new 'stack-no-clear 'vector) + (new 'static 'quaternion :x -0.0015 :y -0.199 :z 0.0002 :w -0.9799) + ) + ) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-! s5-0 (target-pos 0) s4-0) + (let ((v1-1 s5-0)) + (if (and (< (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 122880.0) + (< 0.0 (vector-dot s5-0 gp-0)) + ) + (set! (-> self data-int32 0) 1) + ) + ) + ) + (cond + ((zero? (-> self data-int32 0)) + (dotimes (gp-1 (length *city-slums-transport-info*)) + (let ((s5-1 (-> *city-slums-transport-info* gp-1))) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + 0.0 + (let ((f0-7 (vector-vector-xz-distance (target-pos 0) (-> s5-1 t-pos)))) + (cond + ((and (< f0-7 327680.0) (< 204800.0 f0-7)) + (when (and (not (handle->process (-> self slave gp-1))) + (< (the int (-> self data-float gp-1)) (-> self clock frame-counter)) + ) + (let ((s4-2 (new 'stack-no-clear 'transport-params))) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (set! (-> s3-2 quad) (-> s5-1 t-pos quad)) + (set! (-> s4-2 spawn-pos quad) (-> s5-1 t-pos quad)) + (quaternion-copy! (-> s4-2 quat) (-> s5-1 t-quat)) + (set! (-> s4-2 max-guard) (-> s5-1 num-guard)) + (set! (-> s4-2 max-guard) (the-as uint 8)) + (set! (-> s4-2 turret?) #t) + (set! (-> s4-2 speeches?) #t) + (set! (-> s3-2 y) 0.0) + ) + (let* ((s5-2 (entity-nav-mesh-by-aid (the-as actor-id 9070))) + (a0-16 (if (type? s5-2 entity-nav-mesh) + s5-2 + ) + ) + ) + (when a0-16 + (set! (-> s4-2 nav-mesh) (-> a0-16 nav-mesh)) + (set! (-> self slave gp-1) (ppointer->handle (process-spawn transport s4-2 :to self))) + ) + ) ) ) - (s5-0 (new 'stack-no-clear 'vector)) + ) + ((< 368640.0 f0-7) + (if (handle->process (-> self slave gp-1)) + (send-event (handle->process (-> self slave gp-1)) 'leave) + ) + ) + ) + ) + ) + (if (and (handle->process (-> self slave gp-1)) + (begin + (let ((s5-5 #t) + (a1-11 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-11 from) (process->ppointer self)) + (set! (-> a1-11 num-params) 0) + (set! (-> a1-11 message) 'guards-left) + (let ((v1-75 (the-as object (send-event-function (handle->process (-> self slave gp-1)) a1-11)))) + (cmove-#f-nonzero s5-4 v1-75 s5-5) + ) + ) + s5-4 + ) + ) + (set! (-> self data-float gp-1) (the float (+ (-> self clock frame-counter) (seconds 20)))) + ) + ) + ) + (else + (let ((gp-2 0)) + (dotimes (s5-6 (length *city-slums-transport-info*)) + (when (handle->process (-> self slave s5-6)) + (send-event (handle->process (-> self slave s5-6)) 'leave) + (+! gp-2 1) + ) ) - (vector-! s5-0 (target-pos 0) s4-0) - (let ((v1-1 s5-0)) - (if (and (< (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 122880.0) - (< 0.0 (vector-dot s5-0 gp-0)) - ) - (set! (-> self data-int32 0) 1) + (if (zero? gp-2) + (go-virtual complete) ) ) ) - (cond - ((zero? (-> self data-int32 0)) - (dotimes (gp-1 (length *city-slums-transport-info*)) - (let ((s5-1 (-> *city-slums-transport-info* gp-1))) - (new 'stack-no-clear 'vector) - (new 'stack-no-clear 'vector) - (new 'stack-no-clear 'vector) - (new 'stack-no-clear 'vector) - 0.0 - (let ((f0-7 (vector-vector-xz-distance (target-pos 0) (-> s5-1 t-pos)))) - (cond - ((and (< f0-7 327680.0) (< 204800.0 f0-7)) - (when (and (not (handle->process (-> self slave gp-1))) - (< (the int (-> self data-float gp-1)) (-> self clock frame-counter)) - ) - (let ((s4-2 (new 'stack-no-clear 'transport-params))) - (let ((s3-2 (new 'stack-no-clear 'vector))) - (set! (-> s3-2 quad) (-> s5-1 t-pos quad)) - (set! (-> s4-2 spawn-pos quad) (-> s5-1 t-pos quad)) - (quaternion-copy! (-> s4-2 quat) (-> s5-1 t-quat)) - (set! (-> s4-2 max-guard) (-> s5-1 num-guard)) - (set! (-> s4-2 max-guard) (the-as uint 8)) - (set! (-> s4-2 turret?) #t) - (set! (-> s4-2 speeches?) #t) - (set! (-> s3-2 y) 0.0) - ) - (let* ((s5-2 (entity-nav-mesh-by-aid (the-as actor-id 9070))) - (a0-16 (if (type? s5-2 entity-nav-mesh) - s5-2 - ) - ) - ) - (when a0-16 - (set! (-> s4-2 nav-mesh) (-> a0-16 nav-mesh)) - (set! (-> self slave gp-1) (ppointer->handle (process-spawn transport s4-2 :to self))) - ) - ) - ) - ) - ) - ((< 368640.0 f0-7) - (if (handle->process (-> self slave gp-1)) - (send-event (handle->process (-> self slave gp-1)) 'leave) - ) - ) - ) - ) - ) - (if (and (handle->process (-> self slave gp-1)) - (begin - (let ((s5-5 #t) - (a1-11 (new 'stack-no-clear 'event-message-block)) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-protect-water-slums-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (until #f + (suspend) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-protect-water-slums-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (send-event (handle->process (-> self arrow)) 'leave) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (talker-spawn-func (-> *talker-speech* 185) *entity-pool* (target-pos 0) (the-as region #f)) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-protect-water-slums-resolution) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager () (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-protect-water-slums-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-protect-water-slums-fight) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set! (-> self slave 0) + (ppointer->handle (seal-of-mar-spawn + self + (new 'static 'vector :x 3150154.5 :y 41696.617 :z -2989634.8 :w 1.0) + (new 'static 'vector :x -0.0086 :y -0.0227 :z -0.691 :w 0.7223) + (new 'static 'vector :x 0.06 :y 0.06 :z 0.06 :w 1.0) + ) ) - (set! (-> a1-11 from) (process->ppointer self)) - (set! (-> a1-11 num-params) 0) - (set! (-> a1-11 message) 'guards-left) - (let ((v1-75 (the-as object (send-event-function (handle->process (-> self slave gp-1)) a1-11)))) - (cmove-#f-nonzero s5-4 v1-75 s5-5) - ) - ) - s5-4 - ) - ) - (set! (-> self data-float gp-1) (the float (+ (-> self clock frame-counter) (seconds 20)))) + ) + (set! (-> self slave 1) (the-as handle #f)) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-protect-water-slums-fight) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (when (handle->process (-> self slave 0)) + (let ((f0-0 + (vector-vector-xz-distance (new 'static 'vector :x 3132661.8 :y 33669.12 :z -2965708.8 :w 1.0) (target-pos 0)) + ) + ) + (cond + ((< f0-0 20480.0) + (when (!= (-> self slave 0) #f) + (deactivate (handle->process (-> self slave 0))) + (set! (-> self slave 0) (the-as handle #f)) + ) + (if (= (-> self slave 1) #f) + (set! (-> self slave 1) + (ppointer->handle (process-spawn scene-player :init scene-player-init "city-protect-slums-intro" #t #f)) + ) ) ) - ) - (else - (let ((gp-2 0)) - (dotimes (s5-6 (length *city-slums-transport-info*)) - (when (handle->process (-> self slave s5-6)) - (send-event (handle->process (-> self slave s5-6)) 'leave) - (+! gp-2 1) - ) - ) - (if (zero? gp-2) - (go-virtual complete) - ) - ) + ((< f0-0 163840.0) + (script-eval '(want-anim "city-protect-slums-intro")) + ) ) ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! *game-info* 142 3 (the-as (function object) (lambda :behavior task-manager - () - (until #f - (suspend) - ) - #f - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 142 - 4 - (the-as - (function object) - (lambda :behavior task-manager - () - (send-event (handle->process (-> self arrow)) 'leave) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) - (suspend) - ) - (talker-spawn-func (-> *talker-speech* 185) *entity-pool* (target-pos 0) (the-as region #f)) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! *game-info* 142 5 (the-as (function object) (lambda :behavior task-manager () (none)))) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 142 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 141 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self slave 0) - (ppointer->handle (seal-of-mar-spawn - self - (new 'static 'vector :x 3150154.5 :y 41696.617 :z -2989634.8 :w 1.0) - (new 'static 'vector :x -0.0086 :y -0.0227 :z -0.691 :w 0.7223) - (new 'static 'vector :x 0.06 :y 0.06 :z 0.06 :w 1.0) - ) - ) - ) - (set! (-> self slave 1) (the-as handle #f)) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 141 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (handle->process (-> self slave 0)) - (let ((f0-0 - (vector-vector-xz-distance (new 'static 'vector :x 3132661.8 :y 33669.12 :z -2965708.8 :w 1.0) (target-pos 0)) - ) - ) - (cond - ((< f0-0 20480.0) - (when (!= (-> self slave 0) #f) - (deactivate (handle->process (-> self slave 0))) - (set! (-> self slave 0) (the-as handle #f)) - ) - (if (= (-> self slave 1) #f) - (set! (-> self slave 1) - (ppointer->handle (process-spawn scene-player :init scene-player-init "city-protect-slums-intro" #t #f)) - ) - ) - ) - ((< f0-0 163840.0) - (script-eval '(want-anim "city-protect-slums-intro")) - ) - ) - ) - ) - (none) ) + (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc index 2d1f1a3812..6a529a772d 100644 --- a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc @@ -1093,7 +1093,7 @@ The faster it's moving the fast it flaps it's wings, etc ) (set! (-> self state-time) (-> self clock frame-counter)) (set! (-> self far-time) (-> self clock frame-counter)) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) (none) ) :exit (behavior () @@ -1154,7 +1154,7 @@ The faster it's moving the fast it flaps it's wings, etc ) (set! (-> self near-timer) 3000) (set! (-> self far-time) (-> self clock frame-counter)) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) (none) ) :exit (behavior () @@ -1246,7 +1246,7 @@ The faster it's moving the fast it flaps it's wings, etc (t9-0) ) ) - (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-mode #f 0.0 1) (none) ) :exit (behavior () @@ -1494,8 +1494,8 @@ The faster it's moving the fast it flaps it's wings, etc ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 107 - 0 + (game-task-node forest-scouts-pegasus) + TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () (set! (-> *game-info* controller 0) (process->handle self)) @@ -1521,49 +1521,43 @@ The faster it's moving the fast it flaps it's wings, etc ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 107 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (local-vars (data int)) - (set! (-> self start-time) (-> self clock frame-counter)) - (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-pegasus :init hud-init-by-other :to self))) - (while (> (-> self data-int32 0) 0) - (set! data (-> self data-int32 1)) - (when (-> self actor-group 0) - (dotimes (actor-group (the-as int (-> self actor-group 0 0))) - (let ((actor (-> (&+ (-> self actor-group 0) (* actor-group 8)) 3))) - (if (and actor (logtest? (-> actor extra perm status) (entity-perm-status subtask-complete))) - (set! data (+ data -1)) - ) - ) + (game-task-node forest-scouts-pegasus) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (local-vars (data int)) + (set! (-> self start-time) (-> self clock frame-counter)) + (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-pegasus :init hud-init-by-other :to self))) + (while (> (-> self data-int32 0) 0) + (set! data (-> self data-int32 1)) + (when (-> self actor-group 0) + (dotimes (actor-group (the-as int (-> self actor-group 0 0))) + (let ((actor (-> (&+ (-> self actor-group 0) (* actor-group 8)) 3))) + (if (and actor (logtest? (-> actor extra perm status) (entity-perm-status subtask-complete))) + (set! data (+ data -1)) + ) ) ) - (let ((_data data)) - (set! (-> self data-int32 0) _data) - (set! (-> *game-info* counter) (the float _data)) - ) - (suspend) ) - (go-virtual complete) - (none) + (let ((_data data)) + (set! (-> self data-int32 0) _data) + (set! (-> *game-info* counter) (the float _data)) + ) + (suspend) ) + (go-virtual complete) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 107 - 4 - (the-as - (function object) - (lambda () - (task-node-close! (game-task-node forest-scouts-resolution)) - (talker-spawn-func (-> *talker-speech* 90) *entity-pool* (target-pos 0) (the-as region #f)) - (none) - ) + (game-task-node forest-scouts-pegasus) + TASK_MANAGER_COMPLETE_HOOK + (lambda () + (task-node-close! (game-task-node forest-scouts-resolution)) + (talker-spawn-func (-> *talker-speech* 90) *entity-pool* (target-pos 0) (the-as region #f)) + (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fordumpa-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fordumpa-obs_REF.gc index a10a3a69a4..ae86921b46 100644 --- a/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fordumpa-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fordumpa-obs_REF.gc @@ -180,8 +180,8 @@ ) ) (when v1-22 - (set-setting! 'entity-name "camera-180" 0 0) - (set-setting! 'process-mask 'set 0 (process-mask movie enemy)) + (set-setting! 'entity-name "camera-180" 0.0 0) + (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (process-grab? *target* #f) (let ((a1-13 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-13 from) (process->ppointer self)) diff --git a/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fordumpc-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fordumpc-obs_REF.gc index 0809acddde..1320d45312 100644 --- a/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fordumpc-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fordumpc-obs_REF.gc @@ -695,8 +695,8 @@ This commonly includes things such as: (while (not (process-grab? *target* #f)) (suspend) ) - (set-setting! 'entity-name "camera-182" 0 0) - (set-setting! 'process-mask 'set 0 (process-mask movie enemy)) + (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 (-> self clock frame-counter))) (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.75)) @@ -816,8 +816,8 @@ This commonly includes things such as: ) ) :enter (behavior () - (set-setting! 'allow-pause #f 0 0) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (none) ) :exit (behavior () diff --git a/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank-turret_REF.gc b/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank-turret_REF.gc index 98ea019547..0077e7382f 100644 --- a/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank-turret_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank-turret_REF.gc @@ -689,7 +689,7 @@ ) (ja-no-eval :group! (-> self draw art-group data 3) :num! zero) (ja-post) - (set-setting! 'spotlight-color #f 0 (the-as uint #x80a0a0ff)) + (set-setting! 'spotlight-color #f 0.0 (the-as uint #x80a0a0ff)) (go-virtual idle) (none) ) @@ -834,7 +834,7 @@ ;; definition for function draw-2d-hud ;; INFO: Used lq/sq ;; WARN: Return type mismatch pointer vs symbol. -;; ERROR: Failed store: (s.w! (+ t5-0 8) 0) at op 82 +;; ERROR: Failed load: (set! t0-6 (l.d (+ a0-28 8))) at op 170 (defun draw-2d-hud ((arg0 vector)) "Unused but, maybe useful? TODO - dma buffer casting" (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector4w 4)) diff --git a/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank_REF.gc b/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank_REF.gc index c37252e4fb..9cfe22b165 100644 --- a/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank_REF.gc @@ -333,7 +333,7 @@ (new 'static 'fort-robotank-segment-event :event-type 'code :pos-norm 0.01 - :param-obj (lambda () (set-setting! 'target-height 'abs -981467136 0) (none)) + :param-obj (lambda () (set-setting! 'target-height 'abs (meters -1) 0) (none)) ) (new 'static 'fort-robotank-segment-event :event-type 'send-event @@ -733,11 +733,11 @@ ) ) (('pov-cam-on) - (set-setting! 'mode-name 'cam-pov-track 0 0) - (set-setting! 'allow-look-around #f 0 0) - (set-setting! 'target-height 'abs -968884224 0) + (set-setting! 'mode-name 'cam-pov-track 0.0 0) + (set-setting! 'allow-look-around #f 0.0 0) + (set-setting! 'target-height 'abs (meters -3) 0) (let ((v1-27 (process->ppointer obj))) - (set-setting! 'pov-handle v1-27 #x40400000 (-> v1-27 0 pid)) + (set-setting! 'pov-handle v1-27 3.0 (-> v1-27 0 pid)) ) (set-setting! 'pov-offset 'asdf (-> obj pov-cam-offset) 0) (send-event (handle->process (-> obj turret)) 'pov-cam-on) @@ -763,8 +763,8 @@ ) (('external-cam-on) (hide-hud-quick #f) - (set-setting! 'entity-name (-> sv-96 actor) 0 0) - (set-setting! 'process-mask 'set 0 (process-mask movie enemy)) + (set-setting! 'entity-name (-> sv-96 actor) 0.0 0) + (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (remove-setting! 'target-height) (process-grab? *target* #f) (send-event (handle->process (-> obj turret)) 'fire-suppress #t) @@ -827,8 +827,8 @@ ) (when (logtest? (-> self flags) 32) (set! (-> self flags) (logand -33 (-> self flags))) - (set-setting! 'music 'danger11 0 0) - (set-setting! 'music-volume 'rel #x3f666666 0) + (set-setting! 'music 'danger11 0.0 0) + (set-setting! 'music-volume 'rel 0.9 0) (go-virtual moving) ) (none) 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 e84e209c01..b4a73f2bd1 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 @@ -370,16 +370,20 @@ This commonly includes things such as: ) ;; failed to figure out what this is: -(set-subtask-hook! *game-info* 2 3 (lambda :behavior task-manager - () - (until #f - (sound-play "fortress-alarm") - (let ((gp-1 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) - (suspend) - ) - ) - ) - (the-as object #f) - ) - ) +(set-subtask-hook! + *game-info* + (game-task-node fortress-escape-introduction) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (until #f + (sound-play "fortress-alarm") + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (suspend) + ) + ) + ) + (the-as object #f) + ) + ) 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 ec47b0dd28..8861a8fd4e 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 @@ -296,8 +296,8 @@ This commonly includes things such as: ) ) (hide-hud-quick #f) - (set-setting! 'entity-name "camera-243" 0 0) - (set-setting! 'process-mask 'set 0 (process-mask movie enemy)) + (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 (-> self clock frame-counter))) (until (>= (- (-> self clock frame-counter) gp-2) (seconds 2)) @@ -406,7 +406,7 @@ This commonly includes things such as: ) ) ) - (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'interp-time 'abs 0.0 0) (remove-setting! 'entity-name) (remove-setting! 'process-mask) (dotimes (gp-1 2) diff --git a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc index 5ac27b9353..2fe3a9504d 100644 --- a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc @@ -688,6 +688,7 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-conveyor +;; INFO: this function exists in multiple non-identical object files (defmethod inspect fort-conveyor ((obj fort-conveyor)) (when (not obj) (set! obj obj) @@ -707,12 +708,14 @@ This commonly includes things such as: ) ;; definition for method 22 of type fort-conveyor +;; INFO: this function exists in multiple non-identical object files (defmethod get-art-group fort-conveyor ((obj fort-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-fort-conveyor" (the-as (pointer uint32) #f)) ) ;; definition for method 23 of type fort-conveyor +;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch collide-shape-moving vs none. (defmethod reset-root! fort-conveyor ((obj fort-conveyor)) "Re-initializes the `root` [[trsqv]]" @@ -743,6 +746,7 @@ This commonly includes things such as: ) ;; definition for method 24 of type fort-conveyor +;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch vector vs none. (defmethod init! fort-conveyor ((obj fort-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" @@ -756,6 +760,7 @@ This commonly includes things such as: ) ;; definition for method 25 of type fort-conveyor +;; INFO: this function exists in multiple non-identical object files (defmethod set-and-get-ambient-sound! fort-conveyor ((obj fort-conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" @@ -774,125 +779,119 @@ and return it as well. Otherwise, set it to `0`" ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 172 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'sound-mode #f 0 1) - (set-setting! 'sound-excitement 'abs #x3f4ccccd 0) - (speech-control-method-10 - *speech-control* - 6 - (new 'static 'speech-type-info - :min-delay #x4b0 - :max-delay #x960 - :list (new 'static 'boxed-array :type string - "kg001" - "kg002" - "kg004" - "kg006" - "kg001a" - "kg013" - "kg016" - "kg018" - "kg019" - "kg023" - "kg024" - "kg002a" - "kg004a" - "kg078a" - "kg079a" - "kg080a" - "kg081a" - "kg004a" - "kg082a" - "kg083a" - "kg084a" - "kg085a" - "kg086a" - "kg087a" - "kg088a" - "kg091a" - "kg023a" - "kg006a" - "kg092a" - "kg020a" - "kg093a" - "kg094a" - "kg095a" - "kg103a" - "kg104a" - "kg112a" - "kg024a" - "kg134" - "kg136" - "kg137" - "kg138" - "kg139" - "kg140" - "kg141" - ) + (game-task-node fortress-save-friends-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'sound-mode #f 0.0 1) + (set-setting! 'sound-excitement 'abs 0.8 0) + (speech-control-method-10 + *speech-control* + 6 + (new 'static 'speech-type-info + :min-delay #x4b0 + :max-delay #x960 + :list (new 'static 'boxed-array :type string + "kg001" + "kg002" + "kg004" + "kg006" + "kg001a" + "kg013" + "kg016" + "kg018" + "kg019" + "kg023" + "kg024" + "kg002a" + "kg004a" + "kg078a" + "kg079a" + "kg080a" + "kg081a" + "kg004a" + "kg082a" + "kg083a" + "kg084a" + "kg085a" + "kg086a" + "kg087a" + "kg088a" + "kg091a" + "kg023a" + "kg006a" + "kg092a" + "kg020a" + "kg093a" + "kg094a" + "kg095a" + "kg103a" + "kg104a" + "kg112a" + "kg024a" + "kg134" + "kg136" + "kg137" + "kg138" + "kg139" + "kg140" + "kg141" ) ) - (speech-control-method-10 - *speech-control* - 9 - (new 'static 'speech-type-info - :priority 1 - :min-delay #x12c - :max-delay #x258 - :list (new 'static 'boxed-array :type string - "kg133" - "kg142" - "kg144" - "kg145" - "kg146" - "kg147" - "kg148" - "kg149" - "kg150" - "kg138" - "kg151" - "kg152" - "kg153" - "kg154" - "kg155" - "kg159" - "kg163" - "kg164" - ) - ) - ) - (speech-control-method-10 - *speech-control* - 10 - (new 'static 'speech-type-info :priority #xa :max-delay #x12c :list (new 'static 'boxed-array :type string - "kg166" - "kg167" - "kg168" - "kg169" - "kg171" - "kg172" - "kg173" - "kg174" - "kg175" - ) - ) - ) - (none) ) + (speech-control-method-10 + *speech-control* + 9 + (new 'static 'speech-type-info + :priority 1 + :min-delay #x12c + :max-delay #x258 + :list (new 'static 'boxed-array :type string + "kg133" + "kg142" + "kg144" + "kg145" + "kg146" + "kg147" + "kg148" + "kg149" + "kg150" + "kg138" + "kg151" + "kg152" + "kg153" + "kg154" + "kg155" + "kg159" + "kg163" + "kg164" + ) + ) + ) + (speech-control-method-10 + *speech-control* + 10 + (new 'static 'speech-type-info :priority #xa :max-delay #x12c :list (new 'static 'boxed-array :type string + "kg166" + "kg167" + "kg168" + "kg169" + "kg171" + "kg172" + "kg173" + "kg174" + "kg175" + ) + ) + ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 172 - 1 - (the-as - (function object) - (lambda :behavior task-manager () (speech-control-method-9 *speech-control*) (none)) - ) + (game-task-node fortress-save-friends-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager () (speech-control-method-9 *speech-control*) (none)) ) diff --git a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc index 1d59a9b132..ce4576fd0f 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc @@ -265,7 +265,7 @@ This commonly includes things such as: (cond ((= (-> (level-get-target-inside *level*) name) 'gungame) (when (or (zero? (-> obj in-out)) (= (-> obj in-out) 1)) - (set-setting! 'minimap 'clear 0 128) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> obj in-out) (the-as uint 2)) ) ) @@ -1237,7 +1237,7 @@ This commonly includes things such as: (set! (-> self training-goal) 4000.0) (set! (-> self training?) #t) ) - (set-setting! 'features 'clear 0 896) + (set-setting! 'features 'clear 0.0 (game-feature gun-red gun-blue gun-dark)) (if (!= (-> *game-info* gun-type) 1) (send-event *target* 'change-mode 'gun #f 1) ) @@ -1253,7 +1253,7 @@ This commonly includes things such as: (set! (-> self training-goal) 3000.0) (set! (-> self training?) #t) ) - (set-setting! 'features 'clear 0 832) + (set-setting! 'features 'clear 0.0 (game-feature gun-yellow gun-blue gun-dark)) (if (!= (-> *game-info* gun-type) 2) (send-event *target* 'change-mode 'gun #f 2) ) @@ -1264,7 +1264,7 @@ This commonly includes things such as: (set! (-> self task-silver) (the-as uint 101)) (set! (-> self task-bronze) (the-as uint 100)) (set! (-> *game-info* goal) 4000.0) - (set-setting! 'features 'clear 0 704) + (set-setting! 'features 'clear 0.0 (game-feature gun-yellow gun-red gun-dark)) (if (!= (-> *game-info* gun-type) 3) (send-event *target* 'change-mode 'gun #f 3) ) @@ -1787,8 +1787,15 @@ This commonly includes things such as: ) ) (else - (set! (-> *game-info* sub-task-list 76 death-count) - (the-as uint (seekl (the-as int (-> *game-info* sub-task-list 76 death-count)) #xffff 1)) + (set! (-> *game-info* sub-task-list (game-task-node city-yellow-gun-training-resolution) death-count) + (the-as + uint + (seekl + (the-as int (-> *game-info* sub-task-list (game-task-node city-yellow-gun-training-resolution) death-count)) + #xffff + 1 + ) + ) ) (let ((v1-28 (rand-vu-int-count 4))) (cond @@ -1850,8 +1857,15 @@ This commonly includes things such as: ) ) (else - (set! (-> *game-info* sub-task-list 28 death-count) - (the-as uint (seekl (the-as int (-> *game-info* sub-task-list 28 death-count)) #xffff 1)) + (set! (-> *game-info* sub-task-list (game-task-node city-red-gun-training-resolution) death-count) + (the-as + uint + (seekl + (the-as int (-> *game-info* sub-task-list (game-task-node city-red-gun-training-resolution) death-count)) + #xffff + 1 + ) + ) ) (let ((v1-46 (rand-vu-int-count 4))) (cond @@ -2260,7 +2274,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set-setting! 'darkjak #f 0 0) + (set-setting! 'darkjak #f 0.0 0) (set! sv-16 (new 'static 'res-tag)) (let ((v1-3 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond @@ -2292,7 +2306,7 @@ This commonly includes things such as: (training-manager-method-27 obj *blue-training-path-global-info*) (training-manager-method-27 obj *peace-training-path-global-info*) (training-manager-method-22 obj #f) - (set-setting! 'speech-control #f 0 0) + (set-setting! 'speech-control #f 0.0 0) (go (method-of-object obj wait)) (none) ) @@ -2623,8 +2637,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 43 - 0 + (game-task-node sewer-enemy-resolution) + TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () (let ((s5-0 (new 'static 'fact-info :pickup-type (pickup-type gun-yellow) :pickup-spawn-amount 1.0)) @@ -2654,8 +2668,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 43 - 2 + (game-task-node sewer-enemy-resolution) + TASK_MANAGER_UPDATE_HOOK (lambda :behavior task-manager () (the-as object (gui-control-method-12 *gui-control* self @@ -2673,8 +2687,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 177 - 0 + (game-task-node sewer-escort-get-gun) + TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () (let ((s5-0 (new 'static 'fact-info :pickup-type (pickup-type gun-dark) :pickup-spawn-amount 1.0)) @@ -2704,8 +2718,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 177 - 2 + (game-task-node sewer-escort-get-gun) + TASK_MANAGER_UPDATE_HOOK (lambda :behavior task-manager () (the-as object (gui-control-method-12 *gui-control* self @@ -2998,3 +3012,7 @@ This commonly includes things such as: :save #t ) ) + + + + diff --git a/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc b/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc index 791946b64c..800e6bbb01 100644 --- a/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc @@ -207,7 +207,7 @@ This commonly includes things such as: (set! (-> obj draw shadow-ctrl) v1-9) ) (hide-light-spawn obj *zero-vector* (-> obj node-list data 12)) - (set-setting! 'spotlight-color #f 0 (the-as uint #x80c0c0c0)) + (set-setting! 'spotlight-color #f 0.0 (the-as uint #x80c0c0c0)) (ja-post) (go (method-of-object obj idle)) (none) diff --git a/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc index 62c66eff0a..8cac3d5b0e 100644 --- a/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc @@ -156,7 +156,7 @@ This commonly includes things such as: (defstate play-game (hip-whack-a-metal) :virtual #t :code (behavior ((arg0 game-task-event)) - (set-setting! 'borrow '((hiphog 0 lwhack special)) 0 0) + (set-setting! 'borrow '((hiphog 0 lwhack special)) 0.0 0) (process-taskable-anim-loop (the-as (function process-taskable object) (lambda () (!= (level-status *level* 'lwhack) 'active))) ) diff --git a/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc index 3eb382653d..2bd5ccc214 100644 --- a/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc +++ b/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc @@ -2207,8 +2207,8 @@ (when arg0 (set! (-> *game-info* score) 0.0) (sound-play "whack-start") - (add-setting! 'music 'danger3 0 0) - (set-setting! 'entity-name (res-lump-struct (-> self entity) 'camera-name structure) 0 0) + (add-setting! 'music 'danger3 0.0 0) + (set-setting! 'entity-name (res-lump-struct (-> self entity) 'camera-name structure) 0.0 0) (set! (-> self bopper) (process-spawn manipy :init manipy-init @@ -2222,8 +2222,8 @@ ) ) (send-event (ppointer->process (-> self bopper)) 'anim-mode 'clone-anim) - (set-setting! 'airlock #f 0 0) - (set-setting! 'borrow '((ctywide 1 lwidea #f) (hiphog 0 lwhack special)) 0 0) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'borrow '((ctywide 1 lwidea #f) (hiphog 0 lwhack special)) 0.0 0) (want-display-level *load-state* 'ctyport #f) (want-display-level *load-state* 'ctywide #f) (set! (-> self speech-time) (-> self clock frame-counter)) @@ -2781,7 +2781,7 @@ (ja :num! (loop!)) ) ) - (let* ((v1-32 (-> *game-info* sub-task-list 226)) + (let* ((v1-32 (-> *game-info* sub-task-list (game-task-node city-whack-resolution))) (v1-34 (if (-> v1-32 info) (-> v1-32 info manager) (the-as handle #f) @@ -2862,7 +2862,7 @@ (set! (-> a1-11 num-params) 0) (set! (-> a1-11 message) 'complete) (let ((t9-20 send-event-function) - (v1-34 (-> *game-info* sub-task-list 226)) + (v1-34 (-> *game-info* sub-task-list (game-task-node city-whack-resolution))) ) (t9-20 (handle->process (if (-> v1-34 info) @@ -2924,8 +2924,8 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 226 - 0 + (game-task-node city-whack-resolution) + TASK_MANAGER_INIT_HOOK (lambda :behavior whack-a-metal () (let ((gp-0 (entity-by-name "hip-whack-a-metal-2"))) (if gp-0 (process-spawn whack-a-metal :init whack-a-metal-init gp-0 :to self) 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 1c9fdb7c6b..f798388783 100644 --- a/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc @@ -3263,7 +3263,7 @@ (* 0.2 (-> self clock seconds-per-frame)) (bucket-id screen-filter) ) - (set-setting! 'allow-blackout #f 0 0) + (set-setting! 'allow-blackout #f 0.0 0) ) (none) ) @@ -3763,7 +3763,12 @@ (485 (apply ,(lambda () - (set-setting! 'borrow '((ctywide 0 lcguard special) (prison 0 ldjakbrn special) (introcst 0 lcitylow #f)) 0 0) + (set-setting! + 'borrow + '((ctywide 0 lcguard special) (prison 0 ldjakbrn special) (introcst 0 lcitylow #f)) + 0.0 + 0 + ) (apply-settings *setting-control*) ) ) @@ -3772,7 +3777,7 @@ (apply ,(lambda () (with-pp - (set-setting! 'allow-blackout #f 0 0) + (set-setting! 'allow-blackout #f 0.0 0) (setup *screen-filter* (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) diff --git a/test/decompiler/reference/jak2/levels/landing_pad/castle-obs_REF.gc b/test/decompiler/reference/jak2/levels/landing_pad/castle-obs_REF.gc index c274800628..da284192a5 100644 --- a/test/decompiler/reference/jak2/levels/landing_pad/castle-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/landing_pad/castle-obs_REF.gc @@ -2684,7 +2684,7 @@ This commonly includes things such as: ) (let ((a3-4 (res-lump-struct (-> self entity) 'camera-name structure))) (if a3-4 - (set-setting! 'entity-name a3-4 0 0) + (set-setting! 'entity-name a3-4 0.0 0) ) ) (let ((gp-5 (-> self clock frame-counter))) @@ -2718,7 +2718,7 @@ This commonly includes things such as: ) (let ((a3-6 (res-lump-struct (-> self entity) 'camera-name structure))) (if a3-6 - (set-setting! 'entity-name a3-6 0 0) + (set-setting! 'entity-name a3-6 0.0 0) ) ) (let ((gp-7 (-> self clock frame-counter))) @@ -2815,7 +2815,7 @@ This commonly includes things such as: ) (let ((a3-2 (res-lump-struct (-> self entity) 'camera-name structure))) (if a3-2 - (set-setting! 'entity-name a3-2 0 0) + (set-setting! 'entity-name a3-2 0.0 0) ) ) (let ((gp-2 (-> self clock frame-counter))) diff --git a/test/decompiler/reference/jak2/levels/mars_tomb/left/chase/target-indax_REF.gc b/test/decompiler/reference/jak2/levels/mars_tomb/left/chase/target-indax_REF.gc index 4d9644129e..c1264b7d15 100644 --- a/test/decompiler/reference/jak2/levels/mars_tomb/left/chase/target-indax_REF.gc +++ b/test/decompiler/reference/jak2/levels/mars_tomb/left/chase/target-indax_REF.gc @@ -1460,7 +1460,7 @@ ) (set! (-> self neck flex-blend) 0.0) (target-timed-invulnerable-off self 0) - (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile death)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) (apply-settings *setting-control*) (set! (-> self control transv quad) (the-as uint128 0)) (logior! (-> self focus-status) (focus-status dead)) diff --git a/test/decompiler/reference/jak2/levels/mars_tomb/tomb-obs_REF.gc b/test/decompiler/reference/jak2/levels/mars_tomb/tomb-obs_REF.gc index 7d168e9a5f..2c9d30a17b 100644 --- a/test/decompiler/reference/jak2/levels/mars_tomb/tomb-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/mars_tomb/tomb-obs_REF.gc @@ -592,7 +592,7 @@ This commonly includes things such as: (set! (-> self camera-state) 3) ) ((and (= (-> self camera-state) 1) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 8))) - (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) (set! (-> self camera-state) 2) @@ -610,7 +610,7 @@ This commonly includes things such as: (suspend) (set! v1-5 (or (not *target*) (process-grab? *target* #f))) ) - (set-setting! 'entity-name "camera-171" 0 0) + (set-setting! 'entity-name "camera-171" 0.0 0) (set! (-> self camera-state) 1) (ja-channel-push! 1 (seconds 2)) (ja :group! (-> self draw art-group data 3) :num! min) @@ -704,7 +704,7 @@ This commonly includes things such as: ) ) ((and (= (-> self camera-state) 1) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 4))) - (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) (set! (-> self camera-state) 2) @@ -733,7 +733,7 @@ This commonly includes things such as: (suspend) (set! v1-1 (or (not *target*) (process-grab? *target* #f))) ) - (set-setting! 'entity-name "camera-170" 0 0) + (set-setting! 'entity-name "camera-170" 0.0 0) (set! (-> self state-time) (-> self clock frame-counter)) (set! (-> self camera-state) 1) (ja-channel-push! 1 (seconds 2)) diff --git a/test/decompiler/reference/jak2/levels/mars_tomb/tomb-water_REF.gc b/test/decompiler/reference/jak2/levels/mars_tomb/tomb-water_REF.gc index 1745614e50..4840cf98dc 100644 --- a/test/decompiler/reference/jak2/levels/mars_tomb/tomb-water_REF.gc +++ b/test/decompiler/reference/jak2/levels/mars_tomb/tomb-water_REF.gc @@ -710,8 +710,8 @@ This commonly includes things such as: (set! (-> v1-15 user-int8 1) 1) ) ) - (set-setting! 'gun #f 0 0) - (set-setting! 'entity-name "camera-194" 0 0) + (set-setting! 'gun #f 0.0 0) + (set-setting! 'entity-name "camera-194" 0.0 0) (if (and *target* (logtest? (state-flags prevent-gun) (-> *target* state-flags)) (cpad-pressed? (-> *target* control cpad number) up right down left r1) @@ -2174,7 +2174,7 @@ This commonly includes things such as: (when (and (not (logtest? (-> self flags) 2)) (< (vector-vector-distance (-> self root trans) (get-trans gp-0 0)) 102400.0) ) - (set-setting! 'sound-mode #f 0 2) + (set-setting! 'sound-mode #f 0.0 2) (logior! (-> self flags) 2) ) (when (and (logtest? (-> self flags) 2) diff --git a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc index defe379ad0..9ca4e5a4e4 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc @@ -420,7 +420,7 @@ (go-virtual hidden) ) ((= v1-28 1) - (set-setting! 'music 'danger4 0 0) + (set-setting! 'music 'danger4 0.0 0) (set! (-> self hud) (ppointer->handle (process-spawn hud-metalkor :init hud-init-by-other :to self))) (metalkor-update-hud) (set! (-> self lowtorso) @@ -440,17 +440,17 @@ ) ) (set-countdown-to-roar) - (set-setting! 'fov 'abs #x466eeeef 0) + (set-setting! 'fov 'abs (degrees 84.0) 0) (ja :group! (-> self draw art-group data 9) :num! min) (go-virtual hang-shoot-n-launch) ) ((= v1-28 2) - (set-setting! 'music 'danger4 0 0) + (set-setting! 'music 'danger4 0.0 0) (set-countdown-to-roar) (go-virtual start-second-stage) ) ((= v1-28 3) - (set-setting! 'music 'danger4 0 0) + (set-setting! 'music 'danger4 0.0 0) (set! (-> self last-close-attack) 0) (set! (-> self last-standing-attack) 0) (cond @@ -493,13 +493,13 @@ (set! (-> self legs) (ppointer->handle (process-spawn metalkor-legs "" (-> self root-override trans) :to self)) ) - (set-setting! 'fov 'abs #x466eeeef 0) + (set-setting! 'fov 'abs (degrees 84.0) 0) (go-virtual chase-target) ) ) ) ((= v1-28 4) - (set-setting! 'music 'danger4 0 0) + (set-setting! 'music 'danger4 0.0 0) (set! (-> self wings) (ppointer->handle (process-spawn metalkor-wings "" (-> self root-override trans) :to self)) ) @@ -1534,7 +1534,7 @@ ) :enter (behavior () (process-grab? *target* #f) - (set-setting! 'entity-name "camera-271" 0 0) + (set-setting! 'entity-name "camera-271" 0.0 0) (send-event *camera* 'change-target self) (none) ) @@ -1690,7 +1690,7 @@ ) ) ) - (set-setting! 'entity-name "camera-272" 0 0) + (set-setting! 'entity-name "camera-272" 0.0 0) (send-event *camera* 'change-target self) (set! (-> self need-teleport) #f) (set-setting! 'teleport-on-entity-change 'abs #t 0) @@ -1765,7 +1765,7 @@ ) (when (< f0-10 (* f1-9 f1-9)) (set! (-> self been-to-entity) #t) - (set-setting! 'entity-name "camera-271" 0 0) + (set-setting! 'entity-name "camera-271" 0.0 0) ) ) ) @@ -1793,9 +1793,9 @@ (defstate last-gasp (metalkor) :virtual #t :enter (behavior () - (set-setting! 'music #f 0 0) + (set-setting! 'music #f 0.0 0) (process-grab? *target* #f) - (set-setting! 'entity-name "camera-272" 0 0) + (set-setting! 'entity-name "camera-272" 0.0 0) (remove-setting! 'point-of-interest) (send-event *camera* 'change-target self) (if (nonzero? (-> self neck)) 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 7acceabe39..d2c09e2b0c 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 @@ -4,35 +4,34 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 245 - 0 - (the-as (function object) (lambda :behavior scene-player - () - 0.0 - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) (process->ppointer self)) - (set! (-> a1-0 num-params) 1) - (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 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.1)) - (suspend) - ) - ) - (send-event *target* 'change-mode 'darkjak #f 64) - (let ((gp-1 (-> self clock frame-counter))) - (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.1)) - (suspend) - ) - ) - (send-event *target* 'get-pickup 7 f30-0) - ) - ) - (send-event *target* 'end-mode) - (none) - ) + (game-task-node nest-boss-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior scene-player + () + 0.0 + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (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 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.1)) + (suspend) + ) ) + (send-event *target* 'change-mode 'darkjak #f 64) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.1)) + (suspend) + ) + ) + (send-event *target* 'get-pickup 7 f30-0) + ) + ) + (send-event *target* 'end-mode) + (none) + ) ) ;; failed to figure out what this is: 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 2f5dbfb043..f26f031029 100644 --- a/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc @@ -90,8 +90,8 @@ (when (and (not (-> self set-camera)) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.6))) (process-grab? *target* #f) (hide-hud-quick #f) - (set-setting! 'process-mask 'set 0 (process-mask movie enemy)) - (set-setting! 'entity-name "camera-253" 0 0) + (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) + (set-setting! 'entity-name "camera-253" 0.0 0) (set! (-> self set-camera) #t) ) (rider-trans) diff --git a/test/decompiler/reference/jak2/levels/outro/outro-scenes_REF.gc b/test/decompiler/reference/jak2/levels/outro/outro-scenes_REF.gc index f3528b0358..da3def84f4 100644 --- a/test/decompiler/reference/jak2/levels/outro/outro-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/outro/outro-scenes_REF.gc @@ -1609,7 +1609,7 @@ (apply ,(lambda () (with-pp - (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile)) (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 (let ((t9-2 (method-of-type part-tracker activate))) diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc index 4cbc7d9f4e..64cd53109a 100644 --- a/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc @@ -526,7 +526,7 @@ (get-point-at-percent-along-path! (-> self second-path) (-> self traj-dest) 0.0 'interp) ) (else - (set-setting! 'music #f 0 0) + (set-setting! 'music #f 0.0 0) (process-grab? *target* #f) (get-point-at-percent-along-path! (-> self third-path) (-> self traj-dest) 0.0 'interp) (send-event (handle->process (-> self hud)) 'hide-and-die) @@ -1695,7 +1695,7 @@ :virtual #t :event squid-handler :enter (behavior () - (set-setting! 'music 'danger4 0 0) + (set-setting! 'music 'danger4 0.0 0) (set! (-> self driver-blend target) 1.0) (set! (-> self state-time) (-> self clock frame-counter)) (set! (-> self hud) (ppointer->handle (process-spawn hud-squid :init hud-init-by-other :to self))) diff --git a/test/decompiler/reference/jak2/levels/palace/throne_room/palace-scenes_REF.gc b/test/decompiler/reference/jak2/levels/palace/throne_room/palace-scenes_REF.gc index a65fa39640..e6ff64d2cf 100644 --- a/test/decompiler/reference/jak2/levels/palace/throne_room/palace-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/throne_room/palace-scenes_REF.gc @@ -387,7 +387,7 @@ This commonly includes things such as: (fadein (seconds (new 'static 'bfloat :data 0.5))) (kill "pal-lowrez-throne-1") (fadein (frame-time-30 10)) - (apply ,(lambda :behavior scene-player () (set-setting! 'rain 'abs 0 0) (none))) + (apply ,(lambda :behavior scene-player () (set-setting! 'rain 'abs 0.0 0) (none))) (send-event "metalkor-head" 'trans-hook @@ -656,7 +656,7 @@ This commonly includes things such as: :art-group "scenecamera" :anim "palace-sneak-in-res" :parts 21 - :command-list '((0 (fadein (seconds 1)) (apply ,(lambda :behavior scene-player () (set-setting! 'rain 'abs 0 0) (none)))) + :command-list '((0 (fadein (seconds 1)) (apply ,(lambda :behavior scene-player () (set-setting! 'rain 'abs 0.0 0) (none)))) (10000 (unless (task-closed? "palace-sneak-in-meeting") (talker-spawn "miss010")) (task-close! "palace-sneak-in-meeting") diff --git a/test/decompiler/reference/jak2/levels/power_station/power_switches/ctypower_REF.gc b/test/decompiler/reference/jak2/levels/power_station/power_switches/ctypower_REF.gc index 1e32eec468..491f491d48 100644 --- a/test/decompiler/reference/jak2/levels/power_station/power_switches/ctypower_REF.gc +++ b/test/decompiler/reference/jak2/levels/power_station/power_switches/ctypower_REF.gc @@ -57,245 +57,226 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 87 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (not (task-node-closed? (game-task-node city-power-resolution))) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) - (set-setting! 'minimap 'clear 0 32) - (set! (-> self max-count) 5) - (set! (-> self count) 0) - (set! (-> *game-info* counter) 5.0) - (dotimes (v1-9 5) - (set! (-> self data-int32 v1-9) 0) - ) - (set! (-> self slave 10) (the-as handle #f)) - (dotimes (gp-0 (-> self max-count)) - (set! (-> self data-vector gp-0 quad) (-> *city-power-switch-on-position* gp-0 quad)) - (set! (-> self minimap gp-0) - (add-icon! *minimap* self (the-as uint 15) (the-as int #f) (-> *city-power-switch-on-position* gp-0) 0) - ) - ) + (game-task-node city-power-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (when (not (task-node-closed? (game-task-node city-power-resolution))) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set! (-> self max-count) 5) + (set! (-> self count) 0) + (set! (-> *game-info* counter) 5.0) + (dotimes (v1-9 5) + (set! (-> self data-int32 v1-9) 0) ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 87 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (send-event *traffic-manager* 'restore-default-settings) - (dotimes (v1-3 (-> self max-count)) - (when (-> self minimap v1-3) - (logior! (-> self minimap v1-3 flags) (minimap-flag fade-out)) - (set! (-> self minimap v1-3) #f) - ) - ) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 87 - 2 - (the-as - (function object) - (lambda :behavior task-manager - () - (when (not (task-node-closed? (game-task-node city-power-resolution))) - (check-time self) - (set! (-> self count) 0) - (dotimes (v1-3 (-> self max-count)) - (if (>= 1 (-> self data-int32 v1-3)) - (+! (-> self count) 1) + (set! (-> self slave 10) (the-as handle #f)) + (dotimes (gp-0 (-> self max-count)) + (set! (-> self data-vector gp-0 quad) (-> *city-power-switch-on-position* gp-0 quad)) + (set! (-> self minimap gp-0) + (add-icon! *minimap* self (the-as uint 15) (the-as int #f) (-> *city-power-switch-on-position* gp-0) 0) ) - ) - (if (= (-> self count) (-> self max-count)) - (set! (-> self state-time) (-> self clock frame-counter)) - ) - (set! (-> *game-info* counter) (the float (-> self count))) ) - (when (or (zero? (-> self count)) (task-node-closed? (game-task-node city-power-resolution))) - (when (zero? (-> self count)) - (talker-spawn-func (-> *talker-speech* 92) *entity-pool* (target-pos 0) (the-as region #f)) - (task-node-close! (game-task-node city-power-resolution)) - (send-event (handle->process (-> self hud-timer)) 'hide-and-die) - (send-event (handle->process (-> self hud-counter)) 'hide-and-die) - (set! (-> self fail-on-death?) #f) - ) - (cond - ((handle->process (-> self slave 10)) - (let ((gp-1 (handle->process (-> self slave 10)))) - (when (and gp-1 - (< 40960.0 (vector-vector-xz-distance (-> (the-as process-drawable gp-1) root trans) (target-pos 0))) - ) - (send-event gp-1 'close) - (go-virtual complete) - ) - ) - ) - (else - (go-virtual complete) - ) - ) - ) - (none) ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 87 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-turret :init hud-init-by-other :to self))) - (send-event *traffic-manager* 'set-target-level #x3f800000) - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) - (suspend) + (game-task-node city-power-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'restore-default-settings) + (dotimes (v1-3 (-> self max-count)) + (when (-> self minimap v1-3) + (logior! (-> self minimap v1-3 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-3) #f) ) - (send-event *traffic-manager* 'set-alert-level 1) - (send-event *traffic-manager* 'set-alert-duration #xa4cb80) - (none) ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 87 - 5 - (the-as (function object) (lambda :behavior task-manager - () - (dotimes (v1-0 (-> self max-count)) - (when (-> self minimap v1-0) - (logior! (-> self minimap v1-0 flags) (minimap-flag fade-out)) - (set! (-> self minimap v1-0) #f) - ) - ) - (kill-all-children self) - (none) - ) + (game-task-node city-power-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (when (not (task-node-closed? (game-task-node city-power-resolution))) + (check-time self) + (set! (-> self count) 0) + (dotimes (v1-3 (-> self max-count)) + (if (>= 1 (-> self data-int32 v1-3)) + (+! (-> self count) 1) + ) + ) + (if (= (-> self count) (-> self max-count)) + (set! (-> self state-time) (-> self clock frame-counter)) ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 87 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (set! (-> self state-time) (-> self clock frame-counter)) - (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) - (suspend) - ) - (task-node-close! (game-task-node city-power-post-win)) - (none) - ) - ) - ) - -;; failed to figure out what this is: -(set-subtask-hook! - *game-info* - 87 - 6 - (the-as - (function object) - (lambda :behavior task-manager - ((arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((gp-0 (-> (level-get *level* 'lpower) entity data 0 entity))) - (cond - ((= arg2 'guard-turret-status) - (let ((v1-5 (-> arg3 param 0))) - (let ((a0-2 (the-as object (-> arg3 param 1)))) - (set! (-> *city-power-switch-on-position* v1-5 quad) (-> (the-as vector a0-2) quad)) - ) - (-> self data-int32 v1-5) + (set! (-> *game-info* counter) (the float (-> self count))) + ) + (when (or (zero? (-> self count)) (task-node-closed? (game-task-node city-power-resolution))) + (when (zero? (-> self count)) + (talker-spawn-func (-> *talker-speech* 92) *entity-pool* (target-pos 0) (the-as region #f)) + (task-node-close! (game-task-node city-power-resolution)) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (set! (-> self fail-on-death?) #f) + ) + (cond + ((handle->process (-> self slave 10)) + (let ((gp-1 (handle->process (-> self slave 10)))) + (when (and gp-1 + (< 40960.0 (vector-vector-xz-distance (-> (the-as process-drawable gp-1) root trans) (target-pos 0))) + ) + (send-event gp-1 'close) + (go-virtual complete) ) ) - ((= arg2 'guard-turret-killed) - (let ((s4-1 (-> arg3 param 0))) - (set! (-> self data-int32 s4-1) 1) - (let ((v1-12 (process-spawn - cty-guard-turret-button - :init basebutton-init-by-other - gp-0 - (-> arg0 root trans) - (-> arg0 root quat) - (-> arg0 entity) - #f - 0 - :to self - ) + ) + (else + (go-virtual complete) + ) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-power-resolution) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-turret :init hud-init-by-other :to self))) + (send-event *traffic-manager* 'set-target-level #x3f800000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (send-event *traffic-manager* 'set-alert-level 1) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-power-resolution) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager + () + (dotimes (v1-0 (-> self max-count)) + (when (-> self minimap v1-0) + (logior! (-> self minimap v1-0 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-0) #f) + ) + ) + (kill-all-children self) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-power-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (suspend) + ) + (task-node-close! (game-task-node city-power-post-win)) + (none) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + (game-task-node city-power-resolution) + TASK_MANAGER_EVENT_HOOK + (lambda :behavior task-manager + ((arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((gp-0 (-> (level-get *level* 'lpower) entity data 0 entity))) + (cond + ((= arg2 'guard-turret-status) + (let ((v1-5 (-> arg3 param 0))) + (let ((a0-2 (the-as object (-> arg3 param 1)))) + (set! (-> *city-power-switch-on-position* v1-5 quad) (-> (the-as vector a0-2) quad)) + ) + (-> self data-int32 v1-5) + ) + ) + ((= arg2 'guard-turret-killed) + (let ((s4-1 (-> arg3 param 0))) + (set! (-> self data-int32 s4-1) 1) + (let ((v1-12 (process-spawn + cty-guard-turret-button + :init basebutton-init-by-other + gp-0 + (-> arg0 root trans) + (-> arg0 root quat) + (-> arg0 entity) + #f + 0 + :to self ) - ) - (set! (-> self slave (-> self data-int32 s4-1)) (ppointer->handle v1-12)) - (set! (-> (the-as basebutton (-> v1-12 0)) event-down) 'button-down) - ) - ) - #t - ) - ((= arg2 'guard-turret-button-pushed) - (let ((v1-21 (-> arg3 param 0))) - (set! (-> self data-int32 v1-21) 2) - (set! (-> self slave 10) (process->handle arg0)) - (logior! (-> self minimap v1-21 flags) (minimap-flag fade-out)) - (set! (-> self minimap v1-21) #f) - ) - #t - ) - ((= arg2 'spawn-button) - (let ((s4-2 (-> arg3 param 0)) - (s3-2 (-> arg3 param 1)) + ) ) - (when (not (handle->process (-> self slave (-> self data-int32 s4-2)))) - (let ((v0-1 (the-as object (ppointer->handle (process-spawn - cty-guard-turret-button - :init basebutton-init-by-other - gp-0 - (-> arg0 root trans) - (-> arg0 root quat) - (-> arg0 entity) - s3-2 - 0 - :to self - ) + (set! (-> self slave (-> self data-int32 s4-1)) (ppointer->handle v1-12)) + (set! (-> (the-as basebutton (-> v1-12 0)) event-down) 'button-down) + ) + ) + #t + ) + ((= arg2 'guard-turret-button-pushed) + (let ((v1-21 (-> arg3 param 0))) + (set! (-> self data-int32 v1-21) 2) + (set! (-> self slave 10) (process->handle arg0)) + (logior! (-> self minimap v1-21 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-21) #f) + ) + #t + ) + ((= arg2 'spawn-button) + (let ((s4-2 (-> arg3 param 0)) + (s3-2 (-> arg3 param 1)) + ) + (when (not (handle->process (-> self slave (-> self data-int32 s4-2)))) + (let ((v0-1 (the-as object (ppointer->handle (process-spawn + cty-guard-turret-button + :init basebutton-init-by-other + gp-0 + (-> arg0 root trans) + (-> arg0 root quat) + (-> arg0 entity) + s3-2 + 0 + :to self ) - ) - ) - ) - (set! (-> self slave (-> self data-int32 s4-2)) (the-as handle v0-1)) - v0-1 - ) + ) + ) + ) + ) + (set! (-> self slave (-> self data-int32 s4-2)) (the-as handle v0-1)) + v0-1 ) ) ) - ) + ) ) ) ) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc index 6a1686ac4a..c0774b7e1b 100644 --- a/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc @@ -721,8 +721,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 13 - 3 + (game-task-node ruins-tower-exit) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (set! (-> self data-int32 0) 0) @@ -779,13 +779,16 @@ This commonly includes things such as: ) ;; failed to figure out what this is: -(copy-hooks! (-> *game-info* sub-task-list 99) (-> *game-info* sub-task-list 13)) +(copy-hooks! + (-> *game-info* sub-task-list (game-task-node ruins-enemy-exit)) + (-> *game-info* sub-task-list (game-task-node ruins-tower-exit)) + ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 194 - 3 + (game-task-node ruins-mech-break-wall-1) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (let ((s4-0 (entity-by-type mech)) @@ -873,8 +876,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 195 - 3 + (game-task-node ruins-mech-move-block-1) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (local-vars (v1-3 object) (v1-14 symbol) (v1-18 symbol) (v1-25 object) (v1-31 symbol) (v1-32 symbol)) @@ -950,8 +953,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 196 - 3 + (game-task-node ruins-mech-throw-block-1) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (local-vars (v1-6 object) (v1-58 symbol)) diff --git a/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc b/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc index becf3e3c21..81f45c60fb 100644 --- a/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc @@ -1622,7 +1622,7 @@ This commonly includes things such as: :command-list '((-10 (want-force-vis 'sagehut #t) (fadein (seconds (new 'static 'bfloat :data 0.333))) - (apply ,(lambda () (set-setting! 'rain 'abs 0 0) (none))) + (apply ,(lambda () (set-setting! 'rain 'abs 0.0 0) (none))) ) (1 (joint-eval start-seed-effect entity "life-seed")) (340 (part-tracker diff --git a/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc b/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc index 8f3a8e6031..90a0d3a7b4 100644 --- a/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc @@ -3884,7 +3884,7 @@ ) ) ) - (set-setting! 'allow-look-around #f 0 0) + (set-setting! 'allow-look-around #f 0.0 0) (let ((v1-46 (get-task-by-type (-> arg0 ai-ctrl) halt-wait-spot arg0))) (set! (-> v1-46 bytes 5) 1) (set! (-> v1-46 bytes 6) 4) 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 f1d793f6d9..2588c30a41 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc @@ -117,7 +117,7 @@ (logtest? (elevator-flags airlock-opened) (-> self params flags)) ) (configure-collision self #t) - (set-setting! 'jump #f 0 0) + (set-setting! 'jump #f 0.0 0) ) (none) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-scenes_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-scenes_REF.gc index 858f621603..0711be649a 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-scenes_REF.gc @@ -1298,8 +1298,8 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 41 - 0 + (game-task-node sewer-enemy-blow-up-turrets) + TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () (while (!= (level-status *level* 'sewer) 'active) @@ -1329,8 +1329,8 @@ ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 41 - 3 + (game-task-node sewer-enemy-blow-up-turrets) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (local-vars (sv-96 int) (sv-100 float) (sv-104 vector)) diff --git a/test/decompiler/reference/jak2/levels/stadium/jetboard/skatea-obs_REF.gc b/test/decompiler/reference/jak2/levels/stadium/jetboard/skatea-obs_REF.gc index 0b914a6012..046d67d148 100644 --- a/test/decompiler/reference/jak2/levels/stadium/jetboard/skatea-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/jetboard/skatea-obs_REF.gc @@ -256,7 +256,7 @@ (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'complete) (let ((t9-0 send-event-function) - (v1-5 (-> *game-info* sub-task-list 64)) + (v1-5 (-> *game-info* sub-task-list (game-task-node stadium-board1-board))) ) (t9-0 (handle->process (if (-> v1-5 info) @@ -1181,8 +1181,15 @@ (set! (-> self arrow) (process->handle (task-arrow-spawn gp-4 (the-as task-arrow self)))) ) (else - (set! (-> *game-info* sub-task-list 66 death-count) - (the-as uint (seekl (the-as int (-> *game-info* sub-task-list 66 death-count)) #xffff 1)) + (set! (-> *game-info* sub-task-list (game-task-node stadium-board1-training-judge) death-count) + (the-as + uint + (seekl + (the-as int (-> *game-info* sub-task-list (game-task-node stadium-board1-training-judge) death-count)) + #xffff + 1 + ) + ) ) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei020" -99.0 0) ) @@ -1442,7 +1449,7 @@ This commonly includes things such as: (send-event s5-0 'set-object-target-count 19 0) (send-event s5-0 'set-guard-target-level 0) ) - (set-setting! 'allow-continue #f 0 0) + (set-setting! 'allow-continue #f 0.0 0) (cond ((task-node-closed? (game-task-node forest-scouts-get-board)) (go (method-of-object obj idle)) @@ -1661,7 +1668,7 @@ This commonly includes things such as: ) ) (('close) - (set-setting! 'minimap 'clear 0 128) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self onoff) #f) #f ) 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 4a2317025c..995f87d35c 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc @@ -983,7 +983,7 @@ This commonly includes things such as: (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'complete) (let ((t9-0 send-event-function) - (v1-4 (-> *game-info* sub-task-list 237)) + (v1-4 (-> *game-info* sub-task-list (game-task-node city-defend-stadium-resolution))) ) (t9-0 (handle->process (if (-> v1-4 info) @@ -2202,7 +2202,7 @@ This commonly includes things such as: (set! (-> a1-21 num-params) 0) (set! (-> a1-21 message) 'fail) (let ((t9-11 send-event-function) - (v1-73 (-> *game-info* sub-task-list 237)) + (v1-73 (-> *game-info* sub-task-list (game-task-node city-defend-stadium-resolution))) ) (t9-11 (handle->process (if (-> v1-73 info) @@ -3499,167 +3499,160 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 237 - 0 - (the-as - (function object) - (lambda :behavior task-manager - () - (set-setting! 'border-mode #f 0 0) - (while (!= (level-status *level* 'stadblmp) 'active) - (suspend) - ) - (set-setting! 'minimap 'clear 0 32) - (set-setting! 'exclusive-task #f 0 (-> self node-info task)) - (set-setting! 'music 'danger6 0 0) - (want-force-vis *load-state* 'stadblmp #t) - (let ((gp-1 *traffic-manager*)) - (send-event gp-1 'set-object-target-count 11 0) - (send-event gp-1 'set-object-target-count 12 0) - (send-event gp-1 'set-object-target-count 13 0) - (send-event gp-1 'set-object-target-count 14 0) - (send-event gp-1 'set-object-target-count 15 0) - (send-event gp-1 'set-object-target-count 16 0) - (send-event gp-1 'set-object-target-count 0 0) - (send-event gp-1 'set-object-target-count 1 0) - (send-event gp-1 'set-object-target-count 2 0) - (send-event gp-1 'set-object-target-count 6 0) - (send-event gp-1 'set-object-target-count 7 0) - (send-event gp-1 'set-object-target-count 8 0) - (send-event gp-1 'set-object-target-count 9 0) - (send-event gp-1 'set-object-target-count 10 0) - (send-event gp-1 'set-object-target-count 18 0) - (send-event gp-1 'set-object-target-count 19 0) - (send-event gp-1 'deactivate-by-type 11) - (send-event gp-1 'deactivate-by-type 12) - (send-event gp-1 'deactivate-by-type 13) - (send-event gp-1 'deactivate-by-type 14) - (send-event gp-1 'deactivate-by-type 15) - (send-event gp-1 'deactivate-by-type 16) - (send-event gp-1 'deactivate-by-type 0) - (send-event gp-1 'deactivate-by-type 1) - (send-event gp-1 'deactivate-by-type 2) - (send-event gp-1 'deactivate-by-type 6) - (send-event gp-1 'deactivate-by-type 7) - (send-event gp-1 'deactivate-by-type 8) - (send-event gp-1 'deactivate-by-type 9) - (send-event gp-1 'deactivate-by-type 10) - (send-event gp-1 'deactivate-by-type 18) - (send-event gp-1 'deactivate-by-type 19) - (send-event gp-1 'set-guard-target-level 0) - ) - (let ((v1-177 (entity-by-name "parking-spot-48"))) - (if v1-177 - (logior! (-> v1-177 extra perm status) (entity-perm-status bit-9)) - ) - ) - (let ((v1-179 (entity-by-name "parking-spot-49"))) - (if v1-179 - (logior! (-> v1-179 extra perm status) (entity-perm-status bit-9)) - ) - ) - (set! (-> self slave 0) - (process->handle (the-as process (ppointer->process (process-spawn stad-keira :to self)))) - ) - (set! (-> self slave 1) - (process->handle (the-as process (ppointer->process (process-spawn stad-brutter :to self)))) - ) - (none) + (game-task-node city-defend-stadium-resolution) + TASK_MANAGER_INIT_HOOK + (lambda :behavior task-manager + () + (set-setting! 'border-mode #f 0.0 0) + (while (!= (level-status *level* 'stadblmp) 'active) + (suspend) ) + (set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph)) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set-setting! 'music 'danger6 0.0 0) + (want-force-vis *load-state* 'stadblmp #t) + (let ((gp-1 *traffic-manager*)) + (send-event gp-1 'set-object-target-count 11 0) + (send-event gp-1 'set-object-target-count 12 0) + (send-event gp-1 'set-object-target-count 13 0) + (send-event gp-1 'set-object-target-count 14 0) + (send-event gp-1 'set-object-target-count 15 0) + (send-event gp-1 'set-object-target-count 16 0) + (send-event gp-1 'set-object-target-count 0 0) + (send-event gp-1 'set-object-target-count 1 0) + (send-event gp-1 'set-object-target-count 2 0) + (send-event gp-1 'set-object-target-count 6 0) + (send-event gp-1 'set-object-target-count 7 0) + (send-event gp-1 'set-object-target-count 8 0) + (send-event gp-1 'set-object-target-count 9 0) + (send-event gp-1 'set-object-target-count 10 0) + (send-event gp-1 'set-object-target-count 18 0) + (send-event gp-1 'set-object-target-count 19 0) + (send-event gp-1 'deactivate-by-type 11) + (send-event gp-1 'deactivate-by-type 12) + (send-event gp-1 'deactivate-by-type 13) + (send-event gp-1 'deactivate-by-type 14) + (send-event gp-1 'deactivate-by-type 15) + (send-event gp-1 'deactivate-by-type 16) + (send-event gp-1 'deactivate-by-type 0) + (send-event gp-1 'deactivate-by-type 1) + (send-event gp-1 'deactivate-by-type 2) + (send-event gp-1 'deactivate-by-type 6) + (send-event gp-1 'deactivate-by-type 7) + (send-event gp-1 'deactivate-by-type 8) + (send-event gp-1 'deactivate-by-type 9) + (send-event gp-1 'deactivate-by-type 10) + (send-event gp-1 'deactivate-by-type 18) + (send-event gp-1 'deactivate-by-type 19) + (send-event gp-1 'set-guard-target-level 0) + ) + (let ((v1-177 (entity-by-name "parking-spot-48"))) + (if v1-177 + (logior! (-> v1-177 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-179 (entity-by-name "parking-spot-49"))) + (if v1-179 + (logior! (-> v1-179 extra perm status) (entity-perm-status bit-9)) + ) + ) + (set! (-> self slave 0) + (process->handle (the-as process (ppointer->process (process-spawn stad-keira :to self)))) + ) + (set! (-> self slave 1) + (process->handle (the-as process (ppointer->process (process-spawn stad-brutter :to self)))) + ) + (none) ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 237 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (let ((a0-0 *suppress-stadium*)) - (let ((v1-0 (-> a0-0 bbox))) - (set! (-> v1-0 min x) 373227.53) - (set! (-> v1-0 min y) -204800.0) - (set! (-> v1-0 min z) -3276800.0) - (set! (-> v1-0 min w) 1.0) - ) - (set-vector! (-> a0-0 bbox max) 1482301.5 204800.0 -1228800.0 1.0) - (set! (-> a0-0 duration) (seconds 604800)) - (create-or-update-suppression-box a0-0) - ) - (none) - ) - ) + (game-task-node city-defend-stadium-resolution) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (let ((a0-0 *suppress-stadium*)) + (let ((v1-0 (-> a0-0 bbox))) + (set! (-> v1-0 min x) 373227.53) + (set! (-> v1-0 min y) -204800.0) + (set! (-> v1-0 min z) -3276800.0) + (set! (-> v1-0 min w) 1.0) + ) + (set-vector! (-> a0-0 bbox max) 1482301.5 204800.0 -1228800.0 1.0) + (set! (-> a0-0 duration) (seconds 604800)) + (create-or-update-suppression-box a0-0) + ) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 237 - 4 - (the-as (function object) (lambda :behavior task-manager - () - (dotimes (gp-0 2) - (send-event (handle->process (-> self slave gp-0)) 'die) - ) - (let ((gp-1 (-> (process-by-name "battle-58" *active-pool*) child))) - (while gp-1 - (send-event (ppointer->process gp-1) 'die-fast) - (set! gp-1 (-> gp-1 0 brother)) - ) - ) - (let ((gp-2 (-> (process-by-name "battle-59" *active-pool*) child))) - (while gp-2 - (send-event (ppointer->process gp-2) 'die-fast) - (set! gp-2 (-> gp-2 0 brother)) - ) - ) - (let ((gp-3 (-> (process-by-name "battle-60" *active-pool*) child))) - (while gp-3 - (send-event (ppointer->process gp-3) 'die-fast) - (set! gp-3 (-> gp-3 0 brother)) - ) - ) - (none) - ) - ) + (game-task-node city-defend-stadium-resolution) + TASK_MANAGER_COMPLETE_HOOK + (lambda :behavior task-manager + () + (dotimes (gp-0 2) + (send-event (handle->process (-> self slave gp-0)) 'die) + ) + (let ((gp-1 (-> (process-by-name "battle-58" *active-pool*) child))) + (while gp-1 + (send-event (ppointer->process gp-1) 'die-fast) + (set! gp-1 (-> gp-1 0 brother)) + ) + ) + (let ((gp-2 (-> (process-by-name "battle-59" *active-pool*) child))) + (while gp-2 + (send-event (ppointer->process gp-2) 'die-fast) + (set! gp-2 (-> gp-2 0 brother)) + ) + ) + (let ((gp-3 (-> (process-by-name "battle-60" *active-pool*) child))) + (while gp-3 + (send-event (ppointer->process gp-3) 'die-fast) + (set! gp-3 (-> gp-3 0 brother)) + ) + ) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 237 - 1 - (the-as (function object) (lambda :behavior task-manager - () - (remove-setting! 'border-mode) - (send-event *traffic-manager* 'restore-default-settings) - (none) - ) - ) + (game-task-node city-defend-stadium-resolution) + TASK_MANAGER_CLEANUP_HOOK + (lambda :behavior task-manager + () + (remove-setting! 'border-mode) + (send-event *traffic-manager* 'restore-default-settings) + (none) + ) ) ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 236 - 2 - (the-as (function object) (lambda :behavior task-manager - () - (let ((a0-0 *suppress-stadium*)) - (let ((v1-0 (-> a0-0 bbox))) - (set! (-> v1-0 min x) 373227.53) - (set! (-> v1-0 min y) -204800.0) - (set! (-> v1-0 min z) -3276800.0) - (set! (-> v1-0 min w) 1.0) - ) - (set-vector! (-> a0-0 bbox max) 1482301.5 204800.0 -1228800.0 1.0) - (set! (-> a0-0 duration) (seconds 604800)) - (create-or-update-suppression-box a0-0) - ) - (none) - ) - ) + (game-task-node city-defend-stadium-introduction) + TASK_MANAGER_UPDATE_HOOK + (lambda :behavior task-manager + () + (let ((a0-0 *suppress-stadium*)) + (let ((v1-0 (-> a0-0 bbox))) + (set! (-> v1-0 min x) 373227.53) + (set! (-> v1-0 min y) -204800.0) + (set! (-> v1-0 min z) -3276800.0) + (set! (-> v1-0 min w) 1.0) + ) + (set-vector! (-> a0-0 bbox max) 1482301.5 204800.0 -1228800.0 1.0) + (set! (-> a0-0 duration) (seconds 604800)) + (create-or-update-suppression-box a0-0) + ) + (none) + ) ) ;; definition for method 15 of type hud-samos-old diff --git a/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc b/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc index 7e8893d4b1..238cb6c161 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc @@ -875,7 +875,7 @@ This commonly includes things such as: (cond ((send-event proc 'grenade (-> self speed)) (if (-> self camera-name) - (set-setting! 'entity-name (-> self camera-name) 0 -1) + (set-setting! 'entity-name (-> self camera-name) 0.0 -1) ) ) ((>= (- (-> self clock frame-counter) (-> self enter-time)) (seconds 3)) @@ -1636,15 +1636,15 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 115 - 0 + (game-task-node strip-grenade-explode) + TASK_MANAGER_INIT_HOOK (lambda :behavior task-manager () - (set-setting! 'music 'danger10 0 0) + (set-setting! 'music 'danger10 0.0 0) (set! (-> *game-info* controller 0) (process->handle self)) (set! (-> self entity) (the-as entity-actor (entity-by-name "grenade-point-1"))) (set! (-> self actor-group 0) (res-lump-struct (-> self entity) 'actor-groups (pointer entity-actor))) - (set-setting! 'allow-continue #f 0 0) + (set-setting! 'allow-continue #f 0.0 0) (when (-> self actor-group 0) (dotimes (gp-0 (the-as int (-> self actor-group 0 0))) (let ((s5-0 (-> (&+ (-> self actor-group 0) (* gp-0 8)) 3))) @@ -1665,8 +1665,8 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 115 - 3 + (game-task-node strip-grenade-explode) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (local-vars (sv-16 object)) @@ -1759,30 +1759,29 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 115 - 5 - (the-as (function object) (lambda :behavior task-manager - () - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) (process->ppointer self)) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'attack-invinc) - (set! (-> a1-0 param 0) (the-as uint #f)) - (let ((v1-3 (new 'static 'attack-info :mask (attack-info-mask mode id)))) - (let* ((a0-1 *game-info*) - (a2-1 (+ (-> a0-1 attack-id) 1)) - ) - (set! (-> a0-1 attack-id) a2-1) - (set! (-> v1-3 id) a2-1) - ) - (set! (-> v1-3 mode) 'big-explosion) - (set! (-> a1-0 param 1) (the-as uint v1-3)) - ) - (send-event-function *target* a1-0) - ) - (none) - ) + (game-task-node strip-grenade-explode) + TASK_MANAGER_FAIL_HOOK + (lambda :behavior task-manager + () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'attack-invinc) + (set! (-> a1-0 param 0) (the-as uint #f)) + (let ((v1-3 (new 'static 'attack-info :mask (attack-info-mask mode id)))) + (let* ((a0-1 *game-info*) + (a2-1 (+ (-> a0-1 attack-id) 1)) + ) + (set! (-> a0-1 attack-id) a2-1) + (set! (-> v1-3 id) a2-1) ) + (set! (-> v1-3 mode) 'big-explosion) + (set! (-> a1-0 param 1) (the-as uint v1-3)) + ) + (send-event-function *target* a1-0) + ) + (none) + ) ) ;; definition of type drill-plat @@ -1976,26 +1975,23 @@ This commonly includes things such as: ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 45 - 3 - (the-as - (function object) - (lambda :behavior task-manager - () - (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> self info end-sphere quad)) - (quaternion-identity! (-> gp-0 quat)) - (set! (-> gp-0 flags) (task-arrow-flags)) - (set! (-> gp-0 map-icon) (the-as uint 15)) - (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) - ) - (while (>= (vector-vector-distance (target-pos 0) (-> self info end-sphere)) (-> self info end-sphere r)) - (suspend) - ) - (send-event (handle->process (-> self arrow)) 'leave) - (sleep-code) - (none) + (game-task-node strip-rescue-battle) + TASK_MANAGER_CODE_HOOK + (lambda :behavior task-manager + () + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> self info end-sphere quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) ) + (while (>= (vector-vector-distance (target-pos 0) (-> self info end-sphere)) (-> self info end-sphere r)) + (suspend) + ) + (send-event (handle->process (-> self arrow)) 'leave) + (sleep-code) + (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/temple/mountain-obs2_REF.gc b/test/decompiler/reference/jak2/levels/temple/mountain-obs2_REF.gc index 82b44eacc6..211d7a1cd5 100644 --- a/test/decompiler/reference/jak2/levels/temple/mountain-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/temple/mountain-obs2_REF.gc @@ -394,8 +394,8 @@ For example for an elevator pre-compute the distance between the first and last ;; failed to figure out what this is: (set-subtask-hook! *game-info* - 155 - 3 + (game-task-node canyon-insert-items-door) + TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () (let ((arrow-params (new 'stack-no-clear 'task-arrow-params))) diff --git a/test/decompiler/reference/jak2/levels/temple/mountain-obs_REF.gc b/test/decompiler/reference/jak2/levels/temple/mountain-obs_REF.gc index f2df5ea485..b897db570b 100644 --- a/test/decompiler/reference/jak2/levels/temple/mountain-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/temple/mountain-obs_REF.gc @@ -2106,7 +2106,7 @@ This commonly includes things such as: (until (process-grab? *target* #f) (suspend) ) - (set-setting! 'entity-name "camera-259" 0 0) + (set-setting! 'entity-name "camera-259" 0.0 0) (let ((gp-0 (-> self clock frame-counter))) (until (>= (- (-> self clock frame-counter) gp-0) (seconds 1)) (suspend) diff --git a/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc b/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc index e1c5ed4736..9c7794d861 100644 --- a/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc +++ b/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc @@ -814,7 +814,7 @@ ((= v1-0 'interesting) (+! (-> obj interest) 1) (let ((v1-67 (process->ppointer obj))) - (set-setting! 'handle-of-interest v1-67 0 (-> v1-67 0 pid)) + (set-setting! 'handle-of-interest v1-67 0.0 (-> v1-67 0 pid)) ) ) ((= v1-0 'uninteresting) @@ -1401,8 +1401,8 @@ (defstate hostile (rhino) :virtual #t :enter (behavior () - (set-setting! 'sound-mode #f 0 1) - (set-setting! 'sound-excitement 'abs 0 0) + (set-setting! 'sound-mode #f 0.0 1) + (set-setting! 'sound-excitement 'abs 0.0 0) (let ((t9-2 (-> (method-of-type nav-enemy hostile) enter))) (if t9-2 (t9-2) @@ -1750,8 +1750,8 @@ :virtual #t :event (the-as (function process int symbol event-message-block object :behavior rhino) enemy-event-handler) :enter (behavior () - (set-setting! 'sound-mode #f 0 1) - (set-setting! 'sound-excitement 'abs 0 0) + (set-setting! 'sound-mode #f 0.0 1) + (set-setting! 'sound-excitement 'abs 0.0 0) (set! (-> self state-time) (-> self clock frame-counter)) (nav-enemy-method-166 self) (let ((v1-8 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 e591f3608c..7d63085be3 100644 --- a/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc @@ -480,13 +480,13 @@ (set! (-> self want-name 1) (-> self draw-name)) (set! (-> self want 1) (-> self draw)) (when arg4 - (set-setting! 'bg-a 'abs #x3f800000 0) + (set-setting! 'bg-a 'abs 1.0 0) (set! (-> *setting-control* user-current bg-a) 1.0) (set-blackout-frames 0) (apply-settings *setting-control*) ) (when (>= (-> self draw) 0) - (set-setting! 'bg-a 'abs #x3f800000 0) + (set-setting! 'bg-a 'abs 1.0 0) (apply-settings *setting-control*) (while (!= (-> *setting-control* user-current bg-a) 1.0) (suspend) @@ -632,10 +632,10 @@ (-> pp clock seconds-per-frame) (bucket-id screen-filter) ) - (set-setting! 'allow-progress #t 0 0) + (set-setting! 'allow-progress #t 0.0 0) (apply-settings *setting-control*) (activate-progress *dproc* arg0) - (set-setting! 'allow-progress #f 0 0) + (set-setting! 'allow-progress #f 0.0 0) (dotimes (gp-1 5) (suspend) ) @@ -644,7 +644,7 @@ (while (-> *blit-displays-work* menu-mode) (suspend) ) - (set-setting! 'allow-error #f 0 0) + (set-setting! 'allow-error #f 0.0 0) (apply-settings *setting-control*) (set-blackout-frames (seconds 0.2)) 0 @@ -737,10 +737,10 @@ ) (while (and (handle->process (the-as handle gp-2)) (= (-> *game-info* demo-state) 1)) (when (and (cpad-pressed? 0 start triangle) (< (-> *setting-control* user-current movie-skip-frame) 0.0)) - (set-setting! 'movie-skip-frame 'abs #x448a2000 0) - (set-setting! 'dialog-volume 'abs 0 0) + (set-setting! 'movie-skip-frame 'abs 1105.0 0) + (set-setting! 'dialog-volume 'abs 0.0 0) (set! (-> *setting-control* user-current dialog-volume) 0.000000001) - (set-setting! 'bg-a 'abs #x3f800000 0) + (set-setting! 'bg-a 'abs 1.0 0) (set! (-> *setting-control* user-current bg-a) 1.0) (apply-settings *setting-control*) ) @@ -957,13 +957,13 @@ ) (process-entity-set! self a1-2) ) - (set-setting! 'allow-pause #f 0 0) - (set-setting! 'allow-progress #f 0 0) - (set-setting! 'airlock #f 0 0) - (set-setting! 'music #f 0 0) - (set-setting! 'allow-timeout #f 0 0) - (set-setting! 'allow-error #f 0 0) - (set-setting! 'music-volume 'abs 0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'music #f 0.0 0) + (set-setting! 'allow-timeout #f 0.0 0) + (set-setting! 'allow-error #f 0.0 0) + (set-setting! 'music-volume 'abs 0.0 0) (apply-settings *setting-control*) (dotimes (gp-0 2) (set! (-> self buffer gp-0) diff --git a/test/decompiler/reference/jak2/levels/underport/centipede_REF.gc b/test/decompiler/reference/jak2/levels/underport/centipede_REF.gc index fb5b8fab1d..fbfd69fa28 100644 --- a/test/decompiler/reference/jak2/levels/underport/centipede_REF.gc +++ b/test/decompiler/reference/jak2/levels/underport/centipede_REF.gc @@ -864,12 +864,12 @@ (logior! (-> self enemy-flags) (enemy-flag chase-startup)) (set! (-> self desired-talking-volume) 0.0) (centipede-method-187 self) - (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'interp-time 'abs 0.0 0) (when (not (-> self set-camera-mode?)) (set! (-> self set-camera-mode?) #t) (set-setting-by-param *setting-control* 'mode-name 'cam-fixed 0 0) ) - (set-setting! 'allow-look-around #f 0 0) + (set-setting! 'allow-look-around #f 0.0 0) (suspend) (until #f (let ((v1-13 *camera*)) @@ -1302,7 +1302,7 @@ (remove-setting-by-arg0 *setting-control* 'mode-name) ) (remove-setting! 'allow-look-around) - (set-setting! 'entity-name "camera-252" 0 0) + (set-setting! 'entity-name "camera-252" 0.0 0) (centipede-method-188 self) (suspend) (suspend) diff --git a/test/decompiler/reference/jak2/levels/underport/sig5-course_REF.gc b/test/decompiler/reference/jak2/levels/underport/sig5-course_REF.gc index a0312603c9..79ba3cc7ac 100644 --- a/test/decompiler/reference/jak2/levels/underport/sig5-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/underport/sig5-course_REF.gc @@ -649,7 +649,7 @@ (the-as (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) - (set-setting! 'music 'tomb 0 0) + (set-setting! 'music 'tomb 0.0 0) (when (scene-release? arg1) (reset-warn-time! arg1) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -887,7 +887,7 @@ :nav-mesh-index -1 :skip-to -1 :on-set (lambda ((arg0 sig-under)) - (set-setting! 'music 'danger7 0 0) + (set-setting! 'music 'danger7 0.0 0) (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) (set! (-> v1-3 bytes 5) 1) (set! (-> v1-3 bytes 6) 7) @@ -969,7 +969,7 @@ :nav-mesh-index -1 :skip-to -1 :on-set (lambda ((arg0 sig-under)) - (set-setting! 'music 'tomb 0 0) + (set-setting! 'music 'tomb 0.0 0) (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) (set! (-> v1-3 bytes 5) 1) (set! (-> v1-3 bytes 6) 10) @@ -1309,7 +1309,7 @@ (with-pp (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (+ (-> pp clock frame-counter) (seconds -6))) (logior! (-> arg1 waypoint-bits) 1) - (set-setting! 'music 'danger3 0 0) + (set-setting! 'music 'danger3 0.0 0) ) #f ) @@ -1344,7 +1344,7 @@ (when (and (process-grab? arg0 #t) (process-grab? *target* #t)) (process-grab? arg0 #f) (process-grab? *target* #f) - (set-setting! 'entity-name "camera-245" 0 0) + (set-setting! 'entity-name "camera-245" 0.0 0) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) (process->ppointer pp)) (set! (-> a1-6 num-params) 0) @@ -1376,7 +1376,7 @@ ) ) (send-event (handle->process (-> arg0 growls 0)) 'fade) - (set-setting! 'music 'tomb 0 0) + (set-setting! 'music 'tomb 0.0 0) (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) (go-to-waypoint! arg0 21 #f) ) @@ -1578,7 +1578,7 @@ :skip-to -1 :on-set (lambda ((arg0 sig-under)) (stop-speech arg0 (the-as uint 0) #f) - (set-setting! 'music 'danger7 0 0) + (set-setting! 'music 'danger7 0.0 0) (set! (-> arg0 bot-task-bits) (logand -9 (-> arg0 bot-task-bits))) (let ((v1-7 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) (set! (-> v1-7 bytes 5) 1) diff --git a/test/decompiler/reference/jak2/levels/underport/under-obs_REF.gc b/test/decompiler/reference/jak2/levels/underport/under-obs_REF.gc index ca7d62c6d8..61fea22a82 100644 --- a/test/decompiler/reference/jak2/levels/underport/under-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/underport/under-obs_REF.gc @@ -1772,7 +1772,7 @@ This commonly includes things such as: (logtest? (elevator-flags airlock-opened) (-> self params flags)) ) (under-lift-method-49 self #t) - (set-setting! 'jump #f 0 0) + (set-setting! 'jump #f 0.0 0) ) (none) ) diff --git a/test/decompiler/reference/jak2/levels/underport/underb-master_REF.gc b/test/decompiler/reference/jak2/levels/underport/underb-master_REF.gc index d2f17264a3..f6729720f5 100644 --- a/test/decompiler/reference/jak2/levels/underport/underb-master_REF.gc +++ b/test/decompiler/reference/jak2/levels/underport/underb-master_REF.gc @@ -248,7 +248,7 @@ ((-> *setting-control* user-current pilot-exit) (let ((a1-2 *target*)) (when (and a1-2 (focus-test? a1-2 mech)) - (set-setting! 'pilot-exit #f 0 0) + (set-setting! 'pilot-exit #f 0.0 0) (apply-settings *setting-control*) #t ) @@ -532,7 +532,7 @@ :virtual #t :event underb-master-event-handler :enter (behavior () - (set-setting! 'entity-name "camera-239" 0 0) + (set-setting! 'entity-name "camera-239" 0.0 0) (send-event (ppointer->process *underb-master*) 'request 'under-warp #f) (none) ) @@ -579,7 +579,7 @@ :virtual #t :event underb-master-event-handler :enter (behavior () - (set-setting! 'mode-name 'cam-endlessfall 0 0) + (set-setting! 'mode-name 'cam-endlessfall 0.0 0) (none) ) :exit (behavior () @@ -616,7 +616,7 @@ :event underb-master-event-handler :enter (behavior () (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) - (set-setting! 'entity-name "camera-244" 0 0) + (set-setting! 'entity-name "camera-244" 0.0 0) (set! (-> self big-room-timer) (-> self clock frame-counter)) (send-event (ppointer->process *underb-master*) 'request 'under-warp #t) (none) @@ -1051,7 +1051,7 @@ (label cfg-11) (let ((a3-1 (res-lump-struct (-> self entity) 'camera-name structure))) (if a3-1 - (set-setting! 'entity-name a3-1 0 0) + (set-setting! 'entity-name a3-1 0.0 0) ) ) (until #f @@ -1136,7 +1136,7 @@ ) (let ((a3-1 (res-lump-struct (-> self entity) 'camera-name structure))) (if a3-1 - (set-setting! 'entity-name a3-1 0 0) + (set-setting! 'entity-name a3-1 0.0 0) ) ) (send-event (ppointer->process *underb-master*) 'request 'under-warp #f)