Decompile playerTick

This commit is contained in:
Ryan Dwyer 2021-06-01 20:11:46 +10:00
parent 5d4decdba0
commit f6efddef20
9 changed files with 232 additions and 1032 deletions

View File

@ -6415,7 +6415,7 @@ void func0f0220ec(struct chrdata *chr, s32 arg1, s32 arg2)
if (g_Vars.tickmode == TICKMODE_CUTSCENE) {
if (chr->prop->type == PROPTYPE_PLAYER) {
chr->hidden &= ~CHRHFLAG_KEEP_CORPSE;
chr->hidden &= ~CHRHFLAG_00000800;
}
if (model->anim
@ -6429,7 +6429,7 @@ void func0f0220ec(struct chrdata *chr, s32 arg1, s32 arg2)
if (chr->chrflags & CHRCFLAG_20000000) {
chr->chrflags &= ~CHRCFLAG_20000000;
} else if (arg2) {
if ((chr->hidden & CHRHFLAG_KEEP_CORPSE) == 0) {
if ((chr->hidden & CHRHFLAG_00000800) == 0) {
modelGetRootPosition(model, &chr->prevpos);
func0001ee18(model, arg1, 1);
func0001b3bc(model);

View File

@ -221,8 +221,8 @@ void aibotAllocate(s32 chrnum, s32 aibotnum)
aibot->unk0e4[0] = 0.0f;
aibot->unk0a4 = func0001ae44(chr->model);
aibot->unk0a8 = 0.0f;
aibot->unk0ac = 0.0f;
aibot->angleoffset = 0.0f;
aibot->speedtheta = 0.0f;
aibot->unk0b0 = func0001ae44(chr->model);
aibot->unk0b4 = 0.0f;

File diff suppressed because it is too large Load Diff

View File

@ -250,7 +250,7 @@ void playerAllocate(s32 index)
g_Vars.players[index]->periminfo.width = 0;
g_Vars.players[index]->bondactivateorreload = 0;
g_Vars.players[index]->unk00d4 = 0;
g_Vars.players[index]->model00d4 = 0;
g_Vars.players[index]->isdead = false;
g_Vars.players[index]->aborted = false;
g_Vars.players[index]->bondhealth = 1;
@ -555,8 +555,8 @@ void playerAllocate(s32 index)
g_Vars.players[index]->lastkilltime60_4 = -1;
g_Vars.players[index]->healthdisplaytime60 = 0;
g_Vars.players[index]->unk1994 = 0;
g_Vars.players[index]->unk1998 = 0;
g_Vars.players[index]->chrmuzzlelast[0] = 0;
g_Vars.players[index]->chrmuzzlelast[1] = 0;
g_Vars.players[index]->healthscale = 1;
g_Vars.players[index]->armourscale = 1;

View File

@ -931,8 +931,8 @@ void mpInitSimulant(struct chrdata *chr, u8 full)
chr->hidden |= CHRHFLAG_00100000;
chrMoveToPos(chr, &pos, rooms, thing, true);
chr->aibot->unk0a4 = func0001ae44(chr->model);
chr->aibot->unk0a8 = 0;
chr->aibot->unk0ac = 0;
chr->aibot->angleoffset = 0;
chr->aibot->speedtheta = 0;
chr->aibot->unk0b0 = func0001ae44(chr->model);
chr->aibot->unk0b4 = 0;
chr->aibot->unk0b8 = 0;
@ -2582,8 +2582,8 @@ bool func0f191448(struct chrdata *chr)
{
struct aibot *aibot;
u32 stack;
f32 a;
f32 b;
f32 speedforwards;
f32 speedsideways;
f32 angle;
f32 angle2;
@ -2599,12 +2599,12 @@ bool func0f191448(struct chrdata *chr)
angle += M_BADTAU;
}
a = aibot->unk06c * cosf(angle) - sinf(angle) * aibot->unk070;
b = aibot->unk06c * sinf(angle) + cosf(angle) * aibot->unk070;
speedforwards = aibot->unk06c * cosf(angle) - sinf(angle) * aibot->unk070;
speedsideways = aibot->unk06c * sinf(angle) + cosf(angle) * aibot->unk070;
func0f0c2a58(chr, chrGuessCrouchPos(chr), b, a, aibot->unk0ac, &aibot->unk0a8, &aibot->unk068);
func0f0c2a58(chr, chrGuessCrouchPos(chr), speedsideways, speedforwards, aibot->speedtheta, &aibot->angleoffset, &aibot->unk068);
angle2 = chrGetInverseTheta(chr) - aibot->unk0a8;
angle2 = chrGetInverseTheta(chr) - aibot->angleoffset;
if (angle2 < 0) {
angle2 += M_BADTAU;
@ -3857,18 +3857,18 @@ glabel var7f1b8ef0
// }
// }
//
// aibot->unk0ac = newangle - oldangle;
// aibot->speedtheta = newangle - oldangle;
//
// if (aibot->unk0ac < 0) {
// aibot->unk0ac += M_BADTAU;
// if (aibot->speedtheta < 0) {
// aibot->speedtheta += M_BADTAU;
// }
//
// if (aibot->unk0ac >= M_BADPI) {
// aibot->unk0ac -= M_BADTAU;
// if (aibot->speedtheta >= M_BADPI) {
// aibot->speedtheta -= M_BADTAU;
// }
//
// aibot->unk0ac /= g_Vars.lvupdate240freal;
// aibot->unk0ac *= 16.236389160156f;
// aibot->speedtheta /= g_Vars.lvupdate240freal;
// aibot->speedtheta *= 16.236389160156f;
//
// while (newangle >= M_BADTAU) {
// newangle -= M_BADTAU;
@ -4367,7 +4367,7 @@ void func0f192a74(struct chrdata *chr)
aibot->unk1d4 -= g_Vars.diffframe60;
}
tmp = g_SimDifficulties[diff].unk10 * (aibot->unk0ac * g_Vars.lvupdate240f);
tmp = g_SimDifficulties[diff].unk10 * (aibot->speedtheta * g_Vars.lvupdate240f);
if (tmp < 0) {
tmp = -tmp;

View File

@ -519,7 +519,7 @@
#define CHRHFLAG_00000100 0x00000100 // Not used in scripts
#define CHRHFLAG_00000200 0x00000200 // Not used in scripts
#define CHRHFLAG_PASSIVE 0x00000400
#define CHRHFLAG_KEEP_CORPSE 0x00000800 // Appears to be misnamed
#define CHRHFLAG_00000800 0x00000800
#define CHRHFLAG_UNTARGETABLE 0x00001000
#define CHRHFLAG_00002000 0x00002000 // Globals, Rescue guards once disguised
#define CHRHFLAG_TRIGGER_BUDDY_WARP 0x00004000
@ -544,6 +544,7 @@
// chr->hidden2
#define CHRH2FLAG_0001 0x0001
#define CHRH2FLAG_0002 0x0002 // Equivalent to OBJFLAG3_00020000
#define CHRH2FLAG_0004 0x0004
#define CHRH2FLAG_BLUESIGHT 0x0008
#define CHRH2FLAG_TICKDURINGAUTOCUT 0x0010
#define CHRH2FLAG_0040 0x0040

View File

@ -140,7 +140,7 @@ f32 chrGetAimAngle(struct chrdata *chr);
f32 func0f03e754(struct chrdata *chr);
s32 func0f03e788(struct chrdata *chr, s32 turning, f32 arg2, f32 arg3, f32 arg4);
bool func0f03e9f4(struct chrdata *chr, struct attackanimconfig *animcfg, s32 arg2, s32 arg3, f32 arg4);
u32 func0f03f778(void);
void func0f03f778(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);

View File

@ -77,7 +77,7 @@ void currentPlayerSetShieldFrac(f32 frac);
s32 getMissionTime(void);
s32 playerTickBeams(struct prop *prop);
s32 playerTick(struct prop *prop);
void func0f0c2a58(struct chrdata *chr, s32 crouchpos, f32 arg2, f32 arg3, f32 arg4, f32 *arg5, struct attackanimconfig **arg6);
void func0f0c2a58(struct chrdata *chr, s32 crouchpos, f32 speedsideways, f32 speedforwards, f32 speedtheta, f32 *angleoffset, struct attackanimconfig **animcfg);
Gfx *playerRender(struct prop *prop, Gfx *gdl, bool withalpha);
Gfx *currentPlayerLoadMatrix(Gfx *gdl);
void func0f0c3320(Mtxf *matrices, s32 count);

View File

@ -874,8 +874,8 @@ struct aibot {
/*0x09d*/ u8 unk09d;
/*0x0a0*/ s32 unk0a0;
/*0x0a4*/ f32 unk0a4;
/*0x0a8*/ f32 unk0a8;
/*0x0ac*/ f32 unk0ac;
/*0x0a8*/ f32 angleoffset;
/*0x0ac*/ f32 speedtheta;
/*0x0b0*/ f32 unk0b0; // likely to be the turn angle to 360 degrees, in radians
/*0x0b4*/ f32 unk0b4;
/*0x0b8*/ f32 unk0b8;
@ -1201,6 +1201,10 @@ struct act_throwgrenade {
/*0x38*/ bool needsequip;
};
struct act_bondmulti {
/*0x2c*/ struct attackanimconfig *animcfg;
};
struct act_druggedcomingup {
/*0x2c*/ s16 timer60;
};
@ -1268,6 +1272,7 @@ struct chrdata {
struct act_gopos act_gopos;
struct act_surprised act_surprised;
struct act_throwgrenade act_throwgrenade;
struct act_bondmulti act_bondmulti;
// act_bot_attackstand uses act_attack
// act_bot_attackkneel uses act_attack
// act_bot_attackstrafe uses act_attack
@ -2507,7 +2512,7 @@ struct player {
/*0x00c8*/ s32 badrockettime;
/*0x00cc*/ u32 gunspeed;
/*0x00d0*/ s32 bondactivateorreload;
/*0x00d4*/ u32 unk00d4;
/*0x00d4*/ struct model *model00d4;
/*0x00d8*/ bool isdead;
/*0x00dc*/ f32 bondhealth; // frac (range 0-1)
/*0x00e0*/ struct audiohandle *chokehandle;
@ -2778,14 +2783,8 @@ struct player {
/*0x1970*/ f32 shootroty;
/*0x1974*/ char *award1;
/*0x1978*/ char *award2;
/*0x197c*/ u32 unk197c;
/*0x1980*/ u32 unk1980;
/*0x1984*/ u32 unk1984;
/*0x1988*/ u16 unk1988;
/*0x198c*/ u32 unk198c;
/*0x1990*/ u32 unk1990;
/*0x1994*/ u32 unk1994;
/*0x1998*/ u32 unk1998;
/*0x197c*/ struct coord chrmuzzlelastpos[2];
/*0x1994*/ s32 chrmuzzlelast[2];
/*0x199c*/ f32 healthscale;
/*0x19a0*/ f32 armourscale;
/*0x19a4*/ f32 speedgo;