Discover and document AI commands if_target_nearly_in_sight and if_nearly_in_targets_sight and attempt to decompile func0002f308

This commit is contained in:
Ryan Dwyer
2020-05-28 20:21:16 +10:00
parent 48d54019a2
commit 2f8d66db55
16 changed files with 117 additions and 66 deletions
+14 -5
View File
@@ -592,15 +592,24 @@
mkshort(0x003f), \
label,
#define cmd0040(flags, label) \
/**
* Checks if the current chr's target is in sight of the current chr, or would
* be in sight if the target were to move <distance> units left or right in a
* circle around the current chr.
*/
#define if_target_nearly_in_sight(distance, label) \
mkshort(0x0040), \
mkword(flags), \
mkword(distance), \
label,
// Not sure about this.
#define if_within_units_of_sight(value, label) \
/**
* Checks if the current chr is in sight of their target, or would be in sight
* if the current chr were to move <distance> units left or right in a circle
* around their target.
*/
#define if_nearly_in_targets_sight(distance, label) \
mkshort(0x0041), \
mkword(value), \
mkword(distance), \
label,
/**
+2 -2
View File
@@ -317,8 +317,8 @@ struct prop *chrSpawnAtChr(struct chrdata *basechr, s32 body, s32 head, u32 chrn
s16 chrGoToCover(struct chrdata *chr, u8 speed);
void chrAddTargetToBdlist(struct chrdata *chr);
s32 chrGetDistanceLostToTargetInLastSecond(struct chrdata *chr);
bool func0f04c6b4(struct chrdata *chr, u32 distance);
bool func0f04c71c(struct chrdata *chr, u32 distance);
bool chrIsTargetNearlyInSight(struct chrdata *chr, u32 distance);
bool chrIsNearlyInTargetsSight(struct chrdata *chr, u32 distance);
s16 *teamGetChrIds(s32 team_id);
s16 *squadronGetChrIds(s32 squadron_id);
void audioMarkAsRecentlyPlayed(s16 audioid);
+2 -2
View File
@@ -67,8 +67,8 @@
/*0x003d*/ bool aiIfSawInjury(void);
/*0x003e*/ bool aiIfSawDeath(void);
/*0x003f*/ bool aiIfSeesPlayer(void);
/*0x0040*/ bool ai0040(void);
/*0x0041*/ bool ai0041(void);
/*0x0040*/ bool aiIfTargetNearlyInSight(void);
/*0x0041*/ bool aiIfNearlyInTargetsSight(void);
/*0x0042*/ bool aiIfInLoadedRoom(void);
/*0x0043*/ bool aiIfSawTargetRecently(void);
/*0x0044*/ bool aiIfHeardTargetRecently(void);
+3 -3
View File
@@ -108,7 +108,7 @@ u32 func0002d8b8(void);
u32 func0002d95c(void);
u32 func0002da50(void);
u32 func0002dac8(void);
u32 func0002db98(void);
bool func0002db98(struct coord *viewpos, s16 *rooms, struct coord *targetpos, s32 arg3, u32 arg4);
u32 func0002dc18(struct coord *coord, s16 *room, struct coord *coord2, s32 arg3);
bool hasLineOfSight(struct coord *coord, s16 *room, struct coord *coord2, s16 *room2, s32 arg4, s32 arg5);
u32 func0002dcd0(void);
@@ -127,7 +127,7 @@ u32 func0002e9d8(void);
u32 func0002eb84(void);
u32 func0002ed30(void);
u32 func0002f02c(void);
bool func0002f308(struct coord *pos, s16 *rooms, struct coord *pos2, f32 distance, s32 arg4, s32 arg5);
bool func0002f450(struct coord *pos, s16 *rooms, struct coord *pos2, f32 distance, s32 arg4);
bool func0002f308(struct coord *viewpos, s16 *rooms, struct coord *targetpos, f32 distance, s32 arg4, u16 arg5);
bool func0002f450(struct coord *viewpos, s16 *rooms, struct coord *targetpos, f32 distance, s32 arg4);
#endif