From 44ade384bbe8ed18c295eba530085e6ad8e98956 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 26 May 2021 17:39:58 +1000 Subject: [PATCH] Set names for many more struct properties --- src/files/setup/setupdish.c | 6 +- src/files/setup/setupimp.c | 8 +- src/files/setup/setuppam.c | 6 +- src/game/bondgrab.c | 18 +- src/game/bondhead.c | 46 +-- src/game/bondwalk.c | 4 +- src/game/chr/chr.c | 14 +- src/game/chr/chraction.c | 479 ++++++++++++++++--------------- src/game/chr/chraicommands.c | 26 +- src/game/game_00c490.c | 94 +++--- src/game/game_010b20.c | 34 +-- src/game/game_0125a0.c | 10 +- src/game/game_015010.c | 4 +- src/game/game_091e10.c | 8 +- src/game/game_097ba0.c | 70 ++--- src/game/game_0b69d0.c | 14 +- src/game/game_127910.c | 90 +++--- src/game/game_129210.c | 10 +- src/game/game_190260.c | 8 +- src/game/hudmsg.c | 8 +- src/game/propobj.c | 20 +- src/include/commands.h | 7 +- src/include/constants.h | 16 +- src/include/game/chr/chraction.h | 12 +- src/include/game/game_00c490.h | 2 +- src/include/game/game_097ba0.h | 4 +- src/include/game/hudmsg.h | 4 +- src/include/game/propobj.h | 4 +- src/include/types.h | 352 ++++++++--------------- 29 files changed, 642 insertions(+), 736 deletions(-) diff --git a/src/files/setup/setupdish.c b/src/files/setup/setupdish.c index ec5a34562..5de025d02 100644 --- a/src/files/setup/setupdish.c +++ b/src/files/setup/setupdish.c @@ -5878,9 +5878,9 @@ u8 func1000_jo_typing[] = { u8 func1040_lift_door_sounds[] = { // Disable autoguns yield - set_autoturret_type(0x8b, 0x02) - set_autoturret_type(0x8c, 0x02) - set_autoturret_type(0x8d, 0x02) + set_autogun_target_team(0x8b, TEAM_ENEMY) + set_autogun_target_team(0x8c, TEAM_ENEMY) + set_autogun_target_team(0x8d, TEAM_ENEMY) restart_timer beginloop(0x57) diff --git a/src/files/setup/setupimp.c b/src/files/setup/setupimp.c index a82515edb..f130589c6 100644 --- a/src/files/setup/setupimp.c +++ b/src/files/setup/setupimp.c @@ -730,9 +730,11 @@ u8 func0413_defend_pad[] = { u8 func100b_setup_autoguns[] = { yield - set_autoturret_type(OBJ_AUTOGUN1, 0xef) - set_autoturret_type(OBJ_AUTOGUN2, 0xef) - set_autoturret_type(OBJ_AUTOGUN3, 0xef) + + // Make autoguns shoot at everyone except good people + set_autogun_target_team(OBJ_AUTOGUN1, 0xff & ~TEAM_ALLY) + set_autogun_target_team(OBJ_AUTOGUN2, 0xff & ~TEAM_ALLY) + set_autogun_target_team(OBJ_AUTOGUN3, 0xff & ~TEAM_ALLY) if_difficulty_lt(DIFF_SA, /*goto*/ 0x2f) // SA and PA only diff --git a/src/files/setup/setuppam.c b/src/files/setup/setuppam.c index b978c6451..3379d8694 100644 --- a/src/files/setup/setuppam.c +++ b/src/files/setup/setuppam.c @@ -4296,9 +4296,9 @@ u8 unregistered_function1[] = { u8 func1026_setup_autoguns[] = { yield - set_autoturret_type(0xa8, 0x12) - set_autoturret_type(0xa9, 0x12) - set_autoturret_type(0xaa, 0x12) + set_autogun_target_team(0xa8, TEAM_ENEMY | TEAM_ALLY) + set_autogun_target_team(0xa9, TEAM_ENEMY | TEAM_ALLY) + set_autogun_target_team(0xaa, TEAM_ENEMY | TEAM_ALLY) set_ailist(CHR_SELF, GAILIST_IDLE) endlist }; diff --git a/src/game/bondgrab.c b/src/game/bondgrab.c index 2e35b5277..43693ee02 100644 --- a/src/game/bondgrab.c +++ b/src/game/bondgrab.c @@ -48,12 +48,12 @@ void bgrabInit(void) g_Vars.currentplayer->bondmovemode = MOVEMODE_GRAB; - g_Vars.currentplayer->unk1b60 = 0; + g_Vars.currentplayer->bondgrabthetaspeedsum = 0; g_Vars.currentplayer->grabbedprevpos.x = prop->pos.x; g_Vars.currentplayer->grabbedprevpos.y = prop->pos.y; g_Vars.currentplayer->grabbedprevpos.z = prop->pos.z; g_Vars.currentplayer->grabbedrotoffset = 0; - g_Vars.currentplayer->unk1c58 = 0; + g_Vars.currentplayer->grabbedforcez = 0; g_Vars.currentplayer->grabbedposoffset.x = prop->pos.x - g_Vars.currentplayer->prop->pos.x; g_Vars.currentplayer->grabbedposoffset.y = prop->pos.y - g_Vars.currentplayer->prop->pos.y; g_Vars.currentplayer->grabbedposoffset.z = prop->pos.z - g_Vars.currentplayer->prop->pos.z; @@ -78,7 +78,7 @@ void bgrabInit(void) if (prop->type == PROPTYPE_OBJ || prop->type == PROPTYPE_DOOR || prop->type == PROPTYPE_WEAPON) { struct defaultobj *obj = prop->obj; struct hov *hov = NULL; - bool setthething; + bool withforce; if (obj->hidden & OBJHFLAG_AIRBORNE) { struct projectile *projectile = obj->projectile; @@ -109,17 +109,17 @@ void bgrabInit(void) obj->hidden |= OBJHFLAG_GRABBED; if (obj->flags3 & OBJFLAG3_GEOTYPE3) { - setthething = func000276c8(obj->geo3, + withforce = func000276c8(obj->geo3, g_Vars.currentplayer->prop->pos.x, g_Vars.currentplayer->prop->pos.z, 45, 0, 0); } else { - setthething = func000274e0(obj->geo2, + withforce = func000274e0(obj->geo2, g_Vars.currentplayer->prop->pos.x, g_Vars.currentplayer->prop->pos.z, 45, 0, 0); } - if (setthething) { - g_Vars.currentplayer->unk1c58 = 15; + if (withforce) { + g_Vars.currentplayer->grabbedforcez = 15; } } @@ -2815,10 +2815,10 @@ void bgrabUpdateSpeedTheta(void) s32 i; for (i = 0; i < g_Vars.lvupdate240; i++) { - g_Vars.currentplayer->unk1b60 = g_Vars.currentplayer->unk1b60 * mult + speedtheta; + g_Vars.currentplayer->bondgrabthetaspeedsum = g_Vars.currentplayer->bondgrabthetaspeedsum * mult + speedtheta; } - g_Vars.currentplayer->speedtheta = g_Vars.currentplayer->unk1b60 * (PAL ? 0.024800002574921f : 0.01529997587204f); + g_Vars.currentplayer->speedtheta = g_Vars.currentplayer->bondgrabthetaspeedsum * (PAL ? 0.024800002574921f : 0.01529997587204f); } u32 var80070ea8 = 0x00000000; diff --git a/src/game/bondhead.c b/src/game/bondhead.c index 210eb4acd..9a99ec472 100644 --- a/src/game/bondhead.c +++ b/src/game/bondhead.c @@ -148,7 +148,7 @@ void bheadUpdate(f32 arg0, f32 arg1) struct coord modelpos = {0, 0, 0}; bool somebool = func0001e2a8(); - g_Vars.currentplayer->unk03a8 = false; + g_Vars.currentplayer->resetheadtick = false; func0001e29c(false); func0001ee18(&g_Vars.currentplayer->model, g_Vars.lvupdate240, true); @@ -157,7 +157,7 @@ void bheadUpdate(f32 arg0, f32 arg1) func000159b0(&sp40); sp80.matrix = &sp40; - sp80.unk10 = &g_Vars.currentplayer->unk0510; + sp80.unk10 = g_Vars.currentplayer->bondheadmatrices; func0001cebc(&sp80, &g_Vars.currentplayer->model); g_Vars.currentplayer->headbodyoffset.x = g_Vars.currentplayer->standbodyoffset.x; @@ -166,35 +166,35 @@ void bheadUpdate(f32 arg0, f32 arg1) modelGetRootPosition(&g_Vars.currentplayer->model, &modelpos); - modelpos.x -= g_Vars.currentplayer->unk0510.m[3][0]; - modelpos.z -= g_Vars.currentplayer->unk0510.m[3][2]; + modelpos.x -= g_Vars.currentplayer->bondheadmatrices[0].m[3][0]; + modelpos.z -= g_Vars.currentplayer->bondheadmatrices[0].m[3][2]; modelSetRootPosition(&g_Vars.currentplayer->model, &modelpos); } } if (animspeed > 0) { - g_Vars.currentplayer->unk0510.m[3][0] += arg1; - g_Vars.currentplayer->unk0510.m[3][2] *= arg0; + g_Vars.currentplayer->bondheadmatrices[0].m[3][0] += arg1; + g_Vars.currentplayer->bondheadmatrices[0].m[3][2] *= arg0; if (g_Vars.lvupdate240 > 0) { - g_Vars.currentplayer->unk0510.m[3][0] /= g_Vars.lvupdate240freal; - g_Vars.currentplayer->unk0510.m[3][2] /= g_Vars.lvupdate240freal; + g_Vars.currentplayer->bondheadmatrices[0].m[3][0] /= g_Vars.lvupdate240freal; + g_Vars.currentplayer->bondheadmatrices[0].m[3][2] /= g_Vars.lvupdate240freal; } - headpos.x = g_Vars.currentplayer->unk0510.m[3][0] * g_Vars.currentplayer->headamplitude; - headpos.y = (g_Vars.currentplayer->unk0510.m[3][1] - g_Vars.currentplayer->standheight) * + headpos.x = g_Vars.currentplayer->bondheadmatrices[0].m[3][0] * g_Vars.currentplayer->headamplitude; + headpos.y = (g_Vars.currentplayer->bondheadmatrices[0].m[3][1] - g_Vars.currentplayer->standheight) * g_Vars.currentplayer->headamplitude + g_Vars.currentplayer->standheight; - headpos.z = g_Vars.currentplayer->unk0510.m[3][2] * g_Vars.currentplayer->headamplitude; + headpos.z = g_Vars.currentplayer->bondheadmatrices[0].m[3][2] * g_Vars.currentplayer->headamplitude; if (g_Vars.currentplayer->headanim >= 0) { - lookvel.x = g_Vars.currentplayer->unk0510.m[2][0] * g_Vars.currentplayer->sideamplitude; - lookvel.y = g_Vars.currentplayer->unk0510.m[2][1] * g_Vars.currentplayer->headamplitude; - lookvel.z = (g_Vars.currentplayer->unk0510.m[2][2] - 1.0f) * g_Vars.currentplayer->headamplitude + 1.0f; + lookvel.x = g_Vars.currentplayer->bondheadmatrices[0].m[2][0] * g_Vars.currentplayer->sideamplitude; + lookvel.y = g_Vars.currentplayer->bondheadmatrices[0].m[2][1] * g_Vars.currentplayer->headamplitude; + lookvel.z = (g_Vars.currentplayer->bondheadmatrices[0].m[2][2] - 1.0f) * g_Vars.currentplayer->headamplitude + 1.0f; - upvel.x = g_Vars.currentplayer->unk0510.m[1][0] * g_Vars.currentplayer->headamplitude; - upvel.y = (g_Vars.currentplayer->unk0510.m[1][1] - 1.0f) * g_Vars.currentplayer->headamplitude + 1.0f; - upvel.z = g_Vars.currentplayer->unk0510.m[1][2] * g_Vars.currentplayer->headamplitude; + upvel.x = g_Vars.currentplayer->bondheadmatrices[0].m[1][0] * g_Vars.currentplayer->headamplitude; + upvel.y = (g_Vars.currentplayer->bondheadmatrices[0].m[1][1] - 1.0f) * g_Vars.currentplayer->headamplitude + 1.0f; + upvel.z = g_Vars.currentplayer->bondheadmatrices[0].m[1][2] * g_Vars.currentplayer->headamplitude; g_Vars.currentplayer->headwalkingtime60 += g_Vars.lvupdate240_60; @@ -204,13 +204,13 @@ void bheadUpdate(f32 arg0, f32 arg1) bheadSetdamp(PAL ? 0.99699f : 0.99748998880386f); } } else { - lookvel.x = g_Vars.currentplayer->unk0510.m[2][0]; - lookvel.y = g_Vars.currentplayer->unk0510.m[2][1]; - lookvel.z = g_Vars.currentplayer->unk0510.m[2][2]; + lookvel.x = g_Vars.currentplayer->bondheadmatrices[0].m[2][0]; + lookvel.y = g_Vars.currentplayer->bondheadmatrices[0].m[2][1]; + lookvel.z = g_Vars.currentplayer->bondheadmatrices[0].m[2][2]; - upvel.x = g_Vars.currentplayer->unk0510.m[1][0]; - upvel.y = g_Vars.currentplayer->unk0510.m[1][1]; - upvel.z = g_Vars.currentplayer->unk0510.m[1][2]; + upvel.x = g_Vars.currentplayer->bondheadmatrices[0].m[1][0]; + upvel.y = g_Vars.currentplayer->bondheadmatrices[0].m[1][1]; + upvel.z = g_Vars.currentplayer->bondheadmatrices[0].m[1][2]; bheadSetdamp(PAL ? 0.952f : 0.96f); } diff --git a/src/game/bondwalk.c b/src/game/bondwalk.c index 054c1f5b8..753d82a4f 100644 --- a/src/game/bondwalk.c +++ b/src/game/bondwalk.c @@ -35,7 +35,7 @@ void bwalkInit(void) g_Vars.currentplayer->bondonground = 0; g_Vars.currentplayer->tank = NULL; g_Vars.currentplayer->unk1af0 = NULL; - g_Vars.currentplayer->unk1af4 = 0; + g_Vars.currentplayer->bondonturret = false; g_Vars.currentplayer->swaypos = 0; g_Vars.currentplayer->swayoffset = 0; @@ -3342,7 +3342,7 @@ void bwalk0f0c63bc(struct coord *arg0, u32 arg1, s32 types) struct coord sp100; struct coord sp88; - g_Vars.currentplayer->unk1af4 = 0; + g_Vars.currentplayer->bondonturret = false; g_Vars.currentplayer->autocrouchpos = CROUCHPOS_STAND; bwalk0f0c4d98(); diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index 0fd7c02d6..62f9e784d 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -114,9 +114,9 @@ void func0f01e250(void) s32 value; for (i = 0; i < PLAYERCOUNT(); i++) { - g_Vars.players[i]->unk1c44 = 0; - g_Vars.players[i]->unk1c48 = 0; - g_Vars.players[i]->unk1c4c = 0; + g_Vars.players[i]->bondextrapos.x = 0; + g_Vars.players[i]->bondextrapos.y = 0; + g_Vars.players[i]->bondextrapos.z = 0; } func0f02c9b0(); @@ -15515,8 +15515,8 @@ bool chrUpdateGeometry(struct prop *prop, u8 **start, u8 **end) chr->geo.ymax = chr->manground + chr->chrheight; if (chr->actiontype == ACT_SKJUMP) { - if (chr->manground > chr->act_skjump.y) { - chr->geo.ymin = chr->act_skjump.y; + if (chr->manground > chr->act_skjump.ground) { + chr->geo.ymin = chr->act_skjump.ground; } } @@ -15549,8 +15549,8 @@ void propChrGetBbox(struct prop *prop, f32 *width, f32 *ymax, f32 *ymin) *ymax = chr->manground + chr->chrheight; *ymin = chr->manground + 20; - if (chr->actiontype == ACT_SKJUMP && chr->act_skjump.y < chr->manground) { - *ymin = chr->act_skjump.y + 20; + if (chr->actiontype == ACT_SKJUMP && chr->act_skjump.ground < chr->manground) { + *ymin = chr->act_skjump.ground + 20; } } diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index b3596888b..4556dccb8 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -1644,7 +1644,7 @@ f32 func0f02e684(struct prop *prop, f32 arg1, f32 arg2) return func0f02e550(prop, arg1, arg2, CDTYPE_ALL, ymax, ymin); } -void chrStandChooseAnimation(struct chrdata *chr, f32 arg1) +void chrStandChooseAnimation(struct chrdata *chr, f32 mergetime) { struct prop *gun1 = chrGetEquippedWeaponProp(chr, 1); struct prop *gun2 = chrGetEquippedWeaponProp(chr, 0); @@ -1660,7 +1660,7 @@ void chrStandChooseAnimation(struct chrdata *chr, f32 arg1) } if (race == RACE_EYESPY) { - modelSetAnimation(chr->model, 0x13e, 0, 0, 0, arg1); + modelSetAnimation(chr->model, 0x13e, 0, 0, 0, mergetime); } else if (race == RACE_HUMAN) { if (prevanimnum == ANIM_SNIPING_GETDOWN || prevanimnum == ANIM_SNIPING_GETUP @@ -1669,40 +1669,40 @@ void chrStandChooseAnimation(struct chrdata *chr, f32 arg1) } else if ((gun1 && gun2) || (!gun1 && !gun2) || weaponIsOneHanded(gun1) || weaponIsOneHanded(gun2)) { - modelSetAnimation(chr->model, 0x6a, random() % 2, 0, 0.25, arg1); + modelSetAnimation(chr->model, 0x6a, random() % 2, 0, 0.25, mergetime); modelSetAnimLooping(chr->model, 0, 16); } else if (gun2 || gun1) { - modelSetAnimation(chr->model, 0x01, gun1 != NULL, 0, 0.25, arg1); + modelSetAnimation(chr->model, 0x01, gun1 != NULL, 0, 0.25, mergetime); modelSetAnimLooping(chr->model, 0, 16); modelSetAnimEndFrame(chr->model, 120); } } else if (race == RACE_SKEDAR) { - modelSetAnimation(chr->model, 0xc0, random() % 2, 0, 0.5, arg1); + modelSetAnimation(chr->model, 0xc0, random() % 2, 0, 0.5, mergetime); } else if (race == RACE_DRCAROLL) { - modelSetAnimation(chr->model, 0x13e, 0, 0, 0.5, arg1); + modelSetAnimation(chr->model, 0x13e, 0, 0, 0.5, mergetime); } else if (race == RACE_ROBOT) { - modelSetAnimation(chr->model, 0x237, 0, 0, 0.5, arg1); + modelSetAnimation(chr->model, 0x237, 0, 0, 0.5, mergetime); } } -void func0f02e9a0(struct chrdata *chr, f32 arg1) +void func0f02e9a0(struct chrdata *chr, f32 mergetime) { f32 limit = 127; f32 fsleep; chrStopFiring(chr); chr->actiontype = ACT_STAND; - chr->act_stand.unk02c = 0; + chr->act_stand.prestand = false; chr->act_stand.flags = 0; chr->act_stand.entityid = 0; - chr->act_stand.unk038 = 0; - chr->act_stand.unk03c = 2; - chr->act_stand.unk040 = 0; - chr->act_stand.unk044 = random() % 120 + 180; // 180 to 299 - chr->act_stand.unk048 = arg1; - chr->act_stand.face_target = false; + chr->act_stand.reaim = 0; + chr->act_stand.turning = 2; + chr->act_stand.checkfacingwall = false; + chr->act_stand.wallcount = random() % 120 + 180; // 180 to 299 + chr->act_stand.mergetime = mergetime; + chr->act_stand.playwalkanim = false; - fsleep = arg1; + fsleep = mergetime; if (chr->model->anim->playspeed != PALUPF(1.0f)) { fsleep *= PALUPF(1.0f) / chr->model->anim->playspeed; @@ -1717,7 +1717,7 @@ void func0f02e9a0(struct chrdata *chr, f32 arg1) if (modelIsAnimMerging(chr->model) && !chr->aibot) { chr->hidden |= CHRHFLAG_NEEDANIM; } else { - chrStandChooseAnimation(chr, arg1); + chrStandChooseAnimation(chr, mergetime); chr->hidden &= ~CHRHFLAG_NEEDANIM; } } @@ -1732,16 +1732,17 @@ void chrStand(struct chrdata *chr) if (race == RACE_HUMAN && chr->actiontype == ACT_KNEEL) { chrStopFiring(chr); + chr->actiontype = ACT_STAND; - chr->act_stand.unk02c = 1; + chr->act_stand.prestand = true; chr->act_stand.flags = 0; chr->act_stand.entityid = 0; - chr->act_stand.unk038 = 0; - chr->act_stand.unk03c = 2; - chr->act_stand.unk040 = 0; - chr->act_stand.unk044 = random() % 120 + 180; + chr->act_stand.reaim = 0; + chr->act_stand.turning = 2; + chr->act_stand.checkfacingwall = 0; + chr->act_stand.wallcount = random() % 120 + 180; chr->sleep = 0; - chr->act_stand.face_target = false; + chr->act_stand.playwalkanim = false; if (chr->aibot == NULL) { if (modelGetAnimNum(chr->model) == ANIM_KNEEL_SHOOT_RIGHT_HAND) { @@ -1758,15 +1759,15 @@ void chrStand(struct chrdata *chr) } } else if (race == RACE_DRCAROLL || race == RACE_ROBOT) { chr->actiontype = ACT_STAND; - chr->act_stand.unk02c = 1; + chr->act_stand.prestand = true; chr->act_stand.flags = 0; chr->act_stand.entityid = 0; - chr->act_stand.unk038 = 0; - chr->act_stand.unk03c = 2; - chr->act_stand.unk040 = 0; - chr->act_stand.unk044 = random() % 120 + 180; + chr->act_stand.reaim = 0; + chr->act_stand.turning = 2; + chr->act_stand.checkfacingwall = false; + chr->act_stand.wallcount = random() % 120 + 180; chr->sleep = 0; - chr->act_stand.face_target = false; + chr->act_stand.playwalkanim = false; func0f02e9a0(chr, 16); } else { @@ -1784,25 +1785,27 @@ bool chrFaceCover(struct chrdata *chr) } chrStand(chr); - chr->act_stand.unk038 = 0; + chr->act_stand.reaim = 0; chr->act_stand.flags = ATTACKFLAG_AIMATDIRECTION; - chr->act_stand.unk03c = 1; + chr->act_stand.turning = 1; //chr->act_stand.entityid = atan2f(-cover.look->x, -cover.look->z) * (0x4000 / BADDEG2RAD(90)); chr->act_stand.entityid = atan2f(-cover.look->x, -cover.look->z) * 10432.039f; return true; } -void func0f02ed28(struct chrdata *chr, f32 arg1) +void func0f02ed28(struct chrdata *chr, f32 mergetime) { - func0f02e9a0(chr, arg1); - chr->act_stand.unk040 = 1; + func0f02e9a0(chr, mergetime); + + chr->act_stand.checkfacingwall = true; } void chrStop(struct chrdata *chr) { chrStand(chr); - chr->act_stand.unk040 = 1; + + chr->act_stand.checkfacingwall = true; } void chrKneelChooseAnimation(struct chrdata *chr) @@ -2166,26 +2169,26 @@ void chrRunPosChooseAnimation(struct chrdata *chr) if (heavy) { f32 mult = 0.5; #if PAL - chr->act_runpos.unk03c = 1.0f / (func0f02dff0(0x2a) * mult) * distance * 0.83333331346512f; + chr->act_runpos.eta60 = 1.0f / (func0f02dff0(0x2a) * mult) * distance * 0.83333331346512f; #else - chr->act_runpos.unk03c = 1.0f / (func0f02dff0(0x2a) * mult) * distance; + chr->act_runpos.eta60 = 1.0f / (func0f02dff0(0x2a) * mult) * distance; #endif modelSetAnimation(chr->model, 0x2a, flip, 0, mult, 16); } else { f32 mult = 0.5; #if PAL - chr->act_runpos.unk03c = 1.0f / (func0f02dff0(0x59) * mult) * distance * 0.83333331346512f; + chr->act_runpos.eta60 = 1.0f / (func0f02dff0(0x59) * mult) * distance * 0.83333331346512f; #else - chr->act_runpos.unk03c = 1.0f / (func0f02dff0(0x59) * mult) * distance; + chr->act_runpos.eta60 = 1.0f / (func0f02dff0(0x59) * mult) * distance; #endif modelSetAnimation(chr->model, 0x59, flip, 0, mult, 16); } } else if (race == RACE_SKEDAR) { f32 mult = 0.5; #if PAL - chr->act_runpos.unk03c = 1.0f / (func0f02dff0(0x394) * mult) * distance * 0.83333331346512f; + chr->act_runpos.eta60 = 1.0f / (func0f02dff0(0x394) * mult) * distance * 0.83333331346512f; #else - chr->act_runpos.unk03c = 1.0f / (func0f02dff0(0x394) * mult) * distance; + chr->act_runpos.eta60 = 1.0f / (func0f02dff0(0x394) * mult) * distance; #endif modelSetAnimation(chr->model, 0x394, flip, 0, mult, 16); } @@ -2199,8 +2202,8 @@ void chrRunToPos(struct chrdata *chr, struct coord *pos) chr->act_runpos.pos.y = pos->y; chr->act_runpos.pos.z = pos->z; chr->sleep = 0; - chr->act_runpos.unk038 = 30; - chr->act_runpos.unk040 = 0; + chr->act_runpos.neardist = 30; + chr->act_runpos.turnspeed = 0; if (modelIsAnimMerging(chr->model)) { chr->hidden |= CHRHFLAG_NEEDANIM; @@ -2774,10 +2777,10 @@ void chrBeginDead(struct chrdata *chr) } chr->actiontype = ACT_DEAD; - chr->act_dead.fadetimer = chr->aibot ? 0 : -1; - chr->act_dead.allowfade = false; - chr->act_dead.allowreap = false; - chr->act_dead.reaptimer = 0; + chr->act_dead.fadetimer60 = chr->aibot ? 0 : -1; + chr->act_dead.fadenow = false; + chr->act_dead.fadewheninvis = false; + chr->act_dead.invistimer60 = 0; chr->act_dead.notifychrindex = 0; chr->sleep = 0; @@ -5081,11 +5084,11 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho } chr->actiontype = ACT_PREARGH; - chr->act_preargh.pos.x = vector->x; - chr->act_preargh.pos.y = vector->y; - chr->act_preargh.pos.z = vector->z; - chr->act_preargh.angle = angle; - chr->act_preargh.ibh = ibh; + chr->act_preargh.dir.x = vector->x; + chr->act_preargh.dir.y = vector->y; + chr->act_preargh.dir.z = vector->z; + chr->act_preargh.relshotdir = angle; + chr->act_preargh.hitpart = ibh; chr->act_preargh.aplayernum = aplayernum; chr->act_preargh.hand.weaponnum = hand->weaponnum; chr->act_preargh.hand.unk0639 = hand->unk0639; @@ -5749,7 +5752,7 @@ glabel func0f036c08 /* f036ee0: 27bd00a8 */ addiu $sp,$sp,0xa8 ); -void chrGoPosInitCheap(struct chrdata *chr, struct waydata *waydata, struct coord *padpos, struct coord *chrpos) +void chrGoPosInitMagic(struct chrdata *chr, struct waydata *waydata, struct coord *padpos, struct coord *chrpos) { f32 xdiff1 = padpos->x - chr->prop->pos.x; f32 zdiff1 = padpos->z - chr->prop->pos.z; @@ -5759,10 +5762,10 @@ void chrGoPosInitCheap(struct chrdata *chr, struct waydata *waydata, struct coor f32 xdiff2 = padpos->x - chrpos->x; f32 zdiff2 = padpos->z - chrpos->z; - waydata->mode = WAYMODE_CHEAP; + waydata->mode = WAYMODE_MAGIC; - waydata->segdisttotal = sqrtf(xdiff1 * xdiff1 + zdiff1 * zdiff1); - waydata->segdistdone = waydata->segdisttotal - sqrtf(xdiff2 * xdiff2 + zdiff2 * zdiff2); + waydata->magictotal = sqrtf(xdiff1 * xdiff1 + zdiff1 * zdiff1); + waydata->magicdone = waydata->magictotal - sqrtf(xdiff2 * xdiff2 + zdiff2 * zdiff2); chrSetLookAngle(chr, angle); } @@ -5786,11 +5789,11 @@ void chrGoPosGetCurWaypointInfoWithFlags(struct chrdata *chr, struct coord *pos, *flags = pad.flags; } } else { - pos->x = chr->act_gopos.pos.x; - pos->y = chr->act_gopos.pos.y; - pos->z = chr->act_gopos.pos.z; + pos->x = chr->act_gopos.endpos.x; + pos->y = chr->act_gopos.endpos.y; + pos->z = chr->act_gopos.endpos.z; - rooms[0] = chr->act_gopos.rooms[0]; + rooms[0] = chr->act_gopos.endrooms[0]; rooms[1] = -1; if (flags) { @@ -5860,7 +5863,7 @@ void chrGoPosClearRestartTtl(struct chrdata *chr) void chrGoPosConsiderRestart(struct chrdata *chr) { - if (chr->act_gopos.waydata.mode != WAYMODE_CHEAP + if (chr->act_gopos.waydata.mode != WAYMODE_MAGIC && chr->liftaction != LIFTACTION_WAITINGONLIFT && chr->liftaction != LIFTACTION_WAITINGFORLIFT) { if (chr->act_gopos.restartttl == 0) { @@ -5879,7 +5882,7 @@ void chrGoPosConsiderRestart(struct chrdata *chr) if (chr->aibot) { func0f197544(chr); } else { - chrGoToPos(chr, &chr->act_gopos.pos, chr->act_gopos.rooms, chr->act_gopos.flags); + chrGoToPos(chr, &chr->act_gopos.endpos, chr->act_gopos.endrooms, chr->act_gopos.flags); } } else { chr->act_gopos.restartttl -= (u16)g_Vars.lvupdate240_60; @@ -5895,11 +5898,11 @@ void chrGoPosInitExpensive(struct chrdata *chr) chrGoPosGetCurWaypointInfo(chr, &pos, rooms); chr->act_gopos.waydata.mode = WAYMODE_EXPENSIVE; - chr->act_gopos.waydata.unk01 = 0; - chr->act_gopos.waydata.unk02 = 0; - chr->act_gopos.waydata.pos.x = pos.x; - chr->act_gopos.waydata.pos.y = pos.y; - chr->act_gopos.waydata.pos.z = pos.z; + chr->act_gopos.waydata.iter = 0; + chr->act_gopos.waydata.gotaimpos = false; + chr->act_gopos.waydata.aimpos.x = pos.x; + chr->act_gopos.waydata.aimpos.y = pos.y; + chr->act_gopos.waydata.aimpos.z = pos.z; chrGoPosClearRestartTtl(chr); } @@ -6035,10 +6038,10 @@ void func0f037580(struct chrdata *chr) s16 rooms[8]; chr->act_patrol.waydata.mode = WAYMODE_EXPENSIVE; - chr->act_patrol.waydata.unk01 = 0; - chr->act_patrol.waydata.unk02 = 0; + chr->act_patrol.waydata.iter = 0; + chr->act_patrol.waydata.gotaimpos = false; - chrPatrolGetCurWaypointInfo(chr, &chr->act_patrol.waydata.pos, rooms); + chrPatrolGetCurWaypointInfo(chr, &chr->act_patrol.waydata.aimpos, rooms); } void func0f0375b0(struct chrdata *chr) @@ -6203,7 +6206,7 @@ glabel var7f1a8dac /* f037820: 02002025 */ or $a0,$s0,$zero /* f037824: 8fa5012c */ lw $a1,0x12c($sp) /* f037828: 27a600dc */ addiu $a2,$sp,0xdc -/* f03782c: 0fc0dbb9 */ jal chrGoPosInitCheap +/* f03782c: 0fc0dbb9 */ jal chrGoPosInitMagic /* f037830: 8fa7003c */ lw $a3,0x3c($sp) /* f037834: 10000057 */ b .L0f037994 /* f037838: 02002025 */ or $a0,$s0,$zero @@ -6276,7 +6279,7 @@ glabel var7f1a8dac /* f037928: 02002025 */ or $a0,$s0,$zero /* f03792c: 8fa5012c */ lw $a1,0x12c($sp) /* f037930: 27a6005c */ addiu $a2,$sp,0x5c -/* f037934: 0fc0dbb9 */ jal chrGoPosInitCheap +/* f037934: 0fc0dbb9 */ jal chrGoPosInitMagic /* f037938: 8fa7003c */ lw $a3,0x3c($sp) /* f03793c: 10000015 */ b .L0f037994 /* f037940: 02002025 */ or $a0,$s0,$zero @@ -6464,7 +6467,7 @@ glabel var7f1a8dac /* f037820: 02002025 */ or $a0,$s0,$zero /* f037824: 8fa5012c */ lw $a1,0x12c($sp) /* f037828: 27a600dc */ addiu $a2,$sp,0xdc -/* f03782c: 0fc0dbb9 */ jal chrGoPosInitCheap +/* f03782c: 0fc0dbb9 */ jal chrGoPosInitMagic /* f037830: 8fa7003c */ lw $a3,0x3c($sp) /* f037834: 10000057 */ b .L0f037994 /* f037838: 02002025 */ or $a0,$s0,$zero @@ -6537,7 +6540,7 @@ glabel var7f1a8dac /* f037928: 02002025 */ or $a0,$s0,$zero /* f03792c: 8fa5012c */ lw $a1,0x12c($sp) /* f037930: 27a6005c */ addiu $a2,$sp,0x5c -/* f037934: 0fc0dbb9 */ jal chrGoPosInitCheap +/* f037934: 0fc0dbb9 */ jal chrGoPosInitMagic /* f037938: 8fa7003c */ lw $a3,0x3c($sp) /* f03793c: 10000015 */ b .L0f037994 /* f037940: 02002025 */ or $a0,$s0,$zero @@ -6576,9 +6579,9 @@ glabel var7f1a8dac #endif /** - * Calculate the chr's position when using the cheap method of navigating. + * Calculate the chr's position when using the magic method of navigating. * - * The cheap method is used when the chr is off-screen. It measures the distance + * The magic method is used when the chr is off-screen. It measures the distance * between two consecutive pads in the route and simply increments a distance * value along that segment on each tick, ignoring collisions. Meanwhile, the * chr's prop->pos is left as the original location where this segment started. @@ -6595,22 +6598,22 @@ void chrCalculatePosition(struct chrdata *chr, struct coord *pos) s16 rooms[8]; f32 frac; - if (chr->actiontype == ACT_PATROL && chr->act_patrol.waydata.mode == WAYMODE_CHEAP) { + if (chr->actiontype == ACT_PATROL && chr->act_patrol.waydata.mode == WAYMODE_MAGIC) { chrPatrolGetCurWaypointInfo(chr, pos, rooms); - if (!(chr->act_patrol.waydata.segdistdone >= chr->act_patrol.waydata.segdisttotal) - && chr->act_patrol.waydata.segdisttotal > 0) { - frac = chr->act_patrol.waydata.segdistdone / chr->act_patrol.waydata.segdisttotal; + if (!(chr->act_patrol.waydata.magicdone >= chr->act_patrol.waydata.magictotal) + && chr->act_patrol.waydata.magictotal > 0) { + frac = chr->act_patrol.waydata.magicdone / chr->act_patrol.waydata.magictotal; pos->x = (pos->x - chr->prop->pos.x) * frac + chr->prop->pos.x; pos->y = (pos->y - chr->prop->pos.y) * frac + chr->prop->pos.y; pos->z = (pos->z - chr->prop->pos.z) * frac + chr->prop->pos.z; } - } else if (chr->actiontype == ACT_GOPOS && chr->act_gopos.waydata.mode == WAYMODE_CHEAP) { + } else if (chr->actiontype == ACT_GOPOS && chr->act_gopos.waydata.mode == WAYMODE_MAGIC) { chrGoPosGetCurWaypointInfo(chr, pos, rooms); - if (!(chr->act_gopos.waydata.segdistdone >= chr->act_gopos.waydata.segdisttotal) - && chr->act_gopos.waydata.segdisttotal > 0) { - frac = chr->act_gopos.waydata.segdistdone / chr->act_gopos.waydata.segdisttotal; + if (!(chr->act_gopos.waydata.magicdone >= chr->act_gopos.waydata.magictotal) + && chr->act_gopos.waydata.magictotal > 0) { + frac = chr->act_gopos.waydata.magicdone / chr->act_gopos.waydata.magictotal; pos->x = (pos->x - chr->prop->pos.x) * frac + chr->prop->pos.x; pos->y = (pos->y - chr->prop->pos.y) * frac + chr->prop->pos.y; pos->z = (pos->z - chr->prop->pos.z) * frac + chr->prop->pos.z; @@ -6906,7 +6909,7 @@ bool chrGoToPos(struct chrdata *chr, struct coord *pos, s16 *room, u32 flags) s32 isgopos = chr->actiontype == ACT_GOPOS && (chr->act_gopos.flags & GOPOSFLAG_SPEED) == (flags & 0xff & GOPOSFLAG_SPEED) && !func0f02e064(chr); - s32 ischeap = isgopos && chr->act_gopos.waydata.mode == WAYMODE_CHEAP; + s32 ismagic = isgopos && chr->act_gopos.waydata.mode == WAYMODE_MAGIC; struct coord prevpos; s32 numwaypoints = 0; @@ -6916,7 +6919,7 @@ bool chrGoToPos(struct chrdata *chr, struct coord *pos, s16 *room, u32 flags) chr->oldrooms[i] = -1; - if (isgopos && ischeap && chr->act_gopos.waypoints[chr->act_gopos.curindex]) { + if (isgopos && ismagic && chr->act_gopos.waypoints[chr->act_gopos.curindex]) { nextwaypoint = chr->act_gopos.waypoints[chr->act_gopos.curindex]; } else { nextwaypoint = waypointFindClosestToPos(&prop->pos, prop->rooms); @@ -6933,7 +6936,7 @@ bool chrGoToPos(struct chrdata *chr, struct coord *pos, s16 *room, u32 flags) } if (numwaypoints > 1) { - if (isgopos && ischeap) { + if (isgopos && ismagic) { chrCalculatePosition(chr, &prevpos); } else { prevpos.x = prop->pos.x; @@ -6944,21 +6947,21 @@ bool chrGoToPos(struct chrdata *chr, struct coord *pos, s16 *room, u32 flags) chrStopFiring(chr); chr->actiontype = ACT_GOPOS; - chr->act_gopos.pos.x = pos->x; - chr->act_gopos.pos.y = pos->y; - chr->act_gopos.pos.z = pos->z; - roomsCopy(room, chr->act_gopos.rooms); + chr->act_gopos.endpos.x = pos->x; + chr->act_gopos.endpos.y = pos->y; + chr->act_gopos.endpos.z = pos->z; + roomsCopy(room, chr->act_gopos.endrooms); chr->act_gopos.target = lastwaypoint; chr->act_gopos.curindex = 0; chr->act_gopos.flags = flags | GOPOSFLAG_INIT; - chr->act_gopos.unk0ac = 0; + chr->act_gopos.turnspeed = 0; chr->unk32c_21 = 0; chr->act_gopos.waydata.age = random() % 100; - chr->act_gopos.waydata.unk03 = 0; + chr->act_gopos.waydata.gotaimposobj = 0; if (!isgopos) { - chr->act_gopos.cheapend60 = -1; + chr->act_gopos.waydata.lastvisible60 = -1; } for (i = 0; i < MAX_CHRWAYPOINTS; i++) { @@ -6974,15 +6977,15 @@ bool chrGoToPos(struct chrdata *chr, struct coord *pos, s16 *room, u32 flags) chr->act_gopos.flags &= ~(GOPOSFLAG_80 | GOPOSFLAG_DUCK | GOPOSFLAG_20); chrGoPosGetCurWaypointInfo(chr, &curwppos, curwprooms); - if ((!isgopos || ischeap) + if ((!isgopos || ismagic) && g_Vars.normmplayerisrunning == false && (prop->flags & (PROPFLAG_80 | PROPFLAG_40 | PROPFLAG_02)) == 0 && func0f036c08(chr, &curwppos, curwprooms) && chr->inlift == false) { - chrGoPosInitCheap(chr, &chr->act_gopos.waydata, &curwppos, &prevpos); + chrGoPosInitMagic(chr, &chr->act_gopos.waydata, &curwppos, &prevpos); } - if (chr->act_gopos.waydata.mode != WAYMODE_CHEAP + if (chr->act_gopos.waydata.mode != WAYMODE_MAGIC && modelIsAnimMerging(chr->model) && !chr->aibot) { chr->hidden |= CHRHFLAG_NEEDANIM; return true; @@ -7264,7 +7267,7 @@ glabel var7f1a8dd0 /* f038e84: 26650038 */ addiu $a1,$s3,0x38 /* f038e88: 05a00003 */ bltz $t5,.L0f038e98 /* f038e8c: 02003025 */ or $a2,$s0,$zero -/* f038e90: 0fc0dbb9 */ jal chrGoPosInitCheap +/* f038e90: 0fc0dbb9 */ jal chrGoPosInitMagic /* f038e94: 8fa70054 */ lw $a3,0x54($sp) .L0f038e98: /* f038e98: 826e0068 */ lb $t6,0x68($s3) @@ -7384,7 +7387,7 @@ glabel var7f1a8dd0 // chr->act_patrol.forward = true; // // chr->act_patrol.waydata.age = random() % 100; -// chr->act_patrol.waydata.unk03 = 0; +// chr->act_patrol.waydata.gotaimposobj = 0; // // chr->act_patrol.unk78 = -1; // chr->act_patrol.unk7c = 0; @@ -7401,7 +7404,7 @@ glabel var7f1a8dd0 // && (chr->prop->flags & (PROPFLAG_02 | PROPFLAG_40 | PROPFLAG_80)) == 0 // && func0f036c08(chr, &nextpos, nextrooms) // && !chr->inlift) { -// chrGoPosInitCheap(chr, &chr->act_patrol.waydata, &nextpos, &prop->pos); +// chrGoPosInitMagic(chr, &chr->act_patrol.waydata, &nextpos, &prop->pos); // } // // if (chr->act_patrol.waydata.unk30 != 6 && modelIsAnimMerging(chr->model)) { @@ -7756,7 +7759,7 @@ bool chrIsStopped(struct chrdata *chr) return true; } - if (chr->actiontype == ACT_ROBOTATTACK && chr->act_robotattack.unk06e) { + if (chr->actiontype == ACT_ROBOTATTACK && chr->act_robotattack.finished) { return true; } @@ -7765,9 +7768,9 @@ bool chrIsStopped(struct chrdata *chr) } if (chr->actiontype == ACT_STAND - && chr->act_stand.unk02c == 0 - && chr->act_stand.unk038 == 0 - && chr->act_stand.unk03c != 1) { + && !chr->act_stand.prestand + && !chr->act_stand.reaim + && chr->act_stand.turning != 1) { return true; } @@ -7868,7 +7871,7 @@ bool chrIsReadyForOrders(struct chrdata *chr) break; #endif case ACT_ROBOTATTACK: - if (!chr->act_robotattack.unk06e) { + if (!chr->act_robotattack.finished) { return false; } break; @@ -8228,11 +8231,11 @@ bool chrFaceEntity(struct chrdata *chr, u32 attackflags, u32 entityid) if (attackflags != chr->act_stand.flags || entityid != chr->act_stand.entityid) { chr->act_stand.flags = attackflags; chr->act_stand.entityid = entityid; - chr->act_stand.unk038 = 0; - chr->act_stand.unk040 = 0; + chr->act_stand.reaim = 0; + chr->act_stand.checkfacingwall = false; if (attackflags == ATTACKFLAG_AIMATTARGET && entityid == 1) { - chr->act_stand.face_target = true; + chr->act_stand.playwalkanim = true; chr->act_stand.entityid = 0; } } @@ -9850,14 +9853,14 @@ void chrTickSurrender(struct chrdata *chr) void chrFadeCorpse(struct chrdata *chr) { if (chr->actiontype == ACT_DEAD || chr->actiontype == ACT_DRUGGEDKO) { - chr->act_dead.allowfade = true; + chr->act_dead.fadenow = true; } } -void chrEnableReap(struct chrdata *chr) +void chrFadeCorpseWhenOffScreen(struct chrdata *chr) { if (chr->actiontype == ACT_DEAD) { - chr->act_dead.allowreap = true; + chr->act_dead.fadewheninvis = true; } } @@ -9866,10 +9869,10 @@ void chrTickDead(struct chrdata *chr) struct aibot *aibot = chr->aibot; // If fade is active, handle it - if (chr->act_dead.fadetimer >= 0) { - chr->act_dead.fadetimer += g_Vars.lvupdate240_60; + if (chr->act_dead.fadetimer60 >= 0) { + chr->act_dead.fadetimer60 += g_Vars.lvupdate240_60; - if (chr->act_dead.fadetimer >= PALDOWN(90)) { + if (chr->act_dead.fadetimer60 >= PALDOWN(90)) { // Fade finished chr->fadealpha = 0; @@ -9880,24 +9883,24 @@ void chrTickDead(struct chrdata *chr) } } else { // Still fading - chr->fadealpha = (PALDOWN(90) - chr->act_dead.fadetimer) * 255 / PALDOWN(90); + chr->fadealpha = (PALDOWN(90) - chr->act_dead.fadetimer60) * 255 / PALDOWN(90); } } else { // If fade has been triggered (this can happen when the corpse is on // screen and there's lots of other chrs around) - if (chr->act_dead.allowfade) { - chr->act_dead.fadetimer = 0; + if (chr->act_dead.fadenow) { + chr->act_dead.fadetimer60 = 0; chrDropWeapons(chr); } if (chr->prop->flags & PROPFLAG_80) { // Keep corpse for now - chr->act_dead.reaptimer = 0; + chr->act_dead.invistimer60 = 0; } else { - chr->act_dead.reaptimer += g_Vars.lvupdate240_60; + chr->act_dead.invistimer60 += g_Vars.lvupdate240_60; } - if (chr->act_dead.allowreap && chr->act_dead.reaptimer >= PALDOWN(120)) { + if (chr->act_dead.fadewheninvis && chr->act_dead.invistimer60 >= PALDOWN(120)) { // Remove corpse (off-screen) if (aibot == NULL) { chr->hidden |= CHRHFLAG_REAPED; @@ -10344,8 +10347,8 @@ glabel chrTickDruggedComingUp // && g_AnimTablesByRace[race][i].deathanimcount > 0) { // struct animtablerow *row = &g_AnimTablesByRace[race][i].deathanims[random() % g_AnimTablesByRace[race][i].deathanimcount]; // -// chr->act_druggeddrop.thudframe1 = row->thudframe1; -// chr->act_druggeddrop.thudframe2 = row->thudframe2; +// chr->act_die.thudframe1 = row->thudframe1; +// chr->act_die.thudframe2 = row->thudframe2; // // modelSetAnimationWithMerge(model, row->animnum, row->flip, 0, row->speed, 16, true); // @@ -10404,7 +10407,7 @@ void chrTickDruggedDrop(struct chrdata *chr) static s32 thudindex = 0; // If due, play thud 1 sound - if (chr->act_druggeddrop.thudframe1 >= 0 && modelGetCurAnimFrame(model) >= chr->act_druggeddrop.thudframe1) { + if (chr->act_die.thudframe1 >= 0 && modelGetCurAnimFrame(model) >= chr->act_die.thudframe1) { func0f0939f8(NULL, chr->prop, thuds[thudindex], -1, -1, 0, 0, 0, 0, -1, 0, -1, -1, -1, -1); @@ -10414,11 +10417,11 @@ void chrTickDruggedDrop(struct chrdata *chr) thudindex = 0; } - chr->act_druggeddrop.thudframe1 = -1; + chr->act_die.thudframe1 = -1; } // If due, play thud 2 sound - if (chr->act_druggeddrop.thudframe2 >= 0 && modelGetCurAnimFrame(model) >= chr->act_druggeddrop.thudframe2) { + if (chr->act_die.thudframe2 >= 0 && modelGetCurAnimFrame(model) >= chr->act_die.thudframe2) { func0f0939f8(NULL, chr->prop, thuds[thudindex], -1, -1, 0, 0, 0, 0, -1, 0, -1, -1, -1, -1); @@ -10428,17 +10431,17 @@ void chrTickDruggedDrop(struct chrdata *chr) thudindex = 0; } - chr->act_druggeddrop.thudframe2 = -1; + chr->act_die.thudframe2 = -1; } // If falling animation finished, assign ACT_DRUGGEDKO if (modelGetCurAnimFrame(model) >= modelGetAnimEndFrame(model)) { chr->actiontype = ACT_DRUGGEDKO; - chr->act_druggedko.fadetimer = chr->aibot ? 0 : -1; - chr->act_druggedko.allowfade = false; - chr->act_druggedko.allowreap = false; - chr->act_druggedko.reaptimer = 0; - chr->act_druggedko.unk03c = 0; + chr->act_dead.fadetimer60 = chr->aibot ? 0 : -1; + chr->act_dead.fadenow = false; + chr->act_dead.fadewheninvis = false; + chr->act_dead.invistimer60 = 0; + chr->act_dead.notifychrindex = 0; chr->sleep = 0; } @@ -10450,26 +10453,26 @@ void chrTickDruggedKo(struct chrdata *chr) bool reap = false; // If fade is active, handle it - if (chr->act_druggedko.fadetimer >= 0) { - chr->act_druggedko.fadetimer += g_Vars.lvupdate240_60; + if (chr->act_dead.fadetimer60 >= 0) { + chr->act_dead.fadetimer60 += g_Vars.lvupdate240_60; - if (chr->act_druggedko.fadetimer >= PALDOWN(90)) { + if (chr->act_dead.fadetimer60 >= PALDOWN(90)) { reap = true; } else { - chr->fadealpha = (PALDOWN(90) - chr->act_druggedko.fadetimer) * 255 / PALDOWN(90); + chr->fadealpha = (PALDOWN(90) - chr->act_dead.fadetimer60) * 255 / PALDOWN(90); } } else if ((chr->chrflags & CHRCFLAG_KEEPCORPSEKO) == 0) { - if (chr->act_druggedko.allowfade) { - chr->act_druggedko.fadetimer = 0; + if (chr->act_dead.fadenow) { + chr->act_dead.fadetimer60 = 0; } if (chr->prop->flags & PROPFLAG_80) { - chr->act_druggedko.reaptimer = 0; + chr->act_dead.invistimer60 = 0; } else { - chr->act_druggedko.reaptimer += g_Vars.lvupdate240_60; + chr->act_dead.invistimer60 += g_Vars.lvupdate240_60; } - if (chr->act_druggedko.allowreap && chr->act_druggedko.reaptimer >= PALDOWN(120)) { + if (chr->act_dead.fadewheninvis && chr->act_dead.invistimer60 >= PALDOWN(120)) { reap = true; } } @@ -10508,14 +10511,14 @@ void chrTickPreArgh(struct chrdata *chr) struct model *model = chr->model; if (modelGetCurAnimFrame(model) >= modelGetAnimEndFrame(model)) { - struct coord pos; - pos.x = chr->act_preargh.pos.x; - pos.y = chr->act_preargh.pos.y; - pos.z = chr->act_preargh.pos.z; + struct coord dir; + dir.x = chr->act_preargh.dir.x; + dir.y = chr->act_preargh.dir.y; + dir.z = chr->act_preargh.dir.z; - chrReactToDamage(chr, &pos, - chr->act_preargh.angle, - chr->act_preargh.ibh, + chrReactToDamage(chr, &dir, + chr->act_preargh.relshotdir, + chr->act_preargh.hitpart, &chr->act_preargh.hand, chr->act_preargh.aplayernum); } @@ -18108,7 +18111,7 @@ void robotSetMuzzleFlash(struct chrdata *chr, bool right, bool visible) void robotAttack(struct chrdata *chr) { - u32 rand = random() % 20; + u32 numshots = random() % 20; if (chr->unk348 && chr->unk34c) { chr->actiontype = ACT_ROBOTATTACK; @@ -18127,14 +18130,14 @@ void robotAttack(struct chrdata *chr) chr->unk348->unk14 = 0.0f; - chr->act_robotattack.unk02c = 0.0f; - chr->act_robotattack.unk030 = 0.0f; - chr->act_robotattack.unk034 = 0.0f; - chr->act_robotattack.unk044 = 0.0f; - chr->act_robotattack.unk048 = 0.0f; - chr->act_robotattack.unk04c = 0.0f; - chr->act_robotattack.unk05c = 90; - chr->act_robotattack.unk06c = 0; + chr->act_robotattack.pos[0].x = 0.0f; + chr->act_robotattack.pos[0].y = 0.0f; + chr->act_robotattack.pos[0].z = 0.0f; + chr->act_robotattack.dir[0].x = 0.0f; + chr->act_robotattack.dir[0].y = 0.0f; + chr->act_robotattack.dir[0].z = 0.0f; + chr->act_robotattack.guntype[0] = 90; + chr->act_robotattack.firing[0] = false; chr->unk34c->beam->age = -1; chr->unk34c->unk00 = random() % 3; @@ -18144,17 +18147,17 @@ void robotAttack(struct chrdata *chr) chr->unk34c->unk10 = 0.2f; chr->unk34c->unk14 = 0.0f; - chr->act_robotattack.unk060 = 90; - chr->act_robotattack.unk06d = 0; - chr->act_robotattack.unk06e = 0; - chr->act_robotattack.unk064 = rand; - chr->act_robotattack.unk068 = rand; - chr->act_robotattack.unk038 = 0.0f; - chr->act_robotattack.unk03c = 0.0f; - chr->act_robotattack.unk040 = 0.0f; - chr->act_robotattack.unk050 = 0.0f; - chr->act_robotattack.unk054 = 0.0f; - chr->act_robotattack.unk058 = 0.0f; + chr->act_robotattack.guntype[1] = 90; + chr->act_robotattack.firing[1] = false; + chr->act_robotattack.finished = false; + chr->act_robotattack.numshots[0] = numshots; + chr->act_robotattack.numshots[1] = numshots; + chr->act_robotattack.pos[1].x = 0.0f; + chr->act_robotattack.pos[1].y = 0.0f; + chr->act_robotattack.pos[1].z = 0.0f; + chr->act_robotattack.dir[1].x = 0.0f; + chr->act_robotattack.dir[1].y = 0.0f; + chr->act_robotattack.dir[1].z = 0.0f; chrStandChooseAnimation(chr, 16); } @@ -19700,7 +19703,7 @@ void chrTickRunPos(struct chrdata *chr) if (chr->invalidmove == 1 || g_Vars.lvframe60 - PALDOWN(60) > chr->lastmoveok60 - || posIsArrivingLaterallyAtPos(&chr->prevpos, &prop->pos, &chr->act_runpos.pos, chr->act_runpos.unk038)) { + || posIsArrivingLaterallyAtPos(&chr->prevpos, &prop->pos, &chr->act_runpos.pos, chr->act_runpos.neardist)) { if (race == RACE_HUMAN) { modelGetAnimNum(model); } @@ -19732,10 +19735,10 @@ void chrTickRunPos(struct chrdata *chr) return; } - func0f043f2c(chr, &chr->act_runpos.pos, 1, &chr->act_runpos.unk040); + func0f043f2c(chr, &chr->act_runpos.pos, 1, &chr->act_runpos.turnspeed); - if (chr->act_runpos.unk03c > 0) { - chr->act_runpos.unk03c -= g_Vars.lvupdate240_60; + if (chr->act_runpos.eta60 > 0) { + chr->act_runpos.eta60 -= g_Vars.lvupdate240_60; } else { fVar7 = 1; @@ -19749,7 +19752,7 @@ void chrTickRunPos(struct chrdata *chr) fVar7 = func0f02dff0(ANIM_SKEDAR_RUNNING); } - chr->act_runpos.unk038 += fVar7 * g_Vars.lvupdate240freal * modelGetAbsAnimSpeed(model); + chr->act_runpos.neardist += fVar7 * g_Vars.lvupdate240freal * modelGetAbsAnimSpeed(model); } } @@ -22810,7 +22813,7 @@ void chrTickGoPos(struct chrdata *chr) struct coord pos; s16 rooms[8]; struct prop *prop = chr->prop; - bool enteringcheap = false; + bool enteringmagic = false; struct pad pad; bool sp240 = true; struct coord curwppos; @@ -22846,23 +22849,23 @@ void chrTickGoPos(struct chrdata *chr) #endif // Goposforce was not set - restart the action to try and find a new route - chrGoToPos(chr, &chr->act_gopos.pos, chr->act_gopos.rooms, chr->act_gopos.flags); + chrGoToPos(chr, &chr->act_gopos.endpos, chr->act_gopos.endrooms, chr->act_gopos.flags); } chrGoPosConsiderRestart(chr); chrGoPosGetCurWaypointInfoWithFlags(chr, &curwppos, curwprooms, &curwpflags); - // If cheap mode ended over 3 seconds ago, not multiplayer, not in view of - // eyespy, pad is nothing special and not in lift, then enter the cheap move + // If magic mode ended over 3 seconds ago, not multiplayer, not in view of + // eyespy, pad is nothing special and not in lift, then enter the magic move // mode. - if (chr->act_gopos.waydata.mode != WAYMODE_CHEAP - && chr->act_gopos.cheapend60 + PALDOWN(180) < g_Vars.lvframe60 + if (chr->act_gopos.waydata.mode != WAYMODE_MAGIC + && chr->act_gopos.waydata.lastvisible60 + PALDOWN(180) < g_Vars.lvframe60 && g_Vars.normmplayerisrunning == false && func0f036c08(chr, &curwppos, curwprooms) // related to eyespy && (curwpflags & (PADFLAG_AIWAITLIFT | PADFLAG_AIONLIFT)) == 0 && chr->inlift == false) { - enteringcheap = true; - chrGoPosInitCheap(chr, &chr->act_gopos.waydata, &curwppos, &prop->pos); + enteringmagic = true; + chrGoPosInitMagic(chr, &chr->act_gopos.waydata, &curwppos, &prop->pos); } if (var80062cbc >= 9 @@ -22889,18 +22892,18 @@ void chrTickGoPos(struct chrdata *chr) } #endif - if (chr->act_gopos.waydata.mode == WAYMODE_CHEAP) { - // Check if chr needs to exit cheap mode - if ((!enteringcheap && ((prop->flags & (PROPFLAG_80 | PROPFLAG_40 | PROPFLAG_02)) || !func0f036c08(chr, &curwppos, curwprooms))) + // Check if chr needs to exit magic mode + if (chr->act_gopos.waydata.mode == WAYMODE_MAGIC) { + if ((!enteringmagic && ((prop->flags & (PROPFLAG_80 | PROPFLAG_40 | PROPFLAG_02)) || !func0f036c08(chr, &curwppos, curwprooms))) || (curwpflags & (PADFLAG_AIWAITLIFT | PADFLAG_AIONLIFT)) || chr->inlift) { - // Exiting cheap mode + // Exiting magic mode chrGoPosInitExpensive(chr); - chr->act_gopos.cheapend60 = g_Vars.lvframe60; + chr->act_gopos.waydata.lastvisible60 = g_Vars.lvframe60; return; } - // Tick the cheap mode + // Tick the magic mode func0f0375e8(chr, &chr->act_gopos.waydata, func0f0370a8(chr), &curwppos, curwprooms); return; } @@ -22944,8 +22947,8 @@ void chrTickGoPos(struct chrdata *chr) } } else { // No more waypoints - chr is finished - if (posIsArrivingAtPos(&chr->prevpos, &prop->pos, &chr->act_gopos.pos, 30) || - (chr->inlift && posIsArrivingLaterallyAtPos(&chr->prevpos, &prop->pos, &chr->act_gopos.pos, 30))) { + if (posIsArrivingAtPos(&chr->prevpos, &prop->pos, &chr->act_gopos.endpos, 30) || + (chr->inlift && posIsArrivingLaterallyAtPos(&chr->prevpos, &prop->pos, &chr->act_gopos.endpos, 30))) { if (chr->act_gopos.flags & GOPOSFLAG_FORPATHSTART) { chrTryStartPatrol(chr); return; @@ -22996,11 +22999,11 @@ void chrTickGoPos(struct chrdata *chr) rooms[0] = pad.room; rooms[1] = -1; } else { - pos.x = chr->act_gopos.pos.x; - pos.y = chr->act_gopos.pos.y; - pos.z = chr->act_gopos.pos.z; + pos.x = chr->act_gopos.endpos.x; + pos.y = chr->act_gopos.endpos.y; + pos.z = chr->act_gopos.endpos.z; - roomsCopy(chr->act_gopos.rooms, rooms); + roomsCopy(chr->act_gopos.endrooms, rooms); } // Some bbox related check @@ -23041,11 +23044,11 @@ void chrTickGoPos(struct chrdata *chr) rooms[0] = pad2.room; rooms[1] = -1; } else { - pos.x = chr->act_gopos.pos.x; - pos.y = chr->act_gopos.pos.y; - pos.z = chr->act_gopos.pos.z; + pos.x = chr->act_gopos.endpos.x; + pos.y = chr->act_gopos.endpos.y; + pos.z = chr->act_gopos.endpos.z; - roomsCopy(chr->act_gopos.rooms, rooms); + roomsCopy(chr->act_gopos.endrooms, rooms); } // I suspect this is making the chr turn to face the next pad @@ -23089,9 +23092,9 @@ void chrTickGoPos(struct chrdata *chr) pos.y = pad.pos.y; pos.z = pad.pos.z; } else { - pos.x = chr->act_gopos.pos.x; - pos.y = chr->act_gopos.pos.y; - pos.z = chr->act_gopos.pos.z; + pos.x = chr->act_gopos.endpos.x; + pos.y = chr->act_gopos.endpos.y; + pos.z = chr->act_gopos.endpos.z; if (chr->aibot && chr->myaction == MA_AIBOTGETITEM) { sp240 = false; @@ -23168,7 +23171,7 @@ glabel chrTickPatrol /* f0474b8: 8fa7006c */ lw $a3,0x6c($sp) /* f0474bc: afaa0068 */ sw $t2,0x68($sp) /* f0474c0: 27a60058 */ addiu $a2,$sp,0x58 -/* f0474c4: 0fc0dbb9 */ jal chrGoPosInitCheap +/* f0474c4: 0fc0dbb9 */ jal chrGoPosInitMagic /* f0474c8: 24e70008 */ addiu $a3,$a3,0x8 .L0f0474cc: /* f0474cc: 820b0038 */ lb $t3,0x38($s0) @@ -23357,7 +23360,7 @@ glabel chrTickPatrol /* f0474b8: 8fa7006c */ lw $a3,0x6c($sp) /* f0474bc: afaa0068 */ sw $t2,0x68($sp) /* f0474c0: 27a60058 */ addiu $a2,$sp,0x58 -/* f0474c4: 0fc0dbb9 */ jal chrGoPosInitCheap +/* f0474c4: 0fc0dbb9 */ jal chrGoPosInitMagic /* f0474c8: 24e70008 */ addiu $a3,$a3,0x8 .L0f0474cc: /* f0474cc: 820b0038 */ lb $t3,0x38($s0) @@ -23504,7 +23507,7 @@ bool chrStartSkJump(struct chrdata *chr, u8 arg1, u8 arg2, s32 arg3, u8 arg4) f32 distance = chrGetDistanceToCoord(chr, &target->pos); f32 diffs[2]; f32 thing; - s32 hspeed; + s32 time60; if (distance < 200 || distance > 550 || !target) { return false; @@ -23522,19 +23525,19 @@ bool chrStartSkJump(struct chrdata *chr, u8 arg1, u8 arg2, s32 arg3, u8 arg4) diffs[0] = target->pos.x - chr->prop->pos.x; diffs[1] = target->pos.z - chr->prop->pos.z; thing = sqrtf(diffs[0] * diffs[0] + diffs[1] * diffs[1]) * 2.5f / PALUPF(21.0f); - hspeed = thing; + time60 = thing; - if (hspeed < PALDOWN(10)) { - hspeed = PALDOWN(10); + if (time60 < PALDOWN(10)) { + time60 = PALDOWN(10); } - chr->act_skjump.xspeed = diffs[0] / hspeed; - chr->act_skjump.zspeed = diffs[1] / hspeed; - chr->act_skjump.angle = chrGetInverseTheta(chr) + chrGetAngleToPos(chr, &target->pos); + chr->act_skjump.vel[0] = diffs[0] / time60; + chr->act_skjump.vel[1] = diffs[1] / time60; + chr->act_skjump.roty = chrGetInverseTheta(chr) + chrGetAngleToPos(chr, &target->pos); chr->act_skjump.hit = false; - chr->act_skjump.unk03c = hspeed; - chr->act_skjump.unk04c = hspeed; - chr->act_skjump.y = cdFindGroundYSimple(&chr->prop->pos, chr->chrwidth, chr->prop->rooms, NULL, NULL); + chr->act_skjump.timer60 = time60; + chr->act_skjump.total60 = time60; + chr->act_skjump.ground = cdFindGroundYSimple(&chr->prop->pos, chr->chrwidth, chr->prop->rooms, NULL, NULL); } else { return false; } @@ -23586,7 +23589,7 @@ void chrTickSkJump(struct chrdata *chr) switch (chr->act_skjump.state) { case SKJUMPSTATE_TAKEOFF: fVar6 = chrGetInverseTheta(chr); - fVar5 = func0001afe8(fVar6, chr->act_skjump.angle, 0.35); + fVar5 = func0001afe8(fVar6, chr->act_skjump.roty, 0.35); chrSetLookAngle(chr, fVar5); frame = modelGetCurAnimFrame(chr->model); @@ -23596,31 +23599,31 @@ void chrTickSkJump(struct chrdata *chr) } break; case SKJUMPSTATE_AIRBORNE: - chr->act_skjump.newpos.x = chr->act_skjump.xspeed * g_Vars.lvupdate240_60 + chr->prop->pos.x; - chr->act_skjump.newpos.z = chr->act_skjump.zspeed * g_Vars.lvupdate240_60 + chr->prop->pos.z; + chr->act_skjump.pos.x = chr->act_skjump.vel[0] * g_Vars.lvupdate240_60 + chr->prop->pos.x; + chr->act_skjump.pos.z = chr->act_skjump.vel[1] * g_Vars.lvupdate240_60 + chr->prop->pos.z; - if (chr->act_skjump.unk04c > 0) { - fVar6 = 1.0f - chr->act_skjump.unk03c / (f32)chr->act_skjump.unk04c; + if (chr->act_skjump.total60 > 0) { + fVar6 = 1.0f - chr->act_skjump.timer60 / (f32)chr->act_skjump.total60; fVar7 = sinf(M_PI * fVar6); - fVar7 = fVar7 * 160.0f + chr->act_skjump.y; + fVar7 = fVar7 * 160.0f + chr->act_skjump.ground; } else { fVar6 = 1; - fVar7 = chr->act_skjump.y; + fVar7 = chr->act_skjump.ground; } - chr->act_skjump.newpos.y = fVar7 - chr->prop->pos.y; + chr->act_skjump.pos.y = fVar7 - chr->prop->pos.y; - if (fVar6 < 0.5f && chr->act_skjump.newpos.y < 0.0f) { - chr->act_skjump.newpos.y = 0; + if (fVar6 < 0.5f && chr->act_skjump.pos.y < 0.0f) { + chr->act_skjump.pos.y = 0; } - if (chr->act_skjump.hit == false && chrGetDistanceToTarget(chr) < 150.0f) { + if (!chr->act_skjump.hit && chrGetDistanceToTarget(chr) < 150.0f) { chrPunchInflictDamage(chr, 3, 150, false); chr->act_skjump.hit = true; } - if (chr->act_skjump.unk03c > 0) { - chr->act_skjump.unk03c -= g_Vars.lvupdate240_60; + if (chr->act_skjump.timer60 > 0) { + chr->act_skjump.timer60 -= g_Vars.lvupdate240_60; } else { chrTryStop(chr); } @@ -24194,7 +24197,7 @@ glabel func0f048398 /* f048900: 0007000d */ break 0x7 .L0f048904: /* f048904: 8c8400b8 */ lw $a0,0xb8($a0) -/* f048908: 0fc0f341 */ jal chrEnableReap +/* f048908: 0fc0f341 */ jal chrFadeCorpseWhenOffScreen /* f04890c: 00000000 */ nop /* f048910: 8fa30048 */ lw $v1,0x48($sp) /* f048914: 00105080 */ sll $t2,$s0,0x2 @@ -24240,7 +24243,7 @@ glabel func0f048398 /* f0489a8: 028a1021 */ addu $v0,$s4,$t2 /* f0489ac: 8c440000 */ lw $a0,0x0($v0) /* f0489b0: afa50048 */ sw $a1,0x48($sp) -/* f0489b4: 0fc0f341 */ jal chrEnableReap +/* f0489b4: 0fc0f341 */ jal chrFadeCorpseWhenOffScreen /* f0489b8: afa20044 */ sw $v0,0x44($sp) /* f0489bc: 8fa50048 */ lw $a1,0x48($sp) /* f0489c0: 8fa20044 */ lw $v0,0x44($sp) @@ -24654,7 +24657,7 @@ glabel func0f048398 /* f048900: 0007000d */ break 0x7 .L0f048904: /* f048904: 8c8400b8 */ lw $a0,0xb8($a0) -/* f048908: 0fc0f341 */ jal chrEnableReap +/* f048908: 0fc0f341 */ jal chrFadeCorpseWhenOffScreen /* f04890c: 00000000 */ nop /* f048910: 8fa30048 */ lw $v1,0x48($sp) /* f048914: 00105080 */ sll $t2,$s0,0x2 @@ -24700,7 +24703,7 @@ glabel func0f048398 /* f0489a8: 028a1021 */ addu $v0,$s4,$t2 /* f0489ac: 8c440000 */ lw $a0,0x0($v0) /* f0489b0: afa50048 */ sw $a1,0x48($sp) -/* f0489b4: 0fc0f341 */ jal chrEnableReap +/* f0489b4: 0fc0f341 */ jal chrFadeCorpseWhenOffScreen /* f0489b8: afa20044 */ sw $v0,0x44($sp) /* f0489bc: 8fa50048 */ lw $a1,0x48($sp) /* f0489c0: 8fa20044 */ lw $v0,0x44($sp) @@ -24969,7 +24972,7 @@ glabel func0f048398 /* f047e1c: 0007000d */ break 0x7 .NB0f047e20: /* f047e20: 8d440000 */ lw $a0,0x0($t2) -/* f047e24: 0fc0f140 */ jal chrEnableReap +/* f047e24: 0fc0f140 */ jal chrFadeCorpseWhenOffScreen /* f047e28: 00000000 */ sll $zero,$zero,0x0 /* f047e2c: 8fa30048 */ lw $v1,0x48($sp) /* f047e30: 00116080 */ sll $t4,$s1,0x2 @@ -25012,7 +25015,7 @@ glabel func0f048398 /* f047eb8: 00117080 */ sll $t6,$s1,0x2 /* f047ebc: 02ae1021 */ addu $v0,$s5,$t6 /* f047ec0: 8c440000 */ lw $a0,0x0($v0) -/* f047ec4: 0fc0f140 */ jal chrEnableReap +/* f047ec4: 0fc0f140 */ jal chrFadeCorpseWhenOffScreen /* f047ec8: afa20044 */ sw $v0,0x44($sp) /* f047ecc: 8fa20044 */ lw $v0,0x44($sp) /* f047ed0: 8e0ffffc */ lw $t7,-0x4($s0) @@ -25200,14 +25203,14 @@ glabel func0f048398 // if (chr->actiontype == ACT_DEAD // || (chr->actiontype == ACT_DRUGGEDKO && chr->prop && (chr->chrflags & CHRCFLAG_KEEPCORPSEKO) == 0)) { // if (chr->prop->flags & PROPFLAG_80) { -// if (chr->act_dead.fadetimer < 0 && !chr->act_dead.allowfade) { +// if (chr->act_dead.fadetimer60 < 0 && !chr->act_dead.fadenow) { // numreapablewithpropflag80++; // // if (sp74 < numreapablewithpropflag80 || chr->aibot) { // chrFadeCorpse(chr); // numreapablewithpropflag80--; // } else { -// if (chr->act_dead.allowreap == 0) { +// if (chr->act_dead.fadewheninvis == 0) { // spb8[s1len] = chr; // s1len++; // @@ -25215,7 +25218,7 @@ glabel func0f048398 // writeindex = random() % s1len; // // -// chrEnableReap(spb8[writeindex]); +// chrFadeCorpseWhenOffScreen(spb8[writeindex]); // spb8[writeindex] = spb8[s1len - 1]; // s1len--; // } @@ -25224,7 +25227,7 @@ glabel func0f048398 // } // } else { // // 938 -// if (chr->act_dead.allowreap == 0) { +// if (chr->act_dead.fadewheninvis == 0) { // spa4[s2len] = chr; // s2len++; // @@ -25236,7 +25239,7 @@ glabel func0f048398 // chrBeginDead(spa4[writeindex]); // } // -// chrEnableReap(spa4[writeindex]); +// chrFadeCorpseWhenOffScreen(spa4[writeindex]); // spa4[writeindex] = spa4[s2len - 1]; // s2len--; // } @@ -26809,7 +26812,7 @@ struct prop *chrSpawnAtCoord(s32 bodynum, s32 headnum, struct coord *pos, s16 *r ) { // If we've found a chr that's ready to be reaped, great. // Bail out of the loop. - if (g_ChrSlots[index].act_dead.reaptimer >= PALDOWN(120)) { + if (g_ChrSlots[index].act_dead.invistimer60 >= PALDOWN(120)) { replacechr = &g_ChrSlots[index]; break; } @@ -26827,8 +26830,8 @@ struct prop *chrSpawnAtCoord(s32 bodynum, s32 headnum, struct coord *pos, s16 *r } while (index != startindex); if (replacechr) { - replacechr->act_dead.allowreap = true; - replacechr->act_dead.allowfade = true; + replacechr->act_dead.fadewheninvis = true; + replacechr->act_dead.fadenow = true; } } diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index fdff94b12..16abd8098 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -4015,7 +4015,7 @@ bool aiIfTimerGreaterThan(void) */ bool aiShowCountdownTimer(void) { - countdownTimerSetVisible(1, true); + countdownTimerSetVisible(COUNTDOWNTIMERREASON_AI, true); g_Vars.aioffset += 2; return false; @@ -4026,7 +4026,7 @@ bool aiShowCountdownTimer(void) */ bool aiHideCountdownTimer(void) { - countdownTimerSetVisible(1, false); + countdownTimerSetVisible(COUNTDOWNTIMERREASON_AI, false); g_Vars.aioffset += 2; return false; @@ -5564,14 +5564,14 @@ bool aiRevokeControl(void) u32 playernum = propGetPlayerNum(chr->prop); setCurrentPlayerNum(playernum); currentPlayerSetGunSightVisible(GUNSIGHTREASON_NOCONTROL, false); - func0f0a95ec(2, false); + currentPlayerSetGunAmmoVisible(GUNAMMOREASON_NOCONTROL, false); if ((cmd[3] & 2) == 0) { - currentPlayerSetFlag(PLAYERFLAG_NOCONTROL); + currentPlayerSetHudmsgsOff(HUDMSGREASON_NOCONTROL); } if ((cmd[3] & 4) == 0) { - countdownTimerSetVisible(16, false); + countdownTimerSetVisible(COUNTDOWNTIMERREASON_NOCONTROL, false); } g_PlayersWithControl[g_Vars.currentplayernum] = false; @@ -5595,9 +5595,9 @@ bool aiGrantControl(void) u32 prevplayernum = g_Vars.currentplayernum; setCurrentPlayerNum(propGetPlayerNum(chr->prop)); currentPlayerSetGunSightVisible(GUNSIGHTREASON_NOCONTROL, true); - func0f0a95ec(2, true); - currentPlayerUnsetFlag(PLAYERFLAG_NOCONTROL); - countdownTimerSetVisible(16, true); + currentPlayerSetGunAmmoVisible(GUNAMMOREASON_NOCONTROL, true); + currentPlayerSetHudmsgsOn(HUDMSGREASON_NOCONTROL); + countdownTimerSetVisible(COUNTDOWNTIMERREASON_NOCONTROL, true); g_PlayersWithControl[g_Vars.currentplayernum] = true; setCurrentPlayerNum(prevplayernum); } @@ -11850,7 +11850,7 @@ bool aiSetAutogunType(void) if (obj && obj->prop && obj->type == OBJTYPE_AUTOGUN) { struct autogunobj *autogun = (struct autogunobj *)obj; - autogun->autogun_type = cmd[3]; + autogun->targetteam = cmd[3]; autogun->unka4 = 0; } @@ -12584,10 +12584,10 @@ bool aiChrKill(void) if (chr) { chr->actiontype = ACT_DEAD; - chr->act_dead.fadetimer = -1; - chr->act_dead.allowfade = false; - chr->act_dead.allowreap = false; - chr->act_dead.reaptimer = 0; + chr->act_dead.fadetimer60 = -1; + chr->act_dead.fadenow = false; + chr->act_dead.fadewheninvis = false; + chr->act_dead.invistimer60 = 0; chr->act_dead.notifychrindex = 0; chr->sleep = 0; chr->chrflags |= CHRCFLAG_KEEPCORPSEKO | CHRCFLAG_00010000; diff --git a/src/game/game_00c490.c b/src/game/game_00c490.c index 8dbd025ce..ff62426df 100644 --- a/src/game/game_00c490.c +++ b/src/game/game_00c490.c @@ -1071,13 +1071,13 @@ void setupMine(struct mineobj *mine, s32 cmdindex) mine->base.prop->unk3f_02 = 1; } -void setupCamera(struct cameraobj *camera, s32 cmdindex) +void setupCctv(struct cctvobj *cctv, s32 cmdindex) { - struct defaultobj *obj = &camera->base; + struct defaultobj *obj = &cctv->base; setupGenericObject(obj, cmdindex); - if (camera->lookatpadnum >= 0) { + if (cctv->lookatpadnum >= 0) { struct coord lenspos; union modelrodata *lens = modelGetPartRodata(obj->model->filedata, MODELPART_CCTV_LENS); struct pad pad; @@ -1085,7 +1085,7 @@ void setupCamera(struct cameraobj *camera, s32 cmdindex) f32 ydiff; f32 zdiff; - padUnpack(camera->lookatpadnum, PADFIELD_POS, &pad); + padUnpack(cctv->lookatpadnum, PADFIELD_POS, &pad); lenspos.x = lens->position.pos.x; lenspos.y = lens->position.pos.y; @@ -1105,25 +1105,25 @@ void setupCamera(struct cameraobj *camera, s32 cmdindex) // empty } - func00016d58(&camera->camrotm, 0.0f, 0.0f, 0.0f, xdiff, ydiff, zdiff, 0.0f, 1.0f, 0.0f); - func00015f04(obj->model->scale, &camera->camrotm); + func00016d58(&cctv->camrotm, 0.0f, 0.0f, 0.0f, xdiff, ydiff, zdiff, 0.0f, 1.0f, 0.0f); + func00015f04(obj->model->scale, &cctv->camrotm); - camera->toleft = 0; - camera->yleft = *(s32 *)&camera->yleft * M_BADTAU / 65536.0f; - camera->yright = *(s32 *)&camera->yright * M_BADTAU / 65536.0f; - camera->yspeed = 0.0f; - camera->ymaxspeed = *(s32 *)&camera->ymaxspeed * M_BADTAU / 65536.0f; - camera->maxdist = *(s32 *)&camera->maxdist; - camera->yrot = camera->yleft; + cctv->toleft = 0; + cctv->yleft = *(s32 *)&cctv->yleft * M_BADTAU / 65536.0f; + cctv->yright = *(s32 *)&cctv->yright * M_BADTAU / 65536.0f; + cctv->yspeed = 0.0f; + cctv->ymaxspeed = *(s32 *)&cctv->ymaxspeed * M_BADTAU / 65536.0f; + cctv->maxdist = *(s32 *)&cctv->maxdist; + cctv->yrot = cctv->yleft; - camera->yzero = atan2f(xdiff, zdiff); - camera->xzero = M_BADTAU - atan2f(ydiff, sqrtf(xdiff * xdiff + zdiff * zdiff)); + cctv->yzero = atan2f(xdiff, zdiff); + cctv->xzero = M_BADTAU - atan2f(ydiff, sqrtf(xdiff * xdiff + zdiff * zdiff)); if (xdiff || zdiff) { // empty } - camera->seebondtime60 = 0; + cctv->seebondtime60 = 0; } } @@ -1251,27 +1251,27 @@ void setupAutogun(struct autogunobj *autogun, s32 cmdindex) { setupGenericObject(&autogun->base, cmdindex); - autogun->unk5f = 0; - autogun->unk90 = -1; - autogun->unk94 = -1; - autogun->unk98 = -1; - autogun->unk6c = 0; - autogun->unk70 = 0; - autogun->angleh = 0; - autogun->unk78 = 0; - autogun->unk7c = 0; - autogun->anglev = 0; - autogun->unk88 = 0; - autogun->unk8c = 0; - autogun->unk80 = *(s32 *)&autogun->unk80 * M_BADTAU / 65536.0f; - autogun->unk84 = *(s32 *)&autogun->unk84 * 100.0f / 65536.0f; - autogun->unk64 = *(s32 *)&autogun->unk64 * M_BADTAU / 65536.0f; - autogun->unk68 = *(s32 *)&autogun->unk68 * M_BADTAU / 65536.0f; + autogun->firecount = 0; + autogun->lastseebond60 = -1; + autogun->lastaimbond60 = -1; + autogun->allowsoundframe = -1; + autogun->yrot = 0; + autogun->yspeed = 0; + autogun->yzero = 0; + autogun->xrot = 0; + autogun->xspeed = 0; + autogun->xzero = 0; + autogun->barrelspeed = 0; + autogun->barrelrot = 0; + autogun->maxspeed = *(s32 *)&autogun->maxspeed * M_BADTAU / 65536.0f; + autogun->aimdist = *(s32 *)&autogun->aimdist * 100.0f / 65536.0f; + autogun->ymaxleft = *(s32 *)&autogun->ymaxleft * M_BADTAU / 65536.0f; + autogun->ymaxright = *(s32 *)&autogun->ymaxright * M_BADTAU / 65536.0f; autogun->beam = malloc(ALIGN16(sizeof(struct beam)), MEMPOOL_STAGE); autogun->beam->age = -1; - autogun->unk5e = 0; + autogun->firing = false; autogun->ammoquantity = 255; - autogun->unka0 = 0; + autogun->shotbondsum = 0; if (autogun->targetpad >= 0) { u32 stack1; @@ -1287,11 +1287,11 @@ void setupAutogun(struct autogunobj *autogun, s32 cmdindex) ydiff = pad.pos.y - autogun->base.prop->pos.y; zdiff = pad.pos.z - autogun->base.prop->pos.z; - autogun->angleh = atan2f(xdiff, zdiff); - autogun->anglev = atan2f(ydiff, sqrtf(xdiff * xdiff + zdiff * zdiff)); + autogun->yzero = atan2f(xdiff, zdiff); + autogun->xzero = atan2f(ydiff, sqrtf(xdiff * xdiff + zdiff * zdiff)); } else if (autogun->base.modelnum == MODEL_CETROOFGUN) { // Deep Sea roofgun - autogun->anglev = -1.5705462694168f; + autogun->xzero = -1.5705462694168f; } } #endif @@ -2781,7 +2781,7 @@ void setupLoadFiles(s32 stagenum) total += setupCountCommandType(OBJTYPE_KEY); total += setupCountCommandType(OBJTYPE_HAT); total += setupCountCommandType(OBJTYPE_DOOR); - total += setupCountCommandType(OBJTYPE_CAMERA); + total += setupCountCommandType(OBJTYPE_CCTV); total += setupCountCommandType(OBJTYPE_AUTOGUN); total += setupCountCommandType(OBJTYPE_HANGINGMONITORS); total += setupCountCommandType(OBJTYPE_SINGLEMONITOR); @@ -2955,9 +2955,9 @@ void setupParseObjects(s32 stagenum) setupHat((struct hatobj *)obj, index); } break; - case OBJTYPE_CAMERA: + case OBJTYPE_CCTV: if (withobjs && (obj->flags2 & diffflag) == 0) { - setupCamera((struct cameraobj *)obj, index); + setupCctv((struct cctvobj *)obj, index); } break; case OBJTYPE_AUTOGUN: @@ -3362,14 +3362,14 @@ void setupParseObjects(s32 stagenum) } } break; - case OBJTYPE_CAMERA2: + case OBJTYPE_CAMERAPOS: { - struct camera2obj *camera = (struct camera2obj *)obj; - camera->unk04 = *(s32 *)&camera->unk04 / 100.0f; - camera->unk08 = *(s32 *)&camera->unk08 / 100.0f; - camera->unk0c = *(s32 *)&camera->unk0c / 100.0f; - camera->unk10 = *(s32 *)&camera->unk10 / 65536.0f; - camera->unk14 = *(s32 *)&camera->unk14 / 65536.0f; + struct cameraposobj *camera = (struct cameraposobj *)obj; + camera->x = *(s32 *)&camera->x / 100.0f; + camera->y = *(s32 *)&camera->y / 100.0f; + camera->z = *(s32 *)&camera->z / 100.0f; + camera->theta = *(s32 *)&camera->theta / 65536.0f; + camera->verta = *(s32 *)&camera->verta / 65536.0f; } break; case OBJTYPE_BEGINOBJECTIVE: diff --git a/src/game/game_010b20.c b/src/game/game_010b20.c index 4b63570a4..3eff9afc2 100644 --- a/src/game/game_010b20.c +++ b/src/game/game_010b20.c @@ -148,7 +148,7 @@ void func0f010bb0(void) } g_Vars.currentplayer->gunctrl.unk158c = malloc(i, MEMPOOL_STAGE); - g_Vars.currentplayer->gunctrl.unk159c = 0; + g_Vars.currentplayer->gunctrl.handfilenum = 0; g_Vars.currentplayer->gunctrl.unk15a0 = 0; g_Vars.currentplayer->gunctrl.unk15a4 = 0; g_Vars.currentplayer->gunctrl.unk15b0 = 0; @@ -210,22 +210,22 @@ void func0f010bb0(void) g_Vars.currentplayer->aimtype = 0; g_Vars.currentplayer->crosspos[0] = 0; g_Vars.currentplayer->crosspos[1] = 0; - g_Vars.currentplayer->unk1668 = 0; - g_Vars.currentplayer->unk166c = 0; - g_Vars.currentplayer->unk1670 = 0.9f; - g_Vars.currentplayer->unk1674 = 0; - g_Vars.currentplayer->unk1678 = 0; - g_Vars.currentplayer->unk167c = 0; - g_Vars.currentplayer->unk1680 = 0; - g_Vars.currentplayer->unk1684 = 0.9f; - g_Vars.currentplayer->unk1688 = 0; - g_Vars.currentplayer->unk168c = -M_PI; - g_Vars.currentplayer->unk1690 = 0; - g_Vars.currentplayer->unk16d4 = 0; + g_Vars.currentplayer->crosspossum[0] = 0; + g_Vars.currentplayer->crosspossum[1] = 0; + g_Vars.currentplayer->guncrossdamp = 0.9f; + g_Vars.currentplayer->crosspos2[0] = 0; + g_Vars.currentplayer->crosspos2[1] = 0; + g_Vars.currentplayer->crosssum2[0] = 0; + g_Vars.currentplayer->crosssum2[1] = 0; + g_Vars.currentplayer->gunaimdamp = 0.9f; + g_Vars.currentplayer->aimangle.x = 0; + g_Vars.currentplayer->aimangle.y = -M_PI; + g_Vars.currentplayer->aimangle.z = 0; + g_Vars.currentplayer->copiedgoldeneye = false; g_Vars.currentplayer->magnetattracttime = -1; - g_Vars.currentplayer->unk16dc = 0; - g_Vars.currentplayer->unk16e0 = 0; - g_Vars.currentplayer->unk16e4 = 0; + g_Vars.currentplayer->gunsync = 0; + g_Vars.currentplayer->syncchange = 0; + g_Vars.currentplayer->synccount = 0; g_Vars.currentplayer->syncoffset = 0; g_Vars.currentplayer->cyclesum = 0; g_Vars.currentplayer->gunampsum = 0; @@ -237,7 +237,7 @@ void func0f010bb0(void) func0f09d140(HAND_LEFT); func0f09d140(HAND_LEFT); - g_Vars.currentplayer->unk16d8 = 0; + g_Vars.currentplayer->gunammooff = 0; g_Vars.currentplayer->gunsightoff = GUNSIGHTREASON_AIMING; g_Vars.currentplayer->gunzoomfovs[0] = 15; g_Vars.currentplayer->gunzoomfovs[1] = 60; diff --git a/src/game/game_0125a0.c b/src/game/game_0125a0.c index 496fb2eb4..939410d50 100644 --- a/src/game/game_0125a0.c +++ b/src/game/game_0125a0.c @@ -109,7 +109,7 @@ void currentPlayerInitAnimation(void) g_Vars.currentplayer->headupsum.z = 0; g_Vars.currentplayer->resetheadpos = true; g_Vars.currentplayer->resetheadrot = true; - g_Vars.currentplayer->unk03a8 = true; + g_Vars.currentplayer->resetheadtick = true; g_Vars.currentplayer->headbodyoffset.x = 0; g_Vars.currentplayer->headbodyoffset.y = 0; g_Vars.currentplayer->headbodyoffset.z = 0; @@ -147,14 +147,14 @@ void currentPlayerInitAnimation(void) func0001b3bc(&g_Vars.currentplayer->model); func000159b0(&sp48); sp88.matrix = &sp48; - sp88.unk10 = &g_Vars.currentplayer->unk0510; + sp88.unk10 = g_Vars.currentplayer->bondheadmatrices; func0001cebc(&sp88, &g_Vars.currentplayer->model); - g_Vars.currentplayer->standheight = g_Vars.currentplayer->unk0510.m[3][1]; + g_Vars.currentplayer->standheight = g_Vars.currentplayer->bondheadmatrices[0].m[3][1]; g_Vars.currentplayer->standbodyoffset.x = 0; - g_Vars.currentplayer->standbodyoffset.y = g_Vars.currentplayer->unk0550.m[3][1] - g_Vars.currentplayer->unk0510.m[3][1]; - g_Vars.currentplayer->standbodyoffset.z = g_Vars.currentplayer->unk0550.m[3][2] - g_Vars.currentplayer->unk0510.m[3][2]; + g_Vars.currentplayer->standbodyoffset.y = g_Vars.currentplayer->bondheadmatrices[1].m[3][1] - g_Vars.currentplayer->bondheadmatrices[0].m[3][1]; + g_Vars.currentplayer->standbodyoffset.z = g_Vars.currentplayer->bondheadmatrices[1].m[3][2] - g_Vars.currentplayer->bondheadmatrices[0].m[3][2]; modelSetAnimation(&g_Vars.currentplayer->model, var80075c00[g_Vars.currentplayer->headanim].animnum, diff --git a/src/game/game_015010.c b/src/game/game_015010.c index 0271c80e7..a1fd7cd45 100644 --- a/src/game/game_015010.c +++ b/src/game/game_015010.c @@ -18,7 +18,7 @@ void func0f015010(void) case OBJTYPE_BASIC: case OBJTYPE_KEY: case OBJTYPE_ALARM: - case OBJTYPE_CAMERA: + case OBJTYPE_CCTV: case OBJTYPE_AMMOCRATE: case OBJTYPE_WEAPON: case OBJTYPE_SINGLEMONITOR: @@ -69,7 +69,7 @@ void func0f015010(void) case OBJTYPE_RENAMEOBJ: case OBJTYPE_PADLOCKEDDOOR: case OBJTYPE_SAFEITEM: - case OBJTYPE_CAMERA2: + case OBJTYPE_CAMERAPOS: case OBJTYPE_CONDITIONALSCENERY: case OBJTYPE_BLOCKEDPATH: case OBJTYPE_END: diff --git a/src/game/game_091e10.c b/src/game/game_091e10.c index dd49cabb9..1e65265e6 100644 --- a/src/game/game_091e10.c +++ b/src/game/game_091e10.c @@ -33,7 +33,7 @@ u32 setupGetCommandLength(u32 *cmd) case OBJTYPE_24: return 23; case OBJTYPE_KEY: return 24; case OBJTYPE_ALARM: return 23; - case OBJTYPE_CAMERA: return 49; + case OBJTYPE_CCTV: return 49; case OBJTYPE_AMMOCRATE: return 24; case OBJTYPE_WEAPON: return 26; case OBJTYPE_SINGLEMONITOR: return 53; @@ -66,7 +66,7 @@ u32 setupGetCommandLength(u32 *cmd) case OBJTYPE_TRUCK: return 34; case OBJTYPE_HELI: return 35; case OBJTYPE_TANK: return 32; - case OBJTYPE_CAMERA2: return 7; + case OBJTYPE_CAMERAPOS: return 7; case OBJTYPE_LIFT: return 37; case OBJTYPE_CONDITIONALSCENERY: return 5; case OBJTYPE_BLOCKEDPATH: return 4; @@ -317,7 +317,7 @@ struct defaultobj *setupCommandGetObject(u32 cmdindex) case OBJTYPE_BASIC: case OBJTYPE_KEY: case OBJTYPE_ALARM: - case OBJTYPE_CAMERA: + case OBJTYPE_CCTV: case OBJTYPE_AMMOCRATE: case OBJTYPE_WEAPON: case OBJTYPE_SINGLEMONITOR: @@ -366,7 +366,7 @@ struct defaultobj *setupCommandGetObject(u32 cmdindex) case OBJTYPE_RENAMEOBJ: case OBJTYPE_PADLOCKEDDOOR: case OBJTYPE_SAFEITEM: - case OBJTYPE_CAMERA2: + case OBJTYPE_CAMERAPOS: case OBJTYPE_CONDITIONALSCENERY: case OBJTYPE_BLOCKEDPATH: case OBJTYPE_PADEFFECT: diff --git a/src/game/game_097ba0.c b/src/game/game_097ba0.c index f6dc044bb..53cc22d0f 100644 --- a/src/game/game_097ba0.c +++ b/src/game/game_097ba0.c @@ -6069,7 +6069,7 @@ glabel var7f1ac320 /* f09a828: a2060005 */ sb $a2,0x5($s0) .L0f09a82c: /* f09a82c: 8fa4005c */ lw $a0,0x5c($sp) -/* f09a830: 0fc288c2 */ jal func0f0a2308 +/* f09a830: 0fc288c2 */ jal handResetSlideInc /* f09a834: afa70064 */ sw $a3,0x64($sp) /* f09a838: 82020004 */ lb $v0,0x4($s0) /* f09a83c: 44803000 */ mtc1 $zero,$f6 @@ -6399,7 +6399,7 @@ glabel var7f1ac320 /* f09a828: a2060005 */ sb $a2,0x5($s0) .L0f09a82c: /* f09a82c: 8fa4005c */ lw $a0,0x5c($sp) -/* f09a830: 0fc288c2 */ jal func0f0a2308 +/* f09a830: 0fc288c2 */ jal handResetSlideInc /* f09a834: afa70064 */ sw $a3,0x64($sp) /* f09a838: 82020004 */ lb $v0,0x4($s0) /* f09a83c: 44803000 */ mtc1 $zero,$f6 @@ -6729,7 +6729,7 @@ glabel var7f1ac320 /* f098864: a2060005 */ sb $a2,0x5($s0) .NB0f098868: /* f098868: 8fa40054 */ lw $a0,0x54($sp) -/* f09886c: 0fc28021 */ jal func0f0a2308 +/* f09886c: 0fc28021 */ jal handResetSlideInc /* f098870: afa7005c */ sw $a3,0x5c($sp) /* f098874: 82020004 */ lb $v0,0x4($s0) /* f098878: 44803000 */ mtc1 $zero,$f6 @@ -7009,7 +7009,7 @@ const char var7f1ab898[] = "rofftime"; // hand->flashon = true; // } // -// func0f0a2308(handnum); +// handResetSlideInc(handnum); // // hand->loadslide = 0; // @@ -7307,7 +7307,7 @@ bool handTickIncAttackingShoot(struct handweaponinfo *info, s32 handnum, struct if (autofunc->unk48 != NULL && autofunc->unk4c != NULL) { func0f097b64(autofunc->unk48, autofunc->unk4c, hand->gs_float1, auStack68); - func0f097b40(&hand->unk088c, auStack68, &hand->unk08bc); + func0f097b40(hand->upgrademult, auStack68, hand->finalmult); } } @@ -9602,30 +9602,30 @@ void func0f09d8dc(f32 breathing, f32 arg1, f32 arg2, f32 arg3, f32 arg4) player->syncoffset++; } - player->unk16e4 += g_Vars.lvupdate240freal; + player->synccount += g_Vars.lvupdate240freal; - if (player->unk16e4 > 60.0f) { - player->unk16e4 = 0.0f; - player->unk16e0 = (random() * (1.0f / U32_MAX) - 0.5f) * 0.2f / 60.0f; + if (player->synccount > 60.0f) { + player->synccount = 0.0f; + player->syncchange = (random() * (1.0f / U32_MAX) - 0.5f) * 0.2f / 60.0f; } - if (player->unk16e0 + sp4c > 0.0f) { - player->unk16dc += player->unk16e0; + if (player->syncchange + sp4c > 0.0f) { + player->gunsync += player->syncchange; } - if (player->unk16dc > 0.5f) { - player->unk16dc = 0.5f; - } else if (player->unk16dc < -0.5f) { - player->unk16dc = -0.5f; - } else if (player->unk16dc < 0.1f && player->unk16dc > -0.1f) { - if (player->unk16dc > 0.0f) { - player->unk16dc = -0.1f; + if (player->gunsync > 0.5f) { + player->gunsync = 0.5f; + } else if (player->gunsync < -0.5f) { + player->gunsync = -0.5f; + } else if (player->gunsync < 0.1f && player->gunsync > -0.1f) { + if (player->gunsync > 0.0f) { + player->gunsync = -0.1f; } else { - player->unk16dc = 0.1f; + player->gunsync = 0.1f; } } - dampt[1] = dampt[0] + player->syncoffset + player->unk16dc; + dampt[1] = dampt[0] + player->syncoffset + player->gunsync; while (dampt[1] >= 1.0f) { func0f09d140(HAND_LEFT); @@ -16448,9 +16448,9 @@ void handSetAdjustPos(f32 angle) player->hands[1].adjustpos.z = (1 - cosf(angle)) * 5; } -void func0f0a2308(s32 handnum) +void handResetSlideInc(s32 handnum) { - g_Vars.currentplayer->hands[handnum].unk084c = 1; + g_Vars.currentplayer->hands[handnum].slideinc = 1; } GLOBAL_ASM( @@ -24893,9 +24893,9 @@ void func0f0a6c30(void) } player->visionmode = VISIONMODE_XRAY; - player->unk0251 = 24; - player->unk0252 = 8; - player->unk0253 = 24; + player->ecol_1 = 24; + player->ecol_2 = 8; + player->ecol_3 = 24; player->epcol_0 = 2; player->epcol_1 = 0; player->epcol_2 = 1; @@ -24910,9 +24910,9 @@ void func0f0a6c30(void) } player->visionmode = VISIONMODE_XRAY; - player->unk0251 = 16; - player->unk0252 = 24; - player->unk0253 = 8; + player->ecol_1 = 16; + player->ecol_2 = 24; + player->ecol_3 = 8; player->epcol_0 = 0; player->epcol_1 = 1; player->epcol_2 = 2; @@ -30369,12 +30369,12 @@ void func0f0a94d0(u32 operation, struct coord *pos, struct coord *rot) } } -void func0f0a95ec(u32 arg0, bool enable) +void currentPlayerSetGunAmmoVisible(u32 reason, bool enable) { if (enable) { - g_Vars.currentplayer->unk16d8 &= ~arg0; + g_Vars.currentplayer->gunammooff &= ~reason; } else { - g_Vars.currentplayer->unk16d8 |= arg0; + g_Vars.currentplayer->gunammooff |= reason; } } @@ -36797,10 +36797,10 @@ void func0f0abd30(s32 handnum) } } - hand->unk088c = 1; - hand->unk0890 = 1; - hand->unk08bc = 1; - hand->unk08c0 = 1; + hand->upgrademult[0] = 1; + hand->upgrademult[1] = 1; + hand->finalmult[0] = 1; + hand->finalmult[1] = 1; if (gunctrl->ammotypes[0] >= 0) { abmagReset(&hand->abmag); diff --git a/src/game/game_0b69d0.c b/src/game/game_0b69d0.c index 2b8d75024..a4aad5191 100644 --- a/src/game/game_0b69d0.c +++ b/src/game/game_0b69d0.c @@ -657,7 +657,7 @@ glabel var7f1ad568 /* f0b73b4: 8e4a0284 */ lw $t2,0x284($s2) /* f0b73b8: ad4016d8 */ sw $zero,0x16d8($t2) /* f0b73bc: 8e4c0284 */ lw $t4,0x284($s2) -/* f0b73c0: 0fc37e87 */ jal currentPlayerUnsetFlag +/* f0b73c0: 0fc37e87 */ jal currentPlayerSetHudmsgsOn /* f0b73c4: ad8b17a4 */ sw $t3,0x17a4($t4) /* f0b73c8: 8e4d0284 */ lw $t5,0x284($s2) /* f0b73cc: 3c0141f0 */ lui $at,0x41f0 @@ -978,7 +978,7 @@ glabel var7f1ad568 // g_Vars.currentplayer->unk16d8 = 0; // g_Vars.currentplayer->gunsightoff = 2; // -// currentPlayerUnsetFlag(0xffffffff); +// currentPlayerSetHudmsgsOn(0xffffffff); // // angle = M_BADTAU - scenarioChooseSpawnLocation(30, &pos, rooms, g_Vars.currentplayer->prop); // var7f1ad534 // @@ -1193,7 +1193,7 @@ void currentPlayerResetToDefault(void) g_Vars.currentplayer->bondshotspeed[2] = 0; g_Vars.currentplayer->docentreupdown = 0; - g_Vars.currentplayer->unk0104 = 0; + g_Vars.currentplayer->lastupdown60 = 0; g_Vars.currentplayer->prevupdown = 0; g_Vars.currentplayer->movecentrerelease = 0; g_Vars.currentplayer->lookaheadcentreenabled = true; @@ -5488,7 +5488,7 @@ glabel var7f1ad6ac /* f0be1e4: 0fc54d39 */ jal optionsGetAmmoOnScreen /* f0be1e8: 8da40070 */ lw $a0,0x70($t5) /* f0be1ec: 02a02025 */ move $a0,$s5 -/* f0be1f0: 0fc2a68e */ jal func0f0a95ec +/* f0be1f0: 0fc2a68e */ jal currentPlayerSetGunAmmoVisible /* f0be1f4: 00402825 */ move $a1,$v0 /* f0be1f8: 02a02025 */ move $a0,$s5 /* f0be1fc: 0fc2b04c */ jal currentPlayerSetGunSightVisible @@ -7889,7 +7889,7 @@ glabel var7f1ad6ac /* f0bdc78: 0fc54a0d */ jal optionsGetAmmoOnScreen /* f0bdc7c: 8dc40070 */ lw $a0,0x70($t6) /* f0bdc80: 02a02025 */ or $a0,$s5,$zero -/* f0bdc84: 0fc2a57b */ jal func0f0a95ec +/* f0bdc84: 0fc2a57b */ jal currentPlayerSetGunAmmoVisible /* f0bdc88: 00402825 */ or $a1,$v0,$zero /* f0bdc8c: 02a02025 */ or $a0,$s5,$zero /* f0bdc90: 0fc2af1d */ jal currentPlayerSetGunSightVisible @@ -10290,7 +10290,7 @@ glabel var7f1ad6ac /* f0bb8e0: 0fc533c9 */ jal optionsGetAmmoOnScreen /* f0bb8e4: 8dc40070 */ lw $a0,0x70($t6) /* f0bb8e8: 02a02025 */ or $a0,$s5,$zero -/* f0bb8ec: 0fc29ce3 */ jal func0f0a95ec +/* f0bb8ec: 0fc29ce3 */ jal currentPlayerSetGunAmmoVisible /* f0bb8f0: 00402825 */ or $a1,$v0,$zero /* f0bb8f4: 02a02025 */ or $a0,$s5,$zero /* f0bb8f8: 0fc2a675 */ jal currentPlayerSetGunSightVisible @@ -12450,7 +12450,7 @@ glabel var7f1ad6ac // bmoveSetAutoAimY(optionsGetAutoAim(g_Vars.currentplayerstats->mpindex)); // bmoveSetAutoAimX(optionsGetAutoAim(g_Vars.currentplayerstats->mpindex)); // bmoveSetAutoMoveCentreEnabled(optionsGetLookAhead(g_Vars.currentplayerstats->mpindex)); -// func0f0a95ec(1, optionsGetAmmoOnScreen(g_Vars.currentplayerstats->mpindex)); +// currentPlayerSetGunAmmoVisible(GUNAMMOREASON_OPTION, optionsGetAmmoOnScreen(g_Vars.currentplayerstats->mpindex)); // currentPlayerSetGunSightVisible(GUNSIGHTREASON_1, true); // // // dc9c diff --git a/src/game/game_127910.c b/src/game/game_127910.c index 2c5870be0..299c21ac7 100644 --- a/src/game/game_127910.c +++ b/src/game/game_127910.c @@ -265,7 +265,7 @@ void playerAllocate(s32 index) g_Vars.players[index]->healthshowmode = HEALTHSHOWMODE_HIDDEN; g_Vars.players[index]->docentreupdown = false; - g_Vars.players[index]->unk0104 = 0; + g_Vars.players[index]->lastupdown60 = 0; g_Vars.players[index]->prevupdown = 0; g_Vars.players[index]->movecentrerelease = 0; g_Vars.players[index]->lookaheadcentreenabled = true; @@ -326,7 +326,7 @@ void playerAllocate(s32 index) g_Vars.players[index]->controldef = 2; g_Vars.players[index]->resetheadpos = true; g_Vars.players[index]->resetheadrot = true; - g_Vars.players[index]->unk03a8 = true; + g_Vars.players[index]->resetheadtick = true; g_Vars.players[index]->headanim = 0; g_Vars.players[index]->headdamp = (PAL ? 0.9166f : 0.93f); @@ -380,15 +380,15 @@ void playerAllocate(s32 index) g_Vars.players[index]->floorflags = 0; for (i = 0; i < 2; i++) { - g_Vars.players[index]->unk0610[i].unk00 = 640; - g_Vars.players[index]->unk0610[i].unk02 = (PAL ? 544 : 480); - g_Vars.players[index]->unk0610[i].unk04 = 511; - g_Vars.players[index]->unk0610[i].unk06 = 0; + g_Vars.players[index]->viewport[i].unk00 = 640; + g_Vars.players[index]->viewport[i].unk02 = (PAL ? 544 : 480); + g_Vars.players[index]->viewport[i].unk04 = 511; + g_Vars.players[index]->viewport[i].unk06 = 0; - g_Vars.players[index]->unk0610[i].unk08 = 640; - g_Vars.players[index]->unk0610[i].unk0a = (PAL ? 544 : 480); - g_Vars.players[index]->unk0610[i].unk0c = 511; - g_Vars.players[index]->unk0610[i].unk0e = 0; + g_Vars.players[index]->viewport[i].unk08 = 640; + g_Vars.players[index]->viewport[i].unk0a = (PAL ? 544 : 480); + g_Vars.players[index]->viewport[i].unk0c = 511; + g_Vars.players[index]->viewport[i].unk0e = 0; } g_Vars.players[index]->viewx = 100; @@ -438,34 +438,34 @@ void playerAllocate(s32 index) g_Vars.players[index]->crosspos[0] = 0; g_Vars.players[index]->crosspos[1] = 0; - g_Vars.players[index]->unk1668 = 0; - g_Vars.players[index]->unk166c = 0; - g_Vars.players[index]->unk1670 = 0.9f; + g_Vars.players[index]->crosspossum[0] = 0; + g_Vars.players[index]->crosspossum[1] = 0; + g_Vars.players[index]->guncrossdamp = 0.9f; g_Vars.players[index]->hands[HAND_LEFT].crosspos[0] = 0; g_Vars.players[index]->hands[HAND_LEFT].crosspos[1] = 0; - g_Vars.players[index]->hands[HAND_LEFT].unk0cd4 = 0; - g_Vars.players[index]->hands[HAND_LEFT].unk0cd8 = 0; + g_Vars.players[index]->hands[HAND_LEFT].guncrosspossum[0] = 0; + g_Vars.players[index]->hands[HAND_LEFT].guncrosspossum[1] = 0; g_Vars.players[index]->hands[HAND_RIGHT].crosspos[0] = 0; g_Vars.players[index]->hands[HAND_RIGHT].crosspos[1] = 0; - g_Vars.players[index]->hands[HAND_RIGHT].unk0cd4 = 0; - g_Vars.players[index]->hands[HAND_RIGHT].unk0cd8 = 0; + g_Vars.players[index]->hands[HAND_RIGHT].guncrosspossum[0] = 0; + g_Vars.players[index]->hands[HAND_RIGHT].guncrosspossum[1] = 0; - g_Vars.players[index]->unk1674 = 0; - g_Vars.players[index]->unk1678 = 0; - g_Vars.players[index]->unk167c = 0; - g_Vars.players[index]->unk1680 = 0; - g_Vars.players[index]->unk1684 = 0.9f; - g_Vars.players[index]->unk1688 = 0; - g_Vars.players[index]->unk168c = -M_PI; - g_Vars.players[index]->unk1690 = 0; + g_Vars.players[index]->crosspos2[0] = 0; + g_Vars.players[index]->crosspos2[1] = 0; + g_Vars.players[index]->crosssum2[0] = 0; + g_Vars.players[index]->crosssum2[1] = 0; + g_Vars.players[index]->gunaimdamp = 0.9f; + g_Vars.players[index]->aimangle.x = 0; + g_Vars.players[index]->aimangle.y = -M_PI; + g_Vars.players[index]->aimangle.z = 0; - g_Vars.players[index]->unk16d4 = 0; - g_Vars.players[index]->unk16d8 = 0; - g_Vars.players[index]->unk16dc = 0; - g_Vars.players[index]->unk16e0 = 0; - g_Vars.players[index]->unk16e4 = 0; + g_Vars.players[index]->copiedgoldeneye = 0; + g_Vars.players[index]->gunammooff = 0; + g_Vars.players[index]->gunsync = 0; + g_Vars.players[index]->syncchange = 0; + g_Vars.players[index]->synccount = 0; g_Vars.players[index]->syncoffset = 0; g_Vars.players[index]->cyclesum = 0; g_Vars.players[index]->gunampsum = 0; @@ -529,8 +529,8 @@ void playerAllocate(s32 index) g_Vars.players[index]->zoominfovynew = 60; g_Vars.players[index]->fovy = 60; g_Vars.players[index]->aspect = 640.0f / (PAL ? 544.0f : 480.0f); - g_Vars.players[index]->flags = 0; - g_Vars.players[index]->unk1860 = -1; + g_Vars.players[index]->hudmessoff = 0; + g_Vars.players[index]->bondmesscnt = -1; g_Vars.players[index]->weapons = NULL; g_Vars.players[index]->equipment = NULL; @@ -567,21 +567,21 @@ void playerAllocate(s32 index) g_Vars.players[index]->activatetimethis = 0; g_Vars.players[index]->bondmovemode = MOVEMODE_WALK; - g_Vars.players[index]->unk1a48 = 0; - g_Vars.players[index]->unk1a4c = 0; - g_Vars.players[index]->unk1a50 = 0; - g_Vars.players[index]->unk1a54 = 0; - g_Vars.players[index]->unk1a58 = 0; - g_Vars.players[index]->unk1a5c = 0; - g_Vars.players[index]->unk1a60 = 0; - g_Vars.players[index]->unk1a64 = 0; - g_Vars.players[index]->unk1a68 = 0; + g_Vars.players[index]->bondtankthetaspeedsum = 0; + g_Vars.players[index]->bondtankverta = 0; + g_Vars.players[index]->bondtankvertasum = 0; + g_Vars.players[index]->bondturrettheta = 0; + g_Vars.players[index]->bondturretthetasum = 0; + g_Vars.players[index]->bondturretspeedsum = 0; + g_Vars.players[index]->bondturretside = 0; + g_Vars.players[index]->bondturretchange = 0; + g_Vars.players[index]->bondtankslowtime = 0; g_Vars.players[index]->hoverbike = NULL; g_Vars.players[index]->bondonground = false; g_Vars.players[index]->tank = NULL; g_Vars.players[index]->unk1af0 = NULL; - g_Vars.players[index]->unk1af4 = 0; + g_Vars.players[index]->bondonturret = 0; g_Vars.players[index]->grabbedprop = NULL; g_Vars.players[index]->bondtankexplode = false; g_Vars.players[index]->tickdiefinished = false; @@ -633,9 +633,9 @@ void playerAllocate(s32 index) g_Vars.players[index]->footstepdist = 0; g_Vars.players[index]->unk1c64 = 0; - g_Vars.players[index]->unk1c44 = 0; - g_Vars.players[index]->unk1c48 = 0; - g_Vars.players[index]->unk1c4c = 0; + g_Vars.players[index]->bondextrapos.x = 0; + g_Vars.players[index]->bondextrapos.y = 0; + g_Vars.players[index]->bondextrapos.z = 0; g_Vars.players[index]->disguised = false; g_Vars.players[index]->dostartnewlife = false; diff --git a/src/game/game_129210.c b/src/game/game_129210.c index 5f42b4665..261e294ac 100644 --- a/src/game/game_129210.c +++ b/src/game/game_129210.c @@ -173,13 +173,13 @@ void *func0f12955c(s32 count, s32 index, s32 arg2, s32 arg3) && chr->prop && (chr->prop->flags & PROPFLAG_80) == 0 && chr->actiontype == ACT_DEAD - && chr->act_dead.allowreap == false) { + && chr->act_dead.fadewheninvis == false) { if (tally < 6) { chrs[tally] = chr; tally++; } else { rand = random() % tally; - chrEnableReap(chrs[rand]); + chrFadeCorpseWhenOffScreen(chrs[rand]); chrs[rand] = chr; } } @@ -194,7 +194,7 @@ void *func0f12955c(s32 count, s32 index, s32 arg2, s32 arg3) i = random() % tally; if (chrs[i]) { - chrEnableReap(chrs[i]); + chrFadeCorpseWhenOffScreen(chrs[i]); chrs[i] = NULL; rand--; } @@ -351,7 +351,7 @@ glabel func0f12955c .NB0f1243bc: /* f1243bc: 028fc821 */ addu $t9,$s4,$t7 /* f1243c0: 00608825 */ or $s1,$v1,$zero -/* f1243c4: 0fc0f140 */ jal chrEnableReap +/* f1243c4: 0fc0f140 */ jal chrFadeCorpseWhenOffScreen /* f1243c8: 8f240000 */ lw $a0,0x0($t9) /* f1243cc: 0011c080 */ sll $t8,$s1,0x2 /* f1243d0: 02984021 */ addu $t0,$s4,$t8 @@ -382,7 +382,7 @@ glabel func0f12955c /* f124420: 11600006 */ beqz $t3,.NB0f12443c /* f124424: 00036080 */ sll $t4,$v1,0x2 /* f124428: 028c8021 */ addu $s0,$s4,$t4 -/* f12442c: 0fc0f140 */ jal chrEnableReap +/* f12442c: 0fc0f140 */ jal chrFadeCorpseWhenOffScreen /* f124430: 8e040000 */ lw $a0,0x0($s0) /* f124434: ae000000 */ sw $zero,0x0($s0) /* f124438: 2631ffff */ addiu $s1,$s1,-1 diff --git a/src/game/game_190260.c b/src/game/game_190260.c index 1f79d5ddb..6f18d54e7 100644 --- a/src/game/game_190260.c +++ b/src/game/game_190260.c @@ -1096,7 +1096,7 @@ u32 propobjHandlePickupByAibot(struct prop *prop, struct chrdata *chr) return 3; case OBJTYPE_BASIC: case OBJTYPE_ALARM: - case OBJTYPE_CAMERA: + case OBJTYPE_CCTV: case OBJTYPE_CHR: case OBJTYPE_SINGLEMONITOR: case OBJTYPE_MULTIMONITOR: @@ -1121,7 +1121,7 @@ u32 propobjHandlePickupByAibot(struct prop *prop, struct chrdata *chr) case OBJTYPE_SAFE: case OBJTYPE_SAFEITEM: case OBJTYPE_TANK: - case OBJTYPE_CAMERA2: + case OBJTYPE_CAMERAPOS: case OBJTYPE_TINTEDGLASS: break; } @@ -3970,7 +3970,7 @@ f32 aibotCalculateMaxSpeed(struct chrdata *chr) speed *= 0.5f; } else if (chr->actiontype == ACT_GOPOS && chr->act_gopos.waypoints[chr->act_gopos.curindex] == NULL - && chrGetLateralDistanceToCoord(chr, &chr->act_gopos.pos) < 200) { + && chrGetLateralDistanceToCoord(chr, &chr->act_gopos.endpos) < 200) { speed *= 0.5f; } @@ -12640,6 +12640,6 @@ void func0f197544(struct chrdata *chr) } if (!pass) { - chrGoToPos(chr, &chr->act_gopos.pos, chr->act_gopos.rooms, chr->act_gopos.flags); + chrGoToPos(chr, &chr->act_gopos.endpos, chr->act_gopos.endrooms, chr->act_gopos.flags); } } diff --git a/src/game/hudmsg.c b/src/game/hudmsg.c index b7367956c..fb4f7bde8 100644 --- a/src/game/hudmsg.c +++ b/src/game/hudmsg.c @@ -6088,14 +6088,14 @@ glabel var7f1aded8 ); #endif -void currentPlayerUnsetFlag(u32 flag) +void currentPlayerSetHudmsgsOn(u32 reason) { - g_Vars.currentplayer->flags &= ~flag; + g_Vars.currentplayer->hudmessoff &= ~reason; } -void currentPlayerSetFlag(u32 flag) +void currentPlayerSetHudmsgsOff(u32 reason) { - g_Vars.currentplayer->flags |= flag; + g_Vars.currentplayer->hudmessoff |= reason; } void hudmsgRemoveForDeadPlayer(s32 playernum) diff --git a/src/game/propobj.c b/src/game/propobj.c index 263951a1b..dd325eb89 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -33744,9 +33744,9 @@ void escastepTick(struct prop *prop) } } -void cameraTick(struct prop *camprop) +void cctvTick(struct prop *camprop) { - struct cameraobj *camera = (struct cameraobj *)camprop->obj; + struct cctvobj *camera = (struct cctvobj *)camprop->obj; struct defaultobj *obj = camprop->obj; f32 yaw; struct prop *playerprop; @@ -46827,8 +46827,8 @@ s32 objTick(struct prop *prop) if (obj->type == OBJTYPE_DOOR) { doorTick(prop); - } else if (obj->type == OBJTYPE_CAMERA && (obj->flags & OBJFLAG_DEACTIVATED) == 0) { - cameraTick(prop); + } else if (obj->type == OBJTYPE_CCTV && (obj->flags & OBJFLAG_DEACTIVATED) == 0) { + cctvTick(prop); } else if (obj->type == OBJTYPE_FAN) { fanTick(prop); } else if (obj->type == OBJTYPE_AUTOGUN && (obj->flags & OBJFLAG_DEACTIVATED) == 0) { @@ -58125,7 +58125,7 @@ bool func0f085158(struct defaultobj *obj) case OBJTYPE_DOOR: case OBJTYPE_BASIC: case OBJTYPE_ALARM: - case OBJTYPE_CAMERA: + case OBJTYPE_CCTV: case OBJTYPE_SINGLEMONITOR: case OBJTYPE_MULTIMONITOR: case OBJTYPE_HANGINGMONITORS: @@ -72458,18 +72458,18 @@ glabel var7f1ab19c ); #endif -void countdownTimerSetVisible(u32 flag, bool show) +void countdownTimerSetVisible(u32 reason, bool visible) { - if (show) { - g_CountdownTimerVisible &= ~flag; + if (visible) { + g_CountdownTimerVisible &= ~reason; } else { - g_CountdownTimerVisible |= flag; + g_CountdownTimerVisible |= reason; } } bool countdownTimerIsHidden(void) { - return g_CountdownTimerVisible < 1; + return !g_CountdownTimerVisible; } void countdownTimerSetValue(f32 frames) diff --git a/src/include/commands.h b/src/include/commands.h index 72e843ab6..7e9fc4cef 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -3793,10 +3793,13 @@ bool_enable, \ bool_unknown, -#define set_autoturret_type(object, type) \ +/** + * Define the team that an autogun should shoot at. + */ +#define set_autogun_target_team(object, team) \ mkshort(0x01b8), \ object, \ - type, + team, /** * Shuffle the generator switches in Pelagic II. diff --git a/src/include/constants.h b/src/include/constants.h index 159aeed7b..10d08e3d7 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -644,6 +644,9 @@ #define CONTROLMODE_23 6 #define CONTROLMODE_24 7 +#define COUNTDOWNTIMERREASON_AI 0x01 +#define COUNTDOWNTIMERREASON_NOCONTROL 0x10 + #define COVERFLAG_0001 0x0001 #define COVERFLAG_INUSE 0x0002 #define COVERFLAG_AIMSAMEROOM 0x0004 // look + 6 metres is in the same room @@ -976,6 +979,9 @@ #define GUNMEMOWNER_10 10 #define GUNMEMOWNER_11 11 +#define GUNAMMOREASON_OPTION 0x01 +#define GUNAMMOREASON_NOCONTROL 0x02 + #define GUNSIGHTREASON_1 0x01 #define GUNSIGHTREASON_AIMING 0x02 #define GUNSIGHTREASON_NOCONTROL 0x04 @@ -1071,6 +1077,8 @@ #define HUDMSGFLAG_4 0x4 #define HUDMSGFLAG_ALLOWDUPES 0x8 +#define HUDMSGREASON_NOCONTROL 0x00000002 + #define HUDMSGSTATE_FREE 0 #define HUDMSGSTATE_QUEUED 1 #define HUDMSGSTATE_FADINGIN 3 @@ -2975,7 +2983,7 @@ #define OBJTYPE_BASIC 0x03 #define OBJTYPE_KEY 0x04 #define OBJTYPE_ALARM 0x05 -#define OBJTYPE_CAMERA 0x06 +#define OBJTYPE_CCTV 0x06 #define OBJTYPE_AMMOCRATE 0x07 #define OBJTYPE_WEAPON 0x08 #define OBJTYPE_CHR 0x09 @@ -3015,7 +3023,7 @@ #define OBJTYPE_SAFE 0x2b #define OBJTYPE_SAFEITEM 0x2c #define OBJTYPE_TANK 0x2d -#define OBJTYPE_CAMERA2 0x2e +#define OBJTYPE_CAMERAPOS 0x2e #define OBJTYPE_TINTEDGLASS 0x2f #define OBJTYPE_LIFT 0x30 #define OBJTYPE_CONDITIONALSCENERY 0x31 @@ -3114,8 +3122,6 @@ #define PDMODEPROP_DAMAGE 2 #define PDMODEPROP_ACCURACY 3 -#define PLAYERFLAG_NOCONTROL 0x00000002 - #define PORTALCMD_END 0x00 #define PORTALCMD_PUSH 0x01 #define PORTALCMD_POP 0x02 @@ -3756,7 +3762,7 @@ #define VOICEBOX_FEMALE 3 #define WAYMODE_EXPENSIVE 0 -#define WAYMODE_CHEAP 6 +#define WAYMODE_MAGIC 6 #define WEAPON_NONE 0x00 #define WEAPON_UNARMED 0x01 diff --git a/src/include/game/chr/chraction.h b/src/include/game/chr/chraction.h index 2ac2ce059..5581bca84 100644 --- a/src/include/game/chr/chraction.h +++ b/src/include/game/chr/chraction.h @@ -26,7 +26,7 @@ void func0f02e3dc(struct coord *a, struct coord *b, struct coord *c, struct coor void func0f02e4f8(struct coord *arg0, struct coord *arg1, struct coord *dst); f32 func0f02e550(struct prop *prop, f32 arg1, f32 arg2, u32 arg3, f32 ymax, f32 ymin); f32 func0f02e684(struct prop *prop, f32 arg1, f32 arg2); -void chrStandChooseAnimation(struct chrdata *chr, f32 arg1); +void chrStandChooseAnimation(struct chrdata *chr, f32 mergetime); void chrStand(struct chrdata *chr); bool chrFaceCover(struct chrdata *chr); void chrKneelChooseAnimation(struct chrdata *chr); @@ -51,7 +51,7 @@ void chrAttack(struct chrdata *chr, struct attackanimgroup **animgroups, bool fl void chrAttackAmount(struct chrdata *chr, u32 attackflags, u32 entityid, u32 maxshots); void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 ibh, struct shorthand *hand, bool knockout, s32 aplayernum); void chrBeginArgh(struct chrdata *chr, f32 angle, s32 ibh); -void chrReactToDamage(struct chrdata *chr, struct coord *pos, f32 angle, s32 ibh, struct shorthand *hand, s32 playernum); +void chrReactToDamage(struct chrdata *chr, struct coord *dir, f32 angle, s32 ibh, struct shorthand *hand, s32 playernum); void chrYeetFromPos(struct chrdata *chr, struct coord *pos, f32 arg2); s32 handGetBlurAmount(struct shorthand *hand); void chrKnockOut(struct chrdata *chr, f32 angle, s32 ibh, struct shorthand *hand); @@ -76,7 +76,7 @@ bool chrCanRollInDirection(struct chrdata *chr, bool toleft, f32 distance); void chrGetSideVector(struct chrdata *chr, bool side, struct coord *vector); bool chrCanJumpInDirection(struct chrdata *chr, bool side, f32 distance); s32 func0f036c08(struct chrdata *chr, struct coord *arg1, s16 *rooms); -void chrGoPosInitCheap(struct chrdata *chr, struct waydata *waydata, struct coord *arg2, struct coord *prevpos); +void chrGoPosInitMagic(struct chrdata *chr, struct waydata *waydata, struct coord *arg2, struct coord *prevpos); void chrGoPosGetCurWaypointInfoWithFlags(struct chrdata *chr, struct coord *pos, s16 *rooms, u32 *flags); f32 func0f0370a8(struct chrdata *chr); s32 chrGoPosCalculateBaseTtl(struct chrdata *chr); @@ -223,8 +223,8 @@ bool func0f04c874(struct chrdata *chr, u32 angle360, struct coord *pos, u8 arg3, u32 rebuildTeams(void); u32 rebuildSquadrons(void); u32 func0f04d000(struct chrdata *chr); -void func0f02e9a0(struct chrdata *chr, f32 arg1); -void func0f02ed28(struct chrdata *chr, f32 arg1); +void func0f02e9a0(struct chrdata *chr, f32 mergetime); +void func0f02ed28(struct chrdata *chr, f32 mergetime); void chrStop(struct chrdata *chr); void chrKneel(struct chrdata *chr); void chrStartAlarm(struct chrdata *chr); @@ -269,7 +269,7 @@ bool chrTryStartAlarm(struct chrdata *chr, s32 pad_id); s32 chrConsiderGrenadeThrow(struct chrdata *chr, u32 attackflags, u32 entityid); void chrTickKneel(struct chrdata *chr); void chrFadeCorpse(struct chrdata *chr); -void chrEnableReap(struct chrdata *chr); +void chrFadeCorpseWhenOffScreen(struct chrdata *chr); void chrTickTest(struct chrdata *chr); void chrSetLookAngle(struct chrdata *chr, f32 angle); f32 func0f03e578(struct chrdata *chr); diff --git a/src/include/game/game_00c490.h b/src/include/game/game_00c490.h index 683c70f68..2f7ec960b 100644 --- a/src/include/game/game_00c490.h +++ b/src/include/game/game_00c490.h @@ -18,7 +18,7 @@ void weaponAssignToHome(struct weaponobj *weapon, s32 cmdindex); void setupHat(struct hatobj *hat, s32 cmdindex); void setupKey(struct keyobj *key, s32 cmdindex); void setupMine(struct mineobj *mine, s32 cmdindex); -void setupCamera(struct cameraobj *camera, s32 cmdindex); +void setupCctv(struct cctvobj *camera, s32 cmdindex); void setupAutogun(struct autogunobj *autogun, s32 cmdindex); void setupHangingMonitors(struct hangingmonitorsobj *monitors, s32 cmdindex); void setupSingleMonitor(struct singlemonitorobj *monitor, s32 cmdindex); diff --git a/src/include/game/game_097ba0.h b/src/include/game/game_097ba0.h index d3c0c27f0..6df40b41e 100644 --- a/src/include/game/game_097ba0.h +++ b/src/include/game/game_097ba0.h @@ -106,7 +106,7 @@ u16 weaponGetNameId(s32 weaponnum); char *weaponGetShortName(s32 arg0); void currentPlayerReloadHandIfPossible(s32 handnum); void handSetAdjustPos(f32 angle); -void func0f0a2308(s32 handnum); +void handResetSlideInc(s32 handnum); u32 func0f0a233c(void); f32 func0f0a2498(f32 arg0, f32 arg1, f32 arg2, f32 arg3); void func0f0a24f0(struct coord *arg0, s32 handnum); @@ -151,7 +151,7 @@ void handSetAimPos(struct coord *coord); void handSetHitPos(struct coord *coord); void func0f0a9494(u32 operation); void func0f0a94d0(u32 operation, struct coord *pos, struct coord *rot); -void func0f0a95ec(u32 arg0, bool enable); +void currentPlayerSetGunAmmoVisible(u32 reason, bool enable); void currentPlayerSetAmmoQuantity(s32 ammotype, s32 quantity); s32 currentPlayerGetAmmoCountWithCheck(s32 type); s32 currentPlayerGetAmmoCount(s32 ammotype); diff --git a/src/include/game/hudmsg.h b/src/include/game/hudmsg.h index fb843cb35..ef457536c 100644 --- a/src/include/game/hudmsg.h +++ b/src/include/game/hudmsg.h @@ -25,8 +25,8 @@ void hudmsgCreate(char *text, s32 type, s32 conf00, s32 conf01, s32 conf02, u32 textcolour, u32 shadowcolour, u32 alignh, s32 conf16, u32 alignv, s32 conf18, s32 arg14, u32 flags); void hudmsgsTick(void); -void currentPlayerUnsetFlag(u32 flag); -void currentPlayerSetFlag(u32 flag); +void currentPlayerSetHudmsgsOn(u32 reason); +void currentPlayerSetHudmsgsOff(u32 reason); void hudmsgRemoveForDeadPlayer(s32 playernum); Gfx *hudmsgsRender(Gfx *gdl); void hudmsgsReset(void); diff --git a/src/include/game/propobj.h b/src/include/game/propobj.h index cbd3f0654..77841d3d9 100644 --- a/src/include/game/propobj.h +++ b/src/include/game/propobj.h @@ -25,7 +25,7 @@ bool countdownTimerIsHidden(void); bool countdownTimerIsRunning(void); void countdownTimerSetRunning(bool running); void countdownTimerSetValue(f32 frames); -void countdownTimerSetVisible(u32 flag, bool show); +void countdownTimerSetVisible(u32 reason, bool visible); void countdownTimerTick(void); bool doorCallLift(struct prop *doorprop, bool allowclose); bool doorIsPadlockFree(struct doorobj *door); @@ -166,7 +166,7 @@ u32 func0f077448(void); void platformDisplaceProps(struct prop *platform, s16 *propnums, struct coord *prevpos, struct coord *newpos); void liftTick(struct prop *lift); void escastepTick(struct prop *escalator); -void cameraTick(struct prop *camera); +void cctvTick(struct prop *camera); u32 func0f078930(void); void fanTick(struct prop *fan); void fanUpdateModel(struct prop *fan); diff --git a/src/include/types.h b/src/include/types.h index 8b1de94e2..daa59a2dd 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -129,7 +129,7 @@ struct g_vars { /*0002b4*/ u32 knockoutcount; /*0002b8*/ struct textoverride *textoverrides; /*0002bc*/ s32 roomcount; - /*0002c0*/ u32 unk0002c0; + /*0002c0*/ u32 hitboundscount; /*0002c4*/ u32 unk0002c4; /*0002c8*/ u32 unk0002c8; /*0002cc*/ u32 unk0002cc; @@ -1004,15 +1004,15 @@ struct tilething { }; struct act_stand { - /*0x2c*/ s32 unk02c; + /*0x2c*/ s32 prestand; /*0x30*/ u32 flags; /*0x34*/ s32 entityid; - /*0x38*/ u32 unk038; - /*0x3c*/ s32 unk03c; - /*0x40*/ u32 unk040; - /*0x44*/ u32 unk044; - /*0x48*/ f32 unk048; - /*0x4c*/ s8 face_target; + /*0x38*/ u32 reaim; + /*0x3c*/ s32 turning; + /*0x40*/ u32 checkfacingwall; + /*0x44*/ u32 wallcount; + /*0x48*/ f32 mergetime; + /*0x4c*/ s8 playwalkanim; }; struct act_anim { @@ -1045,10 +1045,10 @@ struct act_die { }; struct act_dead { - /*0x2c*/ bool allowfade; - /*0x30*/ bool allowreap; - /*0x34*/ s32 reaptimer; - /*0x38*/ s32 fadetimer; + /*0x2c*/ bool fadenow; + /*0x30*/ bool fadewheninvis; + /*0x34*/ s32 invistimer60; + /*0x38*/ s32 fadetimer60; /*0x3c*/ s32 notifychrindex; }; @@ -1066,9 +1066,9 @@ struct shorthand { }; struct act_preargh { - /*0x2c*/ struct coord pos; - /*0x38*/ f32 angle; - /*0x3c*/ s32 ibh; + /*0x2c*/ struct coord dir; + /*0x38*/ f32 relshotdir; + /*0x3c*/ s32 hitpart; /*0x40*/ struct shorthand hand; /*0x44*/ s32 aplayernum; }; @@ -1122,17 +1122,17 @@ struct act_jumpout { struct act_runpos { /*0x2c*/ struct coord pos; - /*0x38*/ f32 unk038; - /*0x3c*/ s32 unk03c; - /*0x40*/ f32 unk040; + /*0x38*/ f32 neardist; + /*0x3c*/ s32 eta60; + /*0x40*/ f32 turnspeed; }; struct waydata { /*0x00*/ s8 mode; - /*0x01*/ u8 unk01; - /*0x02*/ u8 unk02; - /*0x03*/ u8 unk03; - /*0x04*/ struct coord pos; + /*0x01*/ u8 iter; + /*0x02*/ u8 gotaimpos; + /*0x03*/ u8 gotaimposobj; + /*0x04*/ struct coord aimpos; /*0x10*/ u32 unk10; /*0x14*/ u32 unk14; /*0x18*/ u32 unk18; @@ -1140,14 +1140,15 @@ struct waydata { /*0x20*/ u32 unk20; /*0x24*/ u32 unk24; /*0x28*/ s32 age; - /*0x2c*/ u32 unk2c; - /*0x30*/ s8 unk30; + /*0x2c*/ u32 aimposobj; + /*0x30*/ s8 unk30_test; /*0x34*/ u32 unk34; // These are the distances between the current waypoint and the previous - // when using cheap mode. - /*0x38*/ f32 segdistdone; - /*0x3c*/ f32 segdisttotal; + // when using magic mode. + /*0x38*/ f32 magicdone; + /*0x3c*/ f32 magictotal; + /*0x40*/ s32 lastvisible60; }; struct act_patrol { @@ -1155,13 +1156,12 @@ struct act_patrol { /*0x030*/ s32 nextstep; /*0x034*/ bool forward; /*0x038*/ struct waydata waydata; - /*0x078*/ s32 unk78; - /*0x07c*/ f32 unk7c; + /*0x07c*/ f32 turnspeed; }; struct act_gopos { - /*0x02c*/ struct coord pos; // Target pos - /*0x038*/ s16 rooms[8]; // Target rooms + /*0x02c*/ struct coord endpos; + /*0x038*/ s16 endrooms[8]; /*0x048*/ struct waypoint *target; // Target/final waypoint // Array of pointers to the next couple of waypoints. Recalculated each time @@ -1183,8 +1183,7 @@ struct act_gopos { /*0x066*/ u16 restartttl; /*0x068*/ struct waydata waydata; - /*0x0a8*/ s32 cheapend60; // lvframe60 time that the chr exited cheap method of wayfinding - /*0x0ac*/ f32 unk0ac; + /*0x0ac*/ f32 turnspeed; }; struct act_surprised { @@ -1198,59 +1197,29 @@ struct act_throwgrenade { /*0x38*/ bool needsequip; }; -// This struct likely doesn't exist - act_die was used instead -struct act_druggeddrop { - /*0x2c*/ s32 notifychrindex; - /*0x30*/ f32 thudframe1; - /*0x34*/ f32 thudframe2; -}; - -// This struct likely doesn't exist - act_dead was used instead -struct act_druggedko { - /*0x2c*/ bool allowfade; - /*0x30*/ bool allowreap; - /*0x34*/ s32 reaptimer; - /*0x38*/ s32 fadetimer; - /*0x3c*/ u32 unk03c; -}; - struct act_druggedcomingup { /*0x2c*/ s16 timer60; }; struct act_robotattack { - /*0x2c*/ f32 unk02c; - /*0x30*/ f32 unk030; - /*0x34*/ f32 unk034; - /*0x38*/ f32 unk038; - /*0x3c*/ f32 unk03c; - /*0x40*/ f32 unk040; - /*0x44*/ f32 unk044; - /*0x48*/ f32 unk048; - /*0x4c*/ f32 unk04c; - /*0x50*/ f32 unk050; - /*0x54*/ f32 unk054; - /*0x58*/ f32 unk058; - /*0x5c*/ u32 unk05c; - /*0x60*/ u32 unk060; - /*0x64*/ u32 unk064; - /*0x68*/ u32 unk068; - /*0x6c*/ u8 unk06c; - /*0x6d*/ u8 unk06d; - /*0x6e*/ u8 unk06e; + /*0x2c*/ struct coord pos[2]; + /*0x44*/ struct coord dir[2]; + /*0x5c*/ u32 guntype[2]; + /*0x64*/ u32 numshots[2]; + /*0x6c*/ u8 firing[2]; + /*0x6e*/ u8 finished; }; struct act_skjump { /*0x2c*/ u8 state; /*0x2d*/ u8 needsnewanim; /*0x2e*/ u8 hit; - /*0x30*/ f32 xspeed; - /*0x34*/ f32 zspeed; - /*0x38*/ f32 angle; - /*0x3c*/ s32 unk03c; - /*0x40*/ struct coord newpos; - /*0x4c*/ s32 unk04c; - /*0x50*/ f32 y; + /*0x30*/ f32 vel[2]; + /*0x38*/ f32 roty; + /*0x3c*/ s32 timer60; // counts down + /*0x40*/ struct coord pos; + /*0x4c*/ s32 total60; + /*0x50*/ f32 ground; }; struct chrdata { @@ -1298,8 +1267,8 @@ struct chrdata { // act_bot_attackstand uses act_attack // act_bot_attackkneel uses act_attack // act_bot_attackstrafe uses act_attack - struct act_druggeddrop act_druggeddrop; - struct act_druggedko act_druggedko; + // act_druggeddrop uses act_die + // act_druggedko uses act_dead struct act_druggedcomingup act_druggedcomingup; // act_attackamount uses act_attack struct act_robotattack act_robotattack; @@ -1681,7 +1650,7 @@ struct keyobj { // objtype 0x04 u32 keyflags; }; -struct cameraobj { // objtype 0x06 +struct cctvobj { // objtype 0x06 struct defaultobj base; // Note y is being used as an abbreviation for yaw @@ -1770,27 +1739,27 @@ struct hangingmonitorsobj { // objtype 0x0c struct autogunobj { // objtype 0x0d struct defaultobj base; /*0x5c*/ s16 targetpad; - /*0x5e*/ u8 unk5e; - /*0x5f*/ u8 unk5f; - /*0x60*/ f32 angleh; - /*0x64*/ f32 unk64; - /*0x68*/ f32 unk68; - /*0x6c*/ f32 unk6c; - /*0x70*/ f32 unk70; - /*0x74*/ f32 anglev; - /*0x78*/ f32 unk78; - /*0x7c*/ f32 unk7c; - /*0x80*/ f32 unk80; - /*0x84*/ f32 unk84; - /*0x88*/ f32 unk88; - /*0x8c*/ f32 unk8c; - /*0x90*/ s32 unk90; - /*0x94*/ s32 unk94; - /*0x98*/ s32 unk98; + /*0x5e*/ u8 firing; + /*0x5f*/ u8 firecount; + /*0x60*/ f32 yzero; + /*0x64*/ f32 ymaxleft; + /*0x68*/ f32 ymaxright; + /*0x6c*/ f32 yrot; + /*0x70*/ f32 yspeed; + /*0x74*/ f32 xzero; + /*0x78*/ f32 xrot; + /*0x7c*/ f32 xspeed; + /*0x80*/ f32 maxspeed; + /*0x84*/ f32 aimdist; + /*0x88*/ f32 barrelspeed; + /*0x8c*/ f32 barrelrot; + /*0x90*/ s32 lastseebond60; + /*0x94*/ s32 lastaimbond60; + /*0x98*/ s32 allowsoundframe; /*0x9c*/ struct beam *beam; - /*0xa0*/ f32 unka0; + /*0xa0*/ f32 shotbondsum; /*0xa4*/ u32 unka4; - /*0xa8*/ u8 autogun_type; + /*0xa8*/ u8 targetteam; /*0xa9*/ u8 ammoquantity; }; @@ -1915,13 +1884,14 @@ struct safeitemobj { struct safeitemobj *next; }; -struct camera2obj { // objtype 0x2e - u32 unk00; - f32 unk04; - f32 unk08; - f32 unk0c; - f32 unk10; - f32 unk14; +struct cameraposobj { // objtype 0x2e + s32 type; + f32 x; + f32 y; + f32 z; + f32 theta; + f32 verta; + s32 pad; }; struct tintedglassobj { // objtype 0x2f @@ -2236,9 +2206,9 @@ struct hand { /*0x0810*/ s32 lastshootframe60; /*0x0814*/ struct beam beam; /*0x0840*/ f32 noiseradius; - /*0x0844*/ u32 unk0844; - /*0x0848*/ u32 unk0848; - /*0x084c*/ u32 unk084c; + /*0x0844*/ u32 fingerroty; + /*0x0848*/ u32 slidetrans; + /*0x084c*/ u32 slideinc; /*0x0850*/ struct weaponobj *rocket; /*0x0854*/ bool firedrocket; /*0x0858*/ s32 loadedammo[2]; @@ -2252,30 +2222,8 @@ struct hand { /*0x0880*/ u32 unk0880; /*0x0884*/ u32 unk0884; /*0x0888*/ f32 loadslide; - /*0x088c*/ f32 unk088c; - /*0x0890*/ f32 unk0890; - /*0x0894*/ u32 unk0894; - /*0x0898*/ u32 unk0898; - /*0x089c*/ u32 unk089c; - /*0x08a0*/ u32 unk08a0; - /*0x08a4*/ u32 unk08a4; - /*0x08a8*/ u32 unk08a8; - /*0x08ac*/ u32 unk08ac; - /*0x08b0*/ u32 unk08b0; - /*0x08b4*/ u32 unk08b4; - /*0x08b8*/ u32 unk08b8; - /*0x08bc*/ f32 unk08bc; - /*0x08c0*/ f32 unk08c0; - /*0x08c4*/ u32 unk08c4; - /*0x08c8*/ u32 unk08c8; - /*0x08cc*/ u32 unk08cc; - /*0x08d0*/ u32 unk08d0; - /*0x08d4*/ u32 unk08d4; - /*0x08d8*/ u32 unk08d8; - /*0x08dc*/ u32 unk08dc; - /*0x08e0*/ u32 unk08e0; - /*0x08e4*/ u32 unk08e4; - /*0x08e8*/ u32 unk08e8; + /*0x088c*/ f32 upgrademult[12]; + /*0x08bc*/ f32 finalmult[12]; /*0x08ec*/ Mtxf cammtx; /*0x092c*/ Mtxf posmtx; /*0x096c*/ Mtxf prevmtx; @@ -2330,11 +2278,11 @@ struct hand { /*0x0c24*/ struct coord lastshootpos; /*0x0c30*/ s32 shotstotake; /*0x0c34*/ f32 shotremainder; - /*0x0c38*/ u32 unk0c38; + /*0x0c38*/ u32 hitspershot; /*0x0c3c*/ s32 state; /*0x0c40*/ s32 stateminor; /*0x0c44*/ u32 stateflags; - /*0x0c48*/ u32 unk0c48; + /*0x0c48*/ u32 statemode; /*0x0c4c*/ s32 stateframes; /*0x0c50*/ s32 statecycles; /*0x0c54*/ s32 statelastframe; @@ -2365,9 +2313,8 @@ struct hand { /*0x0cc8*/ u8 unk0cc8_08 : 1; /*0x0cc9*/ u8 animloopcount; /*0x0ccc*/ f32 crosspos[2]; - /*0x0cd4*/ f32 unk0cd4; - /*0x0cd8*/ f32 unk0cd8; - /*0x0cdc*/ u32 unk0cdc; + /*0x0cd4*/ f32 guncrosspossum[2]; + /*0x0cdc*/ u32 statejob; /*0x0ce0*/ s32 statevar1; /*0x0ce4*/ s32 attacktype; /*0x0ce8*/ struct guncmd *unk0ce8; @@ -2409,7 +2356,7 @@ struct hand { /*0x0d6c*/ u32 unk0d6c; /*0x0d70*/ u32 unk0d70; /*0x0d74*/ u16 gunroundsspent[4]; - /*0x0d7c*/ u32 unk0d7c; + /*0x0d7c*/ u32 ispare1; /*0x0d80*/ struct guncmd *unk0d80; /*0x0d84*/ struct audiohandle *audiohandle; /*0x0d88*/ u32 ispare4; @@ -2463,7 +2410,7 @@ struct gunctrl { /*0x1590*/ u32 unk1590; /*0x1594*/ struct modelfiledata *unk1594; /*0x1598*/ s32 unk1598; - /*0x159c*/ u16 unk159c; + /*0x159c*/ u16 handfilenum; /*0x15a0*/ s32 unk15a0; /*0x15a4*/ s32 unk15a4; /*0x15a8*/ u32 unk15a8; @@ -2503,8 +2450,8 @@ struct player { /*0x0014*/ s32 memcamroom; /*0x0018*/ struct coord eraserpos; /*0x0024*/ f32 eraserpropdist; - /*0x0028*/ u32 unk0028; - /*0x002c*/ u32 unk002c; + /*0x0028*/ u32 eraserbgdist; + /*0x002c*/ u32 eraserdepth; /*0x0030*/ bool isfalling; /*0x0034*/ s32 fallstart; /*0x0038*/ struct coord globaldrawworldoffset; @@ -2539,7 +2486,7 @@ struct player { /*0x00c0*/ bool bondperimenabled; /*0x00c4*/ u32 devicesactive; /*0x00c8*/ s32 badrockettime; - /*0x00cc*/ u32 unk00cc; + /*0x00cc*/ u32 gunspeed; /*0x00d0*/ s32 bondactivateorreload; /*0x00d4*/ u32 unk00d4; /*0x00d8*/ bool isdead; @@ -2553,7 +2500,7 @@ struct player { /*0x00f8*/ f32 healthshowtime; /*0x00fc*/ u32 healthshowmode; /*0x0100*/ s32 docentreupdown; - /*0x0104*/ u32 unk0104; + /*0x0104*/ u32 lastupdown60; /*0x0108*/ s32 prevupdown; /*0x010c*/ s32 movecentrerelease; /*0x0110*/ bool lookaheadcentreenabled; @@ -2605,9 +2552,9 @@ struct player { /*0x024c*/ s16 invdowntime; /*0x024e*/ s16 usedowntime; /*0x0250*/ u8 activemenumode; - /*0x0251*/ u8 unk0251; - /*0x0252*/ u8 unk0252; - /*0x0253*/ u8 unk0253; + /*0x0251*/ u8 ecol_1; + /*0x0252*/ u8 ecol_2; + /*0x0253*/ u8 ecol_3; /*0x0254*/ s32 erasertime; // related to FarSight's auto tracking /*0x0258*/ f32 autoeraserdist; /*0x025c*/ struct prop *autoerasertarget; @@ -2659,7 +2606,7 @@ struct player { /*0x036c*/ struct playerbond bond2; /*0x03a0*/ bool resetheadpos; /*0x03a4*/ bool resetheadrot; - /*0x03a8*/ bool unk03a8; + /*0x03a8*/ bool resetheadtick; /*0x03ac*/ s32 headanim; /*0x03b0*/ f32 headdamp; /*0x03b4*/ s32 headwalkingtime60; @@ -2686,41 +2633,8 @@ struct player { /*0x0490*/ s32 eyespydarts; /*0x0494*/ union modelrwdata *bondheadsave[30]; /*0x050c*/ u32 unk050c; - /*0x0510*/ Mtxf unk0510; - /*0x0550*/ Mtxf unk0550; - /*0x0590*/ u32 unk0590; - /*0x0594*/ u32 unk0594; - /*0x0598*/ u32 unk0598; - /*0x059c*/ u32 unk059c; - /*0x05a0*/ u32 unk05a0; - /*0x05a4*/ u32 unk05a4; - /*0x05a8*/ u32 unk05a8; - /*0x05ac*/ u32 unk05ac; - /*0x05b0*/ u32 unk05b0; - /*0x05b4*/ u32 unk05b4; - /*0x05b8*/ u32 unk05b8; - /*0x05bc*/ u32 unk05bc; - /*0x05c0*/ u32 unk05c0; - /*0x05c4*/ u32 unk05c4; - /*0x05c8*/ u32 unk05c8; - /*0x05cc*/ u32 unk05cc; - /*0x05d0*/ u32 unk05d0; - /*0x05d4*/ u32 unk05d4; - /*0x05d8*/ u32 unk05d8; - /*0x05dc*/ u32 unk05dc; - /*0x05e0*/ u32 unk05e0; - /*0x05e4*/ u32 unk05e4; - /*0x05e8*/ u32 unk05e8; - /*0x05ec*/ u32 unk05ec; - /*0x05f0*/ u32 unk05f0; - /*0x05f4*/ u32 unk05f4; - /*0x05f8*/ u32 unk05f8; - /*0x05fc*/ u32 unk05fc; - /*0x0600*/ u32 unk0600; - /*0x0604*/ u32 unk0604; - /*0x0608*/ u32 unk0608; - /*0x060c*/ u32 unk060c; - /*0x0610*/ struct player0610 unk0610[2]; + /*0x0510*/ Mtxf bondheadmatrices[4]; + /*0x0610*/ struct player0610 viewport[2]; /*0x0630*/ s16 viewx; // 320 lo-res, 640 hi-res /*0x0632*/ s16 viewy; // 220 regardless of res /*0x0634*/ s16 viewleft; // 0 @@ -2743,38 +2657,18 @@ struct player { /*0x1624*/ struct threat lookingatprop; /*0x1630*/ struct threat cmpfollowprops[4]; /*0x1660*/ f32 crosspos[2]; - /*0x1668*/ f32 unk1668; - /*0x166c*/ f32 unk166c; - /*0x1670*/ f32 unk1670; - /*0x1674*/ f32 unk1674; - /*0x1678*/ f32 unk1678; - /*0x167c*/ f32 unk167c; - /*0x1680*/ f32 unk1680; - /*0x1684*/ f32 unk1684; - /*0x1688*/ f32 unk1688; - /*0x168c*/ f32 unk168c; - /*0x1690*/ f32 unk1690; - /*0x1694*/ u32 unk1694; - /*0x1698*/ u32 unk1698; - /*0x169c*/ u32 unk169c; - /*0x16a0*/ u32 unk16a0; - /*0x16a4*/ u32 unk16a4; - /*0x16a8*/ u32 unk16a8; - /*0x16ac*/ u32 unk16ac; - /*0x16b0*/ u32 unk16b0; - /*0x16b4*/ u32 unk16b4; - /*0x16b8*/ u32 unk16b8; - /*0x16bc*/ u32 unk16bc; - /*0x16c0*/ u32 unk16c0; - /*0x16c4*/ u32 unk16c4; - /*0x16c8*/ u32 unk16c8; - /*0x16cc*/ u32 unk16cc; - /*0x16d0*/ u32 unk16d0; - /*0x16d4*/ u32 unk16d4; - /*0x16d8*/ u32 unk16d8; - /*0x16dc*/ f32 unk16dc; - /*0x16e0*/ f32 unk16e0; - /*0x16e4*/ f32 unk16e4; + /*0x1668*/ f32 crosspossum[2]; + /*0x1670*/ f32 guncrossdamp; + /*0x1674*/ f32 crosspos2[2]; + /*0x167c*/ f32 crosssum2[2]; + /*0x1684*/ f32 gunaimdamp; + /*0x1688*/ struct coord aimangle; + /*0x1694*/ Mtxf aimanglemat; + /*0x16d4*/ bool copiedgoldeneye; + /*0x16d8*/ u32 gunammooff; + /*0x16dc*/ f32 gunsync; + /*0x16e0*/ f32 syncchange; + /*0x16e4*/ f32 synccount; /*0x16e8*/ s32 syncoffset; /*0x16ec*/ f32 cyclesum; /*0x16f0*/ f32 gunampsum; @@ -2830,8 +2724,8 @@ struct player { /*0x1850*/ f32 zoominfovynew; /*0x1854*/ f32 fovy; /*0x1858*/ f32 aspect; - /*0x185c*/ u32 flags; - /*0x1860*/ s32 unk1860; + /*0x185c*/ u32 hudmessoff; + /*0x1860*/ s32 bondmesscnt; /*0x1864*/ struct invitem *weapons; // circular linked list, sorted /*0x1868*/ struct invitem *equipment; // slots, allocated, unsorted /*0x186c*/ s32 equipmaxitems; @@ -2900,15 +2794,15 @@ struct player { /*0x1a2c*/ struct coord grabbedposextra; /*0x1a38*/ f32 grabbedrotextrasum; /*0x1a3c*/ struct coord grabbedposextrasum; - /*0x1a48*/ f32 unk1a48; - /*0x1a4c*/ f32 unk1a4c; - /*0x1a50*/ f32 unk1a50; - /*0x1a54*/ f32 unk1a54; - /*0x1a58*/ f32 unk1a58; - /*0x1a5c*/ f32 unk1a5c; - /*0x1a60*/ f32 unk1a60; - /*0x1a64*/ f32 unk1a64; - /*0x1a68*/ s32 unk1a68; + /*0x1a48*/ f32 bondtankthetaspeedsum; + /*0x1a4c*/ f32 bondtankverta; + /*0x1a50*/ f32 bondtankvertasum; + /*0x1a54*/ f32 bondturrettheta; + /*0x1a58*/ f32 bondturretthetasum; + /*0x1a5c*/ f32 bondturretspeedsum; + /*0x1a60*/ f32 bondturretside; + /*0x1a64*/ f32 bondturretchange; + /*0x1a68*/ s32 bondtankslowtime; /*0x1a6c*/ struct prop *hoverbike; /*0x1a70*/ struct coord bondvehicleoffset; /*0x1a7c*/ s32 bondvehiclemode; @@ -2925,7 +2819,7 @@ struct player { /*0x1ae8*/ f32 bondonground; /*0x1aec*/ struct prop *tank; /*0x1af0*/ struct prop *unk1af0; - /*0x1af4*/ u32 unk1af4; + /*0x1af4*/ u32 bondonturret; /*0x1af8*/ s32 walkinitmove; /*0x1afc*/ struct coord walkinitpos; /*0x1b08*/ Mtxf walkinitmtx; @@ -2933,7 +2827,7 @@ struct player { /*0x1b4c*/ f32 walkinitt2; /*0x1b50*/ struct coord walkinitstart; /*0x1b5c*/ struct prop *grabbedprop; - /*0x1b60*/ f32 unk1b60; + /*0x1b60*/ f32 bondgrabthetaspeedsum; /*0x1b64*/ s32 grabstarttime; /*0x1b68*/ f32 autoaimdamp; /*0x1b6c*/ struct coord bondforcespeed; @@ -2985,13 +2879,11 @@ struct player { /*0x1c38*/ s32 unk1c38; /*0x1c3c*/ s32 unk1c3c; /*0x1c40*/ u32 joybutinhibit; - /*0x1c44*/ f32 unk1c44; - /*0x1c48*/ f32 unk1c48; - /*0x1c4c*/ f32 unk1c4c; + /*0x1c44*/ struct coord bondextrapos; /*0x1c50*/ u8 unk1c50_01 : 1; /*0x1c51*/ u8 disguised : 1; /*0x1c54*/ u32 devicesinhibit; - /*0x1c58*/ f32 unk1c58; + /*0x1c58*/ f32 grabbedforcez; /*0x1c5c*/ f32 stealhealth; /*0x1c60*/ s32 unk1c60; /*0x1c64*/ s32 unk1c64;