summaryrefslogtreecommitdiff
path: root/soh/src/code/z_parameter.c
diff options
context:
space:
mode:
authorRalphie Morell <stratomaster64@gmail.com>2023-04-03 00:06:55 -0400
committerGitHub <noreply@github.com>2023-04-03 00:06:55 -0400
commitff1d8a9e9d27de17b0718ef31f2ad6ac0fab3874 (patch)
treeb50e6743f7064369b6ba9032b819fc3f1d729cb9 /soh/src/code/z_parameter.c
parent0f40472c1abe188ad1ae90d99c835775542e406b (diff)
Enhancement: Room/Scene Timers (#2478)
* Groundwork on scene/room timers; naming changes * added to save manager; reworked storing timestamps * actually saved stuff to savemanager; accounted for null playstate * finally fixed the fucking timers * Added scene mapping * Added CVar for room/scene level; fixed some displays * reworked logic * increase name spec for scene timestamps * Actually save item timestamps when loading v3 save * Cleanup * fix merge artifact * apply suggestions
Diffstat (limited to 'soh/src/code/z_parameter.c')
-rw-r--r--soh/src/code/z_parameter.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c
index 488c9a320..f1a0eb36a 100644
--- a/soh/src/code/z_parameter.c
+++ b/soh/src/code/z_parameter.c
@@ -1625,7 +1625,7 @@ void func_80084BF4(PlayState* play, u16 flag) {
void GameplayStats_SetTimestamp(PlayState* play, u8 item) {
// If we already have a timestamp for this item, do nothing
- if (gSaveContext.sohStats.timestamp[item] != 0){
+ if (gSaveContext.sohStats.itemTimestamp[item] != 0){
return;
}
// Use ITEM_KEY_BOSS only for Ganon's boss key - not any other boss keys
@@ -1644,20 +1644,20 @@ void GameplayStats_SetTimestamp(PlayState* play, u8 item) {
// Count any bottled item as a bottle
if (item >= ITEM_BOTTLE && item <= ITEM_POE) {
- if (gSaveContext.sohStats.timestamp[ITEM_BOTTLE] == 0) {
- gSaveContext.sohStats.timestamp[ITEM_BOTTLE] = time;
+ if (gSaveContext.sohStats.itemTimestamp[ITEM_BOTTLE] == 0) {
+ gSaveContext.sohStats.itemTimestamp[ITEM_BOTTLE] = time;
}
return;
}
// Count any bombchu pack as bombchus
if (item == ITEM_BOMBCHU || (item >= ITEM_BOMBCHUS_5 && item <= ITEM_BOMBCHUS_20)) {
- if (gSaveContext.sohStats.timestamp[ITEM_BOMBCHU] == 0) {
- gSaveContext.sohStats.timestamp[ITEM_BOMBCHU] = time;
+ if (gSaveContext.sohStats.itemTimestamp[ITEM_BOMBCHU] == 0) {
+ gSaveContext.sohStats.itemTimestamp[ITEM_BOMBCHU] = time;
}
return;
}
- gSaveContext.sohStats.timestamp[item] = time;
+ gSaveContext.sohStats.itemTimestamp[item] = time;
}
// Gameplay stat tracking: Update time the item was acquired
@@ -1673,28 +1673,28 @@ void Randomizer_GameplayStats_SetTimestamp(uint16_t item) {
// Use ITEM_KEY_BOSS to timestamp Ganon's boss key
if (item == RG_GANONS_CASTLE_BOSS_KEY) {
- gSaveContext.sohStats.timestamp[ITEM_KEY_BOSS] = time;
+ gSaveContext.sohStats.itemTimestamp[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) {
- gSaveContext.sohStats.timestamp[ITEM_BOTTLE] = time;
+ if (gSaveContext.sohStats.itemTimestamp[ITEM_BOTTLE] == 0) {
+ gSaveContext.sohStats.itemTimestamp[ITEM_BOTTLE] = time;
}
return;
}
// Count any bombchu pack as bombchus
if (item >= RG_BOMBCHU_5 && item <= RG_BOMBCHU_DROP) {
- if (gSaveContext.sohStats.timestamp[ITEM_BOMBCHU] = 0) {
- gSaveContext.sohStats.timestamp[ITEM_BOMBCHU] = time;
+ if (gSaveContext.sohStats.itemTimestamp[ITEM_BOMBCHU] = 0) {
+ gSaveContext.sohStats.itemTimestamp[ITEM_BOMBCHU] = time;
}
return;
}
if (item == RG_MAGIC_SINGLE) {
- gSaveContext.sohStats.timestamp[ITEM_SINGLE_MAGIC] = time;
+ gSaveContext.sohStats.itemTimestamp[ITEM_SINGLE_MAGIC] = time;
}
if (item == RG_DOUBLE_DEFENSE) {
- gSaveContext.sohStats.timestamp[ITEM_DOUBLE_DEFENSE] = time;
+ gSaveContext.sohStats.itemTimestamp[ITEM_DOUBLE_DEFENSE] = time;
}
}
@@ -2525,7 +2525,7 @@ u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) {
if (item == RG_GREG_RUPEE) {
Rupees_ChangeBy(1);
Flags_SetRandomizerInf(RAND_INF_GREG_FOUND);
- gSaveContext.sohStats.timestamp[TIMESTAMP_FOUND_GREG] = GAMEPLAYSTAT_TOTAL_TIME;
+ gSaveContext.sohStats.itemTimestamp[TIMESTAMP_FOUND_GREG] = GAMEPLAYSTAT_TOTAL_TIME;
return Return_Item_Entry(giEntry, RG_NONE);
}