Rename symbols relating to hearing targets

This commit is contained in:
Ryan Dwyer 2020-05-29 21:31:35 +10:00
parent 1ba94cabc2
commit 197d713aa2
11 changed files with 23 additions and 26 deletions

View File

@ -1688,7 +1688,7 @@ u8 func0414_programmer[] = {
if_near_miss(/*goto*/ 0x96)
if_saw_injury(0x00, /*goto*/ 0x96)
if_saw_death(0x00, /*goto*/ 0x96)
if_hears_gunfire(/*goto*/ 0x96)
if_hears_target(/*goto*/ 0x96)
if_stage_flag_eq(STAGEFLAG_PROGRAMMER_RAN_TO_GUARD, TRUE, /*goto*/ 0x2c)
if_sees_suspicious_item(/*goto*/ 0x96)
label(0x2c)

View File

@ -1831,7 +1831,7 @@ u8 func041d_fbi[] = {
if_target_in_sight(/*goto*/ 0x18)
if_near_miss(/*goto*/ 0x18)
if_num_times_shot_gt(0, /*goto*/ 0x18)
if_hears_gunfire(/*goto*/ 0x16)
if_hears_target(/*goto*/ 0x16)
if_saw_injury(0x00, /*goto*/ 0x16)
if_saw_death(0x00, /*goto*/ 0x16)
if_sees_suspicious_item(/*goto*/ 0x16)
@ -2106,7 +2106,7 @@ u8 func041e_sealer1[] = {
if_target_in_sight(/*goto*/ LABEL_ALERTED)
if_near_miss(/*goto*/ LABEL_ALERTED)
if_num_times_shot_gt(0, /*goto*/ LABEL_ALERTED)
if_hears_gunfire(/*goto*/ LABEL_ALERTED)
if_hears_target(/*goto*/ LABEL_ALERTED)
if_saw_injury(0x00, /*goto*/ LABEL_ALERTED)
if_saw_death(0x00, /*goto*/ LABEL_ALERTED)
if_sees_suspicious_item(/*goto*/ LABEL_ALERTED)

View File

@ -1236,7 +1236,7 @@ u8 func0405_president_in_room[] = {
label(0x2d)
if_saw_injury(0x00, /*goto*/ 0x86)
if_hears_gunfire(/*goto*/ 0x86)
if_hears_target(/*goto*/ 0x86)
if_timer_lt(120, /*goto*/ 0x2d)
if_chr_in_view(/*goto*/ 0x06)
label(0x2d)
@ -1259,7 +1259,7 @@ u8 func0405_president_in_room[] = {
label(0x2d)
if_saw_injury(0x00, /*goto*/ 0x86)
if_hears_gunfire(/*goto*/ 0x86)
if_hears_target(/*goto*/ 0x86)
if_timer_lt(240, /*goto*/ 0x2d)
if_chr_in_view(/*goto*/ 0x06)
label(0x2d)
@ -1279,7 +1279,7 @@ u8 func0405_president_in_room[] = {
label(0x2d)
if_saw_injury(0x00, /*goto*/ 0x86)
if_hears_gunfire(/*goto*/ 0x86)
if_hears_target(/*goto*/ 0x86)
if_timer_lt(400, /*goto*/ 0x2d)
goto_next(0x84)
@ -1352,7 +1352,7 @@ u8 func0405_president_in_room[] = {
label(0x2d)
if_saw_injury(0x00, /*goto*/ 0x86)
if_hears_gunfire(/*goto*/ 0x86)
if_hears_target(/*goto*/ 0x86)
if_sound_finished(CHANNEL_6, /*goto*/ 0x06)
goto_first(0x0b)
@ -1370,7 +1370,7 @@ u8 func0405_president_in_room[] = {
label(0x2d)
if_saw_injury(0x00, /*goto*/ 0x86)
if_hears_gunfire(/*goto*/ 0x86)
if_hears_target(/*goto*/ 0x86)
if_timer_gt(400, /*goto*/ 0x06)
endloop(0x7a)

View File

@ -12401,7 +12401,7 @@ void chrRecordLastSeeTargetTime(struct chrdata *chr)
void chrRecordLastHearTargetTime(struct chrdata *chr)
{
chr->hidden |= CHRHFLAG_00000002;
chr->hidden |= CHRHFLAG_IS_HEARING_TARGET;
chr->lastheartarget60 = g_Vars.lvframe60;
}
@ -26449,7 +26449,7 @@ void chrTick(struct chrdata *chr)
}
}
chr->hidden &= ~CHRHFLAG_00000002;
chr->hidden &= ~CHRHFLAG_IS_HEARING_TARGET;
chr->hidden2 &= ~CHRH2FLAG_0040;
if (pass) {
@ -28022,9 +28022,9 @@ bool chrHasStageFlag(struct chrdata *chr, u32 flag)
return (g_StageFlags & flag) != 0;
}
bool chrHasHiddenFlag00000002(struct chrdata *chr)
bool chrIsHearingTarget(struct chrdata *chr)
{
return (chr->hidden & CHRHFLAG_00000002) != 0;
return (chr->hidden & CHRHFLAG_IS_HEARING_TARGET) != 0;
}
void chrRestartTimer(struct chrdata *chr)

View File

@ -78,7 +78,7 @@ bool (*g_CommandPointers[])(void) = {
/*0x0039*/ aiIfCanHearAlarm,
/*0x003a*/ aiIfAlarmActive,
/*0x003b*/ ai003b,
/*0x003c*/ ai003c,
/*0x003c*/ aiIfHearsTarget,
/*0x003d*/ aiIfSawInjury,
/*0x003e*/ aiIfSawDeath,
/*0x003f*/ aiIfSeesPlayer,

View File

@ -1293,14 +1293,11 @@ bool ai003b(void)
}
/**
* Either a check if chr is alerted or a check if they can hear gunfire.
* Probably the latter.
*
* @cmd 003c
*/
bool ai003c(void)
bool aiIfHearsTarget(void)
{
if (chrHasHiddenFlag00000002(g_Vars.chrdata)) {
if (chrIsHearingTarget(g_Vars.chrdata)) {
u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[2]);
} else {
@ -6297,7 +6294,7 @@ bool aiSetTarget(void)
g_Vars.chrdata->lastvisibletarget60 = 0;
g_Vars.chrdata->lastseetarget60 = 0;
g_Vars.chrdata->lastheartarget60 = 0;
g_Vars.chrdata->hidden &= ~CHRHFLAG_00000002;
g_Vars.chrdata->hidden &= ~CHRHFLAG_IS_HEARING_TARGET;
g_Vars.chrdata->chrflags &= ~CHRCFLAG_NEAR_MISS;
g_Vars.chrdata->target = prop_id;
}

View File

@ -564,7 +564,7 @@ u8 func0006_unalerted[] = {
set_hear_distance(10000)
chr_toggle_p1p2(CHR_SELF)
set_target_chr(CHR_P1P2)
if_hears_gunfire(/*goto*/ 0x16)
if_hears_target(/*goto*/ 0x16)
if_player_looking_at_something_maybe(0x00, 0x00, 0x01, /*goto*/ 0x13)
if_target_in_sight(/*goto*/ 0x17)
label(0x13)
@ -4392,7 +4392,7 @@ u8 func001d_search_for_player[] = {
dprint '1','\n',0,
if_chr_stopped(/*goto*/ 0x16)
dprint '1','\n',0,
if_hears_gunfire(/*goto*/ 0x12)
if_hears_target(/*goto*/ 0x12)
dprint '1','\n',0,
if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ 0x12)
dprint '1','\n',0,

View File

@ -542,9 +542,9 @@
label,
/**
* Checks if the chr has heard gunfire.
* Checks if the chr has heard their target (eg. due to gunfire).
*/
#define if_hears_gunfire(label) \
#define if_hears_target(label) \
mkshort(0x003c), \
label,

View File

@ -354,7 +354,7 @@
// chr->hidden
#define CHRHFLAG_00000001 0x00000001 // Set when chr drops weapon
#define CHRHFLAG_00000002 0x00000002 // Not used in scripts
#define CHRHFLAG_IS_HEARING_TARGET 0x00000002 // Not used in scripts
#define CHRHFLAG_00000004 0x00000004 // Related to firing - hand 1
#define CHRHFLAG_00000008 0x00000008 // Related to firing - hand 0
#define CHRHFLAG_00000010 0x00000010 // Not used in scripts

View File

@ -297,7 +297,7 @@ bool chrHasFlagById(struct chrdata *ref, u32 chrnum, u32 flag, u32 bank);
void chrSetStageFlag(struct chrdata *chr, u32 flag);
void chrUnsetStageFlag(struct chrdata *chr, u32 flag);
bool chrHasStageFlag(struct chrdata *chr, u32 flag);
bool chrHasHiddenFlag00000002(struct chrdata *chr);
bool chrIsHearingTarget(struct chrdata *chr);
void chrRestartTimer(struct chrdata *chr);
u32 chrResetNearMiss(struct chrdata *chr);
s32 chrGetNumArghs(struct chrdata *chr);

View File

@ -63,7 +63,7 @@
/*0x0039*/ bool aiIfCanHearAlarm(void);
/*0x003a*/ bool aiIfAlarmActive(void);
/*0x003b*/ bool ai003b(void);
/*0x003c*/ bool ai003c(void);
/*0x003c*/ bool aiIfHearsTarget(void);
/*0x003d*/ bool aiIfSawInjury(void);
/*0x003e*/ bool aiIfSawDeath(void);
/*0x003f*/ bool aiIfSeesPlayer(void);