diff options
| author | Sarge-117 <108380086+Sarge-117@users.noreply.github.com> | 2022-12-10 12:37:33 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-10 21:37:33 +0100 |
| commit | 8c23bcd67c8b98068f95d9c38f732f4805a42d9c (patch) | |
| tree | 0dceea495c557fbffb494b9f6c3af29790f568d5 /soh/src/code | |
| parent | 8021f29c3ed864de32c0270e628e02c8c8bcb83b (diff) | |
Gameplay stats 1.1 (#2129)
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_parameter.c | 18 | ||||
| -rw-r--r-- | soh/src/code/z_play.c | 4 |
2 files changed, 19 insertions, 3 deletions
diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 020422d61..9e6654f91 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1616,11 +1616,18 @@ void func_80084BF4(PlayState* play, u16 flag) { // Gameplay stat tracking: Update time the item was acquired // (special cases for some duplicate items) -void GameplayStats_SetTimestamp(u8 item) { +void GameplayStats_SetTimestamp(PlayState* play, u8 item) { - if (gSaveContext.sohStats.timestamp[item] != 0) { + // If we already have a timestamp for this item, do nothing + if (gSaveContext.sohStats.timestamp[item] != 0){ return; } + // Use ITEM_KEY_BOSS only for Ganon's boss key - not any other boss keys + if (play != NULL) { + if (item == ITEM_KEY_BOSS && play->sceneNum != 13 && play->sceneNum != 10) { + return; + } + } u32 time = GAMEPLAYSTAT_TOTAL_TIME; @@ -1658,6 +1665,11 @@ void Randomizer_GameplayStats_SetTimestamp(uint16_t item) { time = 1; } + // Use ITEM_KEY_BOSS to timestamp Ganon's boss key + if (item == RG_GANONS_CASTLE_BOSS_KEY) { + gSaveContext.sohStats.timestamp[ITEM_KEY_BOSS] = time; + } + // Count any bottled item as a bottle if (item >= RG_EMPTY_BOTTLE && item <= RG_BOTTLE_WITH_BIG_POE) { if (gSaveContext.sohStats.timestamp[ITEM_BOTTLE] == 0) { @@ -1698,7 +1710,7 @@ u8 Item_Give(PlayState* play, u8 item) { s16 temp; // Gameplay stats: Update the time the item was obtained - GameplayStats_SetTimestamp(item); + GameplayStats_SetTimestamp(play, item); slot = SLOT(item); if (item >= ITEM_STICKS_5) { diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index fe4ca7ca7..04f239ca8 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -1087,6 +1087,10 @@ void Play_Update(PlayState* play) { // Gameplay stat tracking if (!gSaveContext.sohStats.gameComplete) { gSaveContext.sohStats.playTimer++; + + if (CVar_GetS32("gMMBunnyHood", 0) && Player_GetMask(play) == PLAYER_MASK_BUNNY) { + gSaveContext.sohStats.count[COUNT_TIME_BUNNY_HOOD]++; + } } func_800AA178(1); |
