Split game_0b0420.c to mpstats.c and game_0b0fd0.c and give mpstats functions consistent names

This commit is contained in:
Ryan Dwyer 2021-01-23 16:47:02 +10:00
parent 7e3f04114f
commit 2af20b8596
34 changed files with 464 additions and 427 deletions

View File

@ -91,7 +91,8 @@
build/ROMID/game/game_097ba0.o (section); \
build/ROMID/game/data/data_0160b0.o (section); \
build/ROMID/game/game_0abe70.o (section); \
build/ROMID/game/game_0b0420.o (section); \
build/ROMID/game/mpstats.o (section); \
build/ROMID/game/game_0b0fd0.o (section); \
build/ROMID/game/game_0b2150.o (section); \
build/ROMID/game/game_0b28d0.o (section); \
build/ROMID/game/game_0b3350.o (section); \

View File

@ -12,7 +12,7 @@
#include "game/data/data_02e820.h"
#include "game/game_005fd0.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b3350.h"
#include "game/game_0d4690.h"
#include "game/game_0f09f0.h"

View File

@ -10,7 +10,7 @@
#include "game/data/data_02da90.h"
#include "game/game_01b0a0.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/inventory/inventory.h"
#include "game/game_127910.h"
#include "game/pdoptions.h"

View File

@ -19,7 +19,7 @@
#include "game/game_096750.h"
#include "game/game_096ca0.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b3350.h"
#include "game/game_0b69d0.h"
#include "game/bondcutscene.h"

View File

@ -19,7 +19,7 @@
#include "game/game_096360.h"
#include "game/game_097ba0.h"
#include "game/game_0abe70.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b28d0.h"
#include "game/game_0b3350.h"
#include "game/game_0b69d0.h"

View File

@ -22,7 +22,7 @@
#include "game/game_0969d0.h"
#include "game/game_097ba0.h"
#include "game/game_0abe70.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b28d0.h"
#include "game/game_0b3350.h"
#include "game/game_0b69d0.h"
@ -43,6 +43,7 @@
#include "game/pak/pak.h"
#include "game/propobj.h"
#include "game/wallhit.h"
#include "game/mpstats.h"
#include "gvars/gvars.h"
#include "lib/lib_04790.h"
#include "lib/lib_04a80.h"
@ -2699,7 +2700,7 @@ glabel var7f1a8d44
/* f031a18: 24190001 */ addiu $t9,$zero,0x1
/* f031a1c: afb900e8 */ sw $t9,0xe8($sp)
.L0f031a20:
/* f031a20: 0fc2c15d */ jal decrementKnockoutCount
/* f031a20: 0fc2c15d */ jal mpstatsDecrementTotalKnockoutCount
/* f031a24: afa700ec */ sw $a3,0xec($sp)
/* f031a28: 8fa700ec */ lw $a3,0xec($sp)
.L0f031a2c:
@ -3791,7 +3792,7 @@ glabel var7f1a8d44
/* f0329e8: 8dada24c */ lw $t5,%lo(g_Vars+0x28c)($t5)
/* f0329ec: 0fc4a24b */ jal setCurrentPlayerNum
/* f0329f0: afad0058 */ sw $t5,0x58($sp)
/* f0329f4: 0fc2c169 */ jal mpstatsRecordKill
/* f0329f4: 0fc2c169 */ jal mpstatsRecordPlayerKill
/* f0329f8: 00000000 */ nop
/* f0329fc: 0fc4a24b */ jal setCurrentPlayerNum
/* f032a00: 8fa40058 */ lw $a0,0x58($sp)
@ -3801,7 +3802,7 @@ glabel var7f1a8d44
/* f032a0c: 000ecac0 */ sll $t9,$t6,0xb
/* f032a10: 07210004 */ bgez $t9,.L0f032a24
/* f032a14: 00000000 */ nop
/* f032a18: 0fc2c151 */ jal incrementKillCount
/* f032a18: 0fc2c151 */ jal mpstatsIncrementTotalKillCount
/* f032a1c: 00000000 */ nop
/* f032a20: 8fa20040 */ lw $v0,0x40($sp)
.L0f032a24:
@ -4712,7 +4713,7 @@ glabel func0f0336a8
/* f0336d0: 2401001f */ addiu $at,$zero,0x1f
/* f0336d4: 50410011 */ beql $v0,$at,.L0f03371c
/* f0336d8: 8fbf0014 */ lw $ra,0x14($sp)
/* f0336dc: 0fc2c163 */ jal getKnockoutCount
/* f0336dc: 0fc2c163 */ jal mpstatsGetTotalKnockoutCount
/* f0336e0: afa40018 */ sw $a0,0x18($sp)
/* f0336e4: 28410002 */ slti $at,$v0,0x2
/* f0336e8: 10200005 */ beqz $at,.L0f033700
@ -4722,7 +4723,7 @@ glabel func0f0336a8
/* f0336f8: 01c17825 */ or $t7,$t6,$at
/* f0336fc: ac8f0018 */ sw $t7,0x18($a0)
.L0f033700:
/* f033700: 0fc2c157 */ jal incrementKnockoutCount
/* f033700: 0fc2c157 */ jal mpstatsIncrementTotalKnockoutCount
/* f033704: afa40018 */ sw $a0,0x18($sp)
/* f033708: 8fa40018 */ lw $a0,0x18($sp)
/* f03370c: 24180020 */ addiu $t8,$zero,0x20
@ -6618,27 +6619,27 @@ glabel var7f1a8d98
/* f035324: 10000011 */ b .L0f03536c
/* f035328: 8fa4014c */ lw $a0,0x14c($sp)
.L0f03532c:
/* f03532c: 0fc2c11b */ jal func0f0b046c
/* f03532c: 0fc2c11b */ jal mpstatsIncrementPlayerShotCount2
/* f035330: 8fa4014c */ lw $a0,0x14c($sp)
/* f035334: 1000000f */ b .L0f035374
/* f035338: 00000000 */ nop
.L0f03533c:
/* f03533c: 0fc2c11b */ jal func0f0b046c
/* f03533c: 0fc2c11b */ jal mpstatsIncrementPlayerShotCount2
/* f035340: 24050004 */ addiu $a1,$zero,0x4
/* f035344: 1000000b */ b .L0f035374
/* f035348: 00000000 */ nop
.L0f03534c:
/* f03534c: 0fc2c11b */ jal func0f0b046c
/* f03534c: 0fc2c11b */ jal mpstatsIncrementPlayerShotCount2
/* f035350: 24050005 */ addiu $a1,$zero,0x5
/* f035354: 10000007 */ b .L0f035374
/* f035358: 00000000 */ nop
.L0f03535c:
/* f03535c: 0fc2c11b */ jal func0f0b046c
/* f03535c: 0fc2c11b */ jal mpstatsIncrementPlayerShotCount2
/* f035360: 24050002 */ addiu $a1,$zero,0x2
/* f035364: 10000003 */ b .L0f035374
/* f035368: 00000000 */ nop
.L0f03536c:
/* f03536c: 0fc2c11b */ jal func0f0b046c
/* f03536c: 0fc2c11b */ jal mpstatsIncrementPlayerShotCount2
/* f035370: 24050003 */ addiu $a1,$zero,0x3
.L0f035374:
/* f035374: 0fc4a24b */ jal setCurrentPlayerNum
@ -7529,7 +7530,7 @@ glabel var7f1a8d98
/* f03600c: afa80074 */ sw $t0,0x74($sp)
/* f036010: 0fc4a24b */ jal setCurrentPlayerNum
/* f036014: 00402025 */ or $a0,$v0,$zero
/* f036018: 0fc2c169 */ jal mpstatsRecordKill
/* f036018: 0fc2c169 */ jal mpstatsRecordPlayerKill
/* f03601c: 00000000 */ nop
/* f036020: 0fc4a24b */ jal setCurrentPlayerNum
/* f036024: 8fa40074 */ lw $a0,0x74($sp)
@ -7538,7 +7539,7 @@ glabel var7f1a8d98
/* f03602c: 000a5ac0 */ sll $t3,$t2,0xb
/* f036030: 05630004 */ bgezl $t3,.L0f036044
/* f036034: 8e0202d4 */ lw $v0,0x2d4($s0)
/* f036038: 0fc2c151 */ jal incrementKillCount
/* f036038: 0fc2c151 */ jal mpstatsIncrementTotalKillCount
/* f03603c: 00000000 */ nop
/* f036040: 8e0202d4 */ lw $v0,0x2d4($s0)
.L0f036044:

View File

@ -25,7 +25,7 @@
#include "game/game_095320.h"
#include "game/game_096750.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b28d0.h"
#include "game/game_0b69d0.h"
#include "game/game_0dcdb0.h"
@ -45,6 +45,7 @@
#include "game/pad.h"
#include "game/pdoptions.h"
#include "game/propobj.h"
#include "game/mpstats.h"
#include "gvars/gvars.h"
#include "lib/lib_04790.h"
#include "lib/lib_04a80.h"
@ -5877,9 +5878,9 @@ bool aiIfNumKnockedOutChrs(void)
{
u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
if (cmd[2] < getKnockoutCount() && cmd[3] == 0) {
if (cmd[2] < mpstatsGetTotalKnockoutCount() && cmd[3] == 0) {
g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[4]);
} else if (getKnockoutCount() < cmd[2] && cmd[3] == 1) {
} else if (mpstatsGetTotalKnockoutCount() < cmd[2] && cmd[3] == 1) {
g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[4]);
} else {
g_Vars.aioffset += 5;

View File

@ -63,7 +63,7 @@
#include "game/game_095320.h"
#include "game/game_097ba0.h"
#include "game/game_0abe70.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b28d0.h"
#include "game/game_0b63b0.h"
#include "game/game_0b69d0.h"

View File

@ -13,7 +13,7 @@
#include "game/game_01b0a0.h"
#include "game/game_095320.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b69d0.h"
#include "game/game_0d4690.h"
#include "game/game_0e0770.h"
@ -28,6 +28,7 @@
#include "game/gamefile.h"
#include "game/lang.h"
#include "game/pdoptions.h"
#include "game/mpstats.h"
#include "gvars/gvars.h"
#include "lib/lib_09660.h"
#include "lib/main.h"
@ -178,50 +179,50 @@ struct menudialog g_NextMissionMenuDialog = {
char *soloMenuTextNumKills(struct menuitem *item)
{
sprintf(g_StringPointer, "%d", currentPlayerGetNumKills());
sprintf(g_StringPointer, "%d", mpstatsGetPlayerKillCount());
return g_StringPointer;
}
char *soloMenuTextNumShots(struct menuitem *item)
{
sprintf(g_StringPointer, "%d", currentPlayerGetShotCount(SHOTCOUNT_TOTAL));
sprintf(g_StringPointer, "%d", mpstatsGetPlayerShotCountByRegion(SHOTREGION_TOTAL));
return g_StringPointer;
}
char *soloMenuTextNumHeadShots(struct menuitem *item)
{
sprintf(g_StringPointer, "%d", currentPlayerGetShotCount(SHOTCOUNT_HEAD));
sprintf(g_StringPointer, "%d", mpstatsGetPlayerShotCountByRegion(SHOTREGION_HEAD));
return g_StringPointer;
}
char *soloMenuTextNumBodyShots(struct menuitem *item)
{
sprintf(g_StringPointer, "%d", currentPlayerGetShotCount(SHOTCOUNT_BODY));
sprintf(g_StringPointer, "%d", mpstatsGetPlayerShotCountByRegion(SHOTREGION_BODY));
return g_StringPointer;
}
char *soloMenuTextNumLimbShots(struct menuitem *item)
{
sprintf(g_StringPointer, "%d", currentPlayerGetShotCount(SHOTCOUNT_LIMB));
sprintf(g_StringPointer, "%d", mpstatsGetPlayerShotCountByRegion(SHOTREGION_LIMB));
return g_StringPointer;
}
char *soloMenuTextNumOtherShots(struct menuitem *item)
{
u32 total = currentPlayerGetShotCount(SHOTCOUNT_GUN) + currentPlayerGetShotCount(SHOTCOUNT_5);
u32 total = mpstatsGetPlayerShotCountByRegion(SHOTREGION_GUN) + mpstatsGetPlayerShotCountByRegion(SHOTREGION_5);
sprintf(g_StringPointer, "%d", total);
return g_StringPointer;
}
char *soloMenuTextAccuracy(struct menuitem *item)
{
s32 total = currentPlayerGetShotCount(SHOTCOUNT_TOTAL);
s32 numhead = currentPlayerGetShotCount(SHOTCOUNT_HEAD);
s32 numbody = currentPlayerGetShotCount(SHOTCOUNT_BODY);
s32 numlimb = currentPlayerGetShotCount(SHOTCOUNT_LIMB);
s32 numgun = currentPlayerGetShotCount(SHOTCOUNT_GUN);
s32 num5 = currentPlayerGetShotCount(SHOTCOUNT_5);
s32 numobject = currentPlayerGetShotCount(SHOTCOUNT_OBJECT);
s32 total = mpstatsGetPlayerShotCountByRegion(SHOTREGION_TOTAL);
s32 numhead = mpstatsGetPlayerShotCountByRegion(SHOTREGION_HEAD);
s32 numbody = mpstatsGetPlayerShotCountByRegion(SHOTREGION_BODY);
s32 numlimb = mpstatsGetPlayerShotCountByRegion(SHOTREGION_LIMB);
s32 numgun = mpstatsGetPlayerShotCountByRegion(SHOTREGION_GUN);
s32 num5 = mpstatsGetPlayerShotCountByRegion(SHOTREGION_5);
s32 numobject = mpstatsGetPlayerShotCountByRegion(SHOTREGION_OBJECT);
f32 accuracy;
if (total > 0) {

View File

@ -9,7 +9,7 @@
#include "game/data/data_02da90.h"
#include "game/game_01b0a0.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/inventory/inventory.h"
#include "game/game_127910.h"
#include "game/pdoptions.h"

View File

@ -18,7 +18,7 @@
#include "game/floor.h"
#include "game/ceil.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b3350.h"
#include "game/game_0b69d0.h"
#include "game/game_127910.h"
@ -32,6 +32,7 @@
#include "game/propobj.h"
#include "game/splat.h"
#include "game/wallhit.h"
#include "game/mpstats.h"
#include "gvars/gvars.h"
#include "lib/lib_0e9d0.h"
#include "lib/lib_12dc0.h"
@ -2417,7 +2418,7 @@ void handTickAttack(s32 handnum)
// right hand is not (ie. prevent firing both guns on the same tick)
if (handnum == HAND_RIGHT || !handIsAttackingOnThisTick(HAND_RIGHT)) {
chrUncloakTemporarily(g_Vars.currentplayer->prop->chr);
func0f0b046c((struct hand *)&tmpweaponnum, 0);
mpstatsIncrementPlayerShotCount2((struct hand *)&tmpweaponnum, 0);
if (weaponnum == WEAPON_SHOTGUN) {
handCreateBulletRaycast(handnum, true, true, 1, true);
@ -2430,7 +2431,7 @@ void handTickAttack(s32 handnum)
handCreateBulletRaycast(handnum, true, true, func0f0a1318(handnum), g_Vars.mplayerisrunning);
}
func0f0b0520();
mpstats0f0b0520();
}
break;
case HANDATTACKTYPE_CLOSERANGE:

View File

@ -22,7 +22,7 @@
#include "game/game_097aa0.h"
#include "game/game_097ba0.h"
#include "game/game_0abe70.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b28d0.h"
#include "game/game_0b3350.h"
#include "game/game_0b69d0.h"

View File

@ -10,7 +10,7 @@
#include "game/game_0969d0.h"
#include "game/game_097ba0.h"
#include "game/game_0abe70.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b3350.h"
#include "game/game_0c33f0.h"
#include "game/game_166e40.h"

View File

@ -10,7 +10,7 @@
#include "game/data/data_02da90.h"
#include "game/inventory/items.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b69d0.h"
#include "game/game_0dcdb0.h"
#include "game/game_127910.h"
@ -23,335 +23,6 @@
#include "lib/lib_13130.h"
#include "types.h"
void func0f0b0420(struct hand *hand, s32 index)
{
if (!weaponHasFlag(hand->weaponnum, WEAPONFLAG_00100000)) {
g_Vars.currentplayerstats->shotcount[index]++;
}
}
void func0f0b046c(struct hand *hand, s32 index)
{
if (index == 0) {
if (!weaponHasFlag(hand->weaponnum, WEAPONFLAG_00100000)) {
var80070590 = 1;
g_Vars.currentplayerstats->shotcount[index]++;
}
} else {
if (var80070590) {
if (!weaponHasFlag(hand->weaponnum, WEAPONFLAG_00100000)) {
g_Vars.currentplayerstats->shotcount[index]++;
}
var80070590 = 0;
}
}
}
void func0f0b0520(void)
{
var80070590 = 0;
}
s32 currentPlayerGetShotCount(u32 type)
{
return g_Vars.currentplayerstats->shotcount[type];
}
void incrementKillCount(void)
{
g_Vars.killcount++;
}
void incrementKnockoutCount(void)
{
g_Vars.knockoutcount++;
}
void decrementKnockoutCount(void)
{
g_Vars.knockoutcount--;
}
u8 getKnockoutCount(void)
{
return g_Vars.knockoutcount;
}
u32 getKillCount(void)
{
return g_Vars.killcount;
}
void mpstatsRecordKill(void)
{
char text[256];
s32 simulkills;
s32 duration;
s32 time;
g_Vars.currentplayerstats->killcount++;
g_Vars.currentplayer->killsthislife++;
if (g_Vars.normmplayerisrunning) {
time = getMissionTime();
// Show HUD message
// "Kill count: %d"
sprintf(text, "%s: %d\n", langGet(L_GUN(1)), g_Vars.currentplayerstats->killcount);
hudmsgCreateViaPreset(text, HUDMSGTYPE_DEFAULT);
// Update slowest/fastest two kills
if (g_Vars.currentplayerstats->killcount > 1) {
duration = time - g_Vars.currentplayer->lastkilltime60;
if (duration > g_Vars.currentplayerstats->slowest2kills) {
g_Vars.currentplayerstats->slowest2kills = duration;
}
if (duration < g_Vars.currentplayerstats->fastest2kills) {
g_Vars.currentplayerstats->fastest2kills = duration;
}
}
// Update max simultaneous kills
simulkills = 1;
g_Vars.currentplayer->lastkilltime60_4 = g_Vars.currentplayer->lastkilltime60_3;
g_Vars.currentplayer->lastkilltime60_3 = g_Vars.currentplayer->lastkilltime60_2;
g_Vars.currentplayer->lastkilltime60_2 = g_Vars.currentplayer->lastkilltime60;
g_Vars.currentplayer->lastkilltime60 = time;
if (g_Vars.currentplayer->lastkilltime60_2 != -1 && g_Vars.currentplayer->lastkilltime60 - g_Vars.currentplayer->lastkilltime60_2 < 120) {
simulkills++;
if (g_Vars.currentplayer->lastkilltime60_3 != -1 && g_Vars.currentplayer->lastkilltime60 - g_Vars.currentplayer->lastkilltime60_3 < 120) {
simulkills++;
if (g_Vars.currentplayer->lastkilltime60_4 != -1 && g_Vars.currentplayer->lastkilltime60 - g_Vars.currentplayer->lastkilltime60_4 < 120) {
simulkills++;
}
}
}
if (simulkills > g_Vars.currentplayerstats->maxsimulkills) {
g_Vars.currentplayerstats->maxsimulkills = simulkills;
}
}
}
s32 currentPlayerGetNumKills(void)
{
return g_Vars.currentplayerstats->killcount;
}
void currentPlayerIncrementGgKillCount(void)
{
g_Vars.currentplayerstats->ggkillcount++;
}
void currentPlayerIncrementDeathCount(void)
{
char buffer[256];
g_Vars.currentplayer->deathcount++;
if (g_Vars.normmplayerisrunning) {
if (g_Vars.currentplayer->deathcount == 1) {
sprintf(buffer, langGet(L_GUN(2))); // "Died once"
} else {
sprintf(buffer, "%s %d %s\n",
langGet(L_GUN(3)), // "Died"
g_Vars.currentplayer->deathcount,
langGet(L_GUN(4))); // "times"
}
hudmsgCreateViaPreset(buffer, HUDMSGTYPE_DEFAULT);
}
}
void currentPlayerRecordSuicide(void)
{
char text[256];
s32 simulkills;
s32 duration;
s32 time;
s32 mpindex;
struct mpchr *mpchr;
if (g_Vars.normmplayerisrunning) {
time = getMissionTime();
mpindex = g_Vars.currentplayerstats->mpindex;
if (mpindex < 4) {
mpchr = &g_MpPlayers[mpindex].base;
} else {
mpchr = &g_MpSimulants[mpindex - 4].base;
}
// Show HUD message
// "Suicide count: %d"
sprintf(text, "%s: %d\n", langGet(L_GUN(5)), mpchr->killcounts[mpindex]);
hudmsgCreateViaPreset(text, HUDMSGTYPE_DEFAULT);
// Update slowest/fastest two kills
if (g_Vars.currentplayerstats->killcount > 1) {
duration = time - g_Vars.currentplayer->lastkilltime60;
if (duration > g_Vars.currentplayerstats->slowest2kills) {
g_Vars.currentplayerstats->slowest2kills = duration;
}
if (duration < g_Vars.currentplayerstats->fastest2kills) {
g_Vars.currentplayerstats->fastest2kills = duration;
}
}
// Update max simultaneous kills
simulkills = 1;
g_Vars.currentplayer->lastkilltime60_4 = g_Vars.currentplayer->lastkilltime60_3;
g_Vars.currentplayer->lastkilltime60_3 = g_Vars.currentplayer->lastkilltime60_2;
g_Vars.currentplayer->lastkilltime60_2 = g_Vars.currentplayer->lastkilltime60;
g_Vars.currentplayer->lastkilltime60 = time;
if (g_Vars.currentplayer->lastkilltime60_2 != -1 && g_Vars.currentplayer->lastkilltime60 - g_Vars.currentplayer->lastkilltime60_2 < 120) {
simulkills++;
if (g_Vars.currentplayer->lastkilltime60_3 != -1 && g_Vars.currentplayer->lastkilltime60 - g_Vars.currentplayer->lastkilltime60_3 < 120) {
simulkills++;
if (g_Vars.currentplayer->lastkilltime60_4 != -1 && g_Vars.currentplayer->lastkilltime60 - g_Vars.currentplayer->lastkilltime60_4 < 120) {
simulkills++;
}
}
}
if (simulkills > g_Vars.currentplayerstats->maxsimulkills) {
g_Vars.currentplayerstats->maxsimulkills = simulkills;
}
}
}
void mpstatsRecordDeath(s32 aplayernum, s32 vplayernum)
{
s32 vmpindex = -1;
struct mpchr *vmpchr = NULL;
s32 ampindex;
struct mpchr *ampchr = NULL;
s32 prevplayernum;
char text[256];
if (g_Vars.normmplayerisrunning && g_MpSetup.scenario == MPSCENARIO_POPACAP) {
func0f1847b8();
}
// Find attacker and victim mpchrs
if (aplayernum >= 0) {
ampindex = func0f18d074(aplayernum);
if (ampindex >= 0) {
if (ampindex < 4) {
ampchr = &g_MpPlayers[ampindex].base;
} else {
ampchr = &g_MpSimulants[ampindex - 4].base;
}
}
}
if (vplayernum >= 0) {
vmpindex = func0f18d074(vplayernum);
if (vmpindex >= 0) {
if (vmpindex < 4) {
vmpchr = &g_MpPlayers[vmpindex].base;
} else {
vmpchr = &g_MpSimulants[vmpindex - 4].base;
}
}
}
if (vplayernum >= 0 && aplayernum == vplayernum) {
// Player suicide
if (vmpchr && vmpindex >= 0) {
vmpchr->numdeaths++;
vmpchr->killcounts[vmpindex]++;
}
if (vplayernum < PLAYERCOUNT()) {
prevplayernum = g_Vars.currentplayernum;
setCurrentPlayerNum(vplayernum);
currentPlayerRecordSuicide();
setCurrentPlayerNum(prevplayernum);
}
} else {
// Normal kill
if (vplayernum >= 0) {
if (vmpchr) {
vmpchr->numdeaths++;
}
if (vplayernum < PLAYERCOUNT()) {
// Victim was a player
prevplayernum = g_Vars.currentplayernum;
setCurrentPlayerNum(vplayernum);
if (g_Vars.normmplayerisrunning && aplayernum >= 0) {
// "Killed by %s"
sprintf(text, "%s %s", langGet(L_MISC(183)), var800ac500[aplayernum]->name);
hudmsgCreateViaPreset(text, HUDMSGTYPE_DEFAULT);
}
currentPlayerIncrementDeathCount();
setCurrentPlayerNum(prevplayernum);
}
}
if (ampchr && vmpindex >= 0) {
ampchr->killcounts[vmpindex]++;
}
if (aplayernum >= 0 && aplayernum < PLAYERCOUNT()) {
// Attacker was a player
prevplayernum = g_Vars.currentplayernum;
setCurrentPlayerNum(aplayernum);
if (g_Vars.normmplayerisrunning && vplayernum >= 0) {
// "Killed %s"
sprintf(text, "%s %s", langGet(L_MISC(184)), var800ac500[vplayernum]->name);
hudmsgCreateViaPreset(text, HUDMSGTYPE_DEFAULT);
}
mpstatsRecordKill();
setCurrentPlayerNum(prevplayernum);
}
// If someone killed an aibot
if (g_Vars.normmplayerisrunning
&& aplayernum >= 0
&& vplayernum >= PLAYERCOUNT()
&& aplayernum != vplayernum) {
g_MpPlayerChrs[vplayernum]->aibot->lastkilledbyplayernum = aplayernum;
}
}
if (g_Vars.normmplayerisrunning && aplayernum >= 0 && g_MpPlayerChrs[aplayernum]->aibot) {
s32 thing = func0f1982d4(g_MpPlayerChrs[aplayernum]->aibot->weaponnum);
if (thing >= 0) {
if (aplayernum == vplayernum) {
g_MpPlayerChrs[aplayernum]->aibot->unk244[thing][g_MpPlayerChrs[aplayernum]->aibot->gunfunc]++;
} else {
g_MpPlayerChrs[aplayernum]->aibot->unk214[thing][g_MpPlayerChrs[aplayernum]->aibot->gunfunc]++;
}
}
}
g_Vars.unk000488++;
}
const u32 var7f1acdcc[] = {0x00000000};
struct weapon *weaponFindById(s32 itemid)
{
if (itemid < 0) {

View File

@ -23,7 +23,7 @@
#include "game/game_096ca0.h"
#include "game/game_097ba0.h"
#include "game/game_0abe70.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b2150.h"
#include "game/game_0b3350.h"
#include "game/game_0b63b0.h"

View File

@ -23,7 +23,7 @@
#include "game/game_096ca0.h"
#include "game/game_097ba0.h"
#include "game/game_0abe70.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b2150.h"
#include "game/game_0b3350.h"
#include "game/game_0b69d0.h"
@ -56,6 +56,7 @@
#include "game/pdoptions.h"
#include "game/propobj.h"
#include "game/splat.h"
#include "game/mpstats.h"
#include "gvars/gvars.h"
#include "lib/lib_04320.h"
#include "lib/lib_04840.h"

View File

@ -9,7 +9,7 @@
#include "game/data/data_020df0.h"
#include "game/data/data_02da90.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b2150.h"
#include "game/game_0b3350.h"
#include "game/game_0d4690.h"

View File

@ -9,7 +9,7 @@
#include "game/data/data_020df0.h"
#include "game/data/data_02da90.h"
#include "game/game_092610.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b69d0.h"
#include "game/game_0d4690.h"
#include "game/game_0dcdb0.h"

View File

@ -16,7 +16,7 @@
#include "game/game_01bea0.h"
#include "game/game_095320.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b3350.h"
#include "game/game_0b69d0.h"
#include "game/game_0f09f0.h"

View File

@ -14,7 +14,7 @@
#include "game/game_092610.h"
#include "game/game_096750.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b69d0.h"
#include "game/game_127910.h"
#include "game/game_157db0.h"

View File

@ -11,7 +11,7 @@
#include "game/debug.h"
#include "game/chr/chr.h"
#include "game/ceil.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_127910.h"
#include "game/mplayer/setup.h"
#include "game/game_190260.h"

View File

@ -12,7 +12,7 @@
#include "game/chr/chr.h"
#include "game/game_092610.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_127910.h"
#include "game/game_1999b0.h"
#include "game/pad.h"

View File

@ -11,7 +11,7 @@
#include "game/data/data_02e820.h"
#include "game/ceil.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b3350.h"
#include "game/game_0e0770.h"
#include "game/game_0f09f0.h"

View File

@ -9,7 +9,7 @@
#include "game/data/data_020df0.h"
#include "game/data/data_02da90.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/inventory/inventory.h"
#include "game/training/training.h"
#include "game/lang.h"

View File

@ -10,7 +10,7 @@
#include "game/data/data_02da90.h"
#include "game/game_005fd0.h"
#include "game/title.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b3350.h"
#include "game/game_0d4690.h"
#include "game/game_0f09f0.h"

View File

@ -12,7 +12,7 @@
#include "game/title.h"
#include "game/game_01b0a0.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b69d0.h"
#include "game/game_0d4690.h"
#include "game/game_0f09f0.h"
@ -22,6 +22,7 @@
#include "game/music.h"
#include "game/mplayer/setup.h"
#include "game/mplayer/scenarios.h"
#include "game/mpstats.h"
#include "game/game_19aa80.h"
#include "game/lang.h"
#include "game/mplayer/mplayer.h"
@ -3167,10 +3168,10 @@ glabel var7f1b8db0
/* f18a6dc: 00002025 */ or $a0,$zero,$zero
/* f18a6e0: af001974 */ sw $zero,0x1974($t8)
/* f18a6e4: 8c590284 */ lw $t9,0x284($v0)
/* f18a6e8: 0fc2c14b */ jal currentPlayerGetShotCount
/* f18a6e8: 0fc2c14b */ jal mpstatsGetPlayerShotCountByRegion
/* f18a6ec: af201978 */ sw $zero,0x1978($t9)
/* f18a6f0: ae620000 */ sw $v0,0x0($s3)
/* f18a6f4: 0fc2c14b */ jal currentPlayerGetShotCount
/* f18a6f4: 0fc2c14b */ jal mpstatsGetPlayerShotCountByRegion
/* f18a6f8: 24040001 */ addiu $a0,$zero,0x1
/* f18a6fc: ae620004 */ sw $v0,0x4($s3)
/* f18a700: ae600008 */ sw $zero,0x8($s3)
@ -3265,22 +3266,22 @@ glabel var7f1b8db0
/* f18a84c: ae6e0034 */ sw $t6,0x34($s3)
/* f18a850: e6680028 */ swc1 $f8,0x28($s3)
/* f18a854: 46049183 */ div.s $f6,$f18,$f4
/* f18a858: 0fc2c14b */ jal currentPlayerGetShotCount
/* f18a858: 0fc2c14b */ jal mpstatsGetPlayerShotCountByRegion
/* f18a85c: e6660024 */ swc1 $f6,0x24($s3)
/* f18a860: 00409025 */ or $s2,$v0,$zero
/* f18a864: 0fc2c14b */ jal currentPlayerGetShotCount
/* f18a864: 0fc2c14b */ jal mpstatsGetPlayerShotCountByRegion
/* f18a868: 24040004 */ addiu $a0,$zero,0x4
/* f18a86c: afa20064 */ sw $v0,0x64($sp)
/* f18a870: 0fc2c14b */ jal currentPlayerGetShotCount
/* f18a870: 0fc2c14b */ jal mpstatsGetPlayerShotCountByRegion
/* f18a874: 24040003 */ addiu $a0,$zero,0x3
/* f18a878: afa20068 */ sw $v0,0x68($sp)
/* f18a87c: 0fc2c14b */ jal currentPlayerGetShotCount
/* f18a87c: 0fc2c14b */ jal mpstatsGetPlayerShotCountByRegion
/* f18a880: 24040002 */ addiu $a0,$zero,0x2
/* f18a884: afa2006c */ sw $v0,0x6c($sp)
/* f18a888: 0fc2c14b */ jal currentPlayerGetShotCount
/* f18a888: 0fc2c14b */ jal mpstatsGetPlayerShotCountByRegion
/* f18a88c: 24040001 */ addiu $a0,$zero,0x1
/* f18a890: 00408825 */ or $s1,$v0,$zero
/* f18a894: 0fc2c14b */ jal currentPlayerGetShotCount
/* f18a894: 0fc2c14b */ jal mpstatsGetPlayerShotCountByRegion
/* f18a898: 24040006 */ addiu $a0,$zero,0x6
/* f18a89c: 8e630000 */ lw $v1,0x0($s3)
/* f18a8a0: 3c013f80 */ lui $at,0x3f80

351
src/game/mpstats.c Normal file
View File

@ -0,0 +1,351 @@
#include <ultra64.h>
#include "constants.h"
#include "game/cheats.h"
#include "game/data/data_000000.h"
#include "game/data/data_0083d0.h"
#include "game/data/data_00e460.h"
#include "game/data/data_0160b0.h"
#include "game/data/data_01a3a0.h"
#include "game/data/data_020df0.h"
#include "game/data/data_02da90.h"
#include "game/inventory/items.h"
#include "game/game_097ba0.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b69d0.h"
#include "game/game_0dcdb0.h"
#include "game/game_127910.h"
#include "game/mplayer/setup.h"
#include "game/game_197600.h"
#include "game/lang.h"
#include "game/mplayer/mplayer.h"
#include "game/pdoptions.h"
#include "gvars/gvars.h"
#include "lib/lib_13130.h"
#include "types.h"
void mpstatsIncrementPlayerShotCount(struct hand *hand, s32 region)
{
if (!weaponHasFlag(hand->weaponnum, WEAPONFLAG_00100000)) {
g_Vars.currentplayerstats->shotcount[region]++;
}
}
void mpstatsIncrementPlayerShotCount2(struct hand *hand, s32 region)
{
if (region == 0) {
if (!weaponHasFlag(hand->weaponnum, WEAPONFLAG_00100000)) {
var80070590 = 1;
g_Vars.currentplayerstats->shotcount[region]++;
}
} else {
if (var80070590) {
if (!weaponHasFlag(hand->weaponnum, WEAPONFLAG_00100000)) {
g_Vars.currentplayerstats->shotcount[region]++;
}
var80070590 = 0;
}
}
}
void mpstats0f0b0520(void)
{
var80070590 = 0;
}
s32 mpstatsGetPlayerShotCountByRegion(u32 type)
{
return g_Vars.currentplayerstats->shotcount[type];
}
void mpstatsIncrementTotalKillCount(void)
{
g_Vars.killcount++;
}
void mpstatsIncrementTotalKnockoutCount(void)
{
g_Vars.knockoutcount++;
}
void mpstatsDecrementTotalKnockoutCount(void)
{
g_Vars.knockoutcount--;
}
u8 mpstatsGetTotalKnockoutCount(void)
{
return g_Vars.knockoutcount;
}
u32 mpstatsGetTotalKillCount(void)
{
return g_Vars.killcount;
}
void mpstatsRecordPlayerKill(void)
{
char text[256];
s32 simulkills;
s32 duration;
s32 time;
g_Vars.currentplayerstats->killcount++;
g_Vars.currentplayer->killsthislife++;
if (g_Vars.normmplayerisrunning) {
time = getMissionTime();
// Show HUD message
// "Kill count: %d"
sprintf(text, "%s: %d\n", langGet(L_GUN(1)), g_Vars.currentplayerstats->killcount);
hudmsgCreateViaPreset(text, HUDMSGTYPE_DEFAULT);
// Update slowest/fastest two kills
if (g_Vars.currentplayerstats->killcount > 1) {
duration = time - g_Vars.currentplayer->lastkilltime60;
if (duration > g_Vars.currentplayerstats->slowest2kills) {
g_Vars.currentplayerstats->slowest2kills = duration;
}
if (duration < g_Vars.currentplayerstats->fastest2kills) {
g_Vars.currentplayerstats->fastest2kills = duration;
}
}
// Update max simultaneous kills
simulkills = 1;
g_Vars.currentplayer->lastkilltime60_4 = g_Vars.currentplayer->lastkilltime60_3;
g_Vars.currentplayer->lastkilltime60_3 = g_Vars.currentplayer->lastkilltime60_2;
g_Vars.currentplayer->lastkilltime60_2 = g_Vars.currentplayer->lastkilltime60;
g_Vars.currentplayer->lastkilltime60 = time;
if (g_Vars.currentplayer->lastkilltime60_2 != -1 && g_Vars.currentplayer->lastkilltime60 - g_Vars.currentplayer->lastkilltime60_2 < 120) {
simulkills++;
if (g_Vars.currentplayer->lastkilltime60_3 != -1 && g_Vars.currentplayer->lastkilltime60 - g_Vars.currentplayer->lastkilltime60_3 < 120) {
simulkills++;
if (g_Vars.currentplayer->lastkilltime60_4 != -1 && g_Vars.currentplayer->lastkilltime60 - g_Vars.currentplayer->lastkilltime60_4 < 120) {
simulkills++;
}
}
}
if (simulkills > g_Vars.currentplayerstats->maxsimulkills) {
g_Vars.currentplayerstats->maxsimulkills = simulkills;
}
}
}
s32 mpstatsGetPlayerKillCount(void)
{
return g_Vars.currentplayerstats->killcount;
}
void mpstatsIncrementPlayerGgKillCount(void)
{
g_Vars.currentplayerstats->ggkillcount++;
}
void mpstatsRecordPlayerDeath(void)
{
char buffer[256];
g_Vars.currentplayer->deathcount++;
if (g_Vars.normmplayerisrunning) {
if (g_Vars.currentplayer->deathcount == 1) {
sprintf(buffer, langGet(L_GUN(2))); // "Died once"
} else {
sprintf(buffer, "%s %d %s\n",
langGet(L_GUN(3)), // "Died"
g_Vars.currentplayer->deathcount,
langGet(L_GUN(4))); // "times"
}
hudmsgCreateViaPreset(buffer, HUDMSGTYPE_DEFAULT);
}
}
void mpstatsRecordPlayerSuicide(void)
{
char text[256];
s32 simulkills;
s32 duration;
s32 time;
s32 mpindex;
struct mpchr *mpchr;
if (g_Vars.normmplayerisrunning) {
time = getMissionTime();
mpindex = g_Vars.currentplayerstats->mpindex;
if (mpindex < 4) {
mpchr = &g_MpPlayers[mpindex].base;
} else {
mpchr = &g_MpSimulants[mpindex - 4].base;
}
// Show HUD message
// "Suicide count: %d"
sprintf(text, "%s: %d\n", langGet(L_GUN(5)), mpchr->killcounts[mpindex]);
hudmsgCreateViaPreset(text, HUDMSGTYPE_DEFAULT);
// Update slowest/fastest two kills
if (g_Vars.currentplayerstats->killcount > 1) {
duration = time - g_Vars.currentplayer->lastkilltime60;
if (duration > g_Vars.currentplayerstats->slowest2kills) {
g_Vars.currentplayerstats->slowest2kills = duration;
}
if (duration < g_Vars.currentplayerstats->fastest2kills) {
g_Vars.currentplayerstats->fastest2kills = duration;
}
}
// Update max simultaneous kills
simulkills = 1;
g_Vars.currentplayer->lastkilltime60_4 = g_Vars.currentplayer->lastkilltime60_3;
g_Vars.currentplayer->lastkilltime60_3 = g_Vars.currentplayer->lastkilltime60_2;
g_Vars.currentplayer->lastkilltime60_2 = g_Vars.currentplayer->lastkilltime60;
g_Vars.currentplayer->lastkilltime60 = time;
if (g_Vars.currentplayer->lastkilltime60_2 != -1 && g_Vars.currentplayer->lastkilltime60 - g_Vars.currentplayer->lastkilltime60_2 < 120) {
simulkills++;
if (g_Vars.currentplayer->lastkilltime60_3 != -1 && g_Vars.currentplayer->lastkilltime60 - g_Vars.currentplayer->lastkilltime60_3 < 120) {
simulkills++;
if (g_Vars.currentplayer->lastkilltime60_4 != -1 && g_Vars.currentplayer->lastkilltime60 - g_Vars.currentplayer->lastkilltime60_4 < 120) {
simulkills++;
}
}
}
if (simulkills > g_Vars.currentplayerstats->maxsimulkills) {
g_Vars.currentplayerstats->maxsimulkills = simulkills;
}
}
}
void mpstatsRecordDeath(s32 aplayernum, s32 vplayernum)
{
s32 vmpindex = -1;
struct mpchr *vmpchr = NULL;
s32 ampindex;
struct mpchr *ampchr = NULL;
s32 prevplayernum;
char text[256];
if (g_Vars.normmplayerisrunning && g_MpSetup.scenario == MPSCENARIO_POPACAP) {
func0f1847b8();
}
// Find attacker and victim mpchrs
if (aplayernum >= 0) {
ampindex = func0f18d074(aplayernum);
if (ampindex >= 0) {
if (ampindex < 4) {
ampchr = &g_MpPlayers[ampindex].base;
} else {
ampchr = &g_MpSimulants[ampindex - 4].base;
}
}
}
if (vplayernum >= 0) {
vmpindex = func0f18d074(vplayernum);
if (vmpindex >= 0) {
if (vmpindex < 4) {
vmpchr = &g_MpPlayers[vmpindex].base;
} else {
vmpchr = &g_MpSimulants[vmpindex - 4].base;
}
}
}
if (vplayernum >= 0 && aplayernum == vplayernum) {
// Player suicide
if (vmpchr && vmpindex >= 0) {
vmpchr->numdeaths++;
vmpchr->killcounts[vmpindex]++;
}
if (vplayernum < PLAYERCOUNT()) {
prevplayernum = g_Vars.currentplayernum;
setCurrentPlayerNum(vplayernum);
mpstatsRecordPlayerSuicide();
setCurrentPlayerNum(prevplayernum);
}
} else {
// Normal kill
if (vplayernum >= 0) {
if (vmpchr) {
vmpchr->numdeaths++;
}
if (vplayernum < PLAYERCOUNT()) {
// Victim was a player
prevplayernum = g_Vars.currentplayernum;
setCurrentPlayerNum(vplayernum);
if (g_Vars.normmplayerisrunning && aplayernum >= 0) {
// "Killed by %s"
sprintf(text, "%s %s", langGet(L_MISC(183)), var800ac500[aplayernum]->name);
hudmsgCreateViaPreset(text, HUDMSGTYPE_DEFAULT);
}
mpstatsRecordPlayerDeath();
setCurrentPlayerNum(prevplayernum);
}
}
if (ampchr && vmpindex >= 0) {
ampchr->killcounts[vmpindex]++;
}
if (aplayernum >= 0 && aplayernum < PLAYERCOUNT()) {
// Attacker was a player
prevplayernum = g_Vars.currentplayernum;
setCurrentPlayerNum(aplayernum);
if (g_Vars.normmplayerisrunning && vplayernum >= 0) {
// "Killed %s"
sprintf(text, "%s %s", langGet(L_MISC(184)), var800ac500[vplayernum]->name);
hudmsgCreateViaPreset(text, HUDMSGTYPE_DEFAULT);
}
mpstatsRecordPlayerKill();
setCurrentPlayerNum(prevplayernum);
}
// If someone killed an aibot
if (g_Vars.normmplayerisrunning
&& aplayernum >= 0
&& vplayernum >= PLAYERCOUNT()
&& aplayernum != vplayernum) {
g_MpPlayerChrs[vplayernum]->aibot->lastkilledbyplayernum = aplayernum;
}
}
if (g_Vars.normmplayerisrunning && aplayernum >= 0 && g_MpPlayerChrs[aplayernum]->aibot) {
s32 thing = func0f1982d4(g_MpPlayerChrs[aplayernum]->aibot->weaponnum);
if (thing >= 0) {
if (aplayernum == vplayernum) {
g_MpPlayerChrs[aplayernum]->aibot->unk244[thing][g_MpPlayerChrs[aplayernum]->aibot->gunfunc]++;
} else {
g_MpPlayerChrs[aplayernum]->aibot->unk214[thing][g_MpPlayerChrs[aplayernum]->aibot->gunfunc]++;
}
}
}
g_Vars.unk000488++;
}

View File

@ -31,7 +31,7 @@
#include "game/ceil.h"
#include "game/game_097ba0.h"
#include "game/game_0abe70.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b28d0.h"
#include "game/game_0b3350.h"
#include "game/game_0b69d0.h"
@ -54,6 +54,7 @@
#include "game/core.h"
#include "game/mplayer/setup.h"
#include "game/mplayer/scenarios.h"
#include "game/mpstats.h"
#include "game/game_190260.h"
#include "game/game_1999b0.h"
#include "game/training/training.h"
@ -17863,7 +17864,7 @@ glabel var7f1aa438
/* f075d40: 0fc4a24b */ jal setCurrentPlayerNum
/* f075d44: 00402025 */ or $a0,$v0,$zero
/* f075d48: 8fa40070 */ lw $a0,0x70($sp)
/* f075d4c: 0fc2c108 */ jal func0f0b0420
/* f075d4c: 0fc2c108 */ jal mpstatsIncrementPlayerShotCount
/* f075d50: 00002825 */ or $a1,$zero,$zero
/* f075d54: 3c058007 */ lui $a1,%hi(var80069930)
/* f075d58: 8ca59930 */ lw $a1,%lo(var80069930)($a1)
@ -17880,7 +17881,7 @@ glabel var7f1aa438
/* f075d84: 1040004c */ beqz $v0,.L0f075eb8
/* f075d88: 8fa70070 */ lw $a3,0x70($sp)
/* f075d8c: 00e02025 */ or $a0,$a3,$zero
/* f075d90: 0fc2c108 */ jal func0f0b0420
/* f075d90: 0fc2c108 */ jal mpstatsIncrementPlayerShotCount
/* f075d94: 24050006 */ addiu $a1,$zero,0x6
/* f075d98: 10000047 */ b .L0f075eb8
/* f075d9c: 00000000 */ nop
@ -17941,27 +17942,27 @@ glabel var7f1aa438
/* f075e68: 10000011 */ b .L0f075eb0
/* f075e6c: 00e02025 */ or $a0,$a3,$zero
.L0f075e70:
/* f075e70: 0fc2c108 */ jal func0f0b0420
/* f075e70: 0fc2c108 */ jal mpstatsIncrementPlayerShotCount
/* f075e74: 00e02025 */ or $a0,$a3,$zero
/* f075e78: 1000000f */ b .L0f075eb8
/* f075e7c: 00000000 */ nop
.L0f075e80:
/* f075e80: 0fc2c108 */ jal func0f0b0420
/* f075e80: 0fc2c108 */ jal mpstatsIncrementPlayerShotCount
/* f075e84: 24050004 */ addiu $a1,$zero,0x4
/* f075e88: 1000000b */ b .L0f075eb8
/* f075e8c: 00000000 */ nop
.L0f075e90:
/* f075e90: 0fc2c108 */ jal func0f0b0420
/* f075e90: 0fc2c108 */ jal mpstatsIncrementPlayerShotCount
/* f075e94: 24050005 */ addiu $a1,$zero,0x5
/* f075e98: 10000007 */ b .L0f075eb8
/* f075e9c: 00000000 */ nop
.L0f075ea0:
/* f075ea0: 0fc2c108 */ jal func0f0b0420
/* f075ea0: 0fc2c108 */ jal mpstatsIncrementPlayerShotCount
/* f075ea4: 24050002 */ addiu $a1,$zero,0x2
/* f075ea8: 10000003 */ b .L0f075eb8
/* f075eac: 00000000 */ nop
.L0f075eb0:
/* f075eb0: 0fc2c108 */ jal func0f0b0420
/* f075eb0: 0fc2c108 */ jal mpstatsIncrementPlayerShotCount
/* f075eb4: 24050003 */ addiu $a1,$zero,0x3
.L0f075eb8:
/* f075eb8: 0fc4a24b */ jal setCurrentPlayerNum
@ -36408,7 +36409,7 @@ glabel func0f085eac
/* f086238: 8fa40048 */ lw $a0,0x48($sp)
/* f08623c: 53200004 */ beqzl $t9,.L0f086250
/* f086240: 8faf00fc */ lw $t7,0xfc($sp)
/* f086244: 0fc2c11b */ jal func0f0b046c
/* f086244: 0fc2c11b */ jal mpstatsIncrementPlayerShotCount2
/* f086248: 24050006 */ addiu $a1,$zero,0x6
.L0f08624c:
/* f08624c: 8faf00fc */ lw $t7,0xfc($sp)

View File

@ -11,7 +11,7 @@
#include "game/data/data_02e820.h"
#include "game/ceil.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b3350.h"
#include "game/game_0e0770.h"
#include "game/game_0f09f0.h"

View File

@ -15,7 +15,7 @@
#include "game/game_095320.h"
#include "game/game_096750.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b69d0.h"
#include "game/game_0dcdb0.h"
#include "game/game_0f09f0.h"

View File

@ -9,7 +9,7 @@
#include "game/data/data_02da90.h"
#include "game/dlights.h"
#include "game/chr/chr.h"
#include "game/game_0b0420.h"
#include "game/game_0b0fd0.h"
#include "game/game_0b3350.h"
#include "game/game_127910.h"
#include "game/game_1668e0.h"

View File

@ -2846,13 +2846,13 @@
#define SCREENSPLIT_HORIZONTAL 0
#define SCREENSPLIT_VERTICAL 1
#define SHOTCOUNT_TOTAL 0
#define SHOTCOUNT_HEAD 1
#define SHOTCOUNT_BODY 2
#define SHOTCOUNT_LIMB 3
#define SHOTCOUNT_GUN 4
#define SHOTCOUNT_5 5 // hat?
#define SHOTCOUNT_OBJECT 6
#define SHOTREGION_TOTAL 0
#define SHOTREGION_HEAD 1
#define SHOTREGION_BODY 2
#define SHOTREGION_LIMB 3
#define SHOTREGION_GUN 4
#define SHOTREGION_5 5 // hat?
#define SHOTREGION_OBJECT 6
#define SIGHT_DEFAULT 0
#define SIGHT_CLASSIC 1

View File

@ -1,22 +1,8 @@
#ifndef IN_GAME_GAME_0B0420_H
#define IN_GAME_GAME_0B0420_H
#ifndef IN_GAME_GAME_0B0FD0_H
#define IN_GAME_GAME_0B0FD0_H
#include <ultra64.h>
#include "types.h"
void func0f0b0420(struct hand *hand, s32 index);
void func0f0b046c(struct hand *hand, s32 index);
void func0f0b0520(void);
s32 currentPlayerGetShotCount(u32 type);
void incrementKillCount(void);
void incrementKnockoutCount(void);
void decrementKnockoutCount(void);
u8 getKnockoutCount(void);
u32 getKillCount(void);
void mpstatsRecordKill(void);
s32 currentPlayerGetNumKills(void);
void currentPlayerIncrementDeathCount(void);
void currentPlayerRecordSuicide(void);
void mpstatsRecordDeath(s32 aplayernum, s32 vplayernum);
struct weapon *weaponFindById(s32 itemid);
struct weaponfunc *weaponGetFunctionById(u32 weaponnum, u32 which);
struct weaponfunc *handGetWeaponFunction2(struct hand *hand);

View File

@ -0,0 +1,21 @@
#ifndef IN_GAME_MPSTATS_H
#define IN_GAME_MPSTATS_H
#include <ultra64.h>
#include "types.h"
void mpstatsIncrementPlayerShotCount(struct hand *hand, s32 region);
void mpstatsIncrementPlayerShotCount2(struct hand *hand, s32 region);
void mpstats0f0b0520(void);
s32 mpstatsGetPlayerShotCountByRegion(u32 type);
void mpstatsIncrementTotalKillCount(void);
void mpstatsIncrementTotalKnockoutCount(void);
void mpstatsDecrementTotalKnockoutCount(void);
u8 mpstatsGetTotalKnockoutCount(void);
u32 mpstatsGetTotalKillCount(void);
void mpstatsRecordPlayerKill(void);
s32 mpstatsGetPlayerKillCount(void);
void mpstatsRecordPlayerDeath(void);
void mpstatsRecordPlayerSuicide(void);
void mpstatsRecordDeath(s32 aplayernum, s32 vplayernum);
#endif