Attempt to decompile chrShoot

This commit is contained in:
Ryan Dwyer 2021-12-25 22:05:08 +10:00
parent 9b6cb2d191
commit 42922df7d2
11 changed files with 841 additions and 214 deletions

View File

@ -10720,7 +10720,7 @@ s32 bgun0f09ebbc(void)
return g_Vars.currentplayer->gunctrl.unk1598;
}
void bgun0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, Mtxf *matrix1, f32 *arg4, Mtxf *matrix2, struct prop *prop, struct coord *pos)
void bgun0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, Mtxf *matrix1, struct coord *arg4, Mtxf *matrix2, struct prop *prop, struct coord *pos)
{
struct prop *objprop = obj->prop;
@ -10752,16 +10752,16 @@ void bgun0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, Mtxf
objSetProjectileFlag4(objprop);
mtx4Copy(matrix2, (Mtxf *)&obj->projectile->unk020);
obj->projectile->speed.x = arg4[0];
obj->projectile->speed.y = arg4[1];
obj->projectile->speed.z = arg4[2];
obj->projectile->speed.x = arg4->x;
obj->projectile->speed.y = arg4->y;
obj->projectile->speed.z = arg4->z;
obj->projectile->obj = obj;
obj->projectile->unk0d8 = g_Vars.lvframenum;
}
}
}
void bgun0f09ed2c(struct defaultobj *obj, struct coord *newpos, Mtxf *arg2, f32 *arg3, Mtxf *arg4)
void bgun0f09ed2c(struct defaultobj *obj, struct coord *newpos, Mtxf *arg2, struct coord *arg3, Mtxf *arg4)
{
struct prop *objprop = obj->prop;
struct coord pos;
@ -10853,7 +10853,7 @@ struct defaultobj *bgun0f09ee18(struct chrdata *chr, struct gset *gset, struct c
}
if (obj != NULL) {
bgun0f09ebcc(obj, pos, rooms, arg4, (f32 *)arg5, &mtx, chr->prop, pos);
bgun0f09ebcc(obj, pos, rooms, arg4, arg5, &mtx, chr->prop, pos);
obj->hidden &= 0x0fffffff;

File diff suppressed because it is too large Load Diff

View File

@ -216,10 +216,8 @@ void aibotAllocate(s32 chrnum, s32 aibotnum)
aibot->unk0dc = 0;
aibot->unk0e0[HAND_LEFT] = 0;
aibot->unk0e0[HAND_RIGHT] = 0;
aibot->unk0e4[1] = 0.0f;
aibot->unk0e4[0] = 0.0f;
aibot->maulercharge[HAND_LEFT] = 0.0f;
aibot->maulercharge[HAND_RIGHT] = 0.0f;
aibot->unk0a4 = model0001ae44(chr->model);
aibot->angleoffset = 0.0f;
aibot->speedtheta = 0.0f;

View File

@ -15362,7 +15362,7 @@ s32 playerTick(struct prop *prop)
if ((chr->hidden & CHRHFLAG_00000800) == 0) {
for (i = 0; i < 2; i++) {
if (func0f03fde4(chr, i, &player->chrmuzzlelastpos[i])) {
if (chrGetGunPos(chr, i, &player->chrmuzzlelastpos[i])) {
player->chrmuzzlelast[i] = g_Vars.lvframenum;
} else if (player->chrmuzzlelast[i] < g_Vars.lvframenum - 1) {
player->chrmuzzlelastpos[i].x = player->hands[i].muzzlepos.x;

View File

@ -49,7 +49,7 @@ void aibotReloadWeapon(struct chrdata *chr, s32 handnum, bool withsound)
{
struct aibot *aibot = chr->aibot;
aibot->unk02c[handnum] = 0;
aibot->unk0e4[handnum] = 0;
aibot->maulercharge[handnum] = 0;
if (chr->weapons_held[handnum]
&& func0f19a29c(aibot->weaponnum, aibot->gunfunc) == 0) {
@ -209,11 +209,7 @@ void aibotGiveAmmoByType(struct aibot *aibot, u32 ammotype, s32 quantity)
dprint();
}
/**
* This function appears to handle aibots shooting chrs with the Farsight, but
* is called conditionally and I haven't determined what those conditions are.
*/
bool aibotDoFarsightThing(struct chrdata *chr, u32 arg1, struct coord *vector, struct coord *arg3)
bool aibotShootFarsightThroughWalls(struct chrdata *chr, s32 arg1, struct coord *vector, struct coord *arg3)
{
struct aibot *aibot;
struct chrdata *oppchr;
@ -495,21 +491,21 @@ void aibotCreateSlayerRocket(struct chrdata *chr)
struct coord sp120 = {0, 0, 0};
f32 a;
f32 b;
f32 sp100[3];
struct coord sp100;
a = chrGetAimAngle(chr);
b = func0f03e754(chr);
sp100[0] = cosf(b) * sinf(a);
sp100[1] = sinf(b);
sp100[2] = cosf(b) * cosf(a);
sp100.x = cosf(b) * sinf(a);
sp100.y = sinf(b);
sp100.z = cosf(b) * cosf(a);
mtx4LoadXRotation(b, &sp196);
mtx4LoadYRotation(a, &sp132);
mtx00015be0(&sp132, &sp196);
mtx4LoadIdentity(&sp260);
bgun0f09ebcc(&rocket->base, &chr->prop->pos, chr->prop->rooms, &sp196, sp100, &sp260, chr->prop, &chr->prop->pos);
bgun0f09ebcc(&rocket->base, &chr->prop->pos, chr->prop->rooms, &sp196, &sp100, &sp260, chr->prop, &chr->prop->pos);
if (rocket->base.hidden & OBJHFLAG_AIRBORNE) {
struct prop *target = chrGetTargetProp(chr);

View File

@ -1954,11 +1954,11 @@ struct weaponfunc_shootprojectile invfunc_superdragon_grenadelauncher = {
0x00000000,
0x3f800000,
0x00000000,
0x3da3d70a,
0.08,
0x0000001e,
0x000004b0,
0x3dcccccd,
0x80530000,
0.1,
0x8053,
};
struct inventory_ammo invammo_superdragon = {
@ -2711,11 +2711,11 @@ struct weaponfunc_shootprojectile invfunc_rockerlauncher_shoot = {
0x00000000,
0x40066666,
0x0000003c,
0x00000000,
0,
0x00000000,
0xffffffff,
0x3d4ccccd,
0x80530000,
0.05,
0x8053,
};
struct weaponfunc_shootprojectile invfunc_rocketlauncher_homing = {
@ -2742,11 +2742,11 @@ struct weaponfunc_shootprojectile invfunc_rocketlauncher_homing = {
0x00000000,
0x40066666,
0x00000000,
0x00000000,
0,
0x00000005,
0xffffffff,
0x3d4ccccd,
0x80530000,
0.05,
0x8053,
};
struct inventory_ammo invammo_rocketlauncher = {
@ -2821,11 +2821,11 @@ struct weaponfunc_shootprojectile invfunc_slayer_shoot = {
0x00000000,
0x40833333,
0x0000000a,
0x00000000,
0,
0x00000000,
0xffffffff,
0x3d4ccccd,
0x80530000,
0.05,
0x8053,
};
struct weaponfunc_shootprojectile invfunc_slayer_flybywire = {
@ -2852,11 +2852,11 @@ struct weaponfunc_shootprojectile invfunc_slayer_flybywire = {
0x00000000,
0x40833333,
0x0000000a,
0x00000000,
0,
0x00000000,
0xffffffff,
0x3d4ccccd,
0x80680000,
0.05,
0x8068,
};
struct inventory_ammo invammo_slayer = {
@ -2941,11 +2941,11 @@ struct weaponfunc_shootprojectile invfunc_devastator_shoot = {
0x00000000,
0x3f800000,
0x00000000,
0x3da3d70a,
0.08,
0x00000028,
0x000004b0,
0x3e99999a,
0x80530000,
0.3,
0x8053,
};
struct weaponfunc_shootprojectile invfunc_devastator_wallhugger = {
@ -2972,11 +2972,11 @@ struct weaponfunc_shootprojectile invfunc_devastator_wallhugger = {
0x00000000,
0x3f800000,
0x00000000,
0x3da3d70a,
0.08,
0x00000028,
0x00000168,
0x3e99999a,
0x80530000,
0.3,
0x8053,
};
struct inventory_ammo invammo_devastator = {
@ -3637,11 +3637,11 @@ struct weaponfunc_shootprojectile invfunc_crossbow_lethal = {
0x00000000,
0x40066666,
0x00000000,
0x00000000,
0,
0x0000003c,
0xffffffff,
0x3d4ccccd,
0xffff0000,
0.05,
-1,
};
struct weaponfunc_shootprojectile invfunc_crossbow_shoot = {
@ -3668,11 +3668,11 @@ struct weaponfunc_shootprojectile invfunc_crossbow_shoot = {
0x00000000,
0x40066666,
0x00000000,
0x00000000,
0,
0x0000003c,
0xffffffff,
0x3d4ccccd,
0xffff0000,
0.05,
-1,
};
struct inventory_ammo invammo_crossbow = {
@ -5953,11 +5953,11 @@ struct weaponfunc_shootprojectile invfunc_rocketlauncher34_primary = {
0x00000000,
0x40066666,
0x00000014,
0x00000000,
0,
0x00000000,
0xffffffff,
0x3d4ccccd,
0x80530000,
0.05,
0x8053,
};
struct inventory_ammo invammo_rocketlauncher34 = {

View File

@ -898,6 +898,7 @@
#define FUNCFLAG_10000000 0x10000000 // grenade launchers
#define FUNCFLAG_20000000 0x20000000 // explosives related
#define FUNCFLAG_HOMINGROCKET 0x40000000
#define FUNCFLAG_80000000 0x80000000
#define GAILIST_IDLE 0x0000
#define GAILIST_UNALERTED_0001 0x0001
@ -3171,11 +3172,13 @@
#define PROJECTILEFLAG_00000001 0x00000001
#define PROJECTILEFLAG_00000002 0x00000002
#define PROJECTILEFLAG_00000004 0x00000004
#define PROJECTILEFLAG_00000010 0x00000010
#define PROJECTILEFLAG_00000080 0x00000080
#define PROJECTILEFLAG_00000800 0x00000800
#define PROJECTILEFLAG_00001000 0x00001000
#define PROJECTILEFLAG_00002000 0x00002000
#define PROJECTILEFLAG_00004000 0x00004000
#define PROJECTILEFLAG_40000000 0x40000000
#define PROJECTILEFLAG_FREE 0x80000000
#define PROPFLAG_01 0x01

View File

@ -69,8 +69,8 @@ void bgun0f09e4e0(void);
void bgun0f09ea90(void);
bool bgun0f09eae4(void);
s32 bgun0f09ebbc(void);
void bgun0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, Mtxf *matrix1, f32 *arg4, Mtxf *matrix2, struct prop *prop, struct coord *pos);
void bgun0f09ed2c(struct defaultobj *obj, struct coord *coord, Mtxf *arg2, f32 *arg3, Mtxf *arg4);
void bgun0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, Mtxf *matrix1, struct coord *arg4, Mtxf *matrix2, struct prop *prop, struct coord *pos);
void bgun0f09ed2c(struct defaultobj *obj, struct coord *coord, Mtxf *arg2, struct coord *arg3, Mtxf *arg4);
struct defaultobj *bgun0f09ee18(struct chrdata *chr, struct gset *gset, struct coord *pos, s16 *rooms, Mtxf *arg4, struct coord *arg5);
void bgunCreateThrownProjectile(s32 handnum, struct gset *gset);
void bgun0f09f848(s32 handnum);
@ -84,7 +84,7 @@ void bgunGetCrossPos(f32 *x, f32 *y);
void bgun0f0a0c08(struct coord *arg0, struct coord *arg1);
void bgun0f0a0c44(s32 handnum, struct coord *arg1, struct coord *arg2);
void bgunCalculateShotSpread(struct coord *arg0, struct coord *arg1, s32 handnum, bool dorandom);
u32 bgun0f0a0fac(void);
void bgun0f0a0fac(struct coord *arg0, s32 weaponnum, s32 funcnum, s32 arg3, s32 crouchpos, bool dual);
void bgunSetLastShootInfo(struct coord *pos, struct coord *dir, s32 handnum);
u32 bgunGetUnk0c30(s32 handnum);
void bgun0f0a134c(s32 handnum);

View File

@ -143,10 +143,10 @@ bool func0f03e9f4(struct chrdata *chr, struct attackanimconfig *animcfg, s32 arg
void chrCalculateAimEndProperties(struct chrdata *chr, struct attackanimconfig *animcfg, bool hasleftgun, bool hasrightgun, f32 shootrotx);
f32 chrGetAimLimitAngle(f32 sqdist);
void chrCalculateHit(struct chrdata *chr, bool *angleokptr, bool *hit, struct gset *gset);
bool func0f03fde4(struct chrdata *chr, s32 handnum, struct coord *arg2);
bool chrGetGunPos(struct chrdata *chr, s32 handnum, struct coord *gunpos);
void chrCalculateShieldHit(struct chrdata *chr, struct coord *pos, struct coord *vector, struct modelnode **node, s32 *hitpart, struct model **model, s32 *side);
void func0f04031c(struct coord *frompos, f32 arg1, struct coord *aimpos, struct coord *arg3);
void func0f0404d4(struct chrdata *chr, s32 arg1);
void chrShoot(struct chrdata *chr, s32 handnum);
void func0f041a74(struct chrdata *chr);
bool func0f041c44(struct chrdata *chr);
void chrAttackAmountUpdateAnimation(struct chrdata *chr);

View File

@ -12,7 +12,7 @@ s32 aibotGetAmmoQuantityByType(struct aibot *aibot, s32 ammotype, bool include_e
s32 aibotTryRemoveAmmoFromReserve(struct aibot *aibot, s32 weaponnum, s32 funcnum, s32 qty);
void aibotGiveAmmoByWeapon(struct aibot *aibot, s32 weaponnum, s32 funcnum, s32 qty);
void aibotGiveAmmoByType(struct aibot *aibot, u32 ammotype, s32 quantity);
bool aibotDoFarsightThing(struct chrdata *chr, u32 arg1, struct coord *arg2, struct coord *arg3);
bool aibotShootFarsightThroughWalls(struct chrdata *chr, s32 arg1, struct coord *arg2, struct coord *arg3);
bool func0f19a29c(u32 weaponnum, bool is_secondary);
u32 aibotGetProjectileThrowInterval(u32 weapon);
u32 ammotypeGetWeapon(u32 ammotype);

View File

@ -213,7 +213,7 @@ struct g_vars {
/*000482*/ u16 unk000482;
/*000484*/ s32 mphilltime;
/*000488*/ s32 totalkills;
/*00048c*/ u32 unk00048c;
/*00048c*/ bool unk00048c;
// 1 when entering game setup
// 2 when entering combat simulator
@ -923,7 +923,7 @@ struct aibot {
/*0x0d8*/ s32 unk0d8;
/*0x0dc*/ u32 unk0dc;
/*0x0e0*/ s16 unk0e0[2];
/*0x0e4*/ f32 unk0e4[2];
/*0x0e4*/ f32 maulercharge[2];
/*0x0ec*/ u32 unk0ec;
/*0x0f0*/ u32 unk0f0;
/*0x0f4*/ u32 unk0f4;
@ -937,7 +937,7 @@ struct aibot {
/*0x11c*/ s32 unk11c;
/*0x120*/ s32 unk120;
/*0x124*/ s32 unk124;
/*0x128*/ u32 unk128;
/*0x128*/ s32 unk128;
/*0x12c*/ u32 unk12c;
/*0x130*/ s8 unk130[12];
/*0x13c*/ f32 playerdistances[12];
@ -1539,7 +1539,7 @@ struct projectile {
/*0x0dc*/ f32 unk0dc;
/*0x0e0*/ f32 unk0e0;
/*0x0e4*/ f32 unk0e4;
/*0x0e8*/ u32 unk0e8;
/*0x0e8*/ struct prop *unk0e8;
/*0x0ec*/ f32 unk0ec;
/*0x0f0*/ f32 unk0f0;
/*0x0f4*/ u32 unk0f4;
@ -3104,12 +3104,12 @@ struct weaponfunc_shootprojectile {
/*0x40*/ s32 projectilemodelnum;
/*0x44*/ u32 unk44;
/*0x48*/ u32 unk48;
/*0x4c*/ u32 unk4c;
/*0x50*/ u32 unk50;
/*0x54*/ u32 unk54;
/*0x58*/ u32 unk58;
/*0x5c*/ u32 unk5c;
/*0x60*/ u32 unk60;
/*0x4c*/ s32 unk4c;
/*0x50*/ f32 unk50;
/*0x54*/ s32 unk54;
/*0x58*/ s32 timer60;
/*0x5c*/ f32 unk5c;
/*0x60*/ s16 unk60;
};
struct weaponfunc_throw {