Discover chrIsUsingLift and if_using_lift AI command

This commit is contained in:
Ryan Dwyer
2020-06-20 17:18:15 +10:00
parent 54929f82df
commit 314dd63eb1
6 changed files with 11 additions and 7 deletions
+1 -1
View File
@@ -23829,7 +23829,7 @@ glabel func0f046648
/* f046a2c: 00000000 */ sll $zero,$zero,0x0
);
s32 func0f046a30(struct chrdata *chr)
s32 chrIsUsingLift(struct chrdata *chr)
{
return (chr->actiontype == ACT_GOPOS || chr->actiontype == ACT_PATROL) && chr->liftaction > 0;
}
+1 -1
View File
@@ -439,7 +439,7 @@ bool (*g_CommandPointers[])(void) = {
/*0x01a2*/ aiSayCiStaffQuip,
/*0x01a3*/ aiDoPresetAnimation,
/*0x01a4*/ aiShowHudmsgMiddle,
/*0x01a5*/ ai01a5,
/*0x01a5*/ aiIfUsingLift,
/*0x01a6*/ aiIfTargetYDifferenceLessThan,
/*0x01a7*/ aiIfChrPropsoundcountZero,
/*0x01a8*/ NULL,
+2 -2
View File
@@ -10357,11 +10357,11 @@ bool aiDoPresetAnimation(void)
/**
* @cmd 01a5
*/
bool ai01a5(void)
bool aiIfUsingLift(void)
{
u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
if (func0f046a30(g_Vars.chrdata)) {
if (chrIsUsingLift(g_Vars.chrdata)) {
g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[2]);
} else {
g_Vars.aioffset += 3;
+5 -1
View File
@@ -3555,7 +3555,11 @@
color, \
mkshort(text),
#define cmd01a5(label) \
/**
* Checks if the current chr is using a lift (most likely from the moment they
* call it until the moment the door opens at the end of the journey).
*/
#define if_using_lift(label) \
mkshort(0x01a5), \
label,
+1 -1
View File
@@ -266,7 +266,7 @@ void unregisterDangerousProp(struct prop *prop);
void registerDangerousProp(struct prop *prop);
bool chrDetectDangerousObject(struct chrdata *chr, u8 flags);
void chrTickBondDie(struct chrdata *chr);
s32 func0f046a30(struct chrdata *chr);
s32 chrIsUsingLift(struct chrdata *chr);
bool chrTrySkJump(struct chrdata *chr, u8 arg1, u8 arg2, s32 arg3, u8 arg4);
bool chrSawTargetRecently(struct chrdata *chr);
bool chrHeardTargetRecently(struct chrdata *chr);
+1 -1
View File
@@ -388,7 +388,7 @@
/*0x01a2*/ bool aiSayCiStaffQuip(void);
/*0x01a3*/ bool aiDoPresetAnimation(void);
/*0x01a4*/ bool aiShowHudmsgMiddle(void);
/*0x01a5*/ bool ai01a5(void);
/*0x01a5*/ bool aiIfUsingLift(void);
/*0x01a6*/ bool aiIfTargetYDifferenceLessThan(void);
/*0x01a7*/ bool aiIfChrPropsoundcountZero(void);
/*0x01aa*/ bool ai01aa(void);