From aabec4d1037758740aee1121c397278bca54423e Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Thu, 3 Nov 2022 08:27:16 +1000 Subject: [PATCH] Allow 1xxx ailists to be completely terminated --- src/ailists/gailists.c | 49 +++++------ src/ailists/mp_setuparec.c | 4 +- src/ailists/mp_setupcrad.c | 4 +- src/ailists/mp_setupcryp.c | 4 +- src/ailists/mp_setupjun.c | 2 +- src/ailists/mp_setupmp1.c | 4 +- src/ailists/mp_setupmp10.c | 4 +- src/ailists/mp_setupmp11.c | 2 +- src/ailists/mp_setupmp12.c | 4 +- src/ailists/mp_setupmp13.c | 2 +- src/ailists/mp_setupmp14.c | 2 +- src/ailists/mp_setupmp15.c | 4 +- src/ailists/mp_setupmp16.c | 2 +- src/ailists/mp_setupmp17.c | 4 +- src/ailists/mp_setupmp18.c | 2 +- src/ailists/mp_setupmp19.c | 2 +- src/ailists/mp_setupmp2.c | 2 +- src/ailists/mp_setupmp20.c | 2 +- src/ailists/mp_setupmp3.c | 4 +- src/ailists/mp_setupmp4.c | 4 +- src/ailists/mp_setupmp5.c | 4 +- src/ailists/mp_setupmp6.c | 2 +- src/ailists/mp_setupmp7.c | 2 +- src/ailists/mp_setupmp8.c | 2 +- src/ailists/mp_setupmp9.c | 2 +- src/ailists/mp_setupoat.c | 2 +- src/ailists/mp_setupref.c | 2 +- src/ailists/mp_setuprun.c | 4 +- src/ailists/setupame.c | 89 ++++++++++---------- src/ailists/setuparec.c | 4 +- src/ailists/setupark.c | 105 ++++++++++++----------- src/ailists/setupate.c | 36 ++++---- src/ailists/setupazt.c | 76 +++++++---------- src/ailists/setupcave.c | 146 ++++++++++++++++---------------- src/ailists/setupdam.c | 84 +++++++++---------- src/ailists/setupdepo.c | 94 ++++++++++----------- src/ailists/setupdish.c | 127 ++++++++++++++-------------- src/ailists/setupear.c | 80 +++++++++--------- src/ailists/setupeld.c | 102 +++++++++++----------- src/ailists/setupimp.c | 144 ++++++++++++++----------------- src/ailists/setuplee.c | 120 +++++++++++++------------- src/ailists/setuplip.c | 149 ++++++++++++++++---------------- src/ailists/setuplue.c | 107 +++++++++++------------ src/ailists/setupmp3.c | 2 +- src/ailists/setuppam.c | 168 +++++++++++++++++-------------------- src/ailists/setuppete.c | 110 ++++++++++++------------ src/ailists/setuprit.c | 116 ++++++++++++------------- src/ailists/setupsev.c | 36 ++++---- src/ailists/setupsho.c | 102 +++++++++++----------- src/ailists/setupstat.c | 38 ++++----- src/ailists/setuptra.c | 134 +++++++++++++++-------------- src/ailists/setupwax.c | 82 ++++++------------ src/game/chrai.c | 29 +++++++ src/game/chraiasm.s | 2 + src/include/commands.h | 3 + src/setups/mp_setupmp14.c | 8 -- tools/ai2asm/ai2asm.py | 5 +- tools/ai2asm/commands.py | 1 + 58 files changed, 1177 insertions(+), 1249 deletions(-) diff --git a/src/ailists/gailists.c b/src/ailists/gailists.c index 564decca0..a10095b89 100644 --- a/src/ailists/gailists.c +++ b/src/ailists/gailists.c @@ -21,9 +21,7 @@ struct ailist *tmp = g_GlobalAilists; * @ailist GAILIST_IDLE */ u8 func0000_idle[] = { - beginloop(0x0d) - endloop(0x0d) - + terminate endlist }; @@ -32,7 +30,7 @@ u8 func0000_idle[] = { */ u8 func0005_end_cinema[] = { enter_firstperson - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -74,7 +72,7 @@ u8 func0006_unalerted[] = { // Dying label(0x15) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Injured or gun has just been shot out of hand label(0x16) @@ -794,7 +792,7 @@ u8 func0008_wakeup[] = { // Dead label(0x13) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Stand up label(0x15) @@ -894,7 +892,7 @@ u8 func0007_alerted[] = { label(0x16) say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x13) @@ -2681,7 +2679,7 @@ u8 func0007_alerted[] = { goto_first(LABEL_MAINLOOP) label(0x88) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate /*************************************************************************** * Run for alarm @@ -2754,7 +2752,7 @@ u8 func0007_alerted[] = { // Unreachable - nothing jumps to here label(0x0a) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2786,7 +2784,7 @@ u8 func000a_do_busy_animation[] = { if_chr_idle_action_eq(IDLEACTION_OPERATING_PAD, /*goto*/ 0x07) stop_chr return - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Standing and operating something label(0x03) @@ -3062,7 +3060,7 @@ u8 func000c_combat_with_target_chr[] = { label(0x17) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x13) @@ -3612,10 +3610,7 @@ u8 func0000_idle_0009[] = { set_action(MA_NORMAL, FALSE) set_returnlist(CHR_SELF, GAILIST_IDLE_0009) stop_chr - - beginloop(0x0c) - endloop(0x0c) - + terminate endlist }; @@ -3642,7 +3637,7 @@ u8 func0016_show_objective_failed_msg[] = { // Check objective is still failed label(0x13) if_any_objective_failed(/*goto*/ 0x13) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Show message first time label(0x13) @@ -3658,7 +3653,7 @@ u8 func0016_show_objective_failed_msg[] = { // Check objective is still failed label(0x16) if_any_objective_failed(/*goto*/ 0x13) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Show message second time label(0x13) @@ -3673,7 +3668,7 @@ u8 func0016_show_objective_failed_msg[] = { // Check objective is still failed label(0x06) if_any_objective_failed(/*goto*/ 0x13) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Show message third time label(0x13) @@ -3698,7 +3693,7 @@ u8 func0016_show_objective_failed_msg[] = { u8 func0017_rebuild_groups[] = { rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3871,7 +3866,7 @@ u8 func000f_hand_combat[] = { // Dying label(0x13) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x16) #endif @@ -4369,7 +4364,7 @@ u8 func001d_search_for_player[] = { // Dying label(0x13) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x16) @@ -4563,7 +4558,7 @@ u8 func001f_related_to_spawning[] = { // Dying label(0x13) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x16) @@ -4825,7 +4820,7 @@ u8 func0014_buddy_main[] = { // Dying label(0x13) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x16) @@ -5000,7 +4995,7 @@ u8 func0023_dodge[] = { // Dying label(0x16) set_aishootingatmelist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x13) set_self_flag_bankx(CHRFLAG1_DODGED, BANK_1) @@ -5178,7 +5173,7 @@ u8 func0027_psychosised[] = { // Dying label(0x13) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x16) @@ -5279,7 +5274,7 @@ u8 func0027_psychosised[] = { u8 func002d_invincible_and_idle[] = { set_self_chrflag(CHRCFLAG_INVINCIBLE) set_self_chrflag(CHRCFLAG_UNEXPLODABLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -5412,7 +5407,7 @@ u8 func0020_buddy_warp[] = { u8 func0021_stop_and_idle[] = { set_shotlist(GAILIST_STOP_AND_IDLE) stop_chr - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setuparec.c b/src/ailists/mp_setuparec.c index 42a668fff..97aa6fe5b 100644 --- a/src/ailists/mp_setuparec.c +++ b/src/ailists/mp_setuparec.c @@ -129,7 +129,7 @@ struct path paths[] = { u8 func1001_start_lift[] = { activate_lift(1, 0x00) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -137,7 +137,7 @@ u8 func1000_1b30[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupcrad.c b/src/ailists/mp_setupcrad.c index c91bca4ff..4fcdea7db 100644 --- a/src/ailists/mp_setupcrad.c +++ b/src/ailists/mp_setupcrad.c @@ -121,7 +121,7 @@ struct path paths[] = { u8 func1001_start_lift[] = { activate_lift(1, 0x01) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -129,7 +129,7 @@ u8 func1000_14e0[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupcryp.c b/src/ailists/mp_setupcryp.c index 2f0cde66f..a3fef8d7a 100644 --- a/src/ailists/mp_setupcryp.c +++ b/src/ailists/mp_setupcryp.c @@ -118,7 +118,7 @@ struct path paths[] = { u8 func1001_13d4[] = { set_wind_speed(11) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -126,7 +126,7 @@ u8 func1000_13e0[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupjun.c b/src/ailists/mp_setupjun.c index 81d72e78d..b5055cef5 100644 --- a/src/ailists/mp_setupjun.c +++ b/src/ailists/mp_setupjun.c @@ -125,7 +125,7 @@ u8 func1000_1898[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp1.c b/src/ailists/mp_setupmp1.c index 3a2cf25b2..15fbbfcd7 100644 --- a/src/ailists/mp_setupmp1.c +++ b/src/ailists/mp_setupmp1.c @@ -146,7 +146,7 @@ struct path paths[] = { u8 func1001_start_lifts[] = { activate_lift(1, 0x01) activate_lift(2, 0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -154,7 +154,7 @@ u8 func1000_21d4[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp10.c b/src/ailists/mp_setupmp10.c index a8363ee98..21ce3adb9 100644 --- a/src/ailists/mp_setupmp10.c +++ b/src/ailists/mp_setupmp10.c @@ -120,7 +120,7 @@ u8 func1001_start_lifts[] = { activate_lift(1, 0x00) activate_lift(2, 0x01) activate_lift(3, 0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -128,7 +128,7 @@ u8 func1000_1680[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp11.c b/src/ailists/mp_setupmp11.c index da1c2cd2e..9f7128b58 100644 --- a/src/ailists/mp_setupmp11.c +++ b/src/ailists/mp_setupmp11.c @@ -144,7 +144,7 @@ u8 func1000_26fc[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp12.c b/src/ailists/mp_setupmp12.c index 09c91e65e..8018b5f89 100644 --- a/src/ailists/mp_setupmp12.c +++ b/src/ailists/mp_setupmp12.c @@ -189,7 +189,7 @@ u8 func1001_start_lifts[] = { activate_lift(6, 0x06) activate_lift(7, 0x07) activate_lift(8, 0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -197,7 +197,7 @@ u8 func1000_3cc8[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp13.c b/src/ailists/mp_setupmp13.c index ae04dcb2c..2f12aaa0f 100644 --- a/src/ailists/mp_setupmp13.c +++ b/src/ailists/mp_setupmp13.c @@ -111,7 +111,7 @@ u8 func1000_1368[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp14.c b/src/ailists/mp_setupmp14.c index 4ed802a11..41a9bdc06 100644 --- a/src/ailists/mp_setupmp14.c +++ b/src/ailists/mp_setupmp14.c @@ -37,7 +37,7 @@ u8 unregistered_func1[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp15.c b/src/ailists/mp_setupmp15.c index 3bf4ae759..47ad63d04 100644 --- a/src/ailists/mp_setupmp15.c +++ b/src/ailists/mp_setupmp15.c @@ -147,7 +147,7 @@ struct path paths[] = { u8 func1001_start_lift[] = { activate_lift(1, 0x01) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -155,7 +155,7 @@ u8 func1000_2400[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp16.c b/src/ailists/mp_setupmp16.c index deb474881..f57dce958 100644 --- a/src/ailists/mp_setupmp16.c +++ b/src/ailists/mp_setupmp16.c @@ -36,7 +36,7 @@ u8 unregistered_func1[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp17.c b/src/ailists/mp_setupmp17.c index b5a35afd9..ecaf2e84f 100644 --- a/src/ailists/mp_setupmp17.c +++ b/src/ailists/mp_setupmp17.c @@ -35,7 +35,7 @@ struct path paths[] = { u8 func1001_0038[] = { set_wind_speed(130) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -43,7 +43,7 @@ u8 func1000_0044[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp18.c b/src/ailists/mp_setupmp18.c index 4ee06e743..899315735 100644 --- a/src/ailists/mp_setupmp18.c +++ b/src/ailists/mp_setupmp18.c @@ -37,7 +37,7 @@ u8 func1000_0038[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp19.c b/src/ailists/mp_setupmp19.c index aaa6b4b2f..e3aa9e1e9 100644 --- a/src/ailists/mp_setupmp19.c +++ b/src/ailists/mp_setupmp19.c @@ -37,7 +37,7 @@ u8 func1000_0038[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp2.c b/src/ailists/mp_setupmp2.c index bf2e43ea0..e7d94e7a6 100644 --- a/src/ailists/mp_setupmp2.c +++ b/src/ailists/mp_setupmp2.c @@ -44,7 +44,7 @@ u8 unregistered_func2[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp20.c b/src/ailists/mp_setupmp20.c index a806de67b..bb5aef2bf 100644 --- a/src/ailists/mp_setupmp20.c +++ b/src/ailists/mp_setupmp20.c @@ -37,7 +37,7 @@ u8 func1000_0038[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp3.c b/src/ailists/mp_setupmp3.c index 1cd892079..fe634e387 100644 --- a/src/ailists/mp_setupmp3.c +++ b/src/ailists/mp_setupmp3.c @@ -138,7 +138,7 @@ struct path paths[] = { u8 func1001_27e0[] = { set_wind_speed(15) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -146,7 +146,7 @@ u8 func1000_27ec[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp4.c b/src/ailists/mp_setupmp4.c index 78d9999ed..a4a4b07ac 100644 --- a/src/ailists/mp_setupmp4.c +++ b/src/ailists/mp_setupmp4.c @@ -112,7 +112,7 @@ struct path paths[] = { u8 func1001_1590[] = { set_wind_speed(22) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -120,7 +120,7 @@ u8 func1000_159c[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp5.c b/src/ailists/mp_setupmp5.c index 6d2a63fa1..e17fa7d4d 100644 --- a/src/ailists/mp_setupmp5.c +++ b/src/ailists/mp_setupmp5.c @@ -122,7 +122,7 @@ struct path paths[] = { u8 func1001_1dc0[] = { set_wind_speed(8) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -130,7 +130,7 @@ u8 func1000_1dcc[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp6.c b/src/ailists/mp_setupmp6.c index b5c2fcd14..ac008d628 100644 --- a/src/ailists/mp_setupmp6.c +++ b/src/ailists/mp_setupmp6.c @@ -36,7 +36,7 @@ u8 unregistered_func1[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp7.c b/src/ailists/mp_setupmp7.c index d71ac84fd..4f014f55a 100644 --- a/src/ailists/mp_setupmp7.c +++ b/src/ailists/mp_setupmp7.c @@ -37,7 +37,7 @@ u8 func1000_0038[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp8.c b/src/ailists/mp_setupmp8.c index eef5783b9..9440727bd 100644 --- a/src/ailists/mp_setupmp8.c +++ b/src/ailists/mp_setupmp8.c @@ -37,7 +37,7 @@ u8 func1000_0038[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupmp9.c b/src/ailists/mp_setupmp9.c index bfc5dc238..050636ac9 100644 --- a/src/ailists/mp_setupmp9.c +++ b/src/ailists/mp_setupmp9.c @@ -126,7 +126,7 @@ u8 func1000_1cf8[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupoat.c b/src/ailists/mp_setupoat.c index b47e7e5df..d0c8bb667 100644 --- a/src/ailists/mp_setupoat.c +++ b/src/ailists/mp_setupoat.c @@ -134,7 +134,7 @@ u8 func1000_1c08[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setupref.c b/src/ailists/mp_setupref.c index 7ea6ba73b..fd74804c0 100644 --- a/src/ailists/mp_setupref.c +++ b/src/ailists/mp_setupref.c @@ -132,7 +132,7 @@ u8 func1000_1598[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/mp_setuprun.c b/src/ailists/mp_setuprun.c index 82431fc23..8b0e0c1cd 100644 --- a/src/ailists/mp_setuprun.c +++ b/src/ailists/mp_setuprun.c @@ -34,7 +34,7 @@ struct path paths[] = { }; u8 unregistered_func1[] = { - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -42,7 +42,7 @@ u8 unregistered_func2[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setupame.c b/src/ailists/setupame.c index f57c3efe9..ced5cc735 100644 --- a/src/ailists/setupame.c +++ b/src/ailists/setupame.c @@ -1044,11 +1044,10 @@ u8 func0401_do_some_animation[] = { label(0x2c) chr_do_animation(ANIM_0066, 1, -1, CHRANIMFLAG_PAUSEATEND, 16, CHR_SELF, 2) - beginloop(0x85) - endloop(0x85) + terminate // Unreachable - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1056,7 +1055,7 @@ u8 func0401_do_some_animation[] = { * @unregistered */ u8 unregistered_function[] = { - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1227,7 +1226,7 @@ u8 func040f_cass[] = { // Dying label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) chr_do_animation(ANIM_TALKING_00A0, 0, 193, CHRANIMFLAG_COMPLETED | CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2) @@ -1450,7 +1449,7 @@ u8 func0411_secretary[] = { goto_next(0x2c) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) chr_do_animation(ANIM_00A1, 0, 193, CHRANIMFLAG_COMPLETED | CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2) @@ -1558,7 +1557,7 @@ u8 func0414_programmer[] = { // PA only if_difficulty_gt(DIFF_SA, /*goto*/ 0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) set_reaction_speed(100) @@ -1568,7 +1567,7 @@ u8 func0414_programmer[] = { goto_next(0x2c) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) if_num_times_shot_lt(1, /*goto*/ 0x06) @@ -1929,11 +1928,10 @@ u8 func0414_programmer[] = { label(0x2c) speak(CHR_TARGET, -1, SFX_TYPING_8118, -1, COLOR_00_GREEN) - beginloop(0xb0) - endloop(0xb0) + terminate label(0xb1) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_PC_BROKEN) set_self_flag_bankx(CHRFLAG0_CANT_ALERT_GROUP, BANK_0) @@ -1966,7 +1964,7 @@ u8 func1005_give_control[] = { grant_control(CHR_BOND) grant_control(CHR_COOP) yield - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1974,7 +1972,7 @@ u8 func1005_give_control[] = { * @unused */ u8 func0415_set_idle[] = { - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2135,9 +2133,6 @@ u8 func100e_check_ecm_mines[] = { label(0x8a) endloop(0x00) - beginloop(0x06) - endloop(0x06) - endlist }; @@ -2168,7 +2163,7 @@ u8 func1004_check_lab_lift_located[] = { label(0x2c) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) set_invincible(CHR_BOND) @@ -2188,10 +2183,10 @@ u8 func1006_check_programmer_dead[] = { if_stage_flag_eq(STAGEFLAG_PROGRAMMER_LOGGED_IN, TRUE, /*goto*/ 0x06) show_hudmsg(CHR_BOND, L_AME_057) // "Critical mission personnel killed." set_stage_flag(STAGEFLAG_PROGRAMMER_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Unreachable label(0xac) @@ -2283,7 +2278,7 @@ u8 func1007_uplinking[] = { show_hudmsg(CHR_TARGET, L_AME_045) // "File download completed." yield set_stage_flag(STAGEFLAG_DOWNLOAD_COMPLETE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) show_hudmsg(CHR_TARGET, L_AME_074) // "Datalink broken - connection terminated." @@ -2327,7 +2322,7 @@ u8 func1008_doorswitch[] = { unset_object_flag2(OBJ_OFFICEDOOR1, OBJFLAG2_AICANNOTUSE) unset_object_flag2(OBJ_OFFICEDOOR2, OBJFLAG2_AICANNOTUSE) set_stage_flag(STAGEFLAG_OFFICE_DOOR_UNLOCKED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // PA beginloop(0x04) @@ -2362,7 +2357,7 @@ u8 func1008_doorswitch[] = { label(0x06) assign_sound(SFX_043B, CHANNEL_7) control_sound_from_object(CHANNEL_7, OBJ_OFFICEDOOR1, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2376,12 +2371,12 @@ u8 func1009_check_civilians_killed[] = { label(0x2c) show_hudmsg(CHR_BOND, L_AME_055) // "Unacceptable civilian casualties." set_stage_flag(STAGEFLAG_CIVILIANS_KILLED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x09) show_hudmsg(CHR_BOND, L_AME_057) // "Critical mission personnel killed." set_stage_flag(STAGEFLAG_CIVILIANS_KILLED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2460,7 +2455,7 @@ u8 func100c_noop2[] = { endloop(0x04) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2507,7 +2502,7 @@ u8 func100d_check_objects_destroyed[] = { // Agent label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3183,7 +3178,7 @@ u8 func0422_intro_042d[] = { stop_cutscene_track stop_ambient_track set_savefile_flag(GAMEFILEFLAG_CI_TOUR_DONE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3287,7 +3282,7 @@ u8 func0416_outro[] = { label(0xbd) mute_channel(CHANNEL_10) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3311,7 +3306,7 @@ u8 func100f_check_necklace_collected[] = { label(0x2c) chr_toggle_modelpart(CHR_CASS, MODELPART_CHR_NECKLACE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3331,7 +3326,7 @@ u8 func1010_start_hub_humms[] = { yield play_sound_from_object2(CHANNEL_1, OBJ_SECURITYHUB, SFX_0004, 0x0f, 0x00) #endif - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3380,7 +3375,7 @@ u8 func1012_trigger_x_music[] = { if_stage_flag_eq(STAGEFLAG_LAB_ELEVATOR_CLOSED, TRUE, /*goto*/ 0x2c) play_x_track(XREASON_DEFAULT, 10, 60) label(0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3442,7 +3437,7 @@ u8 func1013_msg_commshubnearby[] = { label(0x2c) speak(CHR_BOND, L_AME_093, SFX_8170, CHANNEL_6, COLOR_09_BLUE) // "We're getting a positive reading - the internal co..." label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3457,7 +3452,7 @@ u8 func1014_msg_officefloor[] = { label(0x2c) speak(CHR_BOND, L_AME_094, SFX_8171, CHANNEL_6, COLOR_09_BLUE) // "You're on the same floor as Cassandra's office." label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3471,7 +3466,7 @@ u8 func1015_msg_securityroom[] = { label(0x2c) speak(CHR_BOND, L_AME_095, MP3_03A2, CHANNEL_6, COLOR_09_BLUE) // "The other hub has got to be in the Security Room." label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3482,18 +3477,18 @@ u8 func1016_msg_basementelevator[] = { label(0x2c) speak(CHR_BOND, L_AME_096, SFX_8172, CHANNEL_6, COLOR_09_BLUE) // "The basement elevator must be around there somewhe..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1017_unlock_basement_door[] = { if_difficulty_lt(DIFF_SA, /*goto*/ 0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Agent only - unlock basement door (SA and PA requires necklace) label(0x2c) unlock_door(OBJ_SECRETDOOR, 0x20) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3664,7 +3659,7 @@ u8 func1019_toggle_guards[] = { enable_chr(0x15) yield enable_chr(0x16) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3672,14 +3667,14 @@ u8 func101a_noop[] = { yield yield yield - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func141c_start_lifts[] = { activate_lift(2, OBJ_LIFT1) activate_lift(1, OBJ_LIFT2) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3747,7 +3742,7 @@ u8 func101d_disable_cameras[] = { label(0x06) show_hudmsg(CHR_BOND, L_AME_097) // "Security system is now back online." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3756,7 +3751,7 @@ u8 func101d_disable_cameras[] = { */ u8 unregistered_function7[] = { show_hudmsg(CHR_BOND, L_AME_099) // "2023 AD, 2214 Hours Lucerne Tower - dataDyne HQ" - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3872,7 +3867,7 @@ u8 func042f_surrendering_guard[] = { // Surrender label(0x28) surrender - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3881,7 +3876,7 @@ u8 func101f_setup_rtracker[] = { set_object_flag3(OBJ_FALCONSIL1, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(OBJ_FALCONSIL2, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(OBJ_LAPTOPGUN, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3997,7 +3992,7 @@ u8 func1420_setup_portals[] = { set_portal_flag(0x00f0, PORTALFLAG_SKIP) set_portal_flag(0x00f8, PORTALFLAG_SKIP) set_portal_flag(0x00f1, PORTALFLAG_SKIP) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4035,12 +4030,12 @@ u8 func1421_setup_environment[] = { configure_environment(0x00a4, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x00a5, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x00a7, AIENVCMD_ROOM_SETOUTDOORS, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 unregistered_function8[] = { - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setuparec.c b/src/ailists/setuparec.c index ac6775a81..840d570c1 100644 --- a/src/ailists/setuparec.c +++ b/src/ailists/setuparec.c @@ -26,12 +26,12 @@ u32 props[] = { }; u8 unregistered_func1[] = { - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 unregistered_func2[] = { - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setupark.c b/src/ailists/setupark.c index ef5bc3b4b..e3cf792cb 100644 --- a/src/ailists/setupark.c +++ b/src/ailists/setupark.c @@ -562,8 +562,7 @@ struct path paths[] = { u8 func0403_stop_and_idle[] = { stop_chr - beginloop(0x00) - endloop(0x00) + terminate endlist }; @@ -571,7 +570,7 @@ u8 func0403_stop_and_idle[] = { u8 func0404_init_drcaroll[] = { set_self_chrflag(CHRCFLAG_PUSHABLE) set_shield(100) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -604,7 +603,7 @@ u8 func0401_drcaroll_following[] = { label(0x00) say_quip(CHR_TARGET, 0x06, 0xff, 0x03, 0xff, BANK_1, 0x00, 0x00) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate set_target_chr(CHR_BOND) set_shield(100) set_chr_maxdamage(CHR_SELF, 100) @@ -688,8 +687,8 @@ u8 func0401_drcaroll_following[] = { label(0x07) try_run_to_target(/*goto*/ 0x08) - beginloop(0x08) - endloop(0x08) + label(0x08) + terminate label(0x09) goto_first(0x02) @@ -703,7 +702,7 @@ u8 func0401_drcaroll_following[] = { goto_first(0x02) label(0x20) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -715,7 +714,7 @@ u8 func0405_drcaroll_waiting[] = { goto_next(0x00) label(0x20) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x00) set_chr_hiddenflag(CHR_DRCAROLL, CHRHFLAG_00100000) @@ -749,7 +748,7 @@ u8 func100c_foyer_lights_timer[] = { // Agent label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Unreachable set_countdown_timer(60) @@ -813,7 +812,7 @@ u8 func100c_foyer_lights_timer[] = { set_lights_state(0x0013, LIGHTOP_1, 0x64, 0x00, 0x00) set_lights_state(0x0014, LIGHTOP_1, 0x64, 0x00, 0x00) set_lights_state(0x000d, LIGHTOP_1, 0x64, 0x00, 0x00) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -886,7 +885,7 @@ u8 func0411_top_guard_blinded[] = { goto_next(0x00) label(0x20) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x00) chr_do_animation(ANIM_BLINDED, 0, -1, CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2) @@ -927,7 +926,7 @@ u8 func0406_general_combat[] = { label(0x00) say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive with gun label(0x20) @@ -1341,7 +1340,7 @@ u8 func1002_check_accessed_foyer_elevator[] = { label(0x00) set_stage_flag(STAGEFLAG_ACCESSED_FOYER_ELEVATOR) show_hudmsg(CHR_TARGET, L_ARK_033) // "Foyer elevator accessed." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1374,7 +1373,7 @@ u8 func1003_check_end_level[] = { label(0x20) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x00) set_invincible(CHR_BOND) @@ -1387,7 +1386,7 @@ u8 func1004_elevator_unlocking[] = { if_difficulty_gt(DIFF_SA, /*goto*/ 0x1f) unlock_door(0x02, 0x01) unlock_door(0x03, 0x01) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x1f) chr_toggle_p1p2(CHR_SELF) @@ -1404,7 +1403,7 @@ u8 func1004_elevator_unlocking[] = { set_stage_flag(STAGEFLAG_ELEVATOR_PC_DESTROYED) show_hudmsg(CHR_BOND, L_ARK_045) // "Critical mission object destroyed." label(0x00) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Computer activated label(0x20) @@ -1449,7 +1448,7 @@ u8 func1004_elevator_unlocking[] = { unlock_door(0x03, 0x01) show_hudmsg(CHR_TARGET, L_ARK_034) // "Office elevator door has been unlocked." set_stage_flag(STAGEFLAG_ELEVATOR_UNLOCKED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1487,7 +1486,7 @@ u8 func1005_check_bodyguards_dead[] = { label(0x26) show_hudmsg(CHR_BOND, L_ARK_036) // "Cassandra's bodyguards have been defeated." set_stage_flag(STAGEFLAG_OBJECTIVE_BODYGUARDS_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1498,12 +1497,12 @@ u8 func1006_check_hovercopter_destroyed[] = { if_object_in_good_condition(OBJ_HOVERCOPTER, /*goto*/ 0x00) show_hudmsg(CHR_BOND, L_ARK_035) // "DataDyne Hovercopter eliminated." set_stage_flag(STAGEFLAG_HOVERCOPTER_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x00) endloop(0x1f) label(0x26) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1527,7 +1526,7 @@ u8 func100e_drcaroll_warnings[] = { label(0x00) show_hudmsg(CHR_BOND, L_ARK_016) // "Dr. Caroll has been killed!" set_stage_flag(STAGEFLAG_DRCAROLL_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Shield under 100 label(0x30) @@ -1544,7 +1543,7 @@ u8 func100e_drcaroll_warnings[] = { }; u8 func1007_noop[] = { - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1564,7 +1563,7 @@ u8 func1008_trigger_hovercopter_roof[] = { label(0x21) set_stage_flag(STAGEFLAG_CHOPPER_GO_TO_ROOF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1615,7 +1614,7 @@ u8 func1009_init_top_room[] = { label(0x20) set_stage_flag(STAGEFLAG_CASS_SHIELD_DAMAGED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1804,7 +1803,7 @@ u8 func0409_tech_conversation[] = { label(0x37) restart_timer surrender - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Unreachable chr_do_animation(ANIM_COWER_0229, -1, -1, CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2) @@ -1822,13 +1821,13 @@ u8 func0409_tech_conversation[] = { label(0x00) remove_chr(CHR_SELF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func040d_cass_necklace[] = { chr_toggle_modelpart(CHR_CASS, MODELPART_CHR_NECKLACE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1896,7 +1895,7 @@ u8 func040a_tech2[] = { label(0x37) restart_timer surrender - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Unreachable chr_do_animation(ANIM_COWER_0229, -1, -1, CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2) @@ -1914,7 +1913,7 @@ u8 func040a_tech2[] = { label(0x00) remove_chr(CHR_SELF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2100,7 +2099,7 @@ u8 func040d_cass[] = { #else stop_chr #endif - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2113,7 +2112,7 @@ u8 func101f_unlock_top_door[] = { label(0x20) unlock_door(OBJ_TOPROOMDOOR, 0x02) unset_object_flag2(OBJ_TOPROOMDOOR, OBJFLAG2_AICANNOTUSE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2121,7 +2120,7 @@ u8 func101f_unlock_top_door[] = { * @unused */ u8 func040e_noop2[] = { - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2184,7 +2183,7 @@ u8 func100b_check_top_lights_on[] = { set_ailist(CHR_TOPGUARD3, AILIST_TOP_GUARD_BLINDED) set_ailist(CHR_TOPGUARD4, AILIST_TOP_GUARD_BLINDED) set_ailist(CHR_TOPGUARD5, AILIST_TOP_GUARD_BLINDED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2287,7 +2286,7 @@ u8 func100c_foyer_lights[] = { set_lights_state(0x0013, LIGHTOP_1, 0x02, 0x00, 0x00) set_lights_state(0x0014, LIGHTOP_1, 0x02, 0x00, 0x00) set_lights_state(0x000d, LIGHTOP_1, 0x02, 0x00, 0x00) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2404,7 +2403,7 @@ u8 func100d_intro[] = { set_ailist(CHR_DRCAROLL, 0x0402) yield kill(CHR_INTRO_GUARD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2629,7 +2628,7 @@ u8 func0412_outro[] = { label(0x5d) disable_object(OBJ_JUMPSHIP) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2670,19 +2669,19 @@ u8 func0413_defend_pad[] = { u8 func100f_move_rocket_ammo[] = { if_difficulty_lt(DIFF_SA, /*goto*/ 0x00) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Agent only label(0x00) move_object_to_pad(OBJ_ROCKETAMMO1, PAD_ARK_000F) move_object_to_pad(OBJ_ROCKETAMMO2, PAD_ARK_000D) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func040d_cass_outro[] = { set_shield(0) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2728,7 +2727,7 @@ u8 func1012_msg_lockeddown[] = { label(0x20) speak(CHR_BOND, L_ARK_051, SFX_8176, CHANNEL_6, COLOR_09_BLUE) // "They've locked down the ground floor - get to the ..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2750,7 +2749,7 @@ u8 func1013_msg_thatcopter[] = { speak(CHR_BOND, L_ARK_052, SFX_8177, CHANNEL_6, COLOR_09_BLUE) // "That copter needs to be taken out, or the jumpship..." label(0x26) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2780,11 +2779,11 @@ u8 func1014_msg_cantleaveany[] = { endloop(0x5f) label(0x20) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x27) mute_channel(CHANNEL_6) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2798,7 +2797,7 @@ u8 func1015_msg_jumpshipwaiting[] = { speak(CHR_BOND, L_ARK_054, SFX_8178, CHANNEL_6, COLOR_09_BLUE) // "Don't keep the jumpship waiting - get back to the ..." label(0x00) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2825,7 +2824,7 @@ u8 func1016_msg_make_foyer_guards_alerted[] = { if_alive_set_alerted(0x09) if_alive_set_alerted(0x0a) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2874,11 +2873,11 @@ u8 func1017_remove_special_shock[] = { endloop(0x1f) label(0x20) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x00) remove_chr(CHR_SPECIAL_SHOCK) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2890,14 +2889,14 @@ u8 func1018_give_magnum[] = { // Player has been seen - remove Dy357 from shock trooper label(0x00) give_object_to_chr(OBJ_DY357, CHR_MRBLONDE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1419_start_lifts[] = { activate_lift(2, 0x1d) activate_lift(1, 0x1e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2909,7 +2908,7 @@ u8 func101a_set_rocketlauncher_flag[] = { set_object_flag2(OBJ_ROCKETLAUNCHER, OBJFLAG2_AICANNOTUSE) label(0x20) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3065,7 +3064,7 @@ u8 func141c_setup_portals[] = { set_portal_flag(0x00f0, PORTALFLAG_SKIP) set_portal_flag(0x00f8, PORTALFLAG_SKIP) set_portal_flag(0x00f1, PORTALFLAG_SKIP) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3103,7 +3102,7 @@ u8 func141e_setup_environment[] = { configure_environment(0x00a4, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x00a5, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x00a7, AIENVCMD_ROOM_SETOUTDOORS, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3111,7 +3110,7 @@ u8 func101d_setup_rtracker[] = { yield set_object_flag3(OBJ_GRENADE, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(OBJ_DRAGON, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setupate.c b/src/ailists/setupate.c index 7803d9f56..07aa7f7bb 100644 --- a/src/ailists/setupate.c +++ b/src/ailists/setupate.c @@ -132,7 +132,7 @@ u8 func1002_first_walk[] = { label(0x0c) grant_control(CHR_BOND) set_ailist(CHR_GUARD, AILIST_GUARD_COMBAT) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -146,7 +146,7 @@ u8 func1007_second_walk[] = { // Begin cutscene label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) revoke_control(CHR_BOND, 0) camera_movement(ANIM_CUT_ATE_INTRO_CAM) @@ -203,7 +203,7 @@ u8 func1007_second_walk[] = { label(0x0c) grant_control(CHR_BOND) set_ailist(CHR_JONATHAN, AILIST_JON_COMBAT) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -212,7 +212,7 @@ u8 func0401_move_to_pad[] = { label(0x06) yield stop_chr - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -226,7 +226,7 @@ u8 func1008_third_walk[] = { // Jo dead label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Do cutscene label(0x06) @@ -275,14 +275,14 @@ u8 func1008_third_walk[] = { label(0x0c) set_ailist(CHR_TRENT, AILIST_TRENT_COMBAT) grant_control(CHR_BOND) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1004_revoke_control[] = { yield revoke_control(CHR_BOND, 0) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -307,7 +307,7 @@ u8 func1005_main[] = { goto_next(0x06) label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) set_stage_flag(STAGEFLAG_SA_WALK_TRIGGER) @@ -332,7 +332,7 @@ u8 func1005_main[] = { goto_next(0x06) label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) set_stage_flag(STAGEFLAG_PA_WALK_TRIGGER) @@ -352,14 +352,14 @@ u8 func1005_main[] = { endloop(0x0d) label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1003_init_audio[] = { stop_cutscene_track stop_ambient_track - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -380,7 +380,7 @@ u8 func1006_check_objectives_complete[] = { // End level label(0x2d) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -429,7 +429,7 @@ u8 func0402_guard_combat[] = { // Dying label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Hand combat label(0x0e) @@ -473,7 +473,7 @@ u8 func0403_jon_combat[] = { label(0x0e) set_returnlist(CHR_SELF, AILIST_JON_COMBAT) set_ailist(CHR_SELF, GAILIST_HAND_COMBAT) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -513,7 +513,7 @@ u8 func0404_trent_combat[] = { set_returnlist(CHR_SELF, AILIST_TRENT_COMBAT) set_ailist(CHR_SELF, GAILIST_HAND_COMBAT) label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -529,7 +529,7 @@ u8 func0405_guard_init[] = { add_health_or_armor(0) set_recovery_speed(0) set_shield(0) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -544,7 +544,7 @@ u8 func0406_jon_init[] = { set_self_chrflag(CHRCFLAG_HIDDEN) set_self_chrflag(CHRCFLAG_INVINCIBLE) set_self_chrflag(CHRCFLAG_UNEXPLODABLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -559,7 +559,7 @@ u8 func0407_trent_init[] = { set_self_chrflag(CHRCFLAG_HIDDEN) set_self_chrflag(CHRCFLAG_INVINCIBLE) set_self_chrflag(CHRCFLAG_UNEXPLODABLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setupazt.c b/src/ailists/setupazt.c index d5699fc6d..05913f46b 100644 --- a/src/ailists/setupazt.c +++ b/src/ailists/setupazt.c @@ -465,7 +465,7 @@ u8 func1400_setup_counterop[] = { u8 func1011_setup_snow[] = { enable_snow(TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -586,7 +586,7 @@ u8 func1002_intro[] = { stop_ambient_track set_chr_hudpiece_visible(CHR_BOND, FALSE) enter_firstperson - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -834,7 +834,7 @@ u8 func0402_outro[] = { label(0x65) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -869,19 +869,7 @@ u8 func1003_msg_therestheescapepod[] = { label(0x31) speak(CHR_P1P2, L_AZT_010, MP3_03CC, CHANNEL_6, COLOR_09_BLUE) // "There's the escape pod." - set_ailist(CHR_SELF, GAILIST_IDLE) - endlist -}; - -u8 func1004_msg_maybetheresabeacon[] = { - restart_timer - beginloop(0x06) - endloop(0x06) - - // Unreachable - label(0x31) - speak(CHR_BOND, L_AZT_011, MP3_03CD, CHANNEL_6, COLOR_09_BLUE) // "Maybe there's a beacon in there." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -903,7 +891,7 @@ u8 func1005_msg_thejamming[] = { #if VERSION >= VERSION_NTSC_1_0 label(0x0f) #endif - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -915,7 +903,7 @@ u8 func1006_msg_elvisbeable[] = { label(0x31) speak(CHR_P1P2, L_AZT_013, MP3_03CF, CHANNEL_6, COLOR_09_BLUE) // "Elvis... He'll be able to protect the President." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1099,7 +1087,7 @@ u8 func100c_spawn_dd_guards[] = { goto_first(0x66) label(0x0f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1135,7 +1123,7 @@ u8 func1008_escapepod[] = { mute_channel(CHANNEL_0) show_hudmsg(CHR_BOND, L_AZT_015) // "Critical mission object has been destroyed." set_stage_flag(STAGEFLAG_ESCAPEPOD_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Pod healthy label(0x31) @@ -1151,7 +1139,7 @@ u8 func1008_escapepod[] = { set_stage_flag(STAGEFLAG_BEACON_ACTIVATED) endloop(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1166,7 +1154,7 @@ u8 func1009_check_shuttle_destroyed[] = { if_object_in_good_condition(OBJ_SKEDAR_SHUTTLE, /*goto*/ 0x31) show_hudmsg(CHR_BOND, L_AZT_021) // "Jamming device has been shut down." set_stage_flag(STAGEFLAG_SKEDAR_SHUTTLE_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x31) endloop(0x06) @@ -1181,7 +1169,7 @@ u8 func100a_check_president_dead[] = { label(0x31) show_hudmsg(CHR_BOND, L_AZT_022) // "President has been killed." set_stage_flag(STAGEFLAG_PRESIDENT_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1193,7 +1181,7 @@ u8 func100b_check_clone_dead[] = { label(0x31) show_hudmsg(CHR_BOND, L_AZT_023) // "Presidential clone has been eliminated." set_stage_flag(STAGEFLAG_CLONE_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1313,8 +1301,7 @@ u8 func0404_elvis[] = { u8 func0405_unused[] = { jog_to_pad(PAD_AZT_0107) - beginloop(0x06) - endloop(0x06) + terminate endlist }; @@ -1418,7 +1405,7 @@ u8 func0418_robot[] = { label(0x11) assign_sound(MP3_ROBOT_ALERT_UNDER_ATTACK, CHANNEL_6) play_sound_from_entity(CHANNEL_6, CHR_SELF, 0x0bb8, 0x1770, 0x01) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1456,13 +1443,13 @@ u8 func0414_spawner[] = { label(0x31) yield set_ailist(CHR_SELF, AILIST_SPAWNER) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func0419_unused[] = { set_self_chrflag(CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1470,7 +1457,7 @@ u8 func0422_hide[] = { set_self_chrflag(CHRCFLAG_INVINCIBLE) set_self_chrflag(CHRCFLAG_UNEXPLODABLE) set_self_chrflag(CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1508,7 +1495,7 @@ u8 func041a_pres_clone[] = { label(0x31) goto_first(0xa5) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1528,7 +1515,7 @@ u8 func041c_president_waiting[] = { // Dying label(0x08) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x31) stop_chr @@ -1572,7 +1559,7 @@ u8 func041d_president_running[] = { assign_sound(MP3_02BF, CHANNEL_6) play_sound_from_entity(CHANNEL_6, CHR_SELF, 0x0bb8, 0x1770, 0x01) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x31) @@ -1694,7 +1681,7 @@ u8 func041d_president_running[] = { show_hudmsg(CHR_TARGET, L_AZT_025) // "President has been rescued." set_stage_flag(STAGEFLAG_PRESIDENT_RESCUED) label(0x31) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1745,7 +1732,7 @@ u8 func100e_check_robots_left[] = { label(0x31) set_stage_flag(STAGEFLAG_TRIGGER_PRESIDENT_RUNNING) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1858,7 +1845,7 @@ u8 func0420_trent_running[] = { // Player definitely not in sight label(0x08) set_self_chrflag(CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1896,7 +1883,7 @@ u8 func100f_check_end_level[] = { label(0x31) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Mission complete label(0x08) @@ -1905,7 +1892,7 @@ u8 func100f_check_end_level[] = { // President dead label(0x32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1936,7 +1923,7 @@ u8 func1010_set_cave_lights[] = { set_lights_state(ROOM_AZT_0053, LIGHTOP_1, 0x06, 0x00, 0x00) set_lights_state(ROOM_AZT_0058, LIGHTOP_1, 0x06, 0x00, 0x00) set_lights_state(ROOM_AZT_0056, LIGHTOP_1, 0x06, 0x00, 0x00) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1945,14 +1932,14 @@ u8 func1012_give_medicalscanner[] = { if_difficulty_gt(DIFF_A, /*goto*/ 0x31) give_object_to_chr(OBJ_MEDICALSCANNER, CHR_BOND) label(0x31) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1013_setup_rtracker[] = { yield set_object_flag3(OBJ_PROXYMINE, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1961,7 +1948,7 @@ u8 func1016_hide_hoverbike[] = { if_savefile_flag_is_set(GAMEFILEFLAG_CRASHSITE_BIKE, /*goto*/ 0x08) disable_object(OBJ_HOVERBIKE) label(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1971,7 +1958,7 @@ u8 func1014_setup_skedar_shuttle[] = { set_object_flag3(OBJ_SKEDAR_SHUTTLE, OBJFLAG3_00000010) object_set_modelpart_visible(OBJ_SKEDAR_SHUTTLE, MODELPART_SKSHUTTLE_GANGWAY, FALSE) object_do_animation(ANIM_0486, OBJ_SKEDAR_SHUTTLE, 0x01, 0xffff) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2079,7 +2066,7 @@ u8 func1415_setup_environment[] = { configure_environment(ROOM_AZT_0045, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(ROOM_AZT_0065, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(ROOM_AZT_0065, AIENVCMD_ROOM_SETOUTDOORS, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2088,7 +2075,6 @@ struct ailist ailists[] = { { func1001_objectives_failed_msg, 0x1001 }, { func1002_intro, 0x1002 }, { func1003_msg_therestheescapepod, 0x1003 }, - { func1004_msg_maybetheresabeacon, 0x1004 }, { func1005_msg_thejamming, 0x1005 }, { func1006_msg_elvisbeable, 0x1006 }, { func1008_escapepod, 0x1008 }, diff --git a/src/ailists/setupcave.c b/src/ailists/setupcave.c index 1fcddaad7..136a2ac3e 100644 --- a/src/ailists/setupcave.c +++ b/src/ailists/setupcave.c @@ -919,13 +919,13 @@ u8 func0425_outro[] = { disable_object(OBJ_PLANE) #endif end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func0402_init_stripes[] = { set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1106,7 +1106,7 @@ u8 func1004_guard_activation[] = { enable_bottom_guard(0x1a) enable_bottom_guard(0x1c) enable_bottom_guard(0x1f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1147,7 +1147,7 @@ u8 func0407_stewardess[] = { goto_next(0x31) label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x31) if_just_injured(CHR_SELF, /*goto*/ 0x02) @@ -1178,7 +1178,7 @@ u8 func0407_stewardess[] = { goto_next(0x16) label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate restart_timer @@ -1374,10 +1374,10 @@ u8 func1005_check_civilians_killed[] = { label(0x31) show_hudmsg(CHR_BOND, L_CAVE_026) // "Innocent civilians have been killed." set_stage_flag(STAGEFLAG_CIVILIANS_KILLED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1497,7 +1497,7 @@ u8 func0408_secretary[] = { goto_next(0x00) label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate #define LABEL_MAIN_LOOP 0x00 #define LABEL_BECOME_ALERT1 0x66 #define LABEL_BECOME_ALERT2 0x68 @@ -1564,7 +1564,7 @@ u8 func0408_secretary[] = { goto_first(0x4f) // Unreachable - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Seen Jo while disguised label(0x07) @@ -1675,7 +1675,7 @@ u8 func0408_secretary[] = { goto_first(0x4f) // Unreachable - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // // TALK 2 @@ -1692,7 +1692,7 @@ u8 func0408_secretary[] = { endloop(0x0e) label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_BECOME_ALERT2) goto_first(LABEL_BECOME_ALERT1) @@ -1712,7 +1712,7 @@ u8 unregistered_function2[] = { set_stage_flag(STAGEFLAG_DISGUISED) label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1773,7 +1773,7 @@ u8 func1007_console_activation[] = { label(0x0c) mute_channel(CHANNEL_1) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1909,11 +1909,11 @@ u8 func1007_console_activation[] = { mute_channel(CHANNEL_6) \ yield \ activate_alarm \ - set_ailist(CHR_SELF, GAILIST_IDLE) \ + terminate \ \ /* Agent, or suitcase deposited */ \ label(0x08) \ - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate u8 func1020_weapon_scanning_bond[] = { yield @@ -1928,7 +1928,7 @@ u8 func1021_weapon_scanning_coop[] = { goto_next(0x02) label(0x31) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x02) weapon_detection_logic(CHR_COOP) @@ -1950,7 +1950,7 @@ u8 func1009_carousel_activation[] = { yield show_hudmsg(CHR_BOND, L_CAVE_067) // "Equipment cannot be checked in." label(0x09) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Carrier activated label(0x02) @@ -1983,7 +1983,7 @@ u8 func1009_carousel_activation[] = { label(0x02) set_object_flag(OBJ_BAGGAGE_CARRIER, OBJFLAG_DEACTIVATED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2029,7 +2029,7 @@ u8 func100b_suitcase_scanning[] = { label(0x07) stop_countdown_timer hide_countdown_timer - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2049,7 +2049,7 @@ u8 func0409_office1[] = { goto_next(0x42) label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x42) chr_do_animation(ANIM_SITTING_DORMANT, 0, -1, CHRANIMFLAG_PAUSEATEND | CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2) @@ -2166,7 +2166,7 @@ u8 func0409_office1[] = { increase_squadron_alertness(100) set_stage_flag(STAGEFLAG_DISGUISE_UNCOVERED) activate_alarm - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2184,7 +2184,7 @@ u8 func040a_office2[] = { goto_next(0x42) label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x42) chr_do_animation(ANIM_SITTING_DORMANT, 0, -1, CHRANIMFLAG_PAUSEATEND | CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2) @@ -2252,7 +2252,7 @@ u8 func040a_office2[] = { set_ailist(CHR_SELF, GAILIST_ALERTED) // Unreachable - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2295,7 +2295,7 @@ u8 func100c_check_end_level[] = { // Both players dead label(0x31) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Mission complete label(0x02) @@ -2316,7 +2316,7 @@ u8 func100c_check_end_level[] = { // Both players dead label(0x31) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Mission complete label(0x02) @@ -2344,7 +2344,7 @@ u8 func100d_laser_panel[] = { label(0x05) set_stage_flag(STAGEFLAG_LASERS_OVERLOADED) show_hudmsg(CHR_P1P2, L_CAVE_046) // "Laser grid system has been overloaded." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2375,7 +2375,7 @@ u8 func100e_check_alaskans_killed[] = { show_hudmsg(CHR_BOND, L_CAVE_047) // "Too many neutral casualties inflicted." set_stage_flag(STAGEFLAG_TOO_MANY_NEUTRALS_KILLED) label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2402,7 +2402,7 @@ u8 func040f_nsa[] = { goto_next(0x44) label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x44) if_chr_distance_to_pad_lt(CHR_SELF, 70, PAD_PRESET, /*goto*/ 0x02) @@ -2582,7 +2582,7 @@ u8 func0411_takeover_lackey[] = { goto_next(0x00) label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x00) chr_toggle_p1p2(CHR_SELF) @@ -2645,7 +2645,7 @@ u8 func0414_officeworker[] = { goto_next(0x00) label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x44) chr_do_animation(ANIM_SITTING_DORMANT, -1, 60, CHRANIMFLAG_PAUSEATEND | CHRANIMFLAG_SLOWUPDATE, 0, CHR_SELF, 2) @@ -2732,7 +2732,7 @@ u8 func0414_officeworker[] = { endloop(0x06) label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x6d) damage_chr(CHR_SELF, WEAPON_SUPERDRAGON) @@ -2740,7 +2740,7 @@ u8 func0414_officeworker[] = { endloop(0x6d) label(0x31) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2752,7 +2752,7 @@ u8 func0415_alaskan_mountainlift_guard[] = { u8 func1010_setup_baggage_carrier[] = { set_object_flag(OBJ_BAGGAGE_CARRIER, OBJFLAG_DEACTIVATED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2781,7 +2781,7 @@ u8 func1010_setup_baggage_carrier[] = { label(0x02) \ goto_first(0x04) \ \ - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate u8 func1011_lasers1[] = { laser_overloaded_logic(0x07, 0x0c, 120) @@ -2821,7 +2821,7 @@ u8 func1014_lasers4[] = { label(0x02) goto_first(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2836,7 +2836,7 @@ u8 func1017_laser5[] = { label(0x04) restart_timer disable_object(0x13) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Unreachable open_door(0x13) @@ -2848,7 +2848,7 @@ u8 func1017_laser5[] = { label(0x31) goto_first(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2861,7 +2861,7 @@ u8 func0403_unused[] = { set_recovery_speed(30) set_shield(0) set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2876,7 +2876,7 @@ u8 func1015_unhide_laser_guards[] = { set_chr_chrflag(0x3f, CHRCFLAG_HIDDEN) set_chr_chrflag(0x40, CHRCFLAG_HIDDEN) set_chr_chrflag(0x41, CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Unreachable beginloop(0x00) @@ -2896,7 +2896,7 @@ u8 func1015_unhide_laser_guards[] = { set_ailist(0x40, GAILIST_ALERTED) enable_chr(0x41) set_ailist(0x41, GAILIST_ALERTED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2913,7 +2913,7 @@ u8 func0404_laser_guard[] = { yield label(0x02) set_ailist(CHR_SELF, GAILIST_UNALERTED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3005,7 +3005,7 @@ u8 func1016_console_noises[] = { label(0x09) mute_channel(CHANNEL_1) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3192,7 +3192,7 @@ u8 func042c_foyer_clone[] = { label(0x02) \ goto_first(0x44) \ \ - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate u8 func042d_hoverbot1[] = { hoverbot_do_paths(0, 1, 2) @@ -3236,7 +3236,7 @@ u8 func0419_ba8c[] = { goto_next(0x31) label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x31) if_chr_idle(/*goto*/ 0x6b) @@ -3438,7 +3438,7 @@ u8 func141b_setup_lifts[] = { activate_lift(1, 0x20) activate_lift(2, 0x21) activate_lift(9, 0x36) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3504,7 +3504,7 @@ u8 func1018_safe_switch[] = { open_door(OBJ_SAFEDOOR) endloop(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3526,7 +3526,7 @@ u8 func1018_safe_switch_cover[] = { label(0x31) set_object_flag(OBJ_SAFE_SWITCH_COVER, OBJFLAG_CANNOT_ACTIVATE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3538,7 +3538,7 @@ u8 func101a_check_disguise_used[] = { label(0x31) show_hudmsg(CHR_P1P2, L_CAVE_049) // "Disguise worn." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3808,7 +3808,7 @@ u8 func1003_intro[] = { stop_cutscene_track stop_ambient_track enter_firstperson - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3819,7 +3819,7 @@ u8 func101c_msg_nowsyourchance[] = { label(0x31) speak(CHR_BOND, L_CAVE_050, SFX_8182, CHANNEL_6, COLOR_09_BLUE) // "Now's your chance! Grab the stewardess's bag and g..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3848,7 +3848,7 @@ u8 func101d_msg_usethatcase[] = { speak(CHR_P1P2, L_CAVE_051, SFX_8183, CHANNEL_4, COLOR_09_BLUE) // "Use that case to conceal your equipment." label(0x09) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3866,7 +3866,7 @@ u8 func101e_msg_casewillgetstopped[] = { label(0x31) speak(CHR_BOND, L_CAVE_052, SFX_8184, CHANNEL_6, COLOR_09_BLUE) // "The case will get stopped unless you do something." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3879,7 +3879,7 @@ u8 func101f_msg_smallerthanithought[] = { label(0x31) speak(CHR_P1P2, L_CAVE_053, MP3_03C7, CHANNEL_6, COLOR_09_BLUE) // "So that's Air Force One? ... Huh, smaller than I t..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3890,7 +3890,7 @@ u8 func1022_check_office1_dead[] = { label(0x31) set_stage_flag(STAGEFLAG_OFFICE1_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3901,7 +3901,7 @@ u8 func1023_check_office2_dead[] = { label(0x31) set_stage_flag(STAGEFLAG_OFFICE2_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3924,7 +3924,7 @@ u8 func1024_double_dy357[] = { unset_object_flag2(0x30, OBJFLAG2_INVISIBLE) unset_object_flag(0x31, OBJFLAG_UNCOLLECTABLE) unset_object_flag2(0x31, OBJFLAG2_INVISIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3960,7 +3960,7 @@ u8 func101a_check_disguise_used2[] = { set_stage_flag(STAGEFLAG_DISGUISED) set_stage_flag(STAGEFLAG_DISGUISED2) label(0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x00) endlist @@ -3970,7 +3970,7 @@ u8 func1026_check_alarm_destroyed[] = { beginloop(0x00) if_object_in_good_condition(OBJ_ALARM, /*goto*/ 0x31) activate_alarm - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x31) endloop(0x00) @@ -3996,7 +3996,7 @@ u8 func0417_remove_or_unalert[] = { chr_drop_weapon(CHR_SELF) remove_chr(CHR_SELF) label(0x31) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x02) set_ailist(CHR_SELF, GAILIST_UNALERTED) @@ -4020,7 +4020,7 @@ u8 func0418_remove_or_cower[] = { yield remove_chr(CHR_SELF) label(0x31) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x02) label(0x62) chr_do_animation(ANIM_COWER_0229, -1, -1, CHRANIMFLAG_PAUSEATEND | CHRANIMFLAG_SLOWUPDATE, 10, CHR_SELF, 2) @@ -4037,7 +4037,7 @@ u8 func0418_remove_or_cower[] = { u8 func102a_setup_snow[] = { enable_snow(TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4055,7 +4055,7 @@ u8 func1027_remotemine[] = { destroy_object(0x46) yield destroy_object(0x47) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x31) endloop(0x00) @@ -4083,7 +4083,7 @@ u8 func141b_setup_lifts_and_doors[] = { label(0x02) unset_object_flag(OBJ_DIAGONAL_LIFT, OBJFLAG_DEACTIVATED) unset_object_flag(OBJ_VERTICAL_LIFT, OBJFLAG_DEACTIVATED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4141,13 +4141,13 @@ u8 func102b_check_secretary_dead[] = { label(0x31) if_door_locked(0x18, 0x02, /*goto*/ 0x31) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x31) show_hudmsg(CHR_BOND, L_CAVE_062) // "Critical mission personnel disabled." set_stage_flag(STAGEFLAG_SECRETARY_DEAD) label(0x09) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4159,7 +4159,7 @@ u8 func102c_lock_door_on_alarm[] = { label(0x31) lock_door(0x18, 0x04) close_door(0x18) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4177,7 +4177,7 @@ u8 func102d_check_console_destroyed[] = { set_stage_flag(STAGEFLAG_CONSOLE_DESTROYED) show_hudmsg(CHR_BOND, L_CAVE_063) // "Critical mission object destroyed." label(0x31) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4190,7 +4190,7 @@ u8 func102e_check_base_entered[] = { label(0x31) show_hudmsg(CHR_BOND, L_CAVE_064) // "Entrance to base secured." set_stage_flag(STAGEFLAG_ENTERED_BASE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4204,7 +4204,7 @@ u8 func102f_undisguise_on_alarm[] = { if_chr_death_animation_finished(CHR_COOP, /*goto*/ 0x31) set_chr_hiddenflag(CHR_COOP, CHRHFLAG_DISGUISE_UNCOVERED) label(0x31) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4212,7 +4212,7 @@ u8 func1030_setup_rtracker[] = { yield set_object_flag3(0x30, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(0x31, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4250,7 +4250,7 @@ u8 func1031_setup_environment[] = { configure_environment(0x008f, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x0090, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x0091, AIENVCMD_ROOM_SETOUTDOORS, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4289,14 +4289,14 @@ u8 func1032_unhide_guards_near_plane[] = { set_ailist(0x20, AILIST_INIT_POSTTAKEOVER_GUARD) unset_chr_hiddenflag(0x20, CHRHFLAG_ANTINONINTERACTABLE) unset_chr_chrflag(0x20, CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1420_setup_portals[] = { yield set_room_flag(0x0080, ROOMFLAG_0800) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setupdam.c b/src/ailists/setupdam.c index b6f70d56e..822350420 100644 --- a/src/ailists/setupdam.c +++ b/src/ailists/setupdam.c @@ -831,7 +831,7 @@ u8 func1002_intro[] = { label(0x04) stop_cutscene_track stop_ambient_track - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1009,14 +1009,14 @@ u8 func0c01_outro[] = { set_chr_hiddenflag(CHR_ELVIS, CHRHFLAG_00020000) chr_do_animation(ANIM_CUT_DAM_INTRO_ELVIS, -2, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_ELVIS, 2) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 unregistered_function1[] = { label(0x00) yield - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1029,7 +1029,7 @@ u8 func1004_msg_controlledfrom[] = { label(0x07) speak(CHR_P1P2, L_DAM_011, MP3_03D1, CHANNEL_6, COLOR_09_BLUE) // "This must be where the sub's controlled from." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1041,7 +1041,7 @@ u8 func1005_msg_withoutautopilot[] = { label(0x07) speak(CHR_P1P2, L_DAM_012, MP3_03D2, CHANNEL_6, COLOR_09_BLUE) // "Without the autopilot and the GPS, the ship will w..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1053,7 +1053,7 @@ u8 func1006_msg_conductoperations[] = { label(0x07) speak(CHR_P1P2, L_DAM_013, MP3_03D3, CHANNEL_6, COLOR_09_BLUE) // "They'll be unable to conduct any operations withou..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1073,7 +1073,7 @@ u8 unregistered_function2[] = { label(0x04) show_hudmsg(CHR_BOND, L_DAM_016) // "Critical mission object has been destroyed." set_stage_flag(STAGEFLAG_00000400) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1101,7 +1101,7 @@ u8 func1009_open_reactor_hatch[] = { set_object_flag2(OBJ_REACTOR_HATCH, OBJFLAG2_INVISIBLE) show_hudmsg(CHR_P1P2, L_DAM_017) // "Reactor shutdown control hatch opened." set_stage_flag(STAGEFLAG_REACTOR_HATCH_OPEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1111,7 +1111,7 @@ u8 func100a_reactor_switch[] = { if_object_in_good_condition(OBJ_REACTOR_SWITCH, /*goto*/ 0x07) show_hudmsg(CHR_BOND, L_DAM_036) // "Critical mission object has been destroyed." set_stage_flag(STAGEFLAG_REACTOR_SWITCH_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x07) if_chr_activated_object(CHR_P1P2, OBJ_REACTOR_SWITCH, /*goto*/ 0x07) @@ -1132,7 +1132,7 @@ u8 func100a_reactor_switch[] = { set_object_image(OBJ_REACTOR_SWITCH, 2, TVCMDLIST_12) show_hudmsg(CHR_P1P2, L_DAM_018) // "Reactor has been shut down." set_stage_flag(STAGEFLAG_REACTOR_SHUT_DOWN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1154,7 +1154,7 @@ u8 func100b_check_diving_area_located[] = { label(0x07) show_hudmsg(CHR_P1P2, L_DAM_019) // "Diving control center has been located." set_stage_flag(STAGEFLAG_LOCATED_DIVING_AREA) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1233,7 +1233,7 @@ u8 func100c_check_end_level[] = { // Both players dead label(0x07) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Mission complete label(0x04) @@ -1242,7 +1242,7 @@ u8 func100c_check_end_level[] = { // Elvis dead label(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1262,7 +1262,7 @@ u8 func100e_check_labtech_dead[] = { show_hudmsg(CHR_BOND, L_DAM_020) // "Critical mission personnel killed." set_stage_flag(STAGEFLAG_LABTECH_DEAD) label(0x0b) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1285,7 +1285,7 @@ u8 func100f_check_researchdata_collected[] = { label(0x07) show_hudmsg(CHR_BOND, L_DAM_021) // "Research data has been secured." set_stage_flag(STAGEFLAG_COLLECTED_RESEARCH_DATA) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1343,7 +1343,7 @@ u8 func040b_labtech1[] = { // Dying label(0x07) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x04) @@ -1416,7 +1416,7 @@ u8 func040c_labtech2[] = { // Dying label(0x07) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x04) @@ -1493,7 +1493,7 @@ u8 func040d_labtech3[] = { // Dying label(0x07) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x04) @@ -1641,14 +1641,14 @@ u8 func0411_labtech_alerted[] = { label(0x07) goto_first(0x13) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func0412_hide[] = { set_self_chrflag(CHRCFLAG_HIDDEN) set_self_chrflag(CHRCFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1843,7 +1843,7 @@ u8 func1010_alarm_responders[] = { unset_chr_chrflag(0x1e, CHRCFLAG_HIDDEN) unset_chr_chrflag(0x20, CHRCFLAG_HIDDEN) unset_chr_chrflag(0x22, CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1856,7 +1856,7 @@ u8 func0402_init_pilot[] = { u8 func0401_pilot_dying[] = { unset_stage_flag(STAGEFLAG_SAID_PULLTHEPLUG) unset_stage_flag(STAGEFLAG_SAID_SWITCHTHINGOFF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2011,7 +2011,7 @@ u8 func0401_pilot[] = { surrender goto_first(0x0b) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2036,12 +2036,12 @@ u8 func1011_check_pilots_dead[] = { label(0x08) if_stage_flag_eq(STAGEFLAG_AUTOPILOT_DISABLED, FALSE, /*goto*/ 0x07) if_stage_flag_eq(STAGEFLAG_GPS_DISABLED, FALSE, /*goto*/ 0x07) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x07) show_hudmsg(CHR_BOND, L_DAM_027) // "Critical mission personnel have been killed." set_stage_flag(STAGEFLAG_PILOT_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2070,19 +2070,19 @@ u8 func1012_choose_angry_pilot[] = { if_chr_deadish(CHR_PILOT1, /*goto*/ 0x3b) if_chr_has_flag_bankx(CHR_PILOT1, CHRFLAG0_COVER_TYPE2, BANK_0, /*goto*/ 0x3b) set_ailist(CHR_PILOT1, AILIST_ANGRY_PILOT) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x3b) if_chr_deadish(CHR_PILOT2, /*goto*/ 0x3c) if_chr_has_flag_bankx(CHR_PILOT2, CHRFLAG0_COVER_TYPE2, BANK_0, /*goto*/ 0x3c) set_ailist(CHR_PILOT2, AILIST_ANGRY_PILOT) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x3c) if_chr_deadish(CHR_PILOT3, /*goto*/ 0x04) if_chr_has_flag_bankx(CHR_PILOT3, CHRFLAG0_COVER_TYPE2, BANK_0, /*goto*/ 0x04) set_ailist(CHR_PILOT3, AILIST_ANGRY_PILOT) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x04) endloop(0x03) @@ -2091,7 +2091,7 @@ u8 func1012_choose_angry_pilot[] = { label(0x08) show_hudmsg(CHR_BOND, L_DAM_035) // "Civilians have been killed." set_stage_flag(STAGEFLAG_JO_KILLED_A_PILOT) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2111,7 +2111,7 @@ u8 func0404_angry_pilot[] = { // Dying label(0x07) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x04) @@ -2209,7 +2209,7 @@ u8 func1013_lift_switch[] = { open_door(0x18) open_door(0x19) set_stage_flag(STAGEFLAG_LIFT_UNLOCKED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2222,7 +2222,7 @@ u8 func1014_moonpool_switch[] = { set_stage_flag(STAGEFLAG_MOONPOOL_SWITCH_DESTROYED) label(0x10) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x08) if_chr_activated_object(CHR_P1P2, OBJ_MOONPOOL_SWITCH, /*goto*/ 0x07) @@ -2232,7 +2232,7 @@ u8 func1014_moonpool_switch[] = { label(0x07) show_hudmsg(CHR_P1P2, L_DAM_029) // "Lift has been activated." set_stage_flag(STAGEFLAG_MOONPOOL_ACTIVATED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2270,7 +2270,7 @@ u8 func1015_shuffle_hatchswitches[] = { yield set_object_image(OBJ_HATCHSWITCH4, 0, TVCMDLIST_13) yield - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2402,7 +2402,7 @@ u8 func101b_reactor_hum[] = { yield assign_sound(SFX_8146, CHANNEL_1) play_sound_from_object(CHANNEL_1, OBJ_REACTOR_SWITCH, 1, 2000, 3000) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2416,7 +2416,7 @@ u8 func0415_elvis_at_start[] = { if_sound_finished(CHANNEL_6, /*goto*/ 0x08) mute_channel(CHANNEL_6) label(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x04) @@ -2541,7 +2541,7 @@ u8 func0415_elvis_at_start[] = { set_chr_chrflag(CHR_SELF, CHRCFLAG_INVINCIBLE) add_health_or_armor(2000) set_chr_maxdamage(CHR_SELF, 1) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2557,7 +2557,7 @@ u8 func0416_elvis_leading[] = { // Dying label(0x07) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x04) @@ -2630,7 +2630,7 @@ u8 func101c_check_elvis_dead[] = { label(0x07) show_hudmsg(CHR_BOND, L_DAM_033) // "Elvis has been killed." set_stage_flag(STAGEFLAG_ELVIS_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2843,7 +2843,7 @@ u8 func101f_unlock_doors[] = { // A + SA + PA label(0x0b) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2851,7 +2851,7 @@ u8 func1020_setup_rtracker[] = { yield set_object_flag3(0x27, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(0x28, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2887,7 +2887,7 @@ u8 func1421_setup_environment[] = { configure_environment(0x0072, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x0073, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x0077, AIENVCMD_ROOM_SETAMBIENT, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setupdepo.c b/src/ailists/setupdepo.c index e88e6e541..553c2f1d7 100644 --- a/src/ailists/setupdepo.c +++ b/src/ailists/setupdepo.c @@ -580,7 +580,7 @@ u8 func1008_check_generator[] = { show_hudmsg(CHR_BOND, L_DEPO_024) // "Mission critical object destroyed." set_stage_flag(STAGEFLAG_GENERATOR_DESTROYED) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) reloop(0x04) @@ -616,7 +616,7 @@ u8 func1003_laser_switch_1[] = { if_stage_flag_eq(STAGEFLAG_LASERSET1_DISABLED, TRUE, /*goto*/ 0x2c) show_hudmsg(CHR_BOND, L_DEPO_024) // "Mission critical object destroyed." set_stage_flag(STAGEFLAG_LASERSWITCH1_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) reloop(0x04) @@ -682,7 +682,7 @@ u8 func1004_laser_switch_2[] = { if_stage_flag_eq(STAGEFLAG_LASERSET2_DISABLED, TRUE, /*goto*/ 0x2c) show_hudmsg(CHR_BOND, L_DEPO_024) // "Mission critical object destroyed." set_stage_flag(STAGEFLAG_LASERSWITCH2_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) reloop(0x04) @@ -748,7 +748,7 @@ u8 func1005_laser_switch_3[] = { if_stage_flag_eq(STAGEFLAG_LASERSET3_DISABLED, TRUE, /*goto*/ 0x2c) show_hudmsg(CHR_BOND, L_DEPO_024) // "Mission critical object destroyed." set_stage_flag(STAGEFLAG_LASERSWITCH3_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) reloop(0x04) @@ -814,7 +814,7 @@ u8 func1006_laser_switch_4[] = { if_stage_flag_eq(STAGEFLAG_LASERSET4_DISABLED, TRUE, /*goto*/ 0x2c) show_hudmsg(CHR_BOND, L_DEPO_024) // "Mission critical object destroyed." set_stage_flag(STAGEFLAG_LASERSWITCH4_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) reloop(0x04) @@ -979,7 +979,7 @@ u8 func1007_init_lasers[] = { mute_channel(CHANNEL_1) mute_channel(CHANNEL_2) mute_channel(CHANNEL_3) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1225,7 +1225,7 @@ u8 func100a_give_keycards[] = { label(0x2c) unset_object_flag(OBJ_KEYCARD2, OBJFLAG_UNCOLLECTABLE) unset_object_flag2(OBJ_KEYCARD2, OBJFLAG2_INVISIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1237,7 +1237,7 @@ u8 func100b_check_backup_collected[] = { label(0x2c) set_stage_flag(STAGEFLAG_BACKUP_COLLECTED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1301,7 +1301,7 @@ u8 func100e_check_conspirators_alerted[] = { unset_stage_flag(STAGEFLAG_ALARM_SOUNDING) endloop(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1336,7 +1336,7 @@ u8 func1010_safe_cracking[] = { if_object_in_good_condition(OBJ_SAFEKEYPAD, /*goto*/ 0x2c) show_hudmsg(CHR_BOND, L_DEPO_064) // "Mission critical object destroyed." set_stage_flag(STAGEFLAG_SAFEKEYPAD_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) if_chr_activated_object(CHR_P1P2, OBJ_SAFEKEYPAD, /*goto*/ 0x2c) reloop(0x04) @@ -1382,7 +1382,7 @@ u8 func1010_safe_cracking[] = { show_hudmsg(CHR_BOND, L_DEPO_064) // "Mission critical object destroyed." set_stage_flag(STAGEFLAG_SAFEKEYPAD_DESTROYED) hide_countdown_timer - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) if_countdown_timer_lt(1, /*goto*/ 0x06) endloop(0x08) @@ -1397,7 +1397,7 @@ u8 func1010_safe_cracking[] = { unset_object_flag2(OBJ_SAFEDOOR, OBJFLAG2_AICANNOTUSE) open_door(OBJ_SAFEDOOR) hide_countdown_timer - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1434,7 +1434,7 @@ u8 func1012_check_for_end[] = { label(0x2c) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Objectives complete label(0x53) @@ -1447,7 +1447,7 @@ u8 func1012_check_for_end[] = { label(0x2c) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Mission complete label(0x06) @@ -1463,7 +1463,7 @@ u8 func1013_check_escape_doors[] = { if_object_in_good_condition(OBJ_ESCAPEDOOR2, /*goto*/ 0x06) label(0x2c) activate_alarm - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate reloop(0x04) label(0x06) @@ -1483,7 +1483,7 @@ u8 func1014_check_camspy_location[] = { set_stage_flag(STAGEFLAG_MEETING_HOLOGRAPHED) label(0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1507,7 +1507,7 @@ u8 func0403_walk_from_meeting[] = { label(0x06) remove_chr(CHR_SELF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1520,7 +1520,7 @@ u8 func0404_run_from_meeting[] = { label(0x06) remove_chr(CHR_SELF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1554,7 +1554,7 @@ u8 func1017_check_lasers_closed[] = { endloop(0x04) label(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1795,7 +1795,7 @@ u8 func040d_intro[] = { set_ailist(CHR_CLOAK_1B, AILIST_INIT_CLOAK1_GUARD) yield kill(CHR_INTRO_VICTIM) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2066,7 +2066,7 @@ u8 func040e_meeting_cutscene[] = { label(0x2c) set_ailist(CHR_BLONDE, AILIST_WALK_FROM_MEETING) set_ailist(CHR_STRIPES, AILIST_WALK_FROM_MEETING) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2202,7 +2202,7 @@ u8 func040f_outro[] = { label(0x06) set_chr_hudpiece_visible(CHR_P1P2, FALSE) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2216,7 +2216,7 @@ u8 func1019_generator_hum[] = { yield assign_sound(SFX_8146, CHANNEL_4) play_sound_from_object(CHANNEL_4, OBJ_GENERATOR, 1, 1600, 2200) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2246,7 +2246,7 @@ u8 func101a_init_laser_switch_guards[] = { set_chr_flag_bankx(0x0d, CHRFLAG0_ACTIVATEALARM, BANK_0) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2319,11 +2319,11 @@ u8 func0412_cloak_guard[] = { label(0x10) if_chr_has_hiddenflag(CHR_SELF, CHRHFLAG_CLOAKED, /*goto*/ 0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) set_chr_cloaked(CHR_SELF, FALSE, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2517,13 +2517,13 @@ u8 func101b_cloak2_entry[] = { set_ailist(CHR_CLOAK_2B, AILIST_CLOAK2_GUARD) set_ailist(CHR_CLOAK_2C, AILIST_CLOAK2_GUARD) set_ailist(CHR_CLOAK_2D, AILIST_CLOAK2_GUARD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func0405_cloak2_hide[] = { set_self_chrflag(CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2541,7 +2541,7 @@ u8 func101c_check_visited_top_door[] = { label(0x06) set_stage_flag(STAGEFLAG_VISITED_TOP_DOOR) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2559,11 +2559,11 @@ u8 func101d_init_mines[] = { if_savefile_flag_is_unset(GAMEFILEFLAG_G5_MINE, /*goto*/ 0x06) disable_object(OBJ_MINE1) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) disable_object(OBJ_MINE2) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2609,7 +2609,7 @@ u8 func101e_msg_nowaythrough[] = { label(0x2c) speak(CHR_P1P2, L_DEPO_060, MP3_03B4, CHANNEL_6, COLOR_09_BLUE) // "There's no way through while those lasers are acti..." label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2632,7 +2632,7 @@ u8 func101f_msg_meetingroomahead[] = { speak(CHR_P1P2, L_DEPO_061, MP3_03B5, CHANNEL_6, COLOR_09_BLUE) // "That must be the meeting room up ahead. Time to us..." label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2644,7 +2644,7 @@ u8 func1020_msg_heavilyencrypted[] = { label(0x2c) speak(CHR_P1P2, L_DEPO_062, SFX_817C, CHANNEL_6, COLOR_09_BLUE) // "The safe's heavily encrypted. The decoder's gonna ..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2666,7 +2666,7 @@ u8 func1021_blow_mines[] = { label(0x2c) if_difficulty_lt(DIFF_SA, /*goto*/ 0x2c) speak(CHR_P1P2, L_DEPO_063, MP3_03B7, CHANNEL_6, COLOR_09_BLUE) // "Time to leave! Let's get to the door I set up earl..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Agent label(0x2c) @@ -2696,7 +2696,7 @@ u8 func1021_blow_mines[] = { label(0x2c) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2837,11 +2837,11 @@ u8 func1022_light_switch[] = { u8 func1023_hide_nbomb_crate[] = { if_savefile_flag_is_unset(GAMEFILEFLAG_G5_MINE, /*goto*/ 0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) disable_object(OBJ_NBOMB_CRATE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2937,7 +2937,7 @@ u8 func1026_unlock_doors[] = { unlock_door(0x40, 0x10) label(0x0a) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2946,7 +2946,7 @@ u8 func0410_invincible[] = { yield set_self_chrflag(CHRCFLAG_INVINCIBLE) set_self_chrflag(CHRCFLAG_UNEXPLODABLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2956,7 +2956,7 @@ u8 func0411_hide[] = { set_self_chrflag(CHRCFLAG_HIDDEN) set_self_chrflag(CHRCFLAG_INVINCIBLE) set_self_chrflag(CHRCFLAG_UNEXPLODABLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2969,7 +2969,7 @@ u8 func1027_cloak1_check_one_remaining[] = { label(0x2c) set_stage_flag(STAGEFLAG_CLOAK1_ONE_REMAINING) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3003,7 +3003,7 @@ u8 func1028_cloak2_check_one_remaining[] = { label(0x06) if_morale_lt(3, /*goto*/ 0x2c) set_stage_flag(STAGEFLAG_CLOAK2_ONE_REMAINING) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) endloop(0x04) @@ -3014,7 +3014,7 @@ u8 func1029_set_secret_weapon_props[] = { yield set_object_flag3(OBJ_NBOMB_CRATE, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(OBJ_CROSSBOW, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3032,7 +3032,7 @@ u8 func102a_8174[] = { set_chr_hiddenflag(0x0f, CHRHFLAG_DONTSHOOTME) set_chr_hiddenflag(0x10, CHRHFLAG_DONTSHOOTME) set_chr_hiddenflag(0x11, CHRHFLAG_DONTSHOOTME) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3062,7 +3062,7 @@ u8 func102b_81bc[] = { set_chr_team(0x17, TEAM_ENEMY) rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3070,7 +3070,7 @@ u8 func102c_set_lightswitch_guard_team[] = { set_chr_team(CHR_LIGHTSWITCH_GUARD, TEAM_ENEMY) rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setupdish.c b/src/ailists/setupdish.c index 77a598499..5db211e70 100644 --- a/src/ailists/setupdish.c +++ b/src/ailists/setupdish.c @@ -824,7 +824,7 @@ u8 func0428_colleague10[] = { u8 func1001_set_jo_team[] = { yield set_chr_team(CHR_BOND, TEAM_32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -929,7 +929,7 @@ u8 func1002_devicetraining_camspy[] = { disable_object(OBJ_CAMSPY) goto_first(0x0f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1072,7 +1072,7 @@ u8 func1003_devicetraining_nightvision[] = { label(0x2f) goto_first(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1237,7 +1237,7 @@ u8 func1004_devicetraining_doordecoder[] = { disable_object(0x28) goto_first(0x0f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1445,7 +1445,7 @@ u8 func1005_devicetraining_xray[] = { disable_object(0x29) goto_first(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1588,7 +1588,7 @@ u8 func1006_devicetraining_disguise[] = { set_ailist(0x03, AILIST_INIT_COLLEAGUE_WHEN_SIGHTED) goto_first(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1727,7 +1727,7 @@ u8 func1007_devicetrainign_ir[] = { disable_object(0x2b) goto_first(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1852,7 +1852,7 @@ u8 func1008_devicetraining_rtracker[] = { disable_object(0x36) goto_first(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2006,7 +2006,7 @@ u8 func1009_devicetraining_cloak[] = { set_ailist(CHR_CARRINGTON, AILIST_INIT_COLLEAGUE_WHEN_SIGHTED) goto_first(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2150,7 +2150,7 @@ u8 func100a_devicetraining_ecmmine[] = { disable_object(0x2e) goto_first(0x0f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2360,7 +2360,7 @@ u8 func100b_devicetraining_uplink[] = { disable_object(0x2f) goto_first(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2450,7 +2450,7 @@ u8 func0401_move_to_deviceroom[] = { label(0x06) stop_chr yield - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2459,7 +2459,7 @@ u8 func0402_move_to_holoroom[] = { label(0x06) stop_chr yield - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2560,7 +2560,7 @@ u8 func0429_grimshaw_disguise[] = { give_object_to_chr(0x3c, CHR_BOND) set_stage_flag(STAGEFLAG_DISGUISE_COMPLETE) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2716,7 +2716,7 @@ u8 func042a_carrington_cloak[] = { label(0x06) stop_chr set_stage_flag(STAGEFLAG_CLOAK_COMPLETE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2779,7 +2779,7 @@ u8 func100e_training_unlockables[] = { label(0x2f) disable_object(0x3a) disable_object(0x3b) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2912,11 +2912,11 @@ u8 func1019_setup_carrington[] = { endloop(0x04) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2f) set_ailist(CHR_CARRINGTON, AILIST_INIT_CARRINGTON) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3203,7 +3203,7 @@ u8 func042c_carrington_tour[] = { label(0x06) set_ailist(CHR_SELF, 0x041e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3251,7 +3251,7 @@ u8 func1013_msg_hovercrate[] = { endloop(0x04) #else if_savefile_flag_is_unset(GAMEFILEFLAG_CI_TOUR_STARTED, /*goto*/ 0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x04) if_savefile_flag_is_set(GAMEFILEFLAG_CI_TOUR_STARTED, /*goto*/ 0x06) @@ -3260,7 +3260,7 @@ u8 func1013_msg_hovercrate[] = { #endif label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2f) #if VERSION >= VERSION_PAL_BETA @@ -3277,7 +3277,7 @@ u8 func1013_msg_hovercrate[] = { label(0x06) remove_hudmsgs show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH_074) // "Press B Button when crate grabbed to release it." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3293,7 +3293,7 @@ u8 func1014_msg_hoverbike[] = { endloop(0x04) #else if_savefile_flag_is_unset(GAMEFILEFLAG_CI_TOUR_STARTED, /*goto*/ 0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x04) if_savefile_flag_is_set(GAMEFILEFLAG_CI_TOUR_STARTED, /*goto*/ 0x06) @@ -3302,7 +3302,7 @@ u8 func1014_msg_hoverbike[] = { #endif label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2f) #if VERSION >= VERSION_PAL_BETA @@ -3319,7 +3319,7 @@ u8 func1014_msg_hoverbike[] = { label(0x06) remove_hudmsgs show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH_076) // "Double tap B Button when on Hovbike to dismount." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3334,7 +3334,7 @@ u8 func1015_msg_doors[] = { endloop(0x04) #else if_savefile_flag_is_unset(GAMEFILEFLAG_CI_TOUR_STARTED, /*goto*/ 0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x04) if_savefile_flag_is_set(GAMEFILEFLAG_CI_TOUR_STARTED, /*goto*/ 0x06) @@ -3342,7 +3342,7 @@ u8 func1015_msg_doors[] = { #endif label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2f) #if VERSION >= VERSION_PAL_BETA @@ -3359,7 +3359,7 @@ u8 func1015_msg_doors[] = { label(0x06) remove_hudmsgs show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH_078) // "B Button will also activate any object nearby." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3376,7 +3376,7 @@ u8 func1016_msg_elevators[] = { endloop(0x04) #else if_savefile_flag_is_unset(GAMEFILEFLAG_CI_TOUR_STARTED, /*goto*/ 0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x04) if_savefile_flag_is_set(GAMEFILEFLAG_CI_TOUR_STARTED, /*goto*/ 0x06) @@ -3392,7 +3392,7 @@ u8 func1016_msg_elevators[] = { remove_hudmsgs show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH_079) // "ELEVATORS Press B Button next to door to call elevator." label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3414,7 +3414,7 @@ u8 func1017_msg_terminals[] = { endloop(0x04) #else if_savefile_flag_is_unset(GAMEFILEFLAG_CI_TOUR_STARTED, /*goto*/ 0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x04) if_savefile_flag_is_set(GAMEFILEFLAG_CI_TOUR_STARTED, /*goto*/ 0x06) @@ -3435,7 +3435,7 @@ u8 func1017_msg_terminals[] = { remove_hudmsgs show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH_114) // "TERMINALS - Press B Button next to terminal to use it." label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3450,7 +3450,7 @@ u8 func1018_lightswitch[] = { unset_object_flag2(OBJ_LIGHTSWITCH, OBJFLAG2_INVISIBLE) endloop(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3584,7 +3584,7 @@ u8 func101c_holo1_main[] = { remove_hudmsgs goto_first(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3812,7 +3812,7 @@ u8 func0430_holo1_check_done[] = { label(0x2f) return - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3920,7 +3920,7 @@ u8 func1022_holo2_main[] = { remove_hudmsgs goto_first(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4025,7 +4025,7 @@ u8 func042f_holo2_part2[] = { restart_timer remove_hudmsgs show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH_105) // "Training failed - you must face forward." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate set_object_image(0x54, 0, TVCMDLIST_12) set_object_image(0x55, 0, TVCMDLIST_12) set_object_image(0x56, 0, TVCMDLIST_12) @@ -4249,7 +4249,7 @@ u8 func1027_holo3_main[] = { remove_hudmsgs goto_first(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4275,7 +4275,7 @@ u8 func102a_holo3_part1[] = { label(0x06) goto_first(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4301,7 +4301,7 @@ u8 func102b_holo3_part2[] = { label(0x06) goto_first(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4360,7 +4360,7 @@ u8 func041c_holo3_check_done[] = { set_stage_flag(STAGEFLAG_TRIGGER_HOLO_SUCCESS) label(0x06) return - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4460,7 +4460,7 @@ u8 func1028_holo4_main[] = { label(0x2f) goto_first(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4479,7 +4479,7 @@ u8 func0403_holo4_guard1[] = { remove_hudmsgs show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH_108) // "Now try against a moving target..." set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4498,7 +4498,7 @@ u8 func0404_holo4_guard2[] = { remove_hudmsgs show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH_109) // "And finally against a target that fights back." set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) if_distance_to_target_lt(500, /*goto*/ 0x2f) try_face_entity(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ 0x08) @@ -4589,7 +4589,7 @@ u8 func1033_holo4_part1[] = { label(0x2f) goto_first(0x8f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4736,7 +4736,7 @@ u8 func0407_holo5_guard1[] = { set_stage_flag(STAGEFLAG_TRIGGER_HOLO_FAILURE) set_stage_flag(STAGEFLAG_GENERAL_PURPOSE) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x0a) set_self_chrflag(CHRCFLAG_00000040) @@ -4755,8 +4755,7 @@ u8 func0407_holo5_guard1[] = { label(0x2f) set_shotlist(GAILIST_IDLE) - beginloop(0x0b) - endloop(0x0b) + terminate label(0x06) if_distance_to_target_lt(300, /*goto*/ 0x2f) @@ -4830,7 +4829,7 @@ u8 func0409_holo5_guard2[] = { label(0x06) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4872,7 +4871,7 @@ u8 func040b_holo5_guard3[] = { label(0x06) set_stage_flag(STAGEFLAG_TRIGGER_HOLO_SUCCESS) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4935,7 +4934,7 @@ u8 func1034_holo5_part1[] = { label(0x2f) goto_first(0x8f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -5040,7 +5039,7 @@ u8 func102e_holo6_main[] = { label(0x2f) goto_first(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -5129,7 +5128,7 @@ u8 func0416_holo_guard_unarmed_alert[] = { remove_hudmsgs show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH_111) // "Training failed - you have been hit." restart_timer - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x5e) if_stage_flag_eq(STAGEFLAG_HOLO_ABORTING, TRUE, /*goto*/ 0x2f) @@ -5139,7 +5138,7 @@ u8 func0416_holo_guard_unarmed_alert[] = { label(0x2f) set_stage_flag(STAGEFLAG_TRIGGER_HOLO_FAILURE) label(0x0a) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -5224,7 +5223,7 @@ u8 func0416_holo_guard_unarmed_alert2[] = { remove_hudmsgs show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH_111) // "Training failed - you have been hit." restart_timer - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x5e) if_timer_gt(180, /*goto*/ 0x2f) @@ -5233,7 +5232,7 @@ u8 func0416_holo_guard_unarmed_alert2[] = { label(0x2f) set_stage_flag(STAGEFLAG_TRIGGER_HOLO_FAILURE) label(0x0f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) label(0x57) @@ -5329,7 +5328,7 @@ u8 func102f_holo1_part1[] = { label(0x2f) goto_first(0x8f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -5439,7 +5438,7 @@ u8 func1030_holo7_main[] = { label(0x2f) goto_first(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -5547,7 +5546,7 @@ u8 func0419_holo_guard_armed_alert[] = { remove_hudmsgs show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH_111) // "Training failed - you have been hit." restart_timer - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x5e) if_stage_flag_eq(STAGEFLAG_HOLO_ABORTING, TRUE, /*goto*/ 0x2f) @@ -5557,7 +5556,7 @@ u8 func0419_holo_guard_armed_alert[] = { label(0x2f) set_stage_flag(STAGEFLAG_TRIGGER_HOLO_FAILURE) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -5641,7 +5640,7 @@ u8 func1031_holo7_part1[] = { label(0x2f) goto_first(0x8f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -5720,7 +5719,7 @@ u8 func1000_jo_typing[] = { yield stop_cutscene_track stop_ambient_track - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -5787,7 +5786,7 @@ u8 func1032_setup_lifts[] = { set_lights_state(0x0008, LIGHTOP_1, 0x32, 0x00, 0x00) set_lights_state(0x0009, LIGHTOP_1, 0x32, 0x00, 0x00) set_lights_state(0x000a, LIGHTOP_1, 0x19, 0x00, 0x00) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -5892,7 +5891,7 @@ u8 func1041_setup_environment[] = { configure_environment(0x0048, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x0055, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x0056, AIENVCMD_ROOM_SETOUTDOORS, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setupear.c b/src/ailists/setupear.c index e3b22b4b5..4f091e27e 100644 --- a/src/ailists/setupear.c +++ b/src/ailists/setupear.c @@ -929,7 +929,7 @@ u8 func0404_scientist[] = { label(0x2f) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) if_just_injured(CHR_SELF, /*goto*/ 0x2f) @@ -1137,8 +1137,8 @@ u8 func0404_scientist[] = { show_hudmsg(CHR_TARGET, L_EAR_029) // "Experiment has been shut down." stop_chr - beginloop(0x0e) - endloop(0x0e) + label(0x0e) + terminate endlist }; @@ -1155,7 +1155,7 @@ u8 func0406_nasty_scientist[] = { label(0x2f) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) if_just_injured(CHR_SELF, /*goto*/ 0x2f) @@ -1281,8 +1281,7 @@ u8 func0406_nasty_scientist[] = { label(0x06) stop_chr - beginloop(0x0e) - endloop(0x0e) + terminate endlist }; @@ -1308,14 +1307,14 @@ u8 func1009_weaponscache[] = { unset_object_flag2(OBJ_CMP150_2, OBJFLAG2_INVISIBLE) set_object_flag2(OBJ_CMP150_1, OBJFLAG2_PICKUPWITHOUTLOS) set_object_flag2(OBJ_CMP150_2, OBJFLAG2_PICKUPWITHOUTLOS) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2f) show_hudmsg(CHR_TARGET, L_EAR_099) // "Enemy detected - weapon cache locked." play_sound(SFX_00F7, -1) unset_stage_flag(STAGEFLAG_BOT_ACTIVE) unset_stage_flag(STAGEFLAG_BOT_REPROGRAMMED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1333,7 +1332,7 @@ u8 func1002_bot_activation_terminal[] = { goto_next(0x04) label(0x2f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x04) chr_toggle_p1p2(CHR_SELF) @@ -1411,7 +1410,7 @@ u8 func1003_bot_programming_terminal[] = { goto_next(0x04) label(0x2f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x04) chr_toggle_p1p2(CHR_SELF) @@ -1490,7 +1489,7 @@ u8 func1004_check_items_collected[] = { yield set_stage_flag(STAGEFLAG_ALL_ITEMS_COLLECTED) unset_stage_flag(STAGEFLAG_ITEMS_UNCOLLECTABLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1526,7 +1525,7 @@ u8 func1018_item_pickup_messages[] = { endloop(0x04) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1583,7 +1582,7 @@ u8 func1005_check_unacceptable_casualties[] = { label(0x0f) set_stage_flag(STAGEFLAG_UNACCEPTABLE_CASUALTIES) show_hudmsg(CHR_BOND, L_EAR_026) // "Unacceptable scientist casualties." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1901,7 +1900,7 @@ u8 func1007_uplink[] = { label(0x0d) mute_channel(CHANNEL_5) mute_channel(CHANNEL_6) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1923,7 +1922,7 @@ u8 func1008_check_bot_terminals_destroyed[] = { endloop(0x04) label(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2043,7 +2042,7 @@ u8 func100b_check_uplink_pc_destroyed[] = { endloop(0x04) label(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2163,8 +2162,7 @@ u8 func0413_purplebot_at_lasers[] = { begin_hovercar_path(0x0a) set_vehicle_speed(512, 120) - beginloop(0x13) - endloop(0x13) + terminate endlist }; @@ -2174,7 +2172,7 @@ u8 func100c_shuffle_terminals[] = { shuffle_investigation_terminals(OBJ_GOODTERM2, OBJ_ALARMTERM2, 0x1a, 0x1b, 0x1c, 0x1d) shuffle_investigation_terminals(OBJ_GOODTERM3, OBJ_ALARMTERM3, 0x15, 0x16, 0x17, 0x18) yield - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2326,7 +2324,7 @@ u8 func0416_intro[] = { chr_do_animation(ANIM_CUT_EAR_INTRO_GUARD_02, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_INTRO_GUARD, 2) yield kill(CHR_INTRO_GUARD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2429,7 +2427,7 @@ u8 func0417_outro[] = { wait_for_camera(0x0f) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2609,12 +2607,12 @@ u8 func100f_check_for_end_level[] = { label(0x2f) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) set_invincible(CHR_BOND) set_ailist(CHR_SELF, AILIST_OUTRO) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2650,7 +2648,7 @@ u8 func1011_spawn_guards_during_uplink[] = { label(0x06) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2693,7 +2691,7 @@ u8 func1012_start_laser_sound[] = { play_sound_from_object(CHANNEL_3, 0x38, 1, 600, 800) assign_sound(SFX_01C5, CHANNEL_4) play_sound_from_object(CHANNEL_4, 0x37, 1, 600, 800) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2725,7 +2723,7 @@ u8 func1013_hatch_pc[] = { label(0x2f) endloop(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2764,7 +2762,7 @@ u8 func0415_radioactivity[] = { label(0x06) goto_first(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2780,7 +2778,7 @@ u8 func101d_coop_radioactivty[] = { if_chr_death_animation_finished(CHR_TARGET, /*goto*/ 0x2f) set_ailist(CHR_SELF, AILIST_RADIOACTIVITY) label(0x2f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2790,7 +2788,7 @@ u8 func1021_counterop_radioactivity[] = { if_chr_death_animation_finished(CHR_TARGET, /*goto*/ 0x2f) set_ailist(CHR_SELF, AILIST_RADIOACTIVITY) label(0x2f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2989,7 +2987,7 @@ u8 func0403_k7_scientist[] = { u8 func1016_setup_drcaroll[] = { set_chr_chrflag(CHR_DRCAROLL, CHRCFLAG_HIDDEN) set_ailist(CHR_DRCAROLL, GAILIST_INVINCIBLE_AND_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3025,7 +3023,7 @@ u8 func1019_msg_securitysector[] = { label(0x2f) speak(CHR_P1P2, L_EAR_094, SFX_8173, CHANNEL_6, COLOR_09_BLUE) // "That's the highest security sector - Dr. Caroll ha..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3038,7 +3036,7 @@ u8 func101a_msg_lotofpower[] = { label(0x2f) speak(CHR_P1P2, L_EAR_095, MP3_03A5, CHANNEL_6, COLOR_09_BLUE) // "Something around here's using a lot of power." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3054,7 +3052,7 @@ u8 func101b_msg_reprogram[] = { label(0x2f) speak(CHR_P1P2, L_EAR_096, SFX_8174, CHANNEL_6, COLOR_09_BLUE) // "Reprogram that cleaning bot - it'll give you a way..." label(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3068,7 +3066,7 @@ u8 func101c_msg_radioactive[] = { label(0x2f) speak(CHR_P1P2, L_EAR_097, SFX_8175, CHANNEL_6, COLOR_09_BLUE) // "Get out, Jo! The levels are too high. Use the CamS..." label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3094,7 +3092,7 @@ u8 func101e_unlock_drcaroll_door[] = { label(0x06) unlock_door(0x26, 0x40) unlock_door(0x5a, 0x40) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3192,7 +3190,7 @@ u8 func101f_check_bot_destroyed[] = { if_stage_flag_eq(STAGEFLAG_HAS_NIGHTVISION, TRUE, /*goto*/ 0x2f) set_stage_flag(STAGEFLAG_ITEMS_UNCOLLECTABLE) label(0x2f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) if_objective_complete(0, /*goto*/ 0x2f) @@ -3216,7 +3214,7 @@ u8 func101f_check_bot_destroyed[] = { label(0x2f) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3230,7 +3228,7 @@ u8 func1020_lock_agent_doors[] = { lock_door(0x5e, 0x08) lock_door(0x5f, 0x08) label(0x2f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3239,7 +3237,7 @@ u8 func1022_setup_rtracker[] = { set_object_flag3(OBJ_CMP150_1, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(OBJ_CMP150_2, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(OBJ_PROXYMINES, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3288,13 +3286,13 @@ u8 func1423_setup_environment[] = { configure_environment(0x0067, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x0069, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x006a, AIENVCMD_ROOM_SETAMBIENT, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1424_start_lift[] = { activate_lift(1, 0x60) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setupeld.c b/src/ailists/setupeld.c index 4625fc922..5899bf064 100644 --- a/src/ailists/setupeld.c +++ b/src/ailists/setupeld.c @@ -1130,7 +1130,7 @@ u8 func1002_intro[] = { set_ailist(CHR_NEGOTIATOR, AILIST_NEGOTIATOR) unset_chr_chrflag(CHR_COOP, CHRCFLAG_HIDDEN) unset_chr_chrflag(CHR_ANTI, CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x4f) camera_movement(ANIM_CUT_ELD_INTRO_CAM_04) cmd0175(60) @@ -1222,7 +1222,7 @@ u8 func1002_intro[] = { set_ailist(CHR_TAKER2, AILIST_TAKER) unset_chr_chrflag(CHR_COOP, CHRCFLAG_HIDDEN) unset_chr_chrflag(CHR_ANTI, CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1385,7 +1385,7 @@ u8 func0408_outro[] = { stop_cutscene_track stop_ambient_track end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1405,7 +1405,7 @@ u8 func1003_give_items[] = { disable_object(0x02) disable_object(0x8a) if_chr_death_animation_finished(CHR_COOP, /*goto*/ 0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // A and SA label(0x06) @@ -1416,13 +1416,13 @@ u8 func1003_give_items[] = { disable_object(0x01) disable_object(0x89) if_chr_death_animation_finished(CHR_COOP, /*goto*/ 0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Velvet doesn't exist label(0x08) disable_object(0x8a) disable_object(0x89) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1442,7 +1442,7 @@ u8 func1004_check_negotiator[] = { // PA label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1634,11 +1634,11 @@ u8 func0402_taker[] = { label(0x2d) remove_chr(CHR_SELF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) stop_chr - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1653,7 +1653,7 @@ u8 func100f_check_takers_dead[] = { label(0x2d) set_stage_flag(STAGEFLAG_TAKERS_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1677,7 +1677,7 @@ u8 func0403_negotiator[] = { set_stage_flag(STAGEFLAG_NEGOTIATOR_ESCAPED) stop_x_track(XREASON_DEFAULT) remove_chr(CHR_SELF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1762,7 +1762,7 @@ u8 func1005_toggle_snipers[] = { set_ailist(CHR_SNIPER6, AILIST_ENABLE_SNIPER) set_ailist(CHR_SNIPER7, AILIST_ENABLE_SNIPER) set_ailist(CHR_SNIPER8, AILIST_ENABLE_SNIPER) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1895,7 +1895,7 @@ u8 func0404_sniper[] = { endloop(0x04) label(0x64) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1943,7 +1943,7 @@ u8 func1006_check_snipers_dead[] = { label(0x2d) show_hudmsg(CHR_BOND, L_ELD_012) // "Snipers have been eliminated." set_stage_flag(STAGEFLAG_SNIPERS_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2077,7 +2077,7 @@ u8 func1009_windmill_switch[] = { set_object_flag2(OBJ_WINDMILL, OBJFLAG2_AICANNOTUSE) unlock_door(0x06, 0x02) unlock_door(0x07, 0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Cooling and power not active label(0x06) @@ -2101,21 +2101,21 @@ u8 func100a_check_switches_destroyed[] = { if_stage_flag_eq(STAGEFLAG_COOLING_ACTIVE, TRUE, /*goto*/ 0x2d) show_hudmsg(CHR_BOND, L_ELD_021) // "Critical mission object has been destroyed." set_stage_flag(STAGEFLAG_WINDMILL_SWITCH_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2d) if_object_in_good_condition(0x04, /*goto*/ 0x2d) if_stage_flag_eq(STAGEFLAG_POWER_ACTIVE, TRUE, /*goto*/ 0x2d) show_hudmsg(CHR_BOND, L_ELD_021) // "Critical mission object has been destroyed." set_stage_flag(STAGEFLAG_WINDMILL_SWITCH_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2d) if_object_in_good_condition(0x05, /*goto*/ 0x2d) if_stage_flag_eq(STAGEFLAG_WINDMILL_ACTIVATED, TRUE, /*goto*/ 0x2d) show_hudmsg(CHR_BOND, L_ELD_021) // "Critical mission object has been destroyed." set_stage_flag(STAGEFLAG_WINDMILL_SWITCH_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2d) endloop(0x04) @@ -2137,7 +2137,7 @@ u8 func100b_invoke_hackers[] = { // A or SA - exit label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // PA - wait for windmill beginloop(0x04) @@ -2189,13 +2189,13 @@ u8 func100b_invoke_hackers[] = { // Hackers dead label(0x2d) hide_countdown_timer - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func0406_init_hacker[] = { set_self_chrflag(CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2224,7 +2224,7 @@ u8 func0405_hacker[] = { label(0x06) stop_chr remove_chr(CHR_SELF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Sees player label(0x09) @@ -2267,7 +2267,7 @@ u8 func100c_check_hackers_dead[] = { // Hackers succeeded label(0x2d) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2308,7 +2308,7 @@ u8 func100e_check_objectives_complete[] = { // Mission failed - objectives incomplete end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2d) if_chr_deadish(CHR_BOND, /*goto*/ 0x2d) @@ -2320,7 +2320,7 @@ u8 func100e_check_objectives_complete[] = { // Mission failed - players dead label(0x2d) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) if_chr_deadish(CHR_CARRINGTON, /*goto*/ 0x2d) @@ -2331,7 +2331,7 @@ u8 func100e_check_objectives_complete[] = { // Carrington died... somehow label(0x2d) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2339,7 +2339,7 @@ u8 func1010_set_pa_negotiator_flag[] = { if_difficulty_lt(DIFF_PA, /*goto*/ 0x06) set_stage_flag(STAGEFLAG_NEGOTIATOR_ESCAPED) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2356,7 +2356,7 @@ u8 func1011_setup_snipers[] = { set_chr_chrflag(CHR_SNIPER2, CHRCFLAG_HAS_SPECIAL_DEATH_ANIMATION) set_chr_chrflag(CHR_SNIPER6, CHRCFLAG_HAS_SPECIAL_DEATH_ANIMATION) set_chr_chrflag(CHR_SNIPER8, CHRCFLAG_HAS_SPECIAL_DEATH_ANIMATION) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2394,7 +2394,7 @@ u8 func1013_check_guard_subdued[] = { // A and SA label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2441,7 +2441,7 @@ u8 func1014_give_keycard[] = { label(0x09) unset_object_flag(OBJ_KEYCARD, OBJFLAG_UNCOLLECTABLE) unset_object_flag2(OBJ_KEYCARD, OBJFLAG2_INVISIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2467,7 +2467,7 @@ u8 func1015_check_computers_destroyed[] = { show_hudmsg(CHR_BOND, L_ELD_021) // "Critical mission object has been destroyed." set_stage_flag(STAGEFLAG_HACKER_PC_DESTROYED) label(0x09) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2517,13 +2517,13 @@ u8 func1016_msg_generator[] = { label(0x2d) speak(CHR_P1P2, L_ELD_035, MP3_03AC, CHANNEL_6, COLOR_09_BLUE) // "If I get the wind generator back online, I'll get ..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1017_msg_gottobequick[] = { if_difficulty_lt(DIFF_PA, /*goto*/ 0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2d) restart_timer @@ -2541,7 +2541,7 @@ u8 func1017_msg_gottobequick[] = { label(0x06) speak(CHR_BOND, L_ELD_036, MP3_03AD, CHANNEL_6, COLOR_09_BLUE) // "I've got to be quick, or they'll kill the negotiat..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2563,7 +2563,7 @@ u8 func1018_msg_hidingdaniel[] = { label(0x2d) speak(CHR_P1P2, L_ELD_037, MP3_03AE, CHANNEL_6, COLOR_09_BLUE) // "Here's where they must be holding Daniel." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2581,7 +2581,7 @@ u8 func1019_msg_hackershavetobestopped[] = { label(0x2d) speak(CHR_BOND, L_ELD_038, MP3_03AF, CHANNEL_6, COLOR_09_BLUE) // "Those hackers have to be stopped before I rescue D..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2762,7 +2762,7 @@ u8 func101b_toggle_basement_chrs[] = { if_object_in_good_condition(0x87, /*goto*/ 0x06) if_object_in_good_condition(0x88, /*goto*/ 0x06) play_sound(MP3_07CB, -1) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) goto_first(0x08) @@ -2775,7 +2775,7 @@ u8 func101b_toggle_basement_chrs[] = { */ u8 func101c_toggle_villa_guards[] = { if_difficulty_lt(DIFF_PA, /*goto*/ 0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // A and SA label(0x2d) @@ -2885,7 +2885,7 @@ u8 func101c_toggle_villa_guards[] = { enable_chr(0x42) rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2916,14 +2916,14 @@ u8 func101d_dual_cmp150[] = { unset_object_flag2(OBJ_CMP150_1, OBJFLAG2_INVISIBLE) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func0407_init_sniper[] = { set_chr_maxdamage(CHR_SELF, 1) stop_chr - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2933,7 +2933,7 @@ u8 func0410_carrington[] = { set_self_chrflag(CHRCFLAG_UNEXPLODABLE) set_chr_maxdamage(CHR_SELF, 1) chr_do_animation(ANIM_CUT_ELD_OUTRO_CARR, 1, 1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_CARRINGTON, 2) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2952,7 +2952,7 @@ u8 func101e_unlock_doors[] = { unlock_door(0x97, 0x80) unlock_door(0x98, 0x80) label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2979,7 +2979,7 @@ u8 func101f_check_one_basement_guard_remaining[] = { if_morale_lt(8, /*goto*/ 0x2d) set_stage_flag(STAGEFLAG_ONE_BASEMENT_GUARD_REMAINING) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2d) endloop(0x04) @@ -2997,7 +2997,7 @@ u8 func1420_setup_portals[] = { set_room_flag(0x004d, ROOMFLAG_0800) set_room_flag(0x0065, ROOMFLAG_0800) set_room_flag(0x0059, ROOMFLAG_0800) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3087,7 +3087,7 @@ u8 func1423_setup_environment[] = { configure_environment(0x0070, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x0071, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x0071, AIENVCMD_ROOM_SETOUTDOORS, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3122,7 +3122,7 @@ u8 func1021_toggle_last_basement_guard[] = { label(0x2d) unset_chr_chrflag(CHR_BASEMENT9, CHRCFLAG_HIDDEN) unset_chr_chrflag(CHR_BASEMENT9, CHRCFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3131,7 +3131,7 @@ u8 func1022_setup_rtracker[] = { set_object_flag3(OBJ_CMP150_1, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(OBJ_CMP150_2, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(OBJ_DEVASTATOR, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3146,7 +3146,7 @@ u8 func0411_cisoldier[] = { yield kill(CHR_CISOLDIER) label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3166,7 +3166,7 @@ u8 func1024_set_chr_flags_on_pa[] = { set_chr_hiddenflag(CHR_BASEMENT6, CHRHFLAG_DONTSHOOTME) set_chr_hiddenflag(CHR_BASEMENT8, CHRHFLAG_DONTSHOOTME) label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3187,7 +3187,7 @@ u8 func1025_check_basement_entered_without_subdue[] = { set_stage_flag(STAGEFLAG_FORGOT_TO_KO_GUARD) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; #endif diff --git a/src/ailists/setupimp.c b/src/ailists/setupimp.c index 5e9ba610a..428eba00e 100644 --- a/src/ailists/setupimp.c +++ b/src/ailists/setupimp.c @@ -749,7 +749,7 @@ u8 func100b_setup_autoguns[] = { set_object_flag(OBJ_AUTOGUN3, OBJFLAG_DEACTIVATED) label(0x2f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -785,7 +785,7 @@ u8 func1004_check_hostages_killed[] = { show_hudmsg(CHR_BOND, L_IMP_016) // "Too many hostages killed." label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -800,7 +800,7 @@ u8 func1005_check_safeinfo_destroyed[] = { label(0x08) show_hudmsg(CHR_BOND, L_IMP_018) // "Sensitive information has been destroyed." set_stage_flag(STAGEFLAG_SAFEINFO_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -843,23 +843,23 @@ u8 func1005_check_safeinfo_destroyed[] = { u8 func1007_autogun_switch1[] = { autogun_switch_logic(OBJ_AUTOGUN_SWITCH1, OBJ_AUTOGUN1, STAGEFLAG_AUTOGUN1_ACTIVE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x11) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1008_autogun_switch2[] = { autogun_switch_logic(OBJ_AUTOGUN_SWITCH2, OBJ_AUTOGUN2, STAGEFLAG_AUTOGUN2_ACTIVE) label(0x11) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1009_autogun_switch3[] = { autogun_switch_logic(OBJ_AUTOGUN_SWITCH3, OBJ_AUTOGUN3, STAGEFLAG_AUTOGUN3_ACTIVE) label(0x11) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1151,7 +1151,7 @@ u8 func0c01_outro[] = { stop_cutscene_track stop_ambient_track end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1535,7 +1535,7 @@ u8 func1002_intro[] = { set_ailist(CHR_CARRINGTON, AILIST_CARRINGTON) set_ailist(CHR_SKEDAR4, AILIST_SKEDAR4) unset_chr_chrflag(CHR_JONATHAN, CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1560,7 +1560,7 @@ u8 func1003_hide_blondes_and_skedar[] = { set_chr_chrflag(CHR_BLONDE4, CHRCFLAG_INVINCIBLE) set_chr_chrflag(CHR_BLONDE5, CHRCFLAG_INVINCIBLE) set_chr_chrflag(CHR_BLONDE6, CHRCFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1572,7 +1572,7 @@ u8 func100c_check_carrington_dead[] = { label(0x2e) show_hudmsg(CHR_BOND, L_IMP_019) // "Carrington has been killed." set_stage_flag(STAGEFLAG_CARRINGTON_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1599,7 +1599,7 @@ u8 func0414_firingrange_hostage[] = { label(0x2e) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x04) if_self_flag_bankx_eq(CHRFLAG0_SKIPSAFETYCHECKS, TRUE, BANK_0, /*goto*/ 0x2e) @@ -1632,7 +1632,7 @@ u8 func0414_firingrange_hostage[] = { set_returnlist(CHR_SELF, AILIST_FIRINGRANGE_HOSTAGE) set_shotlist(AILIST_FIRINGRANGE_HOSTAGE) set_ailist(CHR_SELF, GAILIST_COMBAT_WITH_TARGET) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Enemy not detected label(0x12) @@ -1697,7 +1697,7 @@ u8 func100e_setup_firingrange[] = { unset_chr_chrflag(CHR_HOSTAGE_FR2, CHRCFLAG_INVINCIBLE) unset_chr_chrflag(CHR_TAKER_FR1, CHRCFLAG_INVINCIBLE) unset_chr_chrflag(CHR_TAKER_FR2, CHRCFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1724,7 +1724,7 @@ u8 func041a_hostage_holo[] = { // Dying label(0x2e) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive - wait until holo room door opened beginloop(0x04) @@ -1852,7 +1852,7 @@ u8 func041e_init_holoclone3[] = { u8 func041f_holoclone_onshot[] = { play_sound(SFX_MENU_SWIPE, CHANNEL_6) drop_gun_and_fade_out - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1940,7 +1940,7 @@ u8 func0423_init_shock[] = { add_health_or_armor(0) set_recovery_speed(0) set_shield(90) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1956,7 +1956,7 @@ u8 func0426_init_saved_hostage[] = { label(0x2e) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1967,7 +1967,7 @@ u8 func0425_hostage_thank_and_run[] = { label(0x2e) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x03) set_target_chr(CHR_COOP) @@ -2026,7 +2026,7 @@ u8 func0425_hostage_thank_and_run[] = { label(0x08) unset_self_chrflag(CHRCFLAG_KILLCOUNTABLE) remove_chr(CHR_SELF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2057,7 +2057,7 @@ u8 func0427_drop_devastator[] = { label(0x2e) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x03) set_target_chr(CHR_COOP) @@ -2107,7 +2107,7 @@ u8 func0427_drop_devastator[] = { label(0x08) remove_chr(CHR_SELF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2126,7 +2126,7 @@ u8 func100f_check_holo_takers_dead[] = { label(0x2e) set_stage_flag(STAGEFLAG_HOLO_TAKERS_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2141,7 +2141,7 @@ u8 func1010_check_device_takers_dead[] = { label(0x2e) set_stage_flag(STAGEFLAG_DEVICE_TAKERS_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2156,7 +2156,7 @@ u8 func1011_check_info_takers_dead[] = { label(0x2e) set_stage_flag(STAGEFLAG_INFO_TAKERS_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2181,7 +2181,7 @@ u8 func042b_deviceroom_hostage[] = { label(0x2e) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x12) set_target_chr(CHR_BOND) @@ -2223,7 +2223,7 @@ u8 func042e_taker_device_m[] = { // Dying label(0x2e) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x08) @@ -2279,7 +2279,7 @@ u8 func0430_taker_device_f[] = { // Dying label(0x2e) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x08) @@ -2325,7 +2325,7 @@ u8 func0432_taker_attack[] = { // Dying label(0x2e) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x08) @@ -2389,7 +2389,7 @@ u8 func0433_inforoom_hostage[] = { label(0x2e) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x04) if_self_flag_bankx_eq(CHRFLAG0_SKIPSAFETYCHECKS, TRUE, BANK_0, /*goto*/ 0x08) @@ -2475,7 +2475,7 @@ u8 func1012_info_room[] = { label(0x08) set_chr_flag_bankx(CHR_TAKER_INFO_F, CHRFLAG0_SKIPSAFETYCHECKS, BANK_0) set_chr_flag_bankx(CHR_TAKER_INFO_M, CHRFLAG0_SKIPSAFETYCHECKS, BANK_0) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2493,7 +2493,7 @@ u8 func0436_taker_info_m[] = { // Dying label(0x2e) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x08) @@ -2524,7 +2524,7 @@ u8 func0438_taker_info_f[] = { // Dying label(0x2e) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x08) @@ -2599,7 +2599,7 @@ u8 func1013_check_hostages_saved[] = { set_stage_flag(STAGEFLAG_ENOUGH_HOSTAGES_SAVED) label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2887,14 +2887,14 @@ u8 func1014_carrington_messages[] = { label(0x2e) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x08) set_invincible(CHR_BOND) set_ailist(CHR_SELF, 0x0418) label(0xd9) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2911,7 +2911,7 @@ u8 func1015_firingrange_pc[] = { label(0x2f) show_hudmsg(CHR_BOND, L_IMP_034) // "Critical mission object has been destroyed." set_stage_flag(STAGEFLAG_FR_PC_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x08) play_sound(SFX_8116, -1) @@ -2931,7 +2931,7 @@ u8 func1015_firingrange_pc[] = { unset_object_flag(OBJ_RCP120, OBJFLAG_UNCOLLECTABLE) unset_object_flag(OBJ_RCP120_GLASS, OBJFLAG_INVINCIBLE) destroy_object(OBJ_RCP120_GLASS) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3066,7 +3066,7 @@ u8 func1016_remove_spawners[] = { label(0x2e) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3229,7 +3229,7 @@ u8 func1022_skedar_shuttle[] = { label(0x2e) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Bomb deactivated label(0x0a) @@ -3265,7 +3265,7 @@ u8 func1022_skedar_shuttle[] = { mute_channel(CHANNEL_3) mute_channel(CHANNEL_4) destroy_object(OBJ_SKEDAR_SHUTTLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3278,8 +3278,7 @@ u8 func043a_unused[] = { label(0x08) - beginloop(0x04) - endloop(0x04) + terminate endlist }; @@ -3320,7 +3319,7 @@ u8 unregistered_function1[] = { label(0x2e) set_stage_flag(STAGEFLAG_TRIGGER_SHUTTLE_TAKEOFF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3372,8 +3371,7 @@ u8 func043e_carrington[] = { label(0x2e) stop_chr - beginloop(0x0a) - endloop(0x0a) + terminate endlist }; @@ -3405,7 +3403,7 @@ u8 func1018_hurt_carrington[] = { label(0x08) damage_chr(CHR_CARRINGTON, WEAPON_SUPERDRAGON) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3415,7 +3413,7 @@ u8 func1019_setup_safeinfo[] = { unset_object_flag(OBJ_SAFEDOOR, OBJFLAG_INVINCIBLE) unset_object_flag(OBJ_SAFEINFO, OBJFLAG_INVINCIBLE) #endif - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3435,7 +3433,7 @@ u8 func101b_msg_autodefenses[] = { yield speak(CHR_BOND, L_IMP_035, MP3_03D8, CHANNEL_6, COLOR_09_BLUE) // "The autodefenses will really help me out." label(0x0a) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3458,7 +3456,7 @@ u8 func101c_msg_fosterworkingon[] = { label(0x2e) speak(CHR_P1P2, L_IMP_036, MP3_03D9, CHANNEL_6, COLOR_09_BLUE) // "So this is what Foster was working on." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3480,20 +3478,7 @@ u8 func101d_msg_countingonme[] = { label(0x2e) speak(CHR_BOND, L_IMP_037, MP3_03DA, CHANNEL_6, COLOR_09_BLUE) // "I'll have to go carefully... The hostages are coun..." - set_ailist(CHR_SELF, GAILIST_IDLE) - endlist -}; - -/** - * This message is not played because no condition breaks out of the loop. - */ -u8 func101e_msg_wontknow[] = { - beginloop(0x04) - endloop(0x04) - - label(0x2e) - speak(CHR_BOND, L_IMP_038, MP3_03DB, CHANNEL_6, COLOR_09_BLUE) // "Well, at least I won't know if I'm doing anything ..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3515,7 +3500,7 @@ u8 func101f_configure_cisoldiers[] = { set_ailist(0x1d, AILIST_INIT_CISOLDIER) set_ailist(0x1e, AILIST_INIT_CISOLDIER) set_ailist(CHR_HANGARGUY, AILIST_INIT_CISOLDIER) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3534,7 +3519,7 @@ u8 func1020_trigger_spawning[] = { label(0x2e) set_stage_flag(STAGEFLAG_TRIGGER_SPAWNING) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3553,7 +3538,7 @@ u8 func1021_setup_jonathan[] = { if_savefile_flag_is_set(GAMEFILEFLAG_DEFENSE_JON, /*goto*/ 0x08) remove_chr(CHR_JONATHAN) label(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3615,11 +3600,11 @@ u8 func1023_check_skeder_shuttle_destroyed[] = { label(0x2e) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate #if VERSION >= VERSION_NTSC_1_0 label(0x0f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate #endif endlist }; @@ -3627,7 +3612,7 @@ u8 func1023_check_skeder_shuttle_destroyed[] = { u8 func1024_setup_lifts[] = { activate_lift(1, 0x41) activate_lift(2, 0x42) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3669,7 +3654,7 @@ u8 func100e_setup_firingrange_doors[] = { label(0x2e) unset_object_flag2(0x23, OBJFLAG2_AICANNOTUSE) unset_object_flag2(0x24, OBJFLAG2_AICANNOTUSE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3750,7 +3735,7 @@ u8 func1027_uplink[] = { endloop(0x14) label(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate reloop(0x04) // Connection broken @@ -3770,7 +3755,7 @@ u8 func1027_uplink[] = { endloop(0x04) label(0x0f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3791,14 +3776,14 @@ u8 func1028_shuttle_immunity[] = { endloop(0xe4) label(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1029_setup_rtracker[] = { yield set_object_flag3(OBJ_DEVASTATOR, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3810,7 +3795,7 @@ u8 func102a_setup_environment[] = { configure_environment(0x0048, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x0055, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x0056, AIENVCMD_ROOM_SETOUTDOORS, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3824,7 +3809,7 @@ u8 func102b_safedoor_immunity[] = { label(0x2e) if_object_in_good_condition(OBJ_SAFEDOOR, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) if_chr_in_room(CHR_BOND, 0x00, 0x000c, /*goto*/ 0x2e) @@ -3853,7 +3838,7 @@ u8 func102b_safedoor_immunity[] = { // A and SA label(0x10) set_object_flag(OBJ_SAFEDOOR, OBJFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3911,7 +3896,7 @@ u8 func102c_door_flags[] = { endloop(0xe4) label(0x0f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4001,7 +3986,6 @@ struct ailist ailists[] = { { func101b_msg_autodefenses, 0x101b }, { func101c_msg_fosterworkingon, 0x101c }, { func101d_msg_countingonme, 0x101d }, - { func101e_msg_wontknow, 0x101e }, { func101f_configure_cisoldiers, 0x101f }, { func1020_trigger_spawning, 0x1020 }, { func1021_setup_jonathan, 0x1021 }, diff --git a/src/ailists/setuplee.c b/src/ailists/setuplee.c index b032fbb48..79b095d42 100644 --- a/src/ailists/setuplee.c +++ b/src/ailists/setuplee.c @@ -697,13 +697,13 @@ u8 func1019_check_shields_lowered[] = { label(0x2c) speak(CHR_BOND, L_LEE_017, SFX_81A1, CHANNEL_6, COLOR_04_ORANGE) // "You've got to open the hangar doors so we can dock..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) endloop(0x04) label(0x09) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -723,7 +723,7 @@ u8 func1004_check_hangar_doors_opened[] = { // Console destroyed show_hudmsg(CHR_BOND, L_LEE_048) // "Critical mission object destroyed." set_stage_flag(STAGEFLAG_HANGAR_DOOR_CONSOLE_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Console healthy label(0x2d) @@ -780,7 +780,7 @@ u8 func1004_check_hangar_doors_opened[] = { label(0x08) yield - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -836,7 +836,7 @@ u8 func040e_elvis_give_ar34[] = { label(0x2c) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) stop_chr @@ -928,7 +928,7 @@ u8 func0409_elvis_follow[] = { // Dying label(0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -1083,7 +1083,7 @@ u8 func041c_elvis_outside_prebridgelift[] = { // Dying label(0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -1120,7 +1120,7 @@ u8 func040a_elvis_go_to_hangar_lift[] = { // Dying label(0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -1163,7 +1163,7 @@ u8 func040a_elvis_go_to_hangar_lift[] = { label(0x06) stop_chr - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1175,7 +1175,7 @@ u8 func041b_elvis_at_bridge[] = { // Dying label(0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -1231,7 +1231,7 @@ u8 func1005_check_elvis_dead[] = { label(0x2c) show_hudmsg(CHR_BOND, L_LEE_012) // "Elvis has been killed." set_stage_flag(STAGEFLAG_ELVIS_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1250,7 +1250,7 @@ u8 func040f_init_skedar[] = { // Dying or dead label(0x0d) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1259,7 +1259,7 @@ u8 func0410_wake_suspendedanim_skedar[] = { goto_next(0x06) label(0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) set_accuracy(VERSION >= VERSION_NTSC_1_0 ? 20 : 40) @@ -1348,7 +1348,7 @@ u8 func1006_wake_slayer_skedar[] = { set_chr_team(CHR_SUSPENDEDANIM4, TEAM_ENEMY) rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1370,7 +1370,7 @@ u8 func1007_check_entered_slayer_area[] = { label(0x06) set_stage_flag(STAGEFLAG_ENTERED_SLAYER_AREA) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1586,7 +1586,7 @@ u8 func1008_hangar_lifts[] = { label(0x2c) goto_first(LABEL_64) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1694,7 +1694,7 @@ u8 func0408_knifeable_skedar[] = { stop_chr set_returnlist(CHR_SELF, GAILIST_UNALERTED) set_ailist(CHR_SELF, GAILIST_UNALERTED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1723,7 +1723,7 @@ u8 func1009_keep_door_open_in_intro[] = { label(0x06) set_chr_flag_bankx(CHR_KNIFEABLE_SKEDAR, CHRFLAG0_SKIPSAFETYCHECKS, BANK_0) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1852,7 +1852,7 @@ u8 func0419_hangar_maian[] = { goto_next(0x06) label(0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) if_enemy_distance_lt_and_los(2540, /*goto*/ 0x08) @@ -1977,7 +1977,7 @@ u8 func100a_check_hangar_kills_done[] = { label(0x2c) set_stage_flag(STAGEFLAG_HANGAR_KILLS_DONE) set_ailist(CHR_ELVIS, AILIST_ELVIS_GO_TO_HANGAR_LIFT) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2005,7 +2005,7 @@ u8 func100b_msg_getshieldsdown[] = { label(0x06) speak(CHR_BOND, L_LEE_016, SFX_81A0, CHANNEL_6, COLOR_04_ORANGE) // "Outside, Joanna. Get the shields down and we can h..." set_stage_flag(STAGEFLAG_SAID_GETSHIELDSDOWN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2061,7 +2061,7 @@ u8 func100c_engineroom[] = { destroy_object(0x20) show_hudmsg(CHR_BOND, L_LEE_023) // "Engines have been disabled." set_stage_flag(STAGEFLAG_ENGINES_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2147,7 +2147,7 @@ u8 func100d_prebridgelift[] = { label(0x2c) goto_first(LABEL_64) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2229,7 +2229,7 @@ u8 func100e_bridgelift[] = { label(0x2c) goto_first(LABEL_64) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2368,7 +2368,7 @@ u8 func041a_bridgeclone[] = { // Dying label(0x2c) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -2471,7 +2471,7 @@ u8 func041a_bridgeclone[] = { goto_first(LABEL_C2) label(LABEL_B8) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2522,7 +2522,7 @@ u8 func100f_bridge_entry[] = { label(0x06) set_stage_flag(STAGEFLAG_TRIGGER_BRIDGE_SPAWNING) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2560,7 +2560,7 @@ u8 func1010_check_bridge_captured[] = { label(0x2c) show_hudmsg(CHR_BOND, L_LEE_025) // "Bridge has been captured." set_stage_flag(STAGEFLAG_BRIDGE_CAPTURED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2587,7 +2587,7 @@ u8 func1011_check_end_level[] = { // Both players dead label(0x2c) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Either buddy is alive label(0x06) @@ -2599,7 +2599,7 @@ u8 func1011_check_end_level[] = { // Elvis dead label(0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2856,7 +2856,7 @@ u8 func1003_intro[] = { set_ailist(CHR_CASS, AILIST_CASS) stop_cutscene_track stop_ambient_track - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2993,7 +2993,7 @@ u8 func0c01_outro[] = { label(LABEL_B0) mute_channel(CHANNEL_10) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3041,7 +3041,7 @@ u8 func0421_bridge_skedar[] = { label(0x06) say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x2c) @@ -3184,7 +3184,7 @@ u8 func1013_msg_gottogetshieldsdown[] = { label(0x2c) speak(CHR_BOND, L_LEE_027, MP3_03DC, CHANNEL_6, COLOR_09_BLUE) // "I've got to get those shields down to let Elvis in..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3207,7 +3207,7 @@ u8 func1014_msg_hangarbaydoors[] = { speak(CHR_BOND, L_LEE_028, MP3_03DD, CHANNEL_6, COLOR_09_BLUE) // "Now only the hangar bay doors are in the way." label(0x09) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3219,7 +3219,7 @@ u8 func1015_msg_starmaps[] = { label(0x2c) speak(CHR_P1P2, L_LEE_029, MP3_03DE, CHANNEL_6, COLOR_09_BLUE) // "This machine contains the Skedar star maps." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3235,7 +3235,7 @@ u8 func1016_msg_ifwecontrolthebridge[] = { unset_chr_chrflag(CHR_BRIDGE2, CHRCFLAG_INVINCIBLE) unset_chr_chrflag(CHR_BRIDGE3, CHRCFLAG_INVINCIBLE) speak(CHR_P1P2, L_LEE_030, MP3_03DF, CHANNEL_6, COLOR_09_BLUE) // "If we control the bridge, then the ship is ours." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3271,7 +3271,7 @@ u8 func0422_cass[] = { endloop(LABEL_C2) label(0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3367,7 +3367,7 @@ u8 func141b_setup_lifts[] = { activate_lift(5, 0x29) activate_lift(6, 0x2a) activate_lift(7, 0x2b) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3390,7 +3390,7 @@ u8 func1017_pa_skedar_alertness[] = { label(0x2c) set_ailist(0x02, GAILIST_ALERTED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3413,7 +3413,7 @@ u8 func1012_update_elvis_target_chr[] = { set_chr_target_chr(CHR_ELVIS, CHR_BOND) endloop(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3424,7 +3424,7 @@ u8 func1012_update_elvis_target_chr[] = { u8 func1018_place_elvis_in_hangar[] = { label(0x04) if_difficulty_lt(DIFF_PA, /*goto*/ 0x03) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // A and SA beginloop(0x03) @@ -3432,7 +3432,7 @@ u8 func1018_place_elvis_in_hangar[] = { endloop(0x03) label(0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3460,7 +3460,7 @@ u8 func1002_hangar_shuttle[] = { label(0x06) disable_object(OBJ_HANGAR_SHUTTLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3473,7 +3473,7 @@ u8 func101a_kill_maian[] = { damage_chr(CHR_MAIAN3, WEAPON_SUPERDRAGON) yield damage_chr(CHR_MAIAN3, WEAPON_SUPERDRAGON) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3525,7 +3525,7 @@ u8 func101d_unlock_doors[] = { // All difficulties label(0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3537,7 +3537,7 @@ u8 func101e_bridge_music[] = { label(0x2c) play_x_track(XREASON_DEFAULT, 10, 60) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3596,7 +3596,7 @@ u8 func101f_enable_bridge_skedar[] = { enable_chr(CHR_BRIDGE3) enable_chr(CHR_BRIDGESPAWNER1) enable_chr(CHR_BRIDGESPAWNER2) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3604,7 +3604,7 @@ u8 func1020_engine_hum_noise[] = { yield assign_sound(SFX_81A5, CHANNEL_0) play_sound_from_object(CHANNEL_0, 0x1b, 1, 2000, 4000) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3635,7 +3635,7 @@ u8 func1021_check_ammo_wasted[] = { // Shields disabled label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3644,13 +3644,13 @@ u8 func1022_setup_rtracker[] = { yield set_object_flag3(OBJ_MAULER1, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(OBJ_MAULER2, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func040b_init_cass[] = { set_chr_maxdamage(CHR_SELF, 1) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3661,7 +3661,7 @@ u8 func1024_set_bridge_skedar_invincible[] = { set_chr_chrflag(CHR_BRIDGE1, CHRCFLAG_UNEXPLODABLE) set_chr_chrflag(CHR_BRIDGE2, CHRCFLAG_UNEXPLODABLE) set_chr_chrflag(CHR_BRIDGE3, CHRCFLAG_UNEXPLODABLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3677,14 +3677,14 @@ u8 unregistered_function1[] = { label(0x2c) set_chr_hiddenflag(CHR_BOND, CHRHFLAG_TRIGGER_BUDDY_WARP) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1423_setup_environment[] = { yield configure_environment(0x0000, AIENVCMD_SETAMBIENT, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3809,7 +3809,7 @@ u8 func1025_toggle_chrs[] = { endloop(0x09) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3824,19 +3824,19 @@ u8 func041f_cloak_and_remove[] = { label(0x2c) remove_chr(CHR_SELF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1026_hide_necklace[] = { yield if_difficulty_lt(DIFF_PA, /*goto*/ 0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // A and SA label(0x2c) disable_object(OBJ_NECKLACE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3844,7 +3844,7 @@ u8 func1026_hide_necklace[] = { u8 func0427_set_cloaked[] = { stop_chr set_chr_cloaked(CHR_SELF, TRUE, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setuplip.c b/src/ailists/setuplip.c index 790ebfafe..03e40c6f4 100644 --- a/src/ailists/setuplip.c +++ b/src/ailists/setuplip.c @@ -1104,7 +1104,7 @@ u8 func1007_check_disguise_collected[] = { label(LABEL_2D) set_stage_flag(STAGEFLAG_USED_DISGUISE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1113,7 +1113,7 @@ u8 func1026_check_records_destroyed[] = { if_object_in_good_condition(0x04, /*goto*/ 0x06) show_hudmsg(CHR_BOND, L_LIP_014) // "Research records destroyed." set_stage_flag(STAGEFLAG_RECORDS_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) endloop(0x04) @@ -1169,7 +1169,7 @@ u8 func1003_uplink_doors[] = { label(0x06) mute_channel(CHANNEL_5) if_object_in_good_condition(0x02, /*goto*/ LABEL_2D) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) assign_sound(SFX_01C1, CHANNEL_5) @@ -1246,7 +1246,7 @@ u8 func1004_uplink_lights[] = { label(0x06) mute_channel(CHANNEL_5) if_object_in_good_condition(0x01, /*goto*/ LABEL_2D) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) assign_sound(SFX_01C1, CHANNEL_5) @@ -1337,7 +1337,7 @@ u8 func1005_uplink_autoguns[] = { label(0x06) mute_channel(CHANNEL_5) if_object_in_good_condition(0x03, /*goto*/ LABEL_2D) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) assign_sound(SFX_01C1, CHANNEL_5) control_sound_from_object(CHANNEL_5, 0x00, TRUE) @@ -1378,7 +1378,7 @@ u8 func1006_check_lab_accessed[] = { label(0x06) show_hudmsg(CHR_P1P2, L_LIP_029) // "Laboratory accessed successfully." set_stage_flag(STAGEFLAG_ENTERED_LAB) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1499,7 +1499,7 @@ u8 func0411_labtech_showers_agent[] = { endloop(LABEL_64) label(LABEL_2D) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1541,7 +1541,7 @@ u8 func0410_labtech_showers_sa_pa[] = { label(0x06) say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) if_just_injured(CHR_SELF, /*goto*/ 0x06) @@ -1732,10 +1732,7 @@ u8 func0410_labtech_showers_sa_pa[] = { increase_squadron_alertness(100) stop_chr - beginloop(0x0c) - endloop(0x0c) - - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1800,7 +1797,7 @@ u8 func1009_disguise_timer[] = { label(LABEL_2D) stop_countdown_timer hide_countdown_timer - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Timer expired label(0x06) @@ -1819,7 +1816,7 @@ u8 func1009_disguise_timer[] = { show_hudmsg(CHR_BOND, L_LIP_047) // "The enemy has discovered the disguise." set_stage_flag(STAGEFLAG_DISGUISE_UNCOVERED) hide_countdown_timer - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1928,7 +1925,7 @@ u8 func0418_doorman[] = { label(0x06) say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(LABEL_2D) @@ -2081,7 +2078,7 @@ u8 func0418_doorman[] = { yield goto_first(LABEL_64) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2124,7 +2121,7 @@ u8 func100b_check_doorman_dead[] = { label(LABEL_2D) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) endloop(0x04) @@ -2150,7 +2147,7 @@ u8 func041a_labtech_harrysmate[] = { label(0x06) say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) if_just_injured(CHR_SELF, /*goto*/ 0x06) @@ -2249,7 +2246,7 @@ u8 func041b_labtech_keycardguy[] = { label(0x06) say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(LABEL_2D) @@ -2330,7 +2327,7 @@ u8 func100c_keycardguy_lights[] = { label(LABEL_2D) set_lights_state(0x0088, LIGHTOP_1, 0x64, 0x00, 0x00) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2349,7 +2346,7 @@ u8 func100d_check_entered_lab[] = { label(0x06) set_stage_flag(STAGEFLAG_ENTERED_LAB) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2375,12 +2372,12 @@ u8 func100e_elvis_timer[] = { hide_countdown_timer set_stage_flag(STAGEFLAG_ELVIS_DEAD) show_hudmsg(CHR_BOND, L_LIP_064) // "Elvis has been killed." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) stop_countdown_timer hide_countdown_timer - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2414,7 +2411,7 @@ u8 func100f_check_end_level[] = { label(LABEL_2D) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) set_ailist(CHR_SELF, AILIST_OUTRO) @@ -2423,7 +2420,7 @@ u8 func100f_check_end_level[] = { label(LABEL_5B) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2458,7 +2455,7 @@ u8 func1010_give_keycard[] = { label(LABEL_2D) unset_object_flag2(0x10, OBJFLAG2_INVISIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2475,7 +2472,7 @@ u8 func0413_mechanic[] = { label(0x06) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate restart_timer @@ -2486,7 +2483,7 @@ u8 func0413_mechanic[] = { label(0x06) say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) if_just_injured(CHR_SELF, /*goto*/ 0x06) @@ -2596,7 +2593,7 @@ u8 func1011_unhide_warehouse_spawner[] = { unset_chr_chrflag(0x44, CHRCFLAG_HIDDEN) unset_chr_chrflag(0x44, CHRCFLAG_INVINCIBLE) set_ailist(0x44, AILIST_WAREHOUSE_SPAWNER) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2640,7 +2637,7 @@ u8 func0415_warehouse_spawner[] = { yield endloop(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2662,7 +2659,7 @@ u8 func1013_check_chamber_switch_destroyed[] = { if_stage_flag_eq(STAGEFLAG_CHAMBER1_RAISED, TRUE, /*goto*/ LABEL_2D) show_hudmsg(CHR_BOND, L_LIP_068) // "Mission critical equipment destroyed." set_stage_flag(STAGEFLAG_CHAMBER_SWITCH_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) reloop(0x04) @@ -2671,7 +2668,7 @@ u8 func1013_check_chamber_switch_destroyed[] = { endloop(0x04) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2693,7 +2690,7 @@ u8 func1014_check_crate_destroyed[] = { yield yield if_object_in_good_condition(OBJ_WALL, /*goto*/ LABEL_2D) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) show_hudmsg(CHR_BOND, L_LIP_068) // "Mission critical equipment destroyed." @@ -2709,7 +2706,7 @@ u8 func1014_check_crate_destroyed[] = { label(LABEL_2E) unset_stage_flag(STAGEFLAG_CRATE_DESTROYED) show_hudmsg(CHR_BOND, L_LIP_089) // "Alternative entrance to medlabs created." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) endloop(0x04) @@ -2723,7 +2720,7 @@ u8 func1014_check_crate_destroyed[] = { u8 func041c_unused_041c[] = { set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN) set_chr_chrflag(CHR_SELF, CHRCFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2733,7 +2730,7 @@ u8 func041c_unused_041c[] = { u8 func041d_unused_041d[] = { set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN) set_chr_chrflag(CHR_SELF, CHRCFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2750,7 +2747,7 @@ u8 func041e_unused_041e[] = { set_shield(0) set_chr_chrflag(CHR_SELF, CHRCFLAG_INVINCIBLE) set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2767,7 +2764,7 @@ u8 func1016_check_undisguised[] = { label(0x06) unset_chr_hiddenflag(CHR_BOND, CHRHFLAG_DISGUISED) unset_chr_hiddenflag(CHR_COOP, CHRHFLAG_DISGUISED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2786,7 +2783,7 @@ u8 func041f_labtech_lights[] = { label(0x06) say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) if_just_injured(CHR_SELF, /*goto*/ 0x06) @@ -3004,7 +3001,7 @@ u8 func0420_labtech_doors[] = { label(0x06) say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) if_just_injured(CHR_SELF, /*goto*/ 0x06) @@ -3190,7 +3187,7 @@ u8 func1017_activate_autogun[] = { label(LABEL_2D) unset_object_flag(OBJ_AUTOGUN, OBJFLAG_DEACTIVATED) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3215,7 +3212,7 @@ u8 func0422_labtech_records[] = { label(0x06) say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) if_just_injured(CHR_SELF, /*goto*/ 0x06) goto_next(LABEL_5E) @@ -3349,7 +3346,7 @@ u8 func1018_disable_chambers[] = { set_object_flag(OBJ_CHAMBER6, OBJFLAG_DEACTIVATED) set_object_flag(OBJ_CHAMBER7, OBJFLAG_DEACTIVATED) set_object_flag(OBJ_CHAMBER8, OBJFLAG_DEACTIVATED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3649,7 +3646,7 @@ u8 func0424_alien[] = { u8 func0425_hiddenguy[] = { set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN) set_chr_chrflag(CHR_SELF, CHRCFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3713,7 +3710,7 @@ u8 func1021_xray_scanning[] = { label(0x06) show_hudmsg(CHR_P1P2, L_LIP_075) // "Target ID confirmed - XT origin." set_stage_flag(STAGEFLAG_XRAY_DONE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) show_hudmsg(CHR_P1P2, L_LIP_076) // "Scanner lock lost." @@ -3820,13 +3817,13 @@ u8 func1023_setup_door_locks[] = { if_difficulty_lt(DIFF_PA, /*goto*/ 0x09) // PA - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Agent - lock big door at bottom of ramp near showers label(0x06) lock_door(0x44, 0x80) lock_door(0x45, 0x80) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // SA - unlock the small shower doors label(0x09) @@ -3834,7 +3831,7 @@ u8 func1023_setup_door_locks[] = { unlock_door(0x2c, 0x80) unlock_door(0x2d, 0x80) unlock_door(0x2e, 0x80) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3941,7 +3938,7 @@ u8 func0c01_outro[] = { stop_cutscene_track stop_ambient_track end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4131,7 +4128,7 @@ u8 func1002_intro[] = { set_ailist(CHR_INTRO_DEAD_GUARD, GAILIST_IDLE) yield kill(CHR_INTRO_DEAD_GUARD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4141,7 +4138,7 @@ u8 func1024_noop[] = { endloop(0x04) label(0x03) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4208,7 +4205,7 @@ u8 func1025_toggle_guards[] = { set_ailist(0x30, AILIST_SUPERDRAGON_GUARD) set_ailist(0x31, AILIST_SUPERDRAGON_GUARD) set_ailist(0x32, AILIST_SUPERDRAGON_GUARD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4271,7 +4268,7 @@ u8 func0429_spawn_while_xraying[] = { endloop(0x04) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4349,7 +4346,7 @@ u8 func142d_start_lifts[] = { activate_lift(1, 0x35) activate_lift(4, 0x38) activate_lift(5, 0x39) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4434,17 +4431,17 @@ u8 func1027_check_disguise_worn[] = { set_ailist(0x20, AILIST_BECOME_UNAWARE) set_ailist(0x21, AILIST_BECOME_UNAWARE) set_ailist(0x22, AILIST_BECOME_UNAWARE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1028_toggle_mechanic[] = { if_savefile_flag_is_set(GAMEFILEFLAG_RESCUE_MECHANIC_DEAD, /*goto*/ 0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) disable_chr(CHR_MECHANIC) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4461,7 +4458,7 @@ u8 func1029_msg_showers[] = { label(LABEL_2D) speak(CHR_BOND, L_LIP_078, MP3_03BC, CHANNEL_6, COLOR_09_BLUE) // "The showers... Now, if I can convince someone to p..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4474,7 +4471,7 @@ u8 func102a_msg_temperaturedropping[] = { label(LABEL_2D) speak(CHR_BOND, L_LIP_079, SFX_8180, CHANNEL_6, COLOR_09_BLUE) // "The temperature's dropping... You must be close to..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4485,7 +4482,7 @@ u8 func102b_msg_airrecycled[] = { label(LABEL_2D) speak(CHR_BOND, L_LIP_080, MP3_03BE, CHANNEL_6, COLOR_09_BLUE) // "The air's heavily recycled around here - must be n..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4496,7 +4493,7 @@ u8 func102c_msg_hurry[] = { label(LABEL_2D) speak(CHR_BOND, L_LIP_081, SFX_8181, CHANNEL_6, COLOR_09_BLUE) // "There he is, Jo! Hurry or you'll be too late!" - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4518,7 +4515,7 @@ u8 func0416_become_unaware[] = { // Dying/dead label(0x0f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4535,7 +4532,7 @@ u8 unregistered_function2[] = { // Crate destroyed label(0x06) unset_object_flag(OBJ_WALL, OBJFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4554,7 +4551,7 @@ u8 func102f_shuffle_disguise[] = { disable_object(OBJ_LABCOAT2) disable_object(OBJ_LABCOAT3) disable_object(OBJ_LABCOAT4) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Rand < 51 (51 out of 256 chance) label(0x08) @@ -4562,7 +4559,7 @@ u8 func102f_shuffle_disguise[] = { disable_object(OBJ_LABCOAT3) disable_object(OBJ_LABCOAT4) disable_object(OBJ_LABCOAT5) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Rand >= 51 and < 102 (51 out of 256 chance) label(0x09) @@ -4570,7 +4567,7 @@ u8 func102f_shuffle_disguise[] = { disable_object(OBJ_LABCOAT3) disable_object(OBJ_LABCOAT4) disable_object(OBJ_LABCOAT5) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Rand >= 102 and < 153 (51 out of 256 chance) label(0x0a) @@ -4578,7 +4575,7 @@ u8 func102f_shuffle_disguise[] = { disable_object(OBJ_LABCOAT2) disable_object(OBJ_LABCOAT4) disable_object(OBJ_LABCOAT5) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Rand >= 153 and < 204 (51 out of 256 chance) label(0x0b) @@ -4586,7 +4583,7 @@ u8 func102f_shuffle_disguise[] = { disable_object(OBJ_LABCOAT2) disable_object(OBJ_LABCOAT3) disable_object(OBJ_LABCOAT5) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // A and SA label(0x0c) @@ -4595,7 +4592,7 @@ u8 func102f_shuffle_disguise[] = { disable_object(OBJ_LABCOAT3) disable_object(OBJ_LABCOAT4) disable_object(OBJ_LABCOAT5) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Unreachable label(0x0d) @@ -4603,7 +4600,7 @@ u8 func102f_shuffle_disguise[] = { disable_object(OBJ_LABCOAT2) disable_object(OBJ_LABCOAT4) disable_object(OBJ_LABCOAT5) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4649,7 +4646,7 @@ u8 func1031_toggle_doorman[] = { label(LABEL_2D) unset_chr_chrflag(CHR_DOORMAN, CHRCFLAG_HIDDEN) unset_chr_chrflag(CHR_DOORMAN, CHRCFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4682,7 +4679,7 @@ u8 func1032_count_last_room_guards[] = { label(0x06) if_morale_lt(3, /*goto*/ LABEL_2D) set_stage_flag(STAGEFLAG_ONE_KEYCARD_GUARD_REMAINING) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) endloop(0x04) @@ -4714,7 +4711,7 @@ u8 func1033_unset_untargetable_flag[] = { label(LABEL_2D) unset_chr_hiddenflag(CHR_P1P2, CHRHFLAG_UNTARGETABLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4723,7 +4720,7 @@ u8 func1034_setup_rtracker[] = { set_object_flag3(OBJ_FALCON2SILENCED1, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(OBJ_FALCON2SILENCED2, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(OBJ_PHOENIX, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4820,7 +4817,7 @@ u8 func1435_setup_environment[] = { configure_environment(0x010c, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x010d, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x010e, AIENVCMD_ROOM_SETAMBIENT, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4901,7 +4898,7 @@ u8 func1036_check_door_terminal_destroyed[] = { show_hudmsg(CHR_BOND, L_LIP_068) // "Mission critical equipment destroyed." set_stage_flag(STAGEFLAG_UPLINK_TERMINAL_DESTROYED) label(LABEL_2E) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_2D) endloop(0x0b) diff --git a/src/ailists/setuplue.c b/src/ailists/setuplue.c index 13a78ad53..1c1ec7814 100644 --- a/src/ailists/setuplue.c +++ b/src/ailists/setuplue.c @@ -937,10 +937,7 @@ u8 func0408_start_path07[] = { u8 func040b_stop_vehicle[] = { set_vehicle_speed(0, 1) - - beginloop(0x04) - endloop(0x04) - + terminate endlist }; @@ -977,7 +974,7 @@ u8 func140e_check_interceptors_destroyed[] = { if_stage_flag_eq(STAGEFLAG_INTERCEPTOR3_DESTROYED, FALSE, /*goto*/ 0x2e) show_hudmsg(CHR_BOND, L_LUE_020) // "All robot interceptors disabled." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) endloop(0x04) @@ -1071,17 +1068,17 @@ u8 func1400_give_bugs[] = { label(0x0a) \ set_stage_flag(STAGEFLAG_COMMSBUG_PLACED) \ show_hudmsg(chr, 0x2c1a) /* "Communications bug placed correctly." */ \ - set_ailist(CHR_SELF, GAILIST_IDLE) \ + terminate \ \ label(0x0b) \ if_stage_flag_eq(STAGEFLAG_ONE_BUG_WASTED, TRUE, /*goto*/ 0x2e) \ set_stage_flag(STAGEFLAG_ONE_BUG_WASTED) \ - set_ailist(CHR_SELF, GAILIST_IDLE) \ + terminate \ \ label(0x2e) \ set_stage_flag(STAGEFLAG_COMMSBUG_MISPLACED) \ show_hudmsg(chr, 0x2c1b) /* "Communications bug placed incorrectly." */ \ - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate /** * @unused @@ -1104,7 +1101,7 @@ u8 func1023_check_bug_wasted_coop[] = { label(0x2e) set_stage_flag(STAGEFLAG_ONE_BUG_WASTED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) check_bug_wasted(CHR_COOP) @@ -1116,7 +1113,7 @@ u8 func1004_check_antenna_destroyed[] = { if_object_in_good_condition(OBJ_ANTENNA, /*goto*/ 0x2e) show_hudmsg(CHR_BOND, L_LUE_028) // "Antenna has been destroyed." set_stage_flag(STAGEFLAG_ANTENNA_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) endloop(0x04) @@ -1287,7 +1284,7 @@ u8 func1007_check_hangar_accessed[] = { label(0x06) set_stage_flag(STAGEFLAG_HANGAR_ACCESSED) show_hudmsg(CHR_P1P2, L_LUE_039) // "Hangar has been accessed." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1316,12 +1313,12 @@ u8 func1008_check_end_level[] = { label(0x2e) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) set_invincible(CHR_BOND) set_ailist(CHR_SELF, AILIST_OUTRO) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1336,7 +1333,7 @@ u8 func1009_check_radar_shut_down[] = { show_hudmsg(CHR_BOND, L_LUE_041) // "Air intercept radar shut down." mute_channel(CHANNEL_0) set_stage_flag(STAGEFLAG_RADAR_SHUT_DOWN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1408,7 +1405,7 @@ u8 func100b_final_hangar[] = { label(0x0d) yield - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1605,7 +1602,7 @@ u8 func0417_traitor[] = { endloop(0x60) label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1616,7 +1613,7 @@ u8 func0416_mechanic[] = { label(0x2e) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) if_just_injured(CHR_SELF, /*goto*/ 0x2e) @@ -1717,7 +1714,7 @@ u8 func040a_top_interceptor[] = { beginloop(0x03) if_object_in_good_condition(OBJ_INTERCEPTOR3, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) if_stage_flag_eq(STAGEFLAG_TRIGGER_INTERCEPTOR, TRUE, /*goto*/ 0x06) endloop(0x03) @@ -1779,8 +1776,7 @@ u8 func040c_init_bottom_interceptors[] = { set_object_flag(OBJ_INTERCEPTOR1, OBJFLAG_CHOPPER_INACTIVE) set_object_flag(OBJ_INTERCEPTOR2, OBJFLAG_CHOPPER_INACTIVE) - beginloop(0x04) - endloop(0x04) + terminate endlist }; @@ -1930,7 +1926,7 @@ u8 func040e_outro[] = { remove_chr(CHR_OUTRO_GUARD) set_chr_hudpiece_visible(CHR_P1P2, FALSE) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2152,7 +2148,7 @@ u8 func0410_intro[] = { stop_ambient_track enter_firstperson set_stage_flag(STAGEFLAG_INTRO_FINISHED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2164,8 +2160,7 @@ u8 func0410_intro[] = { */ u8 func0418_walk_to_pad[] = { walk_to_pad(PAD_LUE_0019) - beginloop(0x09) - endloop(0x09) + terminate endlist }; @@ -2201,13 +2196,13 @@ u8 func1010_bunker_lighting[] = { label(0x2e) label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1012_bunker_laser1[] = { if_difficulty_gt(DIFF_A, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // SA and PA only label(0x2e) @@ -2240,13 +2235,13 @@ u8 func1012_bunker_laser1[] = { goto_first(0x0a) label(0x10) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1013_bunker_lasers234[] = { if_difficulty_gt(DIFF_A, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) restart_timer @@ -2282,13 +2277,13 @@ u8 func1013_bunker_lasers234[] = { goto_first(0x0a) label(0x10) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1013_bunker_lasers56[] = { if_difficulty_gt(DIFF_A, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) restart_timer @@ -2342,7 +2337,7 @@ u8 func1013_bunker_lasers56[] = { goto_first(0x0a) label(0x10) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2357,7 +2352,7 @@ u8 func1013_bunker_lasers[] = { disable_object(0x22) disable_object(0x23) disable_object(0x24) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // SA and PA label(0x03) @@ -2404,7 +2399,7 @@ u8 func1013_bunker_lasers[] = { open_door(0x22) open_door(0x23) open_door(0x24) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2547,7 +2542,7 @@ u8 func1011_bunker_explosives[] = { endloop(0x10) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2578,7 +2573,7 @@ u8 func1016_trigger_interceptor[] = { label(0x06) set_stage_flag(STAGEFLAG_TRIGGER_INTERCEPTOR) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2586,7 +2581,7 @@ u8 func1017_radar_terminal_noise[] = { yield assign_sound(SFX_8146, CHANNEL_0) play_sound_from_object(CHANNEL_0, OBJ_RADAR_TERMINAL, 1, 800, 1100) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2657,7 +2652,7 @@ u8 func1018_unhide_guards[] = { #endif set_ailist(0x23, AILIST_DRAGON_ALERTED) set_ailist(0x24, AILIST_DRAGON_ALERTED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2775,7 +2770,7 @@ u8 func1019_spawn_guards_at_antenna[] = { set_ailist(0x35, GAILIST_SEARCH_FOR_PLAYER) rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2842,7 +2837,7 @@ u8 func141f_start_lifts[] = { activate_lift(2, 0x31) activate_lift(3, 0x32) activate_lift(4, 0x33) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2856,7 +2851,7 @@ u8 func101a_check_mechanic_dead[] = { label(0x2e) set_savefile_flag(GAMEFILEFLAG_RESCUE_MECHANIC_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2872,7 +2867,7 @@ u8 func101b_msg_airinterceptradar[] = { label(0x2e) speak(CHR_P1P2, L_LUE_053, SFX_817D, CHANNEL_6, COLOR_09_BLUE) // "The air intercept radar is controlled from that bu..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2888,7 +2883,7 @@ u8 func101c_msg_cantthrow[] = { label(0x2e) speak(CHR_P1P2, L_LUE_054, MP3_03B9, CHANNEL_6, COLOR_09_BLUE) // "There's the antenna, but... I can't throw a bug th..." label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2908,7 +2903,7 @@ u8 func101d_msg_hangarlift[] = { label(0x2e) speak(CHR_P1P2, L_LUE_055, SFX_817E, CHANNEL_6, COLOR_09_BLUE) // "The hangar lift is on the other side of that huge ..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2920,7 +2915,7 @@ u8 func101e_msg_triggerfinger[] = { label(0x2e) speak(CHR_P1P2, L_LUE_056, SFX_817F, CHANNEL_6, COLOR_09_BLUE) // "Careful with that trigger finger, Agent Dark - you..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2985,11 +2980,11 @@ u8 func1020_choose_autogun_guard[] = { call_rng if_rand_gt(128, /*goto*/ 0x2e) set_ailist(0x00, AILIST_ACTIVATE_AUTOGUN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) set_ailist(0x01, AILIST_ACTIVATE_AUTOGUN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3002,7 +2997,7 @@ u8 func1021_damage_rl_guard[] = { damage_chr(CHR_ROCKETLAUNCHER_GUARD, WEAPON_SUPERDRAGON) yield damage_chr(CHR_ROCKETLAUNCHER_GUARD, WEAPON_SUPERDRAGON) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3020,7 +3015,7 @@ u8 func1022_check_lift_switches_destroyed[] = { endloop(0x04) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3112,7 +3107,7 @@ u8 func1025_spawn_bunker_guards[] = { label(0x06) label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3144,7 +3139,7 @@ u8 func0423_a5e8[] = { #define watch_for_laser_broken(crate1, crate2, laser) \ if_difficulty_gt(DIFF_A, /*goto*/ 0x7e) \ - set_ailist(CHR_SELF, GAILIST_IDLE) \ + terminate \ \ /* SA and PA */ \ beginloop(0x7e) \ @@ -3209,7 +3204,7 @@ u8 func0424_activate_lasers[] = { // A and SA label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3218,7 +3213,7 @@ u8 func0425_a7d4[] = { yield set_self_chrflag(CHRCFLAG_INVINCIBLE) set_self_chrflag(CHRCFLAG_UNEXPLODABLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3230,7 +3225,7 @@ u8 func041c_template_guard[] = { set_self_chrflag(CHRCFLAG_HIDDEN) set_self_chrflag(CHRCFLAG_INVINCIBLE) set_self_chrflag(CHRCFLAG_UNEXPLODABLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3250,14 +3245,14 @@ u8 func102d_check_antenna_switch_destroyed[] = { set_stage_flag(STAGEFLAG_ANTENNA_DESTROYED) label(0x2e) label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func102e_setup_rtracker[] = { yield set_object_flag3(OBJ_ROCKETLAUNCHER, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3307,7 +3302,7 @@ u8 func142f_setup_environment[] = { configure_environment(0x0020, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x0020, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x0017, AIENVCMD_ROOM_SETAMBIENT, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setupmp3.c b/src/ailists/setupmp3.c index ebf3c8015..7e3126fca 100644 --- a/src/ailists/setupmp3.c +++ b/src/ailists/setupmp3.c @@ -35,7 +35,7 @@ struct path paths[] = { u8 func1000_0038[] = { set_wind_speed(20) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setuppam.c b/src/ailists/setuppam.c index 3a8ac1600..fdc874bc6 100644 --- a/src/ailists/setuppam.c +++ b/src/ailists/setuppam.c @@ -723,8 +723,7 @@ u8 func0401_unused[] = { begin_hovercar_path(0x00) set_vehicle_speed(384, 120) - beginloop(0x04) - endloop(0x04) + terminate endlist }; @@ -764,7 +763,7 @@ u8 func0402_elvis_follow_and_reactive_teleportals[] = { // Dying label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) if_just_injured(CHR_SELF, /*goto*/ 0x2e) @@ -946,7 +945,7 @@ u8 func0404_elvis_follow_and_do_agent_megaweapon[] = { // Dying label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -1081,7 +1080,7 @@ u8 func0405_elvis_follow_nocombat[] = { // Dying label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -1157,7 +1156,7 @@ u8 func0406_elvis_follow_and_do_sa_megaweapon[] = { // Dying label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -1255,7 +1254,7 @@ u8 func0407_elvis_go_to_sa_teleport[] = { // Dying label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -1327,7 +1326,7 @@ u8 func0403_elvis_give_farsight[] = { // Dying label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -1985,11 +1984,11 @@ u8 func0c02_outro[] = { label(0x06) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2181,7 +2180,7 @@ u8 func1002_intro[] = { enter_firstperson yield set_ailist(CHR_ELVIS, AILIST_INIT_ELVIS) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2225,7 +2224,7 @@ u8 func1006_msg_thiswillhelpus[] = { label(0x2e) speak(CHR_P1P2, L_PAM_010, MP3_03D4, CHANNEL_6, COLOR_04_ORANGE) // "This will help us to get round the ship quicker." label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2241,7 +2240,7 @@ u8 func1007_msg_antibodymasking[] = { speak(CHR_BOND, L_PAM_011, MP3_03D5, CHANNEL_6, COLOR_09_BLUE) // "This antibody masking will protect us from the aut..." label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2267,7 +2266,7 @@ u8 func1008_msg_theresdrcaroll[] = { // Elvis dead, Dr Caroll dead, or Elvis didn't get teleported label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2288,7 +2287,7 @@ u8 func1009_msg_getoutofhere[] = { speak(CHR_BOND, L_PAM_013, MP3_03D7, CHANNEL_6, COLOR_04_ORANGE) // "We have to get out of here!" label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2418,7 +2417,7 @@ u8 func100a_bond_teleports[] = { goto_first(0x04) label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // // At Agent or PA teleport @@ -2456,7 +2455,7 @@ u8 func100a_bond_teleports[] = { label(0x2e) grant_control(CHR_BOND) teleport_to_pad(PAD_PAM_0000, CHR_BOND) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2494,7 +2493,7 @@ u8 func0414_teleport_bond_to_sapa[] = { label(0x61) set_ailist(CHR_ELVIS, AILIST_ELVIS_GIVE_FARSIGHT) label(0x62) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2536,7 +2535,7 @@ u8 func0415_teleport_bond_to_drcaroll[] = { set_ailist(CHR_ELVIS, AILIST_ELVIS_FOLLOW_AND_REACTIVATE_TELEPORTALS) label(0x62) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2592,7 +2591,7 @@ u8 func0416_teleport_bond_to_a_pa_drcaroll[] = { label(0x62) set_stage_flag(STAGEFLAG_TELEPORT_DONE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // SA label(0x08) @@ -2632,7 +2631,7 @@ u8 func0416_teleport_bond_to_a_pa_drcaroll[] = { label(0x61) set_ailist(CHR_ELVIS, AILIST_ELVIS_GIVE_FARSIGHT) label(0x62) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2652,7 +2651,7 @@ u8 func100b_coop_teleports[] = { goto_next(0x1f) label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x1f) if_stage_flag_eq(STAGEFLAG_TELEPORTALS_ACTIVATED, TRUE, /*goto*/ 0x04) @@ -2751,7 +2750,7 @@ u8 func100b_coop_teleports[] = { goto_first(0x04) label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // // At Agent or PA area teleport @@ -2794,7 +2793,7 @@ u8 func100b_coop_teleports[] = { label(0x2e) grant_control(CHR_COOP) teleport_to_pad(PAD_PAM_0000, CHR_COOP) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2833,7 +2832,7 @@ u8 func0417_teleport_coop_to_sapa[] = { set_ailist(CHR_ELVIS, AILIST_ELVIS_GIVE_FARSIGHT) label(0x62) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2873,7 +2872,7 @@ u8 func0418_teleport_coop_to_drcaroll[] = { label(0x61) set_ailist(CHR_ELVIS, AILIST_ELVIS_FOLLOW_AND_REACTIVATE_TELEPORTALS) label(0x62) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2926,7 +2925,7 @@ u8 func0419_teleport_coop_to_a_pa_drcaroll[] = { set_ailist(CHR_ELVIS, AILIST_ELVIS_FOLLOW_AND_REACTIVATE_TELEPORTALS) label(0x62) set_stage_flag(STAGEFLAG_TELEPORT_DONE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // SA label(0x08) @@ -2965,7 +2964,7 @@ u8 func0419_teleport_coop_to_a_pa_drcaroll[] = { label(0x61) set_ailist(CHR_ELVIS, AILIST_ELVIS_GIVE_FARSIGHT) label(0x62) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3137,10 +3136,10 @@ u8 func041d_sniper[] = { label(0x10) if_chr_has_hiddenflag(CHR_SELF, CHRHFLAG_CLOAKED, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) set_chr_cloaked(CHR_SELF, FALSE, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3190,7 +3189,7 @@ u8 func100c_countdown_timer[] = { set_stage_flag(STAGEFLAG_TIMER_EXPIRED) yield set_ailist(CHR_SELF, AILIST_OUTRO) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Player escaped label(0x2e) @@ -3213,14 +3212,14 @@ u8 func100c_countdown_timer[] = { // Both players dead label(0x2e) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Mission complete label(0x06) set_chr_chrflag(CHR_BOND, CHRCFLAG_INVINCIBLE) set_chr_chrflag(CHR_COOP, CHRCFLAG_INVINCIBLE) set_ailist(CHR_SELF, AILIST_OUTRO) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3232,7 +3231,7 @@ u8 func100e_check_elvis_dead[] = { label(0x2e) show_hudmsg(CHR_BOND, L_PAM_014) // "Elvis has been killed." set_stage_flag(STAGEFLAG_ALLY_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3244,7 +3243,7 @@ u8 func100f_check_drcaroll_dead[] = { label(0x2e) show_hudmsg(CHR_BOND, L_PAM_015) // "Dr. Caroll has been killed." set_stage_flag(STAGEFLAG_ALLY_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3305,7 +3304,7 @@ u8 func040f_miniskedar[] = { label(0x2e) say_quip(CHR_BOND, QUIP_GRENADE2, 0xff, 0x00, 0xff, BANK_0, 0x00, 0x00) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -3430,7 +3429,7 @@ u8 func1010_agent_hallway_spawner[] = { endloop(0x09) label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3440,13 +3439,13 @@ u8 func0411_hide[] = { #endif set_self_chrflag(CHRCFLAG_00040000) set_self_chrflag(CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func0412_unused[] = { set_chr_hiddenflag(CHR_SELF, CHRHFLAG_CLOAKED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3460,7 +3459,7 @@ u8 func0413_cloak_and_hide[] = { set_self_chrflag(CHRCFLAG_INVINCIBLE) set_self_chrflag(CHRCFLAG_00040000) set_self_chrflag(CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3589,19 +3588,19 @@ u8 func0408_check_pa_earlydoorcylinders_destroyed[] = { label(0x04) yield if_stage_flag_eq(STAGEFLAG_PA_EARLYDOORCYLINDER1_DESTROYED, TRUE, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) if_stage_flag_eq(STAGEFLAG_PA_EARLYDOORCYLINDER2_DESTROYED, TRUE, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) if_stage_flag_eq(STAGEFLAG_PA_EARLYDOORCYLINDER3_DESTROYED, TRUE, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) if_stage_flag_eq(STAGEFLAG_PA_EARLYDOORCYLINDER4_DESTROYED, TRUE, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) if_stage_flag_eq(STAGEFLAG_PA_EARLYDOORCYLINDER5_DESTROYED, TRUE, /*goto*/ 0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x08) if_door_state(0x09, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x06) @@ -3702,16 +3701,16 @@ u8 func0409_check_pa_latedoorcylinders_destroyed[] = { label(0x04) yield if_stage_flag_eq(STAGEFLAG_PA_LATEDOORCYLINDER1_DESTROYED, TRUE, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) if_stage_flag_eq(STAGEFLAG_PA_LATEDOORCYLINDER2_DESTROYED, TRUE, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) if_stage_flag_eq(STAGEFLAG_PA_LATEDOORCYLINDER3_DESTROYED, TRUE, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) if_stage_flag_eq(STAGEFLAG_PA_LATEDOORCYLINDER4_DESTROYED, TRUE, /*goto*/ 0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x08) if_door_state(0x0d, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x06) @@ -3838,10 +3837,10 @@ u8 func040a_check_pa_canisters_destroyed[] = { label(0x04) yield if_stage_flag_eq(STAGEFLAG_PA_CANISTER1_DESTROYED, TRUE, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2e) if_stage_flag_eq(STAGEFLAG_PA_CANISDER2_DESTROYED, TRUE, /*goto*/ 0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Both canisters destroyed label(0x2e) @@ -3908,7 +3907,7 @@ u8 func101f_pa_circleroom_spawner[] = { goto_first(0x1f) label(0x58) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3992,7 +3991,7 @@ u8 func1021_c6c4[] = { set_ailist(0x33, AILIST_INIT_MINISKEDAR) set_ailist(0x34, AILIST_INIT_MINISKEDAR) set_ailist(0x35, AILIST_INIT_MINISKEDAR) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4062,7 +4061,7 @@ u8 func1022_control_room[] = { label(0x2e) remove_chr(CHR_BLONDE1) remove_chr(CHR_BLONDE2) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // SA and PA beginloop(0x04) @@ -4081,7 +4080,7 @@ u8 func1022_control_room[] = { label(0x2e) show_hudmsg(CHR_P1P2, L_PAM_021) // "Control Room has been secured." set_stage_flag(STAGEFLAG_BLONDES_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4116,7 +4115,7 @@ u8 func1023_check_drcaroll_restored[] = { label(0x08) set_ailist(CHR_SELF, AILIST_MIDCUTSCENE) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4145,7 +4144,7 @@ u8 unregistered_function1[] = { label(0x06) set_chr_hiddenflag(CHR_ELVIS, CHRHFLAG_00020000) set_ailist(CHR_ELVIS, AILIST_ELVIS_FOLLOW_AND_REACTIVATE_TELEPORTALS) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4154,7 +4153,7 @@ u8 func1026_setup_autoguns[] = { set_autogun_target_team(0xa8, TEAM_ENEMY | TEAM_ALLY) set_autogun_target_team(0xa9, TEAM_ENEMY | TEAM_ALLY) set_autogun_target_team(0xaa, TEAM_ENEMY | TEAM_ALLY) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4168,7 +4167,7 @@ u8 func042e_elvis_run_to_exit[] = { // Dying label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -4259,7 +4258,7 @@ u8 func1027_powernode_illumination[] = { label(0x06) endloop(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4287,7 +4286,7 @@ u8 func1028_enable_last_3_guards[] = { set_ailist(0x3c, AILIST_RUN_TO_EXIT) set_ailist(0x3d, AILIST_RUN_TO_EXIT) set_ailist(0x3e, AILIST_RUN_TO_EXIT) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4309,7 +4308,7 @@ u8 func1429_start_lift[] = { if_coop_mode(/*goto*/ 0x45) activate_lift(1, 0x07) label(0x45) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4322,7 +4321,7 @@ u8 func102a_kill_pelagic_guard[] = { damage_chr(0x3f, WEAPON_SUPERDRAGON) yield damage_chr(0x3f, WEAPON_SUPERDRAGON) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4337,7 +4336,7 @@ u8 func102b_proxymines[] = { set_object_flag2(OBJ_PROXYMINES, OBJFLAG2_INVISIBLE) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4354,7 +4353,7 @@ u8 func102c_lock_doors[] = { // A and SA label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4391,24 +4390,13 @@ u8 func0432_dead_skedar[] = { yield chr_do_animation(ANIM_SKEDAR_COLLAPSE, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, 0x21, 2) label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) - endlist -}; - -u8 unregistered_function2[] = { - set_lights_state(0x0009, LIGHTOP_4, 0x00, 0xff, 0xfa) - - beginloop(0x08) - endloop(0x08) - - label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func102e_open_powernode_doors_on_agent[] = { if_difficulty_lt(DIFF_SA, /*goto*/ 0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Agent label(0x08) @@ -4419,7 +4407,7 @@ u8 func102e_open_powernode_doors_on_agent[] = { open_door(0x05) set_object_flag(0x05, OBJFLAG_DOOR_KEEPOPEN) label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4434,7 +4422,7 @@ u8 func042c_elvis_stop[] = { // his function will be reassigned if he takes damage between here and the // teleport. This causes him to not teleport. label(0x2e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4451,7 +4439,7 @@ u8 func102f_unlock_drcaroll_door[] = { unlock_door(0x76, 0x02) unset_object_flag2(0x75, OBJFLAG2_AICANNOTUSE) unset_object_flag2(0x76, OBJFLAG2_AICANNOTUSE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4464,7 +4452,7 @@ u8 func1030_unlock_agent_teleport_door[] = { label(0x2e) unlock_door(0xb7, 0x02) unlock_door(0xb8, 0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4488,7 +4476,7 @@ u8 func1031_unset_trigger_buddy_warp[] = { unset_chr_hiddenflag(CHR_BOND, CHRHFLAG_TRIGGER_BUDDY_WARP) endloop(0x08) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4518,14 +4506,14 @@ u8 unregistered_function3[] = { set_stage_flag(STAGEFLAG_SA_EXIT_TELEPORT_DISABLED) goto_first(0x1f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func1032_setup_rtracker[] = { yield set_object_flag3(OBJ_PROXYMINES, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4625,7 +4613,7 @@ u8 func1433_setup_environment[] = { configure_environment(0x006b, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x006c, AIENVCMD_ROOM_SETAMBIENT, TRUE) #endif - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4646,7 +4634,7 @@ u8 func1034_enable_blondes[] = { set_ailist(CHR_BLONDE1, AILIST_BLONDE) set_ailist(CHR_BLONDE2, AILIST_BLONDE) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4675,9 +4663,9 @@ u8 func102d_check_farsight_ammo_wasted[] = { label(0x2e) show_hudmsg(CHR_BOND, L_PAM_044) // "Ammo wasted - unable to disable megaweapon." set_stage_flag(STAGEFLAG_FARSIGHT_AMMO_WASTED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4685,7 +4673,7 @@ u8 unregistered_function4[] = { mp_init_simulants rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setuppete.c b/src/ailists/setuppete.c index b9d1387d5..4fe0e9053 100644 --- a/src/ailists/setuppete.c +++ b/src/ailists/setuppete.c @@ -642,7 +642,7 @@ u8 func0405_3d50[] = { stop_ambient_track set_stage_flag(STAGEFLAG_INTRO_FINISHED) enter_firstperson - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -777,14 +777,14 @@ u8 func100f_check_mine[] = { label(0x04) set_stage_flag(STAGEFLAG_MINE_WASTED) show_hudmsg(CHR_P1P2, L_PETE_072) // "Remote Mine has been wasted." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x07) set_stage_flag(STAGEFLAG_MINE_WASTED) show_hudmsg(CHR_P1P2, L_PETE_016) // "Mine placed incorrectly." label(0x0a) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -825,7 +825,7 @@ u8 func1026_uplink[] = { control_sound_from_object(CHANNEL_7, OBJ_TAXI, TRUE) yield set_stage_flag(STAGEFLAG_TAXI_REPROGRAMMED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Moved away while uplinking label(0x06) @@ -868,7 +868,7 @@ u8 func040d_limo[] = { // Wait for flag set, provided limo not destroyed beginloop(0x05) if_object_in_good_condition(OBJ_LIMO, /*goto*/ 0x03) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x03) if_stage_flag_eq(STAGEFLAG_LIMO_READY_TO_LEAVE, TRUE, /*goto*/ 0x04) @@ -898,7 +898,7 @@ u8 func040d_limo[] = { set_stage_flag(STAGEFLAG_LIMO_ESCAPED) show_hudmsg(CHR_BOND, L_PETE_028) // "DataDyne limo has escaped." label(0x03) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -926,7 +926,7 @@ u8 func040c_taxi[] = { // Check taxi healthy label(0x04) if_object_in_good_condition(OBJ_TAXI, /*goto*/ 0x03) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Take off label(0x03) @@ -943,7 +943,7 @@ u8 func040c_taxi[] = { // Check taxi healthy label(0x04) if_object_in_good_condition(OBJ_TAXI, /*goto*/ 0x03) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x03) set_stage_flag(STAGEFLAG_TAXI_READY_TO_CRASH) @@ -960,7 +960,7 @@ u8 func040c_taxi[] = { mute_channel(CHANNEL_0) object_do_animation(ANIM_0169, OBJ_TAXI, 0x04, 0xffff) label(0x0a) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -971,7 +971,7 @@ u8 func040c_taxi[] = { \ /* A or SA */ \ label(0x54) \ - set_ailist(CHR_SELF, GAILIST_IDLE) \ + terminate \ \ /* PA */ \ label(0x04) \ @@ -1008,7 +1008,7 @@ u8 func040c_taxi[] = { /* Check limo healthy */ \ label(0x04) \ if_object_in_good_condition(OBJ_LIMO, /*goto*/ 0x04) \ - set_ailist(CHR_SELF, GAILIST_IDLE) \ + terminate \ \ label(0x04) \ restart_timer \ @@ -1030,18 +1030,18 @@ u8 func040c_taxi[] = { \ label(0x04) \ set_stage_flag(STAGEFLAG_TRACERBUG_SAFE) \ - set_ailist(CHR_SELF, GAILIST_IDLE) \ + terminate \ \ /* Bug wasted */ \ label(0x07) \ if_stage_flag_eq(STAGEFLAG_ONE_BUG_REMAINING, TRUE, /*goto*/ 0x03) \ set_stage_flag(STAGEFLAG_ONE_BUG_REMAINING) \ - set_ailist(CHR_SELF, GAILIST_IDLE) \ + terminate \ \ label(0x03) \ set_stage_flag(STAGEFLAG_TRACERBUG_WASTED) \ show_hudmsg(chr, 0x3218) /* "Tracer Bug placed incorrectly." */ \ - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate u8 func1004_tracerbug_bond[] = { tracerbug_logic(CHR_BOND, CHR_BOND) @@ -1055,7 +1055,7 @@ u8 func1011_trackerbug_coop[] = { label(0x03) set_stage_flag(STAGEFLAG_ONE_BUG_REMAINING) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x04) tracerbug_logic(CHR_COOP, CHR_PRESET) @@ -1152,7 +1152,7 @@ u8 func1006_check_for_end[] = { label(0x12) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Objectives complete label(0x05) @@ -1165,11 +1165,11 @@ u8 func1006_check_for_end[] = { label(0x03) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x04) set_ailist(CHR_SELF, AILIST_OUTRO) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1216,7 +1216,7 @@ u8 func040d_limo_timing[] = { label(0x04) set_stage_flag(STAGEFLAG_LIMO_READY_15SEC_AGO) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1250,7 +1250,7 @@ u8 func040c_taxi_timing[] = { label(0x04) set_stage_flag(STAGEFLAG_TAXI_ALMOST_READY_TO_CRASH) unset_object_flag2(OBJ_TAXI, OBJFLAG2_04000000) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1261,7 +1261,7 @@ u8 func0412_cia[] = { goto_next(0x03) label(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x03) if_chr_idle(/*goto*/ 0x43) @@ -1526,7 +1526,7 @@ u8 func0413_bugspotter[] = { goto_next(0x03) label(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x03) @@ -1673,7 +1673,7 @@ u8 func0413_bugspotter[] = { set_self_flag_bankx(CHRFLAG0_SKIPSAFETYCHECKS, BANK_0) yield drop_gun_and_fade_out - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(LABEL_RUN_AWAY) jog_to_pad(PAD_PETE_004F) @@ -1684,7 +1684,7 @@ u8 func0413_bugspotter[] = { label(0x04) stop_chr - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1700,8 +1700,7 @@ u8 func0413_bugspotter[] = { start_patrol \ set_ailist(CHR_SELF, GAILIST_UNALERTED) \ \ - beginloop(0x04) \ - endloop(0x04) + terminate u8 func0414_start_path07[] = { init_patroller(0x07) @@ -1743,9 +1742,6 @@ u8 func0419_init_cia1[] = { start_patrol set_ailist(CHR_SELF, AILIST_CIA) - beginloop(0x04) - endloop(0x04) - endlist }; @@ -1755,7 +1751,7 @@ u8 func041d_fbi[] = { goto_next(0x03) label(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x03) if_num_times_shot_lt(1, /*goto*/ 0x19) @@ -1858,12 +1854,12 @@ u8 func041d_fbi[] = { \ /* Unreachable */ \ label(0x03) \ - set_ailist(CHR_SELF, GAILIST_IDLE) \ + terminate \ \ label(0x05) \ set_stage_flag(STAGEFLAG_CIVILIAN_DEAD) \ show_hudmsg(CHR_BOND, 0x321d) /* "Mission failed - unacceptable civilian casualties." */ \ - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate u8 func1009_check_cia1_dead[] = { check_cia_dead(CHR_CIA1) @@ -1881,12 +1877,12 @@ u8 func100a_check_cia2_dead[] = { // Stop checking this chr label(0x03) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x05) set_stage_flag(STAGEFLAG_CIVILIAN_DEAD) show_hudmsg(CHR_BOND, L_PETE_029) // "Mission failed - unacceptable civilian casualties." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2010,7 +2006,7 @@ u8 func041a_robot[] = { label(0x0c) assign_sound(MP3_ROBOT_ALERT_UNDER_ATTACK, CHANNEL_6) play_sound_from_entity(CHANNEL_6, CHR_SELF, 0x0bb8, 0x1770, 0x01) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x01) label(0x04) @@ -2031,7 +2027,7 @@ u8 func041a_robot[] = { goto_first(0x2d) label(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2287,7 +2283,7 @@ u8 func100d_spawn_alarm_responders[] = { goto_next(0x03) label(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Wait 15 seconds label(0x03) @@ -2349,7 +2345,7 @@ u8 func0420_jog_to_accident[] = { u8 func040a_intro_from_gameplay[] = { set_ailist(CHR_SELF, 0x040a) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2360,7 +2356,7 @@ u8 func101f_setup_robot_noise[] = { play_sound(SFX_80B9, CHANNEL_2) play_sound_from_object(CHANNEL_2, CHR_ROBOT, 0, 900, 1500) #endif - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2476,7 +2472,7 @@ u8 func1014_crash[] = { move_object_to_pad(OBJ_MINE2, PAD_PETE_001C) destroy_object(OBJ_MINE2) set_stage_flag(STAGEFLAG_CRASH_FINISHED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2716,7 +2712,7 @@ u8 func040b_outro[] = { mute_channel(CHANNEL_10) label(0x04) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2795,7 +2791,7 @@ u8 func1416_setup_rain[] = { u8 func041c_hiddenguy[] = { set_chr_chrflag(CHR_HIDDENGUY, CHRCFLAG_HIDDEN) set_chr_chrflag(CHR_HIDDENGUY, CHRCFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2819,7 +2815,7 @@ u8 func1017_drain_guards[] = { set_chr_hiddenflag(0x12, CHRHFLAG_00400000) set_ailist(0x11, GAILIST_ALERTED) set_ailist(0x12, GAILIST_ALERTED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2837,7 +2833,7 @@ u8 func1018_keep_door_open[] = { u8 func1019_setup_topstairs_death_animation[] = { set_chr_special_death_animation(CHR_TOPSTAIRS, SPECIALDIE_OVERRAILING) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2909,7 +2905,7 @@ u8 func101a_msg_onlyplace[] = { label(0x03) speak(CHR_P1P2, L_PETE_060, SFX_8179, CHANNEL_6, COLOR_09_BLUE) // "The only place we could secure the equipment was a..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2930,7 +2926,7 @@ u8 func101b_msg_blockedupdoors[] = { label(0x03) speak(CHR_P1P2, L_PETE_061, MP3_03B1, CHANNEL_6, COLOR_09_BLUE) // "Either of those blocked-up doors will do as an esc..." label(0x0a) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2955,7 +2951,7 @@ u8 func101c_msg_reprogramthattaxi[] = { label(0x03) speak(CHR_P1P2, L_PETE_062, SFX_817A, CHANNEL_6, COLOR_09_BLUE) // "Reprogram that taxi - it's a Mark 2 and should be ..." label(0x0a) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2967,7 +2963,7 @@ u8 func101d_msg_pointofingress[] = { label(0x03) speak(CHR_P1P2, L_PETE_063, SFX_817B, CHANNEL_6, COLOR_09_BLUE) // "That car park lift is your only point of ingress." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3003,7 +2999,7 @@ u8 func101e_check_sealer_guards_dead[] = { set_stage_flag(STAGEFLAG_DIVERSION_CREATED) label(0x03) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3021,7 +3017,7 @@ u8 func1020_elevator_doors[] = { label(0x03) close_door(0x10) close_door(0x11) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3042,7 +3038,7 @@ u8 func1021_check_topstairs_guy[] = { set_chr_special_death_animation(CHR_TOPSTAIRS, SPECIALDIE_NONE) unset_chr_chrflag(CHR_TOPSTAIRS, CHRCFLAG_HAS_SPECIAL_DEATH_ANIMATION) unset_chr_flag_bankx(CHR_TOPSTAIRS, CHRFLAG1_NOHANDCOMBAT, BANK_1) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3068,7 +3064,7 @@ u8 func040d_limo_flags[] = { beginloop(0x2d) if_object_in_good_condition(OBJ_LIMO, /*goto*/ 0x03) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x03) if_timer_gt(596, /*goto*/ 0x03) endloop(0x2d) @@ -3077,7 +3073,7 @@ u8 func040d_limo_flags[] = { disable_object(OBJ_LIMO) set_object_flag(OBJ_LIMO, OBJFLAG_INVINCIBLE) set_object_flag2(OBJ_LIMO, OBJFLAG2_INVISIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3145,7 +3141,7 @@ u8 func1423_setup_environment[] = { configure_environment(0x0066, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x0067, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x0068, AIENVCMD_ROOM_SETAMBIENT, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3176,7 +3172,7 @@ u8 func0412_cia_invincibility[] = { unset_chr_chrflag(CHR_CIA2, CHRCFLAG_INVINCIBLE) unset_chr_chrflag(CHR_CIA3, CHRCFLAG_INVINCIBLE) unset_chr_chrflag(CHR_CIA4, CHRCFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3187,7 +3183,7 @@ u8 func1025_rtracker[] = { set_object_flag3(0x23, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(0x24, OBJFLAG3_RTRACKED_BLUE) #endif - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3203,7 +3199,7 @@ u8 func1027_untrack_dumpster[] = { label(0x03) unset_object_flag3(OBJ_DUMPSTER, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; #endif diff --git a/src/ailists/setuprit.c b/src/ailists/setuprit.c index 874f7f022..958b36c4f 100644 --- a/src/ailists/setuprit.c +++ b/src/ailists/setuprit.c @@ -613,7 +613,7 @@ u8 func1024_give_objects[] = { give_object_to_chr(OBJ_DATAUPLINK_COOP, CHR_COOP) give_object_to_chr(OBJ_REMOTEMINE_COOP, CHR_COOP) label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -650,7 +650,7 @@ u8 func1004_reassign_ailists_during_conversation[] = { set_ailist(0x13, AILIST_BE_UNALERT) set_ailist(0x14, AILIST_BE_UNALERT) set_ailist(0x15, AILIST_BE_UNALERT) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -691,13 +691,13 @@ u8 func1005_check_neutrals_killed[] = { set_stage_flag(STAGEFLAG_KILLED_NEUTRALS) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func0401_init_stripes[] = { set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -705,7 +705,7 @@ u8 func0402_init_elvis[] = { set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN) set_self_chrflag(CHRCFLAG_INVINCIBLE) set_self_chrflag(CHRCFLAG_UNEXPLODABLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -851,7 +851,7 @@ u8 func1006_hijack[] = { rebuild_squadrons unset_chr_hiddenflag(CHR_BOND, CHRHFLAG_DISGUISED) unset_chr_hiddenflag(CHR_COOP, CHRHFLAG_DISGUISED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -890,7 +890,7 @@ u8 func0403_stripes[] = { }; u8 unregistered_function1[] = { - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -963,18 +963,18 @@ u8 unregistered_function1[] = { show_hudmsg(CHR_BOND, 0x3615) /* "UFO attachment damaged." */ \ set_stage_flag(STAGEFLAG_UFO_ATTACHMENT_DAMAGED) \ unset_stage_flag(STAGEFLAG_BOTH_MINES_WASTED) \ - set_ailist(CHR_SELF, GAILIST_IDLE) \ + terminate \ \ /* Mine wasted */ \ label(0x0a) \ set_stage_flag(myflag) \ if_stage_flag_eq(buddyflag, TRUE, /*goto*/ 0x2d) \ - set_ailist(CHR_SELF, GAILIST_IDLE) \ + terminate \ \ label(0x2d) \ show_hudmsg(CHR_BOND, 0x3645) /* "Timed mine has been wasted." */ \ set_stage_flag(STAGEFLAG_BOTH_MINES_WASTED) \ - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate u8 func1008_check_mine_wasted_bond[] = { check_mine_wasted(CHR_BOND, CHR_TARGET, STAGEFLAG_BOND_MINE_WASTED, STAGEFLAG_COOP_MINE_WASTED) @@ -986,7 +986,7 @@ u8 func1021_check_mine_wasted_coop[] = { goto_next(0x06) label(0x2d) set_stage_flag(STAGEFLAG_COOP_MINE_WASTED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) check_mine_wasted(CHR_COOP, CHR_COOP, STAGEFLAG_COOP_MINE_WASTED, STAGEFLAG_BOND_MINE_WASTED) @@ -1085,7 +1085,7 @@ u8 func101e_blow_mines[] = { disable_object(0x30) disable_object(0x31) disable_object(0x32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1109,7 +1109,7 @@ u8 func1009_check_end_level[] = { // Both players dead label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Redundant check label(0x06) @@ -1122,7 +1122,7 @@ u8 func1009_check_end_level[] = { label(0x2d) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Mission complete label(0x06) @@ -1164,13 +1164,13 @@ u8 func100a_autopilot_switch[] = { label(0x06) configure_environment(0x0000, AIENVCMD_STOPNOSEDIVE, 0) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Switch destroyed label(0x08) show_hudmsg(CHR_P1P2, L_RIT_025) // "Autopilot systems have been destroyed." set_stage_flag(STAGEFLAG_AUTOPILOT_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1188,7 +1188,7 @@ u8 func0405_president_in_room[] = { // Dying label(0x2d) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -1203,7 +1203,7 @@ u8 func0405_president_in_room[] = { // Dying label(0x2d) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x03) set_target_chr(CHR_PRESET) @@ -1328,8 +1328,8 @@ u8 func0405_president_in_room[] = { increase_squadron_alertness(100) try_face_entity(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ 0x0a) - beginloop(0x0a) - endloop(0x0a) + label(0x0a) + terminate label(0x06) @@ -1453,7 +1453,7 @@ u8 func0404_president_running[] = { assign_sound(MP3_02BF, CHANNEL_6) play_sound_from_entity(CHANNEL_6, CHR_SELF, 0x0bb8, 0x1770, 0x01) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x2d) @@ -1592,7 +1592,7 @@ u8 func0404_president_running[] = { set_chr_team(CHR_SELF, TEAM_NONCOMBAT) rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Player is in the entrance to Trent's room and both blondes are dead. // The intention behind this code is to make the president cower until the @@ -1623,7 +1623,7 @@ u8 func0404_president_running[] = { label(0x06) goto_first(0x55) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1635,7 +1635,7 @@ u8 func100b_check_president_dead[] = { label(0x06) set_stage_flag(STAGEFLAG_PRESIDENT_DEAD) show_hudmsg(CHR_BOND, L_RIT_026) // "The President has been incapacitated." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1813,7 +1813,7 @@ u8 func100c_cockpit[] = { // All objectives complete label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // UFO attachment damaged label(0x2e) @@ -1911,7 +1911,7 @@ u8 func100c_cockpit[] = { label(0x2d) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Unreachable label(0x7c) @@ -1920,7 +1920,7 @@ u8 func100c_cockpit[] = { set_stage_flag(STAGEFLAG_PLANE_STABILIZED) show_hudmsg(CHR_BOND, L_RIT_028) // "Pilots have been saved." stop_ambient_track - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Unreachable label(0x08) @@ -1928,7 +1928,7 @@ u8 func100c_cockpit[] = { // Plane stabilized or all objectives complete label(0x11) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2183,7 +2183,7 @@ u8 func1002_intro[] = { unset_chr_chrflag(CHR_PRESIDENT, CHRCFLAG_UNPLAYABLE) set_stage_flag(STAGEFLAG_INTRO_FINISHED) enter_firstperson - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2311,7 +2311,7 @@ u8 func040a_defend_pad[] = { // Dying label(0x2d) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -2461,7 +2461,7 @@ u8 func0415_cloner1[] = { // UFO attachment damaged label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2557,7 +2557,7 @@ u8 func0418_cloner2[] = { // UFO attachment damaged label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2649,7 +2649,7 @@ u8 func041b_cloner3[] = { endloop(0x04) label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2718,7 +2718,7 @@ u8 func041e_blonde[] = { label(0x06) say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive // This injured check is pointless @@ -2936,7 +2936,7 @@ u8 func0422_trent_running[] = { if_can_see_target(/*goto*/ 0x06) set_self_chrflag(CHRCFLAG_HIDDEN) remove_chr(CHR_SELF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) set_alertness(100) @@ -2965,7 +2965,7 @@ u8 func1012_check_blondes_dead[] = { // Both blondes dead label(0x2d) set_stage_flag(STAGEFLAG_BOTH_BLONDES_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2995,7 +2995,7 @@ u8 func1013_unhide_trent_and_blondes[] = { unset_chr_chrflag(CHR_TRENT, CHRCFLAG_HIDDEN) unset_chr_chrflag(CHR_BLONDE1, CHRCFLAG_HIDDEN) unset_chr_chrflag(CHR_BLONDE2, CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3028,7 +3028,7 @@ u8 func0429_be_unalert[] = { * The set_ailist at the start has effectively disabled this function. */ u8 func1014_uncover_disguise[] = { - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate restart_timer beginloop(0x04) @@ -3037,7 +3037,7 @@ u8 func1014_uncover_disguise[] = { label(0x06) set_chr_hiddenflag(CHR_BOND, CHRHFLAG_DISGUISE_UNCOVERED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3224,7 +3224,7 @@ u8 func0407_steward[] = { label(0x2d) mute_channel(CHANNEL_4) set_ailist(CHR_SELF, GAILIST_ALERTED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3241,7 +3241,7 @@ u8 func0408_stewardess[] = { goto_next(0x03) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Wait until alerted beginloop(0x03) @@ -3318,7 +3318,7 @@ u8 func1015_msg_retrievetheevidence[] = { label(0x2d) speak(CHR_BOND, L_RIT_046, MP3_03C8, CHANNEL_6, COLOR_09_BLUE) // "Now, let's retrieve the evidence." label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3336,7 +3336,7 @@ u8 func1016_msg_onthislevel[] = { label(0x2d) set_target_chr(CHR_PRESET) speak(CHR_TARGET, L_RIT_047, SFX_8185, CHANNEL_6, COLOR_09_BLUE) // "The President's room is on this level, Joanna." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3362,7 +3362,7 @@ u8 func1017_msg_gettothecockpit[] = { speak(CHR_BOND, L_RIT_048, SFX_8186, CHANNEL_5, COLOR_09_BLUE) // "Something's wrong... You have to get to the cockpi..." label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3381,7 +3381,7 @@ u8 func1018_msg_maybeamine[] = { speak(CHR_P1P2, L_RIT_049, MP3_03CB, CHANNEL_6, COLOR_09_BLUE) // "Maybe a mine will detach the UFO." label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3516,7 +3516,7 @@ u8 func0423_outro[] = { disable_object(0x1a) set_chr_hudpiece_visible(CHR_TARGET, FALSE) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3689,7 +3689,7 @@ u8 func101b_hoverbike_switch[] = { label(0x06) set_object_flag(0x1f, OBJFLAG_DEACTIVATED) set_object_image(OBJ_HOVERBIKE_SWITCH, 0, TVCMDLIST_12) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3706,7 +3706,7 @@ u8 func101c_check_equipment_switch_destroyed[] = { set_stage_flag(STAGEFLAG_EQUIPMENT_SWITCH_DESTROYED) show_hudmsg(CHR_BOND, L_RIT_062) // "Mission critical object has been destroyed." label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3850,7 +3850,7 @@ u8 func042c_remove_if_offscreen[] = { chr_drop_weapon(CHR_SELF) remove_chr(CHR_SELF) yield - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) set_ailist(CHR_SELF, AILIST_INIT_DEFEND_PAD) @@ -3881,7 +3881,7 @@ u8 func101d_handle_early_president_death[] = { label(0x2d) set_stage_flag(STAGEFLAG_PRESIDENT_STARTED_RUNNING) unlock_door(OBJ_COCKPITDOOR, 0x40) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3890,7 +3890,7 @@ u8 func1007_check_pod_destroyed[] = { if_object_in_good_condition(OBJ_ESCAPE_POD, /*goto*/ 0x2d) show_hudmsg(CHR_BOND, L_RIT_062) // "Mission critical object has been destroyed." set_stage_flag(STAGEFLAG_POD_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2d) endloop(0x04) @@ -3901,7 +3901,7 @@ u8 func101f_setup_rtracker[] = { yield set_object_flag3(0x38, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(0x39, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3932,8 +3932,8 @@ u8 func1420_setup_environment[] = { configure_environment(0x0042, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x0043, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x0059, AIENVCMD_ROOM_SETAMBIENT, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate + terminate endlist }; @@ -3967,7 +3967,7 @@ u8 func1022_pilots_stabilizing[] = { set_stage_flag(STAGEFLAG_PLANE_STABILIZED) label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3986,7 +3986,7 @@ u8 func1023_check_pilots_dead[] = { label(0x2d) set_stage_flag(STAGEFLAG_PILOTS_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4019,7 +4019,7 @@ u8 func1025_disable_buddy_warp[] = { yield yield unset_chr_hiddenflag(CHR_BOND, CHRHFLAG_TRIGGER_BUDDY_WARP) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -4043,7 +4043,7 @@ u8 func1026_buddy_floor_hatch[] = { disable_object(OBJ_FLOORHATCH) set_object_flag(OBJ_FLOOR_HATCH_DETACHED, OBJFLAG_00000100) unset_object_flag2(OBJ_FLOOR_HATCH_DETACHED, OBJFLAG2_INVISIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setupsev.c b/src/ailists/setupsev.c index 6b8a710ef..0281312de 100644 --- a/src/ailists/setupsev.c +++ b/src/ailists/setupsev.c @@ -1148,7 +1148,7 @@ u8 func100d_start_lifts[] = { activate_lift(1, 0x35) activate_lift(4, 0x38) activate_lift(5, 0x39) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1157,7 +1157,7 @@ u8 func1003_check_experiment_destroyed[] = { if_object_in_good_condition(OBJ_EXPERIMENT, /*goto*/ 0x2c) show_hudmsg(CHR_BOND, L_SEV_007) // "Medical experiment has been sabotaged." set_stage_flag(STAGEFLAG_EXPERIMENT_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) endloop(0x04) @@ -1169,7 +1169,7 @@ u8 func1004_check_saucer_destroyed[] = { if_object_in_good_condition(0x3e, /*goto*/ 0x2c) show_hudmsg(CHR_BOND, L_SEV_008) // "Captured Maian saucer has been destroyed." set_stage_flag(STAGEFLAG_SAUCER_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) endloop(0x04) @@ -1180,7 +1180,7 @@ u8 func1005_check_experiment_destroyed_pointless[] = { // This is a pointless function beginloop(0x04) if_object_in_good_condition(OBJ_EXPERIMENT, /*goto*/ 0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) endloop(0x04) @@ -1198,7 +1198,7 @@ u8 func1006_activate_alarm[] = { label(0x2c) activate_alarm set_stage_flag(STAGEFLAG_ALARM_SOUNDED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1326,7 +1326,7 @@ u8 func1007_disable_pods[] = { set_object_flag(0x1f, OBJFLAG_DEACTIVATED) set_object_flag(0x20, OBJFLAG_DEACTIVATED) set_object_flag(0x21, OBJFLAG_DEACTIVATED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1353,13 +1353,13 @@ u8 func1008_check_console[] = { play_sound_from_object(CHANNEL_0, OBJ_CONSOLE, 1, 300, 400) show_hudmsg(CHR_BOND, L_SEV_009) // "Distress signal has been sent." set_stage_flag(STAGEFLAG_CONSOLE_ACTIVATED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Console destroyed label(0x08) show_hudmsg(CHR_BOND, L_SEV_010) // "Critical mission object has been destroyed." set_stage_flag(STAGEFLAG_CONSOLE_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1390,13 +1390,13 @@ u8 func1009_check_for_exit[] = { // Both players dead label(0x2c) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // At least one player survived label(0x06) set_ailist(CHR_SELF, AILIST_OUTRO) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1509,7 +1509,7 @@ u8 func100b_check_medlab_escapable[] = { // Glass broken label(0x0d) unset_stage_flag(STAGEFLAG_TRAPPED_AT_START) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x0e) if_chr_in_room(CHR_BOND, 0x00, 0x0095, /*goto*/ 0x2c) @@ -1585,7 +1585,7 @@ u8 func1002_intro[] = { stop_cutscene_track stop_ambient_track enter_firstperson - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1640,14 +1640,14 @@ u8 func041b_outro[] = { label(0x87) label(0x06) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func0419_init_outro_guard[] = { set_self_chrflag(CHRCFLAG_HIDDEN) set_self_chrflag(CHRCFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1655,7 +1655,7 @@ u8 func100c_unset_trolley_flag_when_destroyed[] = { beginloop(0x04) if_object_in_good_condition(OBJ_TROLLEY, /*goto*/ 0x2c) unset_object_flag3(OBJ_TROLLEY, OBJFLAG3_PUSHABLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) endloop(0x04) @@ -1842,7 +1842,7 @@ u8 func100f_init_lighting[] = { configure_environment(0x0088, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x0089, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x008a, AIENVCMD_ROOM_SETAMBIENT, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1888,7 +1888,7 @@ u8 func1010_unload_part1_chrs[] = { set_ailist(0x1f, AILIST_UNLOAD) set_ailist(0x20, AILIST_UNLOAD) set_ailist(0x21, AILIST_UNLOAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1909,7 +1909,7 @@ u8 func0414_unload[] = { chr_drop_weapon(CHR_SELF) remove_chr(CHR_SELF) label(0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) set_ailist(CHR_SELF, GAILIST_UNALERTED) endlist diff --git a/src/ailists/setupsho.c b/src/ailists/setupsho.c index 60cc92613..17c1631e9 100644 --- a/src/ailists/setupsho.c +++ b/src/ailists/setupsho.c @@ -523,7 +523,7 @@ u8 func0402_unarmed_skedar[] = { endloop(0x11) label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate #define LABEL_HANDLE_PHOENIX_AREA 0x5a #define LABEL_HANDLE_WALL_AREA 0x5b @@ -688,7 +688,7 @@ u8 func0402_unarmed_skedar[] = { set_self_flag_bankx(CHRFLAG0_GP1, BANK_0) goto_first(0x03) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -741,7 +741,7 @@ u8 func0404_miniskedar[] = { endloop(0x11) label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x06) @@ -859,7 +859,7 @@ u8 func0407_init_cloaked_skedar[] = { // Remove self label(0x2d) remove_chr(CHR_SELF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate yield endloop(0x04) @@ -898,7 +898,7 @@ u8 func0408_cloaked_skedar[] = { // King is dead label(0x0e) remove_chr(CHR_SELF) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -952,7 +952,7 @@ u8 unregistered_function3[] = { endloop(0x08) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -993,7 +993,7 @@ u8 func1003_remove_random_skedar[] = { remove_random(0x11, 0x12) remove_random(0x13, 0x14) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1003,7 +1003,7 @@ u8 func101a_pointless[] = { endloop(0x04) label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1051,7 +1051,7 @@ u8 func100c_check_army_defeated[] = { label(0x2d) unset_object_flag2(0x45, OBJFLAG2_LOCKEDFRONT) unset_object_flag2(0x46, OBJFLAG2_LOCKEDBACK) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1287,7 +1287,7 @@ u8 func1007_bug_throws_bond[] = { set_stage_flag(STAGEFLAG_BUG_WASTED) show_hudmsg(CHR_BOND, L_SHO_026) // "Target Amplifier placed incorrectly." label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x0f) goto_first(0x03) @@ -1301,7 +1301,7 @@ u8 func101b_bug_throws_coop[] = { label(0x2d) set_stage_flag(STAGEFLAG_COOP_BUGS_WASTED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate beginloop(0x03) if_stage_flag_eq(STAGEFLAG_COOP_THREW_FIRST_BUG, FALSE, /*goto*/ 0x55) @@ -1398,7 +1398,7 @@ u8 func101b_bug_throws_coop[] = { show_hudmsg(CHR_COOP, L_SHO_026) // "Target Amplifier placed incorrectly." label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x0f) goto_first(0x03) @@ -1412,14 +1412,14 @@ u8 func1008_lock_door[] = { // A label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // SA and PA label(0x04) yield lock_door(0x09, 0x02) lock_door(0x0a, 0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1529,7 +1529,7 @@ u8 func1009_altar[] = { if_difficulty_lt(DIFF_SA, /*goto*/ 0x2d) show_hudmsg(CHR_P1P2, L_SHO_027) // "Generator has been reactivated." label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1574,7 +1574,7 @@ u8 func101c_setup_corridor_lighting[] = { set_lights_state(0x007e, LIGHTOP_1, 0x06, 0x00, 0x00) set_lights_state(0x007f, LIGHTOP_1, 0x06, 0x00, 0x00) yield - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // The rest of this function is unreachable restart_timer @@ -1618,7 +1618,7 @@ u8 func101c_setup_corridor_lighting[] = { set_lights_state(0x007f, LIGHTOP_3, 0x06, 0xff, 0x78) goto_first(0x59) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1653,7 +1653,7 @@ u8 func0409_reaper_slayer_skedar[] = { label(0x06) say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alive label(0x2d) @@ -1831,7 +1831,7 @@ u8 func100a_army_room[] = { set_lights_state(0x0087, LIGHTOP_3, 0x06, 0xff, 0x78) set_stage_flag(STAGEFLAG_TRIGGER_SKEDAR_ARMY) play_x_track(XREASON_DEFAULT, 10, 60) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate goto_first(0x04) endlist @@ -1846,7 +1846,7 @@ u8 func100b_check_sanctum_accessed[] = { label(0x2d) show_hudmsg(CHR_P1P2, L_SHO_028) // "Skedar Inner Sanctum has been reached." set_stage_flag(STAGEFLAG_ACCESSED_SANCTUM) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1871,7 +1871,7 @@ u8 func040b_mauler_skedar[] = { set_shotlist(GAILIST_COMBAT_WITH_TARGET) set_returnlist(CHR_SELF, GAILIST_COMBAT_WITH_TARGET) set_ailist(CHR_SELF, GAILIST_COMBAT_WITH_TARGET) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1898,7 +1898,7 @@ u8 func100e_wake_skedar_army[] = { enable_army_skedar(0x32, 0x0e) enable_army_skedar(0x30, 0x0f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2472,12 +2472,12 @@ u8 func1014_spike_top[] = { label(0x2d) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) set_invincible(CHR_BOND) set_ailist(CHR_SELF, AILIST_OUTRO) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2485,24 +2485,24 @@ u8 func040f_update_spike_stageflags[] = { if_stage_flag_eq(STAGEFLAG_SPIKE1_DESTROYED, TRUE, /*goto*/ 0x09) set_stage_flag(STAGEFLAG_SPIKE1_DESTROYED) set_stage_flag(STAGEFLAG_SPIKE_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x09) if_stage_flag_eq(STAGEFLAG_SPIKE2_DESTROYED, TRUE, /*goto*/ 0x0b) set_stage_flag(STAGEFLAG_SPIKE2_DESTROYED) set_stage_flag(STAGEFLAG_SPIKE_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x0b) if_stage_flag_eq(STAGEFLAG_SPIKE3_DESTROYED, TRUE, /*goto*/ 0x0c) set_stage_flag(STAGEFLAG_SPIKE3_DESTROYED) set_stage_flag(STAGEFLAG_SPIKE_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x0c) set_stage_flag(STAGEFLAG_SPIKE4_DESTROYED) set_stage_flag(STAGEFLAG_SPIKE_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2766,7 +2766,7 @@ u8 func0c00_intro[] = { stop_cutscene_track stop_ambient_track enter_firstperson - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2956,14 +2956,14 @@ u8 func0414_outro[] = { stop_cutscene_track stop_ambient_track end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func0413_hide[] = { set_self_chrflag(CHRCFLAG_INVINCIBLE) set_self_chrflag(CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3009,7 +3009,7 @@ u8 func1015_msg_specialpillars[] = { label(0x2d) speak(CHR_P1P2, L_SHO_030, MP3_03E0, CHANNEL_6, COLOR_09_BLUE) // "This seems to be one of the special pillars." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3023,7 +3023,7 @@ u8 func1016_msg_powersmoreconstant[] = { label(0x2d) speak(CHR_P1P2, L_SHO_031, MP3_03E1, CHANNEL_6, COLOR_09_BLUE) // "The power's more constant in this area. The Inner ..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3035,7 +3035,7 @@ u8 func1017_msg_skedararmy[] = { label(0x2d) speak(CHR_P1P2, L_SHO_032, MP3_03E2, CHANNEL_6, COLOR_09_BLUE) // "OH, NO!!! A Skedar army in suspended animation!" - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3054,7 +3054,7 @@ u8 func1018_msg_cutoffthehead[] = { label(0x2d) speak(CHR_P1P2, L_SHO_033, MP3_03E3, CHANNEL_6, COLOR_09_BLUE) // "Okay, this is it... Cut off the head and the body ..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3125,7 +3125,7 @@ u8 func1019_blow_pillars[] = { yield yield yield - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3139,7 +3139,7 @@ u8 func1004_setup_pillars[] = { set_object_flag(OBJ_PILLAR1, OBJFLAG_INVINCIBLE) set_object_flag(OBJ_PILLAR2, OBJFLAG_INVINCIBLE) set_object_flag(OBJ_PILLAR3, OBJFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3154,13 +3154,13 @@ u8 func101d_remove_pillar_shadow[] = { disable_object(0x3e) unset_object_flag2(0x4e, OBJFLAG2_INVISIBLE) unset_object_flag2(0x4f, OBJFLAG2_INVISIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2d) endloop(0x04) // Unreachable - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3556,7 +3556,7 @@ u8 func1020_show_phoenix[] = { unset_object_flag2(OBJ_PHOENIX1, OBJFLAG2_INVISIBLE) unset_object_flag(OBJ_PHOENIX2, OBJFLAG_UNCOLLECTABLE) unset_object_flag2(OBJ_PHOENIX2, OBJFLAG2_INVISIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2d) endloop(0x04) @@ -3576,7 +3576,7 @@ u8 func1021_handle_mine[] = { // A label(0x2d) destroy_object(OBJ_REMOTEMINE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3597,7 +3597,7 @@ u8 func1022_armyroom_exitdoors[] = { // All difficulties label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3611,7 +3611,7 @@ u8 unregistered_function1[] = { label(0x2d) chr_drop_weapon(CHR_BOND) show_hudmsg(CHR_BOND, L_SHO_026) // "Target Amplifier placed incorrectly." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3648,7 +3648,7 @@ u8 func1024_check_grenades_wasted[] = { label(0x2d) if_object_in_good_condition(0x4d, /*goto*/ 0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) label(0x2d) @@ -3664,7 +3664,7 @@ u8 func1024_check_grenades_wasted[] = { // Blown up using other means (eg. Phoenix or all guns cheat) unset_stage_flag(STAGEFLAG_GRENADES_WASTED) show_hudmsg(CHR_BOND, L_SHO_053) // "Alternative entrance to Shrine created." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2d) if_stage_flag_eq(STAGEFLAG_GRENADES_WASTED, TRUE, /*goto*/ 0x2d) @@ -3680,7 +3680,7 @@ u8 func1023_setup_rtracker[] = { yield set_object_flag3(OBJ_PHOENIX1, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(OBJ_PHOENIX2, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3821,7 +3821,7 @@ u8 func1427_setup_environment[] = { configure_environment(0x0036, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x0037, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x0038, AIENVCMD_ROOM_SETOUTDOORS, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3849,7 +3849,7 @@ u8 func1025_unlock_doors_for_buddy[] = { // Buddy doesn't exist label(0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3860,7 +3860,7 @@ u8 func1025_unlock_doors_for_buddy[] = { u8 func1426_setup_portals[] = { yield set_portal_flag(0x0072, PORTALFLAG_FORCEOPEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3886,14 +3886,14 @@ u8 func1028_buddybridge[] = { // This flag is set by global ailists label(0x2d) if_stage_flag_eq(STAGEFLAG_AI_BUDDY_EXISTS, FALSE, /*goto*/ 0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Flag not set - so this is solo mode // Remove the bridge and barricade over the first ravine label(0x2d) disable_object(OBJ_BUDDYBRIDGE) disable_object(OBJ_BUDDYBARRICADE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setupstat.c b/src/ailists/setupstat.c index e8045ae5e..f31dccf11 100644 --- a/src/ailists/setupstat.c +++ b/src/ailists/setupstat.c @@ -349,7 +349,7 @@ u8 func0401_defend[] = { // Dying label(0x2d) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Not dying - go to pad label(0x06) @@ -490,7 +490,7 @@ u8 func1003_spawn_maians[] = { yield rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -649,7 +649,7 @@ u8 func1004_spawn_king1_skedar[] = { yield rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -733,9 +733,9 @@ u8 func1008_spawn_king2_skedar[] = { yield rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -803,9 +803,9 @@ u8 func100c_spawn_king3_skedar[] = { yield rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -900,7 +900,7 @@ u8 func1005_check_leader_dead[] = { label(0x2d) show_hudmsg(CHR_BOND, L_STAT_007) // "Maian leader has been killed." set_stage_flag(STAGEFLAG_LEADER_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -916,7 +916,7 @@ u8 func1009_check_king1_dead[] = { set_stage_flag(STAGEFLAG_KING1_DEAD) unlock_door(0x3e, 0x40) unlock_door(0x3f, 0x40) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -932,7 +932,7 @@ u8 func100a_check_king2_dead[] = { show_hudmsg(CHR_BOND, L_STAT_008) // "Skedar King has been killed." set_stage_flag(STAGEFLAG_KING2_DEAD) label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -948,7 +948,7 @@ u8 func100b_check_king3_dead[] = { show_hudmsg(CHR_BOND, L_STAT_008) // "Skedar King has been killed." set_stage_flag(STAGEFLAG_KING3_DEAD) label(0x0e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -979,12 +979,12 @@ u8 func1007_check_end_level[] = { // Mission failed label(0x2d) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Mission complete label(0x06) set_ailist(CHR_SELF, AILIST_OUTRO) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -992,7 +992,7 @@ u8 func040c_hide[] = { label(0x03) set_self_chrflag(CHRCFLAG_INVINCIBLE) set_self_chrflag(CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1038,10 +1038,10 @@ u8 unregistered_function[] = { // Remove Blonde if counterop doesn't exist label(0x03) if_chr_death_animation_finished(CHR_ANTI, /*goto*/ 0x2d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2d) remove_chr(CHR_BLONDE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1196,7 +1196,7 @@ u8 func040b_outro[] = { label(0x06) mute_channel(CHANNEL_10) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1226,7 +1226,7 @@ u8 func100f_blow_mines[] = { destroy_object(OBJ_MINE5) wait(0x93) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1355,7 +1355,7 @@ u8 func1010_init_lighting[] = { configure_environment(0x0058, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x0059, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x0059, AIENVCMD_ROOM_SETOUTDOORS, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setuptra.c b/src/ailists/setuptra.c index 4fad1578b..be7119bf2 100644 --- a/src/ailists/setuptra.c +++ b/src/ailists/setuptra.c @@ -638,7 +638,7 @@ u8 func1023_gas_damage_coop[] = { set_ailist(CHR_SELF, AILIST_GAS_DAMAGE) label(0x32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -699,7 +699,7 @@ u8 func0401_gas_damage[] = { goto_first(0x08) label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -752,7 +752,7 @@ u8 func1004_jon_msgs_gravedanger[] = { endloop(0x0c) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -790,7 +790,7 @@ u8 func1005_jon_msgs_meetup[] = { label(0x06) set_stage_flag(STAGEFLAG_JON_SAID_MAINT_HATCH) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -802,7 +802,7 @@ u8 func1007_check_medpack_collected[] = { label(0x06) set_stage_flag(STAGEFLAG_COLLECTED_MEDPACK) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -831,7 +831,7 @@ u8 func0402_jonathan_waiting_for_meetup[] = { goto_next(0x67) label(0x32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x67) set_self_flag_bankx(CHRFLAG0_CAMP, BANK_0) @@ -900,7 +900,7 @@ u8 func0404_jonathan_following_and_mine[] = { goto_next(0x06) label(0x32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Unreachable if_stage_flag_eq(STAGEFLAG_JON_FINISHED_EXPLOSIVES, TRUE, /*goto*/ 0x32) @@ -1069,7 +1069,7 @@ u8 func0404_jonathan_following_and_mine[] = { label(0x06) goto_first(LABEL_FOLLOW) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1080,7 +1080,7 @@ u8 func0413_jonathan_hangar[] = { goto_next(0x06) label(0x32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x32) if_just_injured(CHR_SELF, /*goto*/ 0x06) @@ -1369,7 +1369,7 @@ u8 func041c_elvis_go_to_ufo[] = { goto_next(0x06) label(0x32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) run_to_pad(PAD_TRA_03FE) @@ -1381,8 +1381,7 @@ u8 func041c_elvis_go_to_ufo[] = { label(0x06) stop_chr - beginloop(0x6a) - endloop(0x6a) + terminate endlist }; @@ -1394,7 +1393,7 @@ u8 func041b_jonathan_after_terminals[] = { goto_next(0x06) label(0x32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) run_to_pad(PAD_TRA_015F) // conversation corner @@ -1539,7 +1538,7 @@ u8 func1008_spawngroup1[] = { yield rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1614,7 +1613,7 @@ u8 func1013_spawngroup2[] = { yield rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1669,7 +1668,7 @@ u8 func1014_spawngroup3[] = { // Agent - do nothing label(0x32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // SA and PA beginloop(0x04) @@ -1733,7 +1732,7 @@ u8 func1014_spawngroup3[] = { label(0x06) set_stage_flag(STAGEFLAG_TRIGGER_MEDPACK_FINISH) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1814,7 +1813,7 @@ u8 func1015_spawngroup4[] = { yield rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1863,7 +1862,7 @@ u8 func1009_blow_up_wall[] = { yield destroy_object(OBJ_WALLMINE) set_stage_flag(STAGEFLAG_WALL_EXPLODED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1876,7 +1875,7 @@ u8 func100a_check_hangar_accessed[] = { label(0x06) set_stage_flag(STAGEFLAG_ENTERED_HANGAR) show_hudmsg(CHR_P1P2, L_TRA_031) // "The secret hangar has been located." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1905,7 +1904,7 @@ u8 func100b_check_jonathan_dead[] = { set_stage_flag(STAGEFLAG_JON_DEAD) label(0x32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1989,7 +1988,7 @@ u8 func100c_medpack_activation[] = { // Jonathan is dead label(0x32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2004,7 +2003,7 @@ u8 func0412_init_elvis[] = { add_health_or_armor(200) set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, AILIST_ELVIS_FOLLOW) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2056,8 +2055,7 @@ u8 func040b_elvis_follow[] = { label(0x08) stop_chr - beginloop(0x09) - endloop(0x09) + terminate endlist }; @@ -2144,7 +2142,7 @@ u8 func100d_check_terminals_destroyed[] = { label(0x08) show_hudmsg(CHR_BOND, L_TRA_036) // "Mission critical object destroyed." set_stage_flag(STAGEFLAG_HANGAR_TERMINAL_DESTROYED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2158,7 +2156,7 @@ u8 func100e_check_elvis_dead[] = { set_stage_flag(STAGEFLAG_ELVIS_DEAD) show_hudmsg(CHR_BOND, L_TRA_030) // "Elvis has been killed." label(0x32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2217,7 +2215,7 @@ u8 func1010_check_end_level[] = { // Both Joanna and Velvet are dead label(0x33) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Mission complete label(0x06) @@ -2230,7 +2228,7 @@ u8 func1010_check_end_level[] = { // Jonathan and/or Elvis are dead label(0x0f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2246,7 +2244,7 @@ u8 func1011_unlock_doors_when_jo_escaping[] = { unlock_door(0x09, 0x04) unlock_door(0x1d, 0x40) unlock_door(0x1e, 0x40) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2316,14 +2314,14 @@ u8 func1012_hoverbike_auto_doors[] = { open_door(0x05) endloop(0x04) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func040c_hidden_guardtype1[] = { set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN) set_chr_chrflag(CHR_SELF, CHRCFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2375,7 +2373,7 @@ u8 func1016_enable_guards_after_meetup[] = { set_ailist(0x16, AILIST_INIT_SUPERDRAGON_GUARD) rebuild_teams rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2391,14 +2389,14 @@ u8 func1017_check_both_hangar_doors_open[] = { label(0x32) show_hudmsg(CHR_BOND, L_TRA_053) // "The hangar doors are now open." set_stage_flag(STAGEFLAG_BOTH_HANGAR_DOORS_OPEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; u8 func040d_hidden_guardtype2[] = { set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN) set_chr_chrflag(CHR_SELF, CHRCFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2447,7 +2445,7 @@ u8 func1018_unhide_guards_when_jo_escaping[] = { unlock_door(0x1a, 0x40) unlock_door(0x1b, 0x40) unlock_door(0x1c, 0x40) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2455,7 +2453,7 @@ u8 func040e_hidden_biotech[] = { label(0x04) set_self_chrflag(CHRCFLAG_HIDDEN) set_self_chrflag(CHRCFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2477,7 +2475,7 @@ u8 func1019_enable_biotechs_after_stash[] = { unset_chr_chrflag(0x28, CHRCFLAG_HIDDEN) unset_chr_chrflag(0x28, CHRCFLAG_INVINCIBLE) set_ailist(0x28, AILIST_INIT_BIOTECH) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2807,7 +2805,7 @@ u8 func1002_intro[] = { yield kill(0x23) kill(0x24) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3020,7 +3018,7 @@ u8 func101b_gas_sound[] = { yield assign_sound(SFX_816A, CHANNEL_0) play_sound_from_object(CHANNEL_0, 0x2b, 1, 8000, 3000) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3110,7 +3108,7 @@ u8 func0c02_outro[] = { stop_countdown_timer unset_savefile_flag(GAMEFILEFLAG_DEFENSE_JON) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3142,8 +3140,8 @@ u8 func0415_ufo_exit[] = { configure_environment(0x0000, AIENVCMD_STOPUFOHUM, 0) stop_ambient_track disable_object(OBJ_UFO1) - set_ailist(CHR_SELF, GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate + terminate endlist }; @@ -3205,12 +3203,12 @@ u8 func1021_jo_escaping[] = { label(0x69) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Unreachable end_level end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3263,7 +3261,7 @@ u8 func0416_spawn_during_follow[] = { endloop(0x04) label(0x32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3325,7 +3323,7 @@ u8 func101a_medpack_switch[] = { set_stage_flag(STAGEFLAG_MEDPACK_SWITCH_DESTROYED) show_hudmsg(CHR_BOND, L_TRA_036) // "Mission critical object destroyed." label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x32) if_chr_activated_object(CHR_P1P2, OBJ_MEDPACK_SWITCH, /*goto*/ 0x32) @@ -3337,7 +3335,7 @@ u8 func101a_medpack_switch[] = { show_hudmsg(CHR_P1P2, L_TRA_054) // "Medical containment doors unlocked." unlock_door(0x12, 0x40) unlock_door(0x13, 0x40) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3359,7 +3357,7 @@ u8 unregistered_function1[] = { label(0x32) set_ailist(CHR_JONATHAN, 0x040f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3378,7 +3376,7 @@ u8 func040f_warp_jon_to_catwalk[] = { yield set_ailist(CHR_JONATHAN, AILIST_JONATHAN_FOLLOWING_AND_MINE) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3398,7 +3396,7 @@ u8 func101d_msg_medpackaroundhere[] = { label(0x32) speak(CHR_P1P2, L_TRA_055, MP3_03C0, CHANNEL_6, COLOR_09_BLUE) // "The medpack's got to be somewhere around here." label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3416,7 +3414,7 @@ u8 func101e_msg_hookup[] = { label(0x32) speak(CHR_BOND, L_TRA_056, MP3_03C1, CHANNEL_6, COLOR_09_BLUE) // "Time to hook up with Jonathan, before he gets into..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3441,7 +3439,7 @@ u8 func101f_msg_oil[] = { label(0x32) speak(CHR_P1P2, L_TRA_057, MP3_03C2, CHANNEL_6, COLOR_09_BLUE) // "That smell... oil... I smelt that in the other han..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3458,7 +3456,7 @@ u8 func1020_msg_jetbike[] = { label(0x32) speak(CHR_BOND, L_TRA_058, MP3_03C3, CHANNEL_6, COLOR_09_BLUE) // "The jetbike should get me out before they lock the..." - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3473,7 +3471,7 @@ u8 func1024_wall_immune_to_explosives[] = { label(0x32) unset_object_flag(OBJ_WALLOBJECT, OBJFLAG_INVINCIBLE) unset_object_flag(OBJ_WALLDOOR, OBJFLAG_INVINCIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3494,11 +3492,11 @@ u8 func1024_wall_immune_to_explosives[] = { \ label(0x06) \ set_object_flag(OBJ_MEDPACK_GLASS, OBJFLAG_INVINCIBLE) \ - set_ailist(CHR_SELF, GAILIST_IDLE) \ + terminate \ label(0x32) \ endloop(0x04) \ \ - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate u8 unregistered_function2[] = { set_object_flag(OBJ_MEDPACK_GLASS, OBJFLAG_INVINCIBLE) @@ -3552,7 +3550,7 @@ u8 func1026_ufo_spinning[] = { label(0x32) goto_first(0x03) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3595,7 +3593,7 @@ u8 func102e_keep_hangar_doors_open[] = { // Terminal destroyed label(0x0f) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3607,12 +3605,12 @@ u8 func102f_toggle_remotemines[] = { endloop(0x08) label(0x32) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x06) unset_object_flag(OBJ_REMOTEMINES, OBJFLAG_UNCOLLECTABLE) unset_object_flag2(OBJ_REMOTEMINES, OBJFLAG2_INVISIBLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3620,13 +3618,13 @@ u8 func1030_setup_medpack_glass[] = { if_difficulty_gt(DIFF_A, /*goto*/ 0x32) unset_object_flag(OBJ_MEDPACK_GLASS, OBJFLAG_INVINCIBLE) destroy_object(OBJ_MEDPACK_GLASS) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // SA and PA label(0x32) unlock_door(0x3c, 0x40) unlock_door(0x3d, 0x40) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3639,7 +3637,7 @@ u8 func1031_disable_chambers[] = { set_object_flag(0x4b, OBJFLAG_DEACTIVATED) set_object_flag(0x4c, OBJFLAG_DEACTIVATED) set_object_flag(0x4d, OBJFLAG_DEACTIVATED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3651,7 +3649,7 @@ u8 func1032_unlock_door_after_hangar[] = { label(0x06) unlock_door(0x0a, 0x02) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3660,7 +3658,7 @@ u8 func1032_unlock_door_after_hangar[] = { */ u8 func1433_start_lift[] = { activate_lift(1, 0x4e) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3669,7 +3667,7 @@ u8 func101c_setup_rtracker[] = { set_object_flag3(OBJ_FALCON2SCOPE1, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(OBJ_FALCON2SCOPE2, OBJFLAG3_RTRACKED_BLUE) set_object_flag3(OBJ_REMOTEMINES, OBJFLAG3_RTRACKED_BLUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -3823,7 +3821,7 @@ u8 func1434_setup_environment[] = { configure_environment(0x010d, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x010e, AIENVCMD_ROOM_SETAMBIENT, TRUE) configure_environment(0x00cb, AIENVCMD_ROOM_SETAMBIENT, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; diff --git a/src/ailists/setupwax.c b/src/ailists/setupwax.c index 633cc5e69..f5f9afbc1 100644 --- a/src/ailists/setupwax.c +++ b/src/ailists/setupwax.c @@ -1030,37 +1030,7 @@ u8 func0401_init_hovercar[] = { begin_hovercar_path(0x00) set_vehicle_speed(0x0c00, 120) - beginloop(0x04) - endloop(0x04) - - // Everything below here in this function is unreachable - label(0x08) - set_vehicle_speed(0x0600, 120) - goto_first(0x04) - - label(0x09) - set_vehicle_speed(0x0700, 120) - goto_first(0x04) - - label(0x0a) - set_vehicle_speed(0x0800, 120) - goto_first(0x04) - - label(0x0b) - set_vehicle_speed(0x0900, 120) - goto_first(0x04) - - label(0x0c) - set_vehicle_speed(0x0a00, 120) - goto_first(0x04) - - label(0x0d) - set_vehicle_speed(0x0b00, 120) - goto_first(0x04) - - label(0x0e) - set_vehicle_speed(0x0d00, 120) - goto_first(0x04) + terminate endlist }; @@ -1298,7 +1268,7 @@ u8 func0411_cass_in_office[] = { // Dying label(0x2c) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Not dying label(0x06) @@ -1333,7 +1303,7 @@ u8 func0411_cass_in_office[] = { if_chr_knockedout(CHR_CASS, /*goto*/ 0x06) goto_next(0x2c) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) chr_do_animation(ANIM_TALKING_00A0, 0, 193, CHRANIMFLAG_COMPLETED | CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2) @@ -1406,7 +1376,7 @@ u8 func0413_cass_running[] = { // Dying label(0x06) set_shotlist(GAILIST_IDLE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Not dying label(0x2c) @@ -1489,7 +1459,7 @@ u8 func0413_cass_running[] = { yield #endif - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1502,7 +1472,7 @@ u8 func1004_check_cass_dead[] = { label(0x2c) show_hudmsg(CHR_BOND, L_WAX_014) // "Cassandra has been immobilized." set_stage_flag(STAGEFLAG_CASS_DEAD) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1513,7 +1483,7 @@ u8 func1005_check_cass_captured[] = { if_chr_y(CHR_CASS, 0, OPERATOR_LESS_THAN, /*goto*/ 0x2c) show_hudmsg(CHR_BOND, L_WAX_015) // "Cassandra has been captured successfully." set_stage_flag(STAGEFLAG_CASS_CAPTURED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Cass is not at helipad label(0x2c) @@ -1521,7 +1491,7 @@ u8 func1005_check_cass_captured[] = { // Died label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1530,7 +1500,7 @@ u8 func1006_lift_disabling[] = { if_difficulty_lt(DIFF_PA, /*goto*/ 0x06) goto_next(0x2c) label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Disable chief's lift label(0x2c) @@ -1575,7 +1545,7 @@ u8 func1006_lift_disabling[] = { label(0x2c) unset_object_flag(OBJ_CHIEF_LIFT, OBJFLAG_DEACTIVATED) unset_object_flag(OBJ_BLONDE_LIFT, OBJFLAG_DEACTIVATED) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1588,7 +1558,7 @@ u8 func0414_init_chief[] = { set_shield(0) set_morale(0) set_self_chrflag(CHRCFLAG_HIDDEN) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1599,7 +1569,7 @@ u8 func0415_chief[] = { if_chr_deadish(CHR_CHIEF, /*goto*/ 0x2c) goto_next(0x03) label(0x2c) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Wait until player in sight beginloop(0x03) @@ -1659,7 +1629,7 @@ u8 func100f_disable_chiefs_lift[] = { // A or SA - return label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1730,7 +1700,7 @@ u8 func1007_bomb_logic[] = { label(0x2c) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1746,7 +1716,7 @@ u8 func1008_check_bomb_unplantable[] = { // Bomb planted - return label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Alarm active - lock door and wait for door to be closed or bomb planted label(0x2c) @@ -1776,7 +1746,7 @@ u8 func1008_check_bomb_unplantable[] = { // Difficulty is agent or bomb has been planted - return label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate label(0x2c) endloop(0x04) @@ -1855,7 +1825,7 @@ u8 func1009_toggle_top_guards[] = { enable_chr(0x06) yield enable_chr(0x05) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -1889,14 +1859,14 @@ u8 func100a_check_for_completion[] = { // Both players dead label(0x2c) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // At least one player is alive label(0x06) set_ailist(CHR_SELF, AILIST_OUTRO) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate // Player not at helipad label(0x2d) @@ -1908,7 +1878,7 @@ u8 func100a_check_for_completion[] = { u8 func100b_start_lifts[] = { activate_lift(2, 0x55) activate_lift(1, 0x56) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2027,7 +1997,7 @@ u8 func0416_intro[] = { stop_cutscene_track stop_ambient_track enter_firstperson - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2064,7 +2034,7 @@ u8 func0417_outro[] = { label(0x06) end_level - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2098,7 +2068,7 @@ u8 func100e_cass_speech[] = { label(0x06) set_stage_flag(STAGEFLAG_CASS_SAID_YWSM) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2136,7 +2106,7 @@ u8 func1010_init_lighting[] = { configure_environment(0x00a4, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x00a5, AIENVCMD_ROOM_SETOUTDOORS, TRUE) configure_environment(0x00a7, AIENVCMD_ROOM_SETOUTDOORS, TRUE) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2160,7 +2130,7 @@ u8 func1011_shuttle_animation[] = { // Unreachable label(0x06) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; @@ -2195,7 +2165,7 @@ u8 func1012_chief_lift[] = { // A or SA - return label(0x0d) - set_ailist(CHR_SELF, GAILIST_IDLE) + terminate endlist }; #endif diff --git a/src/game/chrai.c b/src/game/chrai.c index b715748eb..0cb89e5d7 100644 --- a/src/game/chrai.c +++ b/src/game/chrai.c @@ -146,3 +146,32 @@ void chraiExecute(void *entity, s32 proptype) } } } + +void aiTerminateCleanup(void) +{ + if (g_Vars.chrdata) { + g_Vars.chrdata->ailist = NULL; + + if (g_Vars.chrdata->model == NULL) { + // It's a BG chr (1xxx script). + // Remove ourselves from the BG chrs array and shift the later ones back. + s32 myindex = -1; + s32 i; + + for (i = 0; i < g_NumBgChrs; i++) { + if (g_Vars.chrdata == &g_BgChrs[i]) { + myindex = i; + break; + } + } + + if (myindex >= 0) { + for (i = myindex + 1; i < g_NumBgChrs; i++) { + g_BgChrs[i - 1] = g_BgChrs[i]; + } + + g_NumBgChrs--; + } + } + } +} diff --git a/src/game/chraiasm.s b/src/game/chraiasm.s index 4d0cbb877..ecdf88bb2 100644 --- a/src/game/chraiasm.s +++ b/src/game/chraiasm.s @@ -33,6 +33,8 @@ glabel aiYield addiu $sp, $sp, 0x28 glabel aiTerminate + jal aiTerminateCleanup + nop move $v0, $zero lw $ra, 0x20($sp) jr $ra diff --git a/src/include/commands.h b/src/include/commands.h index 6af0902a9..cab672231 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -821,6 +821,9 @@ object, \ label, +#define terminate \ + mkshort(0x0065), \ + /** * Destroys the given object. * diff --git a/src/setups/mp_setupmp14.c b/src/setups/mp_setupmp14.c index 236cc3993..2ba9b58fb 100644 --- a/src/setups/mp_setupmp14.c +++ b/src/setups/mp_setupmp14.c @@ -32,11 +32,3 @@ s32 intro[] = { struct path paths[] = { { NULL, 0, 0 }, }; - -u8 unregistered_func1[] = { - mp_init_simulants - rebuild_teams - rebuild_squadrons - set_ailist(CHR_SELF, GAILIST_IDLE) - endlist -}; diff --git a/tools/ai2asm/ai2asm.py b/tools/ai2asm/ai2asm.py index 859378a33..be18b1a10 100755 --- a/tools/ai2asm/ai2asm.py +++ b/tools/ai2asm/ai2asm.py @@ -1399,8 +1399,6 @@ class App(): self.emit('beqz', ['$v0', label]) self.emit('jr', ['$v0']) self.emit_raw('%s:' % label) - self.emit('move', ['$a0', '$zero']) - self.emit('jal', ['aiSetMyList']) self.emit('jal', ['aiTerminate']) def ai_revoke_control(self, params): @@ -1818,6 +1816,9 @@ class App(): self.emit('li', ['$a0', params[2]]) self.emit('jal', ['aiChrEndTeleport']) + def ai_terminate(self, params): + self.emit('jal', ['aiTerminate']) + def ai_try_attack_amount(self, params): self.emit('li', ['$a0', params[0]]) self.emit('li', ['$a1', params[1]]) diff --git a/tools/ai2asm/commands.py b/tools/ai2asm/commands.py index d9effdaa1..139c062f4 100644 --- a/tools/ai2asm/commands.py +++ b/tools/ai2asm/commands.py @@ -85,6 +85,7 @@ def get_commands(): commands[0x0062] = {'macro': 'if_object_in_good_condition', 'len': 4} commands[0x0063] = {'macro': 'if_chr_activated_object', 'len': 5} commands[0x0064] = {'macro': 'if_any_objective_failed', 'len': 3} + commands[0x0065] = {'macro': 'terminate', 'len': 2} commands[0x0066] = {'macro': 'destroy_object', 'len': 3} commands[0x0068] = {'macro': 'drop_concealed_items', 'len': 3} commands[0x0069] = {'macro': 'chr_drop_weapon', 'len': 3}