mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-13 01:57:18 -07:00
Gameplay stats 1.1 (#2129)
This commit is contained in:
parent
8021f29c3e
commit
8c23bcd67c
6 changed files with 39 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue