mirror of
https://gitlab.com/ryandwyer/perfect-dark
synced 2026-08-19 05:22:21 -04:00
Decompile aiIncreaseSquadronAlertness
This commit is contained in:
@@ -1782,7 +1782,7 @@ u8 func0414_programmer[] = {
|
||||
|
||||
label(0xa7)
|
||||
speak(CHR_TARGET, 0x0226, 0x8108, CHANNEL_3, COLOR_03_RED) // "HELP, HELP!"
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
endloop(0x99)
|
||||
|
||||
label(LABEL_JO_SPEAK)
|
||||
@@ -3766,7 +3766,7 @@ u8 func042f_surrendering_guard[] = {
|
||||
label(0x57)
|
||||
dprint 'W','A','R','N',' ','F','R','I','E','N','D','S','\n',0,
|
||||
say_quip(CHR_BOND, 0x10, 0xff, 0x02, 0xff, BANK_0, 0x00, 0x00) // "Intruder alert!","We've got trouble","We've got problems"
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
|
||||
// No chr in same group, or follow through from above
|
||||
// Wait until player in range and then surrender.
|
||||
|
||||
@@ -1788,7 +1788,7 @@ u8 func0409_tech_conversation[] = {
|
||||
if_stage_flag_eq(STAGEFLAG_TECHS_RUNNING, TRUE, /*goto*/ 0x00)
|
||||
set_stage_flag(STAGEFLAG_TECHS_RUNNING)
|
||||
label(0x00)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
open_door(0x04)
|
||||
restart_timer
|
||||
speak(CHR_TARGET, 0x062a, 0x811f, CHANNEL_7, COLOR_06_WHITE) // "Oh, no...too late."
|
||||
@@ -1869,7 +1869,7 @@ u8 func040a_tech2[] = {
|
||||
if_stage_flag_eq(STAGEFLAG_TECHS_RUNNING, TRUE, /*goto*/ 0x00)
|
||||
set_stage_flag(STAGEFLAG_TECHS_RUNNING)
|
||||
label(0x00)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
open_door(0x04)
|
||||
yield
|
||||
restart_timer
|
||||
|
||||
@@ -1299,7 +1299,7 @@ u8 func0418_robot[] = {
|
||||
|
||||
// Alerted
|
||||
label(0x0d)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
restart_timer
|
||||
if_distance_to_target_lt(300, /*goto*/ 0x31)
|
||||
if_distance_to_target_gt(1000, /*goto*/ 0x15)
|
||||
|
||||
@@ -1236,7 +1236,7 @@ u8 func0407_stewardess[] = {
|
||||
|
||||
label(0x02)
|
||||
speak(CHR_TARGET, 0x0e19, 0x1adc, CHANNEL_4, COLOR_07_RED) // "Look out - it's an intruder..."
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
chr_do_animation(ANIM_SURRENDER_002E, 0, 193, 0x10, 0x10, CHR_SELF, 2)
|
||||
|
||||
beginloop(0x06)
|
||||
@@ -1544,7 +1544,7 @@ u8 func0408_secretary[] = {
|
||||
speak(CHR_TARGET, 0x0e20, 0x8162, CHANNEL_4, COLOR_06_WHITE) // "Oh, my God!"
|
||||
|
||||
label(0x67)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
restart_timer
|
||||
chr_do_animation(ANIM_SURRENDER_002E, 0, 193, 0x18, 0x10, CHR_SELF, 2)
|
||||
|
||||
@@ -2130,7 +2130,7 @@ u8 func0409_office1[] = {
|
||||
label(0x02)
|
||||
speak(CHR_TARGET, 0x0e2a, 0x1ae7, CHANNEL_4, COLOR_08_RED) // "Hey - give me back my case."
|
||||
restart_timer
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
|
||||
beginloop(0x0a)
|
||||
if_timer_gt(120, /*goto*/ 0x02)
|
||||
@@ -2153,7 +2153,7 @@ u8 func0409_office1[] = {
|
||||
label(0x72)
|
||||
label(0x02)
|
||||
speak(CHR_TARGET, 0x0e28, 0x1ae5, CHANNEL_4, COLOR_08_RED) // "Hey, you - this is a restricted area."
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
restart_timer
|
||||
chr_do_animation(ANIM_WALK_BACKWARDS, -1, -1, 0x10, 0x10, CHR_SELF, 2)
|
||||
|
||||
@@ -2171,7 +2171,7 @@ u8 func0409_office1[] = {
|
||||
|
||||
label(0x02)
|
||||
speak(CHR_TARGET, 0x0e2c, 0x1ae8, CHANNEL_4, COLOR_08_RED) // "Upstairs...there's an intruder."
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
set_stage_flag(STAGEFLAG_DISGUISE_UNCOVERED)
|
||||
activate_alarm
|
||||
set_ailist(CHR_SELF, GAILIST_IDLE)
|
||||
@@ -2250,7 +2250,7 @@ u8 func040a_office2[] = {
|
||||
if_chr_death_animation_finished(CHR_OFFICE1, /*goto*/ 0x02)
|
||||
if_chr_unloaded(CHR_OFFICE1, /*goto*/ 0x02)
|
||||
speak(CHR_TARGET, 0x0e2b, 0x1ae9, CHANNEL_4, COLOR_09_BLUE) // "You get security - I'll deal with her..."
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
restart_timer
|
||||
|
||||
beginloop(0x06)
|
||||
@@ -3449,7 +3449,7 @@ u8 func0419_ba8c[] = {
|
||||
goto_first(0x05)
|
||||
|
||||
label(0x02)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
say_quip(CHR_BOND, 0x25, 0xff, 0x00, 0xff, 0x81, 0x00, 0x00)
|
||||
label(0x0e)
|
||||
chr_do_animation(0x0229, -1, -1, 0x10, 0x14, CHR_SELF, 2)
|
||||
|
||||
@@ -1601,7 +1601,7 @@ u8 func0411_labtech_alerted[] = {
|
||||
endloop(0x40)
|
||||
|
||||
label(0x41)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
say_quip(CHR_BOND, 0x10, 0xff, 0x02, 0xff, BANK_0, 0x00, 0x00)
|
||||
|
||||
label(0x42)
|
||||
@@ -1896,7 +1896,7 @@ u8 func0401_pilot[] = {
|
||||
say_quip(CHR_BOND, 0x08, 0xfe, 0x0a, 0xff, BANK_0, 0x00, 0x00)
|
||||
|
||||
label(0x04)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
surrender
|
||||
|
||||
beginloop(0x0b)
|
||||
|
||||
@@ -5523,7 +5523,7 @@ u8 func0418_holo_guard_armed_unalert[] = {
|
||||
u8 func0419_holo_guard_armed_alert[] = {
|
||||
set_shotlist(AILIST_HOLO_GUARD_ARMED_ALERT)
|
||||
if_has_gun(CHR_SELF, /*goto*/ 0x2f)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
set_returnlist(CHR_SELF, AILIST_HOLO_GUARD_UNARMED_ALERT)
|
||||
set_ailist(CHR_SELF, AILIST_HOLO_GUARD_UNARMED_ALERT)
|
||||
label(0x2f)
|
||||
|
||||
@@ -2987,7 +2987,7 @@ u8 func0403_k7_scientist[] = {
|
||||
label(0x0c)
|
||||
assign_sound(0x128f, CHANNEL_6)
|
||||
play_sound_from_entity(CHANNEL_6, CHR_SELF, 0x0bb8, 0x1770, 0x01)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
jog_to_pad(0x0133)
|
||||
|
||||
beginloop(0x0d)
|
||||
|
||||
@@ -2261,7 +2261,7 @@ u8 func042e_taker_device_m[] = {
|
||||
set_stage_flag(STAGEFLAG_VISITED_HOSTAGES_BEFORE_AUTOGUNS)
|
||||
|
||||
label(0x2e)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
assign_sound(0x025b, CHANNEL_6)
|
||||
play_sound_from_entity(CHANNEL_6, CHR_SELF, 0x0bb8, 0x1770, 0x01)
|
||||
restart_timer
|
||||
@@ -2309,7 +2309,7 @@ u8 func0430_taker_device_f[] = {
|
||||
endloop(0x0a)
|
||||
|
||||
label(0x08)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
set_self_flag_bankx(CHRFLAG1_00000020, BANK_1)
|
||||
restart_timer
|
||||
chr_do_animation(ANIM_RELOAD_0209, 0, -1, 0x10, 0x10, CHR_SELF, 2)
|
||||
|
||||
@@ -1506,7 +1506,7 @@ u8 func0410_labtech_showers_sa_pa[] = {
|
||||
label(0x61)
|
||||
speak(CHR_TARGET, 0x2a2a, 0x1b31, CHANNEL_4, COLOR_08_RED) // "There's an intruder in the complex."
|
||||
set_stage_flag(STAGEFLAG_DISGUISE_UNCOVERED)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
stop_chr
|
||||
|
||||
beginloop(0x0c)
|
||||
@@ -1707,7 +1707,7 @@ u8 func0418_doorman[] = {
|
||||
|
||||
// Gun shot out of hand
|
||||
label(0x06)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
set_target_chr(CHR_BOND)
|
||||
set_ailist(CHR_SELF, GAILIST_ALERTED)
|
||||
|
||||
@@ -1836,7 +1836,7 @@ u8 func0418_doorman[] = {
|
||||
endloop(0x0f)
|
||||
|
||||
label(0x06)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
set_target_chr(CHR_BOND)
|
||||
set_ailist(CHR_SELF, GAILIST_ALERTED)
|
||||
|
||||
@@ -1967,7 +1967,7 @@ u8 func041a_labtech_harrysmate[] = {
|
||||
|
||||
label(0x06)
|
||||
speak(CHR_TARGET, 0x2a3a, 0x1abb, CHANNEL_4, COLOR_08_RED) // "Hey, that's not Harry. It's an intruder."
|
||||
set_squadron_alertness(120)
|
||||
increase_squadron_alertness(120)
|
||||
restart_timer
|
||||
chr_do_animation(0x002e, 0, -1, 0x18, 0x10, CHR_SELF, 2)
|
||||
|
||||
@@ -2891,7 +2891,7 @@ u8 func0420_labtech_doors[] = {
|
||||
|
||||
label(0x89)
|
||||
label(0x06)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
|
||||
beginloop(0x83)
|
||||
if_sound_finished(CHANNEL_4, /*goto*/ 0x2d)
|
||||
@@ -3094,7 +3094,7 @@ u8 func0422_labtech_records[] = {
|
||||
label(0x06)
|
||||
label(0x06)
|
||||
if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ 0x2d)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
speak(CHR_TARGET, 0x2a57, 0x1aa5, CHANNEL_4, COLOR_08_RED) // "Imposter!"
|
||||
chr_do_animation(0x0202, -1, -1, 0x14, 0x0a, CHR_SELF, 2)
|
||||
restart_timer
|
||||
|
||||
@@ -3136,7 +3136,7 @@ u8 func041b_sniper_wait_for_detection[] = {
|
||||
endloop(0x04)
|
||||
|
||||
label(0x06)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
set_self_chrflag(CHRCFLAG_00040000)
|
||||
set_chr_cloaked(CHR_SELF, TRUE, TRUE)
|
||||
set_ailist(CHR_SELF, AILIST_SNIPER)
|
||||
|
||||
@@ -1455,7 +1455,7 @@ u8 func0412_cia[] = {
|
||||
endloop(0x1e)
|
||||
|
||||
label(0x04)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
|
||||
beginloop(0x38)
|
||||
if_chr_in_squadron_doing_action(MA_TALKING, /*goto*/ 0x04)
|
||||
@@ -1517,7 +1517,7 @@ u8 func0412_cia[] = {
|
||||
endloop(0x06)
|
||||
|
||||
label(0x04)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
say_quip(CHR_BOND, 0x19, 0xff, 0x00, 0xff, 0x81, 0x00, 0x00)
|
||||
label(0x0b)
|
||||
set_chr_team(CHR_SELF, TEAM_NONCOMBAT)
|
||||
@@ -1669,7 +1669,7 @@ u8 func0413_bugspotter[] = {
|
||||
|
||||
// Alert everyone in group
|
||||
label(0x04)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
assign_sound(0x0467, CHANNEL_6)
|
||||
play_sound_from_entity(CHANNEL_6, CHR_SELF, 0x0bb8, 0x1770, 0x01)
|
||||
|
||||
@@ -1815,7 +1815,7 @@ u8 func041d_fbi[] = {
|
||||
// Unreachable
|
||||
label(0x04)
|
||||
say_quip(CHR_BOND, 0x1b, 0xff, 0x00, 0xff, 0x81, 0x00, 0x00)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
goto_next(0x16)
|
||||
|
||||
// Not shot
|
||||
|
||||
@@ -1317,7 +1317,7 @@ u8 func0405_president_in_room[] = {
|
||||
set_ailist(0x15, GAILIST_UNALERTED)
|
||||
set_stage_flag(STAGEFLAG_PRESIDENT_CALLED_SECURITY)
|
||||
yield
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
try_face_entity(0x0200, 0x0000, /*goto*/ 0x0a)
|
||||
|
||||
beginloop(0x0a)
|
||||
@@ -2457,7 +2457,7 @@ u8 func0415_cloner1[] = {
|
||||
// @bug? This may have intended to be a bank 1 check because the bank 1
|
||||
// flag is unset further below, and cloner3 uses bank 1.
|
||||
label(0x4f)
|
||||
if_self_flag_bankx_eq(CHRFLAG0_00080000, TRUE, BANK_0, /*goto*/ 0x2d)
|
||||
if_self_flag_bankx_eq(CHRFLAG0_SQUADALERTANYDIST, TRUE, BANK_0, /*goto*/ 0x2d)
|
||||
restart_timer
|
||||
|
||||
beginloop(0x0b)
|
||||
@@ -2553,7 +2553,7 @@ u8 func0418_cloner2[] = {
|
||||
// @bug? This may have intended to be a bank 1 check because the bank 1
|
||||
// flag is unset further below, and cloner3 uses bank 1.
|
||||
label(0x4f)
|
||||
if_self_flag_bankx_eq(CHRFLAG0_00080000, TRUE, BANK_0, /*goto*/ 0x2d)
|
||||
if_self_flag_bankx_eq(CHRFLAG0_SQUADALERTANYDIST, TRUE, BANK_0, /*goto*/ 0x2d)
|
||||
restart_timer
|
||||
|
||||
beginloop(0x0b)
|
||||
@@ -3238,7 +3238,7 @@ u8 func0407_steward[] = {
|
||||
endloop(0x09)
|
||||
|
||||
label(0x06)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
set_chr_hiddenflag(CHR_BOND, CHRHFLAG_DISGUISE_UNCOVERED)
|
||||
do_special_animation(-1)
|
||||
restart_timer
|
||||
@@ -3316,7 +3316,7 @@ u8 func0407_stewardess[] = {
|
||||
|
||||
label(0x80)
|
||||
play_sound(0x1adc, CHANNEL_7)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
|
||||
label(0x0a)
|
||||
set_self_chrflag(CHRCFLAG_01000000)
|
||||
|
||||
@@ -10082,102 +10082,29 @@ bool aiIfChrPropsoundcountZero(void)
|
||||
/**
|
||||
* @cmd 0131
|
||||
*/
|
||||
GLOBAL_ASM(
|
||||
glabel ai0131
|
||||
/* f05ac98: 27bdffc0 */ addiu $sp,$sp,-64
|
||||
/* f05ac9c: afb20024 */ sw $s2,0x24($sp)
|
||||
/* f05aca0: 3c12800a */ lui $s2,%hi(g_Vars)
|
||||
/* f05aca4: 26529fc0 */ addiu $s2,$s2,%lo(g_Vars)
|
||||
/* f05aca8: 8e4e0434 */ lw $t6,0x434($s2)
|
||||
/* f05acac: 8e4f0438 */ lw $t7,0x438($s2)
|
||||
/* f05acb0: 8e580424 */ lw $t8,0x424($s2)
|
||||
/* f05acb4: afbf003c */ sw $ra,0x3c($sp)
|
||||
/* f05acb8: afb70038 */ sw $s7,0x38($sp)
|
||||
/* f05acbc: afb60034 */ sw $s6,0x34($sp)
|
||||
/* f05acc0: afb50030 */ sw $s5,0x30($sp)
|
||||
/* f05acc4: afb4002c */ sw $s4,0x2c($sp)
|
||||
/* f05acc8: afb30028 */ sw $s3,0x28($sp)
|
||||
/* f05accc: afb10020 */ sw $s1,0x20($sp)
|
||||
/* f05acd0: afb0001c */ sw $s0,0x1c($sp)
|
||||
/* f05acd4: f7b40010 */ sdc1 $f20,0x10($sp)
|
||||
/* f05acd8: 01cf9821 */ addu $s3,$t6,$t7
|
||||
/* f05acdc: 0fc13380 */ jal teamGetChrIds
|
||||
/* f05ace0: 93040125 */ lbu $a0,0x125($t8)
|
||||
/* f05ace4: 84590000 */ lh $t9,0x0($v0)
|
||||
/* f05ace8: 2414fffe */ addiu $s4,$zero,-2
|
||||
/* f05acec: 00408825 */ or $s1,$v0,$zero
|
||||
/* f05acf0: 12990030 */ beq $s4,$t9,.L0f05adb4
|
||||
/* f05acf4: 3c01447a */ lui $at,0x447a
|
||||
/* f05acf8: 4481a000 */ mtc1 $at,$f20
|
||||
/* f05acfc: 84440000 */ lh $a0,0x0($v0)
|
||||
/* f05ad00: 3c170008 */ lui $s7,0x8
|
||||
/* f05ad04: 241600ff */ addiu $s6,$zero,0xff
|
||||
/* f05ad08: 24150005 */ addiu $s5,$zero,0x5
|
||||
.L0f05ad0c:
|
||||
/* f05ad0c: 0fc0a1dd */ jal chrFindByLiteralId
|
||||
/* f05ad10: 00000000 */ sll $zero,$zero,0x0
|
||||
/* f05ad14: 10400023 */ beqz $v0,.L0f05ada4
|
||||
/* f05ad18: 00408025 */ or $s0,$v0,$zero
|
||||
/* f05ad1c: 8c480020 */ lw $t0,0x20($v0)
|
||||
/* f05ad20: 51000021 */ beqzl $t0,.L0f05ada8
|
||||
/* f05ad24: 86240002 */ lh $a0,0x2($s1)
|
||||
/* f05ad28: 0fc0e6a5 */ jal chrIsDead
|
||||
/* f05ad2c: 00402025 */ or $a0,$v0,$zero
|
||||
/* f05ad30: 5440001d */ bnezl $v0,.L0f05ada8
|
||||
/* f05ad34: 86240002 */ lh $a0,0x2($s1)
|
||||
/* f05ad38: 82090007 */ lb $t1,0x7($s0)
|
||||
/* f05ad3c: 52a9001a */ beql $s5,$t1,.L0f05ada8
|
||||
/* f05ad40: 86240002 */ lh $a0,0x2($s1)
|
||||
/* f05ad44: 8e440424 */ lw $a0,0x424($s2)
|
||||
/* f05ad48: 920a02a2 */ lbu $t2,0x2a2($s0)
|
||||
/* f05ad4c: 908202a2 */ lbu $v0,0x2a2($a0)
|
||||
/* f05ad50: 51420004 */ beql $t2,$v0,.L0f05ad64
|
||||
/* f05ad54: 86050000 */ lh $a1,0x0($s0)
|
||||
/* f05ad58: 56c20013 */ bnel $s6,$v0,.L0f05ada8
|
||||
/* f05ad5c: 86240002 */ lh $a0,0x2($s1)
|
||||
/* f05ad60: 86050000 */ lh $a1,0x0($s0)
|
||||
.L0f05ad64:
|
||||
/* f05ad64: 848b0000 */ lh $t3,0x0($a0)
|
||||
/* f05ad68: 50ab000f */ beql $a1,$t3,.L0f05ada8
|
||||
/* f05ad6c: 86240002 */ lh $a0,0x2($s1)
|
||||
/* f05ad70: 0fc1272c */ jal chrGetDistanceToChr
|
||||
/* f05ad74: 00000000 */ sll $zero,$zero,0x0
|
||||
/* f05ad78: 4614003c */ c.lt.s $f0,$f20
|
||||
/* f05ad7c: 02e02825 */ or $a1,$s7,$zero
|
||||
/* f05ad80: 00003025 */ or $a2,$zero,$zero
|
||||
/* f05ad84: 45030005 */ bc1tl .L0f05ad9c
|
||||
/* f05ad88: 26040113 */ addiu $a0,$s0,0x113
|
||||
/* f05ad8c: 0fc12790 */ jal chrHasFlag
|
||||
/* f05ad90: 8e440424 */ lw $a0,0x424($s2)
|
||||
/* f05ad94: 10400003 */ beqz $v0,.L0f05ada4
|
||||
/* f05ad98: 26040113 */ addiu $a0,$s0,0x113
|
||||
.L0f05ad9c:
|
||||
/* f05ad9c: 0fc1289f */ jal incrementByte
|
||||
/* f05ada0: 92650002 */ lbu $a1,0x2($s3)
|
||||
.L0f05ada4:
|
||||
/* f05ada4: 86240002 */ lh $a0,0x2($s1)
|
||||
.L0f05ada8:
|
||||
/* f05ada8: 26310002 */ addiu $s1,$s1,0x2
|
||||
/* f05adac: 1684ffd7 */ bne $s4,$a0,.L0f05ad0c
|
||||
/* f05adb0: 00000000 */ sll $zero,$zero,0x0
|
||||
.L0f05adb4:
|
||||
/* f05adb4: 8e4c0438 */ lw $t4,0x438($s2)
|
||||
/* f05adb8: 8fbf003c */ lw $ra,0x3c($sp)
|
||||
/* f05adbc: d7b40010 */ ldc1 $f20,0x10($sp)
|
||||
/* f05adc0: 258d0003 */ addiu $t5,$t4,0x3
|
||||
/* f05adc4: ae4d0438 */ sw $t5,0x438($s2)
|
||||
/* f05adc8: 8fb20024 */ lw $s2,0x24($sp)
|
||||
/* f05adcc: 8fb0001c */ lw $s0,0x1c($sp)
|
||||
/* f05add0: 8fb10020 */ lw $s1,0x20($sp)
|
||||
/* f05add4: 8fb30028 */ lw $s3,0x28($sp)
|
||||
/* f05add8: 8fb4002c */ lw $s4,0x2c($sp)
|
||||
/* f05addc: 8fb50030 */ lw $s5,0x30($sp)
|
||||
/* f05ade0: 8fb60034 */ lw $s6,0x34($sp)
|
||||
/* f05ade4: 8fb70038 */ lw $s7,0x38($sp)
|
||||
/* f05ade8: 27bd0040 */ addiu $sp,$sp,0x40
|
||||
/* f05adec: 03e00008 */ jr $ra
|
||||
/* f05adf0: 00001025 */ or $v0,$zero,$zero
|
||||
);
|
||||
bool aiIncreaseSquadronAlertness(void)
|
||||
{
|
||||
u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
|
||||
s16 *chrnums = teamGetChrIds(g_Vars.chrdata->team);
|
||||
|
||||
for (; *chrnums != -2; chrnums++) {
|
||||
struct chrdata *chr = chrFindByLiteralId(*chrnums);
|
||||
|
||||
if (chr &&
|
||||
chr->unk020 &&
|
||||
!chrIsDead(chr) &&
|
||||
chr->actiontype != ACT_DEAD &&
|
||||
(g_Vars.chrdata->squadron == chr->squadron || g_Vars.chrdata->squadron == 255) &&
|
||||
g_Vars.chrdata->chrnum != chr->chrnum &&
|
||||
(chrGetDistanceToChr(g_Vars.chrdata, chr->chrnum) < 1000 || chrHasFlag(g_Vars.chrdata, CHRFLAG0_SQUADALERTANYDIST, BANK_0))) {
|
||||
incrementByte(&chr->alertness, cmd[2]);
|
||||
}
|
||||
}
|
||||
|
||||
g_Vars.aioffset += 3;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @cmd 0132
|
||||
|
||||
+10
-2
@@ -2561,9 +2561,17 @@
|
||||
channel,
|
||||
|
||||
/**
|
||||
* Sets the alertness value for all chrs in the current chr's squadron.
|
||||
* Increases the alertness value for other chrs in the current chr's squadron.
|
||||
*
|
||||
* By default, chrs will only be matched if they are within 1000 units of the
|
||||
* current chr. This limitation is bypassed if the current chr has
|
||||
* CHRFLAG0_SQUADALERTANYDIST.
|
||||
*
|
||||
* Chrs in squadron 255 will also be matched.
|
||||
*
|
||||
* The current chr's alertness will not be adjusted by this command.
|
||||
*/
|
||||
#define set_squadron_alertness(value) \
|
||||
#define increase_squadron_alertness(value) \
|
||||
mkshort(0x0131), \
|
||||
value,
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
#define CHRFLAG0_AIVSAI 0x00010000
|
||||
#define CHRFLAG0_CAN_TRAP 0x00020000
|
||||
#define CHRFLAG0_CAN_RUN_FOR_ALARM 0x00040000
|
||||
#define CHRFLAG0_00080000 0x00080000 // Air Force One: a "spawn done" flag
|
||||
#define CHRFLAG0_SQUADALERTANYDIST 0x00080000
|
||||
#define CHRFLAG0_00100000 0x00100000 // Become alert when hearing player and never on screen
|
||||
#define CHRFLAG0_00200000 0x00200000 // Globals, Villa hostage takers
|
||||
#define CHRFLAG0_00400000 0x00400000 // Not used in scripts
|
||||
|
||||
@@ -303,7 +303,7 @@
|
||||
/*0x012c*/ bool aiIfTargetMovingAway(void);
|
||||
/*0x012f*/ bool ai012f(void);
|
||||
/*0x0130*/ bool ai0130(void);
|
||||
/*0x0131*/ bool ai0131(void);
|
||||
/*0x0131*/ bool aiIncreaseSquadronAlertness(void);
|
||||
/*0x0132*/ bool aiSetAction(void);
|
||||
/*0x0133*/ bool ai0133(void);
|
||||
/*0x0134*/ bool aiIfOrders(void);
|
||||
|
||||
+13
-13
@@ -133,7 +133,7 @@ u8 func0006_unalerted[] = {
|
||||
say_quip(CHR_BOND, 0x0c, 0xff, 0x03, 0x00, BANK_0, 0x00, 0x00) // "Holy shh...","What the hell?!"
|
||||
dprint 'N','O',' ','W','A','R','N','I','N','G','\n',0,
|
||||
if_self_flag_bankx_eq(CHRFLAG0_CANT_ALERT_GROUP, TRUE, BANK_0, /*goto*/ 0x13)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
label(0x13)
|
||||
dprint 'N','O',' ','W','A','R','N','I','N','G','\n',0,
|
||||
set_ailist(CHR_SELF, GAILIST_WAKEUP)
|
||||
@@ -369,13 +369,13 @@ u8 func0006_unalerted[] = {
|
||||
label(0x16)
|
||||
say_quip(CHR_BOND, 0x0b, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) // "Hey, you!","Intruder alert","We've got a contact!"
|
||||
label(0x9f)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
goto_next(0x77)
|
||||
|
||||
label(0xdb) // jumped to from below
|
||||
label(0x14)
|
||||
say_quip(CHR_BOND, 0x20, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) // "Imposter!","It's a spy!"
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
goto_next(0x77)
|
||||
|
||||
// Unreachable?
|
||||
@@ -384,7 +384,7 @@ u8 func0006_unalerted[] = {
|
||||
yield
|
||||
dprint 'S','3',0,
|
||||
say_quip(CHR_BOND, 0x0c, 0xff, 0x03, 0x00, BANK_0, 0x00, 0x00) // "Holy shh...","What the hell?!"
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
goto_next(0x77)
|
||||
|
||||
label(0x94)
|
||||
@@ -413,7 +413,7 @@ u8 func0006_unalerted[] = {
|
||||
label(0x77)
|
||||
set_alertness(255)
|
||||
if_self_flag_bankx_eq(CHRFLAG0_CANT_ALERT_GROUP, TRUE, BANK_0, /*goto*/ 0x13)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
label(0x13)
|
||||
set_ailist(CHR_SELF, GAILIST_WAKEUP)
|
||||
|
||||
@@ -441,7 +441,7 @@ u8 func0006_unalerted[] = {
|
||||
set_ailist(CHR_SELF, GAILIST_SEARCH_FOR_PLAYER)
|
||||
|
||||
label(0x13)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
set_ailist(CHR_SELF, GAILIST_WAKEUP)
|
||||
|
||||
//
|
||||
@@ -645,7 +645,7 @@ u8 func0006_unalerted[] = {
|
||||
endloop(0x82)
|
||||
|
||||
label(0x81)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
set_alertness(255)
|
||||
set_ailist(CHR_SELF, GAILIST_WAKEUP)
|
||||
|
||||
@@ -2550,7 +2550,7 @@ u8 func0007_alerted[] = {
|
||||
label(0x97)
|
||||
dprint 'W','A','R','N',' ','F','R','I','E','N','D','S','\n',0,
|
||||
say_quip(CHR_BOND, 0x10, 0xff, 0x02, 0xff, BANK_0, 0x00, 0x00)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
label(0x84)
|
||||
goto_first(0x1b)
|
||||
|
||||
@@ -2758,7 +2758,7 @@ u8 func000b_choose_target_chr[] = {
|
||||
label(0x16)
|
||||
say_quip(CHR_BOND, 0x0c, 0xff, 0x03, 0x00, BANK_0, 0x00, 0x00) // "Holy shh...","What the hell?!"
|
||||
dprint 'N','O',' ','W','A','R','N','I','N','G','\n',0,
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
dprint 'N','O',' ','W','A','R','N','I','N','G','\n',0,
|
||||
if_enemy_distance_lt_and_los(2540, /*goto*/ 0x13)
|
||||
goto_next(0xd3)
|
||||
@@ -2789,7 +2789,7 @@ u8 func000b_choose_target_chr[] = {
|
||||
// Found
|
||||
label(0x16)
|
||||
dprint 'F','O','U','N','D','\n',0,
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
set_ailist(CHR_SELF, GAILIST_COMBAT_WITH_TARGET)
|
||||
set_returnlist(CHR_SELF, GAILIST_CHOOSE_TARGET)
|
||||
|
||||
@@ -4099,7 +4099,7 @@ u8 func0010_civilian_say_comment[] = {
|
||||
*/
|
||||
u8 func001c_surprised[] = {
|
||||
set_shotlist(GAILIST_ALERTED)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
say_quip(CHR_BOND, 0x0c, 0xff, 0x03, 0x00, BANK_0, 0x00, 0x00) // "Holy shh...","What the hell?!"
|
||||
restart_timer
|
||||
chr_do_animation(ANIM_SURPRISED_0202, 0, -1, 0x00, 0x10, CHR_SELF, 2)
|
||||
@@ -4511,7 +4511,7 @@ u8 func001f_related_to_spawning[] = {
|
||||
dprint 'S','E','E',' ','D','E','T','E','C','T','\n',0,
|
||||
say_quip(CHR_BOND, 0x0b, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
|
||||
label(0x9f)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
set_alertness(255)
|
||||
set_returnlist(CHR_SELF, GAILIST_RELATED_TO_SPAWNING)
|
||||
set_ailist(CHR_SELF, GAILIST_COMBAT_WITH_TARGET)
|
||||
@@ -4520,7 +4520,7 @@ u8 func001f_related_to_spawning[] = {
|
||||
yield
|
||||
say_quip(CHR_BOND, 0x09, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
|
||||
if_self_flag_bankx_eq(CHRFLAG0_CAN_HEARSPAWN, TRUE, BANK_0, /*goto*/ 0xda)
|
||||
set_squadron_alertness(100)
|
||||
increase_squadron_alertness(100)
|
||||
set_returnlist(CHR_SELF, GAILIST_RELATED_TO_SPAWNING)
|
||||
set_ailist(CHR_SELF, GAILIST_COMBAT_WITH_TARGET)
|
||||
|
||||
|
||||
@@ -14439,7 +14439,7 @@ bool (*g_CommandPointers[])(void) = {
|
||||
/*0x012e*/ NULL,
|
||||
/*0x012f*/ ai012f,
|
||||
/*0x0130*/ ai0130,
|
||||
/*0x0131*/ ai0131,
|
||||
/*0x0131*/ aiIncreaseSquadronAlertness,
|
||||
/*0x0132*/ aiSetAction,
|
||||
/*0x0133*/ ai0133,
|
||||
/*0x0134*/ aiIfOrders,
|
||||
|
||||
Reference in New Issue
Block a user