Discover and document try_attack_amount AI command and decompile chrTryAttackAmount

This commit is contained in:
Ryan Dwyer
2020-05-28 23:45:12 +10:00
parent 2f8d66db55
commit 4dba3418b3
8 changed files with 90 additions and 153 deletions
+25 -17
View File
@@ -3308,24 +3308,32 @@
mkshort(0x0183), \
label,
// Involves a call to the RNG, and zeroing chr fields aimendlshoulder,
// aimendrshoulder, aimendback and amendsideback.
//
// Called with values:
// 90, 100
// 40, 60
// 20, 30
//
// Used by:
// Attack Ship - Bridge skedar (with 40,60)
// Ruins - Reaper and Slayer skedar (with 40,60)
// globals.s - with values 90,100 and 20,30
//
// Sometimes accompanied with dprint "FIRE FULL"
#define cmd0184(u1, u2) \
/**
* Makes the chr begin the ACT_ATTACKAMOUNT action, although the specifics of
* this action are unknown.
*
* The two values are the lower and upper bounds of a random percentage. For
* example, when using the values 40 and 60 a random percentage will be chosen
* between 40% and 60%. This percentage is then applied to the weapon's clip
* size. When happens with that is not yet known.
*
* Note that this command can fail, but doesn't have a label argument so failure
* cannot be detected.
*
* It's called with these values:
* 90, 100
* 40, 60
* 20, 30
*
* It's used by:
* Attack Ship - Bridge skedar (with 40,60)
* Ruins - Reaper and Slayer skedar (with 40,60)
* Global AI lists - with values 90,100 and 20,30
*/
#define try_attack_amount(lower, upper) \
mkshort(0x0184), \
u1, \
u2,
lower, \
upper,
#define mp_init_simulants \
mkshort(0x0185),
+2 -2
View File
@@ -321,9 +321,9 @@
// chr->flags2
#define CHRFLAG1_00000001 0x00000001 // Globals, Extraction, Air Base, Deep Sea
#define CHRFLAG1_00000002 0x00000002 // Globals
#define CHRFLAG1_00000004 0x00000004 // Globals - If set, avoids cmd0184
#define CHRFLAG1_00000004 0x00000004 // Globals - If set, avoids try_attack_amount
#define CHRFLAG1_00000008 0x00000008 // Only used in WAR. If set, chr waits 2 seconds before attacking while defending
#define CHRFLAG1_00000010 0x00000010 // Globals - If set, avoids cmd0184
#define CHRFLAG1_00000010 0x00000010 // Globals - If set, avoids try_attack_amount
#define CHRFLAG1_00000020 0x00000020 // Globals, AF1, Defense - related to reload animation
#define CHRFLAG1_CAN_SNIPE 0x00000040
#define CHRFLAG1_00000080 0x00000080 // Not used in scripts
+2 -2
View File
@@ -37,7 +37,7 @@ void chrAttackRoll(struct chrdata *chr, bool direction);
void func0f030ff8(struct chrdata *chr, u32 anim_id, f32 fstartframe, f32 fendframe, u8 flags, u32 transition, f32 result);
void func0f031254(struct chrdata *chr);
void func0f031384(struct chrdata *chr, u32 *arg1, bool arg2, s32 *firing, u32 entitytype, u32 entityid, u32 arg6);
u32 func0f0318b8(void);
void chrAttackAmount(struct chrdata *chr, u32 arg1, u32 arg2, u32 arg3);
u32 func0f0319a8(void);
u32 func0f032ac4(void);
void func0f032fe4(struct chrdata *chr, struct coord *pos, f32 arg2, f32 arg3, u32 *arg4, u32 arg5);
@@ -98,7 +98,7 @@ bool chrTryRunSideways(struct chrdata *chr);
u32 chrTryAttackWalk(struct chrdata *chr);
bool chrTryAttackRun(struct chrdata *chr);
u32 chrTryAttackRoll(struct chrdata *chr);
u32 func0f03a3ec(struct chrdata *chr, u32 arg1, u32 arg2, u32 arg3, u32 arg4);
u32 chrTryAttackAmount(struct chrdata *chr, u32 arg1, u32 arg2, u8 arg3, u8 arg4);
u32 func0f03a894(struct chrdata *chr, s32 pad, s32 arg2);
u32 func0f03abd0(void);
u32 func0f03aca0(struct chrdata *chr, u32 arg1, u32 arg2);